text
stringlengths 28
935k
| meta
stringlengths 137
139
| red_pajama_subset
stringclasses 1
value |
---|---|---|
\section{Limitations \& Future Work}
While our proposed pre-training method demonstrates superior performance compared with the state-of-the-art methods, there still exist several limitations. Since our approach relies on 3D geometric consistency to guide the learning of image representations, it can hardly be applied directly on the datasets such as ImageNet\cite{deng2009imagenet}, where 3D reconstructions are not applicable. Besides, in this work, we use a simple 3D clustering method for computing geometric consistency sets; one may consider using more advanced clustering techniques to further improve the performance.
\section{Conclusion}
We propose a method that uses 3D geometric consistency as guidance for self-supervised image representation learning. We leverage the continuities and discontinuities of 3D data and use the 3D clustering results to produce geometric consistency sets for
2D image views. Then we incorporate the geometric consistency sets into a contrastive learning framework to make the learned 2D image representations aware of 3D geometric consistency. We show that the image representations learned in this way will lead to superior performance than state-of-the-arts after fine-tuning for downstream tasks. Moreover, our approach can also improve the performance of downstream tasks when fine-tuning with limited training data. Various ablation studies further verify the effectiveness of our method.
\section{Experimental Setup}
In this section, we will provide a detailed description of our experimental setup, including the backbone architectures, datasets for pre-training and evaluation, and the implementation details. More experiment details are given in the supplementary materials.
\subsection{Backbone Architecture}
We use a UNet-style\cite{ronneberger2015u} architecture with residual connections as our network backbone since it has been widely used in various deep learning tasks. Specifically, it uses ResNet\cite{he2016deep} as encoder, and the decoder part contains standard convolution blocks together with bi-linear interpolation layers for upsampling. In most of our experiments, we use ResNet50 as our encoder for its efficiency and effectiveness. In addition, we also use ResNet18 as the encoder to see the effectiveness of our method with a more lightweight architecture.
\subsection{Dataset}
We conduct our experiments on two widely used datasets ScanNet\cite{dai2017scannet} and NYUv2 \cite{silberman2012indoor}, where ScanNet is used for both pre-training and downstream task fine-tuning, and NYUv2 is used for demonstrating the transferability of the representations learned with our method on ScanNet. In the following, we give more details about the two datasets.
\paragraph{ScanNet}
ScanNet\cite{dai2017scannet} contains large amount of RGB-D sequences together with the corresponding 3D scene reconstructions. It has 1513 scenes for training, which contains around 2.5M images in total. Following Pri3D \cite{hou2021pri3d}, we regularly sample every 25th frame from the original ScanNet sequence for pre-training. And the frame pairs with more than 30$\%$ pixel overlap will be used for contrastive training. Totally, we have around 804k frame pairs in the pre-training stage. Note that we do not use any semantic labels for pre-training. For fine-tuning on downstream tasks, we use the standard labeled training and validation set of ScanNet benchmark\cite{dai2017scannet}, and the 2D images are sampled every 100th frame from the original sequence. Thus, in the fine-tuning stage, we have around 20k images for training and 5k images for validation.
\paragraph{NYUv2} NYUv2\cite{silberman2012indoor} is a dataset consisting of 2D images scanned from various indoor scenes, and in this paper, it is used for fine-tuning downstream tasks. Totally it has 1449 labeled images, in which 795 images are used for training and 654 images for testing.
\subsection{Comparison Methods}
\paragraph{Supervised ImageNet Pre-training \cite{deng2009imagenet}} The network is pre-trained with the supervised classification task on the ImageNet dataset.
\paragraph{MoCoV2 \cite{chen2020improved}} For MoCoV2, there are various strategies for feeding the data, we only list the best performing result (i.e. MoCoV2-supIN $\rightarrow $ SN) from Pri3D \cite{hou2021pri3d}. To be specific, MoCoV2 is initialized with supervised ImageNet pre-training and then trained on ScanNet with randomly shuffled images.
\paragraph{Pri3D \cite{hou2021pri3d}} Pri3D is the method most related to ours, in which 3D data and contrastive pre-training are used. Specifically, it comprises 2D to 2D and 2D to 3D point InfoNCE loss, termed View and Geo loss, respectively, and is also initialized with supervised ImageNet pre-training.
\paragraph{Depth Prediction} The network is pre-trained with a single view depth prediction task, and is also initialized with supervised ImageNet pre-training. We obtain the results directly from Pri3D \cite{hou2021pri3d} where the method is implemented as a baseline.
\begin{figure*}
\centering
\begin{overpic}[width=0.98\textwidth]{figs/vis_semseg2d.pdf}{
\put(26.5,56) {\textbf{ScanNet}}
\put(73.7,56){ \textbf{NYUv2}}
\put(1.7,50){\small {Input}}
\put(-2.2,39){\small {ImageNet}}
\put(1.2,28){\small {Pri3D}}
\put(2.2,17){\small {Ours}}
\put(3.2,4.5){\small {GT}}
}\end{overpic}
\vspace{-3mm}
\caption{\textbf{Qualitative results of semantic segmentation task on ScanNet and NYUv2 datasets.} All the methods are pre-trained on ScanNet with ResNet50 as the backbone. For Pri3d we reproduce the results with their released code.}
\label{fig:vis_semseg2d}
\end{figure*}
\subsection{Implementation Details}
We use the following setting in our experiments unless explicitly specified. For pre-training with our method, Stochastic gradient descent(SGD) \cite{robbins1951stochastic} with Polynomial Learning Rate Policy (PolyLR) \cite{shamir2013stochastic} is used for optimization. The initial learning rate is 0.1 and the batch size is 64. Following Pri3D\cite{hou2021pri3d}, we initialize the network with ImageNet pre-trained weights. In the first stage of pre-training, we train the network with View and Geo loss from Pri3D for 5 epochs. And then in the second stage, the network is trained with our proposed methods for 2 epochs. We use 8 NVIDIA V100 GPUs for training our network, and all the experiments are implemented with PyTorch.
\section{Introduction}
\begin{figure}
\centering
\begin{overpic}[width=0.49\textwidth]{figs/teaser.pdf}{
\put(18,92.5){\small \textbf{Pre-training with Geometric Set Consistency}}
\put(6,3){\footnotesize Object Detection}
\put(34,3){\footnotesize Instance Segmentation}
\put(66,2.5){\footnotesize Semantic Segmentation}
}\end{overpic}
\vspace{-5mm}
\caption{We introduce geometric consistency set to enforce the consistency within images for self-supervised image representation learning. We show that, the image representations pre-trained in this way can improve the performance of some 2D downstream tasks including semantic segmentation, object detection and instance segmentation.}
\label{fig:teaser}
\vspace{-5mm}
\end{figure}
Self-supervised image representation learning is an important problem in the field of computer vision and has been rapidly developed in recent years. Existing works in this area mainly focus on designing various pretext tasks to learn general and intrinsic image features in self-supervised manners \cite{oord2018representation,he2020momentum,hou2021pri3d}. Those pretext tasks are usually low-level and can capture general image properties that favor many downstream tasks, like image classification, semantic segmentation, object detection, instance segmentation, etc. Due to its ability to learn from a large amount of unlabeled data, self-supervised representation learning has already become a standard training regime in many real-world applications\cite{zhao2017pspnet,he2017mask,chen2017rethinking,chen2018encoder}.
Recently, researchers have started to use 3D data, usually represented by point clouds, meshes, or voxel grids, as guidance for learning image representations \cite{hou2021pri3d,liu2021contrastive}. Compared with 2D images, 3D data has complementary advantages for learning discriminative image features. Since 3D data is usually acquired by real-world scanning and reconstruction, and has the same dimension as the real-world scenes, learning geometric structures from 3D data is much easier than 2D images. Moreover, complex occlusions, as well as the texture of objects will also affect the performance of image perception methods.
Meanwhile, 3D data is occlusion-free, and geometric cues like smooth regions and sharp edges can be strong priors for semantic understanding. Thus it is natural to use 3D geometric cues to favor the learning of image representations.
Pioneering works, like Pri3D\cite{hou2021pri3d}, mainly rely on multi-view pixel-level consistency or 2D-3D pixel to point consistency for learning image representations in a self-supervised manner.
The image representations learned in this way are proven to have significantly better performance than learning purely from 2D images for downstream tasks. Despite these great successes, the geometric consistency priors in 3D data (i.e. smooth regions or depth gaps) are not directly employed, which we demonstrate are strong cues and can significantly enhance the learning of image semantics.
In this paper, we propose to use geometric consistency to promote the learning of image representations. Our intuition is that 3D points within the same smooth or even planar regions may share similar semantics, while the discontinuities or depth gaps in 3D space may imply semantic changes. Such geometric cues are directly observable in unlabeled 3D data. However, due to complex textures, these cues can be hardly learned from purely unlabeled 2D images. Based on the above intuition, we design a simple yet effective method to learn the geometric consistency priors described above. Specifically, we leverage the continuities and discontinuities of 3D data, and use the clustering method to cluster the 3D data into many local small segments, termed \textit{geometric consistency sets}, to guide the learning of image representations in a self-supervised contrastive way. Our method is simple and can be easily implemented. We show that by exploring geometric consistency in the self-supervised pre-training stage, the performance of downstream tasks can be significantly improved.
In the following, we summarize our main contributions:
1) We introduce geometric consistency into a contrastive learning framework for self-supervised image representation learning.
2) We propose a simple yet effective multi-view contrastive loss with geometric consistency sets to leverage the consistency within images.
3) We demonstrate superior performance on several downstream tasks compared with SOTA methods.
\section{Method}
Given a large collection of unlabeled images $\{I_{i}\}$ together with the corresponding 3D scenes $\{S_{i}\}$ represented as 3D points, the goal of our method is to pre-train an image encoder $f_{\theta}$ that can extract general and representative features from the input images with the guidance of geometric consistency in a self-supervised manner. And the pre-trained encoder $f_{\theta}$ can improve the performance of various downstream tasks after fine-tuning on relatively small labeled datasets. Note that 3D data is only used for pre-training and is not available in the fine-tuning stage.
Figure \ref{fig:pipeline} illustrates our overall framework. In order to learn the image representations given a set of multi-view unlabeled images together with the corresponding 3D data, our observation is that the consistency or inconsistency of the geometric features in 3D space can serve as strong prior that may imply consistent semantics or object boundaries. For example, points that lie in the same smooth or even planar region may share the same semantics, while those separated by geometry dis-continuities or depth gaps may infer semantic changes. Based on the above observation, we propose to incorporate \textit{geometric consistency sets}, for example clustering the 3D data with similar geometry features into local smooth segments, into a contrastive learning framework to leverage the geometric consistency in learning image representations, and adapt the InfoNCE loss accordingly. In the following, we will first describe the formulation of the \textit{set-InfoNCE loss} that generalizes the InfoNCE loss to enforce the consistency within image views. And then, we will provide the detailed implementation
of our proposed contrastive training framework under the guidance of geometric consistency set.
\subsection{Set-InfoNCE Loss}
\begin{figure}[ht]
\centering
\begin{overpic}[width=1.0\linewidth]{figs/pseudo_label.pdf}{
\put(3,55){\footnotesize \bf{Geometric Guidance}}
\put(58,55){\footnotesize \bf{2D Projection}}
\put(8, 28){\footnotesize 3D Geometry}
\put(1, 1.5){\footnotesize Geometric Consistency Set}
\put(46,1.5){\footnotesize Image $I_n$}
\put(46,28){\footnotesize Image $I_m$}
\put(62,1.5){\footnotesize Projected Geo-sets $\{P_i^n\}_i$}
\put(62,28){\footnotesize Projected Geo-sets $\{P_i^m\}_i$}
}\end{overpic}
\vspace{-5mm}
\caption{\textbf{Geometric consistency set.} We visualize the geometric consistency sets (with different colors) as well as the corresponding 2D projections on two corresponding image views. }
\label{fig:pseudo_label}
\end{figure}
2D contrastive image representation learning mainly aims at learning consistent representations by contrasting multi-view images on either image level or pixel level. The multi-view images can be acquired via different data augmentation strategies or from real-world scanned sequences. Contrastive learning then enforces the feature consistency between different views that correspond to the same content while pushing away the others. For the pixel level contrastive representation learning, current works use pixel-level InfoNCE loss\cite{hou2021pri3d}, which is defined as:
\begin{equation}\label{eq:pcontrast_loss}
\mathcal{L}_{pixel} = - \sum_{(i,j) \in M_p } log \frac{\exp(\mathbf{f}_i \cdot \mathbf{f}_j / \tau)}{\sum_{(\cdot, k) \in M_p}{\exp(\mathbf{f}_i \cdot \mathbf{f}_k / \tau)}}
\end{equation}
\noindent where $M_p$ denotes the set of pixel-to-pixel matching pairs from one view to another, $\mathbf{f}_i$ is the normalized feature vector of the pixel at the $i$th position, and $\tau$ is the temperature parameter for controlling the concentration of the features in the representation space.
Though the representations learned with pixel-level InfoNCE loss\cite{hou2021pri3d} has been proven to be beneficial for many downstream tasks, additional aggregated correspondences among the pixels like the geometric consistency prior could further improve the representation learning. In the following, we give the formulation of the set level InfoNCE loss that generalizes the pixel level InfoNCE to leverage such aggregated correspondences:
\begin{equation}\label{eq:set_contrast_loss}
\mathcal{L}_{set} = - \sum_{(i,j) \in M_s} log \frac{\exp(\mathcal{F}(P_i) \cdot \mathcal{F}(P_j) / \tau)}{\sum_{(\cdot,k)\in M_s}{\exp(\mathcal{F}(P_i) \cdot \mathcal{F}(P_k) / \tau)}} ,
\end{equation}
\noindent where $P_i$ is a set of feature points that are likely to have the same semantics, $\mathcal{F}$ is a mapping from a set to a feature vector in $\mathbb{R}^c$, and $M_s$ denotes the correspondence pairs among sets. Obviously Eqn.~\ref{eq:pcontrast_loss} is a special case to Eqn.~\ref{eq:set_contrast_loss} when the sets $P_i=\{\mathbf{f_i}\}$ degenerate to one-element only.
In our implementation, we set $\mathcal{F}(P_i) = \frac{1}{|P_i|}\sum_{s_j\in P_i} \mathbf{f_{s_j}}$ for aggregating the features from all the points within sets, and we will also discuss different variations of $\mathcal{F}$ in Section \ref{diff_set_choice}.
Note that the set level InfoNCE loss defined in Eqn. \ref{eq:set_contrast_loss} is general, and the strategies for acquiring the set $P_i$ might be different for different scenarios \cite{xiao2021region,liu2021bootstrapping,wang2020unsupervised}. In this paper, we define our geometric consistency set under the guidance of 3D geometry, and will give the detailed description in Section \ref{sec:method_geosetconsistency}.
\subsection{Learning with Geometric Set Consistency} \label{sec:method_geosetconsistency}
Intuitively, the geometric consistency can be a strong prior that can guide the learning of within image consistency.
The geometric cues like smooth regions and depth gaps may imply the same semantics or object boundaries respectively. In the following, we give the formal definition of the proposed set-InfoNCE loss with geometric consistency sets under projection.
Formally, for a given equivalence relation $\sim$ among the points in all the scenes $\cup S_i$, we call the quotient set $\{P_j\}=\cup S_i/\sim$ as the collection of \textit{geometric consistency sets}. For example, when we have some pre-defined geometric labels among the 3D points and define the equivalence relation as \textit{points that share the same label}, then the geometric consistency set $P_i$ would contain all the points that have the $i$th label. Besides, for each image $I_m$, we call $P_j^{m}=\{proj(s) \in I_m | s \in P_j\}$ as the $projection$ of $P_j$ from 3D onto 2D image view $I_m$. By adapting Eqn. \ref{eq:set_contrast_loss}, we could define our set-InfoNCE loss with geometric consistency set as:
\begin{equation}\label{eq:pseudo_loss}
\mathcal{L}_{geo\_set} = - \sum_{\mathclap{~(i,m,n) \in M_s~}} log \frac{\exp(\mathcal{F}(P^m_i) \cdot \mathcal{F}(P^n_i) / \tau)}{\sum_{(k, l, \cdot)\in M_s}{\exp(\mathcal{F}(P^m_i) \cdot \mathcal{F}(P^l_k) / \tau)}} ,
\end{equation}
\noindent where $i$ is the index of the geometric consistency set and $m,n$ are the view indices. $M_s = \{(i,m,n)\}$ maintains the matching pairs of projections $P_i^m, P_i^n$ from one view to another for each geometric consistency set $P_i$.
In general, any proper notion of spatial equivalence induces its corresponding geometric consistency sets; in this work, we use a simple 3D clustering method and find it already works well in our case.
We leave the exploration of more sophisticated spatial partitioning methods as future work.
Specifically, for a sequence of 2D images acquired by scanning around a specific scene, we first have the corresponding 3D surface $S$ via 3D reconstruction. To obtain geometric consistency sets, we use the surface over-segmentation results produced by a normal-based graph cut method \cite{felzenszwalb2004efficient,karpathy2013object}.
As shown in Figure \ref{fig:pseudo_label}, the 3D points that are likely to have the same semantics can be clustered into the same geometric consistency set.
\subsection{Training Strategy}
We use a two-stage training strategy to pre-train with our method. Besides our geometric guided set-InfoNCE loss that mainly considers set-level consistency and involves some high-level semantics such as smooth regions and surface discontinuities, we also include the pixel-level multi-view consistency to enforce the low-level distinction beneficial for the downstream tasks. Thus we propose to pre-train the network from low-level to high-level progressively with two stages. Specifically, in the first stage, we train the network with pixel to pixel and pixel to point multi-view contrastive loss termed as View and Geo loss in Pri3D\cite{hou2021pri3d}. And then, in the second stage, we continue to train the network with our geometric guided set-InfoNCE loss alone. In this way, we can achieve better performance on downstream tasks than training solely with our set-InfoNCE loss or with Pri3D losses.
\section{Related Works}
\begin{figure*}[ht]
\centering
\vspace{-5mm}
\begin{overpic}[width=0.95\linewidth]{figs/pipeline.pdf}{
\put(9,1.5){\small RGB Image}
\put(28.5,12.5){\small 2D Encoder}
\put(48,1.5){\small Feature Map}
\put(73,1.5){\small Geometric Consistency Set}
\put(79.5,21.3){\small 3D Geometry}
\put(17.5,39.6){ \textbf{Pre-training Stage for 2D Network}}
\put(74.7,39.6){\textbf{Geometric Guidance}}
}\end{overpic}
\vspace{-2mm}
\caption{\textbf{Pipeline of our pre-training method}. Given a collection of multi-view unlabeled images together with the corresponding 3D geometry, we propose to use geometric consistency sets (illustrated with different colors), acquired via 3D clustering, to guide the learning of image representations. Specifically, the multi-view feature maps extracted with a 2D encoder will be first aggregated according to the corresponding geometric consistency sets, and then set-level InfoNCE loss will be used on the aggregated features to leverage the consistency within images. }
\label{fig:pipeline}
\vspace{-5mm}
\end{figure*}
\subsection{Scene Understanding}
Learning based scene understanding tasks, including semantic scene segmentation \cite{qi2017pointnet,lin2020fpconv,liu20213d,hu2021bidirectional}, object detection \cite{hu2020jsenet,qi2020imvotenet,qi2019deep} and instance segmentation \cite{yi2019gspn,hou20193d,lahoud20193d}, are fundamental tasks in computer vision and have been rapidly developed in recent years. Due to the available of large scale, real scanned 2D and 3D datasets \cite{dai2017scannet,geiger2013vision,silberman2012indoor,armeni20163d}, these tasks have been widely explored.
View-based methods \cite{dai20183dmv, kundu2020virtual} mainly rely on 2D images for scene understanding tasks, and the results produced with 2D networks can be further fused to 3D space based on multi-view consistency. In recent years, with the development of 3D deep learning networks \cite{qi2017pointnet, wu2019pointconv, wang2017cnn,choy20194d, graham20183d}, the performance of scene understanding tasks has been further promoted. The architectures of 3D networks can be roughly classified into two categories including point-based \cite{qi2017pointnet,wu2019pointconv}, and sparse-voxel based \cite{wang2017cnn,choy20194d,graham20183d}. These architectures are mainly designed for extracting features from sparse and unordered 3D data and have achieved great success in 3D scene understanding. Besides, since 2D images have clearer textures while 3D data is occlusion free from which extracting structure information is much easier, it is also an important research topic to study the joint training of 2D and 3D data \cite{song2018learning,liu2020p4contrast,hou2021pri3d,liu2021contrastive} for scene understanding tasks.
In this paper, we propose to use 3D geometric consistency as guidance to promote the learning of 2D image representations and improve the performance of 2D scene understanding tasks.
\subsection{Self-Supervised Image Pre-training}
Self-supervised image pre-training as a fundamental way for learning representations from a large amount of data has shown significant impact in the field of computer vision and has been proved to be useful for various applications. Researchers in this field mainly aim at designing pretext tasks \cite{oord2018representation,larsson2017colorization,misra2020self,noroozi2016unsupervised} to learn intrinsic and general image representations that may favor various downstream tasks. Contrastive learning \cite{oord2018representation,he2020momentum,chen2020simple,chen2021exploring}, due to it's effectiveness and simplexity, has attracted great attention in recent years. The key idea of contrastive learning is to enforce the consistency between positive pairs while pushing away negative samples. Mainstream works mainly use various data augmentation strategies to get the positive pairs, including cropping, rotating, Gaussian blurring, etc. Besides, region-wise contrastive learning methods \cite{xiao2021region,liu2021bootstrapping} performance contrasting at region level to learn the region level similarities. Recently, researchers start to involve 3D data into contrastive pre-training \cite{hou2021pri3d,liu2020p4contrast,liu2021contrastive}, and the positive samples can be directly induced via multi-view consistency.
In our work, we also explore using 3D data to promote the learning of image representations. In addition to multi-view consistency, we further leverage geometric consistency to enhance the consistency within image views.
\subsection{Multimodal Representation Learning}
Multimodal representation learning aims at learning joint representations by interacting between the data from different modalities. By incorporating the advantages from different modalities, the representations learned in this way are usually much better than those learned with a single modality only. Vision language pre-training \cite{radford2021learning,lu2019vilbert,li2020oscar} is a successful example. The availability of a large amount of image and language pairs makes the learned representations generalizable to various downstream tasks. Recently, with the availability of large scale RGB-D datasets, learning representations jointly from 2D and 3D data has attracted great attention in the research community \cite{song2018learning,liu2020p4contrast,hou2021pri3d,liu2021contrastive}. In particular, Pri3D \cite{hou2021pri3d} proposed to use 3D data as guidance for learning 2D to 2D and 2D to 3D pixel-level consistency. P4Contrast \cite{liu2020p4contrast} proposes to use point-pixel pairs for contrastive learning, and constructs negative samples artificially based on disturbed RGB-D points. TupleInfoNCE \cite{liu2021contrastive} compose new negative tuples for contrastive learning using modalities from different scenes to ensure that the weak modalities are not being ignored.
Existing works mainly use pixel-level multi-view consistency of single or multiply modalities. In our work, we use geometric consistency sets as guidance to explore intra-view consistency for 2D representation learning.
\subsection{Pseudo Labeling}
Pseudo labeling \cite{lee2013pseudo,shi2018transductive,rizve2021defense,liu2021one,iscen2019label}, as an effective way for learning with unlabeled data, has been widely studied in various applications. The key to the success of pseudo labeling methods is to generate high-quality pseudo labels for the unlabeled data. Researchers in this field have explored various ways for acquiring pseudo labels, including predicting directly with trained networks \cite{lee2013pseudo,liu2021one}, neighborhood graph propagation \cite{iscen2019label} or confidence based selection \cite{shi2018transductive,rizve2021defense} etc.
The mainstream works mainly use pseudo labels in semi-supervised or weakly supervised learning scenarios. In our work, the geometric consistency sets we used serve as pseudo consistency labels to guide the learning of 2D image representations in a self-supervised manner.
\section{Experimental Results}
\subsection{Fine-tuning for 2D Downstream Tasks}
In the following, we demonstrate the effectiveness of our method by fine-tuning the pre-trained network on several 2D downstream tasks, including semantic segmentation, instance segmentation, and object detection.
\begin{table}
\centering
\begin{tabular}{lccccc}
\toprule
Method & 20\% & 40\% & 60\% & 80\% & 100\%\\
\midrule
Pri3d(View + Geo) & 51.5 & 56.2 & 58.9 & 60.3 & 61.7\\
Ours & \textbf{54.1} & \textbf{58.3} & \textbf{60.4} & \textbf{61.5} & \textbf{63.1}\\
\bottomrule
\end{tabular}
\vspace{-2mm}
\caption{\textbf{Data efficient learning results on ScanNet.} We fine-tune our pre-trained representations with a limited amount of training data (from $20\%$ to $100\%$). ResNet50 is used as the backbone, and mIoU is used for evaluation. }
\label{tab:semseg2d_scannet_limit}
\end{table}
\paragraph{Semantic Segmentation on ScanNet}
We demonstrate the effectiveness of our pre-trained representation by fine-tuning it with the ScanNet standard labeled training set, and mean IoU is used as the evaluation metric. ResNet50 or ResNet18 is used as the backbone encoder for all pre-training methods. In Table \ref{tab:semseg2d_scannet}, we compare our results with other state-of-the-art pre-training methods. Our method outperforms all the state-of-the-art methods for both ResNet50 and ResNet18 backbones, which confirms the effectiveness of our proposed self-supervised pre-training strategy with geometry-guided set consistency. Figure \ref{fig:vis_semseg2d} demonstrates some qualitative results, as we can see that the segmentation results of our method are less noisy and have clearer details.
We further test our method with different amounts of data for fine-tuning to study the performance under limited data scenarios. ResNet50 is used as the backbone. As shown in Table \ref{tab:semseg2d_scannet_limit}, by comparing our method with the best performing SOTA method, we can achieve superior performance consistently under different ratios of training data.
Moreover, we also test our pre-trained representations with more advanced 2D semantic segmentation architectures including DeepLabV3 \cite{chen2017rethinking}, DeepLabV3+ \cite{chen2018encoder} and PSPNet\cite{zhao2017pspnet}. As shown in Table \ref{tab:semseg2d_scannet_diff_arch}, our method consistently outperforms the state-of-the-art methods by a large margin. Which further validate the effectiveness of considering geometric consistency set for self-supervised image representation learning.
\begin{table}
\centering
\begin{tabular}{lc}
\toprule
Method & ResNet50 \\
\midrule
DeepLabV3(ImageNet) & 57.0\\
DeepLabV3(Pri3D) & 61.3\\
DeepLabV3(Ours) & \textbf{62.2}\\
\midrule
DeepLabV3+(ImageNet) & 57.8\\
DeepLabV3+(Pri3D) & 61.6\\
DeepLabV3+(Ours) & \textbf{62.7}\\
\midrule
PSPNet(ImageNet) & 59.7\\
PSPNet(Pri3D) & 62.8\\
PSPNet(Ours) & \textbf{63.7}\\
\bottomrule
\end{tabular}
\vspace{-2mm}
\caption{\textbf{2D semantic segmentation results on ScanNet with different network architectures.} ResNet50 is used as the backbone for all architectures, and mIoU is used for evaluation.}
\label{tab:semseg2d_scannet_diff_arch}
\end{table}
\paragraph{Instance Segmentation and Detection on ScanNet}
We fine-tune our pre-trained representations on 2D ScanNet object detection and instance segmentation tasks to see the generalizability of the learned representations. Specifically, ResNet50 is used as the backbone encoder for all the pre-training methods. Mask-RCNN \cite{he2017mask} implemented by Detectron2 \cite{wu2019detectron2} is used for object detection and instance segmentation tasks. As shown in Table \ref{tab:insdet_scannet} and \ref{tab:insseg_scannet}, we can achieve comparable or superior performance compared with the other state-of-the-arts on different evaluation metrics.
\begin{table}
\centering
\begin{tabular}{lccc}
\toprule
Method & [email protected] & [email protected] & AP \\
\midrule
From Scratch & 32.7 & 17.7 & 16.9 \\
ImageNet Pre-training & 41.7 & 25.9 & 25.1\\
\midrule
MoCoV2 & 43.5 & 26.8 & 25.8\\
Pri3D(View) & 43.7 & 27.0 & 26.3\\
Pri3D(Geo) & 44.2 & \textbf{27.6} & 26.6\\
Pri3D(View + Geo) & 44.5 & 27.4 & 26.6\\
\midrule
Ours & \textbf{45.1} & \textbf{27.6} & \textbf{26.9}\\
\bottomrule
\end{tabular}
\vspace{-2mm}
\caption{\textbf{2D object detection results on ScanNet.} We use ResNet50 as the backbone and average precision for evaluation.}
\label{tab:insdet_scannet}
\end{table}
\begin{table}
\centering
\begin{tabular}{lccc}
\toprule
Method & [email protected] & [email protected] & AP \\
\midrule
From Scratch & 25.8 & 13.1 & 12.2 \\
ImageNet Pre-training & 32.6 & 17.8 & 17.6\\
\midrule
MoCoV2 & 33.9 & 18.1 & 18.3\\
Pri3D(View) & 34.3 & 18.7 & 18.3\\
Pri3D(Geo) & 34.4 & 18.7 & 18.3\\
Pri3D(View + Geo) & 35.8 & \textbf{19.3} & 18.7\\
\midrule
Ours & \textbf{36.0} & \textbf{19.3} & \textbf{19.5}\\
\bottomrule
\end{tabular}
\vspace{-2mm}
\caption{\textbf{2D instance segmentation results on ScanNet.} We use ResNet50 as the backbone and average precision for evaluation.}
\label{tab:insseg_scannet}
\end{table}
\paragraph{Transfer to NYUv2}
We demonstrate the transferability of our pre-trained representations to other datasets. Specifically, we use ResNet50 as the backbone encoder for all pre-training methods. The network is pre-trained on ScanNet\cite{dai2017scannet} dataset, and fine-tuned for downstream tasks on NYUv2\cite{silberman2012indoor} dataset. Following Pri3D\cite{hou2021pri3d}, we use the learning rate $0.01$ instead of $0.1$ for semantic segmentation task. As demonstrated in Table \ref{tab:semseg2d_nyuv2}, \ref{tab:insdet_nyuv2} and \ref{tab:insseg_nyuv2}, our pre-trained representations achieve superior performance compared with SOTA methods on most evaluation metrics, which further confirms that our pre-trained image representations are general and transferable across different datasets.
\begin{table}
\centering
\begin{tabular}{lcc}
\toprule
Method & ResNet50 \\
\midrule
From Scratch & 24.8 \\%& 22.5 \\
ImageNet Pre-training & 50.0 \\%& 44.7 \\
\midrule
MoCoV2 & 47.6 \\
Pri3D(View) & 54.2 \\%& 48.2 \\
Pri3D(Geo) & 54.8 \\%& 48.6 \\
Pri3D(View + Geo) & 54.7 \\%& 48.1 \\
\midrule
Ours & \textbf{55.4} \\%& \\
\bottomrule
\end{tabular}
\vspace{-2mm}
\caption{\textbf{2D semantic segmentation results on NYUv2.} mIoU is used as the evaluation metric.}
\label{tab:semseg2d_nyuv2}
\end{table}
\begin{table}
\centering
\begin{tabular}{lccc}
\toprule
Method & [email protected] & [email protected] & AP \\
\midrule
From Scratch & 21.3 & 10.3 & 9.0 \\
ImageNet Pre-training & 29.9 & 17.3 & 16.8\\
\midrule
MoCoV2 & 30.1 & 18.1 & 17.3\\
Pri3D(View) & 33.0 & 19.8 & 18.9\\
Pri3D(Geo) & 33.8 & 20.2 & 19.1\\
Pri3D(View + Geo) & 34.0 & 20.4 & 19.4\\
\midrule
Ours & \textbf{34.6} & \textbf{20.5} & \textbf{19.7}\\
\bottomrule
\end{tabular}
\vspace{-2mm}
\caption{\textbf{2D object detection results on NYUv2.} We use ResNet50 as the backbone, and average precision for evaluation.}
\label{tab:insdet_nyuv2}
\end{table}
\begin{table}
\centering
\begin{tabular}{lccc}
\toprule
Method & [email protected] & [email protected] & AP \\
\midrule
From Scratch & 17.2 & 9.2 & 8.8 \\
ImageNet Pre-training & 25.1 & 13.9 & 13.4\\
\midrule
MoCoV2 & 27.2 & 14.7 & 14.8\\
Pri3D(View) & 28.1 & 15.7 & 15.7\\
Pri3D(Geo) & 29.0 & 15.9 & 15.2\\
Pri3D(View + Geo) & 29.5 & \textbf{16.3} & 15.8\\
\midrule
Ours & \textbf{29.7} & \textbf{16.3} & \textbf{16.5}\\
\bottomrule
\end{tabular}
\vspace{-2mm}
\caption{\textbf{2D instance segmentation results on NYUv2.} We use ResNet50 as the backbone, and average precision for evaluation.}
\label{tab:insseg_nyuv2}
\end{table}
\subsection{Ablation Study}
\paragraph{Different Implementation of Set Feature Aggregation }\label{diff_set_choice}
We study a different choice of the set feature aggregation function $\mathcal{F}$ in Eqn. \ref{eq:pseudo_loss} to see whether it will influence the performance. Instead of using the average function to aggregate set-level features for both positive and negative pairs, here we test an asymmetric implementation. To be specific, for $\mathcal{F}(P^m_i)$ and $\mathcal{F}(P^l_k)$ in Eqn. \ref{eq:pseudo_loss} we select the feature of an arbitrary point from each set, and for $\mathcal{F}(P^n_i)$ average function is used. We pre-train the network with the newly defined loss on ScanNet and fine-tune it for ScanNet semantic segmentation. ResNet50 is used as the backbone. In this way, we get the performance of $63.1$ mIoU on the validation set, which is comparable with our result in Table \ref{tab:semseg2d_scannet}.
\paragraph{Ablation of Geometric Consistency Set}
We study the stability of our method by varying the parameters of the over-segmentation method \cite{felzenszwalb2004efficient,karpathy2013object} used for generating geometric consistency sets. To be specific, we generate geometric consistency sets on ScanNet under different clustering edge weight thresholds, and pre-train our network accordingly. As shown in Table ~\ref{tab:set_param_abl}, our method yields robustness to the clustering parameters.
\begin{table}[ht]
\centering
\scalebox{1}{
\begin{tabular}{lccccc}
\toprule
Threshold & 0.01 & 0.02 & 0.03 & 0.04 & 0.05\\
\midrule
mIoU& 63.2 & 62.9 & 62.9 &63.2 & 63.1 \\
\bottomrule
\end{tabular}}
\vspace{-1mm}
\caption{\textbf{Ablation of geometric consistency set.} 2D semantic segmentation results on ScanNet with different over-segmentation parameters used for pre-train. ResNet50 is used as the backbone.}
\label{tab:set_param_abl}
\end{table}
\paragraph{Pre-training with GT Semantic Label} Instead of using a geometry-guided consistency set, we also study the performance of the set-InfoNCE loss under the guidance of the ground truth semantic labels. Specifically, we use ground truth semantic labels to obtain the ground truth consistency sets and pre-train our network with ResNet50 as encoder on ScanNet\cite{dai2017scannet}. Note that ground truth category id is not used in pre-training. By fine-tuning the pre-trained representations for the ScanNet 2D semantic segmentation task, it could achieve the performance of 66.4 mIoU, which implies that a more sophisticated consistency set generation strategy may help to improve the result further.
\paragraph{Ablation of Pri3D}
Since in the first stage of our method we use View and Geo loss in Pri3D\cite{hou2021pri3d} to train the initial representations, one may wonder whether training Pri3D for more epochs will lead to better performance compared with the results listed in their original paper. To address this concern, we test thoroughly by continuing training from the Pri3D checkpoint with different combinations of their losses for two more epochs. And then fine-tune the network on ScanNet semantic segmentation task\cite{dai2017scannet}. Totally, in this experiment, Pri3D is pre-trained for 7 epochs. As shown in Table \ref{tab:pri3d_ablation}, continuous training of different configurations of Pri3D can not lead to better results.
\begin{table}
\centering
\begin{tabular}{lcc}
\toprule
Method & ResNet50\\
\midrule
Pri3D Original& 61.7 \\
\midrule
Pri3D Continue(View) & 61.4\\
Pri3D Continue(Geo) & 61.6 \\
Pri3D Continue(View + Geo) & 61.5 \\
\midrule
Ours & \textbf{63.1} \\
\bottomrule
\end{tabular}
\vspace{-2mm}
\caption{\textbf{Ablation of Pri3D.} Continuous training of different configurations of Pri3D can not lead to better results. Pri3D Continue means continuous training of Pri3D.}
\label{tab:pri3d_ablation}
\end{table}
\section{Details of Geometric Consistency Set}
Here we provide more details about how to acquire the geometric consistency sets. For a 3D scene surface $S$ we can have a sequence of corresponding RGB-D scanning images. We use the surface over-segmentation results produced by a normal-based graph cut method ~\cite{felzenszwalb2004efficient, karpathy2013object} as the geometric consistency sets $\{P_j\}$. In this way, the 3D scene will be divided into many small segments. Figure \ref{fig:vis_patches} shows some examples, and Figure \ref{fig:vis_geo_sets_param} demonstrates the sets generated with different clustering edge weight thresholds. Then we project the 3D surface points together with the corresponding geometric consistency set id (here we use different ids to label the points in different geometric consistency sets) from 3D to 2D image views, and the pinhole camera model is used for 3D to 2D projection. Since the matching between the reconstructed 3D surface and the corresponding 2D image views may have a miss-match problem, we filter out invalid projections by comparing the depth difference between the projection points and the view depth maps. The projected points with the depth difference larger than a threshold, 0.05 in our experiments, will be regarded as invalid. Based on the valid projection points, we can have the corresponding projection $P_j^{m}=\{proj(s) \in I_m | s \in P_j\}$ of the geometric consistency set $P_j$ from 3D onto 2D image view $I_m$.
\section{Effect of the Initial Learning Rate}
We study different choices of the initial learning rate in the pre-training stage to see how it will influence the fine-tuning results. Specifically, the networks are pre-trained with different initial learning rates, including $0.1$ and $0.01$, on the ScanNet \cite{dai2017scannet} dataset and fine-tuned for the image semantic segmentation task on ScanNet and NYUv2 \cite{silberman2012indoor} datasets. Table \ref{tab:learning_rate} illustrates the performance of both our method and Pri3D \cite{hou2021pri3d}. Although the network performance varies with the initial learning rate, our method consistently outperforms Pri3D on all the settings.
\begin{table}[hbt!]
\centering
\begin{tabular}{lcc}
\toprule
Method & ScanNet & NYUv2\\
\midrule
Pri3D (0.01) & 59.7 & 54.8 \\
Ours (0.01) & \textbf{60.3} & \textbf{55.4} \\
\midrule
Pri3D (0.1) & 61.7 & 51.4 \\
Ours (0.1) & \textbf{63.1} & \textbf{54.1}\\
\bottomrule
\end{tabular}
\caption{\textbf{Effect of the initial learning rate.} Effect of different initial learning rates in the pre-training stage. ResNet50 is used as the backbone encoder, the network is pre-trained on ScanNet dataset and fine-tuned for the image semantic segmentation task on ScanNet and NYUv2 datasets. mIOU is used for evaluation.}
\label{tab:learning_rate}
\end{table}
\section{Convergence}
We study the convergence of the methods by fine-tuning the pre-trained networks on ScanNet\cite{dai2017scannet} semantic segmentation dataset and reporting the performance on the validation set after different number of epochs. As shown in Figure \ref{fig:convergence}, both Pri3D\cite{hou2021pri3d} and our proposed method converge within $10$ epochs, and our method consistently outperforms Pri3D after that.
\begin{figure}[ht]
\centering
\begin{overpic}[width=0.45\textwidth]{figs/convergence_no_text.pdf}{
\put(16,6){\footnotesize 1}
\put(28,6){\footnotesize 5}
\put(40,6){\footnotesize 10}
\put(54,6){\footnotesize 15}
\put(67.5,6){\footnotesize 20}
\put(82,6){\footnotesize 25}
\put(96,6){\footnotesize 30}
\put(36,1){\footnotesize Number of Fine-tuning Epochs}
\put(70, 26){\footnotesize Ours}
\put(70, 18){\footnotesize Pri3d(View+Geo)}
\put(6,12){\footnotesize 0.53}
\put(6,22){\footnotesize 0.55}
\put(6,31){\footnotesize 0.57}
\put(6,40){\footnotesize 0.59}
\put(6,50){\footnotesize 0.61}
\put(6,59){\footnotesize 0.63}
\put(-5, 35){\footnotesize mIoU}
}\end{overpic}
\caption{\textbf{Convergence of the methods.} We fine-tune the pre-trained networks on the ScanNet semantic segmentation task. The average performance of 3 runs for each method is reported.}
\label{fig:convergence}
\end{figure}
\begin{figure*}
\centering
\begin{overpic}[width=1\textwidth]{figs/vis_patches.pdf}{
}\end{overpic}
\caption{\textbf{Geometric consistency sets on 3D.} Different colors indicate different geometric consistency sets. }
\label{fig:vis_patches}
\end{figure*}
\section{Representation Space Analysis}
We analyze the quality of the learned representation spaces by computing the coding rate \cite{yu2020learning}, which measures the intra-category compactness, on ScanNet 2D semantic segmentation validation set.
Specifically, let $\mathbf{F} \in \mathbb{R}^{d \times m}$ be the matrix containing $m$ feature vectors with dimension $d$. The coding rate of $\mathbf{F}$ can be defined as:
\begin{equation}\label{eq:coding_rate}
R(\mathbf{F}, \epsilon) = \frac{1}{2} \log \det (\mathbf{I} + \frac{d}{m \epsilon^2} \mathbf{F}\mathbf{F}^{\mathsf{T}})
\end{equation}
\noindent where $I$ is the identity matrix, and $\epsilon$ is the distortion parameter.
For each image, we extract pixel features with pre-trained networks. Since the pixel features extracted with different pre-trained networks may have different overall scales, we scale the features by dividing by average feature length. Then, we compute the coding rate for the features within each ground truth category. The coding rate of an image can be computed by averaging the coding rates of all the categories within this image. The average coding rates of Pri3D \cite{hou2021pri3d} and ours are $54.04$ and $34.05$ respectively. This means our pre-trained representations are more compact than Pri3D. Moreover, we also visualize the learned features by PCA. As shown in Figure ~\ref{fig:vis_feat}, our features are cleaner and more separable.
\begin{figure*}[h]
\centering
\begin{overpic}[width=1\textwidth]{figs/vis_feat.pdf}{
\put(86,-2){\footnotesize Pri3D}
\put(61,-2){\footnotesize Ours}
\put(35,-2){\footnotesize GT Label}
\put(10,-2){\footnotesize Input}
}\end{overpic}
\vspace{4mm}
\caption{\textbf{PCA embedding of learned pixel features.} Different colors indicate different ground truth segmentation categories, and black color indicates the unlabeled regions.}
\label{fig:vis_feat}
\end{figure*}
\begin{figure*}
\centering
\begin{overpic}[width=1\textwidth]{figs/vis_geo_set.pdf}{
\put(3,45){\footnotesize Threshold: 0.01}
\put(52,45){\footnotesize Threshold: 0.05}
}\end{overpic}
\caption{\textbf{3D geometric consistency sets generated by different parameters.} Different colors indicate different geometric consistency sets, and larger clustering edge weight threshold will lead to larger sets. Black color denotes the unlabeled regions.}
\label{fig:vis_geo_sets_param}
\end{figure*}
\section{Ablation of Two-stage Training}
We test our method with different pre-training configurations, i.e. set-InfoNCE loss only, set-InfoNCE plus pixel-InfoNCE and two-stage training. As shown in Table ~\ref{tab:two_stage_abl}, the best performance is achieved with two-stage training that learns from low-level to high-level. Similar strategies can also be found in research topics like curriculum learning.
\begin{table}[ht]
\centering
\scalebox{0.97}{
\begin{tabular}{lccccc}
\toprule
& set-InfoNCE & set + pixel-InfoNCE & two stage \\
\midrule
mIoU& 60.6 & 61.0 & 63.1 \\
\bottomrule
\end{tabular}}
\caption{\textbf{Two-stage training ablation. }Performance of 2D semantic segmentation task on ScanNet with different pre-training configurations. ResNet50 is used as the backbone encoder.}
\label{tab:two_stage_abl}
\end{table}
\section{Performance on SUN RGB-D Dataset}
To further validate the transferability of our method, we fine-tune the ScanNet pre-trained representations on SUN RGB-D Dataset \cite{song2015sun} for the 2D semantic segmentation task. Specifically, the dataset contains 5k images for training and 5k images for testing, and the networks are pre-trained with initial learning rates of $0.1$ and $0.01$ respectively. As shown in Table ~\ref{tab:transfer_sunrgbd}, our method achieves better performance compared with Pri3D \cite{hou2021pri3d}.
\begin{table}[ht]
\centering
\scalebox{1}{
\begin{tabular}{lcc}
\toprule
Method & ResNet50 \\
\midrule
ImageNet Pre-training & 34.8\\
Pri3D (0.1) & 37.3 \\
Ours (0.1) & 38.1 \\
Pri3D (0.01) & 38.6\\
Ours (0.01) & \textbf{39.2}\\
\bottomrule
\end{tabular}}
\caption{\textbf{Performance on SUN RGB-D dataset.} Pre-train on ScanNet with different learning rates and fine-tune on SUN RGB-D for 2D semantic segmentation. ResNet50 is used as the backbone encoder.}
\label{tab:transfer_sunrgbd}
\end{table}
\begin{table}[hbt!]
\centering
\begin{tabular}{lcc}
\toprule
Method & ResNet50 \\
\midrule
ImageNet Pre-training & 28.5 \\
Pri3D & 33.2 \\
\midrule
Ours & \textbf{33.7} \\
\bottomrule
\end{tabular}
\caption{\textbf{Performance on KITTI dataset.} ResNet50 is used as the backbone encoder, the network is pre-trained with unlabeled RGB-D sequence on KITTI and fine-tuned for the image semantic segmentation task. mIOU is used for evaluation.}
\label{tab:kitti_semseg}
\end{table}
\begin{figure*}
\centering
\begin{overpic}[width=1\textwidth]{figs/vis_semseg2d_sup.pdf}{
\put(39,97.3) {\textbf{ScanNet}}
\put(38.5,47.7){ \textbf{NYUv2}}
\put(-0.5,92){\small {Input}}
\put(-2.50,82){\small {ImageNet}}
\put(-1,73){\small {Pri3D}}
\put(0,64){\small {Ours}}
\put(0.5,55){\small {GT}}
\put(-0.5,42){\small {Input}}
\put(-2.5,32.5){\small{ImageNet}}
\put(-1,23.5){\small {Pri3D}}
\put(0,14.5){\small {Ours}}
\put(0.5,5){\small {GT}}
}\end{overpic}
\caption{\textbf{More qualitative results of semantic segmentation task on ScanNet and NYUv2 datasets.} All the methods are pre-trained on ScanNet with ResNet50 as the backbone encoder.
}
\label{fig:vis_semseg2d_sup}
\end{figure*}
\section{Performance on KITTI Dataset}
We further test our method on KITTI \cite{geiger2013vision} dataset, to see the effectiveness of our method in the outdoor autonomous driving scenario. KITTI is a dataset captured by driving around a city with cars equipped with different kinds of sensors, including stereo camera, GPS, laser-scanner, etc. In our experiment, we use the unlabeled RGB-D sequences for pre-training and fine-tune the pre-trained network on the 2D image semantic segmentation task. To compute the geometric consistency sets, we use the Voxel Cloud Connectivity Segmentation (VCCS) \cite{papon2013voxel} method implemented by PCL \cite{Rusu_ICRA2011_PCL} library to extract clusters on the per-view point clouds. During training, for each view pair, we use the geometric consistency sets from one view and project them onto the other, while the geometric consistency sets from the other view are ignored. In this way, we can have the same geometric consistency sets for the corresponding views. Table \ref{tab:kitti_semseg} illustrates the results. We note that the point clouds in KITTI are partial and noisy, and the moving objects in the scenes may lead to incorrect correspondences between views, which makes the results sensitive to different clustering parameters. The experiment here is to demonstrate the possibility of adapting our method to outdoor scenes; we hope our work can motivate future research in this direction.
\section{More Qualitative Results}
In Figure \ref{fig:vis_semseg2d_sup}, we show more qualitative results of 2D semantic segmentation task on ScanNet\cite{dai2017scannet} and NYUv2\cite{silberman2012indoor} datasets. As is shown, the segmentation results produced with our method have less noise compared with those from other methods.
\section{Details of Geometric Consistency Set}
Here we provide more details about how to acquire the geometric consistency sets. For a 3D scene surface $S$ we can have a sequence of corresponding RGB-D scanning images. We use the surface over-segmentation results produced by a normal-based graph cut method ~\cite{felzenszwalb2004efficient, karpathy2013object} as the geometric consistency sets $\{P_j\}$. In this way, the 3D scene will be divided into many small segments. Figure \ref{fig:vis_patches} shows some examples, and Figure \ref{fig:vis_geo_sets_param} demonstrates the sets generated with different clustering edge weight thresholds. Then we project the 3D surface points together with the corresponding geometric consistency set id (here we use different ids to label the points in different geometric consistency sets) from 3D to 2D image views, and the pinhole camera model is used for 3D to 2D projection. Since the matching between the reconstructed 3D surface and the corresponding 2D image views may have a miss-match problem, we filter out invalid projections by comparing the depth difference between the projection points and the view depth maps. The projected points with the depth difference larger than a threshold, 0.05 in our experiments, will be regarded as invalid. Based on the valid projection points, we can have the corresponding projection $P_j^{m}=\{proj(s) \in I_m | s \in P_j\}$ of the geometric consistency set $P_j$ from 3D onto 2D image view $I_m$.
\section{Effect of the Initial Learning Rate}
We study different choices of the initial learning rate in the pre-training stage to see how it will influence the fine-tuning results. Specifically, the networks are pre-trained with different initial learning rates, including $0.1$ and $0.01$, on the ScanNet \cite{dai2017scannet} dataset and fine-tuned for the image semantic segmentation task on ScanNet and NYUv2 \cite{silberman2012indoor} datasets. Table \ref{tab:learning_rate} illustrates the performance of both our method and Pri3D \cite{hou2021pri3d}. Although the network performance varies with the initial learning rate, our method consistently outperforms Pri3D on all the settings.
\begin{table}[hbt!]
\centering
\begin{tabular}{lcc}
\toprule
Method & ScanNet & NYUv2\\
\midrule
Pri3D (0.01) & 59.7 & 54.8 \\
Ours (0.01) & \textbf{60.3} & \textbf{55.4} \\
\midrule
Pri3D (0.1) & 61.7 & 51.4 \\
Ours (0.1) & \textbf{63.1} & \textbf{54.1}\\
\bottomrule
\end{tabular}
\caption{\textbf{Effect of the initial learning rate.} Effect of different initial learning rates in the pre-training stage. ResNet50 is used as the backbone encoder, the network is pre-trained on ScanNet dataset and fine-tuned for the image semantic segmentation task on ScanNet and NYUv2 datasets. mIOU is used for evaluation.}
\label{tab:learning_rate}
\end{table}
\section{Convergence}
We study the convergence of the methods by fine-tuning the pre-trained networks on ScanNet\cite{dai2017scannet} semantic segmentation dataset and reporting the performance on the validation set after different number of epochs. As shown in Figure \ref{fig:convergence}, both Pri3D\cite{hou2021pri3d} and our proposed method converge within $10$ epochs, and our method consistently outperforms Pri3D after that.
\begin{figure}[ht]
\centering
\begin{overpic}[width=0.45\textwidth]{figs/convergence_no_text.pdf}{
\put(16,6){\footnotesize 1}
\put(28,6){\footnotesize 5}
\put(40,6){\footnotesize 10}
\put(54,6){\footnotesize 15}
\put(67.5,6){\footnotesize 20}
\put(82,6){\footnotesize 25}
\put(96,6){\footnotesize 30}
\put(36,1){\footnotesize Number of Fine-tuning Epochs}
\put(70, 26){\footnotesize Ours}
\put(70, 18){\footnotesize Pri3d(View+Geo)}
\put(6,12){\footnotesize 0.53}
\put(6,22){\footnotesize 0.55}
\put(6,31){\footnotesize 0.57}
\put(6,40){\footnotesize 0.59}
\put(6,50){\footnotesize 0.61}
\put(6,59){\footnotesize 0.63}
\put(-5, 35){\footnotesize mIoU}
}\end{overpic}
\caption{\textbf{Convergence of the methods.} We fine-tune the pre-trained networks on the ScanNet semantic segmentation task. The average performance of 3 runs for each method is reported.}
\label{fig:convergence}
\end{figure}
\begin{figure*}
\centering
\begin{overpic}[width=0.95\textwidth]{figs/vis_patches.pdf}{
}\end{overpic}
\caption{\textbf{Geometric consistency sets on 3D.} Different colors indicate different geometric consistency sets. }
\label{fig:vis_patches}
\end{figure*}
\section{Representation Space Analysis}
We analyze the quality of the learned representation spaces by computing the coding rate \cite{yu2020learning}, which measures the intra-category compactness, on ScanNet 2D semantic segmentation validation set.
Specifically, let $\mathbf{F} \in \mathbb{R}^{d \times m}$ be the matrix containing $m$ feature vectors with dimension $d$. The coding rate of $\mathbf{F}$ can be defined as:
\begin{equation}\label{eq:coding_rate}
R(\mathbf{F}, \epsilon) = \frac{1}{2} \log \det (\mathbf{I} + \frac{d}{m \epsilon^2} \mathbf{F}\mathbf{F}^{\mathsf{T}})
\end{equation}
\noindent where $I$ is the identity matrix, and $\epsilon$ is the distortion parameter.
For each image, we extract pixel features with pre-trained networks. Since the pixel features extracted with different pre-trained networks may have different overall scales, we scale the features by dividing by average feature length. Then, we compute the coding rate for the features within each ground truth category. The coding rate of an image can be computed by averaging the coding rates of all the categories within this image. The average coding rates of Pri3D \cite{hou2021pri3d} and ours are $54.04$ and $34.05$ respectively. This means our pre-trained representations are more compact than Pri3D. Moreover, we also visualize the learned features by PCA. As shown in Figure ~\ref{fig:vis_feat}, our features are cleaner and more separable.
\begin{figure*}[h]
\centering
\begin{overpic}[width=1\textwidth]{figs/vis_feat.pdf}{
\put(86,-2){\footnotesize Pri3D}
\put(61,-2){\footnotesize Ours}
\put(35,-2){\footnotesize GT Label}
\put(10,-2){\footnotesize Input}
}\end{overpic}
\vspace{4mm}
\caption{\textbf{PCA embedding of learned pixel features.} Different colors indicate different ground truth segmentation categories, and black color indicates the unlabeled regions.}
\label{fig:vis_feat}
\end{figure*}
\begin{figure*}
\centering
\begin{overpic}[width=1\textwidth]{figs/vis_geo_set.pdf}{
\put(3,45){\footnotesize Threshold: 0.01}
\put(52,45){\footnotesize Threshold: 0.05}
}\end{overpic}
\caption{\textbf{3D geometric consistency sets generated by different parameters.} Different colors indicate different geometric consistency sets, and larger clustering edge weight threshold will lead to larger sets. Black color denotes the unlabeled regions.}
\label{fig:vis_geo_sets_param}
\end{figure*}
\section{Ablation of Two-stage Training}
We test our method with different pre-training configurations, i.e. set-InfoNCE loss only, set-InfoNCE plus pixel-InfoNCE and two-stage training. As shown in Table ~\ref{tab:two_stage_abl}, the best performance is achieved with two-stage training that learns from low-level to high-level. Similar strategies can also be found in research topics like curriculum learning.
\begin{table}[ht]
\centering
\scalebox{0.97}{
\begin{tabular}{lccccc}
\toprule
& set-InfoNCE & set + pixel-InfoNCE & two stage \\
\midrule
mIoU& 60.6 & 61.0 & 63.1 \\
\bottomrule
\end{tabular}}
\caption{\textbf{Two-stage training ablation. }Performance of 2D semantic segmentation task on ScanNet with different pre-training configurations. ResNet50 is used as the backbone encoder.}
\label{tab:two_stage_abl}
\end{table}
\section{Performance on SUN RGB-D Dataset}
To further validate the transferability of our method, we fine-tune the ScanNet pre-trained representations on SUN RGB-D Dataset \cite{song2015sun} for the 2D semantic segmentation task. Specifically, the dataset contains 5k images for training and 5k images for testing, and the networks are pre-trained with initial learning rates of $0.1$ and $0.01$ respectively. As shown in Table ~\ref{tab:transfer_sunrgbd}, our method achieves better performance compared with Pri3D \cite{hou2021pri3d}.
\begin{table}[ht]
\centering
\scalebox{1}{
\begin{tabular}{lcc}
\toprule
Method & ResNet50 \\
\midrule
ImageNet Pre-training & 34.8\\
Pri3D (0.1) & 37.3 \\
Ours (0.1) & 38.1 \\
Pri3D (0.01) & 38.6\\
Ours (0.01) & \textbf{39.2}\\
\bottomrule
\end{tabular}}
\caption{\textbf{Performance on SUN RGB-D dataset.} Pre-train on ScanNet with different learning rates and fine-tune on SUN RGB-D for 2D semantic segmentation. ResNet50 is used as the backbone encoder.}
\label{tab:transfer_sunrgbd}
\end{table}
\begin{table}[hbt!]
\centering
\begin{tabular}{lcc}
\toprule
Method & ResNet50 \\
\midrule
ImageNet Pre-training & 28.5 \\
Pri3D & 33.2 \\
\midrule
Ours & \textbf{33.7} \\
\bottomrule
\end{tabular}
\caption{\textbf{Performance on KITTI dataset.} ResNet50 is used as the backbone encoder, the network is pre-trained with unlabeled RGB-D sequence on KITTI and fine-tuned for the image semantic segmentation task. mIOU is used for evaluation.}
\label{tab:kitti_semseg}
\end{table}
\begin{figure*}
\centering
\begin{overpic}[width=1\textwidth]{figs/vis_semseg2d_sup.pdf}{
\put(39,97.3) {\textbf{ScanNet}}
\put(38.5,47.7){ \textbf{NYUv2}}
\put(-0.5,92){\small {Input}}
\put(-2.50,82){\small {ImageNet}}
\put(-1,73){\small {Pri3D}}
\put(0,64){\small {Ours}}
\put(0.5,55){\small {GT}}
\put(-0.5,42){\small {Input}}
\put(-2.5,32.5){\small{ImageNet}}
\put(-1,23.5){\small {Pri3D}}
\put(0,14.5){\small {Ours}}
\put(0.5,5){\small {GT}}
}\end{overpic}
\caption{\textbf{More qualitative results of semantic segmentation task on ScanNet and NYUv2 datasets.} All the methods are pre-trained on ScanNet with ResNet50 as the backbone encoder.
}
\label{fig:vis_semseg2d_sup}
\end{figure*}
\section{Performance on KITTI Dataset}
We further test our method on KITTI \cite{geiger2013vision} dataset, to see the effectiveness of our method in the outdoor autonomous driving scenario. KITTI is a dataset captured by driving around a city with cars equipped with different kinds of sensors, including stereo camera, GPS, laser-scanner, etc. In our experiment, we use the unlabeled RGB-D sequences for pre-training and fine-tune the pre-trained network on the 2D image semantic segmentation task. To compute the geometric consistency sets, we use the Voxel Cloud Connectivity Segmentation (VCCS) \cite{papon2013voxel} method implemented by PCL \cite{Rusu_ICRA2011_PCL} library to extract clusters on the per-view point clouds. During training, for each view pair, we use the geometric consistency sets from one view and project them onto the other, while the geometric consistency sets from the other view are ignored. In this way, we can have the same geometric consistency sets for the corresponding views. Table \ref{tab:kitti_semseg} illustrates the results. We note that the point clouds in KITTI are partial and noisy, and the moving objects in the scenes may lead to incorrect correspondences between views, which makes the results sensitive to different clustering parameters. The experiment here is to demonstrate the possibility of adapting our method to outdoor scenes; we hope our work can motivate future research in this direction.
\section{More Qualitative Results}
In Figure \ref{fig:vis_semseg2d_sup}, we show more qualitative results of 2D semantic segmentation task on ScanNet\cite{dai2017scannet} and NYUv2\cite{silberman2012indoor} datasets. As is shown, the segmentation results produced with our method have less noise compared with those from other methods.
| {'timestamp': '2022-03-30T02:26:40', 'yymm': '2203', 'arxiv_id': '2203.15361', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15361'} | arxiv |
\section{Introduction}
Topological data analysis (TDA) has been used in music analysis recently based on persistent homology \cite{Bigo,Bergomi,Bergomithesis}. Persistent homology is an efficient concept for music analysis as it captures the cyclic structures of data \cite{ZC2005,Cohen,EHarer}.
In \cite{TPJ}, TDA was used to analyze Korean {\it Jung-Ak} music for the first time. {\it Jung-Ak} music\footnote{The literal meaning of {\it Jung Ak} is the {\it right} music.} is a type of music that was played at Royal palaces or among noble communities in old Korea. {\it Dodeuri} music is one of the most popular Jung-Ak music pieces. As its name indicates, the main characteristics of {\it Dodeuri} (repeat-and-return) music are in its frequent repetition and variation patterns. To analyze such patterns, TDA, particularly persistent homology has been utilized in \cite{TPJ}. Since the raw form of the music is not suitable, the given music is represented as a network \cite{BW,Liu,RCG,LTS10}, for which proper definitions of nodes and edges are provided in \cite{TPJ}. A node is defined as a two-dimensional vector whose first component is the pitch and the second the duration of the music note. If two nodes are placed side-by-side in the music, those two nodes are directly connected and the edge between those two nodes is defined as the connection. The weight of the edge is defined as the frequency of the side-by-side appearance of those two nodes. In such a way, the weight is non-negative integers. In order to apply TDA, the notion of the distance between two nodes is defined as the reciprocal of the edge weight of those two nodes if they are connected directly. If two nodes are only connected through more than two edges, the distance between those two nodes is defined by the sum of the reciprocals of the weights of edges involved between those two nodes. For the uniqueness, such edges between two nodes are picked in the path that has the smallest number of edges among all possible paths. Once the distance is defined, persistent homology is calculated and the corresponding one-dimensional barcodes are obtained. The one-dimensional barcode contains the one-dimensional hole information \cite{Carlsson}, that is, one-dimensional cycles in the given graph. In \cite{TPJ}, a unique set of total $8$ cycles was found for Suyeonjangjigok in Haegeum instrument -- Suyeonjangjigok (or Suyeonjang in short) is one of the most popular Dodeuri music.
Figure \ref{fig:syj_original} shows first few lines of Suyeonjangjigok directly translated from Jeongganbo, the old Korean music notation. The version in the figure is a simple version of Suyeonjangjigok without ornaments. Readers can also listen Suyeonjangjigok played with Haegeum instrument in the following YouTube link {\lstinline{https://www.youtube.com/watch?v=_DKo8FjL7Mg&t=461s}} from 0:24 to 5:24. In this paper, we mainly use Suyeonjangjigok as an exemplary for the development of the proposed method.
\begin{figure}[h]
\begin{center}
\includegraphics[width=0.9\textwidth]{syj_original.png}
\caption{Suyeonjangjigok without ornaments. Credit: Myong-Ok Kim}
\label{fig:syj_original}
\end{center}
\end{figure}
In \cite{TPJ}, a new concept of {\it {\color{black}{Overlap}} matrix} of $s$-scale was introduced. The {\color{black}{Overlap}} matrix of $s$-scale, which will be explained in detail in Section \ref{cycles}, is a visualization in a matrix form that shows how those found cycles are interconnected over the music at $s$-scale. It was shown in \cite{TPJ} that the proposed {\color{black}{Overlap}} matrix is useful to understand how the given music is composed and to classify music. In fact, the {\color{black}{Overlap}} matrix explains surprisingly and quantitively well why the Dodeuri music is different from the Taryong music, a music known as a non Dodeuri music. In this way, the {\color{black}{Overlap}} matrix can be interpreted as the composition algorithm or composition principle of the considered music. The current paper is based on our assumption that the {\color{black}{Overlap}} matrix reveals the composition algorithm of the music considered. Upon such assumption, we propose a way of machine composition using the {\color{black}{Overlap}} matrix.
Machine composition with Artificial Intelligence (AI) techniques based on artificial neural networks is well known even to non-experts these days \cite{Lopez}. There are various AI composition software packages available as well. AI music composition algorithms based on deep neural networks are to train a machine by feeding music pieces and create artificial neural networks that can produce music similar to the input music data. These approaches are considered as a blackbox optimization. That is, how machine composes with the constructed network is not known to users and the underlying composition algorithm of the generated music pieces is, in general, not explainable.
In this paper, we present a way of machine composition that trains a machine the composition principle embedded in the given music data. Our proposed method is based on the {\color{black}{Overlap}} matrix explained in the above. As explained in details in Section \ref{cycles}, the {\color{black}{Overlap}} matrix is a kind of visualization method that shows how the key cycles of the music found via TDA are distributed and interconnected one another over the music flow. The main idea of the current paper is to train a machine the composition principle represented by the {\color{black}{Overlap}} matrix in the expectation that the music is algorithmically composed mimicking the input {\color{black}{Overlap}} matrix. One can simply create or design the {\color{black}{Overlap}} matrix and the machine generates the music with such {\color{black}{Overlap}} matrix as a seed music. In this paper, we explain how music can be generated with the {\color{black}{Overlap}} matrix. First, we will explain that the {\color{black}{Overlap}} matrix can be used directly to compose a music algorithmically. Second we will explain how we train a machine the {\color{black}{Overlap}} matrix for building artificial neural networks and generating music.
The paper is composed of the following sections. In Section \ref{cycles}, we will explain the key elements of the current paper. We first explain the music network and TDA over the constructed network. Then we give detailed mathematical properties of the Overlap matrix. In Section \ref{nodepool}, we will explain the concept of node pool, which serves as the provider of nodes used for the composition. In Section \ref{algorithm}, we explain how we use the {\color{black}{Overlap}} matrix to generate music algorithmically -- Algorithm A. In Section \ref{ANN}, we explain how we use the Overlap matrix in the context of artificial neural network. First we propose three different methods that can generate the seed music using the {\color{black}{Overlap}} matrix in order to use towards the construction of the artificial neural network. Then, we provide a way to train a machine with the {\color{black}{Overlap}} matrix and construct the corresponding artificial neural networks. In Section \ref{conclusion}, we provide a brief concluding remark and future research questions.
\section{Cycles and Overlap matrix}
\label{cycles}
In this section we first explain how to construct music network from the given music. The raw form of music is not suitable for TDA. We represent the given music as a graph so that TDA can be applied. As in \cite{TPJ}, we consider Suyeonjangjigok, a Dodeuri type monophonic music written in {\it Jeongganbo}. Jeongganbo is a unique Korean music notation similar to a matrix. Figure \ref{fig:syj_original} shows first few lines of Suyeonjangjigok translated directly from Jeongganbo. For the explanation of reading Jeongganbo, see \cite{TPJ}. Once music network is constructed, we apply TDA and obtain so-called the persistent barcode and the cycles corresponding to the one-dimensional barcode. Based on the barcode and cycles, we build the {\it {\color{black}{Overlap}} matrix} which will be used together with the cycle information and node frequency distribution for generating new music. We refer readers to \cite{TPJ,Carlsson} for more details of TDA through persistent homology.
\subsection{Construction of music network}
Consider a monophonic music piece composed of $d$ notes and let $\mathcal{L} = \{n_1, n_2, \ldots, n_d\}$ be the ordered sequence of notes as the music flow. Each note has the information of height (pitch) and length (duration) of the sound to be played, i.e.,
\[
n_i = (p_i, l_i),
\]
where $p_i$ is the pitch of note $n_i$ and $l_i$ is its length. Note that by the definition of $n_i$, it is possible that $(p_i,l_i) = (p_j, l_j)$ for $i\neq j$. We then construct the music network $G = (\mathcal{N}, \mathcal{E})$, where $\cal{N}$ is the set of nodes and $\cal{E}$ is the set of edges in $G$. Here, $\cal{N}$ is the set of distinct notes in $\mathcal{L}$, sorted in ascending order in terms of pitch first then length. That is, $\mathcal{N} = \{\nu_1,\nu_2,\ldots,\nu_{q}\}$, where $q\leq d$ is the number of distinct notes in $\mathcal{L}$ and $\nu_j$ has a higher pitch than $\nu_i$ or both have the same pitch but $\nu_j$ has a longer length than $\nu_i$ if $j>i$. We draw an edge between two nodes $\nu_i$ and $\nu_j$, $i\neq j$, if they occur adjacent in time.
Let $e_{ij} \in \mathcal{E}$ be the edge whose end points are $\nu_i$ and $\nu_j$.
The weight or the degree of the edge $e_{ij}$, $w_{ij}$, between $\nu_i$ and $\nu_j$ is the number of occurrences of those two nodes being adjacent in time.
For two nodes $\nu_i$ and $\nu_j$ with $i<j$, let $p_{ij}$ be the path with the minimum number of edges between $\nu_i$ and $\nu_j$ found by Dijkstra algorithm.
The distance between nodes $\nu_i$ and $\nu_j$, $i<j$ is defined to be:
\begin{equation}\label{dij}
\delta(\nu_i,\nu_j) = \sum \limits_{e_{kl}\in p_{ij}}w_{kl}^{-1}
\end{equation}
where $w_{kl}$ represents the weight of the edge $e_{kl}$ and $p_{ij} = \bigcup e_{kl} $.
For those music we consider in this paper, since there is no empty Jeonggan where the music is not played, i.e., there is no isolated node, there always exists at least one path between any two distinct nodes $\nu_i$ and $ \nu_j$ even if they do not appear adjacently in the whole music.
Also, it is obvious that $w_{kl}\geq 1$ for any edge $e_{kl}$. Thus, the definition of the distance by \eqref{dij} is well-defined.
Then we form the distance matrix $D = \{\delta_{ij}\}$ as follows:
\[
\delta_{ij} = \left\{ \begin{array}{lc}
\delta(\nu_i,\nu_j), & i < j \\
0, & i = j \\
\delta_{ji}, & i> j
\end{array} \right.
\]
\subsection{TDA: Barcode and Cycles}
We do not attempt to explain TDA here but refer readers to \cite{Carlsson} if necessary. The graph introduced above is defined with the definition of distance. Consider a point cloud composed of all nodes in $\mathcal{N}$. As all the pair-wise distances between $\nu_i$ and $\nu_j$ are defined, we first build a simplical complex out of the point {\color{black}{cloud}} as a Vietoris-Rips complex to compute persistent homology (see \cite{Carlsson,EHarer}). We note that there are other approaches rather than Vietoris-Rips complex for persistent homology on a graph. Since the main purpose of the current research is to propose a machine composition algorithm, the choice of building algorithm of complexes and filtration method is not critical. Using the distance matrix $D$, we build the corresponding Vietoris-Rips complex and barcode, for which we use the software package Javaplex \cite{AT}.
Suyeonjang has total $d = 440$ notes composed of $q = 33$ distinct notes. \figref{fig:syj_barcode} shows the zero-dimensional (top) and one-dimensional (bottom) barcodes generated by Javaplex applied to $G$ of Suyeonjang.
\begin{figure}[h]
\begin{center}
\includegraphics[width=0.7\textwidth]{syj_barcode.eps}
\caption{Barcode of Suyeonjang using Vietoris-Rips method. Top: 0-D barcode. Bottom: 1-D barcode. In 1D barcode, we observe 8 non-zero persistence intervals implying 8 cycles in $G$. Credit: \cite{TPJ}}
\label{fig:syj_barcode}
\end{center}
\end{figure}
In \figref{fig:syj_barcode} the horizontal axis is the filtration value $\tau$. Vertically we have multiple intervals that correspond to generators of the homology groups. In the zeroth dimension we have $33$ generators that correspond to $33$ components when $\tau$ is zero or small, which eventually are connected into a single component when $\tau=1$. The $33$ components are actually those $33$ distinct nodes defined in Suyeonjang. All these components constitute a single component because of the fact that any node in the network connects at least one time with another node, which means that at most when distance $\tau=1$ all nodes in the network are connected. On the other hand, the fact that one component is formed exactly when $\tau = 1$ implies that there exists at least a pair of nodes $\nu_i, \nu_j$ that have distance $\delta (\nu_i, \nu_j)= 1$, i.e., $\nu_i$ and $\nu_j$ are adjacent only once. In the first dimension we see $8$ generators which topologically correspond to eight cycles. It turns out that the interconnection between these cycles is related to the repetition of music melodies known as Dodeuri \cite{TPJ}.
{\color{black}{
For each persistence interval we use the persistence algorithm computing intervals to find a representative cycle. The method \textsf{computeAnnotatedIntervals} in Javaplex is used to find the nodes in the intervals of persistence. In the one dimensional case, the annotated intervals consist of the components in the loops generated in the process of filtration.
}}
\figref{fig:syj_cycles} shows $8$ Cycles identified by TDA corresponding to $8$ persistence intervals in the one dimensional barcode {\color{black}{of Suyeonjang. We enumerate the cycles by the order of the appearance of their corresponding persistence intervals in the barcode.}}
That is, the earlier the 1D barcode dies, the lower number is assigned to the corresponding cycle.
For example, the death of Cycle $i$ is earlier than the death of Cycle $j$ if $i < j$. Note that this order is different from the order of their appearance in the actual music {\color{black}{and can be done arbitrarily without affecting the proposed composition algorithms}}. In the figure, each Cycle is shown with persistence interval, node information including node number, pitch and its length, the latter two of which are encrypted in {\color{black}{the circles filled with different colors and centered by Chinese letters. In fact}}, the Chinese letter in the center of each filled circle corresponds to a specific pitch, and the color of each circle illustrates the node length (see Table \ref{tab:syj_nodeinfo}). The figure also shows edge weight (in normal size in blue), distance between nodes (in small size in blue in brackets) and the average weight (in red in center) which is the simple mean of all edge weights. As shown in the figure, the minimum number of nodes that constitute a cycle is $4$ and the maximum number is $6$.
The information of corresponding music notes found {\color{black}{in}} all cycles is given in \tabref{tab:syj_nodeinfo}.
{\color{black}{For the purpose of this paper, we will use only the node information of the Cycles $C_i, i=1,\ldots,8$. More precisely, we will use the information of which nodes each Cycle consists of. For example, in the case of Suyeonjang, $C_1=\{ \nu_{18}, \nu_{20}, \nu_{22}, \nu_{27}\}$, $C_2=\{ \nu_{3}, \nu_{6}, \nu_{12}, \nu_{18}\}$ and so on. It should be noted that we do not need detailed information of the names, pitches or lengths of the music notes for building the composition algorithms. Those actual music note information will be used at the finishing stage where we get the generated music for playing.}}
In the next section, we explain in details how the Cycles will be used to construct so-called the Overlap matrix, one of the key ingredients in generating new music.
\include{syj_cycles}
\include{syj_nodeinfo}
\subsection{Overlap matrices} \label{sec:om}
In \cite{TPJ} the {\color{black}{Overlap}} matrix was introduced. In this section, we provide a formal definition of the {\color{black}{Overlap}} matrix and its mathematical properties.
From now on, let $s$ be a positive integer.
\definition{A \textit{binary matrix} is a matrix whose entries are either $0$ or $1$.
}
\definition{ A binary matrix $M_{k\times d}^s=\{m_{ij}^s\}$ is said to \textit{belong to $s$-scale} if for all $i = 1,\ldots,k$ we have that $m_{ij}^s = 1$ if and only if there exist nonnegative integers $t,l$ satisfying $t+l \geq s-1$ such that
\begin{equation*}
m_{i,j-l}^s = m_{i,j-l-1}^s = \ldots = m_{ij}^s = \ldots = m_{i,j+t-1}^s = m_{i,j+t}^s = 1.
\end{equation*}
}
Notice that there are $t+l+1$ entries from $m_{i,j-l}^s$ to $m_{i,j+t}^s$:
\begin{center}
\begin{tikzpicture}[scale=1.2]
\draw (0,0) -- (9,0);
\node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$m_{i,j-l}^s$}] at (1,0) {};
\node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=above:{$m_{i,j-l-1}^s$}] at (2,0) {};
\node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$\ldots$}] at (3,0) {};
\node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$m_{i,j}^s$}] at (4.5,0) {};
\node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$\ldots$}] at (5.5,0) {};
\node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=above:{$m_{i,j+t-1}^s$}] at (7,0) {};
\node[circle,fill=black,inner sep=0pt,minimum size=5pt,label=below:{$m_{i,j+t}^s$}] at (8,0) {};
\node at (4.5,-1){$\underbrace{\phantom{n + 1\text{ length of underbrace longer longer longer}}}_{t+l+1 \text{ entries }}$};
\end{tikzpicture}
\end{center}
Thus, a binary matrix $M_{k\times d}^s=\{m_{ij}^s\}$ belongs to $s$-scale if and only if on each row of $M_{k\times d}^s$ any entry equal to $1$ should be staying in a consecutive sequence of length at least $s$ columns that equal to $1$.
Unless other mentioned, let $\mathcal{O}$ be a music piece composed of $d$ notes that flows in the following order $\mathcal{L} = \{ n_1, \ldots, n_d\}$ and assume that the barcode for it in the first dimension consists of $k$ generators which topologically correspond to $k$ Cycles, $C_1, \ldots, C_k$. We define the binary and integer Overlap matrices {\color{black}{of}} $s$-scale for $\mathcal{O}$ as follows.
\definition{Matrix $M_{k\times d}^s=\{m_{ij}^s\}$ is called the \textit{binary Overlap matrix} {\color{black}{of}} $s$-scale for $\mathcal{O}$ if it satisfies the following conditions
\[
m_{ij}^s = \begin{cases}
1, & \text{ if } \exists~ t,l \geq 0 \text{ satisfying } t + l \geq s-1 \text{ such that }\\
& \hspace{0.5cm} n_{j-l}, n_{j-l-1}, \ldots, n_j, \ldots, n_{j+t-1}, n_{j+t} \in C_i,\\
0, & \text{ otherwise,}
\end{cases}
\]
for all $i = 1,\ldots, k$; $j = 1,\ldots,d$.
}\label{def:bom}
\definition{
Matrix $M_{k\times d}^s=\{m_{ij}^s\}$ is called the \textit{integer Overlap matrix} {\color{black}{of}} $s$-scale for $\mathcal{O}$ if it satisfies the following conditions
\[
m_{ij}^s = \begin{cases}
n_j, & \text{ if } \exists~ t,l \geq 0 \text{ satisfying } t + l \geq s-1 \text{ such that }\\
& \hspace{0.5cm} n_{j-l}, n_{j-l-1}, \ldots, n_j, \ldots, n_{j+t-1}, n_{j+t} \in C_i,\\
0, & \text{ otherwise,}
\end{cases}
\]
for all $i = 1,\ldots, k$; $j = 1,\ldots,d$.
}\label{def:iom}
\remark{
Given the integer Overlap matrix {\color{black}{of}} $s$-scale for a music $\mathcal{O}$, its corresponding binary Overlap matrix is uniquely determined and easily obtained by replacing nonzero entries in the integer Overlap matrix with $1$. The converse is not true.
} \label{rmk:iom_to_bom}
\begin{proposition} \label{prop}
If $M_{k\times d}^s=\{m_{ij}^s\}$ is the binary Overlap matrix {\color{black}{of}} $s$-scale for $\mathcal{O}$, then the followings hold
\begin{enumerate}[(i)]
\item $M_{k\times d}^s$ is a binary matrix belonging to $s$-scale.
\item $m_{ij}^s = 1$ implies that $n_j \in C_i$.
\item If $n_j \notin C_i$ then $m_{ij}^s = 0$.
\end{enumerate}
\end{proposition}
\begin{remark}
The converse of $(ii)$ and $(iii)$ is not necessarily true.
\end{remark}
\begin{proof}[Proof of Proposition \ref{prop}]
Let $M_{k\times d}^s=\{m_{ij}^s\}$ be the binary Overlap matrix {\color{black}{of}} $s$-scale for $\mathcal{O}$. It is easy to see that $(ii)$ and $(iii)$ are straightforward from the definition \ref{def:bom}. To prove $(i)$, since $m_{ij}^s$ is either $0$ or $1$ for all $i,j$, hence $M_{k\times d}^s$ is a binary matrix, it remains to show that on each row of $M_{k\times d}^s$ any entry equal to $1$ stays in a consecutive sequence of length at least $s$ columns that equal to 1.
Let $m_{ij}^s=1$. By definition \ref{def:bom}, there exist $ t,l \geq 0 $ satisfying $t + l \geq s-1$ such that $n_{j-l}$, $n_{j-l-1}, \ldots, n_j, \ldots, n_{j+t-1}$, $n_{j+t} \in C_i$. In other words, there exists a consecutive sequence of at least $s$ notes including $n_j$ in $\mathcal{O}$ that belong to $C_i$. Now, in turn, $m_{i,j-l}^s = 1$ since there exist $u=0$, $r = t+l \geq0$ satisfying $u+r = t+l \geq s-1$ such that $n_{j-l-u} (= n_{j-l}), n_{j-l-u-1} (=n_{j-l-1}) \ldots, n_{j-l+r-1} ( = n_{j+t-1}), n_{j-l+r} (= n_{j+t}) \in C_i$. Analogously, we can show that $m_{i,j-l-1}^s = \ldots = m_{i,j+t}^s = 1$. Thus, $M_{k\times d}^s=\{m_{ij}^s\}$ belongs to $s$-scale.
\end{proof}
\begin{remark} Given a music piece $\mathcal{O}$, the integer Overlap matrix (and thus the binary Overlap matrix as well, by Remark \ref{rmk:iom_to_bom}) {\color{black}{of $s$-scale $M_{k\times d}^s$ for $\mathcal{O}$}} is uniquely determined.
\end{remark}
In Algorithm \ref{algorithm1} we give an algorithm to compute the integer Overlap matrix {\color{black}{of}} $s$-scale $M_{k\times d}^s$ for a given music $\mathcal{O}$.
\algdef{SE}[SUBALG]{Indent}{EndIndent}{}{\algorithmicend\ }%
\algtext*{Indent}
\algtext*{EndIndent}
\begin{algorithm}
\caption{Algorithm to compute integer Overlap matrix {\color{black}{of}} $s$-scale $M_{k\times d}^s$}\label{algorithm1}
\begin{algorithmic}
\State Given $\mathcal{O}$ and Cycle information $C_1, \ldots, C_k$.
\State Set $M_{k\times d}^s = \mathbb{O}_{k\times d}$ (zero matrix).
\State Let $j = 1$.
\State For each row $i = 1,\ldots, k$, repeat the followings until $j=d$.
\State {\bf Step 1: Find}
\begin{equation}
q = \argmin_\beta \{ j\leq \beta \leq d: n_\beta \in C_i\}.
\label{inCi}
\end{equation}
\Indent\Indent
\If {\eqref{inCi} has no solution}
\State break
\Else
\State Go to Step 2.
\EndIf
\EndIndent
\EndIndent
\State {\bf Step 2: Find}
\begin{equation}
\label{not_inCi}
r = \argmin_\gamma \{ q < \gamma \leq d: n_\gamma \notin C_i\}.
\end{equation}
\Indent\Indent
\If { \eqref{not_inCi} has no solution}
\If { $d-q \geq s-1$}
$$m_{i,j}^s = n_j, \quad j = q,\ldots,d.$$
\EndIf
\State {\bf break}
\ElsIf {\eqref{not_inCi} has a solution and $r-q\geq s$}
$$m_{i,j}^s = n_j, \quad j = q, \ldots r-1.$$
\EndIf
\EndIndent
\EndIndent
\State Set $j = r$ and come back to Step 1.
\end{algorithmic}
\end{algorithm}
In the case of Suyeonjang which is composed of $d=440$ notes and has in total eight Cycles, the binary Overlap matrix {\color{black}{of}} $4$-scale $M_{8\times440}^4$ is displayed in \figref{fig:syj_overlap4}. In \figref{fig:syj_overlap4} the horizontal axis represents the time sequence the music flows and the vertical axis represents the cycle number, from $C_1$ to $C_8$. The zero entries are left blank and the entries that equal to $1$ are colored. Notice that {\color{black}{at}} $s$-scale, each colored block is of length at least $s$ entries.
\begin{figure}[!h]
\begin{center}
\includegraphics[scale=0.6]{syjom.png}
\caption{The binary Overlap matrix {\color{black}{of $4$-scale for Suyeonjang}}. The zero entries are left blank and the entries that equal to $1$ are colored. {\color{black}{Credit: \cite{TPJ}}} }
\label{fig:syj_overlap4}
\end{center}
\end{figure}
According to the definition of the binary Overlap matrix $M_{k\times d}^s$, the entries $m_{ij}^s$ can be either $0$ or $1$ depending on whether there exists a consecutive sequence of at least $s$ notes containing the note $n_j$ of the music that belongs to the Cycle $C_i$ or not.
A zero entry $m_{ij}^s=0$ does not necessarily mean that the note $n_j$ does not belong to the Cycle $C_i$. It can be the case that the note $n_j$ belongs to the Cycle $C_i$ but the consecutive sequence of notes containing note $n_j$ belonging to Cycle $C_i$ is not long enough on the scale being considered.
On the other hand, if $m_{ij}^s=1$ we can say for sure that the note $n_j$ of the music belongs to the Cycle $C_i$.
Thus,
the $j$-th column of the matrix $M_{k\times n}^s$ provide the information of how many cycles, as well as which ones, are overlapping ``{\color{black}{at}} $s$-scale'' at this point.
This is indeed the motivation why we call it the Overlap matrix.
For example, let us take a close look at the binary Overlap matrix $M_{8\times 440}^4$ {\color{black}{of}} $4$-scale for Suyeonjang. The first column of $M_{8\times 440}^4$ which is
\begin{equation*}
\begin{bmatrix}
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0
\end{bmatrix}^T
\end{equation*}
can mean that the first node $n_1$ does not belong to any Cycle, or in fact it does belong to some Cycle but at least one of the notes $n_2, n_3, n_4$ does not belong to that Cycle. On the other hands, the $25$-th column of $M_{8\times 440}^4$ which is
\begin{equation*}
\begin{bmatrix}
0 & 1 & 0 & 0 & 1 & 1 & 1 & 0
\end{bmatrix}^T
\end{equation*}
implies that the $25$-th note at least belongs to 4 Cycles, that are $C_2$, $C_5$, $C_6$, $C_7$. Similar to the first note $n_1$, it is inconclusive whether or not the $25$-th note belongs to $C_1, C_3, C_4, C_8$.
\vspace{0.3cm}
\begin{minipage}{.5\textwidth}
\begin{center}
\text{first column} \\ \vspace{0.5cm}
\scalebox{0.6}{
\begin{tikzpicture}[rotate=-90,every node/.style={minimum size=1cm-\pgflinewidth, outer sep=0pt}]
\draw[step=1cm,color=black] (0,0) grid (8,1);
\end{tikzpicture}
}
\end{center}
\end{minipage}%
\begin{minipage}{.3\textwidth}
\begin{center}
\text{$25$-th column} \\ \vspace{0.5cm}
\scalebox{0.6}{
\begin{tikzpicture}[rotate=-90,every node/.style={minimum size=1cm-\pgflinewidth, outer sep=0pt}]
\draw[step=1cm,color=black] (0,0) grid (8,1);
\node[fill={rgb:cyan,0.7; green,0.2; blue,0.2}] at (1.5,0.5) {$C_2$};
\node[fill={rgb:cyan,0.7; green,0.2; blue,0.2}] at (4.5,0.5) {$C_5$};
\node[fill={rgb:cyan,0.7; green,0.2; blue,0.2}] at (5.5,0.5) {$C_6$};
\node[fill={rgb:cyan,0.7; green,0.2; blue,0.2}] at (6.5,0.5) {$C_7$};
\end{tikzpicture}
}
\end{center}
\end{minipage}
\vspace{0.5cm}
\definition {A Cycle $C_i$ is said to \textit{survive} at note $n_j$ {\color{black}{at}} $s$-scale if $m_{ij}^s = 1$.
}
Denote by $S_j$ the set of Cycles which survive at note $n_j$ {\color{black}{at}} $s$-scale. It is obvious that
\begin{equation} \label{eq:S}
S_j = \begin{cases}
\emptyset, & \text { if } m_{ij}^s = 0, \forall i = 1,\ldots,k, \\
\{ C_t | t \in I_j \}, & \text { if } m_{ij}^s = \chi_{I_j} (i),
\end{cases}
\end{equation}
for $j = 1, \ldots, d$. Here, $I_j$ is an index set, $I_j \subset \{ 1, 2, \ldots, k\}$ and $\chi_{I_j}$ is the indicator function $\chi_{I_j}: \{ 1, 2, \ldots, k\} \to \{0,1\}$ such that
\begin{equation*}
\chi_{I_j}(x) = \begin{cases}
1, & \text{ if } x \in {I_j},\\
0, & \text{ if } x \notin {I_j}.
\end{cases}
\end{equation*}
Indeed, $I_j$ is the set of all the indices $i$ where $m_{ij}^s=1$ for a given $j$. In the case of Suyeonjang we have, for example, that $S_1 = \emptyset$ and $S_{25} = \{C_2, C_5, C_6, C_7\}$.
\section{Node pool}
\label{nodepool}
First consider the algorithmic composition by following the pattern of the binary Overlap matrix {\color{black}{of}} given $s$-scale of the considered music. Notice that {\color{black}{at}} $s$-scale the Cycles obtained from the considered music by TDA tools only overlap at certain notes (see the binary Overlap matrix of Suyeonjang in \figref{fig:syj_overlap4}) or sometimes they do not overlap at all (see the binary Overlap matrix of {\color{black}{a music called Taryong \cite{TPJ}}} in \figref{fig:tr_overlap4}). Also, there are many notes along the music flow where there is no Cycle surviving {\color{black}{at}} $s$-scale. At those notes, more freedom of node choice can be given. We will build up a so-called Node pool (denoted by $\mathcal{P}$), from which we choose node for those places where there is no Cycle surviving {\color{black}{at}} the considered $s$-scale. The Node pool is a collection of nodes that satisfies the node frequency distribution.
\begin{figure}[!h]
\begin{center}
\includegraphics[scale=0.8]{trom.png}
\caption{The binary Overlap matrix {\color{black}{of $4$-scale for Taryong}}. The zero entries are left blank and the entries that equal to $1$ are colored. Credit: \cite{TPJ} }
\label{fig:tr_overlap4}
\end{center}
\end{figure}
\begin{table}[!h]
\begin{center}
\caption{Frequency versus node for Suyeonjang, Songkuyeo and Taryong music. Credit: \cite{TPJ}.}
\label{tab:freq}
{\footnotesize{
\begin{tabular}{| c | |c c|| c c|| c c|}
\hline
{Rank}& {Suyeonjang} & & {Songkuyeo} & & {Taryong} & \\
\hline
1 & $n_{18}$ & 76 & $n_{20}$ & 65 & $n_{16}$ & 38 \\
2 & $n_{6}$ & 57 & $n_{31}$ & 53 & $n_{11}$ & 28 \\
3 & $n_{11}$ & 44 & $n_{13}$ & 45 & $n_{13}$ & 23 \\
4 & $n_{22}$ & 44 & $n_{26}$ & 44 & $n_{26}$ & 18 \\
5 & $n_{1}$ & 30 & $n_{8}$ & 27 & $n_{29}$ & 17 \\
6 & $n_{20}$ & 26 & $n_{18}$ & 23 & $n_{31}$ & 15 \\
7 & $n_{27}$ & 22 & $n_{4}$ & 18 & $n_{28}$ & 15 \\
8 & $n_{3}$ & 16 & $n_{33}$ & 18 & $n_{3}$ & 14 \\
9 & $n_{28}$ & 14 & $n_{6}$ & 11 & $n_{18}$ & 13 \\
10 & $n_{12}$ & 10 & $n_{16}$ & 11 & $n_{15}$ & 11 \\
11 & $n_{16}$ & 9 & $n_{25}$ & 11 & $n_{12}$ & 10 \\
12 & $n_{26}$ & 9 & $n_{19}$ & 10 & $n_{22}$ & 10 \\
13 & $n_{31}$ & 9 & $n_{24}$ & 10 & $n_{6}$ & 9 \\
14 & $n_{2}$ & 7 & $n_{27}$ & 10 & $n_{32}$ & 8 \\
15 & $n_{4}$ & 7 & $n_{28}$ & 9 & $n_{17}$ & 7 \\
16 & $n_{23}$ & 7 & $n_{32}$ & 8 & $n_{20}$ & 7 \\
17 & $n_{9}$ & 6 & $n_{2}$ & 6 & $n_{4}$ & 5 \\
18 & $n_{10}$ & 6 & $n_{15}$ & 5 & $n_{9}$ & 4 \\
19 & $n_{5}$ & 5 & $n_{7}$ & 4 & $n_{0}$ & 3 \\
20 & $n_{8}$ & 5 & $n_{11}$ & 3 & $n_{14}$ & 3 \\
21 & $n_{13}$ & 5 & $n_{12}$ & 3 & $n_{2}$ & 2 \\
22 & $n_{0}$ & 4 & $n_{14}$ & 3 & $n_{5}$ & 2 \\
23 & $n_{7}$ & 3 & $n_{17}$ & 3 & $n_{7}$ & 2 \\
24 & $n_{17}$ & 3 & $n_{21}$ & 3 & $n_{8}$ & 2 \\
25 & $n_{19}$ & 3 & $n_{23}$ & 3 & $n_{19}$ & 2 \\
26 & $n_{21}$ & 2 & $n_{35}$ & 3 & $n_{21}$ & 2 \\
27 & $n_{25}$ & 2 & $n_{0}$ & 2 & $n_{27}$ & 2 \\
28 & $n_{29}$ & 2 & $n_{3}$ & 2 & $n_{33}$ & 2 \\
29 & $n_{30}$ & 2 & $n_{9}$ & 2 & $n_{34}$ & 2 \\
30 & $n_{32}$ & 2 & $n_{10}$ & 2 & $n_{35}$ & 2 \\
31 & $n_{14}$ & 1 & $n_{36}$ & 2 & $n_{1}$ & 1 \\
32 & $n_{15}$ & 1 & $n_{34}$ & 2 & $n_{10}$ & 1 \\
33 & $n_{24}$ & 1 & $n_{1}$ & 1 & $n_{23}$ & 1 \\
34 & & & $n_{5}$ & 1 & $n_{24}$ & 1 \\
35 & & & $n_{22}$ & 1 & $n_{25}$ & 1 \\
36 & & & $n_{29}$ & 1 & $n_{30}$ & 1 \\
37 & & & $n_{30}$ & 1 & $n_{38}$ & 1 \\
38 & & & & & $n_{36}$ & 1 \\
39 & & & & & $n_{37}$ & 1 \\
40 & & & & & $n_{39}$ & 1 \\
\hline
\end{tabular}
}}
\end{center}
\end{table}
Let us take Suyeonjang as an example again. According to our node definition, Suyeonjang is of length $440$ notes that consists of $33$ distinct nodes. The node frequency distribution of Suyeonjang is shown in Table \ref{tab:freq} where two additional music pieces, Songkuyeo and Taryong's node frequency distributions are also shown.
Imagine that we have a set of $440$ nodes where, for example, the node $n_{18}$ has $76$ copies, $n_{6}$ has $57$ copies and so on. Then the chance of randomly picking up the node $n_j$ can be the same as its probability:
\[
\text{ Node probability of $n_j$} = \frac{\text{ Node frequency of $n_j$}} {\text{ Total number of node frequencies}}
\]
In general, consider a music of length $d$ notes that flows in the following order $\mathcal{L} = \{n_1, \ldots, n_d\}$. Let $\{ \nu_1, \ldots, \nu_q\}$ be the set of its distinct nodes as before, with the node frequencies are $f_1, \ldots, f_q$, respectively.
Then $\mathcal{P}$ for this music is a multiset made of all the nodes $\nu_1, \ldots, \nu_q$, where node $\nu_1$ appears in the set $f_1$ times, $\nu_2$ appears $f_2$ times and so on.
\[
\mathcal{P} = \{ \underbrace{\nu_1, \ldots, \nu_1}_{f_1\text{ times}}, \underbrace{\nu_2, \ldots, \nu_2}_{f_2\text{ times}}, \ldots, \underbrace{\nu_q, \ldots, \nu_q}_{f_q\text{ times}} \}
\]
Notice that
\[
f_1 + \ldots + f_q = d,
\]
thus, $\mathcal{P}$ contains exactly $d$ nodes that made up from $q$ distinct nodes from the music. In other words, $\mathcal{P}$ is a permutation of the set $\mathcal{L} = \{n_1, \ldots, n_d\}$. The chance of picking a node from $\mathcal{P}$ is equal to its probability, $p(\nu_j) = \frac{f_j}{d}$.
\section{Algorithmic composition - Algorithm A}
\label{algorithm}
The Overlap matrix of Suyeonjang in \figref{fig:syj_overlap4} is found to be related to the unique structure of Dodeuri pattern \cite{TPJ}. The Overlap matrices show how the Cycles are distributed and interconnected along the music flow. The idea of creating new music algorithmically is shown in the flowchart in \figref{fig:flowchart}.
\begin{figure}[!h]
\begin{center}
\begin{tikzpicture}
\draw (0.5,0) rectangle (4.5,1) node[midway] {Seed music $\mathcal{O}$};
\draw[->,thick] (2.5,0) -- (7,-1);
\draw (5,-1) rectangle (9,-2) node[midway] {Distance matrix $\{\delta_{ij}\}$};
\draw [->,thick] (7,-2) -- (7,-3.5);
\draw (6,-4.5) rectangle (8,-3.5) node[midway] {Cycles $C_i$};
\draw [->,thick] (6,-4) -- (5,-4);
\draw (0,-3.5) rectangle (5,-4.5) node[midway] {Binary Overlap matrix $M_{ij}^s$};
\draw[->,thick] (2.5,0) -- (-1.75,-1);
\draw (-3.5,-1) rectangle (0,-2.5) node[midway,align=center] {Node frequency \\distribution};
\draw [->,thick] (-1.75,-2.5) -- (-1.75,-3.5);
\draw (-3,-3.5) rectangle (-0.5,-4.5) node[midway] {Node pool $\mathcal{P}$};
\draw [->,thick] (-1.75, -4.5) -- (2.3,-6);
\draw [->,thick] (2.5,-4.5) -- (2.5,-6);
\draw [->,thick] (7,-4.5) -- (2.7,-6);
\draw (0.5,-6) rectangle (4.5,-7) node[midway] {New music $\mathcal{O}'$};
\end{tikzpicture}
\end{center}
\caption{Flowchart of algorithmic creation of new music.}
\label{fig:flowchart}
\end{figure}
For the preparation we need Node pool, Cycles and binary Overlap matrix.
Given the music that we consider (Suyeonjang for example), it is straightforward to get the node frequency distribution and then build up the Node pool. On the other hand, from the seed music we can construct the music network and then find the distance matrix. Next, the distance matrix is plugged into Javaplex and by using TDA tools we find the barcode and corresponding Cycle information. The Cycles are then used to obtain the binary Overlap matrix.
Given the music of length $d$ notes which is a music in Jeongganbo that flows in the following order $\mathcal{L} = \{ n_1, \ldots, n_d\}$, our goal is to algorithmically create new music of the same length $d$ that flows in the following order $\mathcal{L'} = \{ n_1', \ldots, n_d'\}$ such that the pattern of the binary Overlap matrix {\color{black}{of}} given $s$-scale of the seed music is strictly followed and the new music sounds similar to the seed music holding particular patterns. Below we explain how to choose each note $n_j', j = 1,\ldots,d$ of the new music.
Assume that following the process described above we found $k$ Cycles $C_1, C_2,\ldots, C_k$. Let $S_j$ be the set of Cycles which survive at note $n_j$ {\color{black}{at}} $s$-scale, as defined in \eqref{eq:S}. Along the music flow, at each note $n_j$ either there are some Cycles surviving {\color{black}{at}} $s$-scale ($S_j\neq \emptyset$) or none of the Cycles survive ($S_j=\emptyset$). Denote by $\mathcal{I}_j$ the set of nodes belonging to the intersection of those Cycles surviving {\color{black}{at}} $s$-scale that overlap at note $n_j$:
\[
\mathcal{I}_j = \{ n_i | n_i \in \bigcap\limits_{C_i \in S_j} C_i \}.
\]
If some of the Cycles survive at note $n_j$ {\color{black}{at}} $s$-scale, i.e., $S_j \neq\emptyset$, then the new note $n_j'$ is randomly chosen from the intersection of those Cycles:
\begin{equation*}
n_j' = \text{ random choice from } \mathcal{I}_j \iff S_j \neq \emptyset, j = 1,\ldots,d.
\end{equation*}
Otherwise, if none of the $k$ Cycles survive at note $n_j$ {\color{black}{at}} $s$-scale, i.e., $S_j = \emptyset$, we randomly pick up a node from the Node pool $\mathcal{P}$ with or without a constraint depending on whether or not there exist Cycles surviving at node $n_{j-1}$ and node $n_{j+1}$ {\color{black}{at}} $s$-scale as follows:
\begin{equation*}
\resizebox{ \textwidth}{!} {$
n_j' = \begin{cases}
\text{ random choice from } \mathcal{P} & \iff S_{j-1} = S_j = S_{j+1} =\emptyset, \\
\text{ random choice from } \mathcal{P} \setminus \mathcal{I}_{j-1} & \iff S_{j-1} \neq \emptyset, S_j = S_{j+1} = \emptyset, \\
\text{ random choice from } \mathcal{P} \setminus \mathcal{I}_{j+1} & \iff S_{j-1} = S_j = \emptyset, S_{j+1} \neq \emptyset, \\
\text{ random choice from } \mathcal{P} \setminus (\mathcal{I}_{j-1} \bigcup \mathcal{I}_{j+1}) & \iff S_{j-1} \neq \emptyset, S_j = \emptyset, S_{j+1} \neq \emptyset,
\end{cases}$
}
\end{equation*}
for $j = 1,\ldots,d$. It is easy to see that in this way, we strictly follow the pattern of the binary Overlap matrix.
\begin{remark}
After getting new music $\mathcal{O}'$ we can apply to it the process of constructing music network, followed by using TDA tools, to find its corresponding binary and integer Overlap matrices. It is observed that new music $\mathcal{O}'$ generated by the procedure in \figref{fig:flowchart}, although sounds nice, neither necessarily has the same number of Cycles nor necessarily reflects the overlap pattern of the original seed music $\mathcal{O}$. In other words, both the binary and integer Overlap matrices of $\mathcal{O}'$ can be very different from those of $\mathcal{O}$. This is illustrated in the following examples where we use Suyeonjang as the seed music. We provide here only the binary Overlap matrices since it is obvious that if two musics have different binary Overlap matrices then their integer Overlap matrices are also different.
\end{remark}
\begin{example} \label{ex:syjnew5}
Figure \ref{fig:syjnew5} shows a music generated from Suyeonjang which has only four Cycles.
\begin{figure}[!h]
\begin{center}
\includegraphics[scale=0.8]{SYJnew_5om.png}
\caption{The binary Overlap matrix {\color{black}{of $4$-scale for a new music generated from Suyeonjang}}. The zero entries are left blank and the entries that equal to $1$ are colored. The new music has four Cycles. }
\label{fig:syjnew5}
\end{center}
\end{figure}
\end{example}
\begin{example} \label{ex:syjnew63}
Figure \ref{fig:syjnew63} shows another music generated from Suyeonjang which also has only four Cycles. The overlap pattern of this music is quite different from that of the music shown in Example \ref{ex:syjnew5}.
\begin{figure}[!h]
\begin{center}
\includegraphics[scale=0.8]{SYJnew_63om.png}
\caption{The binary Overlap matrix {\color{black}{of $4$-scale for a new music generated from Suyeonjang}}. The zero entries are left blank and the entries that equal to $1$ are colored. The new music has four Cycles. }
\label{fig:syjnew63}
\end{center}
\end{figure}
\end{example}
\begin{example}
Figure \ref{fig:syjnew68} shows a music generated from Suyeonjang which has six Cycles. Although this music has more Cycles than the musics shown in Examples \ref{ex:syjnew5} and \ref{ex:syjnew63}, it obviously has less Cycles than Suyeonjang. It is not exactly the same as the binary Overlap matrix of Suyeonjang but shows some similarity in the overlapping sense.
\begin{figure}[!h]
\begin{center}
\includegraphics[scale=0.8]{SYJnew_68om.png}
\caption{The binary Overlap matrix {\color{black}{of $4$-scale for a new music generated from Suyeonjang}}. The zero entries are left blank and the entries that equal to $1$ are colored. The new music has six Cycles. }
\label{fig:syjnew68}
\end{center}
\end{figure}
\end{example}
\section{Creating new music with artificial neural network - Algorithm B}
\label{ANN}
An alternative approach of generating new music is to use the artificial neural network explained in the following.
\subsection{Generating seed Overlap matrix}
\label{seed}
Given the integer Overlap matrix {\color{black}{of $s$-scale for Suyeonjang}} $M_{k\times d}^s$,
our first goal is to generate an integer Overlap matrix $\widetilde{M}_{k\times d}^s$ that has the same size and similar pattern as $M_{k\times d}^s$, which will be used as a seed Overlap matrix towards the artificial neural network.
For the given music, there could be various ways of generating seed Overlap matrix which has the same size as the Overlap matrix of the given music and also has similar patterns as the given music. Below we introduce three algorithms for generating a seed integer Overlap matrix $\widetilde{M}_{k\times d}^s$ from $M_{k\times d}^s$.
{\color{black}{
The common strategy of the following three algorithms is to generate a binary Overlap matrix that has the same size and mimic the overlapping pattern of the given integer Overlap matrix first, then convert it to an integer Overlap matrix. The idea of each algorithm is as follows.
{\em Row by Row Method:} Overlap Matrix Algorithm \#1 is row by row approach. That is, the first binary row is determined based on the number of blocks of consecutive nonzero entries of the first row of the given Overlap matrix. Next, using the overlapping pattern and node information, the second binary row is generated so that it overlaps or does not overlap the first row depending on whether the first and the second rows of the given Overlap matrix overlap or not. This process is continued for all rows. As a result we get a binary Overlap matrix that has the same size, same frequency of blocks of consecutive nonzero entries and preserve the overlapping pattern of the given Overlap matrix. To convert the generated binary Overlap matrix to an integer Overlap matrix, we convert column by column using the node information.
{\em Element by Element {\color{black}{Method}}:} Overlap Matrix Algorithm \#2 is element by element approach. That is, nonzero entries in given Overlap matrix are first replaced with 1 to generate a binary Overlap matrix that has exactly the same overlapping pattern as the given Overlap matrix. Then, from the node information, entries equal to 1 in the generated binary Overlap matrix are converted back to integer numbers. This algorithm is the simplest one if we just want to get a new but very similar Overlap matrix.
{\em Column by Column Method:} Overlap Matrix Algorithm \#3 is column by column approach. After converting given integer Overlap matrix to a binary Overlap matrix, we collect all kinds of columns in it and generate new Overlap matrix according to the frequencies of the columns. {\color{black}{In this}} way we automatically preserve the overlapping pattern of the given Overlap matrix, while still have the flexibility in the number of blocks as well as the length of each block of consecutive nonzero entries. The difficulty in this algorithm is that, a new column has to be carefully chosen so that the number of consecutive nonzero entries is not less than $s$ to satisfy the definition of an Overlap matrix {\color{black}{of}} $s$-scale.
}}
\vspace{0.4cm}
\noindent
\rule{\textwidth}{1pt}
\vspace{-0.8cm}
\begin{center}
Overlap Matrix Algorithm \#1
\end{center}
\vspace{-0.1cm}
\hrule
\vspace{0.3cm}
\vspace{0.5cm}
\begin{enumerate}
\item [Step 1:] Find the frequency $f_i$ of blocks of consecutive nonzero entries in row $i$ of $M_{k\times d}^s$, $i=1,\ldots,k$.
\item [Step 2:] For each cycle $C_i$, identify the set of cycles that do not overlap $C_i$. Let $S_i$ be the set of all indices $j$ of nodes $n_j$ that constitute those cycles.
\item [Step 3:] Let $\widetilde{B}_{k\times d}^s$ be a $k\times d$ zero matrix. Then for each $i$ randomly pick up $f_i$ indices $j_1,\ldots, j_{f_i}$ that is not in $S_i$ and set $\widetilde{b}_{i,j_p+q} = 1$, $p = 1,\ldots, f_i$; $q = 0,1,\ldots,s-1$. Repeat this for all $i = 1,\ldots,k$. This step generates $\widetilde{B}_{k\times d}^s$ as a binary {\color{black}{Overlap}} matrix.
\item [Step 4:] For each non-zero column $\bold{b_j}$ of $\widetilde{B}_{k\times d}^s$ let $U_j$ be the set of all nodes that constitute those cycles that correspond to nonzero entries in $\bold{b_j}$. Then replace all entries equal to $1$ in $\bold{b_j}$ by a random node index $n_j$ chosen from $U_j$. This step converts $\widetilde{B}_{k\times d}^s$ to an integer {\color{black}{Overlap}} matrix $\widetilde{M}_{k\times d}^s$.
\end{enumerate}
\vspace{1.6cm}
\hrule
\noindent
\rule{\textwidth}{1pt}
\vspace{-0.8cm}
\begin{center}
Overlap Matrix Algorithm \#2
\end{center}
\vspace{-0.1cm}
\hrule
\vspace{0.3cm}
\vspace{0.5cm}
\begin{enumerate}
\item [Step 1:] Replace nonzero entries in $M_{k\times d}^s$ with $1$ to convert $M_{k\times d}^s$ to a binary Overlap matrix $B_{k\times d}^s$.
\item [Step 2:] Assume that $C_i = \{ n_1^i, n_2^i,\ldots,n_{r_i}^i\}, i = 1,\ldots,k$. Replace entries equal to $1$ in row $i$ of $B_{k\times d}^s$ by a random node $n_j^i$ belonging to $C_i$ by the method \texttt{random.choice(C\_i)}.
\item [Step 3:] Repeat Step 2 for all rows in $B_{k\times d}^s$.
\end{enumerate}
\vspace{0.3cm}
\hrule
\noindent
\rule{\textwidth}{1pt}
\vspace{-0.8cm}
\begin{center}
Overlap Matrix Algorithm \#3
\end{center}
\vspace{-0.1cm}
\hrule
\vspace{0.3cm}
\vspace{0.5cm}
\noindent\textbf{Procedure 1}: Generate a binary Overlap matrix $\widetilde{B}_{k\times d}^s$.
\begin{enumerate}
\item [Step 1:] Convert $M_{k\times d}^s$ to a binary Overlap matrix $B_{k\times d}^s$.
\item [Step 2:] Choose a column for $\widetilde{B}_{k\times d}^s$ by a random selection from the set of all distinct columns in $B_{k\times d}^s$ according to the frequencies of the columns by the method \texttt{random.choices(C,F)}, where $C=[c_1,\ldots,c_i]$ denotes the list of all distinct columns in $B_{k\times d}^s$ and $F = [f_1,\ldots,f_i]$ is the list of their corresponding frequencies.
\item [Step 3:] Select a number for how many times the column selected in Step 2 will be repeated in $\widetilde{B}_{k\times d}^s$. This number is chosen by \texttt{random.choices} from the set of repeated columns according to the repeating frequencies.
\item [Step 4:] The next column is also chosen by the method \texttt{random.choices} but from the set of all distinct columns in $B_{k\times d}^s$ that are adjacent to the column selected in Step 2. The resulting column in Step 4 after placing in $\widetilde{B}_{k\times d}^s$ should satisfy the continuous condition, meaning that any entry equal to $1$ in $\widetilde{B}_{k\times d}^s$ should be staying in a consecutive sequence of length at least $s$ columns that equal to $1$.
\item [Step 5:] Repeat Step 2-4 if necessary until the frequencies of blocks of consecutive entries equal to $1$ on each row of $B_{k\times d}^s$ and $\widetilde{B}_{k\times d}^s$ are similar.
\end{enumerate}
\noindent \textbf{Procedure 2}: Convert $\widetilde{B}_{k\times d}^s$ to an integer Overlap matrix $\widetilde{M}_{k\times d}^s$.
\begin{enumerate}
\item [Step 1:] Find all kinds of columns that $M_{k\times d}^s$ has and save them in a variable named \texttt{col\_choice}.
\item [Step 2:] For each binary column $\bold{b_j}$ in $\widetilde{B}_{k\times d}^s$, find all columns in \texttt{col\_choice} that have the same indices of nonzero entries as $\bold{b_j}$, then randomly choose one of them, say $\bold{\widetilde{m_j}}$, to add to $\widetilde{M}_{k\times d}^s$.
\end{enumerate}
\vspace{0.3cm}
\hrule
\subsection{Training data set}
In order to input the seed Overlap matrix into the artificial neural network for generating a new music, we need to construct an optimized artificial neural network corresponding to the given music. Such network can be obtained by training a machine with the given music. Note that the number of the given music is not large. For example, if we consider a single music, e.g. Suyeonjang, the number of the input music with which we train the machine is simply unity. That is, the number of data required for training is too small. In this section, we use a simple method of the {\it periodic extension} of the given music to generate more music for training. In our future research, however, we need to investigate more general approaches to address the issue of the number of the input music. The periodic extension is reasonable approach reflecting the Dodeuri music patterns.
Let $M_{k\times d}^s$, which from now on will be denoted as $M$, be the integer Overlap matrix of the given music {\color{black}{and $\mathcal{L}$ be the ordered sequence of notes as the music flow.}}
We augment seed music by shifting the original music one space at a time:
\begin{equation}
\begin{matrix}
M^{(i)} & = & \overline{M}_{:,i:i + d - 1}, \\
\mathcal{L}^{(i)} & = & \overline{\mathcal{L}}_{i:i + d - 1},
\end{matrix}
\label{eq:augmentation}
\end{equation}
where
$\overline{M} = [{\color{black}{M \;\; M}}]$,
$\overline{\mathcal{L}} = \begin{bmatrix}\mathcal{L} \\ \mathcal{L} \end{bmatrix}$, $d$ is the length of a seed music {\color{black}{and $i = 1,\ldots,d$}}.
For the illustration, let us use Suyeonjang as the seed music. As explained above, for this case, we have $d = 440$ and $k = 8$ for Suyeonjang.
Here, we think of a music flow $\mathcal{L}$ as a vector whose elements are indices of notes. Let $\mathcal{X}=\left\{ \overline{M}_{:,i:i+439}\right\}_{i=1}^{440}$ and $\mathcal{Y}=\left\{ \overline{\mathcal{L}}_{i:i+439}\right\}_{i=1}^{440}$. Figure \ref{fig:dataset} illustrates the construction of our dataset.
\begin{figure}[!h]
\centering
\includegraphics[width=0.8\textwidth]{dataset_new.pdf}
\caption{Dataset construction: periodic extension}
\label{fig:dataset}
\end{figure}
We design a neural network $f_\theta$ such that $f_\theta(M') = {y}'$ where $M' \in \mathcal{X}$ and $y' \in \mathcal{Y}$ . Note that $f_\theta$ only satisfies $f_\theta(M') = {y}'$ in the optimization sense.
\subsection{Construction of music generation network $f_\theta$}
For the construction of $f_\theta$ introduced above, we seek a set of parameters $\theta^{*}$ that maximizes the probability of the real music flow $\mathcal{L}$ given the integer Overlap matrix $M^{s}_{k \times d}$:
$$
\theta^{*} = \operatornamewithlimits{argmax}_{\theta} \sum_{(\mathcal{L}^{(i)}, M^{(i)})}\log p\left( \mathcal{L}^{(i)} \mid M^{(i)} \right),
$$
where $\theta$ is a set of parameters of our model, {\color{black}{$p$ is the conditional probability distribution and}} $(\mathcal{L}^{(i)}, M^{(i)})$ is the $i$-th pair of the real music flow and its corresponding integer Overlap matrix induced by $\mathcal{L}$ and $M^{s}_{k \times d}$. We model the conditional probability distribution $p$ with a Multi-Layer Perceptron (MLP), but one can use any nonlinear function. MLPs are a sequence of affine transformations followed by element-wise nonlinearity. Let $f^{(l)}$ be the $l$-th hidden layer of a MLP and let $\mathbf{a}^{(l-1)} \in \mathbb{R}^{d^{(l-1)}}$ be an input vector of $f^{(l)}$ where $d^{(l-1)}$ is the dimensionality of $(l-1)$-th hidden layer. The output of $f^{(l)}$ is:
$$
f^{(l)} \left( \mathbf{a}^{(l-1)} \right) = \sigma \left( \mathbf{W}^{(l)} \mathbf{a}^{(l-1)} + \mathbf{b}^{(l)} \right),
$$
where {\color{black}{$\sigma$ is an activation function}}, $\mathbf{W}^{(l)} \in \mathbb{R}^{d^{(l)} \times d^{(l-1)}}$ and $\mathbf{b}^{(l)} \in \mathbb{R}^{d^{(l)}}$ are learnable weight matrix and bias vector, respectively. A nonlinear function $\sigma$ is applied to each element of a vector. Each hidden layer can use a different activation function. Typical choices for $\sigma$ are sigmoid function, hyperbolic tangent function and Rectified Linear Unit (ReLU). Then, a MLP $f_\theta$ is the composition of hidden layers $f^{(l)}$s:
$$
\begin{matrix}
f_\theta & = & f^{(L)} \circ f^{(L-1)} \circ \cdots \circ f^{(1)}, \\
\theta & = & \left\{ \mathbf{W}^{(l)}, \mathbf{b}^{(l)} :l=1, \cdots, L \right\},
\end{matrix}
$$
where $L$ {\color{black}{is}} the number of hidden layers and $\mathbf{a}^{(0)}=\mathbf{x}$ is an input vector of $f_\theta$. For MLPs, the number of hidden layers, $L$ and the dimensionality of each hidden layer, $d^{(l)}$ are hyper-parameters to be determined.
In general, MLPs take a vector as an input while our input is a matrix. The simplest way to feed a matrix into a MLP is to flatten it to one dimensional vector. Our model $f_\theta$ takes the flattened vector of $M^{(i)}$ and outputs the $d$ probability distributions \textcolor{black}{over $q$ distinct notes. We note that each element of $\mathcal{L}^{(i)}$ is the node index so that we apply one-hot encoding to it. Hence, we generate the corresponding $d \times q$ matrix $\mathbf{L}^{(i)}$ such that $\mathbf{L}^{(i)}_{jk}=1$ if $j$-th note is equal to $\nu_k$, and $\mathbf{L}^{(i)}_{jk}=0$ otherwise. For our network, the output of the last hidden layer $\mathbf{a}^{(L)}$ is a $dq$-dimensional vector. Then, we reshape $\mathbf{a}^{(L)}$ into the $d \times q$ matrix $\hat{\mathbf{L}}^{(i)}$, and takes the softmax function over each row. The output of our model for $M^{(i)}$ is as follows:}
\begin{equation}
\hat{\mathbf{L}}^{(i)}_{jk}=\frac{\exp \left( \mathbf{a}^{(L)}_{q(j-1) + k} \right)}{\sum_{l=1}^{q} \exp \left( \mathbf{a}^{(L)}_{q(j-1) + l} \right)}.
\label{eq:softmax}
\end{equation}
$\hat{\mathbf{L}}^{(i)}_{jk}$ can be interpreted as the probability that the $j$-th note in the generated music is $\nu_k$. Then, a set of parameters of our model is updated toward minimizing the cross entropy loss between output probability distributions and the real music flow:
\begin{equation}
\operatorname{CrossEntropyLoss}\left(\hat{\mathbf{L}}^{(i)}, \mathbf{L}^{(i)} \right) = - \frac{1}{d} \sum\limits_{j=1}^{d} \sum\limits_{k=1}^{q} \mathbf{L}^{(i)}_{jk} \log \hat{\mathbf{L}}^{(i)}_{jk}.
\label{eq:cross-entropy}
\end{equation}
Figure \ref{fig:network} shows the architecture of our model.
\begin{figure}[htbp]
\centering
\includegraphics[width=\textwidth]{network_new.pdf}
\caption{The architecture of our model for Suyeonjang. We use a MLP with three hidden layers each of which has 440 dimensionality. The output is the 440 probability distributions over 33 distinct notes. The learnable parameters are updated toward minimizing the cross entropy loss.}
\label{fig:network}
\end{figure}
To evaluate our model, {\color{black}{we}} generated Suyeonjang-style musics using our model. The length $d$ of Suyeonjang is 440 and it has $q=33$ distinct notes and $k=8$ cycles. We used the binary Overlap matrix {\color{black}{of}} 4-scale. We obtained 440 data from the augmentation in Equation {\color{black}{\eqref{eq:augmentation}}} and used $70\%$ of them for training and the rest of them for evaluation. The detailed architecture of a MLP is shown in Table \ref{tab:architecture}. We optimized Equation {\color{black}{\eqref{eq:cross-entropy}}} with respect to the model's parameters using Adam optimizer with learning rate $0.001$ over 500 epochs.
\begin{table}[htbp]
\centering
\begin{tabular}{c|c|c}
\hline
$l$ & $d^{(l)}$ & $\sigma$ \\
\hline
$1$ & $440$ & ReLU \\
$2$ & $440$ & ReLU \\
$3$ & $440 \times 33$ & Softmax in Eq. {\color{black}{\eqref{eq:softmax} }}\\
\hline
\end{tabular}
\caption{The architecture of the MLP for generating Suyeonjang-style music}
\label{tab:architecture}
\end{table}
\subsection{Examples}
We generated music pieces with Algorithm A and Algorithm B.\footnote{
Some of the generated music pieces were played in June and July, 2021. Readers can listen those using the following YouTube links: {\lstinline{https://www.youtube.com/watch?v=_DKo8FjL7Mg&t=461s}} (June 5, 2021) and {\lstinline{https://www.youtube.com/watch?v=AxXKoFRlQiQ&t=751s}} (July 29, 2021). The original music with Haegeum instrument is played from 0:24 to 5:24 in the first link and 0:10 to 4:52 in the second link. }
For Algorithm B, we used the Overlap Matrix Algorithm \# 1.
Figure \ref{fig:example} shows the original Suyeonjang for Haegeum instrument (top), one of the generated music pieces with Algorithm {\color{black}{A}} (middle), and one of the generated music pieces with Algorithm {\color{black}{B}} (bottom). The music pieces in the middle and bottom are randomly selected from the automatically generated music pool.
\begin{figure}[htbp]
\centering
\includegraphics[width=\textwidth]{syj1.png}
\includegraphics[width=\textwidth]{syj_a1.png}
\includegraphics[width=\textwidth]{syj_a2.png}
\caption{Top: First few notes from the original Suyeonjang with Haegeum instrument. Middle: A music created by Algorithm A. Bottom: A music created by Algorithm B.}
\label{fig:example}
\end{figure}
\section{Conclusion}
\label{conclusion}
In this paper, we used topological data analysis, {\color{black}{Overlap}} matrix and artificial neural network approaches for machine composition of trained Korean music, particularly the {\it {Dodeuri}} music. Using the concept of training the composition principle, we could generate similar music pieces to Dodeuri music. Although the proposed method provides a framework of machine composition of Korean music, there are several issues that need further rigorous investigations. First of all, we will need to analyze the overall structures of the generated music through Algorithm A and Algorithm B, compare them with the original music and study its musical implications. Second, the current research considered only limited aspects of Korean music reflected on the Overlap matrix, but for a full consideration, we will need to consider other unique characteristics of Korean music such as meter, ornamenting symbols, {\it Sikimse}\footnote{Sikimse is a unique technique of Korean music that variates the given note by vibrating, sliding, breaking, etc. }, etc. Also, the current research used a rather simple periodic extension method for generating the training data set from the given seed music. Our future work will conduct a study on how to provide training data when the number of considered music pieces is small. These should be fully considered for the construction of more generalized machine composition of Korean music.
\vskip .2in
\noindent
{\bf{Acknowledgements:} }This work was supported by the NRF grant under grant number 2021R1A2C300964812. We thank Dr. Myong-Ok Kim for her translating Suyeonjangjigok into staff notation (\figref{fig:syj_original} and top figure of \figref{fig:example}).
\newpage
\bibliographystyle{plain}
| {'timestamp': '2022-03-30T02:31:16', 'yymm': '2203', 'arxiv_id': '2203.15468', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15468'} | arxiv |
\section{Introduction}
\textit{Count-Min sketch} is a hash-based data structure to represent a dynamically changing associative array $\boldsymbol{a}$ of counters in an approximate way. The array $\boldsymbol{a}$ can be seen as a mapping from some set $K$ of keys to $\mathbb{N}$, where $K$ is drawn from a (large) universe $U$. The goal is to support {\em point queries} about the (approximate) current value of $\boldsymbol{a}(p)$ for a key $p$. Count-Min is especially suitable for the streaming framework, when counters associated to keys are updated dynamically. That is, {\em updates} are (key,value) pairs $(p,\ell)$ with the meaning that $\boldsymbol{a}(p)$ is updated to $\boldsymbol{a}(p)+\ell$.
Count-Min sketch was proposed in \cite{cormode_improved_2005}, see e.g. \cite{DBLP:reference/db/Cormode18} for a survey. A similar data structure was introduced earlier in \cite{DBLP:conf/sigmod/CohenM03} named \textit{Spectral Bloom filter}, itself closely related to \textit{Counting Bloom filters} \cite{FanEtAl00}. The difference between Count-Min sketch and Spectral Bloom filter is marginal: while a Count-Min sketch requires hash functions to have disjoint codomains (rows of Count-Min matrix), a Spectral Bloom filter has all hash functions mapping to the same array, as does the regular Bloom filter. In this paper, we will deal with the Spectral Bloom filter version but will keep the term Count-Min sketch as more common in the literature.
Count-Min sketch supports negative update values $\ell$ provided that at each moment, each counter $\boldsymbol{a}(p)$ remains non-negative (so-called {\em strict turnstile model} \cite{liu2011methods}).
When updates are positive, the Count-Min update algorithm can be modified to a stronger version leading to smaller errors in queries. This modification, introduced in \cite{DBLP:conf/sigcomm/EstanV02} as \textit{conservative update}, is mentioned \cite{DBLP:reference/db/Cormode18}, without any formal analysis given in those papers. This variant is also discussed in \cite{DBLP:conf/sigmod/CohenM03} under the name \textit{minimal increase}, where it is claimed that it decreases the probability of a positive error by a factor of the number of hash functions, but no proof is given. We discuss this claim in the concluding part of this paper.
\newcommand{\lVert \boldsymbol{a} \rVert_{1}}{\lVert \boldsymbol{a} \rVert_{1}}
The case of positive updates is widespread in practice. In particular, a very common instance is \textit{counting} where all update values are $1$. This task occurs in different scenarios in network traffic monitoring, as well as other applications related to data stream mining \cite{DBLP:conf/sigcomm/EstanV02}. In bioinformatics, we may want to maintain, on the fly, multiplicities of $k$-mers (words of length $k$) occurring in a big dataset \cite{mohamadi2017ntcard,behera2018kmerestimate,shibuya_set-min_2020}. We refer to \cite{DBLP:conf/iccnc/EinzigerF15} for more examples of applications.
While it is easily seen that the error in conservative update can only be smaller than in Count-Min, obtaining more precise bounds is a challenging problem. Count-Min guarantees, with high probability, that the additive error can be bounded by $\varepsilon \lVert \boldsymbol{a} \rVert_{1}$ for any $\varepsilon$, where $\lVert \boldsymbol{a} \rVert_{1}$ is the $L1$-norm of $\boldsymbol{a}$ \cite{cormode_improved_2005}. In the counting setting, $\lVert \boldsymbol{a} \rVert_{1}$ is the length of the input stream which can be very large, and therefore this bound provides a weak guarantee in practice, unless the distribution of keys is very skewed and queries are made on frequent keys (\textit{heavy hitters}) \cite{liu2011methods,charikar2004finding,cormode2008finding}.
It is therefore an important practical question to analyse the improvement provided by the conservative update strategy compared to the original Count-Min sketch.
Probably the first attempt towards this goal was made in \cite{DBLP:conf/teletraffic/BianchiDLS12}, under assumption that all $\binom{n}{k}$ counter combinations are equally likely at each step ($n$ size of the Count-Min array, $k$ number of hash functions) which amounts to assuming uniform distribution on $\binom{n}{k}$ input keys.
For the regime when the number of distinct keys in the input considerably exceeds the sketch size, it was experimentally observed in \cite{DBLP:conf/teletraffic/BianchiDLS12} that frequent keys have essentially no error while the (over)estimate for less frequent keys tends be the same, for given input stream length and sketch size.
On the other hand,
it was experimentally shown
that in that regime, the uniform distribution of keys presents the worst-case scenario producing the largest
such estimate and a method was proposed to compute this estimate.
Another method for bounding the error proposed in \cite{DBLP:conf/iccnc/EinzigerF15}
}
is based on a simulation of spectral Bloom filters by a hierarchy of ordinary Bloom filters.
However, the bounds provided are not explicit but are expressed via a recursive relation based on false positive rates of involved Bloom filters.
Recent works \cite{DBLP:journals/corr/abs-2203-14549,benmazziane:hal-03613957} propose formulas for computing error bounds depending on key probabilities assumed independent but not necessarily uniform, in particular leading to an improved precision bounds for detecting heavy hitters.
In this paper, we provide a probabilistic analysis of the conservative update scheme for counting under the assumption of \textit{uniform distribution of keys} in the input. Our main result is a demonstration that the error in count estimates undergoes a phase transition
when the number of distinct keys grows relative to the size of the Count-Min array. We show that the phase transition threshold corresponds to the \textit{peelability threshold} for random $k$-uniform hypergraphs.
For the \textit{subcritical regime}, when the number of distinct keys is below the threshold, we show that the relative error for a randomly chosen key tends to $0$ asymptotically, with high probability. This contrasts with the regular Count-Min algorithm producing a relative error shown to be at least $1$ with constant probability.
For the \textit{supercritical regime}, we show that the average relative error is lower-bounded by a constant (depending on the number of distinct keys), with high probability. We prove this result for $k=2$ and conjecture that it holds for arbitrary $k$ as well. We provide computer simulations showing that the expected relative error grows fast after the threshold, with a distribution showing a peculiar multi-modal shape. In particular, keys with small (or zero) error still occur after the threshold, but their fraction quickly decreases when the number of distinct keys grows.
After defining Count-Min sketch and conservative update strategy in Section~\ref{countmin-and-CU} and introducing hash hypergraphs in Section~\ref{sec:hash}, we formulate the conservative update algorithm (or regular Count-Min, for that matter) in terms of a hypergraph augmented with counters associated to vertices. In Section~\ref{sec:main}, we state our main results and illustrate them with a series of computer simulations.
All technical proofs are provided in a separate Section~\ref{sec:proofs}.
In addition, in Section~\ref{sec:non-peelable}, we study a specific family of 2-regular $k$-hypergraphs that are sparse but not peelable. For such graphs we show that while the relative error of every key is $1$ with the regular Count-Min strategy, it is $1/k+o(1)$ for conservative update. While this result is mainly of theoretical interest, it illustrates that the peelability property is crucial for the error to be asymptotically vanishing.
Finally, in Section~\ref{sec:zipf}, we turn to non-uniform distributions and provide experimental evidence that for Zipf's distribution, the phase transition in average error does not occur.
\section{Count-Min and Conservative Update}
\label{countmin-and-CU}
We consider a (counting version of) Count-Min sketch to be an array $A$ of size $n$ of counters initially set to $0$, together with hash functions $h_1,\ldots,h_k$ mapping keys from a given universe to $[1..n]$.
To count key occurrences in a stream of keys, regular Count-Min proceeds as follows.
To process a key $p$, each of the counters $A[h_i(p)]$, $1\leq i\leq k$, is incremented by $1$.
Querying the occurrence number $\boldsymbol{a}(p)$ of a key $p$ returns the estimate $\hat{\boldsymbol{a}}_{CM}(p)=\min_{1\leq i\leq k}\{A[h_i(p)]\}$. It is easily seen that $\hat{\boldsymbol{a}}_{CM}(p)\geq \boldsymbol{a}(p)$.
A bound on the overestimate of $\boldsymbol{a}(p)$ is given by the following result adapted from \cite{cormode_improved_2005}.
\begin{theorem}[\cite{cormode_improved_2005}]
\label{countmin}
For $\varepsilon>0$, $\delta>0$, consider a Count-Min sketch with $k=\lceil \ln(\frac{1}{\delta}) \rceil$ and size $n=k\frac{e}{\varepsilon}$. Then $\hat{\boldsymbol{a}}_{CM}(p)- \boldsymbol{a}(p)\leq \varepsilon N$ with probability at least $1-\delta$, where $N$ is the size of the input stream.
\end{theorem}
While Theorem~\ref{countmin} is useful in some situations,
it has a limited utility as it bounds the error with respect to the stream size which can be very large.
\textit{Conservative update} strengthens Count-Min by increasing only the smallest counters among $A[h_i(p)]$. Formally, for $1\leq i\leq k$,
$A[h_i(p)]$ is incremented by $1$ only if $A[h_i(p)]=\min_{1\leq j\leq k}\{A[h_j(p)]\}$ and is left unchanged otherwise.
The estimate of $\boldsymbol{a}(p)$, denoted $\hat{\boldsymbol{a}}_{CU}(p)$, is computed as before: $\hat{\boldsymbol{a}}_{CU}(p)=\min_{1\leq i\leq k}\{A[h_i(p)]\}$.
It can be seen that $\hat{\boldsymbol{a}}_{CU}(p)\geq \boldsymbol{a}(p)$ still holds, and that $\hat{\boldsymbol{a}}_{CU}(p)\leq \hat{\boldsymbol{a}}_{CM}(p)$.
The latter follows from the observation that on the same input, an entry of counter array $A$ under conservative update can never get larger than the same entry under Count-Min.
\section{Hash hypergraphs and CU process}\label{sec:hash}
With a counter array $A[1..n]$ and hash functions $h_1,...,h_k$ we associate a $k$-uniform \textit{hash hypergraph} $H=(V,E)$ with vertex-set $V=\{1..n\}$
and edge-set $E=\{\{h_1(p),...h_k(p)\}\}$ for all distinct keys $p$. Let $\mathcal{H}_{n,m}^{k}$ be the set of $k$-uniform hypergraphs with $n$ vertices and $m$ edges.
We assume that the hash hypergraph is a uniformly random Erd\H{o}s-R\'enyi hypergraph in $\mathcal{H}_{n,m}^{k}$, which
we denote by $H^k_{n,m}$, where $m$ is the number of distinct keys in the input (for $k=2$, we use the notation $G_{n,m}=H^2_{n,m}$).
Even if this property is not granted by hash functions used in practice, it is a reasonable and commonly used hypothesis to conduct the analysis of sketch algorithms.
Below we show that the behavior of a sketching scheme depends on the properties of the associated hash hypergraph. It is well-known that depending on the $m/n$ ratio, many properties of Erd\H{o}s-R\'enyi (hyper)graphs follow a phase transition phenomenon \cite{FriezeKaronski16}. For example, the emergence of a giant component, of size $O(n)$, occurs {with high probability} (hereafter, \textit{w.h.p.}) at the threshold $\frac{m}{n}=\frac{1}{k(k-1)}$ \cite{KARONSKI2002125}.
Particularly relevant to us is the \textit{peelability} property.
Let $H=(V,E)$ be a hypergraph. The peeling process on $H$ is as follows. We define $H_0=H$, and iteratively for $i\geq 0$, we define $V_i$ to be the set of leaves (vertices of degree 1) or isolated vertices in $H_i$, $E_i$ to be the set of edges of $H_i$ incident to vertices in $V_i$, and $H_{i+1}$ to be the hypergraph obtained from $H_i$ by deleting
the vertices of $V_i$ and the edges of $E_i$. A vertex in $V_i$ is said to have \emph{peeling level}~$i$.
The process stabilizes from some step $I$, and the hypergraph $H_I$ is called the
\emph{core} of $H$, which is the largest induced sub-hypergraph whose vertices all have degree at least $2$. If $H_I$ is empty, then $H$ is called \emph{peelable}.
It is known~\cite{molloy2005cores} that peelability undergoes a phase transition. For $k\geq 3$, there exists a positive constant $\lambda_k$ such that, for $\lambda<\lambda_k$,
the random hypergraph $H^k_{n,\lambda n}$ is w.h.p. peelable as $n\to\infty$, while for $\lambda>\lambda_k$, the core of $H^k_{n,\lambda n}$ has w.h.p. a size concentrated around
$\alpha n$ for some $\alpha>0$ that depends on $\lambda$. The first peelability thresholds are $\lambda_3\approx 0.818$, $\lambda_4\approx 0.772$, etc., $\lambda_3$ being the largest.
For $k=2$, for $\lambda<1/2$, w.h.p. a proportion $1-o(1)$ of vertices are in trees of size $O(1)$,
(and a proportion $o(1)$ of the vertices are in the core), while for $\lambda\geq 1/2$, the core size is w.h.p. concentrated around $\alpha n$ for $\alpha>0$ that depends on~$\lambda$
~\cite{pittel2005counting}.
We note that properties of hash hypergraphs determine the behavior of some other hash-based data structures, such as Cuckoo hash tables \cite{pagh2004cuckoo} and Cuckoo filters \cite{10.1145/2674005.2674994}, Minimal Perfect Hash Functions and Static Functions \cite{majewski1996family}, Invertible Bloom filters \cite{goodrich2011invertible}, and others. We refer to \cite{DBLP:phd/dnb/Walzer20} for an extended study of relationships between properties of hash hypergraphs and some of those data structures. In particular, peelability is directly relevant to certain constructions of Minimal Perfect Hash Functions as well as to good functioning of Invertible Bloom filters.
The connection to hash hypergraphs allows us to reformulate the Count-Min algorithm with conservative updates as a process, which
we call CU-process, on a random hypergraph $H_{n,m}^k$, where $n,m,k$ correspond to counter array length, number of distinct keys, and number of
hash functions, respectively.
Let $H=(V,E)$ be a hypergraph. To each vertex $v$ we associate a counter $c_v$ initially set to $0$. At each step $t\geq 1$, a \emph{CU-process} on $H$ chooses an edge $e=\{v_1,\ldots,v_k\}\in E$ in $H$, and increments by 1 those $c_{v_i}$ which verify $c_{v_i}=\min_{1\leq j\leq k}c_{v_j}$.
For $t\geq 0$ and $v\in V$, $c_v(t)$ will denote the value of the counter $c_v$ after $t$ steps, and $o_e(t)$ the number of times edge $e\in E$ has been drawn in the first $t$ steps. The counter $c_e(t)$ of an edge $e=\{v_1,\ldots,v_k\}$ is defined as $c_e(t)=\min_{1\leq i\leq k} c_{v_i}(t)$. Clearly, for each $t$ and each $e$, $o_e(t)\leq c_e(t)$. The \emph{relative error} of $e$ at time $t$ is defined as $R_e(t)=\frac{c_e(t)-o_e(t)}{o_e(t)}$.
The following Lemma can be easily proved by induction on $t$.
\begin{lemma}\label{lem:observation}
Let $H=(V,E)$ be a hypergraph on which a CU-process is run.
At every step $t$, for each vertex $v$, there is at least one edge $e$ incident to $v$ such that $c_e(t)=c_v(t)$.
\end{lemma}
Observe that, when $H$ is a graph ($k=2$), Lemma~\ref{lem:observation} is equivalent to the property that vertex counters cannot have a strict local maximum, i.e., at every step $t$, each vertex $v$ has at least one neighbour~$u$
such that $c_u(t)\geq c_v(t)$.
\section{Phase transition of the relative error}
\label{sec:main}
\subsection{Main results}\label{sec:main_results}
Let $H=(V,E)$ be a hypergraph, $|V|=n, |E|=m$. Let $N\geq 1$. We consider two closely related models of input to perform the CU-process. In the \emph{$N$-uniform model}, the CU process is performed on a random sequence of keys (edges in $E$)
of length $N\cdot m$, each key being drawn independently and uniformly in $E$.
In the \emph{$N$-balanced model}, the CU-process is performed on a random sequence of length $N\cdot m$,
such that each $e\in E$ occurs exactly $N$ times, and the order of keys is random. In other words, the sequence of keys on which the
CU-process is performed is a random permutation of the multiset made of $N$ copies of each key of $E$.
Clearly, both models are very close, since the number of occurrences of any key in the $N$-uniform model is concentrated around $N$ (with Gaussian fluctuations
of order $\sqrt{N}$) as $N$ gets large.
For both models, we use the notation $c_v^{(N)}=c_v(Nm)$ for the resulting counter of $v\in V$, $o_e^{(N)}=o_e(Nm)$ for the resulting number of occurrences of $e\in E$,
$c_e^{(N)}=c_e(Nm)$ for the resulting counter of $e\in E$, and $R_e^{(N)}=R_e(Nm)=(c_e^{(N)}-o_e^{(N)})/o_e^{(N)}$
for the resulting relative error of $e$.
In the $N$-balanced model, since each key $e\in E$ occurs $N$ times, we have $R_e^{(N)}=(c_e^{(N)}-N)/N$.
Our main result is the following.
\begin{theorem}[subcritical regime]\label{theo:subcriti}
Let $k\geq 2$, and let $\lambda<\lambda_k$, where $\lambda_2 =1/2$, and for $k\geq 3$, $\lambda_k$ is the peelability threshold as defined in Section~\ref{sec:hash}.
Consider a CU-process on a random hypergraph $H^k_{n,\lambda n}$ under either $N$-uniform or $N$-balanced model, and consider the relative error $R_e^{(N)}$ of a random edge in $H^k_{n,\lambda n}$. Then $R_e^{(N)}=o(1)$ w.h.p., as both $n$ and $N$ grow\footnote{Formally, for any $\epsilon >0$, there exists $M$ such that $\mathbb{P}(R_e^{(N)} \leq \epsilon) \geq 1-\epsilon$ if $n\geq M$ and $N\geq M$.}.
\end{theorem}
Note that
with the regular Count-Min algorithm (see Section~\ref{countmin-and-CU}), in the $N$-balanced model, the counter value of a node $v$ is $\tilde{c}_v^{(N)} = N\cdot \mathrm{deg}(v)$, and the relative error $\tilde{R}_e^{(N)}$ of an edge $e=(v_1,\ldots,v_k)$ is always (whatever $N\geq 1$) equal to $\mathrm{min}(\mathrm{deg}(v_1),\ldots,\mathrm{deg}(v_k))-1$, and is thus always a non-negative integer.
For fixed $k\geq 2$ and $\lambda>0$, and for a random edge $e$ in $H^k_{n,\lambda n}$, the probability that all $k$ vertices belonging to $e$ have at least one
incident edge apart from $e$ converges to a positive constant $c(\lambda,k)=(1-e^{-k\lambda})^k$. Therefore, $\tilde{R_e}$ is a nonnegative integer whose probability to be non-zero converges to $c(\lambda,k)$. Thus, Theorem~\ref{theo:subcriti} ensures that, for $\lambda<\lambda_k$, conservative updates lead to a drastic decrease of the error, from $\Theta(1)$ to $o(1)$.
For a given hypergraph $H=(V,E)$ with $m$ edges, we define $\mathrm{err}_N(H)=\frac1{m}\sum_{e\in E}R_e^{(N)}$ the \emph{average} error over the edges of $H$.
Theorem~\ref{theo:subcriti} states that a randomly chosen edge has a small error, but this does not formally exclude that a small fraction of edges may have large errors, possibly yielding $\mathrm{err}_N(H)$ larger than $o(1)$. However, we believe that this is not the case. From the previous remark, it follows that the error of an edge $e=(v_1,\ldots,v_k)$ is upper-bounded by $\mathrm{min}(\mathrm{deg}(v_1),\ldots,\mathrm{deg}(v_k))-1$. Since the expected maximal degree in $H_{n,\lambda n}^k$ grows very slowly with $n$, one can expect that any set of $o(n)$ edges should have a contribution $o(1)$ w.h.p.. This is also supported by experiments given in the next section.
Based on Theorem~\ref{theo:subcriti} and the above discussion, we propound that a phase transition occurs for the average error, in the sense that it is $o(1)$ in the subcritical regime $\lambda<\lambda_k$,
and $\Theta(1)$ in the supercritical regime $\lambda>\lambda_k$, w.h.p..
Regarding the supercritical regime, we are able to show that this indeed holds for $k=2$ in the $N$-balanced model.
\begin{theorem}[supercritical regime, case $k=2$]\label{theo:supercrit}
Let $\lambda>1/2$. Then there exists a positive constant $f(\lambda)$ such that, in the $N$-balanced model, $\mathrm{err}_N(G_{n,\lambda n})\geq f(\lambda)$ w.h.p., as $n$ grows\footnote{Formally, for any $\epsilon>0$, there exists $M$ such that $\mathbb{P}(\mathrm{err}_N(G_{n,m})\geq f(\lambda))\geq 1-\epsilon$
if $N\geq 1$ and $n\geq M$.}.
\end{theorem}
Our proof of Theorem~\ref{theo:supercrit} can be extended to any $k\geq 2$ and $\lambda>\frac1{k(k-1)}$ such that
the giant component $G'=(V',E')$ in $H_{n,\lambda n}^k$ satisfies w.h.p. $|E'|-|V'|\geq a\,n$ for some positive constant $a$.
For $k=2$, any value $\lambda>1/2$ has this property~\cite{pittel2005counting}, while for $k=3$ (respectively, $k=4$), the analysis given in \cite{DBLP:journals/cpc/BehrischCK14} ensures that this property holds for values of $\lambda$ strictly above the peelability threshold, namely $\lambda>\widetilde{\lambda_3}\approx 0.94$ (respectively, $\lambda>\widetilde{\lambda_4}\approx 0.98$) .
%
%
%
%
Nevertheless, based on simulations presented below, we expect that Theorem~\ref{theo:supercrit} holds for $k\geq 3$ for all $\lambda>\lambda_k$ as well, however proving this would then require a different kind of argument.
\subsection{Simulations}
\label{sec:simulation}
Here we provide several experimental results illustrating the phase transition stated in Theorems~\ref{theo:subcriti} and \ref{theo:supercrit}. Figure~\ref{fig:av_err} shows plots for the average relative error $\mathrm{err}_N(H_{n,m}^{k})$ as a function of $\lambda=m/n$, for $k\in\{2,3,4\}$ for regular Count-Min and the conservative update strategies. Experiments were run for $n=1000$ with the $N$-independent model (each edge drawn independently with probability $1/m$) and $N=50,000$ (number of steps $N\cdot |E|$). For each $\lambda$, an average is taken over $15$ random graphs.
\medskip
\medskip
\begin{figure}[h]
\centering
\begin{subfigure}[b]{0.35\textwidth}
\centering
\includegraphics[scale=0.22]{k2-with-countmin.png}
\caption{$k=2$}
\label{fig:k2}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[scale=0.22]{k3-with-countmin.png}
\caption{$k=3$}
\label{fig:k3}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.30\textwidth}
\centering
\includegraphics[scale=0.22]{k4-with-countmin.png}
\caption{$k=4$}
\label{fig:k4}
\end{subfigure}
\caption{Average relative error as a function of $\lambda=m/n$ for regular Count-Min (red) and conservative update (blue), for $k\in\{2,3,4\}$.}
\label{fig:av_err}
\end{figure}
\medskip
\medskip
The phase transitions are clearly seen to correspond to the critical threshold $0.5$ for $k=2$, and, for $k\in\{3,4\}$,
to the peelability thresholds $\lambda_3\approx 0.818$, $\lambda_4\approx 0.772$. Observe that the transition looks sharper for $k\geq 3$, which may be
explained by the fact that the core size undergoes a discontinuous phase transition for $k\geq 3$, as shown in~\cite{molloy2005cores} (e.g. for $k=3$, the fraction of vertices in the
core jumps from $0$ to about $0.13$).
For the supercritical regime, we analysed the concentration around the average shown in Figure~\ref{fig:av_err} by simulating CU-processes on 50 random graphs, for each $\lambda$. Figure~\ref{fig:concentration} shows the results. We observe that the concentration tends to become tighter for growing~$\lambda$.
\begin{figure}[h]
\centering
\begin{subfigure}[b]{0.47\textwidth}
\centering
\includegraphics[width=\textwidth]{k2-concentration-extended.png}
\caption{$k=2$}
\label{fig:k2-concentration}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.50\textwidth}
\centering
\includegraphics[width=\textwidth]{k3-concentration-extended.png}
\caption{$k=3$}
\label{fig:k3-concentration}
\end{subfigure}
\caption{Concentration of the average error as a function of $\lambda=m/n$, for $k\in\{2,3\}$.}
\label{fig:concentration}
\end{figure}
Furthermore, we experimentally studied the empirical distribution of individual relative errors, which turns out to have an interesting multi-modal shape for intermediate values of~$\lambda$. Typical distributions for $k=2,3$ are illustrated in Figure~\ref{fig:distribution} where each point corresponds to an edge, and the edges are randomly ordered along the $x$-axis. Each plot corresponds to an individual random graph.
When $\lambda$ grows beyond the peelability threshold, a fraction of edges with small errors still remains but vanishes quickly: these include edges incident to at least one leaf (these have error $0$) and peelable edges (these have error $o(1)$, by arguments to be given in Section~\ref{sec:proofk3}).
For intermediate values of $\lambda$, the distribution presents several modes: besides the main mode (largest concentration on plots of Figure~\ref{fig:distribution}), we observe a few other concentration values which are typically integers. While this phenomenon is still to be analysed, we explain it by the presence in the graphs of certain structural motifs that involve disparities in node degrees. Note that the fraction of values concentrated around the main mode is dominant: for example, for $k=3,\lambda=3$ (Figure~\ref{fig:k3-l3}), about 90\% of values correspond to the main mode ($\approx 3.22$). Finally, when $\lambda$ becomes larger, these ``secondary modes'' disappear, and the distribution becomes concentrated around a single value. This is consistent with the tighter concentration observed earlier in Figure~\ref{fig:concentration}.
\begin{figure}[ht!]
\centering
\begin{subfigure}[b]{0.49\textwidth}
\includegraphics[width=\textwidth]{k2-l1.png}
\caption{$k=2, \lambda=1$}
\label{fig:k2-l1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{k3-l1.png}
\caption{$k=3, \lambda=1$}
\label{fig:k3-l1}
\end{subfigure}
\begin{subfigure}[b]{0.49\textwidth}
\includegraphics[width=\textwidth]{k2-l3.png}
\caption{$k=2, \lambda=3$}
\label{fig:k2-l3}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.49\textwidth}
\centering
\includegraphics[width=\textwidth]{k3-l3.png}
\caption{$k=3, \lambda=3$}
\label{fig:k3-l3}
\end{subfigure}
\begin{subfigure}[b]{0.50\textwidth}
\centering
\includegraphics[height=129pt]{k2-l5.png}
\caption{$k=2, \lambda=5$}
\label{fig:k2-l5}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\textwidth}
\centering
\includegraphics[width=\textwidth]{k3-l5.png}
\caption{$k=3, \lambda=5$}
\label{fig:k3-l5}
\end{subfigure}
\caption{Distribution of relative errors of individual edges shown in a random order along $x$-axis.}
\label{fig:distribution}
\end{figure}
Finally, we report on another experiment supporting the conjecture of a positive average error in the supercritical regime. We simulated the CU-process on sparse random non-peelable 3-hypergraphs (i.e. $k=3$), namely 2-regular 3-hypergraphs with $2n$ edges and $3n$ vertices ($n$ parameter). These are sparsest possible non-peelable 3-hypergraphs, with degree 2 of each vertex. We observed that the average error for such graphs is concentrated around a constant value of $\approx 0.217$. Since the core size is linear in the supercritical regime, this experiment provides an evidence of a positive error in the general case. While this remains to be proved in general, in Section~\ref{sec:non-peelable} we provide a proof for certain families of regular hypergraphs.
\newpage
\section{Proofs of main results}
\label{sec:proofs}
Theorem~\ref{theo:subcriti} relies on properties of random hypergraphs. Case $k=2$ corresponds to Erd\H{o}s-R\'enyi random graphs $G_{n,\lambda n}$ \cite{erdos1960evolution} which have been extensively studied \cite{FriezeKaronski16}. In particular, it is well known
when $\lambda<1/2$ and $n$ gets large, $G_{n,\lambda n}$ is, w.h.p., a union of small connected components most of which are constant-size trees.
That is, a random edge in $G_{n,\lambda n}$ is, w.h.p., in a tree of size $O(1)$. Thus,
the proof amounts to showing that, for a fixed tree $T$ and a vertex $v\in T$, we have $c_v^{(N)}/N=1+o(1)$ w.h.p..
We prove this in Section~\ref{sec:error_tree} for both $N$-uniform and $N$-balanced models.
The proof for $k\geq 3$, given in Section~\ref{sec:proofk3}, requires more ingredients. An additional difficulty is that, for $\lambda<\lambda_k$, a random edge $e$ in $H_{n,\lambda n}^k$ may be in the giant component (if $\lambda\in(\frac1{k(k-1)},\lambda_k)$). However, we rely on the fact that the peeling level of $e$ is $O(1)$ w.h.p., and prove that for a vertex $v$ of bounded level, we have $c_v^{(N)}/N=1+o(1)$ w.h.p. as $N\to\infty$, where the $o(1)$ term does not depend on
the size of the giant component.
\subsection{CU-process on a fixed tree}\label{sec:error_tree}
\subsubsection{Analysis in the $N$-uniform model}\label{sec:tree_N_uniform}
Consider a graph $G=(V,E)$, with $m$ edges, on which the CU-process is run, in the $N$-uniform model.
Recall that $c_v(t)$ (resp. $c_e(t)$) denotes the value of the counter for $v$ (resp. for $e$) after $t$ steps, and $o_e(t)$ is the number of occurrences $e$ in the first $t$ steps.
The aim of this Section is to prove the following result.
\begin{lemma}\label{prop:cv}
Let $T=(V,E)$ be a tree, on which the CU-process is run, in the $N$-uniform model. Let $m=|E|$. Then, for every vertex $v$ of $T$,
there exist absolute positive constants $a_v,b_v$ such that, for any $N\geq 1$ and $x>0$, we have
\[
\mathbb{P}\Big(\mathrm{max}_{t\in[0..Nm]}|c_v(t)-t/m| \geq x\sqrt{N}\Big)\leq a_v\exp(-b_vx^2).
\]
\end{lemma}
Lemma~\ref{prop:cv} implies that, in the $N$-uniform model,
the final counter $c_v^{(N)}$ of every vertex $v$ of $T$ is concentrated around $N$, with (sub-)Gaussian fluctuations
of order $\sqrt{N}$. The same holds for the final counter $c_e^{(N)}=\mathrm{min}(c_u^{(N)},c_v^{(N)})$ of every edge $e=(u,v)$ of $T$. On the other hand,
the number $o_e(Nm)$ of times $e$ is chosen follows a binomial distribution $\mathrm{Bin}(Nm,1/m)$. Then, it is also concentrated around $N$, with Gaussian fluctuations
of order $\sqrt{N}$. This implies that $R_e^{(N)}=O(1/\sqrt{N})=o(1)$ w.h.p. as $N$ gets large.
We say that a family of events $\mathcal{E}_M^N$ indexed by two parameters $N,M\geq 1$, is \emph{$(N,M)$-concentrated}
if there are absolute constants $a,b>0$ such that, for every $N,M$, we have
$\mathbb{P}(\mathcal{E}_M^N)\leq a\exp(-bx^2)$, where $x=M/\sqrt{N}$. For $f(t)$ a (possibly random) quantity depending on $t\in[0..Nm]$, we use the notation $\widehat{f}(t):=f(t)-t/m$.
Thus, to prove Lemma~\ref{prop:cv}, we have to show that
for a fixed tree $T$ with $m$ edges on which the $N$-independent CU-process is run, and for $v$ a vertex of $T$, the event
$\{\mathrm{max}_{t\in[0..Nm]}|\widehat{c_v}(t)|\geq M\}$ is $(N,M)$-concentrated.
We proceed by induction on the peeling level $i$ of vertices.
A vertex $v$ at level $0$ is a leaf. Let $e$ be its incident edge.
It is easy to see that the counter of $v$ increases exactly at the steps when $e$ is drawn. Hence $c_v(t)=o_e(t)$ for $t\in[0..Nm]$.
Doob's martingale maximal inequality combined with Hoeffding's inequality ensure
that, for every edge $e$ of $T$, we have
\[
\mathbb{P}(\mathrm{max}_{t\in[0..Nm]}|\widehat{o_e}(t)|\geq M)\leq 2\exp(-2x^2/m),\ \ \mathrm{where}\ x=M/\sqrt{N}.
\]
Hence, for any leaf $v$ of $T$, the event $\{\mathrm{max}_{t\in[0..Nm]}|\widehat{c_v}(t)|\geq M\}$ is $(N,M)$-concentrated.
Moreover, for $v$ a vertex and $e$ an arbitrary edge incident to $v$, the fact that $c_v(t)\geq o_e(t)$
ensures that the event $\{\mathrm{min}_{t\in[0..Nm]}\widehat{c_v}(t)) \leq -M\}$ is
$(N,M)$-concentrated. It thus remains
to show that, for vertices of positive levels, the event $\{\mathrm{max}_{t\in[0..Nm]} \widehat{c_v}(t) \geq M\}$ is $(N,M)$-concentrated.
The following statement will be useful to treat the inductive step.
\begin{lemma}\label{lem:dv}
Let $G$ be a graph on which a CU-process is run. Let $v$ be a vertex of $G$, with $v_1,\ldots,v_{h+1}$ its neighbours one of which (say $v_{h+1}$) is distinguished, and with $e$ denoting the edge $\{v,v_{h+1}\}$.
For $t\in[0..Nm]$, let $d_v(t)=\mathrm{max}(c_{v_1}(t),\ldots,c_{v_{h}}(t))$. Consider the event $\mathcal{E}_M^N$
that there exists $t\in[0..Nm]$ such that $c_v(t)\geq d_v(t)+M$, and the event $\mathcal{F}_M^N$ that there exists $t\in [0..Nm]$ such that $|\widehat{o_e}(t)|\geq M/4$ or $|\widehat{d_v}(t)|\geq M/4$. Then $\mathcal{E}_M^N$ implies $\mathcal{F}_M^N$.
\end{lemma}
\begin{proof}
If $\mathcal{E}_M^N$ holds, let $t_0\geq 0$ be such that $c_v(t_0)\geq d_v(t_0)+M$. Let $t'=\mathrm{max}\{t\leq t_0\ |\ c_v(t)\leq d_v(t)\}$. The crucial point is that, in the interval $[t'..t_0]$, any step where $c_v$ increases occurs when $e$ is chosen (indeed, when $c_v(t)>\mathrm{max}(c_{v_1}(t),\ldots,c_{v_{h}}(t))$, choosing an edge $\{v,v_i\}$ with $i\in[1..h]$ yields no increase of $c_v$). Hence,
$c_v(t_0)-c_v(t')\leq o_e(t_0)-o_e(t')$. Since $c_v(t')=d_v(t')$ and $c_v(t_0)\geq d_v(t_0)+M$ we conclude that $o_e(t_0)-o_e(t')\geq d_v(t_0)-d_v(t')+M$. Thus we also have
$\widehat{o_e}(t_0)-\widehat{o_e}(t')\geq \widehat{d_v}(t_0)-\widehat{d_v}(t')+M$. Hence $\mathrm{max}(|\widehat{o_e}(t_0)|, |\widehat{o_e}(t')|,|\widehat{d_v}(t_0)|,|\widehat{d_v}(t')|)\geq M/4$, so that $\mathcal{F}_M^N$ holds.
\end{proof}
Let $i\geq 1$, and assume Lemma~\ref{prop:cv} holds for all vertices of level smaller than $i$. Let $v$ be a vertex of level $i$, for which we want to prove that the event $\{\mathrm{max}_{t\in[0..Nm]} \widehat{c_v}(t) \geq M\}$ is $(N,M)$-concentrated.
All neighbours $v_1,\ldots,v_{h+1}$ of $v$ have level at most $i-1$, except for one, say $v_{h+1}$,
with its level in $\{i-1,i,i+1\}$ (respectively corresponding to $T_i$ having one vertex, two vertices, or at least three vertices).
Let $e$ be the edge between $v$ and $v_{h+1}$. Let $\mathcal{E}_M^N$ be the event that $\widehat{c_v}(t)\geq M$ for some $t\in [0..Nm]$.
If this holds, then one of the two events $\{\widehat{c_v}(t)-\widehat{d_v}(t)\geq M/2\}$ or $\{\widehat{d_v}(t)\geq M/2\}$ holds.
By Lemma~\ref{lem:dv}, the first event implies that $|\widehat{d_v}(t)|\geq M/8$ or $|\widehat{o_e}(t)|\geq M/8$ for some $t\in[0..Nm]$. Hence, the event
$\{\mathrm{max}_{t\in[0..Nm]}\widehat{c_v}(t)\geq M\}$
implies that either the event
$\{\mathrm{max}_{t\in[0..Nm]}|\widehat{d_v}(t)|\geq M/8\}$ (which is also the union of the events
$\{\mathrm{max}_{t\in[0..Nm]}|\widehat{c_{v_j}}(t)|\geq M/8\}$ for $j\in[1..h]$) or the event $\{\mathrm{max}_{t\in[0..Nm]}|\widehat{o_e}(t)|\geq M/8\}$ holds.
Since these events are $(N,M)$-concentrated, we conclude (using the union bound) that the event $\{\mathrm{max}_{t\in[0..Nm]}\widehat{c_v}(t)\geq M\}$ is also $(N,M)$-concentrated, which concludes the proof of Lemma~\ref{prop:cv}.
\subsubsection{Analysis in the $N$-balanced model}\label{sec:tree_N_balanced}
\begin{lemma}\label{prop:tree_N_uniform}
Let $T$ be a tree, on which the CU-process is performed, in the $N$-balanced model. Then, for every edge $e$ of $T$, we have $R_e^{(N)}=o(1)$ w.h.p. as $N\to\infty$.
\end{lemma}
\begin{proof}
Note that the $N$-balanced model is just the $N$-uniform model conditioned on all edges occurring exactly $N$ times, which happens with probability $\Theta(n^{-m/2})$ if $T$ has $m$ edges.
Let $u$ be an extremity of $e$.
By Lemma~\ref{prop:cv}, there exists a positive constant $b$ such that, in the $N$-uniform model,
\[
\mathbb{P}(c_u(Nm)\geq N+N^{2/3})=O(e^{-b\, n^{1/3}}).
\]
Hence, in the $N$-balanced model, we have
\[
\mathbb{P}(c_u^{(N)}\geq N+N^{2/3})=O(n^{m/2}e^{-b\, n^{1/3}})=o(1),
\]
and thus
\[
\mathbb{P}(R_e^{(N)}\geq N^{-1/3})=\mathbb{P}(c_e^{(N)}\geq N+N^{2/3})\leq \mathbb{P}(c_u^{(N)}\geq N+N^{2/3})=o(1),
\]
which ensures that $R_e^{(N)}=o(1)$ w.h.p. as $N\to\infty$.
\end{proof}
\subsection{Proof of Theorem~\ref{theo:subcriti} for $k=2$}\label{sec:subcritical2}
We use the well-known property~\cite{erdos1960evolution} that, for fixed $\lambda\in(0,1/2)$, a random edge $e$ in $G_{n,\lambda n}$ is w.h.p. in a tree of size $O(1)$.
Precisely, if we let $\mathcal{E}^m_{n,\lambda}$ be the event that $e$ belongs to a tree of size at most $m$, then we have the property that, for every $\epsilon>0$,
there exist $m$ and $n_0$ such that $\mathbb{P}(\mathcal{E}^m_{n,\lambda})\geq 1-\epsilon$ for $n\geq n_0$.
By Lemma~\ref{prop:tree_N_uniform}, there exists $N_0$ (depending on $m$) such that, in the $N$-balanced or $N$-uniform model,
for every tree $T$ with at most $m$ edges, and every edge $e\in T$,
we have $\mathbb{P}(R_e^{(N)}\geq\epsilon)\leq \epsilon$ for $N\geq N_0$.
Hence, for $n\geq n_0$ and $N\geq N_0$,
if we perform the CU-process on $G_{n,\lambda n}$ in the $N$-balanced model (note that the $N$-balanced model holds separately on every connected component),
and draw a random edge $e$,
we have
\[
\mathbb{P}(R_e^{(N)}\geq\epsilon)\leq\mathbb{P}(R_e^{(N)}\geq\epsilon\ |\ \mathcal{E}^m_{n,\lambda})+\mathbb{P}(\neg\mathcal{E}^m_{n,\lambda})\leq 2\epsilon.
\]
This means that $R_e^{(N)}=o(1)$ w.h.p., when $n$ and $N$ grow. In the $N$-uniform model, the same argument holds, using the fact that the total number of times
edges in $T$ are drawn is concentrated around $Nm$.
\subsection{Proof of Theorem~\ref{theo:subcriti} for $k\geq 3$}\label{sec:proofk3}
The proof partly follows the same lines as for $k=2$, but requires additional arguments, in particular a suitably extended notion of peelability.
A \emph{marked hypergraph} is a hypergraph $H=(V,E)$ where some of the vertices are marked. The subset of marked vertices is denoted $V_{\infty}$. When performing a CU-process on a marked hypergraph, the counters of unmarked vertices are (as usual) initially $0$, while the counters at marked vertices are initially (and remain) $+\infty$.
When peeling, the marked vertices are not allowed to be peeled (even when they are incident to a unique edge). We define $H_0=H$, and iteratively for $i\geq 0$, we define $V_i$ as the set of non-marked vertices that are leaves or isolated vertices in $H_i$,
$E_i$ as the set of edges of $H_i$ incident to vertices in $V_i$, and $H_{i+1}$ to be the hypergraph obtained from $H_i$ by deleting
the vertices in $V_i$ and the edges in $E_i$. A vertex in $V_i$ is said to have \emph{level $i$}.
Then $H$ is called \emph{peelable} if every unmarked vertex is peeled at some step.
Following the exact same lines as in the proof of Lemma~\ref{prop:cv} (induction on the vertex-levels, and a straightforward adaptation of Lemma~\ref{lem:dv} to hypergraphs) and Lemma~\ref{prop:tree_N_uniform}, we obtain:
\begin{lemma}\label{prop:cvH}
Let $H=(V,E)$ be a peelable connected marked hypergraph, on which the CU-process is run, in the $N$-uniform model. Let $m=|E|$, and for $t\in[0..Nm]$, let $c_v(t)$ be the
value of the counter of $v$ after $t$ steps.
Then, for every unmarked vertex $v$ of $H$,
there exist absolute positive constants $a_v,b_v$ such that, for any $N\geq 1$ and $x>0$, we have
\[
\mathbb{P}\Big(\mathrm{max}_{t\in[0..Nm]}|c_v(t)-t/m| \geq x\sqrt{N}\Big)\leq a_v\exp(-b_vx^2).
\]
In the $N$-uniform or $N$-balanced model, for every unmarked vertex $v$ of $H$, we have $c_v^{(N)}/N=1+o(1)$ w.h.p. as $N\to\infty$.
\end{lemma}
For $H$ a hypergraph, and for $v$ a vertex of finite level in $H$, a vertex $u\in H$ is called a \emph{descendant} of $v$ if there is a sequence $v_0=u,v_1,\ldots,v_r=v$ of vertices such that, for each $j\in[1..r-1]$, $v_{j}$ and $v_{j+1}$ are incident to a same edge, and the level of $v_{j+1}$ is larger than the level of $v_j$.
\begin{lemma}\label{lem:Hv}
For a hypergraph $H$, and for a vertex $v$ of $H$ of finite level, let $D_v$ be the set formed by $v$ and it descendants, and let $E_v$ be the set of edges
that are incident to at least one vertex from $D_v$. Let $H_v$ be the marked hypergraph formed by the edges in $E_v$ and their incident vertices, where the marked vertices
are those not in $D_v$. Then $H_v$ is peelable.
\end{lemma}
\begin{proof}
Let $u$ be a vertex in $D_v$, of level $i$. If $i=0$, then $u$ is a leaf in $H$. It is also a leaf in $H_v$, and is immediately peeled.
Otherwise, except for possibly one incident edge, $u$ has at least one neighbour $v_e$ of level smaller than $i$ in every incident edge $e$ (note that $v_e$ has to be in $D_v$).
By induction, $v_e$ and $e$ are peeled in the peeling process of $H_v$. Hence, $u$ is peeled as well during the peeling process on $H_v$ (by induction as well, the level of a vertex in $D_v$ is actually the same in $H$ and in $H_v$).
\end{proof}
\begin{remark}\label{rk:shell_ball}
In a hypergraph $H=(V,E)$, the \emph{distance} between two vertices $u$ and $v$ is the minimum number of edges to traverse in order to reach $v$ from $u$.
For $r\geq 1$ and $v\in V$, the ball $B_H(v,r)$ is the set of vertices at distance at most $r$ from $v$. Clearly, if $v$ is at level $i$, then every vertex in $D_v$ is in
$B_H(v,i)$, and every vertex of $H_v$ is in $B(v,i+1)$. \dotfill
\end{remark}
\begin{lemma}[Lemma~3 in \cite{molloy2005cores}]\label{lem:I}
Let $k\geq 3$, and let $\lambda\in(0,\lambda_k)$. For every $\epsilon>0$, there exist $I(\epsilon)$ and $n_0(\epsilon)$ such that,
for $v$ a random vertex in $H^k_{n,\lambda n}$, the probability that $v$ has level at most $I(\epsilon)$ is at least $1-\epsilon$, for $n\geq n_0(\epsilon)$.
\end{lemma}
\begin{lemma}\label{lem:monoton}
Let $H=(V,E)$ be a hypergraph, and let $E'$ be a subset of $E$.
Let $V'$ (resp. $W$) be the subset of vertices incident to at least one edge from $E'$ (resp. incident only to edges in $E'$). Let $H'=(V',E')$ be the marked
hypergraph where the unmarked vertices are those in $W$.
Consider a CU-process on $H$, with $S$ the sequence of items (each item an edge of $H$), and for $v\in V$ let $c_v$ be the final value of the counter of $v$. Let $S'$
be the subsequence of $S$ composed by the items in $E'$. Consider the CU process on $H'$ where the sequence of items is $S'$.
For $v\in W$, let $c_v'$ be the final value of the counter of $v$. Then $c_v'\geq c_v$.
\end{lemma}
\begin{proof}
For an assignment $f:V\to \mathbb{N}\cup\{+\infty\}$ of initial values to the vertex counters, let $c_f:V\to\mathbb{N}\cup\{+\infty\}$ be the function giving the final vertex counters after performing the CU-process on an input sequence $S$.
It is easy to check (by induction on the length of $S$) that the CU-process is monotonous: if $f(v)\leq g(v)$ for all $v\in V$, then $c_f(v)\leq c_g(v)$ for all $v\in V$.
Now, if we define $f$ as the function assigning initial value $0$ to vertices in $W$,
and initial value $+\infty$ to the other vertices, then $c_v'=c_f(v)$ for all $v\in W$. On the other hand, if $f_0$ denotes the function assigning initial value $0$ to all vertices, then
$c_v=c_{f_0}(v)$ for all $v\in V$. Hence, the monotonicity property ensures that $c_v'\geq c_v$ for all $v\in W$.
\end{proof}
We can now conclude the proof of Theorem~\ref{theo:subcriti} for $k\geq 3$. Let $\epsilon>0$. Let $I(\epsilon)$ and $n_0(\epsilon)$ be as given in Lemma~\ref{lem:I}.
Let $s(\epsilon)$ be such that, for a random vertex $v\in H_{n,\lambda n}^k$, we have $\mathbb{P}\big(|B(v,I(\epsilon)+1)|\leq s(\epsilon)\big)\geq 1-\epsilon$ for all $n$.
The existence of $s(\epsilon)$ easily follows from the known property that $H_{n,\lambda n}$ converges to a Galton-Watson branching
process for the local topology, see e.g.~\cite[Prop 2.6]{dembo2010gibbs}.
Let $v$ be a random vertex in $H_{n,\lambda n}$. Let $\mathcal{E}_{n,\epsilon}$
be the event that the level of $v$ is at most $I(\epsilon)$, and the number of vertices in $H_v$ is at most $s(\epsilon)$.
Then, using Remark~\ref{rk:shell_ball} and the union bound, we have $\mathbb{P}(\mathcal{E}_{n,\epsilon})\geq 1-2\epsilon$ for $n\geq n_0(\epsilon)$.
From Lemma~\ref{prop:cvH}, there exists $N_0$ such that, for every marked $k$-uniform hypergraph $H$ with at most $s(\epsilon)$ vertices, and for every unmarked vertex $v$
of $H$, we have $\displaystyle\mathbb{P}\big(c_v^{(N)}/N\ -1\geq \epsilon\big)\leq \epsilon$ for $N\geq N_0$.
Let $e$ be a random edge in $H^k_{n,\lambda n}$, and let $v$ be a random vertex of $e$. Note that $v$ is distributed as a random vertex in $H_{n,\lambda n}^k$.
With Lemma~\ref{lem:Hv} and Lemma~\ref{lem:monoton}, this implies that,
conditioned on $\mathcal{E}_{n,\epsilon}$, for $N\geq N_0$ we have $\displaystyle\mathbb{P}\big(c_v^{(N)}/N\ -1\geq \epsilon\big)\leq \epsilon$ in the $N$-balanced model, and also
$\mathbb{P}(R_e^{(N)}\geq \epsilon)\leq \epsilon$ (since $c_e^{(N)} \leq c_v^{(N)}$). Since $\mathbb{P}(\neg \mathcal{E}_{n,\epsilon})\leq 2\epsilon$, we conclude that, for $n\geq n_0(\epsilon)$ and $N\geq N_0$, we have
$\mathbb{P}(R_e^{(N)}\geq \epsilon)\leq 3\epsilon$.
Hence, in the $N$-balanced model, $R_e^{(N)}=o(1)$ w.h.p., when $n$ and $N$ grow.
In the $N$-uniform model, the same argument holds again, using the fact that the number of times an edge in $H_v$ is drawn is concentrated around $Nm$, with $m$ the
number of edges of $H_v$.
\subsection{Proof of Theorem~\ref{theo:supercrit}}
The \emph{excess} of a graph $G$ is $\mathrm{exc}(G)=|E|-|V|$.
\begin{lemma}\label{lem:excess}
Let $G=(V,E)$ be a graph. Then, for the $N$-balanced model, we have
$\sum_{e\in E}R_e^{(N)}\geq \frac1{2}\,\mathrm{exc}(G)$.
\end{lemma}
\begin{proof}
During the CU process, each time an edge is drawn, the counter of at least one of its extremities is increased by $1$. Hence $\sum_{v\in V}c_v^{(N)}\geq N |E|$.
Hence, with the notation $R_v^{(N)}:=c_v^{(N)}/N-1$, we have $\sum_{v\in V}R_v^{(N)}\geq \mathrm{exc}(G)$. Now, by Lemma~\ref{lem:observation}, for each $v\in V$, there exists an edge $e_v$ incident to $v$ such that $c_{e_v}^{(N)}=c_v^{(N)}$ (if several incident edges have this property, an arbitrary one is chosen). Hence, $\sum_{v\in V}R_{e_v}^{(N)}\geq \mathrm{exc}(G)$. Note that, in this sum, every edge occurs at most twice (since it has two extremities), thus $\sum_{e\in E}R_e^{(N)}\geq \frac1{2}\mathrm{exc}(G)$.
\end{proof}
For $\lambda>1/2$, it is known~\cite[Theorem~6]{pittel2005counting} that there is an explicit constant $\tilde{f}(\lambda)>0$ such that the excess of the giant component $G'=(V',E')$ of
$G_{n,\lambda n}$ is concentrated around $\tilde{f}(\lambda)n$, with fluctuations of order $\sqrt{n}$. Thus, $\mathrm{exc}(G')\geq \frac1{2}\tilde{f}(\lambda)n$
w.h.p. as $n\to\infty$.
Hence, by Lemma~\ref{lem:excess}, w.h.p. as $n\to\infty$ (and for any $N\geq 1$), we have
\[
\mathrm{err}_N(G_{n,\lambda n})\geq \frac1{\lambda n}\sum_{e\in E'}R_e^{(N)}\geq \frac1{2\lambda n}\,\mathrm{exc}(G') \geq \frac1{4\lambda} \tilde{f}(\lambda)=:f(\lambda).
\]
\section{Analysis for some non-peelable hypergraphs}
\label{sec:non-peelable}
Analysing the asymptotic behaviour of the relative error of the CU-process on arbitrary hypergraphs seems to be a challenging task,
even if we restrict ourselves to $N$-uniform and $N$-balanced models, as we do in this paper. Based on simulations, we expect that, for a fixed connected
$k$-hypergraph $H=(V,E)$, and for $v\in V$, we have $c_v^{(N)}/N=C_v+o(1)$ w.h.p. as $N\to\infty$, for an explicit constant $C_v\in[1,\mathrm{deg}(v)]$. Since the number of increments at each step lies in $[1..k]$, constants $C_v$ must verify $1\leq \frac1{|E|}\sum_{v\in V} C_v\leq k$, where $\frac1{|E|}\sum_{v\in V} C_v$ can be seen as the average number of increments at a step.
If $H$ is peelable,
then Lemma~\ref{prop:cvH} implies that
this concentration holds, with $C_v=1$. We expect that, if no vertex of $H$ is peelable, and if $H$ is ``sufficiently homogeneous'', then the constants $C_v$ should be all equal to the same constant $C>1$, and thus the relative error $R_e^{(N)}$ of every edge is concentrated around $C-1>0$ w.h.p. as $N\to\infty$. This, in particular, is supported by an experiment reported at the end of Section~\ref{sec:simulation}.
In this Section, we show that this is the case for a
family of regular hypergraphs which are very sparse ($O(\sqrt{|V|})$ edges) but have a high order (an edge contains $O(\sqrt{|V|})$ vertices).
The \emph{dual} of a hypergraph $H$ is the hypergraph $H'$ where the roles of vertices and edges are interchanged:
the vertices of $H'$ are the edges of $H$, and the edges of $H'$ are the vertices of $H$
so that an edge of $H'$ corresponding to a vertex $v$ of $H$ contains those vertices that correspond to edges incident to $v$ in $H$.
We consider here the hypergraph $K_{n}'$ dual to the complete graph $K_{n}$.
\begin{lemma}\label{lem:complete}
Consider any CU-process on $K_{n}'=(V,E)$. At each step $t$, let $\mathrm{minedges}(t)$ be the set of edges of $E$ whose counter $c_e(t)$ is minimal over all edges.
We have $|\mathrm{minedges}(t)|\geq 2$.
Let $e$ be the edge selected at time $t$. Then, at time $t$, $e$ is the only edge whose counter increases (by $1$), except when $e\in\mathrm{minedges}(t)$
and $|\mathrm{minedges}(t)|=2$, in which case the counter of the other edge in $\mathrm{minedges}(t)$ also increases (by $1$).
\end{lemma}
\begin{proof}
Every vertex $v\in V$ has degree~$2$. Considering a vertex $v$ of minimal counter, its two incident edges thus
have to be in $\mathrm{minedges}(t)$, therefore $|\mathrm{minedges}(t)|\geq 2$.
Let $e$ be the chosen edge at time~$t$. Clearly, $c_e$ increases (by $1$).
Moreover, for every edge $e'$ such that $c_{e'}(t)\neq c_e(t)$, $c_{e'}$ does not increase.
Let now $e'$ be such that $c_{e'}(t)=c_e(t)$, but there exists an edge $e''\notin\{e,e'\}$ with $c_{e''}(t)\leq c_{e'}(t)$. Let $v=e'\cap e''$. By Lemma~\ref{lem:observation}, we must have $c_v(t)=c_{e'}(t)$.
Since $v$ is not incident to $e$, its counter does not increase, and neither does the counter of~$e'$.
If there does not exist $e''\notin\{e,e'\}$ with $c_{e''}(t)\leq c_{e'}(t)$, then we must be in the situation where $e\in\mathrm{minedges}(t)$ and $|\mathrm{minedges}(t)|=2$.
Let $v=e\cap e'$. Then, by Lemma~\ref{lem:observation}, we have
$c_v(t)=c_e(t)=c_{e'}(t)$, and any vertex $v'\neq v$ must satisfy $c_{v'}(t)>c_v(t)$ (since $v'$ has at least one incident edge different from $e,e'$).
Thus, the counter of $v$ increases, and the counter of $e'$ also increases.
\end{proof}
\begin{theorem}\label{theo:dual_complete}
For any fixed $n\geq 2$, in the $N$-uniform model (resp. in the $N$-balanced model), {the counter of each vertex $v\in K_n'$ satisfies $c_v^{(N)}/N=n/(n-1)+o(1)$ w.h.p. as $N\to\infty$.}
Hence, the relative error $R_e^{(N)}$ of each edge $e$ in $K_{n}'$ satisfies $R_e^{(N)}=1/(n-1)+o(1)$ w.h.p. as $N\to\infty$.
\end{theorem}
\begin{proof}
Consider a CU-process performed on $K_{n}'=(V,E)$. At each step $t$, let $p(t)=\mathrm{min}(c_v(t),\ v\in V)=\mathrm{min}(c_e(t),\ e\in E)$,
and let $q(t)=\mathrm{max}(c_e(t),\ e\in E)$.
It easily follows from Lemma~\ref{lem:complete} that $\sum_{e\in E}c_e(t)=t+p(t)$. Therefore, $(n-1)p(t)\leq t\leq (n-1)q(t)$, so that $\frac{t}{n-1}\in[p(t),q(t)]$.
We now consider the CU process on $K_{n}'$ in the $N$-uniform model.
Let $e_1,e_2$ be two edges in $E$, and let $M\geq 1$. For $t\in[0..Nn]$, the event that $c_{e_1}(t)\geq c_{e_2}(t)+M$
implies the event that $o_{e_1}(t)-o_{e_1}(t')\geq o_{e_2}(t)-o_{e_1}(t')+M$ for some $t'\in[0..t]$ (indeed, letting $t'$ be the last time before $t$ where $c_{e_1}=c_{e_2}$,
Lemma~\ref{lem:complete} ensures that all times in $[t'..t-1]$ where $c_{e_1}$ increases are due to chosing $e_1$), which
is the same as the event that $\widehat{o_{e_1}}(t)-\widehat{o_{e_1}}(t')\geq \widehat{o_{e_2}}(t)-\widehat{o_{e_1}}(t')+M$ for some $t'\in[0..t]$, with the notation of Section~\ref{sec:tree_N_uniform}.
Therefore, the event that $c_{e_2}(t)-c_{e_1}(t)\geq M$ for some $t\in[0..Nn]$ implies the event that $\mathrm{max}(|\widehat{o_{e_1}}(t)|,|\widehat{o_{e_2}}(t)|)\geq M/4$ for some $t\in[0..Nn]$.
With the terminology of Section~\ref{sec:tree_N_uniform}, for every $e\in E$, the event $\mathrm{max}_{t\in [0,Nn]}|\widehat{o_e}(t)|\geq M$ is $(N,M)$-concentrated. Hence, the event
$\{\mathrm{max}_{t\in [0,Nn]}(c_{e_2}(t)-c_{e_1}(t))\geq M\}$ is $(N,M)$-concentrated. This implies that $\mathbb{P}(c_{e_2}(Nn)-c_{e_1}(Nn)\geq N^{2/3})=O(e^{-bN^{1/3}})$ for some $b>0$, and (by the union bound) that $\mathbb{P}(q(Nn)-p(Nn)\geq N^{2/3})=O(e^{-\tilde{b}N^{1/3}})$ for some $\tilde{b}>0$. Note that $\frac{Nn}{n-1}\in[p(Nn),q(Nn)]$, and
for every edge $e\in E$ we have $c_e(Nn)\in [p(Nn),q(Nn)]$. Therefore, $\mathbb{P}(|c_e(Nn)-\frac{Nn}{n-1}|\geq N^{2/3})=O(e^{-\tilde{b}N^{1/3}})$. Hence, in the $N$-uniform
model we have $R_e^{(N)}-\frac1{n-1}=O(N^{-1/3})=o(1)$ w.h.p. as $N\to\infty$.
In the $N$-balanced model, by the same argument as in Lemma~\ref{sec:tree_N_balanced}, we have
$\mathbb{P}(|c_e^{(N)}-\frac{Nn}{n-1}|\geq N^{2/3})=O(N^{n/2}e^{-\tilde{b}N^{1/3}})$; hence, $R_e^{(N)}-\frac1{n-1}=O(N^{-1/3})=o(1)$ w.h.p. as $N\to\infty$.
\end{proof}
Note that with regular Count-Min, the relative error of every edge is $1+o(1)$ (exactly $1$ in the $N$-balanced model),
since all vertices have degree 2.
The statement and proof of Theorem~\ref{theo:dual_complete} easily extend to dual complete hypergraphs as follows. Let $K_{n,r}$ be the complete $r$-uniform hypergraph on $n$ vertices (for $n\geq r\geq 2$), and consider a CU-process on $K_{n,r}'$ in the $N$-uniform (resp. $N$-balanced) model.
Then { the counter of each vertex $v\in K_{n,r}'$ satisfies $c_v^{(N)}/N=n/(n-r+1)+o(1)$ w.h.p as $N\to\infty$}, hence the relative error $R_e^{(N)}$ of any edge $e\in K_{n,r}'$ satisfies $R_e^{(N)}=\frac{r-1}{n-r+1}+o(1)$ w.h.p. as $N\to\infty$.
For regular Count-Min, the relative error is $r-1+o(1)$ (exactly $r-1$ in the $N$-balanced model), since every vertex in $K_{n,r}'$ has degree $r$.
\section{Non-uniform distributions}
\label{sec:zipf}
An interesting and natural question is whether the phase transition phenomenon holds for non-uniform distributions as well. This question is of practical importance, as in many practical situations keys are not distributed uniformly. In particular, Zipfian distributions often occur in various applications and are a common test case for Count-Min sketches \cite{CormodeMuthuICDM05,DBLP:conf/teletraffic/BianchiDLS12,DBLP:conf/iccnc/EinzigerF15,10.1145/3487552.3487856,DBLP:journals/corr/abs-2203-14549}.
In Zipf's distributions, key probabilities in descending order are proportional to $1/i^\beta$, where $i$ is the rank of the key and $\beta\geq 0$ is the \textit{skewness} parameter. Note that for $\beta = 0$, Zipf's distribution reduces to the uniform one. It is therefore a natural question whether the phase transition occurs for Zipf's distributions with $\beta > 0$.
One may hypothesize that the answer to the question should be positive, as under Zipf's distribution, frequent keys tend to have no error, as it has been observed in earlier papers \cite{DBLP:conf/teletraffic/BianchiDLS12,DBLP:journals/corr/abs-2203-14549,benmazziane:hal-03613957}. On the other hand, keys of the tail of the distribution have fairly similar frequencies, and therefore might show the same behavior as for the uniform case.
However, this hypothesis does not hold. Figure~\ref{fig:zipf} shows the behavior of the average error for Zipf's distributions with $\beta \in \{0.2,0.5,0.7,0.9\}$ vs. the uniform distribution ($\beta=0$). The average error is defined here as the average error of all keys weighted by their frequencies\footnote{This definition is natural for non-uniform distributions, as the error for a frequent key should have a larger contribution. Note that it is consistent with the definition of Section~\ref{sec:main_results} in the $N$-balanced case, and in the $N$-uniform case it presents a negligible difference when $N$ gets large.}, i.e. $\mathrm{err}_N(H)=\frac{1}{mN}\sum_{e\in E}o_e^{(N)}\frac{c_e^{(N)}-o_e^{(N)}}{o_e^{(N)}}=\frac{1}{mN}\sum_{e\in E}(c_e^{(N)}-o_e^{(N)})$. In other words, $\mathrm{err}_N(H)$ is the expected error of a randomly drawn key from the entire input stream of length $mN$ (taking into account multiplicities).
\begin{figure
\begin{center}
\includegraphics[width=0.7\textwidth]{zipf.png}
\end{center}
\caption{Average error as a function of $\lambda=m/n$, for Zipf's distributions with $\beta \in \{0.0,0.2,0.5,0.7,0.9\}$. Plots obtained for $n=1000$, $k=3$, $N=50,000$.}
\label{fig:zipf}
\end{figure}
We observe that the phase transition behavior vanishes for $\beta>0$. It turns out that even in the subcritical regime, frequent elements, while having no error themselves, heavily affect the error of certain rare elements, which raises the resulting average error. In the supercritical regime ($\lambda>1$ in Figure~\ref{fig:zipf}) the opposite happens: the uniform distribution shows the largest average error. This is because an increasingly large fraction of the keys (those in the core of the associated hypergraph) contribute to the error, while for skewed distributions, frequent keys tend to have no error, and thus the larger $\beta$ (with frequent keys becoming more predominant) the smaller the average error. {Note that this is in accordance with the observation of \cite{DBLP:conf/teletraffic/BianchiDLS12} that the estimates for the uniform distribution majorate the estimates of infrequent keys for skewed distributions.}
\section{Concluding remarks}
We presented an analysis of conservative update strategy for Count-Min sketch under the assumption of uniform distribution of keys in the input stream. Our results show that the behaviour of the sketch heavily depends on the properties of the underlying hash hypergraph. Assuming that hash functions are $k$-wise independent, the error produced by the sketch follows two different regimes depending on the density of the underlying hypergraph, that is the number of distinct keys relative to the size of the sketch. When this ratio is below the threshold, the conservative update strategy produces a $o(1)$ relative error when the input stream and the number of distinct keys both grow, while the regular Count-Min produces a positive constant error. This gap formally demonstrates that conservative update achieves a substantial improvement over regular Count-Min.
We showed that the above-mentioned threshold corresponds to the peelability threshold for $k$-uniform random hypergraphs. One practical implication of this is that the best memory usage is obtained with three hash functions, due to the fact that $\lambda_3$ is maximum among all $\lambda_k$, and therefore $k=3$ leads to the minimum number of counters needed to deal with a given number of distinct keys.
In \cite{DBLP:conf/sigmod/CohenM03} it is claimed, without proof, that the rate of positive errors of conservative update is $k$ times smaller than that of regular Count-Min. This claim does not appear to be true. Note that Count-Min does not err on a key represented in the sketch if and only if the corresponding edge of the hypergraph includes a leaf (vertex of degree 1), while the conservative update can return an exact answer even for an edge without leaves. However, this latter event depends on the relative frequencies of keys and therefore on the specific distribution of keys and the input length. On the other hand, our experiments with uniformly distributed keys show that this event is relatively rare, and the rate of positive error for Count-Min and conservative update are essentially the same.
One important assumption of our analysis is the uniform distribution of keys in the input.
We presented an experimental evidence that for skewed distributions, in particular for Zipf's distribution, the phase transition
{disappears when the skewness parameter grows. Therefore, the uniform distribution presents the smallest error in the subcritical regime. The situation is the opposite in the supercritical regime when the number of distinct keys is large compared to the number of counters: here the uniform distribution presents the largest average error.
As mentioned earlier, }
for Zipf's distribution, frequent keys have essentially no error, whereas in the supercritical regime, low frequency keys have all similar overestimates. This reveals another type of phase transition in error approximation for Zipf's distribution, occurring between frequent and infrequent elements. Quantifying this transition is an interesting open question directly related to the accurate detection of \textit{heavy hitters} in streams.
\paragraph*{Acknowledgments} We thank Djamal Bellazougui who first pointed out to us the conservative update strategy.
| {'timestamp': '2022-07-15T02:10:48', 'yymm': '2203', 'arxiv_id': '2203.15496', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15496'} | arxiv |
\section{Introduction}
In the last few years, multi-speaker text-to-speech (TTS) models have been proposed that can create entirely new high-quality voices \cite{jia2018transfer, stanton2021speaker}. While these approaches can generate unique voices that are distinct from voices seen during training, it is unclear how to create a personalized voice that fits one's own mental representation. The existence of such a tool would open the door to numerous creative and practical applications, such as developing customized voices for robots, personalized speech assistants, bringing fictional characters or paintings to life, or developing individualized voices for speech-impaired people.
A large body of psychological research has shown that people actively make inferences about faces, including the personality, age, or background of the person \cite{jack2015review, sofer2014trustworthiness, ekman1992emotions, angulu2018age, walker2016personality}. Since the relation between face and voice is complex, we use humans-in-the-loop to find voices in the speaker latent space of a trained TTS model that match their perception of faces in photographs, art portraits, and cartoons. Despite the fact that this approach is not automated and relies on expensive human judgments, subjective evaluations from an independent group of human raters confirm that the created voices accurately match the faces.
\section{Background}
Previous human-in-the-loop approaches have shown that humans can iteratively build feature representations for personalizing sound and speech. For example, Ritschel et al. \cite{ritschel2019personalized} used an interactive evolutionary algorithm to allow users to create sounds that express intentions and emotions for a social robot. Van Rijn et al. \cite{vanrijn2021exploring} used an adaptive method to sample from latent semantic human representations \cite{harrison2020gsp} to find prototypes of emotional speech by adapting the latent representation of a GST Tacotron model \cite{wang2018style}.
In the past years, various approaches have been proposed to create novel voices. Jia et al. \cite{jia2018transfer} demonstrated that an independently trained speaker encoder network trained on a speaker verification task can produce useful conditioning for a multi-speaker text-to-speech model. By sampling random points from the obtained speaker embedding space, the authors generated fictitious voices that were not seen during the training. Another approach was proposed by Stanton et al. \cite{stanton2021speaker} that does not rely on transfer learning from the speaker verification task, but jointly learns a distribution over speaker embeddings, also allowing for sampling a novel voice. However, all of these papers focus on speaker generation, but not on speaker personalization. To our knowledge, this is the first paper using speaker generation models for voice personalization.
In the present paper, we adopt the method proposed by Jia et al. \cite{jia2018transfer} and used embeddings from a speaker verification network as speaker representation: because they can be trained on noisy speech of thousands of speakers, do not require transcripts, can extract speaker embeddings for unseen voices, and the obtained voice prototypes can be reused in future models if trained on the same pretrained speaker verification network. While this work use this particular state-of-the-art architecture for voice synthesis (Figure \ref{fig1}A), our human-sampling approach (Figure \ref{fig1}B) can be extended to work with a large class of speaker generation models so that they can be used for voice personalization.
\begin{figure*}[ht!]
\centering
\includegraphics{figures/figure_1.pdf}
\caption{Overview. (A) The architecture used in this paper is a modified version of the VITS model using SpeakerNet ($\theta_\mathrm{spk}$) and GST embeddings ($\theta_\mathrm{gst}$). $z_q$ is the posterior latent sequence for a speech sample. (B) Participants move a slider adjusting a single dimension of the voice. The same slider is presented to three participants. The mean answer is passed to the next iteration. This allows us to gradually optimize the voice which fits to a face over the course of iterations. (C) Image materials. Images are extracted for all speakers in the RAVDESS corpus. We use deep-learning style transfer to convert the images to cartoons and paintings.}
\label{fig1}
\end{figure*}
\section{Methods}
\subsection{TTS Architecture}
Here, we use the state-of-the-art TTS model VITS \cite{kim2021conditional}, consisting of the following components: (i) text frontend composed of text normalization followed by a grapheme-to-phoneme model utilizing IPA characters (International Phonetic Alphabet) \cite{bernard2021phonemizer}, (ii) transformer-based Text Encoder with a projection layer used to construct prior distribution, (iii) Normalizing Flow greatly improving the flexibility of prior latent space, (iv) convolutional Posterior Encoder producing $z_q$, (v) Monotonic Alignment Search (MAS) and Stochastic Duration Predictor (SDP) modules learning to align input characters to encoded spectrogram frames, (vi) high-fidelity GAN vocoder based on the HiFi-GAN \cite{jungil2020hifigan} architecture. We extend VITS by two additional components described below: SpeakerNet and GST.
We use the pretrained speaker verification network SpeakerNet-M \cite{koluguri2020speakernet} as speaker embeddings. The model was trained on 7,205 speakers and has a satisfactory trade-off between the quality on a speaker recognition task and a small computational footprint. We furthermore found that SpeakerNet mainly encoded voice pitch and timbre information and not prosody. In order to learn prosodic variation, we extend our model with a bank of Global Style Tokens (GST) \cite{wang2018style}, which extracts style embeddings from encoded spectrogram frames. We initialized 16 Global Style Tokens with 8 attention heads and the resulting embedding size was set to 256. For the GST encoder, an 8-layer convolutional network was used with the same architecture as the Posterior Encoder. During training, the speaker and style embedding were separately L2-normalized and concatenated. During the experiments, we use the same zero embedding to keep prosody approximately constant across samples.
To prevent the GSTs from learning speaker-dependent features in presence of SpeakerNet embeddings, an additional adversarial loss is proposed as follows. Alongside discriminators, a separate shallow feed-forward neural network is trained to reconstruct the speaker embeddings from extracted style embeddings. During the discriminator step, this network minimizes a cosine distance between real and reconstructed speaker embeddings using cosine embedding loss: $(1-\mathrm{cos}(x,\hat{x}))$. Conversely, during the generator step, the style extractor is penalized if this network succeeded in reconstructing speaker embeddings -- the loss function is then: $(\mathrm{max}(0,\mathrm{cos}(x,\hat{x})))$. The overview of the architecture is depicted in Figure \ref{fig1}A.
We applied transfer learning from the publicly available VCTK checkpoint \cite{vits} and the training was continued using two NVIDIA V100 GPUs. For the first 400k iterations only the discriminators were allowed to train due to the lack of a published discriminator checkpoint, then normal training continued for additional 2M iterations with learning rate lowered to 1e-4.
\begin{figure*}[ht!]
\centering
\includegraphics{figures/figure_2_comp.pdf}
\caption{Results. (A) Final speaker profiles on mean values for F0 and MFCC1--4. The shaded areas in all plots refer to 95\% confidence intervals. (B) Example profiles for speaker 8 at different iterations. (C) The Euclidean distance between consecutive iterations is larger for earlier iterations compared to later iterations. (D) The Euclidean distance to the original reference drops over the first ten dimensions and slightly increases and decreases. (E) The mean opinion score increases over the course of iterations.
}
\label{fig2}
\end{figure*}
\subsection{Gibbs Sampling with People}
`Gibbs Sampling with People' (GSP) is an adaptive technique \cite{harrison2020gsp},
where many participants collaborate to navigate a stimulus space and identify regions associated with a given semantic concept, in our case optimize voice parameters so that they match a target face animation. The participants' responses are organized into sequences of iterations called ``chains''. In each trial, the participant is presented with a stimulus (a synthesized voice) and a slider, where the slider is coupled to a particular dimension of the stimulus space that changes from trial to trial. The participant is instructed to move the slider to find the stimulus most associated with the target face. In our implementation, three different participants contribute trials for a given iteration in a given chain, and their responses are averaged. The resulting stimulus (based on the average response) is then passed along the chain of participants, with each successive generation of participants optimizing a different dimension of the stimulus (Figure 1B). This procedure is repeated multiple times, cycling through each of the dimensions of the sample space. Harrison et al. (\cite{harrison2020gsp}) demonstrated that the emergent process corresponds to a Gibbs sampler that maps the relationship between the target face and the participants' internalized representations of the corresponding voice parameters
In the current experiment, participants change the first ten principal components of the SpeakerNet embeddings. Initial piloting suggested that these principal components had the desired property of intuitive interpretability (e.g., PC2 has a strong gender effect), and prior research with related models suggested that 10 principal components should be enough to achieve meaningful control over the stimuli \cite{harrison2020gsp}. The principal components were computed on SpeakerNet embeddings extracted on a single utterance of the 45,825 speakers present in the train, dev, and test partitions of the English CommonVoice dataset \cite{commonvoice} and account for 25.4 \% of the variance. The participants are prompted to adjust a slider that corresponds to one principal component to make the voice maximally similar to a face (see Figure \ref{fig1}C for some of the faces). For practical reasons, every slider contains a finite resolution of 31 equally-spaced slider positions. As opposed to using static images, we use Wav2Lip \cite{prajwal2020wav2lip} to synchronize the lips to the voice so that the resulting stimulus looks more natural (see supplementary materials).
\section{Materials}
\subsection{Stimuli}
In order to compare the personalized voice with ground truth, we extracted stills and speaker embeddings from recordings of real speakers. It was important to use speakers who are unknown to the participants because this might constrain possible voices attributed to the face. We used the same neutral utterance of all 24 speakers in the RAVDESS corpus \cite{livingstone2018ravdess}.
To demonstrate our approach does not only work for real faces, but also for fictional characters, we created for each original image four fictional characters based on style transfer. We used toonify \cite{pinkey2020toonify} and three additional art portrait styles from Ai Gahaku\cite{ai_gahaku}: OR, EX3, and ROO or P00 (see example in figure 1C). We selected the images in the following way. We start by creating 12 art portraits and one toonified version and then select four styles with the highest perceptual similarity to the real photo \cite{zhang2018perceptual} (see Figure \ref{fig1}C). Thus, we select toonify, OR, and EX3 styles, but in 22 of 24 cases we select R00 and in all other cases we select P00.
For all 24 speakers, we use the extracted images and four styles with the highest perceptual similarity totaling 120 chains. To each chain, we randomly assign one of the 720 phonetically balanced and semantically neutral Harvard sentences \cite{harvardsentences}.
\subsection{Participants}
All participants were recruited from Amazon Mechanical Turk (AMT) and provided informed consent in accordance with the Max Planck Society Ethics Council approved protocol (application 2021\_42). Participants were paid \$9/hour. Requirements for participation include a minimum age of 18 years, 99\% or higher approval rate on at least 5,000 previous tasks on AMT, residency in the US, and wearing headphones \cite{woods2017headphone}. Participant recruitment was managed by PsyNet \cite{harrison2020gsp}, an under-development framework for implementing complex experimental paradigms. This framework builds on the Dallinger platform \cite{dallinger} for experiment hosting and deployment.
\begin{figure*}[ht!]
\centering
\includegraphics{figures/figure_3.pdf}
\caption{Gender difference. (A) Generated speaker embeddings in MDS space in which voices for male and female pictures occupy increasingly distinct areas in the voice latent space. Each row represents two iterations, read from left to right, top to bottom. (B) The pitch strongly increases for female faces and is lowered for male faces in the first ten iterations. The solid background reflects common pitch ranges for the sexes. Extracted F0 is expressed in Hz. (C) In the final iterations, the difference in the generated voice is smaller within the different styles of the same face (purple), compared to a random same-sex (green) or different-sex face (yellow).}
\label{fig3}
\end{figure*}
\section{Results and discussion}
\subsection{Main experiment}
180 US participants (69 female, 3 prefer not to say, 68 male) engaged in the main experiment. The age ranged from 19 to 78 years old (\textit{M} = 41, \textit{SD} = 12). We terminated the experiment after 48 hours, after which 99 out of the 120 chains were full (22 iterations). In the last iteration, we obtain unique profiles for all 24 speakers (Figure \ref{fig2}A) and while each voice is randomly initialized, the profiles rapidly develop towards the final prototypes (Figure \ref{fig2}B). Quantitatively, we show that the Euclidean distance between consecutive iterations within a chain decreases over the course of iterations (Figure \ref{fig2}C), stabilizing toward the final 15 iterations. This means that participants move the sliders to a lesser extent at later iterations, suggesting convergence. We also compared the created speaker embedding at each iteration with the original speaker embedding of the real speaker. As we can see in Figure \ref{fig2}D, the difference to the reference is dropping for the first 10 iterations and then mildly increases and decreases again.
\subsection{Validation}
In a separate validation experiment, participants (\textit{N} = 110, 50 female, 1 prefer not to say, 59 male; age \textit{M} = 35, \textit{SD} = 10) rated how well the voice matches the moving face on a 5-point Mean Opinion Score (MOS): `Excellent', `Good', `Fair', `Poor', and `Bad match'. The validation included all stimuli generated in the first experiment, (overall 2,409 stimuli). Participants performed 200 ratings per experiment and consequently on average every stimulus was rated 9.1 times. As depicted in Figure \ref{fig2}E, the average MOS increases over the course of iterations for all styles. However, the increase is largest for the original faces moving from a 2.7 MOS at iteration 0 to a MOS of 4.0 (`Good match') in the later iterations (Wilcoxon rank sum test, \textit{Z} = .42, \textit{p} $<$ 0.001, Bonferroni-adjusted). The trend is followed by the cartoons (Wilcoxon rank sum test, \textit{Z} = .18, \textit{p} $<$ 0.001, Bonferroni-adjusted).
For art portraits the improvement over iterations is smallest (Wilcoxon rank sum test, \textit{Z} = .16, \textit{p} $<$ 0.001, Bonferroni-adjusted).
\subsection{Toward personalized voice characteristics}
To further understand what kind of voice features were selected by the personalization process, we visualize the speaker latent space using Multi Dimensional Scaling on all voices created in the experiment. As shown in Figure \ref{fig3}A, over the course of iterations, male and female faces occupy increasingly distinct areas in the voice latent space. Furthermore, the average pitch starts at roughly the same point due to the random initialization of the voices and over the course of iterations is lowered for male and increased for female voices (Figure \ref{fig3}B). Voices for males and females converge in a pitch range common for the sex (85-155 and 165-255 Hz respectively) as indicated by the shaded areas \cite{fitch1970fundamental}.
Based on these results, we can state that the speaker gender apparent from the face is well-recovered in the voice. However, do people only focus on gender or also on other characteristics of the face? In order to address this question, we run another analysis. Here, we compute the Euclidean difference between the voices created for different styles of the same speaker versus a random speaker of the same sex. Using bootstrapping (\textit{n} = 1,000) we show that the voice differences within the same speaker are significantly smaller compared to a voice of a random speaker of the same sex (Figure \ref{fig3}C). The results show that the voice prototypes can capture face-specific image features in addition to gender.
\subsection{Limitations and outlook}
Since the ratings plateau at a MOS of 4 (``good match'') there is still room for improving the match. A simple way to improve the model is to increase the dimension of the latent space and apply GSP to the style embeddings instead of fixing the prosody in all chains. Furthermore, applying neutral prosody to all stimuli can have a negative impact on intelligibility, amplified by the fact that participants should focus on the match between voice and face rather than intelligibility. For future work, we may also explore running iterations within the same participants and without aggregating multiple responses per iteration (see \cite{harrison2020gsp, vanrijn2021exploring} for an exploration of these options). Another possible modification is changing the interface so that there are more sliders per interaction.
Another approach to disentangle prosody could be to initially obtain the speaker embeddings from a speaker verification network and at a later stage to learn them with the other components of the model. This initialization with speaker verification embeddings can be a reasonable starting point. In the present study, we used the first ten principal components computed on the SpeakerNet Embeddings, but future research can explore alternative parametrizations of the speaker latent space that potentially better align with human perception and might explain more variance.
\section{Conclusion}
In this paper, we presented a human-in-the-loop approach for generating speech personalized to a specific face. To this end, we used an embedding space of a speaker verification network as input to a state-of-the-art TTS model. The embeddings were modified collaboratively by the use of a GSP experiment in order to find a voice that is consistent with shown images of realistic faces, portraits, and cartoon-style faces. Our evaluation showed that over the course of our experiment, the MOS of the generated speech, representing the consistency between the speech and the shown faces, increased from 2.7 to 4.0. This indicates that our approach is promising for synthesizing highly personalized speech for a specific speaker's visual appearance.
Taken together our results open up a vast range of creative and practical applications including personalized voices in audiobooks and games, personalized speech assistants, and individualized voices for people with speech-impairments.
\section{Acknowledgments}
This work has partially been funded by the European Union Horizon 2020 research and innovation programme, grant agreement 856879 (PRESENT).
\clearpage
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-07-12T02:38:18', 'yymm': '2203', 'arxiv_id': '2203.15379', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15379'} | arxiv |
\section{Introduction}
\label{sec:intro}
Event cameras are bio-inspired vision sensors developed in recent years \cite{brandli2014240}.
Different from traditional frame-based cameras which capture a scene as a synchronous sequence of 2D images, event cameras asynchronously measure brightness changes on each pixel and output \emph{event} streams.
An event encodes the timestamp, pixel coordinates and polarity of brightness changes.
Compared with traditional cameras, event cameras have numerous advantages: extremely high event rate ($>10^6$ events per second, events/s) and dynamic range (up to $130$ dB) while traditional cameras usually obtain $\sim 30$ FPS and $65$ dB, respectively \cite{son20174}.
Additionally, event cameras only require a very low data rate (KB vs. MB) by removing an amount of the inherent redundancy of standard cameras, thus making it quite efficient.
The unique properties of event cameras make them as ideal sensors for running visual SLAM systems on low-power embedded platforms, such as robots and drones, for real-time applications.
The event-based monocular visual SLAM systems involve event-based 3D reconstruction which aims to estimate the depth information and the structure of the scene from event cameras.
Unlike the multi-view stereo methods, the monocular methods only require a single event camera which do not pursue instantaneous depth estimation, but rather depth estimation for SLAM \cite{cadena2016past}.
Recently, the event-based monocular multi-view stereo (EMVS) technique has received particular attention, since its performance will greatly affect the overall performance of visual SLAM systems \cite{zhou2021event}\cite{zhou2018semi}.
However, it is very challenging to unlock the benefits of event cameras for monocular multi-view stereo applications on embedded platforms for real-time purpose.
This is due to the fact that event cameras represent a paradigm shift in acquisition of visual information, thus requiring novel algorithms and specified hardware design \cite{gallego2020event}.
Previous accelerators designed for traditional intensity-frame-based multi-view stereo algorithms cannot be directly applied for the event-based algorithms.
Several previous algorithms have been proposed for EMVS implementations \cite{rebecq2018emvs}\cite{kim2016real}\cite{gallego2018unifying} but all of them could only run on relatively powerful CPU or GPU platforms.
Aiming to improve the computational efficiency of EMVS, an event-based space-sweep method \cite{rebecq2018emvs} is proposed by back-projecting events to create a ray density volume \cite{collins1996space}, and then find local maxima of ray density to estimate the scene structure.
Such an efficient EMVS implementation integrated with an event-based visual odometry (EVO) system \cite{rebecq2016evo} could process $1.2$ million events/s when running with a single core of Intel x86 CPU, and $4.7$ million events/s with $4$ cores \cite{rebecq2018emvs}.
However, running the EMVS algorithms on multi-core x86 CPUs is not practical for embedded EVO applications.
Another event processing pipeline is proposed in \cite{kim2016real} by utilizing three filters running in parallel to jointly estimate the motion of the event camera and 3D map.
Such an approach only runs on GPUs for real-time performance and cannot process high event rate input (up to $1$M events/s).
A unified event processing framework is proposed in \cite{gallego2018unifying} focusing on motion estimation, depth estimation and optical flow estimation.
However, such a framework is only evaluated on a desktop CPU and no quantitative results are provided.
Overall, all of these implementations are insufficient to fully unlock the potential advantages of event cameras for EMVS systems.
This motivates us to explore more efficient EMVS algorithm-hardware co-design approach for real-time target on low-power embedded platforms.
From comparative analysis, we observed that the event-based space-sweep procedures in EMVS have significant advantages including relatively high parallelism, low data dependency and low computational redundancy.
These advantages make it very suitable for customized hardware acceleration, which is adopted as the basic framework for our algorithm-hardware co-design and optimizations.
In this paper, \texttt{Eventor} is proposed as an FPGA/ARM heterogeneous accelerator for EMVS systems. The most time-consuming tasks of event back-projection and volumetric ray-counting are performed on FPGA. The main contributions are listed below:
\begin{itemize}[topsep=4pt,leftmargin=12pt]
\item[$\checkmark$] A novel efficient EMVS accelerator, \texttt{Eventor}, is proposed for real-time applications on embedded FPGA platform via algorithm-architecture co-design approaches.
\item[$\checkmark$] The involved EMVS algorithm is redesigned and customized in a hardware-friendly manner, which makes the accelerator much more efficient.
\item[$\checkmark$] Highly paralleled and fully pipelined architecture is designed and integrated with the heterogeneous execution model to improve the throughput and reduce the memory footprint.
\end{itemize}
The remainder of the paper is organized as follows. Section \ref{sec:system} demonstrates some comprehensive analysis of EMVS algorithm for potential optimization. Section \ref{sec:arch} illustrates the detailed architecture of the proposed \texttt{Eventor}. Evaluation results are provided in Section \ref{sec:exp}. Finally the conclusions are given in Section \ref{sec:con}.
\section{EMVS System}
\label{sec:system}
In this section, typical EMVS algorithm is analyzed for computational patterns evaluation and reformulated for hardware-friendly targeting.
Meanwhile, data quantization and compression strategies are further exploited to improve the computational efficiency.
\begin{figure}[t]
\includegraphics[width=\linewidth]{figure/emvs-workflow.pdf}
\caption{A typical EMVS workflow. This paper focuses on building the semi-dense depth information from the event streams.}
\label{fig:emvs-workflow}
\end{figure}
\subsection{Algorithm Analysis}
EMVS algorithm aims to address the problem of estimating 3D structure from the event stream acquired by a moving event camera with a known trajectory \cite{rebecq2018emvs}.
A typical EMVS system is depicted in Fig.~\ref{fig:emvs-workflow}.
It mainly consists of four procedures: event \emph{aggregation} ($\mathcal{A}$), event back-\emph{projection} ($\mathcal{P}$), volumetric \emph{ray}-counting ($\mathcal{R}$) and scene structure \emph{detection} ($\mathcal{D}$).
The system receives the input event stream and corresponding camera trajectory, and reconstructs the semi-dense depth information of the viewing scene by event-based space-sweep method.
The complete workflow of EMVS algorithm is illustrated in Fig.~\ref{fig:emvs-framework}, and each stage is described as follows.
\emph{\textbf{Event Aggregation}}.
Specifically, when the logarithmic brightness at a certain pixel $\left(x_{k},y_{k}\right)$ reaches a threshold, event camera generates an event $e_{k}\doteq \left \langle x_{k},y_{k},t_{k},p_{k}\right \rangle$, where $x_{k}$ and $y_{k}$ is the corresponding pixel's coordinates of $k$-th event, $t_{k}$ is the timestamp of the triggered event and $p_{k}$ is the polarity of the brightness change.
\emph{Aggregation} (denoted as $\mathcal{A}$) divides the generated event stream to event frames (i.e. event packets) which will be processed together.
\emph{\textbf{Event Back-Projection}}.
Event back-\emph{projection} (denoted as $\mathcal{P}$) is the first stage of event-based space-sweep method. Each event in an event frame is back-projected to the viewing space according to the camera pose of the frame.
Usually a ray density volume is created to record the distribution of back-projected rays.
A disparity space image (DSI) is interchangeably used to describe the discretized space volume and the scores stored in each voxel (i.e., the number of back-projected viewing rays passing through each voxel) \cite{rebecq2018emvs}.
The DSI is defined by dividing the viewing space to $N_{z}$ slices along the depth and discretizing each slice to $w \times h$ cuboid voxels, where $w$ and $h$ are the horizontal and vertical resolution of the event camera.
So the DSI size is $w \times h \times N_{z}$. Assuming the center of a voxel is $\mathcal{X}=\left(X,Y,Z\right)^{T}$, then back projecting events to the DSI can be discretized to the execution of mapping events to all the depth planes $\left \{ \mathbb{Z}_{i} \right \}_{i=1}^{N_{z}}$ located in the middle of the slices.
By creating a virtual camera located at a reference viewpoint, a DSI could be defined for its view recording.
The event back-projection is performed by two steps:
\ding{182}
Each event is firstly mapped from the current camera to the virtual camera via a canonical plane $\mathbb{Z}_{0}$ using homography matrix $\mathcal{H}_{\mathbb{Z}_{0}}$, which are denoted as $\mathcal{P}\left(\mathbb{Z}_{0}\right)$. The coordinates of events back-projected to $\mathbb{Z}_{0}$ are denoted as $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$.
\ding{183}
The other depth planes $\mathbb{Z}_{i}$ could be obtained by mapping the points from $\mathbb{Z}_{0}$, which are denoted as $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$. The coordinates of events back-projected to $\mathbb{Z}_{i}$ are denoted as $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right)\right \}$.
\emph{\textbf{Volumetric Ray-Counting}}.
After back-projecting events to DSI volume, the second stage of event-based space-sweep method is counting the number of back-projection rays that pass through each voxel (denoted as $\mathcal{R}$).
In the previous stage, the ray-voxel intersections are discretized to back projecting events to depth planes $\left \{ \mathbb{Z}_{i} \right \}_{i=1}^{N_{z}}$.
Then accumulating votes in the DSI can be done by voting DSI voxels at positions of $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right), \mathbb{Z}_{i}\right \}$.
\begin{figure}[t]
\includegraphics[width=0.85\linewidth]{figure/emvs-framework.pdf}
\caption{EMVS algorithm framework.}
\label{fig:emvs-framework}
\end{figure}
\emph{\textbf{Key Frame Selection}}.
The EMVS algorithm selects several key reference views along the trajectory of the event camera and constructs local DSI.
After setting the original reference viewpoint, a new event frame could be only selected as a new key frame ($\mathcal{K}$) if the distance between the current event camera pose and the previous key reference view exceeds a threshold.
All of the events between two key frames will be utilized to estimate the local depth information.
\emph{\textbf{Scene Structure Detection}}.
Scene structure detection ($\mathcal{D}$) is the last stage of event-based space-sweep method.
A semi-dense depth map at the reference viewpoint is extracted from the DSI by determining whether a 3D point is present in each DSI voxel.
Based on the theory that the regions where multiple back-projection rays nearly intersect are likely to possess scene points, the algorithm determine 3D points by finding DSI voxels whose ray density scores are at local maximum of the ray density function.
\emph{\textbf{Merging Depth Information}}.
After getting the semi-dense depth map of the previous reference view at the scene structure detection procedure, the old local DSI is abandoned and a new local DSI is set in the viewing space of the new reference viewpoint.
Then the depth map is converted to a local point cloud and merged into the global point cloud ($\mathcal{M}$).
Hence, it includes three steps: reset DSI, point cloud conversion, and map updating.
\emph{\textbf{Computational Evaluation}}.
According to our observations, the most computational intensive and time-consuming tasks in the whole algorithm is \emph{event back-projection} ($\mathcal{P}$) and \emph{volumetric ray-counting} ($\mathcal{R}$).
When evaluating the EMVS algorithm on the DAVIS event camera dataset \cite{mueggler2017event}, the runtime of these two tasks accounts for over $80\%$ of total runtime.
To execute EMVS efficiently in real-time on a low-power embedded system, optimizations for these two tasks are obviously required, from both algorithm and hardware perspectives.
Hence, the procedures of $\mathcal{P}$ and $\mathcal{R}$ are accelerated by FPGA in our proposed \texttt{Eventor}.
\subsection{Hardware-Friendly Reformulation}
\label{subsec:reform}
Aiming to relieve the computational bottleneck ($\mathcal{P}$ and $\mathcal{R}$) of EMVS algorithm, an algorithm-hardware co-optimization approach is proposed where the original algorithm is rescheduled in a hardware-friendly manner as shown in Fig.~\ref{fig:emvs-reschedule}.
The event back-projection ($\mathcal{P}$) is divided into four sub-tasks:
\ding{202} \emph{Compute Homography Matrix} aims to compute the homography matrix $\mathcal{H}_{\mathbb{Z}_{0}}$,
\ding{203} \emph{Canonical Event Back-Projection} corresponds to $\mathcal{P}\left(\mathbb{Z}_{0}\right)$,
\ding{204} \emph{Compute Proportional Back-Projection Parameters} determines the parameters $\phi$ required in $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$,
\ding{205} \emph{Proportional Event Back-Projection} conducts the actual $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$.
And the volumetric ray-counting ($\mathcal{R}$) is divided into two sub-tasks:
\emph{Generate DSI Votes} ($\mathcal{G}$) and \emph{Vote DSI Voxels} ($\mathcal{V}$).
\begin{figure}[t]
\includegraphics[width=\linewidth]{figure/emvs-reschedule.pdf}
\caption{Details of original EMVS framework (left) and rescheduled for hardware-friendly optimization in our \texttt{Eventor} (right).}
\label{fig:emvs-reschedule}
\end{figure}
\emph{\textbf{Workload Evaluation}}.
We further evaluate the computational workload of each sub-task for the above $\mathcal{P}$ and $\mathcal{R}$ procedures.
Among all the sub-tasks, \emph{Canonical Event Back-Projection} ($\mathcal{P}\left(\mathbb{Z}_{0}\right)$), \emph{Proportional Event Back-Projection} ($\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$), \emph{Generate DSI Votes} ($\mathcal{G}$) and \emph{Vote DSI Voxels} ($\mathcal{V}$) will take up most of the runtime, because the required executions are proportional to the number of input events, while the \emph{Homography Matrix} ($\mathcal{H}_{\mathbb{Z}_{0}}$) and \emph{Proportional Back-Projection Parameters} ($\phi$) are only updated once when a new event frame is received.
Validation results on the DAVIS dataset show that the four sub-tasks above are responsible for over $90\%$ execution time of $\mathcal{P}$ and $\mathcal{R}$ procedures.
\emph{\textbf{Computation Parallelism Analysis}}.
The above $\mathcal{P}$ and $\mathcal{R}$ procedures could be found with high parallel availability.
According to the mechanism of event-based space-sweep method, there are mainly three types of parallelism in workloads:
\begin{itemize}[topsep=3pt,leftmargin=12pt]
\item[$\medtriangleright$] \emph{Operator-Level Parallelism}.
For the involved matrix and vector calculations in the procedure of $\mathcal{P}$, multiple arithmetic logic units (ALUs) could be deployed for fine-grained parallelism.
\item[$\medtriangleright$] \emph{Event-Level Parallelism}.
The procedure $\mathcal{P}$ requires to back-project each input event to the viewing space separately and extract scene structure from the ray density volume, which does not require simultaneous event observations or event matching.
Hence, different events can be processed in parallel and the computation stages involved can be fully pipelined.
\item[$\medtriangleright$] \emph{DSI-Level Parallelism}.
Due to the discretized structure of DSI and depth planes $\left \{ \mathbb{Z}_{i} \right \}_{i=1}^{N_{z}}$, the procedure $\mathcal{P}$ for different depth planes can be executed in parallel, so can voting for different DSI voxels.
\end{itemize}
\begin{figure}[t]
\centering
\begin{subfigure}{0.495\linewidth}
\centering
\includegraphics[width=\linewidth]{figure/vote-error.pdf}
\caption{Different voting approaches.}
\label{fig:error-compare:vote-error}
\end{subfigure}
\begin{subfigure}{0.495\linewidth}
\centering
\includegraphics[width=\linewidth]{figure/quant-error.pdf}
\caption{w/ or w/o quantization.}
\label{fig:error-compare:quant-error}
\end{subfigure}
\caption{Depth estimation error (AbsRel) comparison between different approaches evaluated on different datasets. The maximum AbsRel difference between Nearest Voting and original Bilinear Voting is about $1.18\%$. The maximum AbsRel difference before and after quantization is about $1.01\%$.}
\label{fig:error-compare}
\end{figure}
\emph{\textbf{Dataflow Reformulation}}.
According to the evaluation and analysis above, there are four tasks accelerated on FPGA: $\mathcal{P}\left(\mathbb{Z}_{0}\right)$, $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$, $\mathcal{G}$ and $\mathcal{V}$.
The high parallelism makes accelerating these tasks on FPGA rewarding.
However, the dataflow of the original EMVS framework shown in Fig.~\ref{fig:emvs-reschedule} (left) is not hardware-friendly enough.
Rescheduling the original algorithm to a streaming and hardware-friendly manner is proven to be an effective strategy in previous software-hardware co-optimization designs for traditional visual SLAM, such as the ORB-SLAM accelerator in \cite{liu2019eslam}.
Therefore, we perform reformulation to the EMVS algorithm for sufficient acceleration on heterogeneous systems.
As illustrated in Fig.~\ref{fig:emvs-reschedule} (right), the reformulation is mainly performed in the aspects of \emph{Rescheduling} and \emph{Approximate Computing}:
$\RHD$ \emph{\underline{Rescheduling}} includes the stages of \emph{Event Distortion Correction} and \emph{Compute Proportional Back-Projection Coefficients}.
\ding{182}
\emph{Event Distortion Correction} execution is originally performed after the events aggregated to a whole frame.
We set this stage before \emph{Event Aggregation} so that the correction is executed for each event in a streaming manner.
Streaming corrections could improve memory access efficiency during the aggregation stage.
\ding{183}
\emph{Proportional Back-Projection Coefficients} $\phi$ is pre-computed before performing $\mathcal{P}\left(\mathbb{Z}_{0}\right)$.
With the pre-computed $\phi$, the subsequent stages $\mathcal{P}\left(\mathbb{Z}_{0}\right)$, $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$, $\mathcal{G}$ and $\mathcal{V}$ could be efficiently accelerated on FPGA in parallel and fully pipelined. Meanwhile, the originally required data transfer of $\phi$ could be significantly reduced.
$\RHD$ \emph{\underline{Approximate Computing}} is adopted to improve the execution efficiency of procedure $\mathcal{R}$.
\ding{182} A standard DSI voting approach is named \emph{bilinear voting}, which is similar to bilinear interpolation.
Bilinear voting adopts a point $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right), \mathbb{Z}_{i}\right \}$ to vote for the corresponding four nearest voxels on depth plane $\mathbb{Z}_{i}$ by splitting its contribution according to the distance between this point to each voxel.
\ding{183} Another approximate approach is called \emph{nearest voting}, which simply adopts each point to vote for its nearest neighboring voxels.
Nearest voting approach is less accurate than bilinear voting.
However, the computation complexity and memory access characteristics of nearest voting are much more hardware-friendly than bilinear voting.
The depth estimation accuracy comparison between Bilinear Voting and Nearest Voting is illustrated in Fig.~\ref{fig:error-compare:vote-error} by absolute relative error (AbsRel) across different datasets.
Fig.~\ref{fig:error-compare:vote-error} shows that the accuracy loss is acceptable when adopting nearest voting.
Considering the requirement of hardware-friendly manner, nearest voting is exploited in our dataflow.
\subsection{Hybrid Data Quantization}
Since most data involved in EMVS dataflow are represented by long floating-point format, we consider converting them as short fixed-point representations to reduce the memory footprint and data transferring bandwidth requirements.
Linear quantization method is utilized both for event coordinates and related parameters during the procedure of $\mathcal{P}$ and $\mathcal{R}$.
Detailed quantization strategies are illustrated in Table~\ref{tab:quantization}.
\begin{table}[t]
\caption{Detailed quantization strategies for procedure $\mathcal{P}$ and $\mathcal{R}$. Original floating-point data are quantized by fix-point data.}
\label{tab:quantization}
\small
\begin{tabular}{|c|c|c|c|}
\hline
Quantized Data Type & Total \#bit & \#bit of Integer & \#bit of Decimal \\ \hline
($x_k$, $y_k$) & $16$ & $9$ & $7$ \\ \hline
$\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ & $16$ & $9$ & $7$ \\ \hline
$\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right)\right \}$ & $8$ & $8$ & $0$ \\ \hline
$\mathcal{H}_{\mathbb{Z}_{0}}$ & $32$ & $11$ & $21$ \\ \hline
$\phi$ & $32$ & $11$ & $21$ \\ \hline
DSI Scores & $16$ & $16$ & $0$ \\ \hline
\end{tabular}
\end{table}
\emph{\textbf{Event Coordinates Quantization}}.
For event coordinates, we adopt a hybrid quantization strategy.
Considering the byte-aligned bit width limitation and the $32$-bit data bus width between DRAM and FPGA, we utilize $16$-bit data to store the coordinates of the original input events ($x_k$, $y_k$).
In this way, the coordinates of an event are quantized as a pair of $16$-bit data and concatenated to a $32$-bit data to be saved in memory.
For events generated by DAVIS event camera with resolution of $240 \times 180$, $9$-bit is enough for integer part of fixed-point coordinates, and remaining $7$-bit is exploited for decimal part.
Coordinates of $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ are quantized by using the same strategy.
As for coordinates of $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right)\right \}$, due to the mechanism of nearest voting method adopted in procedure $\mathcal{R}$, finding the nearest voxel to the projected point could be done by rounding the precise floating coordinates to integers.
Therefore, their coordinates can be quantized as $8$-bit integers.
\emph{\textbf{Parameters Quantization}}.
Since the homography matrix $\mathcal{H}_{\mathbb{Z}_{0}}$ and pre-computed parameters $\phi$ are usually invoked repeatedly during the procedures, their precision settings will have larger impact on the whole algorithm.
On the other hand, the required memory of these parameters are essentially much less than event coordinates and DSI scores.
As an appropriate strategy, they are quantized as $32$-bit data with $11$-bit integer part and $21$-bit decimal part.
As our observations, the sufficient integer bit width avoids data overflow, and continuing to increase the decimal bit width will not bring significant improvement to the depth estimation accuracy.
\emph{\textbf{DSI Scores Quantization}}.
For the scores stored in DSI voxels, they are quantized from $32$-bit float to $16$-bit integer.
Benefiting from nearest voting method, the increments (i.e. votes) of the scores are integer so that no decimal part is required.
Since the entire DSI structure are usually required to be stored in memory, such a quantization strategy can significantly reduce the memory footprint.
In summary, our hybrid data quantization strategy can save up to $50\%$ of the memory requirement and data transferring bandwidth.
Meanwhile, the depth estimation errors resulted from quantization are also evaluated across different datasets and illustrated in Fig.~\ref{fig:error-compare:quant-error}.
Evaluation results indicate that the accuracy of our quantized framework is comparable to the original full-precision framework.
\section{\texttt{Eventor} Architecture}
\label{sec:arch}
\begin{figure}[t]
\includegraphics[width=\linewidth]{figure/eventor-architecture.pdf}
\caption{Overall hardware architecture of our proposed \texttt{Eventor}.}
\label{fig:eventor-architecture}
\end{figure}
Base on the reformulated dataflow, overall hardware architecture of \texttt{Eventor} is designed on Zynq FPGA platform as shown in Fig.~\ref{fig:eventor-architecture}.
\texttt{Eventor} is partially implemented with programmable logic (PL) of FPGA and hosted by an ARM CPU as the processing system (PS).
\emph{Canonical Projection Module} and \emph{Proportional Projection Module} are exploited to compute $\mathcal{P}\left(\mathbb{Z}_{0}\right)$, $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$.
For processing each input event frame, ARM configures DMA to transfer input event coordinates $\left(x_{k},y_{k}\right)$ and parameters to input buffers.
Then ARM sends instructions to start the computational modules.
Overall, \texttt{Eventor} receives the input event frames streaming and updates the DSI data stored in DRAM.
\subsection{Canonical Projection Module}
Canonical Projection Module aims to compute $\mathcal{P}\left(\mathbb{Z}_{0}\right)$.
It receives the input event frames, $\mathcal{H}_{\mathbb{Z}_{0}}$, and outputs $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$.
It also temporarily stores the proportional back-projection parameters and provides them together with intermediate event coordinates.
\textbf{AXI Interface} supports DMA to transfer input data and parameters via AXI bus. Quantized $16$-bit coordinates $\left(x_{k},y_{k}\right)$ are concatenated as 32-bit data which are transferred via AXI bus and stored in buffer.
\textbf{Buffers} in Canonical Projection Module include:
\ding{182}
\texttt{Buf\_H} for storing $\mathcal{H}_{\mathbb{Z}_{0}}$,
\ding{183}
Event Buffer \texttt{Buf\_E} for storing input event coordinates $\left(x_{k},y_{k}\right)$,
\ding{184}
Proportional Back-Projection Parameter Buffer \texttt{Buf\_P} for storing parameters $\phi$ required in $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$,
\ding{185}
Intermediate Buffer \texttt{Buf\_I} for storing $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$.
Among them, \texttt{Buf\_H} is composed of registers since only one $3\times3$ homography matrix is required for each input event frame.
And the others are built with on-chip BRAM.
All of these buffers (including the Vote Buffer \texttt{Buf\_V} illustrated in Subsection \ref{sebsec:ppm} are realized by the manner of \emph{double-buffering}.
Many dataflow-driven accelerator designs have adopted this strategy to guarantee continuous loading and output streaming \cite{fu2018scalable}.
In this way, the transferring and processing of streaming data can be executed simultaneously, thus avoiding pipeline halt due to waiting for input data.
\textbf{PE\_Z0} is the processing element (PE) deployed in Canonical Projection Module for computing $\mathcal{P}\left(\mathbb{Z}_{0}\right)$.
It is equipped with a set of matrix-vector multiply-accumulate (MV MAC) units and a normalization function unit. $\mathcal{P}\left(\mathbb{Z}_{0}\right)$ is accelerated by multiple ALUs deployed in \texttt{PE\_Z0}, which are fully pipelined.
\texttt{PE\_Z0} loads $\mathcal{H}_{\mathbb{Z}_{0}}$ from \texttt{Buf\_H}, then receives streaming $\left(x_{k},y_{k}\right)$ from \texttt{Buf\_E} and outputs $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ to \texttt{Buf\_I}.
Since the workload of $\mathcal{P}\left(\mathbb{Z}_{0}\right)$ is less than $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$, only one \texttt{PE\_Z0} is deployed.
Besides, the latency of computing $\mathcal{P}\left(\mathbb{Z}_{0}\right)$ is not the critical path for normal frames in the pipelined workflow which will be demonstrated in Subsection \ref{sebsec:workflow}.
\textbf{Controller} in Canonical Projection Module mainly receives the starting instructions and configurations, then initializes \texttt{PE\_Z0} and buffers.
The Canonical Projection Controller is built as a finite-state machine (FSM), which has a specially designed synchronization state to synchronize the double-buffering state of \texttt{Buf\_E} together with the Proportional Projection Controller.
This synchronization mechanism ensures two modules to work in a pipelined mode.
\subsection{Proportional Projection Module}
\label{sebsec:ppm}
Proportional Projection Module is responsible for $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$.
It receives $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ and $\phi$ from Canonical Projection Module, and updates the DSI voxels scores.
\textbf{PE\_Zi:} Canonical Projection Module has multiple \texttt{PE\_Zi} to execute $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{G}$.
\texttt{PE\_Zi} receives $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$ and $\phi$ from Data Allocator, and generates the addresses of DSI voxels which are required for \texttt{Buf\_V}.
\texttt{PE\_Zi} includes: Scalar MAC Units, Nearest Voxel Finder and Vote Address Generator.
Scalar MAC Units execute $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$.
Nearest Voxel Finder computes the nearest DSI voxel to $\left \{x_{k}\left(\mathbb{Z}_{i}\right), y_{k}\left(\mathbb{Z}_{i}\right), \mathbb{Z}_{i}\right \}$ and conducts projection missing judgement.
Vote Address Generator generates the vote addresses, which are directly utilized for updating DSI scores.
Usually different PEs (multiple \texttt{PE\_Zi}) could share a same event input and operate simultaneously in parallel for different depth planes.
\textbf{Data Allocator} fetches input data and parameters required by \texttt{PE\_Zi} and allocates them to PEs.
Different PEs need different parameters while sharing a same event input.
The dataflow between \texttt{Buf\_I} and \texttt{PE\_Zi} is managed by this allocator.
\textbf{Vote Execute Unit} exploits the DSI vote addresses stored in \texttt{Buf\_V} to vote the corresponding voxels.
It is equipped with two AXI-HP ports and data transfer logic to directly access the DRAM via the DRAM controller, no need for ARM intervention. The old scores stored in DSI voxels are fetched from DRAM, added by a vote value (typically $1$) and wrote back to DRAM.
\begin{figure}[t]
\includegraphics[width=\linewidth]{figure/pipeline.pdf}
\caption{The pipelined workflow of normal event frame (upper) and key event frame (lower).}
\label{fig:pipeline}
\end{figure}
\subsection{Accelerator Workflow}
\label{sebsec:workflow}
The overall execution model of \texttt{Eventor} is shown in Figure \ref{fig:pipeline}.
Canonical Projection Module and the Proportional Projection Module work in a pipelined order while \texttt{Eventor} receives the streaming input event frames.
For normal event frames, the two modules work simultaneously.
Canonical Projection Module starts working as soon as \texttt{Buf\_I} is ready for new input so that Proportional Projection Module can operate continuously.
In this way, the actual execution time for each frame is equal to the sum of the execution time of $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$, and the execution time of $\mathcal{P}\left(\mathbb{Z}_{0} \right)$ is overlapped.
Things are different when a new key event frame is selected.
Because a new key frame means a new reference view, the DSI will be reset and the following events will be back projected and vote for the new DSI.
So the Canonical Projection Module will wait until the Proportional Projection Module finishes processing the previous event frame, then start processing the key event frame if it is fired up.
The Proportional Projection Module then starts to work once receiving $\left \{x_{k}\left(\mathbb{Z}_{0}\right), y_{k}\left(\mathbb{Z}_{0}\right)\right \}$.
Therefore, the execution time for a key frame is equal to the sum of the execution time of $\mathcal{P}\left(\mathbb{Z}_{0} \right)$, $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ and $\mathcal{R}$.
\subsection{Parallelization Mechanism}
According to the computation parallelism analysis carried out in Section \ref{subsec:reform}, three levels of parallelism are involved: operator-level, event-level and DSI-level.
\texttt{Eventor} aims to fully utilize these parallelism.
For operator-level parallelism, we deploy multiple ALUs in \texttt{PE\_Z0} to accelerate matrix and vector calculation.
For event-level parallelism, the workflow and datapath of \texttt{Eventor} is designed as a fully-pipelined scheme to process events without data dependency.
For DSI-level parallelism, multiple \texttt{PE\_Zi} are implemented inside the Proportional Projection Module to back-project an event to multiple depth planes and generate vote addresses simultaneously.
Benefiting from the exploration of parallelism, our \texttt{Eventor} is able to achieve a relatively high event processing rate.
\section{Experimental Results}
\label{sec:exp}
This section first introduces our experimental setup.
Then, we evaluate the effectiveness of our hardware-friendly dataflow reformulation and the proposed \texttt{Eventor} accelerator.
\subsection{Experimental Setup}
\textbf{Hardware Implementation:}
The \texttt{Eventor} is implemented and evaluated on Xilinx Zynq XC7Z020 SoC \cite{zynq}.
Its PL is with $4.9$ Mb BRAM as on-chip memory and 1 GB, 32-bit DDR3 DRAM as external memory. The clock frequency of \texttt{Eventor} is 130 MHz, and the DDR clock is $533$ MHz.
The prototype of \texttt{Eventor} is equipped with two \texttt{PE\_Zi} and corresponding \texttt{Buf\_I} in Proportional Projection Module.
The computation modules on PL are implemented by hand-optimised RTL.
The resources utilization of \texttt{Eventor} are shown in Table~\ref{tab:utilization}. It can be seen that \texttt{Eventor} uses quite few resources.
\begin{table}[t]
\caption{The FPGA resources utilization of \texttt{Eventor}.}
\label{tab:utilization}
\small
\begin{tabular}{|c|c|c|c|}
\hline
& \# LUT & \# FF & BRAM \\ \hline
Utilization & $ 17538$ ($32.97\%$) & $22830$ ($21.46\%$) & $64$ KB ($11.43\%$) \\ \hline
\end{tabular}
\end{table}
\textbf{Dataset:} The reformulated EMVS framework and \texttt{Eventor} are evaluated on DAVIS event camera dataset and simulator \cite{mueggler2017event}.
It contains event streams captured with a DAVIS event camera in a variety of simulated and real environments, along with ground-truth camera trajectories.
The resolution of a DAVIS event camera is $240\times180$.
Four different sequences are used for evaluation: \emph{simulation\_3planes} and \emph{simulation\_3walls} are simulated sequences, \emph{slider\_close} and \emph{slider\_far} are captured in real scene.
\begin{figure}[t]
\centering
\begin{subfigure}{0.495\linewidth}
\centering
\includegraphics[width=\linewidth]{figure/total-error.pdf}
\caption{The depth estimation error (AbsREL) of our reformulated hardware-friendly EMVS when compared with original EMVS.}
\label{fig:total-error:error}
\end{subfigure}
\hfill
\begin{subfigure}{0.43\linewidth}
\centering
\includegraphics[width=\linewidth]{figure/depth_colored.pdf}
\caption{A sample demonstration of reconstructed scene structure from the sequence of \emph{simulation\_3planes}.}
\label{fig:total-error:scene}
\end{subfigure}
\caption{Accuracy of depth estimation comparison and reconstructed scene structure demonstration.}
\label{fig:total-error}
\end{figure}
\subsection{Accuracy Analysis}
The accuracy of EMVS is measured by depth estimation error (absolute relative error, AbsREL), which means the difference between the depth of reconstructed scene structure and the groundtruth.
Fig.~\ref{fig:total-error:error} shows the comparison of average depth estimation error between original EMVS and our reformulated framework.
For \emph{simulation\_3planes} and \emph{simulation\_3walls}, the original EMVS has a better accuracy than our reformulated framework, but the maximum difference is less than $1.78\%$.
For \emph{slider\_close} and \emph{slider\_far}, our framework even has a better accuracy than the original EMVS.
Overall, the results indicate that the accuracy of our reformulated framework is comparable to original EMVS.
A sample reconstructed scene structure from the sequence of \emph{simulation\_3planes} is also demonstrated in Fig.~\ref{fig:total-error:scene} for 3D view.
\subsection{Performance Evaluation}
The performance of \texttt{Eventor} is compared with the EMVS run on Intel i5-7300HQ CPU \cite{intel}.
Comparison results of computation speed and power consumption are illustrated in Table~\ref{tab:performance}, including detailed runtime breakdown, average runtime per event frame and the event processing rate.
Each event frame consists of $1024$ events, which is determined according to the sensor's event rate and storage.
Compared with the Intel i5 CPU, the event processing rate of \texttt{Eventor} is slightly higher, without obvious advantage.
However, in terms of power consumption, \texttt{Eventor} shows great advantage over the Intel CPU. As shown in Table \ref{tab:performance}, the power consumption can be reduced by $24\times$.
\texttt{Eventor} is able to achieve significant energy reduction with no loss of performance.
\begin{table}[t]
\caption{Performance comparison between \texttt{Eventor} and original EMVS run on Intel i5 CPU.}
\label{tab:performance}
\small
\begin{tabular}{|cc|c|c|}
\hline
\multicolumn{2}{|c|}{} & Intel CPU & \texttt{Eventor} \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Runtime per Event Frame\\ ( $\mu$s / task )\end{tabular}}} & $\mathcal{P}\left(\mathbb{Z}_{0}\right)$ & 22.40 & 8.24 \\ \cline{2-4}
\multicolumn{1}{|c|}{} & $\mathcal{P}\left(\mathbb{Z}_{0} \leadsto \mathbb{Z}_{i}\right)$ \& $\mathcal{R}$ & 559.55 & 551.58 \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Runtime per Event Frame\\ ( $\mu$s / frame )\end{tabular}}} & Normal frame & 581.95 & 551.58 \\ \cline{2-4}
\multicolumn{1}{|c|}{} & Key frame & 581.95 & 559.82 \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Event Processing Rate\\ ( $10^6$ events / second)\end{tabular}}} & Normal frame & 1.76 & 1.86 \\ \cline{2-4}
\multicolumn{1}{|c|}{} & Keyframe & 1.76 & 1.83 \\ \hline
\multicolumn{2}{|c|}{Power (W)} & 45 & 1.86 \\ \hline
\end{tabular}
\end{table}
\section{Conclusions}
\label{sec:con}
In this paper, an efficient EMVS accelerator, \texttt{Eventor}, is proposed for real-time applications and evaluated on Zynq FPGA platform.
The EMVS algorithm is partly reformulated to a more hardware-friendly manner, and hybrid data quantization strategies are adopted to improve the computational efficiency.
Meanwhile, the most time-consuming stages, i.e., event back-projection and volumetric ray-counting are accelerated on FPGA with different parallelism.
Evaluation results show that \texttt{Eventor} could achieve $24\times$ improvement in energy efficiency compared with Intel i5 CPU.
The overall performance of \texttt{Eventor} could satisfy the requirements of real-time reconstruction on power-limited embedded platforms.
\section{0pt}{3pt plus 1pt minus 1pt}{0pt plus 1pt minus 1pt}
\titlespacing\subsection{0pt}{3pt plus 1pt minus 1pt}{0pt plus 1pt minus 1pt}
\titlespacing\subsubsection{0pt}{3pt plus 1pt minus 1pt}{2pt plus 1pt minus 1pt}
\setlength{\textfloatsep}{8pt plus 1pt minus 1pt}
\setlength{\floatsep}{10pt plus 1pt minus 1pt}
\setlength{\intextsep}{4pt plus 1pt minus 1pt}
\setlength{\columnsep}{21pt}
\setlength{\belowdisplayskip}{5pt} \setlength{\belowdisplayshortskip}{5pt}
\setlength{\abovedisplayskip}{5pt} \setlength{\abovedisplayshortskip}{5pt}
\fi
\settopmatter{printacmref=false}
\setcopyright{acmcopyright}
\copyrightyear{2022}
\acmYear{2022}
\setcopyright{acmcopyright}\acmConference[DAC '22]{Proceedings of the 59th ACM/IEEE Design Automation Conference (DAC)}{July 10--14, 2022}{San Francisco, CA, USA}
\acmBooktitle{Proceedings of the 59th ACM/IEEE Design Automation Conference (DAC) (DAC '22), July 10--14, 2022, San Francisco, CA, USA}
\acmPrice{15.00}
\acmDOI{10.1145/3489517.3530452}
\acmISBN{978-1-4503-9142-9/22/07}
\begin{document}
\title{
\texttt{Eventor}: An Efficient \underline{Event}-Based Monocular Multi-View Stereo Accelera\underline{tor} on FPGA Platform
}
\titlenote{This work was supported by the National Natural Science Foundation of China (Grant No. 62072019). \\
Corresponding author: \textit{Jianlei Yang}, Email: \url{[email protected]}}
\author{Mingjun Li$^1$, \quad Jianlei Yang$^1$, \quad Yingjie Qi$^1$, \quad Meng Dong$^2$, \quad Yuhao Yang$^1$,}
\author{Runze Liu$^3$, \quad Weitao Pan$^2$, \quad Bei Yu$^4$, \quad Weisheng Zhao$^1$}
\affiliation{
\institution{
$^1$Beihang University, Beijing, China \hspace{3em}
$^2$Xidian University, Xi'an, Shaanxi, China \\
$^3$Beijing Real Imaging Medical Technology Co., Ltd. \hspace{3em}
$^4$The Chinese University of Hong Kong, Hong Kong
}
}
\input{0-abstract.tex}
\keywords{Event-based Vision, Multi-View Stereo, FPGA, Acceleration}
\setcopyright{none}
\maketitle
\pagestyle{plain}
\pagenumbering{gobble}
\input{1-introduction.tex}
\input{2-system.tex}
\input{3-architecture.tex}
\input{4-experiment.tex}
\input{5-conclusions.tex}
\bibliographystyle{unsrt}
| {'timestamp': '2022-06-08T02:13:12', 'yymm': '2203', 'arxiv_id': '2203.15439', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15439'} | arxiv |
\section{Introduction}
The adversarial machine learning (AML) domain has been expanding rapidly recently due to increased adversarial attacks on various traditional ML and deep learning (DL) systems. An adversarial attack is a process of causing well-planned misclassifications from a target classifier. In short, let us assume a ML system $f$, input sample $x_{clean}$, which is a natural input (Non-adversarial) and its true label $y_{true}$. The ML system correctly classifies this input i.e. $f(x_{clean})=y_{true}$. Now the system will be said under adversarial attack if an adversary carefully crafts an input sample $x_{adv}$ such that $f(x_{adv})\neq y_{true}$.
An adversary can attack a target ML-based system from the digital world as well as the physical world. When the adversary leverages its digital access to the target system, creates and presents an adversarial example (AX) digitally to the target system, the realized attack is called a digital adversarial attack. On the other hand, it is called a physical adversarial attack if the adversary realizes the attack from the physical world. The target system for these AXs could be a face recognition system (FRS), where a trained DL model tries to validate the claimed identity of an input face image.
The adversarial attack can be of dodging type or impersonation type based on the attacker's objective. However, crafting impersonation (targeted) attacks is more challenging than dodging-type attacks. In this work, we focus on the generation of impersonation attacks. Also, an adversary can attack a target system during the training \cite{barreno2006can, biggio2011support, biggio2013poisoning, mei2015using}, testing \cite{goodfellow2014explaining, papernot2016distillation, papernot2016limitations, eykholt2018robust}, or model deployment stage\cite{miao2021machine, sehatbakhsh2020security}.
For physical adversarial attacks, the standard methods to transfer digital AXs to Physical World include printing and painting. The success of physical attacks depends on physical transferability, which is the ability of digital AXs to successfully transfer/imitate to the physical world. However, the attack performance in the physical world has been relatively lower than in the digital world.
Some practical FRSs use a printed image to verify a subject’s identity, e.g., person re-identification, automatic ID document (like a passport) photo-matching systems at international borders. When an adversary submits a physical adversarial image in a registration process that causes a mistake by the target FRS, this attack is called a physical image registration attack. It allows an adversary to impersonate a target identity; This causes serious security concerns\cite{kakizaki2021toward}. This work considers physical image registration setting during physical world evaluation and focuses on improving physical transferability.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figure_pdf/reg_attack.png}
\caption{Physical image registration attacks against FRSs. An adversary registers an AX $x_{adv}$ generated using a clean source image $x_s$ in the target system. At the time of face verification, the registered $x_{adv}$ results in the successful verification of a person at the security gate even the person ($x_p$) is different from the person of $x_{adv}$ image.}
\label{fig:reg_attack}
\end{figure}
Effective optimization of adversarial noise during the attack generation process results in robust AXs following misclassification objectives. For a better physical attack success rate (ASR), the generation of smooth patterns is a well-known approach for lower \textit{physical reconstruction losses}. \textit{Physical reconstruction loss} is the total amount of information lost and the noise added to the physical AX while transferring it from the digital world\cite{kurakin2016adversarial,singh2021brightness}. The errors during printing, camera noises, change in camera angles, variable lighting conditions \cite{singh2021brightness}, attack surface characteristics, and realism is the critical parameters influencing the physical re-constructability of digital AXs, thereby the success of a physical AX.
\noindent \textbf{Our main contributions from this work are as follows:}
\begin{enumerate}
\item We propose a novel smoothness regularizer for generating robust AXs with high physical transferability for attacking FRSs from the physical world. Our smoothness loss also provides black-box performance improvements to the generated attacks due to the regularization effect.
\item We propose a novel patch-noise combo attack method for generating powerful digital and physical adversarial attacks against FRSs by combining patch and imperceptibly small adversarial noises.
\item We perform extensive white-box and black-box evaluation in the digital and physical worlds for state-of-the-art attack generation algorithms, for the proposed smoothness regularizer and the patch-noise combo attack method. We present a practical methodology for the physical world evaluation of registration-based adversarial attacks. We also provide the physical world evaluation for the ineffectiveness of the attacks with imperceptibly small noises in the physical world.
\end{enumerate}
\subsection{Related Works}
To reduce physical reconstruction loss, previous works focused on generating smoother patterns in the adversarial noise. Existing studies found that abrupt pixel variations in a digital image, when compared to smoother patterns, cause significant printing \cite{sharif2016accessorize} and camera \cite{mahendran2015understanding} errors when transferred to the physical world. The smooth adversarial patterns result in a better ASR for the printed AXs. Sharif et al. \cite{sharif2016accessorize} proposed a smoothness loss function to generate smoother adversarial patterns for physical AXs. Their smoothness loss is given below.
\begin{equation}\label{eqn: tvm}
T V(r)=\sum_{i, j}\left(\left(r_{i, j}-r_{i+1, j}\right)^{2}+\left(r_{i, j}-r_{i, j+1}\right)^{2}\right)^{\frac{1}{2}}
\end{equation}
\noindent Where $r_{i,j}$ is the pixel intensity in the noise image with coordinates $(i,j)$. This smoothness penalty is used as a regularizer in the adversarial loss function and minimizes the differences in the adjacent pixel values in an image $r$. They improved the smoothness of the adversarial patch, thereby improving the inconspicuousness and physical realizability of the generated adversarial patches.
Though the smoothness loss used by Sharif et al. \cite{sharif2016accessorize} results in the performance of improvements of the generated AXs in the physical world, it suffers from some primary limitations. It causes more substantial constraints on the optimization procedure for adversarial attack generation, reducing the convergence rate and white box ASR in the digital environment. Also, this reduction in the feasible solution space restricts a large number of possible practical patterns. It treats the imperceptible noise as well as perceptible noise in the same manner. Moreover, it does not allow selective optimization of the adversarial noise. It does not allow the formation of smooth sub-patches within the main malicious patch when the pixel distribution within the sub-patch and the remaining area of the patch is substantially different, thus, making it unfeasible for generating AXs with a sub-region representing a small smooth area of significantly different colors or patterns.
\section{Our Proposed Smoothness Loss}
We propose a smoothness loss based on an activation threshold $\tau$ that causes calculation of total variation (TV) only for the pixel pairs having deviation greater than $\tau$ from an initial reference value. Our proposed smoothness penalty is given in equation \ref{our_loss}.
\begin{multline}\label{our_loss}
L_{\text {smooth}}=\sum_{i, j}(\left(p_{i+1, j}-p_{i, j}\right)^2 \cdot\left(M_{i+1, j} \cdot M_{i,j}\right)+ \\ \left(p_{i, j+1}-p_{i, j}\right)^2 \cdot\left(M_{i, j+1} \cdot M_{i, j}\right))^{\frac{1}{2}}
\end{multline}
\noindent Where,
\begin{equation}
M_{i, j}= \begin{cases}1 & p_{i, j} \geq \tau_{i,j} \text{ and } \tau_{i,j} \in Z \\ 0 & \text {else}\end{cases}
\end{equation}
\noindent $p_{i,j}$ is the difference in the value of a pixel from the reference value at location $(i,j)$ in the adversarial noise region. $M$ is a dynamic mask that activates the smoothness loss for pixels with intensities greater than a predefined level. The threshold matrix $Z$ activates the smoothness penalty for respective pixels in the adversarial patch region. The matrices $M$ and $Z$ have the exact dimensions as the source face image $x_s$ using which AX is generated. Each pixel-level threshold $\tau_{i,j} \in Z$ can have a predefined fixed value or can be updated iteratively.
\subsection{Working of Existing \cite{sharif2016accessorize} vs. Our Smoothness Loss}
The existing smoothness loss \cite{sharif2016accessorize} starts penalizing the total variation (TV) present in the input image's trainable pixels (adversarial noise pixels) right from the beginning of the attack generation process. This causes excessive constraints on the adversarial optimization process from the start, considerably limiting the feasible solution space for the adversarial noise patterns. On the other hand, our smoothness loss starts penalizing the TV only for pixel pairs with a significant deviation from an initial reference value. Thus the pixels away from the initial reference value only are smoothened.
It is to be noted that giving very high weightage to our smoothness regularizer might result in confining the solution space near a ball (with radius proportional to thresholds in $Z$) around the reference value, but the constraints remain softer than the existing penalty \cite{sharif2016accessorize} because of the hinge type margin caused by $Z$. Hence our smoothness loss introduces delayed smoothness constraints only at selected pixel locations during the attack generation process resulting in faster and better converged final solutions while maintaining a similar level of smoothness present in the generated AXs.
\section{Our Patch-Noise Combo Attack}
Existing works focus on generating adversarial noise coming from a single distribution. To generate stronger AXs for FRSs, we combined an adversarial patch (eyeglass) noise $\delta_p$ with an imperceptibly small noise $\delta_s$ (calling imperceptible noise from hereon). The small noise $\delta_s$ is placed in the remaining area of the face image $x_s$.
\begin{equation}\label{patch-noise update}
x^{p-n}_{adv} = x_s + M_s \cdot \delta_s + M_p \cdot \delta_p
\end{equation}
\noindent Where, the mask matrix $M_p$ takes values 1 for the pixels at patch location in $x_s$ and 0 otherwise.
In this attack, adversarial noises of different sizes and different distributions are combined to form a single strong AX. We abbreviate it as “patch-noise combo attack” due to the combination of adversarial noises coming from different distributions. Our patch-noise combo attack is illustrated in the Figure \ref{fig:noise_combo}. This attack causes increased ASR in the digital domain mainly because the increased feasible solution space resulted from additional adversarial noise. However, for the physical world success of this attack, the size constraints on the imperceptible noise play a vital role (can be understood further in Section \ref{res_dis}).
The minimal size of the imperceptible noise $\delta_s$ results in digital world ASR increase only because the physical reconstruction losses neutralize the effect in the physical world. However, increasing the size (by relaxing $L_{\infty}$ size constraints) increases physical ASR but decreases the physical imperceptibility of generated AXs. Hence, a target domain-specific choice of the size constraints for $\delta_s$ can be made for generating powerful patch-noise combo attacks in the physical world.
This type of attack can be successfully used for attacking FRSs digitally and physically where the submission of a printed image is required for the verification, e.g., registration attacks.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figure_pdf/noise_combo_face.png}
\caption{Generation of our patch-noise combo attack combining imperceptibly small noise with eyeglass patch for highly transferable digital and registration-based physical AXs.}
\label{fig:noise_combo}
\end{figure}
\section{Experimental Setting} \label{exp_setting}
\subsection{Pretrained DL Models}
We used state-of-the-art DL models as deep feature extractors in the FRS setting. In the feature extractor setting, the final layer of a DL model outputs a vector of deep representative features for the given input compared to the output class probabilities in the classification setting. A properly trained classifier can be used as a feature extractor by removing the last softmax/classification layer.
We used ResNet50\cite{he2016deep}, ResNet100\cite{he2016deep}, VGG16\cite{vgg16model}, SE-IR100\cite{hu2018squeeze}, and SphereFace\cite{Liu_2017_CVPR} model architectures. The VGG16 model was trained on VggFace\cite{vggface_data} data using the softmax loss. We trained two variants for each of ResNet50 and ResNet100 models using softmax and arcface\cite{deng2019arcface} loss functions on VggFace2\cite{vggface2} and MS1MV2\cite{deng2019arcface} data, respectively. The IR-SE100 model was also trained on MS1MV2 dataset. We calculated the verification threshold $\tau$ for best accuracies. Only four models were used at a time for each attack setting. The diverse model setting allows the elimination of unnecessary biases during the evaluation.
\subsection{Algorithms for Attack Generation}
For a comprehensive experimental analysis, we selected the four most widely used gradient-based attack generation algorithms. We applied all these algorithms in a feature-extractor setting. The algorithms that we use for the attack generation are given below.
\noindent \textbf{(1) Projected Gradient Descent (PGD) Attack \cite{pgd}.} We initialized the PGD attack for source image $x_s$ with some initial Gaussian random noise $\delta$ as $x_0 \leftarrow x + \delta$. The update step during $t^{th}$ iteration of attack generation process for the PGD attack is given in equation \ref{pgd_update}.
\begin{equation}\label{pgd_update}
x^{t+1} \leftarrow {Clip}_{x,\epsilon}\left(x^t + \alpha \cdot Sign\left(\nabla L_{adv}\right)\right)
\end{equation}
\noindent Where, $\nabla L_{adv}$ is the gradients calculated w.r.t the adversarial loss function $L_{adv}$.
\noindent \textbf{(2) Carlini and Wagner Attack (CW) \cite{cw}.} The Carlini Wagner attack minimized the $\Delta L$ and training adversarial noise $\delta$ while keeping $x+\delta \in [0,1]$ for all pixels in the adversarial region of the training image. For making sure to satisfy the above constraints, the following transformation was used.
\begin{equation}
x_i + \delta_i = \frac{tanh(w_i)+1}{2}
\end{equation}
Where, $w_i$'s were trainable parameters.
\noindent \textbf{(3) Layerwise Origin-Target Synthesis (LOTS) Attack \cite{lots}.} This attack is proposed explicitly for feature extractors. In our setting, we calculated the loss for the final layer of the model only.
\noindent \textbf{(4) Iterative Fast Gradient Sign (IFGSM) Attack \cite{ifgsm1,ifgsm2}.} This attack is almost the same as the PGD attack except the training images were initialized as $x_0 \leftarrow x$.
\subsection{Black-box Attack Techniques}
To generate black-box attacks, we used three techniques for attack robustness and transferability enhancement.
\noindent \textbf{(a) Input Diversity Method \cite{input_div}:} we applied random crop transformations to the training image in each training iteration of the attack generation process. The random crop was limited to $7\%$ of the original image's length for every four edges.
\noindent \textbf{(b) Ensemble Diversity Method \cite{ensemble_div}:} we used ResNet50\cite{he2016deep} and SE-IR50\cite{hu2018squeeze} models (with equal weights to loss) out of the four pre-trained DL models for attack generation and remaining models for black-box evaluation.
\noindent \textbf{(c) Combination of Input and Ensemble Diversity: }we combined the input diversity \cite{input_div} and ensemble diversity \cite{ensemble_div} to further enhance the robustness and black-box transferability.
\subsection{Type of Attacks and Adversarial Objective}
All of the experimentations were performed for an impersonation attack objective. In the impersonation attacks against FRSs, a source image $x_s$ is perturbed to an adversarial image $x_{adv}$ considering an adversarial loss for impersonation $L_{imper}$, such that the deep features of $x_{adv}$ becomes similar to the deep features of a target identity's image $x_{tar}$. Hence, the adversarial image $x_{adv}$ is classified as $x_{tar}$ by the target model, causing a mistake by the target DL model. We used the following loss functions for generating impersonation attacks:
\begin{equation}\label{adv_loss_fn}
{L}_{adv}= \gamma \cdot {L}_{smooth} - \sum_{i}^{K} f_{d}\left(f_{i}\left(x_{t}\right), f_{i}\left(x_{train} \right)\right)
\end{equation}
\noindent Where, ${L}_{smooth}$ is either the TV loss or our smoothness loss function, $x_{train}$ is the face image $x_s$ combined with adversarial perturbations. For patch only attacks, $x_{train} = x_s + M_p \cdot \delta_p $. For the patch-noise combo attacks, $x_{train}$ follows equation \ref{patch-noise update}. $x_t$ is the image of target identity. $f_i$ is the pre-trained face feature extractor. For non-ensemble models, $K = 1$ and $f1$ is one of the feature extractors. For ensemble models \cite{ensemble_div}, $K=2$, and $f_1$ and $f_2$ represents ResNet50\cite{he2016deep}, SE-IR50\cite{hu2018squeeze} feature-extractors. $\gamma$ is the weight parameter for the smoothness loss function. For the instances with input diversity transformation \cite{input_div}, the training image become $x^{'}_{train} = f_{DI}\left( x_{train} \right)$. The function $f_{DI}$ applies input diversity transformation \cite{input_div}. $f_d$ calculates the $L_2$ distance between given inputs.
\subsection{Ablation Study Instances}
\begin{algorithm}
\caption{Attack Evaluation Procedure Outline}\label{alg:attack_gen_procedure}
\begin{algorithmic}
\State \hskip-0.6em \textbf{Inputs:} Source image $x_s$, target image $x_t$; algorithms A = \{PGD,CW,LOTS,IFGSM\}; black-box methods B = \{None, DI, Ensemble, DI+Ensemble\}; attack techniques T = \{No regularizer, TV Loss, Our Loss, Patch-Noise Combo+TV Loss, Patch-Noise Combo+Our Loss\};
\State \hskip-0.6em \textbf{For} all $a_i \in A$, $b_i \in B$, $t_i \in T$ \textbf{do}
\State Generate digital AXs $(X_{adv})$ using combination of $a_i$,$b_i$, and $t_i$, while following the loss function of equation \ref{adv_loss_fn} and update rule of $a_i$;
\State \hskip-0.6em \textbf{Perform} \textit{digital} evaluation of $X_{adv}$;
\State \hskip-0.6em \textbf{Perform} \textit{physical} evaluation of successful digital $X_{adv}$ as per section \ref{phy_pipeline};
\end{algorithmic}
\end{algorithm}
For the ablation study, we implemented a total of 80 attack combinations following Algorithm \ref{alg:attack_gen_procedure}; out of them, 48 were baselines, and 32 were our method’s instances. We took training face images for attack generation from VggFace2 data\cite{vggface2}. We generated 100 AXs for the digital evaluation for each attack combination and a subset of 10 AXs for the physical evaluation.
\subsection{Parameter Settings}
The attack parameters for all the baselines and our methods were kept identical for effective comparison between baselines and our methods.
We set training iterations to 2000 for PGD, LOTS, and IFGSM attacks and 7000 for CW attacks after observing the convergence for the given iterations. The $\epsilon$ parameter was kept to 1 for all attacks as we are generating patch attacks. The learning rate parameter was also kept identical for all instances at 0.01 in the gradient descent setting.
\begin{figure*}
\centering
\includegraphics[width=0.9\textwidth]{figure_pdf/phy_pipe_face.png}
\caption{Our physical AX generation and evaluation pipeline in the registration attack setting.}
\label{fig:phy_pipe}
\end{figure*}
\section{Physical AXs Generation Pipeline} \label{phy_pipeline}
We considered the light conditions and the camera angle, two main physical parameters during the realization of the physical AXs.
\noindent \textbf{1. Light conditions:} Two sub-parameters were considered for the light conditions parameter. \textbf{i. Brightness levels:} We considered two different brightness levels of 800 and 1200 lux. \textbf{ii. Light color temperature:} We captured the images under white light with color temperatures of 3000K, 5000K.
\noindent \textbf{2. Angle of the camera w.r.t. the printed adversarial image:} To capture the effect of reflectivity of the attack surface, we captured a stream of images by moving the camera in a horizontal arc of radius 15cm (approx.) and by subtending an angle of approximately 45° at the center of the captured image.
To transfer the successful digital AXs to the physical world for realizing physical adversarial attacks, we followed the pipeline shown in Figure \ref{fig:phy_pipe}. The steps are as follows:
\noindent\textbf{Step 1: Generating successful digital AXs.} Powerful physically transferable digital AXs were first generated.
\noindent\textbf{Step 2: Printing.} The generated AXs were then color printed on paper.
\noindent\textbf{Step 3: Capturing printed AXs.} The printed AXs were then captured using a camera in an appropriate format for the target system. This step transfers the AXs in physical form back to the digital space for the evaluation.
\noindent\textbf{Step 4: Data cleaning.} From captured images, blurry and improper images were then cleaned. Around 20 images for each AX then remained.
\noindent\textbf{Step 5: MTCNN face detection \cite{zhang2016joint} and alignment.} To align and crop the captured physical AX as shown in Figure \ref{fig:phy_pipe} (after step-4), firstly, we performed MTCNN face detection. The detected faces were then aligned using the similarity alignment.
\noindent\textbf{Step 6: Feeding cropped and aligned AXs to the face matcher.} The cropped and aligned AXs were fed to a target face matcher depending on the attack evaluation setting (black/white-box).
\noindent\textbf{Step 7: Checking attack success.}Finally, the success or failure of the attack is checked by distance or cosine similarity-based thresholds obtained for best f1-scores.
\begin{figure*}
\centering
\begin{subfigure}{.5\textwidth}
\centering
\includegraphics[width=0.99\linewidth]{figure_pdf/dig_wb.pdf}
\caption{ASR for the white-box digital AXs}
\label{fig:dg_wb}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
\centering
\includegraphics[width=0.99\linewidth]{figure_pdf/dig_bb.pdf}
\caption{ASR for the black-box digital AXs}
\label{fig:dg_bb}
\end{subfigure}
\caption{Mean adversarial ASR for white-box (left) and black-box (right) attacks in the \textit{digital} domain. The x-axis represents the different attack generation methods, and the y-axis represents ASR. The attack generation algorithms are denoted by ‘A’ and follow the combinations of Algorithm \ref{alg:attack_gen_procedure}.}
\label{fig:dig_results}
\end{figure*}
\section{Results and Discussion} \label{res_dis}
The comprehensive experimental analysis found that our smoothness loss and patch-noise combo attack method significantly exceeds conventional techniques, especially in the physical world. The black-box transferability was also found to be increased for the generated attacks. The performance gains over the TVM approach \cite{sharif2016accessorize} for both digital and physical worlds are mainly due to better optimization in the digital world, better handling of the areas to be smoothened in the adversarial patch, and convergence to more effective solutions. Our patch-noise combo attacks in the face recognition setting generated the most potent digital and physical domains attacks.
For the white-box attacks in the digital domain, we can see from Figure \ref{fig:dg_wb} that the ASR for AXs from our smoothness loss is almost the same as the AXs generated from without any smoothness regularizer. Ideally, the AXs generated without any smoothness regularizer for the white-box case should have higher ASR as they are trained for only that single adversarial objective without any additional constraints (regularizers). Nevertheless, the attacks generated with TVM regularizer had low ASR. The reason for low ASR was the stricter smoothness constraints on the attack generation procedure by calculating total variation right from the start for all pixels in the adversarial noise region. Our smoothness loss causes fewer constraints by the calculation of total variation during the attack generation process. The fewer constraints are due to the threshold-based activation of total variation calculation. Also, due to this, the AXs generated from our patch-noise combo attack method (using our smoothness loss) considerably outperform the ones generated from the TVM approach. The ASR for our patch-noise combo attack was 1.48 times higher than the eyeglass patch-only attacks because the more significant number of trainable parameters resulted in a significantly larger feasible solution space.
From the results for the digital black box attacks shown in Figure \ref{fig:dg_bb}, we found that the AXs generated using our smoothness loss significantly outperforms in the black-box transferability and resulted in 2.88 and 1.80 times higher mean ASR compared to the AXs generated using TVM and without TVM, respectively. Our patch-noise combo attack performed the best and recorded 6.36 times higher black-box mean ASR than TVM-based patch attack. However, the AXs generated from the patch-noise combo attack using TVM regularizer also had significantly better black-box performance than the other baselines. A good white-box ASR and not being overfitted are the two critical parameters that contribute to the better black-box performance of the adversarial noise.
In the physical domain, the AXs from our smoothness loss and the patch-noise combo attack using our smoothness loss completely outperforms their respective baselines (Figure \ref{fig:phy_results}). The patch-noise combo attacks with our smoothness regularizer were the strongest in the physical domain and resulted in 2.39 and 4.74 times higher mean ASR for the white-box and black-box settings. The performance gap between ours and baseline methods in the physical domain was significantly higher than in the digital domain. Hence, proving the effectiveness of our smoothness loss and the patch-noise combo attack for excellent physical transferability of generated AXs.
\subsection{Comparing Smoothness in Generated AXs}
To better understand the superior performance of our smoothness regularizer and to confirm our hypothesis, we compare the total variation present in the generated AXs from ours and the conventional \cite{sharif2016accessorize} TVM-based smoothness regularizers.
We calculated the total variation present in the AXs generated from the existing \cite{sharif2016accessorize} and our smoothness loss using the following equation \ref{eqn: tvm}.
We found that AXs generated without using any smoothness regularizer, using TVM regularizer \cite{sharif2016accessorize}, using our smoothness loss, using patch-noise combo attack with TVM regularizer, and using patch-noise combo attack with our smoothness regularizer had a mean total variation of 39.31, 19.39, 20.93, 20.25, and 22.75, respectively.
We can see a more significant reduction in the total variation in the generated AXs due to a smoothness regularizer. But we can also see that this difference is not very significant compared to the smoothness of generated AXs from our and the existing TVM-based smoothness regularizer. Hence, we can say that our smoothness loss introduces a similar amount of smoothness in the generated AXs while allowing them to reach much better optimal solutions.
\begin{figure*}
\centering
\begin{subfigure}{.5\textwidth}
\centering
\includegraphics[width=\linewidth]{figure_pdf/phy_wb.pdf}
\caption{ASR for the white-box physical AXs}
\label{fig:sub1}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
\centering
\includegraphics[width=\linewidth]{figure_pdf/phy_bb.pdf}
\caption{ASR for the black-box physical AXs}
\label{fig:sub2}
\end{subfigure}
\caption{Mean adversarial ASR for white-box (left) and black-box (right) attacks in the \textit{physical} domain. The x-axis represents the different attack generation methods, and the y-axis represents ASR. The attack generation algorithms are denoted by ‘A’ and follow the combinations of Algorithm \ref{alg:attack_gen_procedure}.}
\label{fig:phy_results}
\end{figure*}
\subsection{Physical Transferability of Successful Digital AXs}
\begin{table}
\centering
\sisetup{detect-weight,mode=text}
\renewrobustcmd{\bfseries}{\fontseries{b}\selectfont}
\renewrobustcmd{\boldmath}{}
\newrobustcmd{\B}{\bfseries}
\addtolength{\tabcolsep}{0.29pt}
\begin{tabular}{c|c?c|c|c|c}
\toprule
Sr. & Smoothness & \multicolumn{4}{c}{ AX Generation Method } \\ \cline{3-6}
No. & Regularizer & A1 & A2 & A3 & A4 \\
\midrule
1 & S0 & $0.240$ & $0.340 $ & $0.320 $ & 0.315 \\
\midrule
2 & S1 & $0.250 $ & $0.345 $ & $0.447 $ & 0.379 \\
\midrule
3 & S2 & $0.320 $ & $0.432 $ & $0.390 $ & 0.420 \\
\midrule
4 & S3 & $0.700 $ & $0.780 $ & $0.750 $ & 0.830 \\
\midrule
5 & S4 & $0.830 $ & $0.890 $ & $0.710 $ & 0.838 \\
\bottomrule
\end{tabular}
\caption{Results for the Physical Transferability of the Successful Digital AXs. S0, S1, S2, S3, and S4 represents the use of no smoothness regularizer, existing smoothness loss \cite{sharif2016accessorize}, our smoothness loss, patch-noise combo and existing smoothness loss, and patch-noise combo and our smoothness loss.}
\label{tab:physical_trans}
\end{table}
Table \ref{tab:physical_trans} shows the physical transferability of the successful digital AXs to the physical domain. It can be seen that the AXs generated using any smoothness-based regularizer have better ASR in the physical domain as compared to the AXs generated without any smoothness regularizer. Also, the physical transferability of AXs generated from our smoothness loss remained better than the AXs generated from existing TV minimization even after using softer regularizing smoothness constraints.
\subsection{Imperceptible Noise Attacks in Physical World}
We also evaluate the performance of physical AXs with imperceptibly small adversarial noise distributed over the entire face image. Conventionally, these kinds of attacks are prevalent in the digital world only. However, in this work, we check whether they are usable for the physical world attacks.
In our experimentation, we first generated digital attacks for 7 different values (0.02, 0.05, 0.1, 0.25, 0.5, 0.75, 1) of the $epsilon$ parameter. It is to be noted that source images were normalized in the range $[0,1]$. For each value of the $epsilon$ parameter, we generated three successful digital AXs with different identities for the physical evaluation. We transferred all digital AXs to the physical world and checked the physical ASRs.
From the results (Figure \ref{fig:imper_size}) for the white-box ResNet50\cite{he2016deep} model, we found direct proportionality between $\epsilon$ and physical ASR; This is because AXs with smaller $\epsilon$ have less prominent visible adversarial patterns to the target system. Less prominence or visibility is caused due to physical reconstruction losses. Also, the AXs with smaller $\epsilon$ are more sensitive to the small perturbations than those with larger $\epsilon$. Also, from a subjective evaluation, we found an inverse proportionality between $\epsilon$ and physical inconspicuousness.
Hence, we conclude a trade-off between the ASR and inconspicuousness of AXs in the physical domain. For a physical attack to succeed, it must be physically inconspicuous and have a high attack success probability. That makes the simple adversarial noise attacks (adversarial noise not taking any real-world patch shape) an unpopular choice for the physical adversarial attacks.
\begin{figure}[!h]
\centering
\includegraphics[width=0.95\linewidth]{figure_pdf/imperceptible.pdf}
\caption{Change in physical ASR and imperceptibility with increasing size $\epsilon$ of the adversarial noise. Increasing $\epsilon$ increases physical ASR but decreases physical imperceptibility.}
\label{fig:imper_size}
\end{figure}
\section{Conclusions} \label{conclusions}
This paper proposed a novel smoothness regularizer and patch-noise combo attack method for generating powerful physical adversarial examples against practical FRSs. From extensive experimentation, we found that our proposed methods outperform all state-of-the-art baselines in the digital and physical worlds.
The use of our smoothness loss results in better physical transferability. Our smoothness loss also allows generating much complex real-world adversarial patterns due to selective smoothening in adversarial noise, reducing unwanted boundary losses. In our patch-noise combo attack, we confirm that using imperceptibly small adversarial noise along with adversarial patches can result in \textit{significant} performance improvements in the physical world. However, the size of imperceptible noise has the trade-off of ASR and physical imperceptibility. The generated digital and physical AXs from our methods allow an adequate risk assessment for the practical FRSs.
{\small
\bibliographystyle{ieee_fullname}
| {'timestamp': '2023-02-09T15:19:58', 'yymm': '2203', 'arxiv_id': '2203.15498', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15498'} | arxiv |
\section{Introduction}
\label{sec:intro}
In the context of increasing demand for seasonal migrant farm labour in member European Union states and its supply side disruption due to the pandemic~\cite{granier2021migrant}, autonomous crop monitoring has gained further importance for plant phenotyping, yield monitoring, crop protection, and harvesting.
The availability of different sensors and systems has enabled crop monitoring at different levels from global low resolution satellite mapping~\cite{rembold2013using} to drone-based crop-level mapping~\cite{maimaitijiang2020crop,stefas2019vision} to individualized plant level mapping using mobile robots~\cite{qiao2005mapping} and mobile manipulators~\cite{shafiekhani2017vinobot}, with an increase in the level of detail and precision.
While global crop monitoring is necessary to make coarse yield predictions, fruit mapping is key to accurate yield monitoring and to performing automated precise interventions.
Fruit mapping consists of the localization of fruits and estimation of their shape.
With the advent of inexpensive RGB-D cameras, fusing instance masks from panoptic segmentation networks with depth information provides 3D information about the size and location of the fruits.
However, autonomous mapping of crops such as sweet peppers can be a challenging task since the plants have complex structures, with many leaves that may partially occlude fruits.
Therefore, obtaining accurate information about the location and shape of fruits can be difficult.
Even if observations from multiple views are acquired, fruits can often be only partially covered.
To enable shape prediction in these cases, we present a system to estimate the shape of both partially and fully observed fruits.
We build upon ideas of Lehnert\etal\cite{lehnert2016sweet} who proposed to match the shape of sweet peppers with superellipsoids.
Whereas their experiments were limited to controlled environments with single pepper plants, we integrated our superellipsoid matching system with our previously developed viewpoint planner~\cite{zaenker2020viewpoint}.
As a result, we are able to apply our fruit mapping system on data captured with an RGB-D camera on a robotic arm in various scenarios containing multiple plants with sweet peppers.
\figref{fig:coverfig} shows an example application of our system using data of sweet pepper crops in a glasshouse.
As can be seen, fruit masks are detected in the RGB image to subsequently generate a fruit point cloud from depth data.
From a sequence of point clouds, we generate a fruit map in form of truncated signed distance fields~(TSDF) with the mapping framework voxblox~\cite{oleynikova2017voxblox}.
The surface cloud of this TSDF map is clustered to separate fruits, and superellipsoids are fitted by first estimating center and normals of the points and then minimizing the distance of detected points to the superellipsoid surface.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{images/matched_superellipsoids_2}
\caption{Illustration of matched superellipsoids to fruits. Map generated from multiple views in a commercial glasshouse environment. Estimated superellipsoid surfaces are visualized as blue point clouds. While the left fruit has been observed from almost all directions, only half of the right fruit has been mapped. In both cases, our system was able to accurately predict their shape.
}
\label{fig:coverfig}
\end{figure}
Our main contributions are the following:
\begin{itemize
\item A complete framework that accurately maps and estimates fruit shapes using multiple views,
\item An implementation in ROS, providing easy integration with our previously developed ROI viewpoint planner,
\item An evaluation of the accuracy of the estimated fruit volumes in various simulated scenarios with multiple crops,
\item Qualitative results on data recorded in a commercial glasshouse environment.
\end{itemize}
\section{Related Work}
\label{sec:related}
Several approaches exist that are based on reconstruction using 3D data collected from different viewpoints to obtain a full 3D~model, however, with no explicit modeling of shape.
For example, Wang\etal\cite{wang2020fruit} developed automatic fruit shape measurement based on 3D reconstruction, using a Kinect sensor and an electric turntable.
Similarly, Jadhav\etal\cite{jadhav2019volumetric} investigated the volumetric 3D reconstruction of different fruits based on voxel mapping using silhouette probabilities and inter-image homographies, with multiple RGB cameras and a checkerboard.
Complete reconstruction approaches are generally suitable for ground truth dataset generation or volumetric estimation in laboratory conditions.
However, the reconstruction methods are computationally expensive and are generally not suitable for resource-constrained, real-time agriculture automation tasks.
Moreover, occlusions due to the plant leaves or unreachability of the sensor to cover the complete view can lead to incomplete scanning of the fruits.
Viewpoint planning uses the hitherto accumulated information to plan the next best view for maximising the information gain.
As an example, Roy and Isler\cite{roy2017active} used a viewpoint planning approach to count apples in orchards, however, without any volumetric estimation.
In our previous work~\cite{zaenker2020viewpoint}, we formulated a sampling approach based on regions of interest~(ROI), i.e., fruits that outperforms those that do not consider ROIs, with respect to the number of detected fruits and the estimated volume.
However, the previous approach suffered from inaccuracies in fruit volume estimation as no shape estimation or modeling was carried out for predicting the unobserved fruit regions.
State-of-the-art shape completion or fruit modeling approaches do not use a viewpoint planner for maximizing the information gain, instead they typically attempt to predict fruit shape and pose using data from a single view or few views.
Kang\etal\cite{kang2020visual} used the DasNet deep learning network~\cite{kang2020fruit} for fruit recognition, and 3D Sphere Hough Transform to estimate the fruit pose and size, for autonomous apple harvesting.
Similarly, Lin \etal \cite{lin2019guava} demonstrated that sphere fitting works better than a bounding box method for pose estimation of guavas.
However, while spherical fitting provides acceptable results for autonomous harvesting, the reduction of different fruits to simple spheres is neither generalizable, nor reliable for localized yield predictions.
Ge\etal\cite{ge2020symmetry} formulated another approach based on shape from symmetry~\cite{thrun2005shape}, to generate and rate different hypotheses for the symmetrical plane and the mirrored point sets, for the partial view, to reconstruct the complete shape of strawberry fruits for fruit localization.
Furthermore, photogrammetry-based methods have been used for estimating real length and width after fitting ellipses for apples and mangoes, respectively, in the 2D plane~\cite{gongal2018apple,wang2017tree}.
The most closely related work is the approach by Lehnert\etal\cite{lehnert2016sweet} that fits superellipsoids to sweet peppers.
Here, point clouds from different viewpoints were merged into a single point cloud using different registration methods of which Kinect Fusion~(KinFu) was found to perform best at pose tracking.
After registration and segmentation of red sweet papers based on color using the HSV colour space, sweet pepper pose estimation is performed using constrained non-linear least squares optimization.
A superellipsoid model is then used for estimating parameters of the fruit shape and for obtaining the 6 DoF transform between the registered point cloud and the model.
KinFu can be used for realtime mapping of scenes while concurrently obtaining the camera pose by tracking the depth frames continuously as in~\cite{lehnert2016sweet}.
However, as the viewpoint planner used in our previous approach~\cite{zaenker2020viewpoint} plans discrete viewpoints for maximising information gain, KinFu cannot perform continuous tracking and registration which needs small movements in successive frames for the convergence of ICP alignment~\cite{pirovano2012kinfu}.
Oleynikova\etal\cite{oleynikova2017voxblox} developed voxblox to build TSDFs based map representations for local planning of Micro Aerial Vehicles.
Unlike KinFu, which requires a known map size, large amounts of memory, and GPU computational power, voxblox can dynamically grow maps as it adds point cloud data from different viewpoints.
As voxblox can run on a single CPU core with low memory requirements and still build TSDF maps faster than building occupancy maps, we replaced the 3D~occupancy maps in~\cite{zaenker2020ecmr} with TSDF maps.
In conclusion, most state-of-the-art approaches for fruit mapping fall into three categories -- naive complete reconstruction methods, viewpoint planning without any shape completion, and geometric shape completion methods.
Our approach combines a viewpoint planner with shape completion for mapping of fruits for estimation of count and volume, in the wild, with an improved TSDF based mapping.
\begin{figure*}[h] \centering \includegraphics[width=\linewidth]{images/system_overview} \caption{Overview of our system.
Color and depth images are converted into a fruit point cloud from generated fruit masks, which is processed by voxblox~\cite{oleynikova2017voxblox} into a truncated signed distance field~(TSDF) map.
The surface point cloud from this map is used to fit superellipsoids to individual fruits, which can be visualized together with the map, or used to estimate position and volume.}
\label{fig:system_overview}
\end{figure*}
\section{System Overview}
\label{sec:approach}
Our approach aims at estimating the shape of detected fruits, which might be partially occluded.
We use our previously developed viewpoint planner~\cite{zaenker2020viewpoint} to move a camera placed on a robotic arm, which enables us to observe fruits from different perspectives.
In order to estimate the shape of detected fruits, we build a map of the environment.
Previously, we generated an octree with marked regions of interest~(ROIs), i.e., fruits, to guide the planner and estimate the fruit position and size.
While this enabled ROI targeted viewpoint planning and a rough estimation of fruit positions, due to the limited accuracy of the octree map, the shape of fruits could not be accurately determined.
For the new approach presented in this paper, we therefore build a separate map of the environment specifically for the fruits.
We use the masks of detected fruits
to generate a separate fruit point cloud as input for the fruit mapping.
This point cloud is processed to remove outliers and forwarded to the voxblox mapping system~\cite{oleynikova2017voxblox}, which creates a TSDF map of the fruits.
Our superellipsoid matching system receives the surface point cloud generated from that map, clusters it into individual fruits, and optimizes the parameters of a superellipsoid to find the best fitting shape for the corresponding points.
The parameters of the superellipsoid can be used to compute the fruit position and volume.
Addionally, a fruit point cloud for visualization purposes is generated.
\figref{fig:system_overview} shows an overview of the approach described above.
\section{Fruit Mapping and Shape Estimation}
\subsection{Fruit Detection and Mapping}
\label{sec:detection_mapping}
In order to match superellipsoid to fruits, they have to be detected first.
Like in our previous work, we provide two methods to detect fruits in images.
The first one is a color thresholder for detecting red pixels, and is used in our simulated experiments with only red peppers.
For our real world data, we utilize a neural network trained on a dataset recorded at the University of Bonn~\cite{halstead2020fruit} to detect the fruit masks.
In both cases, we end with a set of pixels belonging to fruits.
We match those with the point cloud generated from the depth image of the RGB-D camera, and extract a cloud only containing the fruit points.
This cloud is used to generate the map used for our shape completion, while the complete cloud can be used to generate an additional map containing full plants.
Before that, outliers are removed using statistical outlier removal to counter depth noise.
For generating the map used to match superellipsoids to fruits, we utilize the mapping framework voxblox \cite{oleynikova2017voxblox}.
We configure voxblox with a TSDF voxel size of 0.004 m and 64 voxels per side.
We disable ICP tracking feature of voxblox and utilize position feedbacks from the robot arm.
\subsection{Clustering and Shape Estimation}
\label{sec:approach_sampling}
From the fruit TSDF map generated with voxblox, we extract the surface point cloud to match our fruit predictions.
In a first processing step, we extract clusters to identify individual fruits.
We utilize Euclidean cluster extraction with a cluster tolerance of 0.01 m, a minimum cluster size of 100 points and a maximum cluster size of 10000 points for that.
For each extracted cluster, we first estimate the normals of the points.
Taking into account the normals, a cluster center $w$ is estimated using a closed form least-squares solution for minimizing the sum of perpendicular distances from the estimated point to all the lines \cite{traa2013least}.
We also use L2 regularization to bias the solution towards a reference point (i.e., the mean of all points in a cluster) with the regularization value of $\lambda = 2.5$ \cite{traa2013least}.
This center is used as start point for the optimization of the superellipsoid.
As in \cite{lehnert2016sweet}, we represent superellipsoids with the following equation:
\begin{equation}
f(x, y, z) = \left[
\left(\frac{x}{a}\right)^\frac{2}{\varepsilon_2} +
\left(\frac{y}{b}\right)^\frac{2}{\varepsilon_2}
\right]^\frac{\varepsilon_2}{\varepsilon_1} +
\left(\frac{z}{c}\right)^\frac{2}{\varepsilon_1} = 1
\end{equation}
The parameters $a$, $b$, $c$, $\varepsilon_1$, and $\varepsilon_2$, together with the translation $t_x$, $t_y$, $t_z$ and rotation $\phi$, $\theta$, $\psi$ make up 11 parameters to optimize.
We set the initial value of $t_x$, $t_y$, $t_z$ to the estimated center and the rotation to 0.
For the superellipsoid parameters, we start with initial values of $a=b=c=0.05\ m$ and $\varepsilon_1=\varepsilon_2=0.5$.
Compared to \cite{lehnert2016sweet}, we changed the cost function to achieve better fits.
Jakli{\v{c}} \etal \cite{jaklic2000superquadrics} describe approximated distance of a point to a superellipsoid as:
\begin{equation}
d = |r_0 - \beta r_0| = |r_0| \cdot |1-f^{-\frac{\varepsilon_1}{2}}(x_0, y_0, z_0)|
\end{equation}
where $r_0 = (x_0, y_0, z_0)$ represents the coordinates of a point with respect to the superellipsoid center.
$\beta$ is the scaling factor to project $r_0$ to the superellipsoid surface, and computed by solving $f(\beta x_0, \beta y_0, \beta z_0)$ for $\beta$.
To find the best fitting shape, we minimize the sum of $d$ over all points.
We get the following optimization task, with priors encouraging the superellipsoid center to be closer to the estimated center and the $a$, $b$, and $c$ parameters to be close to each other:
\begin{equation}
\min_{a, ..., \psi} \sum_i \biggl [ d_i^2 + \alpha ||t-w||_2^2 + \gamma \bigl((a-b)^2+(b-c)^2+(c-a)^2 \bigr) \biggr ]
\end{equation}
We apply the Levenberg–Marquardt algorithm to optimize the parameters.
The numerical computations are performed using the open source Ceres solver \cite{ceres-solver}.
We limit $a$, $b$, and $c$ between 0.02 and 0.15 m, and $\varepsilon_1$ and $\varepsilon_2$ between 0.3 and 0.9, to avoid unrealistically small, large or deformed superellipsoids that don't realistically represent a fruit.
We set regularization constants $\alpha = \gamma = 0.1$. We also limit the maximum number of iterations to 100 and discard optimizations that terminated without convergence.
\subsection{Shape Evaluation}
\label{sec:approach_evaluation}
Our node provides the results of the matched superellipsoids in multiple forms.
For visualization, surface point clouds are generated from the optimized parameters.
We provide a colored point cloud with different colors for each cluster, as well a labeled point cloud including the computed normals.
For further usage, the superellipsoid parameters and volume are published.
We compute the volume using the following formula, as described in \cite{jaklic2000superquadrics}:
\begin{equation}
V = 2abc\varepsilon_1\varepsilon_2B\left(\frac{\varepsilon_1}{2}+1, \varepsilon_1\right)B\left(\frac{\varepsilon_2}{2}, \frac{\varepsilon_2}{2}\right);
\end{equation}
where $B$ is the beta function:
\begin{equation}
B(x, y) = 2\int_{0}^{\frac{\pi}{2}}
\sin^{2x-1}\phi cos^{2y-1} \phi d\phi = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y)}
\end{equation}
For our simulated environments, we extract a point cloud from the mesh models of the fruits and optimize superellipsoid parameters to fit this point cloud for each fruit.
We read the position and orientation of the plants directly from the Gazebo simulator and can therefore generate a ground truth superellipsoid for each fruit in the scene.
We can match ground truth and detected ellipsoids by comparing the distance of the centers and the volumes.
\section{Experiments}
\label{sec:exp}
We carried out experiments with of our shape estimation method in a simulated environment for quantitative analysis and with data collected from the glasshouse to validate our approach in real world conditions.
For our evaluation in simulated scenarios, we used the Gazebo based simulation setup presented in \cite{zaenker2020viewpoint}, but with an additional new environment with more and different plants.
It simulates a UR5e arm from Universal Robots with an RGB-D camera placed at its flange. We configured the planner to move the arm to new views autonomously.
We placed the arm on a static pole for the first scenario, and for the other two, it was attached to a retractable pole hanging from the ceiling, to enable good coverage of the fruits.
The three scenarios are described with pictures in \Cref{fig:simulatedenv1,fig:simulatedenv2,fig:simulatedenv3}.
\subsection{Simulated Scenarios}
To evaluate the accuracy of the fruit shape estimation with our new method to our old approach, we compare the average estimated fruit center distance and volume accuracy of the detected fruits.
Additionally, we set a new restriction on the detected fruits -- they are counted only when the specified minimum accuracy criterion is met.
For the evaluation, we consider the number of fruits with minimum accuracy 0 (i.e. the detected volume must not be more than twice the ground truth volume) and minimum accuracy 0.5 (the detected volume must not be more than 50\% larger or smaller than the ground truth.)
This gives us the following metrics: \begin{itemize}
\item \textit{Detected fruits}: Number of found fruits
that can be matched with ground truth fruits, which means that their center distance is less than~$20\,cm$, and their volume accuracy is greater than the specified minimum.
\item \textit{Center distance}: Average distance of the fruit centers from the ground truth centers.
\item \textit{Volume accuracy}: Average accuracy of the cluster volumes.
The accuracy is computed as follows:
\begin{equation}
acc_{V} = 1 - \frac{|V_{det} - V_{gt}|}{V_{gt}}
\end{equation}
where $V_{det}$ is the detected volume and $V_{gt}$, the ground truth volume.
For detected volumes less than the ground truth volume, the $acc_{V}$ varies from 0 to 1, with 1 representing the best possible accuracy when they are equal.
On the other hand, for $V_{det}$ greater than $2V_{gt}$, the $acc_{V}$ turns negative.
For our old method, the volumes are computed as bounding box volumes of the detected clusters.
For the new method, we use the superellipsoid volume as described in \Cref{sec:approach_evaluation}.
\end{itemize}
For each scenario, we executed 20 trials, each with a planning time of three minutes.
\begin{figure*} \centering \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/simulated_env_1_cropped} \caption{Scenario 1}
\label{fig:simulatedenv1}
\end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/simulated_env_2_cropped} \caption{Scenario 2}
\label{fig:simulatedenv2}
\end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/simulated_env_3_cropped} \caption{Scenario 3}
\label{fig:simulatedenv3}
\end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/detected_fruits_w14} \caption{Fruits Scenario 1}
\label{fig:det_fruits_w14}
\end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/detected_fruits_w19} \caption{Fruits Scenario 2}
\label{fig:det_fruits_w19}
\end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \includegraphics[width=\linewidth]{images/detected_fruits_w22} \caption{Fruits Scenario 3}
\label{fig:det_fruits_w22}
\end{subfigure} \par\bigskip \begin{subfigure}[b]{0.32\linewidth} \centering \begin{tabular}{ c | c | c | c |} \cline{2-4} & Fruits & Center & Vol.
\\ \hline\hline
\makecell[c]{Old\\(all)} & \makecell[r]{12.8\\ $\pm$ 0.9} & \makecell[r]{2.5\\ $\pm$ 0.5} & \makecell[r]{-0.12\\ $\pm$ 0.79} \\ \hline
\makecell[c]{SE\\(all)} & \makecell[r]{13.2\\ $\pm$ 0.9} & \makecell[r]{2.9\\ $\pm$ 0.7} & \makecell[r]{0.26\\ $\pm$ 0.27} \\ \hline\hline
\makecell[c]{Old\\(MA0)} & \makecell[r]{8.7\\ $\pm$ 2.6} & \makecell[r]{2.6\\ $\pm$ 1.1} & \makecell[r]{0.45\\ $\pm$ 0.12} \\ \hline
\makecell[c]{SE\\(MA0)} & \makecell[r]{9.8\\ $\pm$ 1.9} & \makecell[r]{2.3\\ $\pm$ 0.8} & \makecell[r]{0.69\\ $\pm$ 0.06} \\ \hline\hline
\makecell[c]{Old\\(MA50)} & \makecell[r]{4.7\\ $\pm$ 2.2} & \makecell[r]{1.6\\ $\pm$ 0.8} & \makecell[r]{0.65\\ $\pm$ 0.17} \\ \hline
\makecell[c]{SE\\(MA50)} & \makecell[r]{7.7\\ $\pm$ 1.9} & \makecell[r]{1.9\\ $\pm$ 0.9} & \makecell[r]{0.81\\ $\pm$ 0.04} \\ \hline
\end{tabular} \caption{Results Scenario 1} \label{tab:res_table_1} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \begin{tabular}{ c | c | c | c |} \cline{2-4} & Fruits & Center & Vol.
\\ \hline\hline
\makecell[c]{Old\\(all)} & \makecell[r]{25.5\\ $\pm$ 1.0} & \makecell[r]{2.2\\ $\pm$ 0.3} & \makecell[r]{-0.05\\ $\pm$ 0.21} \\ \hline
\makecell[c]{SE\\(all)} & \makecell[r]{26.5\\ $\pm$ 1.2} & \makecell[r]{1.8\\ $\pm$ 0.6} & \makecell[r]{0.35\\ $\pm$ 0.23} \\ \hline\hline
\makecell[c]{Old\\(MA0)} & \makecell[r]{16.4\\ $\pm$ 3.4} & \makecell[r]{2.1\\ $\pm$ 0.5} & \makecell[r]{0.35\\ $\pm$ 0.06} \\ \hline
\makecell[c]{SE\\(MA0)} & \makecell[r]{22.4\\ $\pm$ 2.4} & \makecell[r]{1.4\\ $\pm$ 0.6} & \makecell[r]{0.67\\ $\pm$ 0.04} \\ \hline\hline
\makecell[c]{Old\\(MA50)} & \makecell[r]{6.0\\ $\pm$ 2.0} & \makecell[r]{1.8\\ $\pm$ 0.4} & \makecell[r]{0.66\\ $\pm$ 0.07} \\ \hline
\makecell[c]{SE\\(MA50)} & \makecell[r]{17.7\\ $\pm$ 2.1} & \makecell[r]{1.2\\ $\pm$ 0.4} & \makecell[r]{0.78\\ $\pm$ 0.03} \\ \hline
\end{tabular} \caption{Results Scenario 2} \label{tab:res_table_2} \end{subfigure} \begin{subfigure}[b]{0.32\linewidth} \centering \begin{tabular}{ c | c | c | c |} \cline{2-4} & Fruits & Center & Vol.
\\ \hline\hline
\makecell[c]{Old\\(all)} & \makecell[r]{41.1\\ $\pm$ 3.3} & \makecell[r]{2.4\\ $\pm$ 0.4} & \makecell[r]{-0.19\\ $\pm$ 0.27} \\ \hline
\makecell[c]{SE\\(all)} & \makecell[r]{40.9\\ $\pm$ 3.9} & \makecell[r]{1.9\\ $\pm$ 0.4} & \makecell[r]{0.22\\ $\pm$ 0.22} \\ \hline\hline
\makecell[c]{Old\\(MA0)} & \makecell[r]{28.0\\ $\pm$ 4.7} & \makecell[r]{2.5\\ $\pm$ 0.5} & \makecell[r]{0.44\\ $\pm$ 0.06} \\ \hline
\makecell[c]{SE\\(MA0)} & \makecell[r]{33.6\\ $\pm$ 3.9} & \makecell[r]{1.3\\ $\pm$ 0.3} & \makecell[r]{0.70\\ $\pm$ 0.04} \\ \hline\hline
\makecell[c]{Old\\(MA50)} & \makecell[r]{12.4\\ $\pm$ 3.6} & \makecell[r]{2.1\\ $\pm$ 0.6} & \makecell[r]{0.71\\ $\pm$ 0.04} \\ \hline
\makecell[c]{SE\\(MA50)} & \makecell[r]{27.2\\ $\pm$ 3.9} & \makecell[r]{1.2\\ $\pm$ 0.3} & \makecell[r]{0.80\\ $\pm$ 0.02} \\ \hline
\end{tabular} \caption{Results Scenario 3} \label{tab:res_table_3} \end{subfigure} \caption{\textit{(a-c)}: Our three simulated scenarios.
\textit{Scenario 1:} Simulated environment with static arm, as used in \cite{zaenker2020viewpoint}, with 4 plants and 14 fruits.
\textit{Scenario 2}: Simulated environment with retractable arm, as in \cite{zaenker2020viewpoint}, with 4 plants and 28 fruits.
\textit{Scenario 3}: New simulated environment.
It also uses the retractable arm, but contains a total of 12 plants, ordered in two rows, with different growth stages and fruits.
There are a total of 47 red fruits in this environment.\\ \textit{(d-f)}: Results for the three simulated scenarios.
For each tested approach, 20 trials with a duration of three minutes each were performed.
The plots show the average number of detected fruits of our superellipsoid matcher (\textbf{SE}) compared to our old octree-based approach (\textbf{Old}), with no minimum accuracy (\textbf{all}), a minimum accuracy of 0 (\textbf{MA0}), and a minimum accuracy of 0.5 (\textbf{MA50}).
As can be seen, while the number of detected fruits with no accuracy bounds is similar, our new approach detects much more fruits with good accuracy.\\ \textit{(g-i)}: The average numerical results at the end of the episodes regarding number of detected fruits (\textbf{Fruits}), center distance in cm (\textbf{Center}), and volume accuracy (\textbf{Vol.}).
}
\label{fig:res_detected_fruits}
\end{figure*}
\Cref{fig:det_fruits_w14,fig:det_fruits_w19,fig:det_fruits_w22} illustrate the number of detected fruits over the three minutes planning time, and \Cref{tab:res_table_1,tab:res_table_2,tab:res_table_3} show the quantitative results for the three scenarios.
While the number of detected fruits with no volume accuracy bounds is similar to our old approach, our current approach with the superellipsoid matcher recognizes signifcantly greater number of fruits, when the minimum volume accuracy bound is applied.
With a minimum accuracy of 0.5, we detect an average of 7.7 fruits with our new aapproach compared to 4.7 with the old approach in Scenario 1, 17.7 compared to 6.0 in Scenario 2, and 27.2 compared to 12.4 in Scenario 3.
It can also be seen that with our old approach, the number of detected fruits with minimum accuracy drops towards the end.
This can happen if nearby fruits are combined to a single fruit, which greatly decreases the volume accuracy.
Since our new method uses a more accurate map and better clustering, this happens less often, leading to a considerable improvement in count and volume estimation.
The average center distances are similar for both approaches.
However, the average volume accuracy of our superellipsoid matcher is much higher.
When counting all detected fruits, with average accuracies between 0.22 and 0.35, it is still quite low.
This is because the clustering still can fail if there are not enough fruit points detected and nearby fruits are merged, leading to overestimated shapes with negative accuracies, which bring down the average.
When removing those outliers, which was done via prior assumptions about the maximum fruit size, the average accuracy increases appreciably, with accuracies between 0.67 and 0.70 compared to only between 0.35 and 0.45 with our old approach.
This accuracy covers on average over 70\% of the detected fruits in Scenario 1 and over 80\% in Scenario 2 and 3.
The evaluation demonstrates that our approach with superellipsoid based shape completion can lead to a higher number of accurately detected fruits.
While there are still some outliers, the volume accuracy for most of the sweet peppers shows that they can be satisfactorily approximated through superellipsoids, even if only partially observed by our viewpoint planner.
\subsection{Real-World Glasshouse Experiment}
To evaluate how our approach handles real-word data, we utilized a recording of the data feed gathered from our previously developed viewpoint planner in a capsicum glasshouse.
Color and depth images were generated using a RealSense L515 Lidar sensor, and the data includes the arm configuration and the camera poses.
The recorded images are passed through a neural network~\cite{halstead2020fruit} to generate fruit masks which are fused with the depth images to generate the fruit point clouds used for voxblox mapping.
In addition to the fruit map used to estimate shapes with superellipsoids, we generate a map from the full point cloud for visualization purposes.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{images/rw_image}
\caption{Generated map with superellipsoids. Blue point clouds represent the estimated surface of the matched shapes.}
\label{fig:rw_image}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}[b]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{images/combined_photo.png} \caption{Captured photos}
\label{fig:glasshouse_photo}
\end{subfigure}
\begin{subfigure}[b]{0.49\linewidth} \centering \includegraphics[width=\linewidth]{images/real_world_rois.png} \caption{ROI octree}
\label{fig:glasshouse_rois}
\end{subfigure}
\caption{\textit{Left}: Captured RGB images of the glasshouse in the segment mapped in~\Cref{fig:rw_image} . \textit{Right}: The octree-based map generated in~\cite{zaenker2020viewpoint}, with red bounding boxes visualizing the matched fruit volume. The two fruits are the same as the two red fruits on the right in~\Cref{fig:rw_image}}
\label{fig:old_results}
\end{figure}
In \Cref{fig:rw_image}, you can see the generated full TSDF map of a section of the glasshouse, with the superellipsoids matched from the fruit-only map visualized as blue point clouds.
For comparison, \Cref{fig:old_results} shows the results of the same segment using the octree-based map presented in \cite{zaenker2020viewpoint}.
It can be seen that our new method provides both a more accurate map and a better approximation of the fruit shapes.
\section{Conclusions}
\label{sec:concl}
To move a step closer to autonomous crop monitoring and yield estimation, we developed a framework to accurately estimate the shape of fruits such as sweet peppers.
Our system is embedded into a viewpoint planning approach and builds up a map of the fruits in form of truncated signed distance fields, on which fruits are clustered.
Subsequently, the shape of clustered fruits is approximated by fitting superellipsoids to the surface points.
As the evaluation with a simulated robotic arm equipped with an RGB-D camera demonstrates, our system can detect a majority of the fruits with good accuracy, and the qualitative results on real-world data show that it is applicable under realistic conditions in commercial glasshouse environments.
In the future, we plan to use the estimated shapes to determine the missing parts of partially detected fruits to guide our viewpoint planner to achieve better coverage.
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-03-30T02:32:31', 'yymm': '2203', 'arxiv_id': '2203.15489', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15489'} | arxiv |
\subsection{Emerging result}
\end{abstract}
\begin{CCSXML}
<ccs2012>
<concept>
<concept_id>10010147.10010257</concept_id>
<concept_desc>Computing methodologies~Machine learning</concept_desc>
<concept_significance>300</concept_significance>
</concept>
<concept>
<concept_id>10011007.10011006.10011072</concept_id>
<concept_desc>Software and its engineering~Software libraries and repositories</concept_desc>
<concept_significance>500</concept_significance>
</concept>
<concept>
<concept_id>10011007</concept_id>
<concept_desc>Software and its engineering</concept_desc>
<concept_significance>300</concept_significance>
</concept>
</ccs2012>
\end{CCSXML}
\ccsdesc[500]{Software and its engineering~Software libraries and repositories}
\ccsdesc[300]{Computing methodologies~Machine learning}
\keywords{APIs, libraries, usability, learnability, machine learning}
\maketitle
\section{Introduction}
The success of machine learning (ML) is leading to an ever increasing demand for data scientists. However, software developers who try to fill this gap and have already delved into the necessary scientific ML background still face the challenge of learning how to correctly use the related ML APIs.
The importance of API learnability and usability has been emphasized in many influential studies \cite{Robillard:IEEESOftware2009,Robillard:ESE2011,SouzaCleidsonBentolila:ICSE2009,WangGodfrey:MSR2013,ZibranEtAlWCRE2011}.
Therefore, we aimed to find out whether and how the learning curve can be flattened and correct use
can be fostered.
Using \skl{} \cite{scikit-learn}, a widely-adopted ML library as a case study, we address the following research questions:
\begin{description}
\item [RQ1] Can the complexity of the API be reduced without affecting its existing users?
\item [RQ2] Which deviations from established principles of good API design make learning and correct use of ML APIs hard, even for developers who have the required mathematical and software engineering skills?
\item [RQ3] Can learnability and correct use be improved by a different design of the API?
\item [RQ4] Given an improved API design, can an implementation be derived and maintained
automatically, based on the official library? What precisely can be automated and how much human effort is still needed?
\end{description}
\section{API Complexity Reduction}
\label{sec:api_complexity}
Existing ML APIs, such as \skl{}, follow a ``one size fits all'' approach, irrespective of user expertise. We questioned this approach, assuming that novices need just a subset of the API and are hence distracted and confused by additional functionalities \cite{ZibranEtAlWCRE2011}. We consider novices to be persons who aim to develop an ML application and have the required mathematical and software engineering background, but no experience using the particular ML API.
\subsection{Empirical Results}
\label{sec:empirical}
To verify our assumption,
we aimed to quantify the amount of functionalities
that novice users do not need. However, lacking a representative pool of programs written only by novices we started with a broader analysis of all usages that we could find. We did this in two steps:
\begin{description}
\item [API statistics]
We counted the number of API elements
in \skl{} version 0.24.2.
In Fig. \ref{fig:scikit-statistics-bar-chart}, the dark blue bars indicate the \emph{total} total numbers of classes, functions, and parameters, whereas the red bars show the respective numbers of \emph{public} elements.
\item [Usage statistics]
By analyzing 92,402 programs contributed to Kaggle competitions\footnote{https://www.kaggle.com/competitions} by users of any skill level
we found
41,867 that used scikit-learn. Within this pool, we counted the number of \emph{uses} of each class, function and function parameter.
Based on this raw data, we computed the additional two bars shown in Fig. \ref{fig:scikit-statistics-bar-chart}. The green bars indicate the number of classes, functions and parameters actually \emph{used} in Kaggle competitions. The light blue bar indicates \emph{useful} parameters, which are set to at least two different values. We call parameters that are always set to the same value \emph{useless}, since they can be replaced by a local variable in the containing function and eliminated from the API.
An example of a useless parameter is \textsl{copy\_X} (optional parameter with default \textsl{True}) in the \textsl{Lasso} model, since it is set to \textsl{True} in all 748 cases the constructor is invoked. However, the parameter is not unused since users passed the value \textsl{True} three times explicitly.
\end{description}
\begin{figure}
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{img/api_size_classes.png}
\caption{Classes}
\label{fig:scikit-statistics-bar-chart-classes}
\end{subfigure}
\hfill
\\[1.5ex]
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{img/api_size_functions.png}
\caption{Functions}
\label{fig:scikit-statistics-bar-chart-functions}
\end{subfigure}
\hfill
\\[1.5ex]
\begin{subfigure}[b]{0.45\textwidth}
\centering
\includegraphics[width=\textwidth]{img/api_size_parameters.png}
\caption{Parameters}
\label{fig:scikit-statistics-bar-chart-parameters}
\end{subfigure}
\vspace{-0.5em}
\caption{Numbers of classes, functions, and parameters in \skl{}: Dark blue for the entire API, red for public elements, green for elements used in Kaggle competitions, light blue for
parameters that are set to at least two different values. The white area shows absolute and relative reductions compared to the public API.}
\vspace{-1em}
\label{fig:scikit-statistics-bar-chart}
\end{figure}
From Fig. \ref{fig:scikit-statistics-bar-chart} we can infer the reduction of the API's complexity if users were presented just with the used classes and functions and useful parameters. This benefits novices and experts alike:
It shows that even among the public elements, 56 classes (21\%) and 597 functions (47\%) are unused, while 2467 parameters (57\%) are useless. These API elements can be eliminated from the user-visible API without affecting the functionality of the analysed applications. The improvements are huge and can be a significant time-saver when learning a new API.
\subsection{Plausibility Check}
\label{sec:PlausibilityCheck}
We wanted to be sure that the above results are not biased by the choice of Kaggle competitions as sample data, but can be generalized to other ML applications.
To this end, we inspected unused classes and functions, and useless parameters, in search of reasons why elements are generally not needed for application development.
\begin{description}
\item [Unused classes] We found that most unused classes are indeed clearly irrelevant for application programmers, being designed just for extending the API by additional models and internal code reuse. Examples include mixins, base classes, and a few unused, exotic ML models, like \textsl{MultiTaskLasso}.
\item [Unused functions] Similarly, several groups of unused functions are intended for API extensions only, such as validation functions for inputs. Some are related to sample datasets (\textsl{fetch\_california\_housing}), which are clearly not used in applications that include their own data.
However, there are also unused core ML functions, often composite ones (\textsl{fit\_transform}, \textsl{fit\_predict} etc.) that exist for API consistency, and which we do not want to remove for this reason. We guess they are not called because users might call the component functions separately (e.g. \textsl{fit} or \textsl{transform}). Finally, some introspection functions (\textsl{decision\_functions}) are not used either and also deserve further investigation.
\item [Unused and useless parameters] Given the sheer number of parameters, we have not yet completed categorizing them. However, our findings to date confirm the generality of the empirical results, also for parameters.
\end{description}
Since our plausibility check suggests that the results obtained for Kaggle can be generalized, we conclude that for \skl{}, the complexity of the API can indeed be reduced without affecting existing users (RQ1) by roughly the numbers indicated in
Fig. \ref{fig:scikit-statistics-bar-chart}, by eliminating unused and useless elements from the public API.
\section{API Redesign}
\label{sec:api-redesign}
The manual inspection done for our plausibility check
revealed aspects that were not evident from the statistical data.
We found that even the \emph{used and useful} part of the API is subject to design and usability problems that deserve specific attention. This motivated our research questions RQ2 and RQ3. In the following, we address these questions in turn, enumerating found usability issues
(RQ2) and proposing related design improvements (RQ3).
\subsection{Proliferation of Primitives}
\label{sec:proliferation}
One of the design principle of \skl{} is \keyword{non-proliferation of classes}, which means classes are only added for learning algorithms. All other concepts are expressed by primitive types, or types from other scientific libraries, like numpy or scipy \cite{sklearn_api}.
This, however, results in long lists of parameters of primitive types, contradicting established design principles.
McConnell's guideline, based on psychological research, is to use at most seven parameters \cite[p. 178]{code_complete}.
Martin (\cite[p. 288]{clean_code}) suggest to keep parameter lists as short as possible and to avoid more than three parameters.
While the removal of unused parameters (Sec. \ref{sec:empirical})
alleviates the problem, it does not eliminate it. This section discusses related issues and ways to address them without sacrificing the generality of the API:
\begin{description}
\item [Tangled concerns] \label{item:tangling}
The long parameter lists of the constructors of ML models hide the important \emph{hyperparameters} between parameters that are unrelated to the core ML concern, such as debugging or performance options.
For example, the constructor of the \textsl{SVC} model has 15 parameters (all of which are used) for a multitude of concerns: \textsl{kernel} is a hyperparameter, while \textsl{verbose} is for debugging, and \textsl{cache\_size} concerns performance.
Such parameters can be removed from the constructors of ML models leaving only the hyperparameters, drastically increasing their visibility.
If needed, attributes for non-ML concerns in the created object can anyway be set to non-default values before calling its \textsl{fit} method to start training.
\item[Implicit dependencies]
Flat lists of inter-dependent parameters can allow combinations of parameter values that are semantically wrong. For instance, it is non-obvious that the \textsl{degree} parameter of the SVC constructor should only be set if the \textsl{kernel} parameter is set to \textsl{\str{poly}}. The invocation \textsl{SVC(\allowbreak{}kernel=\allowbreak{}\str{linear},\allowbreak{} degree=\allowbreak{}3)} is possible but most surely an error, since the degree value will be ignored. However, \textsl{SVC(\allowbreak{}kernel=\allowbreak{}\str{poly},\allowbreak{} degree=\allowbreak{}3)} is correct.
Grouping dependent parameters in one object, called a \keyword{parameter object} in \cite{refactoring}, improves understandabilty \cite{LaceraEtAl:JSS2020}, makes dependencies clear, and prevents any accidental misuse of the API. In our example, we create different variants of \textsl{Kernel} objects, with a \textsl{degree} parameter only in the \textsl{\str{poly}} variant. Via \textsl{SVC(\allowbreak{}Kernel.linear)} and \textsl{SVC(\allowbreak{}Kernel.poly(\allowbreak{}degree=\allowbreak{}3))} we can then create legal SVC configurations, but the erroneous example above will be impossible to create.
\item[Magic strings]
Scikit-learn often uses string parameters that only have a limited set of legal values\footnote{
In 2007, when \skl{} was initially released, Python offered no alternative. Later, the string types had to be kept for backwards compatibility.}. This has the downside that statically ensuring use of a valid value is difficult. This problem is similar to the anti-pattern of using integers to encode such limited value sets \cite{effective_java, clean_code}.
The problem is worsened by the fact that \skl{} sometimes does not validate parameters. For example, the \textsl{criterion} parameter of the \textsl{DecisionTreeClassifier} should either be \textsl{\str{gini}} or \textsl{\str{entropy}}. However, the creation of an instance with the call \textsl{DecisionTreeClassifier(\allowbreak{}criterion=\allowbreak{}\str{giny})} is silently accepted but, when we later call the \textsl{fit} method on the model, the program crashes. The error message \textsl{KeyError: \str{giny}} gives us only a vague hint about the source of the error.
Using instead \keyword{enums} in conjunction with \keyword{type hints}\footnote{\url{https://docs.python.org/3/library/typing.html} (added in Python 3.5)} lets static analysis tools ensure that a correct value is passed.
\end{description}
The proposed introduction of parameter objects and enums would increase the number of classes, contrary to the non-pro\-li\-fe\-ra\-tion of classes design of \skl{}. It remains to be investigated which design is easier to learn and use correctly. We are confident that, with a careful redesign, (1) the improved error-resilience of the redesigned API is worth the effort and (2) the increase in the size of the API will be outweighed by the usage-based reduction discussed in Sec. \ref{sec:api_complexity}.
\subsection{Module Structure}
\label{sec:moduleStructure}
Module structure is another target for API redesign:
Models for supervised learning are grouped by model category, such as Support Vector Machine (SVM) models. The task they solve is only indicated by a suffix on the class name.
For example, \textsl{SVC} is an SVM model for classification, and \textsl{SVR} is one for regression.
Similarly, metrics for model evaluation are grouped in \textsl{sklearn\allowbreak{}.metrics}, regardless of task, even though the sets of metrics applicable to different tasks are disjoint.
However, developers are interested in fulfilling a \emph{task}, rather than exploring a particular \emph{family of algorithms}.
Therefore, we suggest grouping of models and metrics by task, like in Apache Spark MlLib \cite{mllib}.
This speeds up the search for models applicable to a task, or metrics suited to evaluate their performance, and makes it obvious, which models and metrics can be used interchangeably. The importance of aligning software components with tasks
has already been discussed in \cite{kersten:mylar, wang:feature_location, thung:api_method_recommendation}.
\section{API Wrapping}
\label{sec:api-wrapping}
The design improvements discussed so far should not be misunderstood as a proposal for redesigning \skl{}, a high-quality, widely used ML library. Neither do we want to reinvent the wheel, nor break the huge number of programs using \skl{}.
Our vision is to wrap the existing \skl{} library into an API that implements the suggested improvements so that it is more suited for novices. However, the size of the \skl{} library prohibits manual wrapper creation and maintenance. Thus, our approach raises the two challenges, summarized in RQ4: (1) automated initial wrapper creation and (2) automated update of wrappers, whenever a version of the \skl{} library is released.
\subsection{Initial Wrapper Creation}
\label{sec:wrapper creation}
As a basis for automation, the manually derived design improvements outlined previously need to be expressed in a machine-readable form that specifies precisely which \emph{changes} should be performed on which \emph{API elements}.
\begin{table}
\centering
\begin{tabulary}{\linewidth}{cL}
\hline
Annotation & Meaning \\
\hline\hline
\textsl{@remove} & Remove unused \& unnecessary API element. \\
\hline
\textsl{@attribute} & Remove parameter from the constructor of a model and keep it only as a model attribute. \\
\hline
\textsl{@group} & Group dependent parameters as an object. \\
\hline
\textsl{@enum} & Replace string type with enum type. \\
\hline
\textsl{@move} & Move class / global function to another module. \\
\hline
\end{tabulary}
\vspace{0.5\baselineskip}
\caption{Annotations that can be set in the annotation editor and their implied effect on wrapper creation.}
\vspace{-2.4em}
\label{tab:annotations}
\end{table}
We do this by annotating elements of the \skl{} API. Each annotation type (Table \ref{tab:annotations}) corresponds to one of the improvements outlined in Sec. \ref{sec:api_complexity} and \ref{sec:api-redesign}. A user can
attach these annotations to classes, functions and parameters in a web-based annotation editor\footnote{\url{https://github.com/lars-reimann/api-editor}}. To reduce the workload of annotators and guide them to relevant elements, an initial set of \textsl{@remove} annotations
is created automatically from the usage data described in Sec. \ref{sec:empirical}.
Based on the annotations and the original \skl{} API, the new API is inferred and corresponding \keyword{wrappers} \cite{gof} are generated.
\subsection{Wrapper Update}
\label{sec:wrapperUpdate}
The authors of \skl{} follow a strict release policy aimed not to break existing clients. API elements scheduled for removal are deprecated two versions in advance. Renamings and moves are implemented by deprecating the existing element and adding a new one. Similarly, changes of legal parameter values are implemented by deprecating the current value and adding a new one. This addition of new elements and forwarding from old to new ones is basically a wrapping step.
Thus, a lightweight evolution policy can reflect the deprecations, additions and deletions from \skl{} in our adapted API, delegating the task of updating client programs to users of our API. Additions and deletions can be identified by our code analysis (Sec. \ref{sec:empirical}). Deprecation information can be extracted automatically from the \skl{} documentation using a mix of parsing,
and rudimentary natural language processing (NLP). This avoids having to repeat the initial manual annotation work in any future releases. Only a fraction of the added elements might need new annotations.
\section{Related Work}
\paragraph{API usability}
Among the rich body of literature about API usability, other contributions that were not cited so far but have influenced our work include the empirical study of API usability problems by Piccioni et al. \cite{piccioni2013}, the evaluation of API usability using Human-Computer Interaction methods by Grill et al. \cite{grill2012}, general recommendations for API designers by Myers and Stylos \cite{myers:api_usability}, and the
JavaDoc alternative by Stylos et al. \cite{myers:api_documentation_usage}, which takes usage data of an API as input to create better documentation.
However, we only found one other assessment of APIs in the context of ML, namely by Király et al. \cite{kiraly2021designing}, who compiled the interfaces and design patterns underlying \skl{} and other ML APIs and derived high-level guidelines for ML API design but didn't investigate their practical implications on a concrete framework, such as \skl{}. In addition their scitype concept also makes the notion of tasks explicit, which provides a formal basis for the task-oriented restructuring that we propose in Sec. \ref{sec:moduleStructure}.
\paragraph{ML for novices}
Our simplified API has been developed as part of the Simple-ML project \cite{Gottschalk2019, guidance}, as a back-end for a user-friendly Domain Specific Language (DSL) for ML. The Simple-ML API and DSL are embedded into an Integrated Development Environment (IDE) for ML workflows. The entire system is tailored to the needs of data science novices, to make ML more accessible.
\paragraph{Wrapper creation} Our API wrapping approach described in Sec. \ref{sec:api-wrapping} is similar to the one of
Hossny et al. \cite{paas_adapters}, who use semantic annotations to hide proprietary APIs of different cloud providers behind a generic one, in order to combat vendor lock-in. Wrappers are automatically created so they can easily be kept up-to-date.
\paragraph{API evolution} The vast literature about techniques to tackle the evolution of an API and automatically keep \emph{client} code up-to-date is
compiled in a recent survey \cite{evolution_survey}. However, our focus is not on updating client code but on updating our generated wrappers. For this, we need to be able to detect changes in \skl{} and identify conflicts with respect to the changes implied by our annotations. An extensive review of related change detection and change merging approaches can be found in \cite{mens2002:merging}.
\section{Threats to Validity}
\label{sec:threats-to-validity}
\paragraph{Usage data} For now, we only pulled usage data from Kaggle programs that were linked to competitions. This can skew results, since we got groups of programs that solve the same problem and, therefore, might employ similar methods. Moreover, some competitions were very popular, so we could get 1000 entries\footnote{The maximum that can be retrieved via Kaggle's REST API}, whereas others only had a handful.
\paragraph{\skl{} v1.0} In the meantime, a new version of \skl{} has been released. The few contained API changes\footnote{\url{https://scikit-learn.org/stable/whats_new/v1.0.html}} slightly change the absolute numbers but not the percentages reported in Sec. \ref{sec:api_complexity}.
\section{Future Plans}
\label{sec:future}
To eliminate possible bias (Sec. \ref{sec:threats-to-validity}), we want to extend the gathered Kaggle data with additional \skl{} usage data from GitHub repositories. Afterwards, our plausibility check (Sec. \ref{sec:PlausibilityCheck}) for parameters needs to be completed.
The suggestions for API redesign (Sec. \ref{sec:api-redesign}) initially had to be entered manually in the annotation editor. We have started automating this by extracting information from the documentation of \skl{}, using a mix of parsing (for the structured parts of the documentation) and natural language processing (for the rest).
Task-oriented restructuring of modules (Sec. \ref{sec:moduleStructure}) will be partially automated by checking the suffix of model names (e.g Classifier vs. Regressor). The annotation editor (Sec. \ref{sec:api-wrapping}) is fully implemented. Annotation of \skl{} is in progress and the added annotations will be used as input for wrapper generation, and as a test oracle for automated extraction of necessary design changes from the documentation.
Finally, the resulting API needs to be carefully evaluated through usability studies to determine whether it really yields the conjectured improvement.
\section{Conclusion}
In this paper, we have presented a novel approach for easing the learning and correct use of a complex API. Unlike approaches to learnability that focused on improving the documentation of an API \cite{Robillard:ESE2011, Robillard:IEEESOftware2009}, we investigated whether API \emph{complexity} can be reduced, to avoid overwhelming application developers.
Based on analysis of the API's usage in 41,867 programs, we showed that 21\% of classes, 47\% of functions, and 57\% of parameters can be eliminated, without affecting any of the analysed programs (Fig. \ref{fig:scikit-statistics-bar-chart}).
Analysing code and documentation of the remaining API elements, we found
a proliferation of elements of primitive types, which
impedes learnability and eases API misuse. Tangling of different concerns in long parameter lists hides the essential hyperparameters. Hard to debug errors arise from implicit dependencies of parameters and hidden narrowing of parameter domains in code that behaves correctly just on a subset of the values that can be passed (Sec. \ref{sec:api-redesign}).
We showed that design improvements inspired by refactorings can solve these issues. However, since we cannot refactor a third-party API,
we proposed an alternative approach: semi-automated API wrapping. We showed how a layer of wrappers
that implement an improved API can be built and kept up-to-date with minimal manual effort, based on analysis of the original library's source code and documentation, usage statistics, and code generation.
The only ML-specific argument in our discussion is the distinction between hyperparameters and parameters for other concerns. This notion can be generalized to a distinction between domain-specific parameters and others.
Hence, semi-automated API wrapping should be applicable to other domains and APIs, as a general way to reduce API complexity and improve API design.
\begin{acks}
We want to thank the reviewers for their very constructive comments and inspiring suggestions for future work. This work was partially funded by the German Federal Ministry of Education and Research (BMBF) under project Simple-ML (01IS18054).
\end{acks}
\newpage
\bibliographystyle{ACM-Reference-Format}
| {'timestamp': '2022-04-07T02:21:09', 'yymm': '2203', 'arxiv_id': '2203.15491', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15491'} | arxiv |
\section{Introduction}
Migration is a megatrend of our time. In the ongoing globalization, the number of international migrants has reached unprecedented heights. International migration is a complex phenomenon that includes both \textit{voluntary migration}~\cite{ottonelli2013migration}, e.g., to enhance career opportunities, and \textit{forced migration}, e.g., caused by conflicts~\cite{yazgan2015syrian} and climate changes~\cite{abel2019climate}. While the Covid-19 pandemic has temporarily slowed migration flows, the UN's position is that ``migration is part of today's world’’~\cite{un_2020}. The UN expects the numbers to rise again and posits that well-managed migration can contribute to inclusive and sustainable development in countries of both origin and destination.
Efficient and effective second-language acquisition is a vital component in sustainable international migration. The body of research literature points out language proficiency as a key to successful integration~\cite{blake2017impact,meer2019english}, not the least to support rapid entry to the labor market. International migrants are a highly diverse set of people with substantially different capacities, needs, and opportunities for learning~\cite{morrice2021you}. The history of second-language acquisition has progressed from a focus on linguistics, e.g., inspired by Chomsky's ideas about a universal grammar~\cite{chomsky2014aspects}, to a sociocognitive process, i.e., learning by combining cognitive involvement and social interaction~\cite{larsen2018looking}. The current school of thought stresses the importance of person-centered interactions. While such interactions undoubtedly offer effective learning environments, it remains unclear how they could scale to meet the needs of the migration megatrend.
Digital solutions for scalable second-language acquisition are increasingly popular. As there is a high demand for language learning tools, several applications have entered the consumer market in the last decade\footnote{https://blog.vsoftconsulting.com/blog/7-of-the-best-language-learning-chatbot-apps}. Duolingo, one of the most popular applications, has hundreds of millions of global users that are incentivized to keep learning through gamification~\cite{shortt2021gamification}. While Duolingo relies primarily on decontextualized grammar-translational exercises and audiolingual drills, there are indications that already such a simplistic digital interaction between a learner and a digital solutions can support second-language acquisition~\cite{loewen2019mobile}. Chatbots are another type of language learning tools~\cite{pham2018chatbot}, available in Duolingo and other services such as Andy, Eggbun, and Babbel. While chatbots are closer to the person-related interactions recommended for second-language acquisition, we focus this study on a more advanced digital solution, i.e., conversational agents (ConvAg).
State-of-the-art ConvAgs rely on generative dialog models (GDM). A GDM is a type of machine learning (ML) model that aims to produce human-like replies to user input. While many simple chatbots rely on pattern matching and string processing~\cite{hussain2019survey}, the GDMs we consider in this work are open-domain~\cite{roller2020recipes}, i.e., they shall be able to maintain a dialog on arbitrary topics. This is clearly a significantly more challenging implementation task and, as we stress in this paper, a substantially tougher challenge for any quality assurance (QA) effort. The AI engineering community needs to develop approaches for QA of GDMs, as failures can have severe repercussions. We remind the reader of Microsoft’s experimental ConvAg Tay, removed from Twitter less than 24 hours after being deployed due to posting racist, sexist, and anti-Semitic tweets~\cite{wolf2017we}.
In this paper, we argue that QA of ConvAgs' GDMs must be tackled from two directions. First, the development organization must capture the often vague expectations on how a ConvAg shall perform in its operational context. Second, test engineers must develop automated test cases that verify that the expectations are met. To exacerbate the QA challenge, typical ConvAg development involves frequent retraining of the underlying GDM. ML development is highly exploratory and known to suffer from the CACE principle~\cite{sculley_hidden_2015}, i.e., ``Changing Anything Changes Everything.'' Often several models are retrained in parallel, and then the ML engineers select one for deployment -- so called \textit{model selection}. While there might be indications that one of the models is better, how can you know for sure? We need a reliable approach for benchmarking different models~\cite{hasselbring2021benchmarking}, i.e., test automation that helps us detect if any GDMs digress from acceptable behavior.
The AI engineering community needs more research on QA of ML models trained for natural language processing (NLP). From the ML testing perspective, previous secondary studies show that NLP is underrepresented in the body of literature~\cite{riccio2020testing,zhang_machine_2020}. The need for NLP testing was also highlighted by Yoo in his keynote address at the DeepTest~2020 Workshop as he called for additional research~\cite{yoo2020searching}. We acknowledge that QA of GDMs forces us to see the oracle problem~\cite{barr2014oracle} in a new light. Also, compared to the comparatively well-studied topic of testing of ML models for computer vision, the discrete nature of natural language~\cite{ferrone2020symbolic} poses new challenges, as a simple negation in a sentence inverts the meaning.
We present results from ongoing action research in the context of QA of GDMs for , an evolving ConvAg designed for Swedish language practice. Emely evolves as part of an innovation project in the city of Helsingborg under development of a team from the AI consultancy company NordAxon. During the summer of 2021, researchers from RISE and Lund University joined to constitute a QA action team~\cite{staron2020action}.
Together, we set out to explore three research questions in the context of ConvAg QA:
\begin{itemize}
\item[RQ1] What are the requirements on Emely's GDM?
\item[RQ2] How can test cases be designed to verify that the GDM satisfies the requirements?
\item[RQ3] How can the test cases be implemented to allow test automation throughout the evolution of Emely?
\end{itemize}
Our pioneering paper responds to calls for additional research on ML testing for NLP. To the best of our knowledge, this is the first study to explore QA of a ConvAg development project in the field. In this paper, we present intermediate results and lessons learned from the first phase of our study. As Emely is a proprietary product, we complement our discussion with Facebook's open-source ConvAg Blenderbot~\cite{roller2020recipes}. The test infrastructure we use for GDM testing is available on GitHub~\cite{repo}, but only the Blenderbot part is available for external replication.
Note that the requirements reported in this paper are specified without strict quality targets for two reasons. First, the exact threshold values for Emely are business-critical and cannot be shared publicly. Second, Emely development follows the agile practice of using test cases as requirements~\cite{bjarnason2016multi}. This practice supports integration of requirements engineering in the agile development context, i.e., exact threshold values can easily be tuned by developers updating the automated test cases. As there are no guidelines to base the quality targets on, we found an experimental manner to be the best way forward.
The paper is organized as follows. First, Sec.~\ref{sec:bg} presents background and related work followed by a technical overview of Emely in Sec.~\ref{sec:case}. Second, Sec.~\ref{sec:method} describes our approach to action research and the results are discussed in Sec.~\ref{sec:res}. Third, Sec.~\ref{sec:threats} and Sec.~\ref{sec:lessons} elaborate on threats to validity and lessons learned, respectively, before we conclude the paper in Sec.~\ref{sec:conc}.
\section{Background and Related Work} \label{sec:bg}
This section introduces AI quality for ConvAgs. Furthermore, we present related work on NLP testing and GDM evaluation.
\subsection{AI Quality and ConvAgs} \label{sec:bg-q}
Expressing quality expectations on a ConvAg is far from trivial. First, ``quality'' in general is a notoriously difficult aspect to put the finger on~\cite{walkinshaw_software_2017}. Quality is not a single concept, but rather a multi-dimensional patchwork of different system aspects that influence the users' experience. Moreover, quality is inevitably subjective and largely lies in the eye of the beholder. For ConvAg quality, the user experience will vary depending on both the human conversationalist and the context, i.e., each dialog instance.
Second, ConvAgs are created to mimic a human conversationalist. This is indeed a grand task, and an ideal solution would even pass the imitation game of the famous Turing test~\cite{saygin2000turing}, i.e., the ConvAg would exhibit intelligent behaviour indistinguishable from that of a human. Assessing intelligent behavior is non-trivial, thus Turing proposed the role of a human interrogator in the original paper's envisioned ``imitation game.'' Pinpointing what is needed to pass the test, i.e., specifying requirements on what the interrogator should check, is a formidable challenge. Finally, as also humans are known to fail Turing tests~\cite{warwick2015human}, we humbly accept that ConvAg QA is a daunting task that cannot be solved in a single study.
In this paper, we use the following definitions from related work~\cite{borg2021aiq}: ``MLWare is a subset of AI that, fueled by data, realizes functionality through supervised
and/or unsupervised learning`` and ``AI Quality is the capability of MLware to satisfy stated and implied needs under specified conditions while the underlying data satisfy the requirements specific to the application and its context.'' A fundamental aspect of the latter definition is that quality is about both stated and implied needs. As part of our study, we conduct requirements engineering (RE) to transfer an initial set of implied needs on ConvAgs to specified requirements that lay the foundation for subsequent test case design and implementation.
\subsection{NLP Testing and GDM Evaluation}
The software testing community has published relatively few papers on ML testing for NLP applications. Compared to ML testing for image classification and recognition, especially for automotive perception systems~\cite{borg_safely_2019}, few studies specifically target NLP~\cite{riccio2020testing,zhang2020machine}. Exceptions include a study by Kim and Yoo that explores how surprise adequacy, a test adequacy metric developed for neural network input~\cite{kim2019guiding}, generalizes from image input to the NLP context~\cite{kim2021multimodal}. The most similar work to ours is the dialog testing tool DialTest by Liu \textit{et al.}~\cite{liu2021dialtest}, which was not published when we initiated our action research study.
In the NLP research community, several papers propose metrics to support evaluation of language generation. Deng \textit{et al.} presented a framework for natural language generation that covers language compression, transduction, and creation~\cite{deng2021compression}. The latter includes the dialog generation that constitutes a critical feature in ConvAgs. The authors' primary contribution is a set of metrics that corresponds to information alignment between natural language input, output, and the overall context. Based on an analysis of an established human annotation dataset, they conclude that the metrics correlate with human judgments. Yeh \textit{et al.} recently conducted a study comparing a set of 23 metrics for dialog generation on 10 datasets~\cite{yeh2021comprehensive}. They conclude that USR, GRADE, DEB, and USL-H perform the best for evaluating response generation.
Several researchers argue that a combination of metrics are needed to reliably evaluate generative language models.
In the context of machine translation, Yuan \textit{et al.} propose BARTScore~\cite{yuan2021bartscore}, including evaluation based on seven quality categories: 1) Informativeness, 2) Relevance, 3) Fluency, 4) Coherence, 5) Factuality, 6) Semantic Coverage, and 7) Adequacy. These categories partly overlap the categories we found relevant for Emely, but we instead propose a customized list for GDMs.
\section{Case description: Emely} \label{sec:case}
Emely is a ConvAg designed to help newcomers in Sweden practice Swedish, i.e., to accelerate second-language acquisition. The long-term goal is to provide a scalable approach to Swedish language practice that will help migrants enter the labor market faster~\cite{blake2017impact,meer2019english}. Emely lets users practice job interview sessions in a protected setting, i.e., interactive person-centered dialogs as recommended for effective second-language acquisition~\cite{larsen2018looking}. Fig.~\ref{fig:web} provides an impression of Emely's visual appearance
\begin{figure}
\centering
\includegraphics[width=0.45\textwidth]{emely.png}
\caption{Emely's visual appearance.}
\label{fig:web}
\end{figure}
Fig.~\ref{fig:architecture} shows the high-level architecture of Emely. Note that Emely is a proprietary solution, thus we restrict the architecture description to a high level and quantitative information is reported in vague terms. Third-party components are depicted in gray and nationality flags show the content of the natural language data. Users practicing Swedish interact with Emely through a web UI (A). The user speaks to Emely and the spoken language is transformed to text (B).
The text passes through a Toxic Filter (C) consisting of rules that identify hate speech and toxic language. If the user expresses unacceptable sentences, Emely will shortcut the information flow in Fig.~\ref{fig:architecture} already at this point, i.e., reject the input, and simply reply ``Can we please talk about something else?'' If not rejected, the Swedish text is subsequently translated to American English (D).
\begin{figure*}
\centering
\includegraphics[width=1\textwidth]{architecture.png}
\caption{High-level Emely architecture. Gray boxes indicate third-party components.}
\label{fig:architecture}
\end{figure*}
The English text is then processed by a custom dialog manager module (E) that relies on ML classifiers trained specifically for processing the user input to Emely. These ML models have been trained using the open-source framework Rasa\footnote{https://rasa.com/}. The dialog manager controls the ongoing dialog and, among other things, can bypass the GDM to instead provide high-quality answers to certain input, such as answering the question ``What is the salary for this position?'' with ``I cannot discuss the salary with you at this stage of the process.''
The rightmost component in Fig.~\ref{fig:architecture} is the GDM (F), i.e., the component that constitutes the software under test. The GDM is based on publicly available pre-trained Blenderbot models by Facebook AI\footnote{https://huggingface.co/facebook}. Blenderbot is an open-source open-domain ConvAg with pre-trained GDMs in different sizes for conversations in English. NordAxon and the city of Helsingborg manually created an initial realistic dialog dataset of interview sessions, expanded it with transcriptions of mock interviews from YouTube, and expanded the content using GPT-3~\cite{brown2020language}. From this starting point, the dataset has gradually grown during the Emely development. NordAxon uses transfer learning to adapt generic Blenderbot models to custom GDMs for Emely. The dialog manager forwards input from the user to Emely's custom GDM and a reply in English is provided.
The lower part of Fig.~\ref{fig:architecture} shows how information from the GDM is processed on the way back to the user. First, also considered part of the conversational engine, rule-based processing (G) provides a filter for the GDM output to ensure that no unacceptable content is forwarded to the user. These rules primarily rely on pattern matching and string processing, guided by hours' worth of system testing. The natural language text is then translated from American English to Swedish (H) and a third-party text to speech component (I) generates spoken language in the local Scanian dialect -- hence, the Scanian flag. Finally, Emely reads the output aloud complemented by the corresponding text. An important quality requirement is that the overall process must be fast enough to result in a realistic interview session without unreasonable delays.
\section{Research Method} \label{sec:method}
We are currently conducting action research, i.e., ``a disciplined process of inquiry conducted by and for those taking the action''~\cite{sagor2000guiding}. Action research is an appropriate research method in software engineering when the main goal is to support change in a development context and the researcher is a member of the team responsible for the change~\cite{wohlin2021guiding}. We describe our work according to Staron's recently published model for action research, which explicitly depicts knowledge, learning, and theory as secondary outputs from the endeavor -- such as this paper.
Fig.~\ref{fig:overview} shows an overview of the research project, organized into two phases. Phase~I describes the action research cycles and Phase~II illustrates how we worked on systematic evaluation of the research output and generalization beyond Emely. To support the flow of the paper, we present details related to the method for activities A)--C) in Sec.~\ref{sec:ret}.
\subsection{Phase I: Action Research Cycles}
The upper part in Fig.~\ref{fig:overview} illustrates the action research cycle and its five elements: 1) Diagnosing, 2) Action Planning, 3) Action Taking, 4) Evaluating, and 5) Learning. Full cycles were iterated on a weekly basis during three months of 2021. The action research during this time involved three distinct steps, i.e., A) Requirements Elicitation, B) Test Design, and C) Test Implementation. As indicated in Fig.~\ref{fig:overview}, a literature study was a continuous activity during the work, including gray literature on ConvAgs and chatbot testing.
\begin{figure*}
\centering
\includegraphics[width=1\textwidth]{overview.png}
\caption{Overview of the action research study.}
\label{fig:overview}
\end{figure*}
While there has been staff turnover during the project, the core action team consisted of nine members.
Two researchers from RISE, two researchers from Lund University, four AI developers from NordAxon, and a product owner from the city of Helsingborg.
As this project was conducted during the Covid-19 pandemic, remote work was the norm. The researchers integrated with the development team by joining NordAxon's regular virtual meetings, i.e., two regular status meetings per week covering synchronization and sprint planning. On top of that, additional meetings were organized for discussion of technical details and evaluation of results. Between the live meetings, a shared Slack workspace ensured another effective communication channel. The communication channels, combined with shared source code and ML models, provided a project context geared for rapid feedback. The iterative work enabled the evolution of three deliverables (cf. the gray Research Artifacts in Fig.~\ref{fig:overview}) customized for Emely: a Requirements Specification, a Test Suite for a selection of the requirements, and the corresponding Test Results. After three months of action research cycles, the resulting automated test cases could be executed in the Emely development environment.
The action team interwove the five elements of action research with the ongoing evolution of Emely corresponding to version 0.2, 0.3, and 0.4:
\begin{enumerate}
\item \textit{Diagnosing} initiated weekly sprints with an exploration of the current state of the QA initiative, e.g., to what extent were the elicited requirements complete and did the implemented test cases create value?
\item \textit{Action Planning} was integrated as a natural part of the sprint planing in the development project. In practice, we jointly prioritized backlog items and assigned resources for RE and test development.
\item \textit{Action Taking} The interventions we did to support QA of GDMs in the organization involves RE (elicitation, analysis, specification, and validation) and test development (design and implementation).
\item \textit{Evaluating} We continuously assessed the interventions from a technical perspective with the NordAxon developers. Moreover, we also validated requirements and test verdicts with the product owner on a weekly basis.
\item \textit{Learning} During the cycles, the researchers in the team used retrospectives to discuss what lessons learned could be generalized to ConvAg QA beyond Emely. In this process, we collected notes that later initiated the writing of this paper during Phase~II.
\end{enumerate}
\subsection{Phase II: Generalizing Knowledge}
The lower part of Fig.~\ref{fig:overview} shows Phase~II of the project that started from the two research artifacts developed during Phase~I. In Phase~II, the research project shifted its focus to careful analysis of the test suite, validation of the test results, generalizing results, and reporting. During Phase~II, the research team resorted to joining one weekly status meeting to discuss the progress and to ask clarification questions for the paper writing. Phase~II lasted for five months and allowed a longitudinal perspective on ConvAg QA
The core activities during Phase~II related to executing the test suite for different GDMs and to validate the results. We set up an experimental environment in which we could execute the test cases on Docker images containing three incremental versions of Emely. To allow comparisons with an open-source ConvAg, we also provide test results for Blenderbot-400M-distill\footnote{https://huggingface.co/facebook/blenderbot-400M-distill} as a benchmark. The specification of the test environment is a desktop PC running MS Windows 10 equipped with an Intel Core i7-10770 CPU @ 3.80 GHz, 16 GB RAM, and an Nvidia 1080Ti graphics card. We provide a replication package for Blenderbot in the GitHub repository~\cite{repo}. Finally, in D) Results Validation, four academic researchers and two AI developers validated that the test results could be used to verify that the corresponding requirements were satisfied -- this is described in Sec.~\ref{sec:rq1res}.
\subsection{Requirements Engineering and Testing} \label{sec:ret}
An initial activity toward QA of a GDM is to clarify expectations. In the requirements elicitation step of Phase~I, we focused on capturing vague expectations and expressing them in text. The corresponding action research cycles consisted of five main activities.
First, we initiated the work by discussing the expectations on GDMs within the action team and different constellations of the researchers. Our discussions were open, and fueled by our previous personal experiences with ConvAgs. We decided to focus this work on requirements on Emely's GDM rather than the overall system (cf. F) in Fig.~\ref{fig:architecture}). Second, we did an informal market analysis and surveyed gray literature~\cite{garousi2020benefitting} on ConvAg and chatbot quality, e.g., blog posts and technical reports.
Third, we iteratively elicited, analyzed, and specified requirements. This activity was the largest in terms of effort. Fourth, we organized the requirements based on the categories proposed by Martin \textit{et al.}~\cite{chatbottesting}, i.e., 1) personality, 2) onboarding, 3) understanding, 4) answering, 5) navigation, 6) error management, and 7) intelligence. Fifth, the action team conducted a workshop to validate the requirements and prioritize for which requirements the first set of test cases should be developed.
We assessed each requirement from the perspectives of: 1) NordAxon value, 2) implementation effort, and 3) perceived academic novelty.
All perspectives were assessed on an ordinal scale between 1 (lowest score) and 5 (highest score). We refined the requirements after the workshop and report the results in this paper.
We iteratively designed test cases (cf. B) in Fig.~\ref{fig:overview}) targeting the prioritized requirements as part of the action research cycles. Designing test cases for GDMs is non-trivial, and required both long discussions and several iterations. Moreover, the test implementation (cf. C) in Fig.~\ref{fig:overview}) was intertwined with the test design. Some test cases were straightforward to implement, others were revised several times. The results are presented in Sec.~\ref{sec:res}.
\section{Results and Discussion} \label{sec:res}
This section reports our results and discusses the three RQs.
\subsection{RQ1: Requirements} \label{sec:resrq1}
The action team developed a set of 38 requirements for Emely's GDM. During the validation workshop, one example related to the formatting of a help feature was removed as out of scope. The remaining 37 requirements, all considered valid, were further refined after the meeting and the outcome is listed in Table~\ref{tab:reqts}. The letters in the identifiers show how the requirements map to the categories proposed by Martin \textit{et al.}~\cite{chatbottesting}, i.e., Onboarding (O), Personality (P), Answering (A), Understanding (U), Intelligence (I), Error Management (E), and Performance (PF). Note that we did not specify any Emely requirements related to the Navigation category. In the context of the requirements, we define a set of key terms.
\begin{description}
\item[Dialog] An instance of an interview session.
\item[Prompt] A single string of user input to the GDM.
\item[Reply] A single string of output from the GDM.
\item[Digressed dialog] A dialog that needs an intervention to refocus because it has left the main topic.
\end{description}
\begin{table*}
\centering
\caption{Requirements on Emely's dialog generating model. Scores are in the range 1--5, with 5 being the highest.}
\includegraphics[width=1.0\textwidth]{table_reqts.png}
\label{tab:reqts}
\end{table*}
Table~\ref{tab:reqts} also presents how the action team prioritized the requirements before initiating the test development. As described in Sec.~\ref{sec:method}, we assessed all requirements from three dimensions resulting in scores between 1 and 5. The rightmost columns in the table show Value, Effort, and Novelty, respectively. For Value and Effort, green color indicates a very high estimated value, and pink color shows a very high estimated implementation effort. Finally, requirements O1 and E5 were evaluated as ``N/A'' -- the action team concluded that they are infeasible targets for automated testing.
Based on discussions within the action team, we decided to proceed with test design for 15 requirements as highlighted in bold font in Table~\ref{tab:reqts}. Our selection included eight of the 14 requirements that obtained the highest Value score. Three of the top Value requirements were excluded due to high Effort scores (P1, A2, and U1) whereas we decided to included I2 despite the high Effort. The remaining seven requirements were selected to increase the diversity (P2, A3, I1, U3, U4, U5, and U6).
\subsection{RQ2: Test Design} \label{sec:testdesign}
Our approach to GDM testing relies on randomness in the test case generation. To allow the detection of general trends, the number of test case executions are in the order of magnitude of hundreds or thousands. The approach corresponds to \textit{soak testing} as defined in ISO/IEC/IEEE 29119~\cite{iso29119_2013}. Two fundamental test parameters are 1) how many dialogs to generate and 2) how many prompts shall be provided to the GDM under test during each dialog. We found that between 20 and 50 prompts are valid and that a number of dialogs that results in roughly 1,000 prompts reliably discovers differences between GDMs.
For each of the selected requirements in Table~\ref{tab:reqts}, the corresponding approach to testing followed one of five test structures:
\begin{itemize}
\item Question-Answer (Q-A)
\item N-gram Counting (NC)
\item Coherence Checks (CC)
\item Toxicity Analysis (TA)
\item Simple Checks (SC)
\end{itemize}
The Q-A structure has three main test steps: 1) provide specific information, 2) request the same information, 3) assert that the two pieces of information match. We use this for both open questions and closed yes/no questions. Furthermore, we created 15 controlled lists representing different pieces of information (for step 1) and different ways to request that information (for step 2). For open questions, we use a BERT-SQuAD model~\cite{devlin2018bert,rajpurkar2016squad} to identify what part of the reply from the GDM is the answer -- this is used for the assessment in step 3). Wang \textit{et al.} use a similar QA approach in their work on evaluating text summaries~\cite{wang2020asking}. For closed questions, step 3) uses a controlled list of strings that are treated as no, otherwise the test case defaults to yes.
The other four test structures are less complex. However, all but SC also use third-party libraries. Test cases following the NC structure check that terms are not repeated in the GDM's replies, i.e., ``stuttering,'' using NLTK~\cite{bird2009natural}. Test cases of the CC structure uses a Sentence-BERT model~\cite{reimers2019sentence} to evaluate the coherence of the content during dialogs and between subsequent replies. The TA structure uses the Detoxify model~\cite{Detoxify} to assess whether the language in the replies from a GDM is acceptable. Finally, the SC structure relies on trivial Python asserts.
In the remainder of this section, we present how we designed test cases for the selected requirements organized per category. For each requirement, we present a descriptive test case name, which test structure it follows in brackets, and a short description.
\subsubsection{Personality and Answering}
We designed three test cases to verify that the requirements related to personality and answering are satisfied. Test cases for P2 result in normalized values whereas A3 and A4 testing yield raw frequencies.
\begin{itemize}
\item[P2] \textbf{Toxicity} [TA]. Send prompts to the GDM and assess the replies using the Detoxify model. Detoxify returns normalized values between 0 and 1 corresponding to the following categories~\cite{Detoxify}: 1) Toxicity, 2) Severe toxicity, 3) Obscene, 4) Threat, 5) Insult, 6) Identity Attack, and 7) Sexually explicit. All seven values are used to verify the satisfaction of P2.
\item[A3] \textbf{Nagging} [SC] A simple check to count the number of times during a dialog that the GDM provides the same verbatim question that it has already provided during a dialog.
\item[A4] \textbf{Stuttering} [NC] Count the number of immediate N-gram repetitions in the GDM's replies. We consider bigrams to 6-grams and combine the result to a ``stuttering score'' for which higher order N-grams are penalized more.
\end{itemize}
\subsubsection{Intelligence}
Below we list the eight test case designs we developed to verify that the selected Intelligence requirements are met. Apart from I2 and I3, the overall structure for the intelligence test cases is to present information, maintain the dialog by providing $x$ additional prompts, and then to request the previously provided information ($x$ is a tunable test parameter). Test case designs I5 and I8--I11 randomly select among handcrafted prompts, i.e., \textit{Controlled Test Data} from the file \textit{testset\_database.py} on GitHub~\cite{repo}.
\begin{itemize}
\item[I1] \textbf{Self consistency} [Q-A] 1) Request information about Emely. 2) Provide $x$ prompts. 3) Request the same information about Emely again. 4) Assert that the reply contains the same information as was provided by the GDM in step 1.
\item[I2] \textbf{Dialog coherency} [CC] 1) Provide $x$ prompts. 2) Assess the coherence between each of the GDM's replies in relation to the overall dialog.
\item[I3] \textbf{Reply coherency} [CC] 1) Provide $x$ prompts. 2) Assess the coherence between each of the GDM's replies in relation to the preceding prompt.
\item[I5] \textbf{Memory assessment} [Q-A] 1) Provide specific information $a$ in a prompt (e.g., ``I studied at Shiraz University''). 2) Provide $x$ prompts. 3) Provide a prompt requesting information $a$. 4) Assert that the GDM's reply contains~$a$.
\item[I8] \textbf{Diverse information} [Q-A] 1) Provide information $a$ as formulated in one out of several handcrafted prompts. 2) Provide a prompt requesting information $a$. 3) Assert that the GDM's reply contains~$a$.
\item[I9] \textbf{Contextual information} [Q-A] 1) Provide one out of several handcrafted prompts containing two sentences in which the first gives context and the second adds specific information $a$. 2) Request information $a$ for the specific context. 3) Assert that the GDM's reply contains $a$.
\item[I10] \textbf{Diverse questions} [Q-A] 1) Provide specific information $a$ in a prompt. 2) Provide one out of several handcrafted prompts requesting information $a$. 3) Assert that the GDM's reply contains $a$.
\item[I11] \textbf{Contextual questions} [Q-A] 1) Provide specific information $a$ in a prompt. 2) Provide one out of several handcrafted prompts containing two sentences in which the first gives context and the second requests information $a$. 3) Assert that the GDM's reply contains $a$.
\end{itemize}
\subsubsection{Understanding}
The following list reports the four test case designs we used to verify that the selected Understanding requirements are satisfied. All test case designs use the Q-A structure and share a first step of 1) providing specific information $a$ in a prompt. For each test case design, we aggregate test verdicts to depict the success rate over the fraction of introduced ``noise'' originating in fault injection. The fraction of characters and words that shall be afflicted by injected noise are tunable parameters.
\begin{itemize}
\item[U3] \textbf{Typo robustness} [Q-A] 2) Request information $a$ through a prompt containing randomly inserted character-level typing mistakes. 3) Assert that the GDM's reply contains information $a$.
\item[U4] \textbf{Word order robustness} [Q-A] 2) Request information $a$ through a prompt containing randomly swapped words. 3) Assert that the GDM's reply contains information $a$.
\item[U5] \textbf{Omitted word robustness} [Q-A] 2) Request information $a$ through a prompt containing randomly dropped words. 3) Assert that the GDM's reply contains information $a$.
\item[U6] \textbf{Synonymy robustness} [Q-A]. 2) Request information $a$ through a prompt containing words randomly replaced by synonyms (using NLTK~\cite{bird2009natural}). 3) Assert that the GDM's reply contains information $a$.
\end{itemize}
\subsection{RQ3: Test Implementation} \label{sec:rq1res}
Fig.~\ref{fig:impl} shows the dual GDM structure used in our test implementation. First, there is a generation phase with a Blenderbot GDM (A) generating prompts that are sent to the GDM under test (B). The GDM under test provides a reply to the Blenderbot, and the cycle repeats until a pre-specified number of prompts have been provided. During this phase, our test framework might randomly interrupt and replace a Blenderbot prompt with constituents of a test case using the Q-A structure, i.e., injecting prompts from the Controlled Test Data (C). We set a probability $p$ for each Q-A test case to replace a Blenderbot prompt. If information is injected, it will be requested in a subsequent prompt as described in Sec.~\ref{sec:testdesign}. The dual GDM structure increases the realism of the testing by providing the context of an ongoing dialog. We found the value of realism to outweigh the drawbacks of the evident non-determinism.
\begin{figure}
\centering
\includegraphics[width=0.35\textwidth]{impl.png}
\caption{The test implementation with dual GDMs.}
\label{fig:impl}
\end{figure}
The right part of Fig.~\ref{fig:impl} shows how the dialog resulting from the generation phase is forwarded to the Analysis step (D). All test case verdicts come from analyzing recorded dialogs after-the-fact. Test cases following the structures NC, CC, TA, and SC can be executed on all dialogs no matter if Q-A test cases injected information or not. However, analyzing the outcome of test cases following the Q-A structure is only relevant if the corresponding information has been provided to the GDM during the dialog. If multiple test cases are configured with $p>0$, different pieces of information can be injected and requested within the same dialog.
The next subsections discuss the results from executing the automated test cases.
\subsubsection{Personality and Answering}
Table~\ref{tab:pers_ans} shows the results from testing the Personality and Answering requirements, i.e., Toxicity, Nagging, and Stuttering. The table lists results from testing three GDMs of Emely (v02, v03, and v04) and Blenderbot (BB). The results are based on 200 dialogs driven by 50 Blenderbot prompts each, i.e., analyses of 10,000 GDM replies. To increase the variation in the dialogs, we set all probabilistic test cases to $p = 0.05$.
Toxicity is a subjective measure. We argue that recall (i.e., test sensitivity) is more important than precision for toxicity testing of a GDM and thus consider an arguably low Detoxify score of
greater than 0.1 as the threshold.
To validate this threshold, all six authors conducted an independent (binary) assessment of 50 GDM replies representing a range of Detoxify scores. The task was to use the gut feeling to indicate replies that ``do not feel like a tactful reply by the GDM.'' We found a large individual variation, ranging from 0 to 20 toxicity-indicated replies, corresponding to a fairly low inter-rater agreement (Fleiss' kappa = 0.25). We created a ground truth by considering any reply highlighted as non-tactful by at least two independent indications as a true positive. The test results, corresponding to toxicity testing using the 0.1 threshold on the sample, represents a recall of 0.88 and a precision of 0.28. The test results for P2 - Toxicity in Table~\ref{tab:pers_ans} show i) the fraction of toxic replies (out of 10,000), ii) the 75\% percentile for Detoxify scores, and iii) their standard deviation.
\begin{table}[]
\caption{Test results related to Personality and Answering. Results in bold font are discussed in the text.}
\label{tab:pers_ans}
\begin{tabular}{lc|ccc|c}
& & v02 & v03 & v04 & BB \\ \hline
\multirow{3}{*}{P2 - Toxicity} & Toxic & 391/10k & 350/10k & 398/10k & 526/10k \\
& 75\% & 0.002 & 0.003 & 0.003 & 0.003 \\
& Std & 0.083 & 0.078 & 0.077 & 0.070 \\ \hline
\multirow{3}{*}{A3 - Nagging} & Nag & 196/200 & 200/200 & 200/200 & 197/200 \\
& \#Nags & 670 & \textbf{1176} & \textbf{1159} & 617 \\
& Median & 2 & 3 & 2 & 2 \\ \hline
\multirow{3}{*}{A4 - Stuttering} & Stut & 192/200 & 183/200 & \textbf{20/200} & 190/200 \\
& 75\% & \textbf{1.077} & 0.143 & 0.299 & 0.133 \\
& Std & \textbf{28.83} & 0.025 & 0.032 & 0.022 \\ \hline
\end{tabular}
\end{table}
Table~\ref{tab:pers_ans} also shows the test results for A3 - Nagging. Regarding Nagging, the rows present i) the fraction of dialogs that contained a nagging question (out of 200), ii) the total number of nagging questions, and iii) the median number of nagging questions in dialogs with nagging present. We note that GDMs v03 and v04 are strikingly more likely to repeat the same verbatim question.
Finally, Table~\ref{tab:pers_ans} reports the test results for A4 - Stuttering. The rows list i) the fraction of dialogs containing a non-zero stuttering score (out of 200), ii) the 75\% percentile of the stuttering scores, and iii) the standard deviation. The most extreme example of stuttering we detected was a reply by the GDM v02 that consisted of a sequence of 64(!) ``z''. In contrast, the reply with the highest stuttering score by the GDM v04 was ``It is always sunny and always sunny.'' To provide another perspective on how the requirement is met, Fig.~\ref{fig:dists} shows distributions and probability density functions for stuttering scores representing 200 dialogs for each GDM. We believe that presenting such plots in dashboards could help ML test engineers effectively detect model regression after retraining.
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{dists.png}
\caption{Distributions of stuttering scores (on the x-axes). Y-axes show frequencies (note the extreme scale of v02).}
\label{fig:dists}
\end{figure}
We conclude that \textit{the test cases developed for the three selected requirements under Personality and Answering detected meaningful differences between the GDMs}. Thus, our findings show that they can be used to support selection of GDMs, e.g., as part of regression testing prior to model selection after retraining. For Toxicity, we found that the three GDM versions were all less toxic than Blenderbot. For Nagging, we found that the number of repeated verbatim GDM questions has increased in later versions. Finally, for stuttering, we detected that the GDM v02 had an issue of repeating n-grams within replies -- which was a known issue by NordAxon at that time and later resolved. The prevalence of stuttering in the GDM v04 is substantially lower compared to the other GDMs.
\subsubsection{Intelligence, Understanding, and Robustness}
Table~\ref{tab:int} summarizes the results from testing the Intelligence requirements. The table shows results from testing three GDM versions (v02, v03, and v04) and Blenderbot (BB) using 200 dialogs driven by 50 Blenderbot prompts each. Table~\ref{tab:int} shows three values for each requirement: i) the fraction of dialogs with failed test cases, ii) the 75\% percentile for the number of failed test cases per dialog, and iii) the standard deviation. To increase the variation in the dialogs for I2 and I3 testing, we set all probabilistic test cases to $p = 0.05$. For all other test cases, we set $p = 0.05$ for the corresponding injection and kept all others at 0.
The test results for I1 show that none of the GDMs are consistent in how they convey themselves during dialogs. Instead, the GDMs frequently present contradictory information and change previously expressed facts. We observed a lower fraction of failed test cases for GDM~v03, but at the same time the number of failed test cases per dialog remains high. We consider this a normal variation in the probabilisitic testing and conclude that all GDMs are far from satisfying I1.
Coherence is a subjective quality just like toxicity. To validate the utility of the sentence-BERT's Next Sentence Prediction (NSP) to measure coherence as part of the CC test structure, all authors did an independent assessment of 30 dialog snippets (containing roughly five prompts and five replies) representing a range of different I2 test verdicts. The task was to use the gut feeling to indicate replies that ``do not feel coherent given the ongoing dialog.'' The inter-rater agreement was higher than for toxicity (Fleiss' kappa = 0.46) and we created a ground truth through the majority vote among the raters (removing two ties). The I2 test results, corresponding to whether the NSP indicates that a GDM's reply is more likely to be a random sequence of words rather than a continuation of the dialog (i.e., coherent), represents a recall of 0.50 and a precision of 0.85. We find that these results show that BERT's NSP scores can be used for I2 coherence testing.
Table~\ref{tab:int} shows the results from I2 testing. For each of the 10,000 replies in the 200 dialogs, NSP assessed whether it is coherent. If a dialog contains at least one incoherent reply, the dialog is recorded as failed. We find that the GDMs v03 and v04 are more coherent than v02, i.e., 79 and 71 failed dialogs compared to 122.
On the other hand, the I3 validation effort clearly showed that BERT's NSP cannot be used to assess coherence in relation to a single preceding prompt. There is obviously too little information for the technique to make any reliable predictions. Thus, we do not report any results from testing I3 -- Table~\ref{tab:int} only lists ``Omitted.''
The Q-A structure is at the core of most test cases for Intelligence and Understanding. As described in Sec.~\ref{sec:testdesign}, the I5 test cases provide information to the GDM and request the same information a few prompts later. Test cases for I8--I11 use the same concept, but alters the way either information is provided or information is requested. The test cases we implemented for Understanding uses the same Q-A structure, but injects various types of noise, i.e., typos (U3), swapped word order (U4), removed words (U5), and synonym replacement (U6).
Test results related to I5 also had to be carefully validated. While the results related to the memory of GDMs are less subjective than the toxicity and coherence counterparts, the possible language variation makes it difficult to programatically distinguish between correct and incorrect replies -- the so called test oracle problem~\cite{barr2014oracle}. To validate the test results, we analyzed 25 randomly selected test results from each GDM, i.e., the output from BERT-SQuAD and the test case verdict. Using human judgment as the ground truth, the test results correspond to a recall of 0.85 and a precision of 0.97.
We further analyzed the relatively high false negative rate. Eleven passing test cases should instead have failed. Among these, we found two main tendencies. First, the GDMs sometimes ``trick'' the test case into a positive verdict by talking about itself, e.g., ``Where did I use to work?" followed by ``I used to work at a fast food restaurant.'' Second, GDMs frequently dodge questions by returning another question. As replies to the prompt with the closed question Q:``Am I good at working with people?'' we found both general clarification questions such as A:``What do you mean by that?'' and more complex formulations, e.g., A:``What do you mean by people skills?'' Defaulting such answers to yes, as described in Sec.~\ref{sec:testdesign}, resulted in false negatives.
The recall is still sufficient to allow GDM testing, thus we present I5 test results in Table~\ref{tab:int}. The results, corresponding to I5 test case injection set to $p = 0.1$, clearly show that all GDMs display inadequate memory, i.e., between 173 and 199 dialogs with injected I5 test cases fail. Blenderbot performs the worst, and we observe only slight differences between Emely's three GDMs versions.
We conclude that \textit{the test cases designed for I1, I2, and I5 are sufficiently sensitive to detect differences between different versions of GDMs}. In this process, we also found that none of the GDMs satisfy the I5 memory requirement. As the results for the fundamental memory test case were inadequate, we refrain from reporting results for the more complex Q-A test cases (I8--I11 and U3--U6) in this paper. The basic I5 test case design was troublesome enough.
\begin{table}[]
\caption{Test results related to Intelligence. Results in bold font are discussed in the text. Several results, e.g. everything about Understanding, are omitted after failed validation.}
\label{tab:int}
\begin{tabular}{lccccc}
& \multicolumn{1}{c|}{} & v02 & v03 & \multicolumn{1}{c|}{v04} & BB \\ \hline
\multirow{3}{*}{\begin{tabular}[c]{@{}l@{}}I1 - Self\\ consistency\end{tabular}} & \multicolumn{1}{c|}{Failed} & 182/197 & \textbf{136/196} & \multicolumn{1}{c|}{180/198} & 161/194 \\
& \multicolumn{1}{c|}{75\%} & 3 & 5 & \multicolumn{1}{c|}{5} & 5 \\
& \multicolumn{1}{c|}{Std} & 2.606 & 3.210 & \multicolumn{1}{c|}{2.668} & 2.848 \\ \hline
\multirow{3}{*}{\begin{tabular}[c]{@{}l@{}}I2 - Dialog\\ coherence\end{tabular}} & \multicolumn{1}{c|}{Failed} & 122/200 & \textbf{79/200} & \multicolumn{1}{c|}{\textbf{71/200}} & 114/200 \\
& \multicolumn{1}{c|}{75\%} & 2 & 2 & \multicolumn{1}{c|}{1} & 2 \\
& \multicolumn{1}{c|}{Std} & 0.933 & 0.641 & \multicolumn{1}{c|}{0.499} & 0.620 \\ \hline
\multicolumn{3}{l|}{I3 - Reply coherence} & \multicolumn{3}{c}{Omitted} \\ \hline
\multirow{3}{*}{I5 - Memory} & \multicolumn{1}{c|}{Failed} & 179/200 & 181/200 & \multicolumn{1}{c|}{173/200} & 199/200 \\
& \multicolumn{1}{c|}{75\%} & 2 & 3 & \multicolumn{1}{c|}{2} & 3 \\
& \multicolumn{1}{c|}{Std} & 1.462 & 1.772 & \multicolumn{1}{c|}{1.378} & 1.533 \\ \hline
\multicolumn{3}{l|}{I8 -- I11 (Diversity and Context)} & \multicolumn{3}{c}{Omitted} \\ \hline
\multicolumn{3}{l|}{U3 -- U6 (Robustness)} & \multicolumn{3}{c}{Omitted} \\ \hline
\end{tabular}
\end{table}
\section{Threats to Validity} \label{sec:threats}
We discuss the most important threats to the validity of our action research study as proposed by Staron~\cite{staron2020action}.
\textbf{Construct validity.} The concept of quality of ConvAgs is at the heart of our work. Do our requirements really capture the elusive concept of human-like dialog generation? Moreover, even if our requirements are valid, do our automated test cases properly verify that the GDM satisfies them? Our work is by no means finished or complete, but we argue that we mitigated the main threats by conducting multi-perspective requirements engineering and independent validation of test results.
\textbf{Internal validity.} The only difference between the test subjects are the GDMs, i.e., no rule-based processing differs. There is considerable randomness in the test case results that could influence our causal claims, but we reduce the threat by repeated execution.
\textbf{Conclusion validity.} Apart for P2 and A3, we largely discuss the fraction of dialogs that contain failed test cases. Perhaps this fairly coarse-grained approach hides detailed insights, but we complement the data with percentiles and standard deviations for test case failures on a dialog level. Furthermore, we find that interpreting inter-rater agreements using standard thresholds are valid for our purposes.
\textbf{External validity.} We designed test cases particularly for the GDM in the interview-coaching Emely, thus they are certainly less applicable for other GDMs. However, while the test case implementations are customized, we believe that the specified requirements are general enough to apply to virtually any ConvAg, e.g., the general purpose Blenderbot. Generalizing further, many requirements should also apply to simpler chatbots without GDMs -- also rule-based bots shall remember information and avoid toxic language.
\section{Lessons Learned} \label{sec:lessons}
Action research results in valuable lessons learned. In this section, we report four important lessons that can guide others working on ConvAg QA and their embedded GDMs.
First, Emely's memory appears remarkably short and this can lead to frustrated users. We believe that a GDM in isolation will never be sufficient to satisfy memory requirements. Instead, the conversational engine must likely contain dedicated knowledge representation. This would involve combining the current deep learning techniques with previous work on symbolic AI, e.g., what can be found in ConvAgs from the 90s~\cite{allen1995trains}. To mitigate frustrated users, Emely now explicitly warns the user about her poor memory when she introduces herself as a job interviewer.
Second, we believe that another approach to memory testing could be better. The current test designs focus on testing that the GDM remembers information provided by the user. Instead, testing that the GDM remembers what it previously provided would be more meaningful and better complement the I1 test cases for self-consistency. However, this would require the test harness to implement knowledge representation and populate it during the ongoing dialog -- and then look for contradictions in the replies.
Third, testing a GDM designed to drive interviews is more difficult than testing a mere conversationalist. As a test engineer, you want to control the situation. However, the interview-driving Emely is itself designed to drive to conversational flow. Any injected test cases by the test engineer lead to a power struggle that make the dialog less realistic.
Fourth, the GDM lacks the concept of self. As an anthropomorphic (although disembodied) ConvAg, dialogs that violate everyday constructs such as ``you'' and ``me'' might deteriorate the user's perception of Emely~\cite{araujo2018living}. Our test cases triggered such behavior, e.g., Q:``Do I enjoy working with people?'' followed by the reply A:``Yes, I love working with people!'' Future versions of the ConvAg needs to be reinforced to mitigate such tendencies.
\section{Conclusion and Future Work} \label{sec:conc}
QA of ConvAgs that rely on GDMs requires novel approaches to AI engineering. We conducted action research in the context of Emely, an evolving solution for person-centered interactive second-language acquisition~\cite{larsen2018looking}, intended to accelerate migrants entry to the labor market~\cite{blake2017impact,meer2019english}.
We elicited and specified 37 requirements on Emely's GDM that generalize to other ConvAgs (RQ1). Based on a prioritization activity within the action team, we selected 15 requirements and proposed corresponding test designs (RQ2). We implemented automated test cases that indicate to what extent subsequent versions of Emely's GDMs satisfy the requirements (RQ3). We report test results for six test cases and validate that they reflect requirements fulfillment.
This action research endeavor will continue. Emely is still in early development and we will keep improving her corresponding QA. Next we will revisit and refine the requirements by introducing additional stakeholders in the requirements engineering. Furthermore, we will refactor the test infrastructure and execute test cases in an MLOps setting~\cite{borg2022agility}. Moreover, we will develop an interactive dashboard to provide NordAxon ML engineers with an actionable overview for model selection among candidate GDMs.
| {'timestamp': '2022-03-30T02:29:41', 'yymm': '2203', 'arxiv_id': '2203.15414', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15414'} | arxiv |
\section{Experimental Validation Results}
\subsection{Experimental Setup}
\begin{figure}[t!]
\centering
\includegraphics[width=\linewidth]{image/Setup_all.png}
\caption{The designed and realized experimental setup for the proposed TR-based multi-user MISO scheme.}
\label{fig:setup}
\end{figure}
To evaluate the performance of the proposed ITRDMA precoding scheme, we have implemented an experimental setup to first sound the channel and then to TR-precode the transmitted signals, as shown in Fig.~\ref{fig:setup}. The setup consists of a transmitter array with $M=8$ antennas, all connected to a solid-state Radio Frequency (RF) switch. The input of this $1\times8$ switch is connected to a power amplifier that is fed by an Arbitrary Waveform Generator (AWG) from Tektronix (specifically, the AWG-7012). This AWG was used to generate transmitted signals with a carrier frequency at $2$ GHz. The transmitter (Tx) was placed inside a reverberating cavity to create a rich multipath signal propagation channel. This cavity has an opened window facing the Receivers (i.e., Rx1 and Rx2), which are placed outside the cavity. The AWG and DSO were connected to an Ethernet network switch and controlled by a desktop computer. The AWG triggered the DSO to ensure synchronization. The sampling rate of the DSO and the AWG was $12.5$ and $10$ GHz, respectively.
Two different setup configurations were used for two different sets of measurements. The first setup intended to evaluate the ITRDMA precoding scheme in a two-user MISO scenario, where two dipole antennas were connected to two low noise amplifiers, and then, to the inputs of an RF Digital Storage Oscilloscope (DSO) (specifically, the Tektronix TDS6604B). The second setup was used to evaluate the TR precoding in a mobile setting, considering a single-user MISO scenario. In particular, the receiving user Rx1 was mounted on a linear motorized bench in order to be able to move its receiving antenna without strongly modifying the channel property inside the reverberating cavity. The bench was placed parallel to the cavity's opening, resulting in a displacement range equal to $30$cm.
\subsection{Spatiotemporal Focusing Capability}
In the first experiment, we ran the transmission chain with a bandwidth $B=100$ MHz to focus the precoded signal on the user Rx1. We applied both the conventional TR and the proposed ITR precoding algorithms using $50$ iterations. The radiated field was probed not only on the user Rx1, but also on the user Rx2. The amplitude of the baseband received fields versus the discrete time index is demonstrated in Fig.~\ref{fig:TRVsITR}. We first clearly observe a strong time and spatial focusing with the both TR-based precoding algorithms. However, the side lobes on Rx1 and the secondary lobes on Rx2 are smaller when ITRDMA is applied. One can also see that the ITRDMA-precoded signals have slightly lower amplitude at time $t=0$.
\begin{figure}[t!]
\centering
\includegraphics[width=1 \linewidth]{image/focus_signal.jpg}
\caption{Amplitude in Volts of the baseband received field probed by the antenna of Rx1 (top figure) and the antenna of Rx2 (bottom figure), when TR and ITRDMA precoding are considered by the $8$-antenna transmitter array in order to spatiotemporally focus the transmitted signal at Rx1.}
\label{fig:TRVsITR}
\end{figure}
To quantify the improvement of the ITRDMA-based focusing, we plot in Fig.~\ref{fig:SINRtoiter} the SIR performance of the received signal, as computed via \eqref{eq:SINR} by setting $\sigma=0$, as a function of the number of the algorithmic iterations for a $B=100$ MHz bandwidth signal. Note that the SIR of conventional TR precoding is obtained when the number of iterations with ITR equals to $0$. It can be seen that, thanks to the proposed iterative scheme, an improvement up to $6.5$ dB is obtained with ITR for $400$ iterations. Evidently, the improvement is not linear with the number of iterations. We actually observe that the SIR improves with the square root of this number, as soon as the iterations are more than $50$. We believe that those improvement and behavior strongly depend on the channel characteristics and transmission bandwidth.
\begin{figure}[t!]
\centering
\includegraphics[width=1 \linewidth]{image/SINRiter2.jpg}
\caption{The SIR performance of the proposed ITRDMA precoding algorithm with respect to the number of iterations using $B=100$ MHz. The inner plot is the same plot, but its horizontal axis is in log scale.}
\label{fig:SINRtoiter}
\end{figure}
\subsection{The Effect of Mobility}
The TR-based precoding is known to be sub-optimal, especially in the case of low-to-moderate noise levels. However, it is also known to be less sensitive to channel fluctuations and receiver mobility. Hence, one may wonder to what extent the proposed ITRDMA processing is more sensitive than conventional TR, when considering a displacement of a receiving user between its position when channel estimation was performed and its new position during the data transmission phase. We experimentally investigate this question, as follows. We consider the user Rx1 lying on the motorized bench, and a first step, the $8$ CIRs are estimated for an initial position of Rx1 at the point $x=8$ cm. Using those estimates, the ITRDMA precoder is derived. In a second step, the Rx1 is moved between the positions $x=1$ and $15$ cm with a step size of $1$ cm. For each of those positions, the same precoder was applied and the measured signal in baseband was recorded and stored. This signal's amplitude, considering $50$ algorithmic iterations for ITRDMA, is illustrated as a function of time and RX1 position in Fig.~\ref{fig:SPfocus}. As expected the maximum of the spatiotemporal focusing is obtained for the Rx1 position at $x=8$ cm, where the CIR was estimated. It is also shown that the maximum amplitude reaches a minimum when the receive antenna is moved by $5$ cm from the CIR measurement position. For TR preprocessing, it is well known that the width of the focal spot is directly given by the spatial coherence length, which is equal to half a wavelength for a diffuse field. In our experiment at $2$ GHz carrier frequency, this coherence length is $3.4$ cm. The larger value seen in this figure happens because the receiving antenna is placed outside the reverberation cavity, leading to an increase of the spatial coherence length.
\begin{figure}[t!]
\centering
\includegraphics[width=1 \linewidth]{image/SP_focus.png}
\caption{Amplitude [V] of the baseband received signal with respect to time and the position of the antenna of Rx1. The ITRDMA-precoded signals have been obtained using $50$ algorithmic iterations and the transmission bandwidth $B=100$ MHz.}
\label{fig:SPfocus}
\end{figure}
We next investigate the effect of the user receiver displacement between the channel sounding and the data transmission phases in the SINR performance, by evaluating the expression \eqref{eq:SINR}. The Doppler effect was not taken into account. However, it is expected to have a moderate impact on the data transmission since we perform wideband processing in the time domain. The SINR curves versus the Rx1 displacement in cm for the SNR value $30$ dB are demonstrated in Fig.~\ref{fig:CH10SNR30}. We clearly observe that, for small distances, the larger the number of iterations is, the faster is the decay of the SINR with respect to the distance. Nevertheless, the ITRDMA algorithm seems to inherit the TR robustness. Indeed, once the SINR improvement due to the $50$ algorithmic iterations is lost, its behavior becomes identical to the one obtained with only $20$ iterations. Hence, by optimizing the number of iterations in our algorithm, one can get better performance with the proposed ITRDMA scheme than using conventional TR.
\begin{figure}[t!]
\centering
\includegraphics[width=1 \linewidth]{image/SINRtoDistance.jpg}
\caption{The estimated SINR at Rx1 with respect to the distance traveled by this user between the CIR estimation process and the application of the ITRDMA precoder. The performance curves were obtained for $3$ different precoders: \textit{i}) conventional TR, as well as ITRDMA with \textit{ii}) $20$ and \textit{iii}) $50$ algorithmic iterations. The transmission bandwidth and operating SNR were set to $100$ MHz and $30$ dB, respectively.}
\label{fig:CH10SNR30}
\end{figure}
We hereinafter set as $\tau$ the time duration between the channel estimation process and the actual data transmission, ans as $v$ the speed of mobility of the user Rx1. Based on the findings in Fig.~\ref{fig:SPfocus}, one can assess the maximum speed that Rx1 can reach before its SINR performance reduces by a factor of $2$ for different CIR estimation time intervals $\tau$. Indicative results for this metric are provided in Table~I. The shown time duration values are completely compatible with our indoor applications of the ITRDMA algorithm. For outdoor applications, the ITRDMA processing has the same limitations with any precoding algorithm, where the channel needs to be estimated by the transmitter. Note that the speed values listed in Table~I are probably overestimated, because the outdoor coherence length can be larger. In this table, we have calculated the minimum speed of the user Rx1 in order to reach half of the signal strength for the corresponding time duration $\tau$. As clearly shown in the figure, a lower value of $\tau$ will result in SINR being more robust to mobility.
\begin {table}[t!]
\caption{The Required Speed of User Rx1 to Reach Half of the Signal Strength For Different Channel Estimation Durations.}
\label{tab:speedtotau}
\begin{center}
\begin{tabular}{|c||c|c|c|}
\hline
$\tau$ (msec) & $50$ & $10$ & $1$ \\
\hline
$v$ (km/h) & $2.16$ & $10.8$ & $108$ \\
\hline
\end{tabular}
\end{center}
\end {table}
\begin{figure}[t!]
\centering
\includegraphics[width=1 \linewidth]{image/CH1B100SNR2-10.jpg}
\caption{The SINR performance versus the speed of the mobile user Rx1 lying in the motorized bench for transmission bandwidth $B=100$ MHz, time mismatch duration $\tau$=1 ms, and operating SNR equal to $2$ and $10$ dB.}
\label{fig:CH1SNR210}
\end{figure}
Finally, in the SINR performance evaluation results in Fig.~\ref{fig:CH1SNR210}, we investigate the effect of the noise on the behavior of the different TR precoding schemes, when considering varying mobility speeds for the user Rx1. In this figure, the time duration $\tau$ between the CIR estimation and data transmission is set to $1$ ms, and we plot the SINR values of the baseband received signal when applying conventional TR, as well as ITRDMA with $20$ and $50$ iterations. Performance curves for operating SNR values equal to $2$ and $10$ dB are depicted. It is shown that, the lower the SNR is, the closer are the performances of the different TR-based precoding schemes. This is due to the fact that for high noise levels, the interference becomes lower than the noise level, and then the interference cancellation process becomes useless. For low-to-moderate user speeds, which are reasonable for indoor applications, it is demonstrated in the figure that ITRDMA outperforms conventional TR. However, for very large speeds, conventional TR, which is obtained from ITRDMA for zero iterations, is sufficient.
\section{Introduction}
Ultra-WideBand (UWB) signal waveforms have ushered a new era in short-range data transmissions for wireless sensor networks, by enabling both robust communications and accurate ranging capabilities \cite{zhang2009uwb}. One central issue facing UWB waveforms for low complexity devices refers to effective energy collection that is usually dispersed in rich scattering wireless environments. The Time Reversal (TR) technique appears to be a paradigm shift in exploiting rich multipath signal propagation, which is capable of focusing UWB pulses both in time and space \cite{lerosey2004time}, while shifting the signal processing complexity to the transmitter side.
With TR precoding, the receivers can benefit from high levels of the intended received signals enabling, in this way, simple, low cost, and low power reception modules \cite{wang2011green,chen2013time}. Moreover, the offered temporal pulse compression and spatial focusing can partially mitigate the Inter-Symbol Interference and the Inter-User Interference (IUI), resulting from the multipath signal propagation \cite{oestges2004time}. The above characteristics render TR precoding a promising scheme for wireless communications and localization applications. Very recently, \cite{Alexandropoulos_ICASSP} demonstrated indoor cm-level localization accuracy with TR at $3.5$ GHz using up to $600$MHz bandwidth channel sounding signals. In \cite{Mokh_CSCN}, considering a leaking reverberation cavity, the authors experimentally verified the ultra-accurate spatiotemporal focusing capability of TR at $273.6$ GHz using transmission bandwidths up to $4$ GHz.
In \cite{han2012time}, a TR-based Division Multiple Access (TRDMA) scheme for multi-user Multi-Input Single-Output (MISO) systems was presented. It was shown that the proposed scheme provides a cost-effective waveform design enabling energy-efficient Internet-of-Things (IoT) nodes \cite{wang2011green}. Thanks to this simple precoding strategy, base stations can support a large number of simultaneous links with moderate complexity \cite{han2014multiuser}. A theoretical analysis for the average Signal-to-Interference Ratio (SIR) of the intended and unintended receivers in a distributed TR-based transmission scheme was carried out in \cite{wang2016snr}, while an experimental evaluation has been recently presented in \cite{mokh2021indoor}. However, it is known that when operating in low Signal-to-Noise Ratio (SNR) values, the interference level can affect the TR performance. Indeed, one major issue with TRDMA is that the SIR level cannot be tuned. For instance, it has been shown that in an ideal Rayleigh channel, the averaged SIR is equal to $0$ dB.
To overcome the latter problem with TR while keeping the receiver as simple as possible, the iterative TRDMA (ITRDMA) technique was proposed in \cite{montaldo2004telecommunication}, aiming to reduce the ISI and IUI. This technique belongs to the family of pre-rake processing techniques, which were originally introduced in \cite{imada2005pre}. It is noted that iterative processing is a popular approach for equalization. It has been applied for single and multi-carrier code division multiple access (CDMA) systems \cite{liu2004iterative}. Very recently, a low complexity iterative rake detector for orthogonal time-frequency space modulation has been presented in \cite{thaj2020low,thaj2020low2}. Although the ITRDMA scheme proposed in \cite{montaldo2004telecommunication} deals with ISI and IUI, it is quite difficult to implement. It requires multiple feedback between the transmitters and the receivers, which makes it non-applicable for very low duty cycle nodes.
Motivated by the latter limitation, in this paper, we present an ITRDMA algorithm that is based on the iterative processing of the Channel Impulse Responses (CIRs) of the multiple users, which are acquired during the channel estimation phase. The proposed algorithm is implemented at the transmitter side as a precoder, instead of being implemented at the receiver as a post-processing step. Hence, the ITRDMA computational complexity is concentrated at the transmitter (e.g., the base station or access point) instead of the receiver, when downlink communication is considered. The performance of the proposed algorithm, in terms of ISI and IUI mitigation, is experimentally evaluated in a multi-user scenario inside a reverberating room mimicking a strongly scattering indoor environment. We specifically validate the performance using channels that have been experimentally acquired at the carrier frequency $2$ GHz using an $100$ MHz communication bandwidth. It is showcased, even for an experimental setup with mobility, that the proposed ITRDMA approach is more efficient than conventional TRDMA schemes.
\section{Time Reversal for Multi-User Precoding}
\label{SEC:TRDMA}
In this section, we first introduce the TR precoding and then present the proposed ITR scheme for multi-user wireless systems.
\subsection{System Model and Time Reversal Precoding}
We consider a multi-user MISO wireless communication system comprising one base station that is equipped with $M$ antenna elements, and which wishes to communicate in the downlink direction with $N$ single-antenna users. We represent by $h_{i,m}[k]$ the baseband CIR at discrete time $k$ between the $m$-th ($m=1,2,\ldots,M$) transmitting and $i$-th ($i=1,2,\ldots,N$) receiving antennas, i.e., at the base station and the $i$-th user, respectively. The TR precoding technique utilizes the time-reversed CIR, i.e., $h^*_{i,m}[L-k]$, to focus the transmitted information-bearing electromagnetic field on the $i$-th user location. As a consequence, the signal sent by the $m$-th transmit antenna at discrete time $k$ to focus the baseband message $x_i$ on each individual receiving antenna is given by:
\begin{align}
s_m[k]=\sum_{i=1}^N \frac{\sum_{l=1}^L x_i[l] h_{i,m}^*[L+l-k]}{\sqrt{\sum_{m=1}^M\sum_{l=1}^L \lvert h_{i,m}[l] \rvert^2}},
\label{eq:yi}
\end{align}
where it is assumed that the CIR is composed of $L$ significant taps. The normalization in this expression ensures that the power emitted toward each user is the same. Using \eqref{eq:yi}, the baseband received signal at each $j$-th ($j=1,2,\ldots,N$) user at time $k$ can be expressed as follows:
\begin{equation}
y_j[k]= \sum_{l=1}^L \sum_{i=1}^N x_i[l] R_{j,i}[L+l-k]+n_j[k].
\label{eq:TR}
\end{equation}
where the expression of the correlation function $R_{j,i}[k]$ between the CIRs of users $j$ and $i$ is defined as
\begin{equation}
R_{j,i}[k] \triangleq \frac{\sum_{m=1}^M\sum_{k'=-\infty}^{+\infty} h_{i,m}^*[k-k'] h_{j,m}[k']}{\sqrt{\sum_{m=1}^M\sum_{l=1}^L \lvert h_{i,m}[l] \rvert^2}},
\label{eq1}
\end{equation}
and $n_j$ represents the zero-mean additive white Gaussian noise with standard deviation $\sigma$ at user $j$.
In multipath channels, when applying TR precoding using the CIR of user $i$, the time-reversed field focuses in time and space in the location of this user \cite{fink2001acoustic}. This means that a signal peak given by the CIR's auto-correlation function $R_{i, i}[0]=\sqrt{\sum_{m'=1}^M\sum_{l=1}^L \lvert h_{i,m}[l] \rvert^2}$ appears at user $i$; at this time and location, $ML$ signals add up coherently. However, this term can be corrupted by incoherent contributions of the auto-correlation function $R_{i,j}[k]$. In fact, the contributions when $k\neq0$ but $i=j$ are due to imperfect time focusing on the targeted user/antenna. This implies that around the main focused peak, some secondary peaks are still present that generate ISI. Note that the elements of the auto-correlation function when $i \neq j$ happen due to the sides lobes. Hence, TR precoding does not perfectly focus the wave on the intended user, inducing interference to the other users.
\subsection{Proposed Time-Reversal-Based Multiple Access}
To reduce the levels of ISI and IUI appearing in \eqref{eq1}, we propose the ITRDMA algorithm. In contrary to the scheme presented in \cite{montaldo2004telecommunication}, our algorithm is based on the measurement of the CIRs of the multiple users. Its main principle is to iteratively remove the secondary peaks and lobes in the autocorrelation function. To this end, the time position and the antenna location of the targeted lobe are identified iteratively. In particular, a pre-processing time-reversed waveform is used to focus on that position at that time index, but with a peak that is the opposite of the complex amplitude of the lobe. Hence, if this time-reversed waveform is added to the actual CIR, thanks to the linearity, the secondary lobe will be canceled. The same procedure can be used iteratively to remove all secondary peaks and lobes from the autocorrelation function. The algorithmic steps of the proposed ITRDMA scheme are summarized as follows:
\begin{enumerate}
\item The transmit precoder ${s}_{i_0,m}[k]$ at the discrete time $k$ is initialized with $\tilde{h}^*_{i_0,m}[L-k]$ to focus the received signal on the user/antenna $i_0$ at the time instant (i.e., channel tap) $k=L$. The notation $\tilde h$ stands for the normalized CIR, which is computed as follows
\begin{equation}
\tilde h_{i,m}[k] \triangleq h_{i,m}[k]\left(\sqrt{\sum_{m=1}^M\sum_{k'=1}^{L} \lvert h_{i,m}[k'] \rvert^2}\right)^{-1}.
\label{eq:Normalized_CIR}
\end{equation}
\item The differences $\Delta_i[k]$ $\forall$$i=1,2,\ldots,N$ between the resulting fields $f_i[k]$ on the $N$ receiving users/antennas, which are given by the autocorrelations $\tilde{R}_{i_0,i}[L-k]$ and their targeted values $\delta[L-k]\delta[i-i_0]$ (i.e., for the fields without lobes), are computed for each receiving antenna. The notation $\tilde{R}_{j,i}[k]$ with $i,j=1,2,\ldots,N$ represents the autocorrelation function using the normalized CIRs, which is given by the expression:
\begin{equation}
\tilde{R}_{j,i}[k] = \sum_{m=1}^M\sum_{k'=-\infty}^{+\infty} \tilde{h}_{i,m}^*[k-k'] \tilde{h}_{j,m}[k'].
\label{eq:Normalized_auto}
\end{equation}
\item The tap index $\hat{k}$ and the antenna index $\hat{i}$ where the maximum of $\lvert \Delta_i[k] \rvert$ occurs are found. This corresponds to the highest (undesired) secondary peak in the autocorrelation function.
\item The ITRDMA precoder is then updated with the time-reversed CIRs, which are shifted in time to focus on the $\hat{i}$-th user/antenna at the $\hat{k}$-th tap with a complex amplitude opposite in sign with $ \Delta_{\hat{i}}[\hat{k}]$, in order to cancel the secondary peaks on each receiving user.
\item The differences $\Delta_i[k]$ $\forall$$i$ are also updated to take into account the new contributions to the precoder field. it will hold that $\Delta_{\hat{i}}[\hat{k}]=0$.
\end{enumerate}
The algorithmic steps of the proposed ITRDMA scheme are summarized in Algortihm~\ref{Hybrid_F}. It can be seen that the iterative Steps $6$ to $8$ remove the secondary taps via TR-based precoding. The iterations stop either when their maximum allowable number $n_{\max}$ is reached or when $\left|\Delta_{i}[k]\right|$ becomes smaller than a target value $\epsilon$. It is noted that this value can be advantageously tuned to meet a target SNR level or to tune the complexity and the processing latency at the transmitter side. Finally, at the Step $11$ of the algorithm, the TR-based precoding signals $s_{i,m}[k]$ at each time discrete index $k$ are normalized in energy.
\begin{algorithm}[!t]
\caption{The Proposed ITRDMA Precoding Scheme}\label{Hybrid_F}
\textbf{Initialize:} Set the values for $M$, $N$, and $L$.
\begin{algorithmic}[1]
\For {$i_0=1,2,\ldots,N$}
\State Set ${s}_{i_0,m}[k] = \tilde{h}^*_{i_0,m}[L-k]$.
\State Set $\Delta_i[k] = \tilde{R}_{i_0,i}[L-k] - \delta[L-k]\delta[i_0-i]$.
\State Set $n=0$.
\While {$\max \lvert \Delta_i[k]\rvert>\epsilon$ and $n<n_{\max}$}
\State Find $\hat{k},\hat{i} = \arg \max_{k,i} \lvert \Delta_i[k]\rvert$.
\State Set ${s}_{i_0,m}[k] \leftarrow {s}_{i_0,m}[k]-\Delta_{\hat{i}}[\hat{k}] \tilde{h}^*_{\hat{i},m}[L-k+\hat{k}] $.
\State Set $\Delta_i[k] \leftarrow \Delta_i[k]-\Delta_{\hat{i}}[\hat{k}] \tilde{R}_{\hat{i},i}[L-k+\hat{k}]$.
\State Set $n=n+1$.
\EndWhile
\State Set $s_{i_0,m}[k] \leftarrow {s}_{i_0,m}[k]\left(\sqrt{\sum_{k',m}|{s}_{i_0,m}[k']|^2}\right)^{-1}$.
\EndFor
\end{algorithmic}
\end{algorithm}
\subsection{Signal-to-Interference-Plus-Noise (SINR) Performance}
The complex-valued information symbols $x_i[l]$ intended for each $i$-th user are convoluted with the precoding sequences $s_{i,m}[k]$ computed from Algortihm~\ref{Hybrid_F}. As a consequence, the baseband received signal at each $j$-th user can be expressed as follows:
\begin{equation}
y_j[k] = \sum_{l=1}^{L}\sum_{i=1}^{N} x_j[l] w_{i,j}[k-l] +n_j[k],
\end{equation}
where $w_{i,j}[k]$ represents the precoding signal given by
\begin{equation}
w_{i,j}[k] \triangleq \sum_{l'=1}^L\sum_{m=1}^M s_{j,m}[l'] h_{i,m}[k-l'].
\end{equation}
In the case of TR precoding, by inspection of expression (2), it can be concluded that $w_{i,j}[k] = R_{i,j}[L-k]$. Therefore, the sequence $w_{i,j}[k]$ can be interpreted as a virtual channel that includes the TR-based precoding. This equivalent channel approach has been already use for TR in \cite{phan2013make}. By assuming that the power of the information symbols is normalized, it is easy to show that SINR of the equivalent channel at each receiving user/antenna $i$ is obtained as follows:
\begin{equation}
{\rm SINR}_i \triangleq \frac{|w_{i,i}[0]|^2}{I_i + \sigma^2}.
\label{eq:SINR}
\end{equation}
where $I_i\triangleq\sum_{l=1,l\neq 0}^L |w_{i,i}[l]|^2+ \sum_{l=1}^L\sum_{j=1,j\neq i}^N |w_{j,i}[l]|^2$ represents the intereference term.
\section{Conclusion}
In this paper, we have presented indoor experimental results for an UWB multiple access scheme based on the TR technique. We have proposed a novel iterative algorithm to confront the effects of ISI and IUI in TR-precoded wireless communication systems. The efficiency of the presented ITRDMA scheme has been validated through real experiments in a highly scattering medium. The presented approach includes a multi-user MISO channel sounding process to estimate the CIRs, which was used to derive the precoding scheme. Then, the TR-precoded received intended signal as well as the interference were measured in baseband and used for the performance assessment. Our performance results showcased that the proposed ITRDMA algorithm is capable to reduce the interference in the received signal, and therefore increase the SINR level. We also investigated the effect of mobility of a receiving user using the same ITRDMA scheme. It was demonstrated that the proposed precoding scheme can still be more efficient than conventional TR at high SNRs, and up to moderate speed values that are reasonable for indoor wireless communications. In future works, we will investigate the performance of the ITRDMA algorithm in imperfect channel estimation settings, and will perform comparisons with other spatial precoding techniques (e.g., regularised zero-forcing). We also intend to experiment data communication considering reconfigurable intelligent surfaces \cite{alexandg_2021} for reprogrammable rich scattering conditions.
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-03-30T02:28:11', 'yymm': '2203', 'arxiv_id': '2203.15399', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15399'} | arxiv |
\section{Introduction}
Semantic segmentation of 3D point clouds is the process of predicting a class for every point in the cloud. This is especially challenging for 3D point clouds, due to undersampling of the scene and a lack of explicit structure in the cloud.
Current approaches rely on projecting the 3D point cloud to 2D images \cite{shi2020spsequencenet,duerr2020lidar} or embed it into a dense volumetric grid \cite{tchapmi2017segcloud,rethage2018fully}. These approaches are, however, suboptimal since 2D images are not a natural representation for 3D point clouds while volumetric grids can be slow and memory intensive.
We propose to use the permutohedral lattice as an alternative representation to apply convolutions on a data structure that more closely resembles the input and can process full scans at interactive speeds.
In this work, we consider the point clouds as being recorded continuously by a sensor like a laser scanner or a depth camera. Processing individual point clouds ignores the temporal information, rendering the agent incapable of distinguishing between moving and stationary objects or integrating evidence over time~\cite{rosu2021latticenetauro,shi2020spsequencenet,duerr2020lidar}.
LatticeNet~\cite{rosu2019latticenet} is a efficient network based on the permutohedral lattice that has shown state-of-the-art results for semantic segmentation of point clouds. It has recently been extended to process temporal information~\cite{rosu2021latticenetauro}. However, the temporal fusion was performed only with simple recurrence using fully connected layers.
We present TemporalLatticeNet, an extension to LatticeNet that utilizes recurrent processing by evaluating Long Short-Term Memory (LSTM)~\cite{hochreiter1997long} and Gated Recurrent Units (GRU)~\cite{cho2014properties} as modules for temporal fusion. Additionally, we propose a novel module called Abstract Flow (AFlow) which can gather temporal information by matching abstract features in lattice space.
We show competitive results on the temporal SemanticKITTI dataset~\cite{behley2019semantickitti}, but with a faster processing speed than other methods.
\begin{figure}[t]
\centering
\includegraphics[width = \linewidth]{Overview.png}
\caption{We use multiple consecutive point clouds as input to our backbone network. The feature matrices of different timesteps are fused together to allow information propagation through time. The per-point semantic classes of the last point cloud in the sequence are predicted.}
\label{fig:overview_arch}
\end{figure}
Our contributions presented in this work include:
\begin{itemize}
\item Extensions to the LatticeNet architecture in order to improve recurrent processing,
\item Novel module inspired by optical flow methods adapted to the permutohedral lattice that improves the aggregation of temporal information, and
\item Competitive results on the SemanticKITTI dataset but with faster processing speed than other methods.
\end{itemize}
\section{Related Work}
In this section, temporal semantic segmentation will be discussed.
For an overview on general semantic segmentation of point clouds without temporal information we refer to Rosu~et al.~\cite{rosu2021latticenetauro}
Temporal semantic segmentation approaches can be divided in two types, depending on their input: i) methods which process sequences of clouds in a recurrent manner to predict the class labels and ii) methods that accumulate multiple clouds into one single cloud to solve the task as a single-frame segmentation.
The advantage of the first type of methods is that at each time-step only the current point cloud needs to be processed as the past information has already been summarized and stored in memory. However, they require more complex architectures than the methods that na\"{\i}vely segment a large aggregated point cloud.
Shi~et al.~\cite{shi2020spsequencenet} present SpSequenceNet, a U-Net based architecture for temporal semantic segmentation.
Two consecutive point clouds are voxelized and given as input to a shared encoder network. Vertical connection are added between the two timesteps in order to gather temporal information before decoding the representation into class probabilities of the last point cloud.
They designed two modules to combine the information from the two consecutive point clouds: the Cross-frame Global Attention~(CGA) and the Cross-frame Local Interpolation~(CLI) module.
CGA is inspired by self-attention and allows the network to gather and fuse global information from the previous cloud. CLI allows to attend to local information by fusing the features from nearby points with a dynamic per-point weighting.
In contrast to our approach, Shi~et al.~\cite{shi2020spsequencenet} can only process sequences of length two and they voxelize the point cloud, which leads to a loss of information and discretization artifacts.
Additionally, CLI per-point weighting is calculated using distances to k-nearest neighbors in 3D space, while our approach calculates the distance in the abstract feature space using the 1-hop neighborhood of a permutohedral lattice.
Duerr~et al.~\cite{duerr2020lidar} present their recurrent architecture TemporalLidarSeg that uses temporal memory alignment to predict the semantic labels of sequences of point clouds. Their sequences have the potential of unlimited length. They project the 3D point clouds onto the 2D plane and use a U-net backbone network to output per-frame feature matrices.
These feature matrices are then combined with the feature matrices of the hidden state using the temporal memory unit, which uses the real-world poses of each point cloud to compute the transformation from the coordinate system of the hidden to the current state.
The 2D semantic segmentation is then projected back into the 3D representation.
Similar to our approach, they require the poses of the point clouds, but they additionally need the mapping from 3D to 2D and therefore don't work directly on the point cloud. Additionally, our approach uses multiple fusion points in contrast to one in their approach.
Kernel Point Convolution (KPConv)~\cite{thomas2019KPConv} operates directly on the point clouds by assigning convolution weights to a set of kernel points located in Euclidean space. Points in the vicinity of these kernel points are weighted and summed together to feature vectors. The kernel function is defined as the correlation between the location of the kernel point and the distance to the points in the radius neighborhood. To be robust to varying densities, the input clouds are subsampled at every layer of the network using a grid subsampling and the radius neighborhood of the convolution is adapted. The kernel points are usually static, but can also be learned by the network itself to adapt to more challenging tasks. Due to memory limitations, their approach cannot process one full point cloud for outdoor scenes. Therefore, Thomas~et al.~ fit multiple overlapping spheres into the point cloud and evaluate them individually. The final results are generated by a voting scheme.
In contrast to our method, KPConv~\cite{thomas2019KPConv} performs temporal semantic segmentation by accumulating all clouds of the sequence into one large point cloud and uses no recurrent architecture.
DarkNet53Seg~\cite{behley2019semantickitti} and TangentConv~\cite{tatarchenko2018tangent} were used as the two baseline networks for the segmentation of 4D point clouds in the SemanticKITTI \cite{behley2019semantickitti} dataset. The input for these were accumulated clouds of the sequences.
DarkNet53Seg~\cite{behley2019semantickitti} is an extension of SqueezeSeg \cite{wu2018squeezeseg} --- a U-Net architecture with skip connections that uses the spherical projection of LiDAR point clouds to predict a point-wise label map that is refined by a conditional random field and subsequent clustering.
TangentConv~\cite{tatarchenko2018tangent} is based on the notion of tangent convolution --- a different approach to construct convolutional networks on surfaces that assumes that the data is sampled from locally Euclidean surfaces. The input points are projected onto local tangent planes which are used as 2D grids for convolutions. Based on this input, Tatarchenko~et al.~\cite{tatarchenko2018tangent} design a U-type network with skip connections.
In contrast to our approach, both DarkNet53Seg and TangentConv were designed to output dense per-point predictions for single point clouds and contain no recurrent connections.
\section{Fundamentals}
We use bold upper-case characters to denote matrices and bold lower-case characters to denote vectors.
We denote with point $p$ a single element from the point cloud and with vertex $v$ an element from the permutohedral lattice.
The points of a cloud are defined as a tuple $p=\left( \mathbf{g}_p, \mathbf{f}_p \right)$, with $\mathbf{g}_p\in\mathbb{R}^{ d }$ denoting the coordinates of the point and $\mathbf{f}_p \in \mathbb{R}^{ f_d }$ representing the features stored at point $p$ (normals, reflectance, etc.). The full point cloud containing $m$ points is denoted by $P=\left( \mathbf{G}, \mathbf{F} \right)$ with $\mathbf{G}\in\mathbb{R}^{ m \times d }$ denoting the positions matrix and $\mathbf{F}\in\mathbb{R}^{ m \times f_d }$ the feature matrix.
The vertices of the $d$-dimensional permutohedral lattice \cite{adams2010fast, rosu2019latticenet} are defined as a tuple $v=\left( \mathbf{c}_v, \mathbf{x}_v \right)$, with $\mathbf{c}_v\in\mathbb{Z}^{ (d+1) }$ denoting the coordinates of the vertex and $\mathbf{x}_v \in \mathbb{R}^{ v_d }$ representing the values stored at vertex $v$. A full lattice contains $k$ vertices and is denoted with $V=\left( \mathbf{C}, \mathbf{X} \right)$, with $\mathbf{C}\in\mathbb{Z}^{ k \times (d+1) }$ representing the coordinate matrix and $\mathbf{X}\in\mathbb{R}^{ k \times v_d }$ the value matrix.
For $d=3$ the input space is tessellated into uniform tetrahedra.
We denote the set of neighbors of vertex $v$ with $N(v)$.
The vertices of the permutohedral lattice are stored in a sparse manner using a hash map.
Hence, we only allocate the simplices that contain the 3D surface of interest.
Tetrahedras scale linearly in the number of vertices and not quadratically like cubical voxels. This allows for fast interpolation of data from the point cloud to the lattice and backwards.
For further details
we refer to Rosu~et al.~\cite{rosu2019latticenet}.
\section{Architecture}
Our recurrent neural network (RNN) TemporalLatticeNet is an extension of LatticeNet\cite{rosu2019latticenet}. LatticeNet is extended with recurrent connections at multiple resolutions on which temporal information is allowed to flow~(\reffig{fig:rnn__architecture}).
\subsection{Method}
\label{sec:method}
Input to our network is a sequence of clouds $P = \left(P_0, P_1, ..., P_{n-1}\right)$, where $P_i=\left( \mathbf{G}, \mathbf{F} \right)$ with $n \in \mathbb{N}^+$ and $0 \leq i < n$. We refer to $n$ as the sequence length. The network outputs the likelihood for each possible class for every point $p \in P_n$ (\reffig{fig:overview_arch}). We assume that the points have been transformed in a common reference frame.
The positions $\mathbf{G}$ are scaled by a factor $\pmb{\sigma} \in \mathbb{R}^d$ as $\mathbf{G}_s = \mathbf{G}/\pmb{\sigma}$ which controls the influence area of the permutohedral lattice. If not otherwise stated, we refer to $\mathbf{G}_s$ as $\mathbf{G}$. The matrix $\mathbf{F}$ denoting the per-point features contains the reflectance value from the LiDAR scanner or is set to zeros in the case of a sensor which doesn't output reflectance.
We insert recurrent connections at various points of the LatticeNet architecture~(\reffig{fig:rnn__architecture}) where the states of two lattices $V^{(t-1)}$ and $V^{(t)}$ have to be fused.
We refer to the feature matrix of each lattice as $\mathbf{X}^{(t-1)}$ and $\mathbf{X}^{(t)}$, respectively, as state of the network.
To compute the hidden state $\mathbf{H}^{(t)}$, we fuse the previous hidden state $\mathbf{H}^{(t-1)}$ together with the current state of the network $\mathbf{X}^{(t)}$. For this, a correspondence between the coordinate matrices $\mathbf{C}$ of both lattices has to be known, because they define the order in which the feature vectors $\mathbf{x}_v \in \mathbf{X}$ are saved. This correspondence is achieved by transforming the point clouds into a common frame and using its hash map. By keeping the hash map the same for the whole sequence, the Distribute operation of LatticeNet maps 3D points to the same coordinate vectors $\mathbf{c}$ across timesteps and allows comparing the feature vectors $\mathbf{x}$ with each other. Vertices corresponding to previously unknown areas in the input are inserted at the end of the matrices $\mathbf{C}$ and $\mathbf{X}$ (\reffig{fig:temporal_fuse}).
\bgroup
\newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}}
\begin{figure}[]
\resizebox{0.48\textwidth}{!}{
\begin{tikzpicture}
\colorlet{featout}{ph-green!80}
\colorlet{feat1}{ph-orange!80}
\colorlet{feat2}{ph-blue!80}
\colorlet{feat3}{ph-green!80}
\colorlet{feat3}{ph-yellow}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\setlength\tabcolsep{0pt}
\setlength\arrayrulewidth{1pt}
\node[] at (0,0) {
\resizebox{1cm}{!}{
\begin{tabular}{|@{\rule[-0.2cm]{0pt}{0.5cm}}*{2}{M{0.5cm} |}}
\hline
\cellcolor{featout} & \cellcolor{featout} \\
\hline
\cellcolor{featout} & \cellcolor{featout} \\
\hline
\cellcolor{featout} & \cellcolor{featout} \\
\hline
\cellcolor{featout} & \cellcolor{featout} \\
\hline
\cellcolor{featout} & \cellcolor{featout} \\
\hline
\cellcolor{featout} & \cellcolor{featout} \\
\hline
\end{tabular}
};
\node[] at (2.5,0) {
\resizebox{1cm}{!}{
\begin{tabular}{|@{\rule[-0.2cm]{0pt}{0.5cm}}*{2}{M{0.5cm} |}}
\hline
\cellcolor{feat1} & \cellcolor{feat1} \\
\hline
\cellcolor{feat1} & \cellcolor{feat1} \\
\hline
\cellcolor{feat1} & \cellcolor{feat1} \\
\hline
\cellcolor{feat1} & \cellcolor{feat1} \\
\hline
0 & 0 \\
\hline
0 & 0 \\
\hline
\end{tabular}
};
\node[] at (4.7,0) {
\resizebox{1cm}{!}{
\begin{tabular}{|@{\rule[-0.2cm]{0pt}{0.5cm}}*{2}{M{0.5cm} |}}
\hline
\cellcolor{feat2} & \cellcolor{feat2} \\
\hline
0 & 0 \\
\hline
0 & 0 \\
\hline
\cellcolor{feat2} & \cellcolor{feat2} \\
\hline
\cellcolor{feat3} & \cellcolor{feat3} \\
\hline
\cellcolor{feat3} & \cellcolor{feat3} \\
\hline
\end{tabular}
};
\node[] at (0.0, -1.55) {
$\mathbf{H^{(t)}}$
};
\node[] at (2.5, -1.55) {
$\mathbf{H^{(t-1)}}$
};
\node[] at (4.7, -1.55) {
$\mathbf{X^{(t)}}$
};
\node[] at (7.4, 1.5) {
};
\node[overlay,anchor=west] at (0.4,0) {
$ = Fuse \left(
\rule{0cm}{1.5cm} \rule{5.5cm}{0cm} \right)
\rule{0cm}{1.6cm} $
};
\node[overlay,anchor=west] at (2.9, -0.85) {
\bigg\} pad
};
\node[overlay, anchor=west] at (5.1, -0.85) {
\bigg\} new vertices
};
\node[overlay, text width=3cm, anchor=west] at (5.1, 0.45) {
\bigg\} unoccupied
};
\node[overlay, text width=3cm, anchor=west] at (3.9, -1.2) {
\Large
,
};
\node[text width=3.5cm, anchor=west] at (0.0, -2.2) {
\scriptsize
\crule[ph-green!80]{7pt} = fused results\\
\crule[ph-orange!80]{7pt} = non-zero entries\\
};
\node[overlay, text width=3.5cm, anchor=west] at (4.0, -2.2) {
\scriptsize
\crule[ph-blue!80]{7pt} = entries already allocated\\
\crule[ph-yellow]{7pt} = newly allocated entries\\
};
\end{tikzpicture}
\caption{Temporal fusion: The feature matrix from the previous time-step $\mathbf{H}^{(t-1)}$ is zero-padded in order to account for the new vertices that were allocated at the current time-step $\mathbf{X}^{(t)}$. The feature matrices are afterwards fused by the chosen recurrent layer.
} \label{fig:temporal_fuse}
\end{figure}
\egroup
\subsection{Position of the Recurrence}
\label{sec:pos_recurrence}
Our RNN is a many-to-one deep RNN whose recurrent layers are positioned at different layers of the network. Four promising positions for the recurrent connections were chosen: Early Fusion, Middle Fusion, Bottleneck Fusion, and Late Fusion as shown in \reffig{fig:rnn__architecture}.
\bgroup
\newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}}
\def55pt{40pt}
\def12pt{10pt}
\def18pt{25pt}
\def13pt{20pt}
\begin{figure}[]
\hspace*{0.07\linewidth}
\begin{tikzpicture}
\scriptsize
\def55pt{55pt}
\def12pt{12pt}
\def18pt{18pt}
\def3pt{3pt}
\def5pt{5pt}
\def13pt{13pt}
\def60{60}
\def60{60}
\def60{60}
\def60{60}
\colorlet{inputColor}{ph-orange!80}
\colorlet{distributeColor}{ph-blue!70}
\colorlet{level1DownColor}{ph-blue!70}
\colorlet{level2DownColor}{ph-green!70}
\colorlet{bottleneckColor}{ph-yellow!80}
\colorlet{level2UpColor}{ph-green!80}
\colorlet{level1UpColor}{ph-blue!70}
\colorlet{sliceColor}{ph-blue!70}
\colorlet{linearColor}{ph-orange!80}
\colorlet{concatColor}{ph-orange!80}
\colorlet{temporalFusionColor}{ph-purple!60}
\def\footnotesize{\footnotesize}
\contourlength{0.05em}
\contournumber{20}
\node[] at (3.4,-3.9) {
\begin{tikzpicture}[>={Stealth[inset=2pt,length=4.5pt,angle'=28,round]}, scale=0.95, every node/.style={scale=0.95}]
\node[rectangle,fill=inputColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (input) at (0,+5pt) {\footnotesize \textbf{Input t}};
\node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (distribute) at (0,-18pt) {\footnotesize \textbf{Distribute}};
\node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (pointnet) at (0,-18pt*2) {\footnotesize \textbf{PointNet}};
\node[rectangle,fill=temporalFusionColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionEarly) at (0,-18pt*3) {\footnotesize \textbf{Temp. Fusion}};
\node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d1c1) at (0,-18pt*4) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d1c2) at (0,-18pt*5) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=temporalFusionColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionMiddle) at (0,-18pt*6) {\footnotesize \textbf{Temp. Fusion}};
\node[rectangle,fill=level2DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (downsample1) at (0+13pt,-18pt*7-3pt) {\footnotesize \textbf{Downsample}};
\node[rectangle,fill=level2DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d2c1) at (0+13pt,-18pt*8-3pt) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (downsample2) at (4+13pt*2,-18pt*9-3pt*2) {\footnotesize \textbf{Downsample}};
\node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (bottleneck1) at (4+13pt*2,-18pt*10-3pt*2) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=temporalFusionColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionBottleNeck) at (4+13pt*2,-18pt*11-3pt*2) {\footnotesize \textbf{Temp. Fusion}};
\node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (upsample1) at (4+13pt*2,-18pt*12-3pt*2) {\footnotesize \textbf{Upsample}};
\node[rectangle,fill=level2UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (u1c1) at (0+13pt,-18pt*13-3pt*3-5pt) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=level2UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (upsample2) at (0+13pt,-18pt*14-3pt*3-5pt) {\footnotesize \textbf{Upsample}};
\node[rectangle,fill=temporalFusionColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionLate) at (0,-18pt*15 -3pt*4-5pt*2) {\footnotesize \textbf{Temp. Fusion}};
\node[rectangle,fill=level1UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (u2c1) at (0,-18pt*16-3pt*4-5pt*2) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=sliceColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (deform-slice) at (0,-18pt*17-3pt*4-5pt*2) {\footnotesize \textbf{DeformSlice}};
\node[rectangle,fill=linearColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (linear) at (0,-18pt*18-3pt*4-5pt*2) {\footnotesize \textbf{Linear}};
\def\ShiftXConcat{-55pt/2 + 13pt/2}
\def\ShiftYConcat{18pt/2-12pt/2+3pt/2+5pt/2}
\path [draw=black,postaction={on each segment={custom arrow2=black}}, transform canvas={shift={(\ShiftXConcat ,0)}}] (temporalFusionMiddle) to (temporalFusionLate);
\path [draw=black,postaction={on each segment={mid arrow=black}}, transform canvas={shift={(\ShiftXConcat ,0)}}] (d2c1) to (u1c1);
\node[circle,fill=concatColor, text=white, inner sep=0pt, minimum size=10pt] (concat2) at ([xshift=\ShiftXConcat,yshift=\ShiftYConcat]temporalFusionLate.north) {\footnotesize $\bm{\mathsf{C}}$};
\node[circle,fill=concatColor, text=white, inner sep=0pt, minimum size=10pt] (concat1) at ([xshift=\ShiftXConcat,yshift=\ShiftYConcat]u1c1.north) {\footnotesize $\bm{\mathsf{C}}$ };
\draw[->] (upsample2) |- (concat2);
\draw[->] (upsample1) |- (concat1);
\draw[->] ($(input.south) +(-10pt,0pt) $) -- ($(distribute.north) +(-10pt,0pt) $) node[midway,xshift=2.2pt] (p-middle) {} node[pos=0.5, right] {P} ;
\draw[->] ($(input.south) +(10pt,0pt) $) -- ($(distribute.north) +(10pt,0pt) $) node[pos=0.5, right] {V};
\draw[->] (distribute) -- (pointnet);
\draw[->] (pointnet) -- (temporalFusionEarly);
\draw[->] (temporalFusionEarly) -- (d1c1);
\draw[->] (d1c1) -- (d1c2);
\draw[->] (d1c2) -- (temporalFusionMiddle);
\draw[->] (downsample1) -- (d2c1);
\draw[->] (downsample2) -- (bottleneck1);
\draw[->] (bottleneck1) -- (temporalFusionBottleNeck);
\draw[->] (temporalFusionBottleNeck) -- (upsample1);
\draw[->] (u1c1) -- (upsample2);
\draw[->] (temporalFusionLate) -- (u2c1);
\draw[->] (u2c1) -- (deform-slice);
\draw[->] (deform-slice) -- (linear);
\path[draw=black,postaction={on each segment={custom arrow={black} }}
] (p-middle) -- ++(-1,0) |- (deform-slice);
\draw[->] ($ (temporalFusionMiddle.south) + (13pt,0) $) -- (downsample1);
\draw[->] ($ (d2c1.south) + (4+13pt,0) $) -- (downsample2);
\node[rectangle, text=black, inner sep=0pt, minimum width=55pt, minimum height=12pt, align = center] (explaintemporalFusionEarly) at (75+13pt*0,-18pt*3) {\footnotesize Early Fusion};
\node[rectangle, text=black, inner sep=0pt, minimum width=55pt, minimum height=12pt, align = center] (explaintemporalFusionMiddle) at (75+13pt*0,-18pt*6) {\footnotesize Middle Fusion};
\node[rectangle, text=black, inner sep=0pt, minimum width=55pt+10, minimum height=12pt, align = center] (explaintemporalFusionBottleNeck) at (80+13pt*0,-18pt*11-3pt*2) {\footnotesize Bottleneck\\Fusion};
\node[rectangle,text=black, inner sep=0pt, minimum width=55pt, minimum height=12pt, align = center] (explaintemporalFusionLate) at (75+13pt*0,-18pt*15 -3pt*4-5pt*2) {\footnotesize Late Fusion};
\end{tikzpicture}
};
\node[] at (0,-3.9) {
\begin{tikzpicture}[>={Stealth[inset=2pt,length=4.5pt,angle'=28,round]}, scale=0.95, every node/.style={scale=0.95}]
\scriptsize
\node[rectangle,fill=inputColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (input) at (0,+5pt) {\footnotesize \textbf{Input t-1}};
\node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (distribute) at (0,-18pt) {\footnotesize \textbf{Distribute}};
\node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (pointnet) at (0,-18pt*2) {\footnotesize \textbf{PointNet}};
\node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionEarly) at (0,-18pt*3) {\footnotesize \textbf{Temp. Fusion}};
\node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d1c1) at (0,-18pt*4) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=level1DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d1c2) at (0,-18pt*5) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionMiddle) at (0,-18pt*6) {\footnotesize \textbf{Temp. Fusion}};
\node[rectangle,fill=level2DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (downsample1) at (0+13pt,-18pt*7-3pt) {\footnotesize \textbf{Downsample}};
\node[rectangle,fill=level2DownColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (d2c1) at (0+13pt,-18pt*8-3pt) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (downsample2) at (0+13pt*2,-18pt*9-3pt*2) {\footnotesize \textbf{Downsample}};
\node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (bottleneck1) at (0+13pt*2,-18pt*10-3pt*2) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionBottleNeck) at (0+13pt*2,-18pt*11-3pt*2) {\footnotesize \textbf{Temp. Fusion}};
\node[rectangle,fill=bottleneckColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (upsample1) at (0+13pt*2,-18pt*12-3pt*2) {\footnotesize \textbf{Upsample}};
\node[rectangle,fill=level2UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (u1c1) at (0+13pt,-18pt*13-3pt*3-5pt) {\footnotesize \textbf{ResNet Block}};
\node[rectangle,fill=level2UpColor, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (upsample2) at (0+13pt,-18pt*14-3pt*3-5pt) {\footnotesize \textbf{Upsample}};
\node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (temporalFusionLate) at (0,-18pt*15 -3pt*4-5pt*2) {\footnotesize \textbf{Temp. Fusion}};
\node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (u2c1) at (0,-18pt*16-3pt*4-5pt*2) {\footnotesize ResNet Block};
\node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (deform-slice) at (0,-18pt*17-3pt*4-5pt*2) {\footnotesize DeformSlice};
\node[rectangle,fill=white, text=white, inner sep=0pt, minimum width=55pt, minimum height=12pt] (linear) at (0,-18pt*18-3pt*4-5pt*2) {\footnotesize Linear};
\def\ShiftXConcat{-55pt/2 + 13pt/2}
\def\ShiftYConcat{18pt/2-12pt/2+3pt/2+5pt/2}
\path [draw=black,postaction={on each segment={custom arrow2=black}}, transform canvas={shift={(\ShiftXConcat ,0)}}] (d1c2) to ($ (temporalFusionLate) + (0,0.25) $);
\path [draw=black,postaction={on each segment={mid arrow=black}}, transform canvas={shift={(\ShiftXConcat ,0)}}] (d2c1) to (u1c1);
\node[circle,fill=concatColor, text=white, inner sep=0pt, minimum size=10pt] (concat2) at ([xshift=\ShiftXConcat,yshift=\ShiftYConcat]temporalFusionLate.north) {\footnotesize $\bm{\mathsf{C}}$};
\node[circle,fill=concatColor, text=white, inner sep=0pt, minimum size=10pt] (concat1) at ([xshift=\ShiftXConcat,yshift=\ShiftYConcat]u1c1.north) {\footnotesize $\bm{\mathsf{C}}$ };
\draw[->] (upsample2) |- (concat2);
\draw[->] (upsample1) |- (concat1);
\draw[->] ($(input.south) +(-10pt,0pt) $) -- ($(distribute.north) +(-10pt,0pt) $) node[midway,xshift=2.2pt] (p-middle) {} node[pos=0.5, right] {P} ;
\draw[->] ($(input.south) +(10pt,0pt) $) -- ($(distribute.north) +(10pt,0pt) $) node[pos=0.5, right] {V};
\draw[->] (distribute) -- (pointnet);
\draw[->] (pointnet) -- (d1c1);
\draw[->] (d1c1) -- (d1c2);
\draw[->] (downsample1) -- (d2c1);
\draw[->] (downsample2) -- (bottleneck1);
\draw[->] (bottleneck1) -- (upsample1);
\draw[->] (u1c1) -- (upsample2);
\draw[->] ($ (d1c2.south) + (13pt,0) $) -- (downsample1);
\draw[->] ($ (d2c1.south) + (13pt,0) $) -- (downsample2);
\fill[fill = white] ($ (pointnet.south) + (0.1,-0.6) $) rectangle ++($ (2.2,0.6) $);
\draw[overlay,->, -{Stealth[scale=1.0]} , color = moving-car,line width=0.4mm] ($ (pointnet.south) + (0,-0.4) $) -- ($ (pointnet.south) - (-2.2,0.4) $);
\fill[draw = white, fill = white] ($ (d1c2.south) + (1,-0.6) $) rectangle ++($ (1.3,0.6) $);
\draw[overlay,->, -{Stealth[scale=1.0]} , color = moving-car,line width=0.4mm] ($ (d1c2.south) + (0.48,-0.4) $) -- ($ (d1c2.south) - (-2.2,0.4) $);
\fill[draw = white, fill = white] ($ (temporalFusionBottleNeck.south) + (0.1,0.0) $) rectangle ++($ (2.3,0.4) $);
\draw[overlay,->, -{Stealth[scale=1.0]}, color = moving-car,line width=0.4mm] ($ (temporalFusionBottleNeck.south) + (0.0,0.2) $) -- ($ (temporalFusionBottleNeck.south) - (-2.3,-0.2) $);
\fill[draw = white, fill = white] ($ (concat2.south) + (0.1,-0.5) $) rectangle ++($ (2.8,0.5) $);
\draw[overlay,->, -{Stealth[scale=1.0]}, color = moving-car,line width=0.4mm] ($ (concat2.south) + (0.0,-0.0) $) |- ($ (concat2.south) - (-2.8,0.22) $);
\end{tikzpicture}
};
\end{tikzpicture}
\caption{Recurrent architecture: The features from previous time-steps are fused in the current time-step at multiple levels of the network. This allows the network to distinguish dynamic and static objects. Our addition to the LatticeNet architecture are the temporal connections ({\color{moving-car}$\pmb{\rightarrow}$}) and the temporal fusion blocks (\crule[ph-purple!60]{8pt}).}
\label{fig:rnn__architecture}
\end{figure}
\egroup
\subsection{Recurrent Layers}
\label{sec:recurrence}
In this section, multiple different recurrent layers are presented and discussed that can be used to fuse $\mathbf{H}^{(t-1)}$ and $\mathbf{X}^{(t)}$. For the last point cloud $P_t$ of the sequence, the previous hidden state $\mathbf{H}^{(n-1)}$ is used to generate the network's prediction. For $t=0$, no computation is performed with $\mathbf{H}^{(0)} = \mathbf{X}^{(0)}$.
In order to fuse $\mathbf{H}^{(t-1)}$ and $\mathbf{X}^{(t)}$, they need the same shape and therefore $\mathbf{H}^{(t-1)}$ is padded with zeros (\reffig{fig:temporal_fuse}).
\textbf{Long short-term memory (LSTM): }
LSTMs \cite{hochreiter1997long} are often used to counteract the problem of vanishing or exploding gradients in sequence learning and show good results for these problems \cite{chung2014empirical}. Therefore we chose them as one recurrent module for our network.
\textbf{Gated recurrent units (GRU): }
As an extension to LSTMs, GRUs were introduced by Cho~et al.~\cite{cho2014learning}. They only use an input and a hidden gate and no cell state like LSTMs and are therefore possibly better suited for our task. The performance of GRUs is comparable to LSTMs, while having a lower memory consumption \cite{chung2014empirical}.
\textbf{Abstract Flow (AFlow): }
\begin{figure}[t]
\centering
\vspace*{3mm}
\includegraphics[width = 0.9\linewidth]{FlowModule.png}
\caption
Abstract Flow module: Features from the one-hop neighborhood of the previous timestep $\mathbf{H}^{(t-1)}$ are compared with the center feature $\mathbf{x}_v$ at the current time. A weighted sum is computed based on the distance. The result is concatenated with $\mathbf{x}_v$ and fused using an MLP. A direction can also be established in lattice space between the center feature and the most similar feature from the previous time-step which gives a coarse notion of the movement in the 3D scene as indicated by the arrow. Please note that this figure depicts a 2D example.
}
\label{fig:cli_module}
\end{figure}
This module is inspired by the CLI module presented by Shi~et al.~\cite{shi2020spsequencenet} that aims at combining local information and capturing temporal information between two point clouds.
Our AFlow module can be seen as a convolution with an adaptive convolution kernel. This resembles the ideas presented in Pixel-Adaptive Convolution\cite{su2019pixel}. Therefore, AFlow is designed to extract partial differences between $\mathbf{X}^{(t)}$ and $\mathbf{H}^{(t-1)}$.
First, the nearest neighbors $N(v)$ of each lattice vertex $v$ with $v \in V^{(t)}$ in the lattice from the previous timestep $V^{(t-1)}$ are found (\reffig{fig:cli_module}). They are used to generate a new local feature vector to fuse temporal information and at the same time summarize the surrounding area from the previous timestep.
The neighbors $N(v)$ for each lattice vertex are given by the one-hop neighborhood. The neighboring feature vectors from $V^{(t-1)}$ are denoted with $N_{\mathbf{H}}(v)$. For $d=3$, the number of neighbors is given by $|N_{\mathbf{H}}(v)| = 8$.
The feature vectors of the vertices in $N_{\mathbf{H}}(v)$ are weighted according to their distance to the feature vector $\mathbf{x}_v$ in $\mathbf{X}^{(t)}$. The weight is calculated as
\begin{equation}
\forall i \in N_{\mathbf{H}}(v): w_{i} = (\alpha - min(dist(\mathbf{x}_v, \mathbf{h}_i), \alpha))\cdot \beta,
\end{equation}
where $\alpha$ and $\beta$ are learnable parameters that are initialized with $\alpha, \beta = 0.1$.
Parameter $\alpha$ impacts the maximum distance a neighbor can have from the feature vector we are evaluating at the moment, while $\beta$ controls the maximum value of the resulting feature. We denote with $dist$ the Euclidean distance between the feature vectors $\mathbf{x}_v$ and $\mathbf{h}_i$ .
The AFlow feature matrix $\mathbf{L}$ has the same dimensionality as $\mathbf{X}^{(t)}$. Its feature vectors $\mathbf{l}_v$ are calculated as
\begin{equation}
\mathbf{l}_v = \sum_{i=1}^{8} \mathbf{h}_i \cdot w_{i}.
\end{equation}
$\mathbf{L}$ is then concatenated with $\mathbf{X}^{(t)}$ along the channels dimension and passed through a linear layer followed by a non-linearity to obtain the new feature matrix $\mathbf{H}^{(t)}$.
The weights calculated in AFlow measure the similarity between features at different timesteps. Similar features that move through time correspond to moving objects in 3D space. We visualize in~\reffig{fig:cli_module} the design of the module and the direction between the center feature and the most similar feature at the previous timestep. Further experiments with the directionality are discussed in \refsec{sec:quali_res}.
\subsection{Network Architectures}
\label{sec:arch_architecture}
The recurrent layers and the recurrence positions can be combined arbitrarily.
To distinguish the different architectures, the following notation is used:
The four recurrence layers are separated by a hyphen, e.g. GRU-GRU-AFlow-GRU refers to a network that has a GRU for the early, middle and late fusion and an AFlow module for the bottleneck fusion.
\section{Experiments}
We evaluate our network architectures by calculating the mean Intersection-over-Union (mIoU) on the SemanticKITTI \cite{behley2019semantickitti} dataset. It provides 3D LiDAR-scans from real urban environments and semantic per-point annotations for moving and non-moving classes. We additionally evaluate the impact of the per-point feature matrix $\mathbf{F}$ onto the network: The two possibilities are an empty feature matrix, which forces the network to predict based only on the point positions, and an $\mathbf{F}$ filled with the points' reflectance values.
\subsection{Implementation}
\label{sec:eval_impl}
All lattice operators with forward and backward passes are implemented on the GPU \cite{rosu2019latticenet} and exposed to PyTorch~\cite{paszke2017automatic}. All convolutions are pre-activated using a ReLU unit \cite{he2016identity,huang2017densely}. For the lattice scale $\pmb{\sigma} = 0.6$ was used and the batch size was chosen as 1.
The models were trained using the Adam optimizer \cite{kingma2014adam, adamw} with a learning rate of $0.001$ and a weight decay of \num{e-4}.
The learning rate was reduced by a cosine annealing scheduler \cite{sgdr}. The number of epochs between two restarts was chosen as three since less frequent restarts tended to cause over-fitting.
\subsection{SemanticKITTI Dataset}
\label{sec:experiments}
The SemanticKITTI \cite{behley2019semantickitti} dataset contains semantically annotated LiDAR scans from the KITTI dataset \cite{Geiger2013IJRR}. The annotations are done for a total of 19 different classes in the single scan task and 25 different classes for the multiple scans task. The scans vary in size from 82K to 129K points with a total of 4,549 million points annotated. In addition to the x, y, and z coordinates, the reflectance value for each point is given. We process each scan entirely without any cropping.
The training data is augmented with random rotations around the height-axis, mirroring, translation around the other two axes, and random per-point noise.
\subsection{Generating Predictions}
The hyperparameters sequence length $n$ and cloud scope $s, \text{with } s \in \mathbb{N}$, have to be chosen for the dataset. The sequence length $n$ defines the cardinality of the input for the network and was chosen as $3 \leq n \leq 5$. We observed that $n < 3$ doesn't allow the network to aggregate enough information, while $n > 5$ leads to memory and time constraints. A sequence length of $n = 4$ worked best for our models.
For SemanticKITTI $s = 3$ was chosen, which means that between clouds in the sequence $P$ two clouds in the dataset are skipped.
We've found that using directly consecutive clouds ($s = 1$) can negatively impact the segmentation results since the input clouds are too similar and therefore choose for all our experiments a cloud scope $s=3$.
It is to be noted that during training we need to keep all input clouds in memory in order to perform back-propagation through time, while during inference we evaluate only the cloud at the current time-step since the features from previous time-step are already stored in memory. This recursive formulation yields inference speed that is similar to the original LatticeNet architecture which operated on a single-scan.
\subsection{Quantitative Results}
\label{sec:quant_res}
\bgroup
\def\checkmark{\tikz\fill[scale=0.2](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;}
\newcolumntype{Q}{C{2cm}}
\begin{table}
\vspace*{1mm}
\caption{Results on SemanticKITTI for different versions of our own architecture. The network with the best result is used in \reftab{tab:semanticKitti_comparison} for comparisons.}
\centering
\begin{tabularx}{\columnwidth}{L{4cm}c|Q}
\toprule
Approach & mIoU &with reflectance\\
\midrule
LSTM-LSTM-AFlow-LSTM & 46.7 & \checkmark \\
GRU-GRU-AFlow-AFlow & 46.9 & \checkmark \\
GRU-GRU-AFlow-GRU & \textbf{47.1} & \checkmark\\
GRU-GRU-/-GRU & 44.1 & \checkmark\\
\midrule
GRU-GRU-AFlow-GRU & 42.8 & x\\
LatticeNet-MLP~\cite{rosu2021latticenetauro} & 45.2 & x\\
\bottomrule
\end{tabularx}
\label{tab:semanticKitti_comparison_inside}
\end{table}
\egroup
\bgroup
\newcolumntype{Q}{C{0.19cm}}
\begin{table*}
\scriptsize
\vspace*{1mm}
\caption{State-of-the-art results on SemanticKITTI in comparison to our best performing network.\protect\footnotemark}
\centering
\begin{tabularx}{\textwidth}{L{2.2cm}c|QQQQQQQQQQQQQQQQQQQQQQQQQ}
\toprule
Approach & \begin{sideways}mIoU\end{sideways} & \begin{sideways}car\end{sideways} & \begin{sideways}truck\end{sideways} & \begin{sideways}other-vehicle\end{sideways} & \begin{sideways}person\end{sideways} & \begin{sideways}bicyclist\end{sideways} & \begin{sideways}motorcyclist\end{sideways} & \begin{sideways}road\end{sideways} & \begin{sideways}parking\end{sideways} & \begin{sideways}sidewalk\end{sideways} & \begin{sideways}other-ground\end{sideways} & \begin{sideways}building\end{sideways} & \begin{sideways}fence\end{sideways} & \begin{sideways}vegetation\end{sideways} & \begin{sideways}trunk\end{sideways} & \begin{sideways}terrain\end{sideways} & \begin{sideways}pole\end{sideways}& \begin{sideways}traffic sign\end{sideways}& \begin{sideways}moving-car\end{sideways}& \begin{sideways}moving-bicyclist\end{sideways}& \begin{sideways}moving-person\end{sideways}& \begin{sideways}moving-motorcyclist\end{sideways}& \begin{sideways}moving-other-vehicle\end{sideways}& \begin{sideways}moving-truck\end{sideways}\\
\midrule
TangentConv\cite{tatarchenko2018tangent} & 34.1 & 84.9 &2.0 &18.2 &21.1 &18.5 &1.6 &83.9 &38.3 &64.0 &15.3 &85.8 &49.1 &79.5 &43.2 &56.7 &36.4 &31.2 &40.3 &1.1 &6.4 &1.9 &\textbf{30.1} &\textbf{42.2} \\
DarkNet53Seg\cite{behley2019semantickitti} & 41.6 & 84.1 &30.4 &32.9 &20.2 &20.7 &7.5 &91.6 &\textbf{64.9}&75.3 &\textbf{27.5} &85.2 &56.5 &78.4 &50.7 &64.8 &38.1 &53.3 &61.5 &14.1 &15.2 &0.2 &28.9 &37.8 \\
SpSequenceNet\cite{shi2020spsequencenet} & 43.1 & 88.5 &24.0 &26.2 &29.2 &22.7 &6.3 &90.1 &57.6 &73.9 &27.1 &91.2 &\textbf{66.8} &84.0 &66.0 &65.7 &50.8 &48.7 &53.2 &41.2 &26.2 &36.2 &2.3 &0.1 \\
KPConv\cite{thomas2019KPConv} & \textbf{51.2} & \textbf{93.7}& 44.9& \textbf{47.2}& \textbf{42.5}& \textbf{38.6}& \textbf{21.6}& 86.5& 58.4& 70.5& 26.7& 90.8& 64.5& \textbf{84.6}& \textbf{70.3}& 66.0& 57.0& 53.9& \textbf{69.4}& \textbf{67.4}& \textbf{67.5}& 47.2& 4.7& 5.8 \\
TemporalLidarSeg\cite{duerr2020lidar} & 47.0 & 92.1 &\textbf{47.7}&40.9 &39.2 &35.0 &14.4 &\textbf{91.8}&59.6 &\textbf{75.8} &23.2 &89.8 &63.8 &82.3 &62.5 &64.7 &52.6 &\textbf{60.4} &68.2 &42.8 &40.4 &12.9 &12.4 &2.1 \\
LatticeNet-MLP\cite{rosu2021latticenetauro} & 45.2 & 91.1& 16.8& 25.0& 29.7& 23.1& 6.8& 89.7& 60.5& 72.5& 26.9& \textbf{91.9}& 64.7& 82.9& 65.0& 63.7& 54.7& 47.1& 54.8& 44.6& 49.9& \textbf{64.3}& 0.6& 3.5 \\
\midrule
Ours & 47.1 & 91.6& 35.4& 36.1& 26.9& 23.0& 9.4& 91.5& 59.3& 75.3& \textbf{27.5}& 89.6& 65.3& \textbf{84.6}& 66.7& \textbf{70.4}& \textbf{57.2}& \textbf{60.4}& 59.7& 41.7& 9.4& 48.8& 5.9& 0.0 \\
\bottomrule
\end{tabularx}
\label{tab:semanticKitti_comparison}
\end{table*}
\egroup
We evaluated five different variants of our architectures on the test set of SemanticKITTI and report their resulting mIoU in \reftab{tab:semanticKitti_comparison_inside}.
We observe that the AFlow module resulted in an improved mIoU of 3.0 points, compared to the base-network that only utilizes GRUs. Adding another AFlow layer at the late fusion instead of an GRU resulted in slightly worse results, which can be explained by the lower feature dimension and therefore a lack of comparability in feature space.
Without using the reflectance as input, the result deteriorated significantly.
The reason for this might be that the reflectance is a very useful feature for distinguishing similar feature vectors.
This applies to the other recurrent blocks as well, albeit not as severely.
Additionally, we evaluate the performance of the original LatticeNet~\cite{rosu2019latticenet} on temporal data. For this experiment, we accumulated all clouds of a sequence and used this cloud as input. The results were worse than all comparable temporal networks.
To compare our network's results to the state-of-the-art on SemanticKITTI, we chose the best performing network GRU-GRU-AFlow-GRU. The IoU for all 25 classes are presented in \reftab{tab:semanticKitti_comparison}. We improved performance in relation to our previously published architecture LatticeNet-MLP~\cite{rosu2019latticenet}.
Our best network has outstanding performance in the segmentation of the classes ‘vegetation’, ‘terrain’, ‘pole’, and ‘traffic sign’. An explanation for the results on ‘traffic sign’ and ‘pole’ is that they are only represented by a small number of points and having multiple clouds can help with a better segmentation quality.
Our network's performance is comparable to TemporalLidarSeg~\cite{duerr2020lidar}, but is outperformed by KPConv~\cite{thomas2019KPConv} with a mIoU that is smaller by $4.1$ points. It is to be noted that KPConv~\cite{thomas2019KPConv} cannot process the whole cloud due to memory constraints, but has to rely on fitting multiple spheres into the cloud to ensure that each point is tested multiple times. The final result is then determined by a voting scheme, in contrast to our approach that processes the whole cloud at once with a single prediction.
TemporalLidarSeg~\cite{duerr2020lidar}, on the other hand, relies on the spherical projection of the 3D cloud to perform 2D operations, while our approach is able to utilize the 3D cloud without any projection.
\bgroup
\newcolumntype{M}{L{4cm}}
\newcolumntype{Q}{R{1.0cm}}
\newcolumntype{P}{L{1.0cm}}
\begin{table}
\footnotesize
\caption{Average time used by the forward pass and the maximum memory used during training. }
\centering
\begin{tabularx}{\columnwidth}{M|QP}
\toprule
& \multicolumn{2}{c}{SemanticKITTI} \\
& \multicolumn{1}{r}{$\left[\SI{}{\milli\second}\right]$} & \multicolumn{1}{l}{$\left[\SI{}{\giga\byte}\right]$}\\
\midrule
LSTM-LSTM-AFlow-LSTM & 151\ph&\ph20 \\
GRU-GRU-AFlow-GRU & 154\ph&\ph20 \\
GRU-GRU-AFlow-AFlow & 159\ph&\ph22 \\
GRU-GRU-/-GRU & 140\ph&\ph18 \\
\midrule
KPConv\cite{thomas2019KPConv} & 225\ph&\ph15 \\
SpSequenceNet\cite{shi2020spsequencenet} & 477\ph&\ph3 \\
\bottomrule
\end{tabularx}
\label{tab:perf-results}
\end{table}
\egroup
We present the performance results in \reftab{tab:perf-results}. The measurements were taken on a NVIDIA GeForce RTX 3090 and the inference time was measured on the validation set. Each AFlow module increases the inference time and memory consumption, caused by the high number of weights in the AFlow module and the distance calculation per vertex. We are able to segment the cloud faster than KPConv\cite{thomas2019KPConv}, because we are able to reuse feature matrices from previous segmentations due to our recurrent architecture.
\subsection{Qualitative Results}
\label{sec:quali_res}
\bgroup
\newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}}
\begin{figure}[t]
\centering
\vspace*{3mm}
\includegraphics[width = \linewidth]{Comparison.png}
\caption{In comparison to SpSequenceNet, we are able to better segment stationary~(\crule[car]{8pt}) and moving cars~(\crule[moving-car]{8pt}) in small streets with a high number of cars in the vicinity. SpSequenceNet \cite{shi2020spsequencenet} was the best network that provided pretrained models and was therefore chosen as the comparison. In this example, it is able to better distinguish the road~(\crule[road]{8pt}) from a sidewalk~(\crule[parking]{8pt}).
Unlabeled~(\crule[unlabeled]{8pt}) points are ignored during training.
}
\label{fig:comparison_images}
\end{figure}
\egroup
We present a visual comparison of the segmentation quality of our method with SpSequenceNet in \reffig{fig:comparison_images}.
\bgroup
\newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}}
\begin{figure}
\centering
\includegraphics[width = \linewidth]{CLI.png}
\caption{Visualization of the AFlow module on the segmentation: Birds-eye view of a car at two different time-steps. The correspondence between the car in the previous timestep~(\crule[ph-dark-blue!80]{8pt}) and the current timestep~(\crule[ph-dark-red]{8pt}) is made by the module and therefore the car is correctly segmented as moving-car.}
\label{fig:cli}
\end{figure}
\egroup
In order to analyze the effects of the AFlow model, we mapped the previously mentioned directionality to 3D space in order to show a coarse direction of movement of the 3D objects. Lattice vertices are approximated in 3D by the average of the 3D points that contribute to them. In~\reffig{fig:cli}, we show one car at two different timesteps. For each lattice vertex in 3D, we draw an arrow showing the direction of the most similar feature from the current time towards the previous timestep. We see that for a car driving towards the left, the directionality from AFlow corresponds to the inverse of the driving direction.
\bgroup
\newcommand\crule[2][black]{\textcolor{#1}{\rule[-1.5pt]{#2}{#2}}}
\begin{figure}
\centering
\begin{subfigure}[b]{\linewidth}
\includegraphics[width=\linewidth]{Failure_GT.png}
\vspace*{-6mm}
\caption{Ground truth segmentation.}
\label{fig:gt_failure}
\end{subfigure}
\vspace*{3mm}
\begin{subfigure}[b]{\linewidth}
\includegraphics[width=\linewidth]{Failure.png}
\vspace*{-6mm}
\caption{Predicted segmentation.}
\label{fig:failure}
\end{subfigure}
\caption{Failure case: The prediction fails for the car on the left side, because it is predicted as car~(\crule[car]{8pt}) instead of moving-car~(\crule[moving-car]{8pt}). The reason for this is that the car is waiting at the crossroads for many timesteps.}
\label{fig:failure_prediction}
\end{figure}
\egroup
A failure case of our architecture is moving objects that are waiting/standing still for a duration that exceeds our temporal scope. An example of a car that is waiting at a crossroad is presented in \reffig{fig:failure}. This shouldn't result in problems for an autonomous agent that takes actions based on this segmentation, because the object actually is standing still and is correctly classified as moving once it starts driving again.
\section{Conclusion}
\footnotetext{We only compare to already published approaches.}
We presented an extension to the original LatticeNet~\cite{rosu2019latticenet} for temporal semantic segmentation. We evaluate different recurrence modules and propose a novel Abstract Flow module that better integrates temporal information. On the SemanticKITTI dataset we achieve comparative results with other baselines while running faster and being able to process the full point cloud at once.
\addtolength{\textheight}{-12cm}
\section*{Acknowledgment}
This work has been funded by the German Federal Ministry of Education and Research (BMBF) in the project ”Kompetenzzentrum: Aufbau des Deutschen Rettungsrobotik-Zentrums” (A-DRZ).
\clearpage
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-03-30T02:31:32', 'yymm': '2203', 'arxiv_id': '2203.15469', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15469'} | arxiv |
\section{Introduction}
Continual learning (CL) is a practical learning scenario under a continuous and online stream of annotated data~\cite{lopez2017gem, prabhu2020gdumb, bang2021rainbow}.
Due to continuously changing data distribution, the CL methods are known to suffer from the stability-plasticity dilemma due to catastrophic interference and resistance to learning new information~\cite{mccloskey1989catastrophic,goodfellow2013empirical}.
In addition, when the CL model is deployed in real-world such as e-commerce applications, the annotated labels are often unreliable due to less controlled data curation process, \eg, crowd-sourcing~\cite{xu2021improving}.
Although data labels are likely to be contaminated in real-world due to human errors, existing CL studies have largely assumed that the given training data has no annotation error~\cite{kirkpatrick2017ewc, prabhu2020gdumb}, which might hinder practical usages of many CL methods in real-world applications.
A very recent work~\cite{kim2021continual_spr} relaxes this assumption by proposing an online CL setup under data stream with less reliable labels.
However, they assume a disjoint class incremental scenario such that there is no class overlapping between task streams, which is argued as {less} practical for real-world applications in the literature~\cite{prabhu2020gdumb,bang2021rainbow}.
To step forward in addressing continuously changing data distribution that can be falsely labeled, we first design a novel CL task of \textit{online continual learning on a contaminated data stream on blurry task boundaries~\cite{prabhu2020gdumb}} as a more realistic and practical continual learning scenario.
Sample selection strategy is arguably important for episodic memory-based CL methods \cite{kirkpatrick2017ewc, prabhu2020gdumb, bang2021rainbow, aljundi2019online, kim2021continual_spr}.
Specifically, diversity-aware sample selection policy is shown to be effective in the online blurry CL scenarios~\cite{bang2021rainbow}.
However, on the contaminated data stream, diversity-based memory construction may promote to include many examples with corrupted labels in the episodic memory, leading to poor performance thanks to very high capacity of deep models to overly fit all the falsely labeled examples~\cite{zhang2021understanding}.
To address this issue, we propose a unified framework of memory sampling policy with robust learning with the episodic memory and semi-supervised learning with unreliable data, named \textbf{PuriDivER\xspace} (\underline{Puri}ty and \underline{Div}ersity aware \underline{E}pisode \underline{R}eplay\xspace).
Fig.~\ref{fig:overview} illustrates an overview of the proposed method to address the new CL task set-up.
\begin{figure*}[t!]
\centering
\includegraphics[width=0.75\textwidth]{figures/overview_cvpr22.pdf}
\vspace*{-0.1cm}
\caption{Overview of PuriDivER\xspace for the online blurry continual learning with noisy labels, where all the tasks share classes (\ie, blurry tasks~\cite{prabhu2020gdumb}) and examples might be falsely labeled. PuriDivER\xspace updates episodic memory by balancing examples' diversity and purity, and unifies a robust training scheme based on semi-supervised learning not to be interfered by unreliable labels in the episodic memory.
}
\label{fig:overview}
\vspace{-1em}
\end{figure*}
Specifically, for the memory sampling policy, we propose to construct a robust episodic memory that preserves a set of training examples that are \emph{diverse} and \emph{pure}.
Unfortunately, maintaining the information diversity and purity is in \emph{trade-off}; clean examples mostly exhibit smaller losses (less diverse) than noise examples due to the memorization effect of deep neural networks~\cite{arpit2017closer, song2021robust}.
Thus, emphasizing purity in memory sampling does not promote sample diversity and \emph{vice versa}. %
To address the dilemma, we define a score function of promoting the label purity with an additional term to promote diversity by optimizing the sample distribution to be similar to the one with noisy examples. %
In addition, we incorporate a novel robust learning scheme to further promote both purity and diversity when we use the samples from the episodic memory (Sec.~\ref{sec:sub:robustlearning}).
Thus, we enforce high diversity and purity around the memory twice; by its construction and usage.
Our empirical validations show that the proposed method outperforms combinations of prior arts to address the combined challenges by noticeable margins on multiple evaluations using CIFAR-10/100, WebVision and Food-101N.
Our contributions are summarized as follows:
\vspace{-0.5em}
\begin{itemize}[leftmargin=10pt]
\setlength\itemsep{-0.5em}
\item Proposing the first online \emph{blurry} CL set-up with contaminated data stream, which is realistic and challenging, and establishing a strong baseline for it.
\item Proposing a unified framework of considering diversity and purity in memory updates and usage strategy.
\item Proposing an adaptive balancing scheme for dynamic trade-off between diversity and purity in memory sampling for addressing various noise ratio in CL.
\item Proposing a semi-supervised robust learning scheme with label cleaned up samples and unreliable samples regarded as unlabeled samples.
%
\end{itemize}
\section{Related Work}
\label{sec:related_work}
There is a large body of literature to address the two challenges of online CL and learning from noisy data, separately.
Here, we selectively review the most relevant ones.
\subsection{Task-free Blurry Online Continual Learning}
Recent studies~\cite{bang2021rainbow,prabhu2020gdumb,aljundi2019gss} argue that the disjoint CL setup is less realistic but prevalent in literature and propose a new setup where task boundaries share classes, called `blurry'.
While the disjoint setup assumes each task has non-overlapping classes, the blurry setup allows that all tasks possibly share the same set of classes with different class distributions.
Moreover, we categorize CL methods by the way of using the data; online and offline.
Offline setup allows a model to use data many times, while online setup only allows a model to observe a data stream once at the current moment, which is more difficult but practical. %
Task-free setup refers to the setup that does not allow the access of task id at inference.
There have been many studies on task-free online continual learning (either blurry or disjoint), which are categorized into two; \textit{1) rehearsal-based approaches}~\cite{bang2021rainbow,prabhu2020gdumb,riemer2018learning}, where episodic memory is used to store a few examples of old tasks, and \textit{2) regularization-based approaches}~\cite{kirkpatrick2017ewc,rwalk}, which regularizes neural network parameters from drastic updates for new information to preserve the information of old tasks for less forgetting.
Since rehearsal-based approaches generally outperform the regularization ones, we use it. %
For better rehearsal with an episodic memory, many strategies have been proposed for data sampling.
Unfortunately, most of them are not suitable for the online continual learning setup except the following few.
MER~\cite{riemer2018learning} applied \textit{reservoir sampling} for updating memory in online continual learning, and it can approximately optimize over the stationary distribution of all seen examples. GDumb~\cite{prabhu2020gdumb} proposed the \textit{greedy balancing sampler} such that it focuses on balancing the number of examples for each class.
\textit{Rainbow memory}~\cite{bang2021rainbow} and OCS~\cite{yoon2021online} are proposed to diversified sampling by regular interval of uncertainty and constructing a `Core-Set'~\cite{sener2018coreset}, respectively.
However, proposed methods assume reliable labels only.
\subsection{Learning with Unreliable Labels}
A number of approaches have been proposed to prevent a model from overfitting to unreliable or noisy labels.
One of the typical methods is `sample selection', which trains the model for selected small-loss examples whose labels are likely to be correct. MentorNet~\cite{jiang2018mentornet} maintains a teacher network to provide the student network with the small-loss examples. Similarly, Co-teaching(+) \cite{han2018coteaching, yu2019coteachingplus} utilizes two models, where each model selects a certain number of small-loss examples and feeds them to its peer model for training.
Alternatively, `re-labeling' corrects noisy labels to reliable ones. SELFIE \cite{song2019selfie} re-labels the examples by predicted labels' consistency. SEAL \cite{chen2021seal} averages the model's softmax output of each example over the whole training set.
Although they utilize the entire data, when the number of classes or noise rate increases, a risk of overfitting to false labels still persists due to possible false correction. %
To address this, there have been efforts to combine `semi-supervised learning' with `sample selection.'
SELF \cite{nguyen2019self} progressively filters out falsely labeled examples from noisy data by using self-ensemble predictions. DivideMix \cite{berthelot2019mixmatch} fits bi-modal univariate Gaussian mixture models\,(GMMs) to the loss of training examples for sample selection, and then applied the MixMatch algorithm \cite{li2019dividemix}.
However, this family of robust methods assumes the offline setup with sufficient amount of training data whereas the training data is limited in the blurry online continual learning setup.
\subsection{Continual Learning with Unreliable Labels}
A straightforward approach for CL with unreliable labels is combining a memory sampling method for online learning with a robust learning method for handling the unreliable labels.
However, this naive integration may not resolve the combined challenge because of aforementioned trade-off between diversity and purity of the examples.
Recently, SPR~\cite{kim2021continual_spr} is proposed to solve online continual learning with contaminated data via self-purifying scheme.
However, the experiments are only conducted on disjoint setup that is less realistic, and there are large rooms to improve in accuracy even in that setup (see Sec. 5 in the supplementary material).
In contrast, we approach this problem by constructing the episodic memory with high diversity and purity, and mitigate the potential risk of memory sampling by using a complementary robust learning approach (see Tab.~\ref{tab:dpm_ablation}) in more realistic CL scenario.
\section{Task Definition}
\label{sub:problem}
We design a new online CL setup that is on a contaminated data stream with \emph{blurry} task boundaries following \cite{bang2021rainbow}.
Let $C$ and $T$ be the number of classes and tasks, respectively.
At each task $t$, the set of classes are split into a set of \emph{major classes}, $M_t$ and a set of \emph{minor classes}, $m_t$.
For describing the imbalanced degree of major and minor classes, we define the hyperparameter ($L$) as the number of minor classes over the number of all the classes, and those tasks are called \textit{blurry-$L$}.
Each class could be either a major class once in a certain task or a minor class in the other tasks.
Formally, tasks should satisfy the following conditions:
\vspace{-0.5em}
\begin{equation}
\begin{split}
& \cup_{t=1}^{T} M_t = \cap_{t=1}^{T} M_t \cup m_t = \{1, \dots ,C\}, \\
& \cup_{i, j = 1, i \neq j}^{T}M_i \cap M_j = \varnothing.
\vspace{-1em}
\end{split}
\end{equation}
To configure blurry tasks, we split the streaming data $\mathcal{S}_t$ for the task $t$ into subsets of different classes; $\mathcal{S}_t = \{\mathcal{S}_{(t, c)} : c \in \{1, \dots ,C\} \}$.
For a given task $t$, $L = |\cup_{c \in m_t} \mathcal{S}_{(t, c)}| / |\mathcal{S}_t|$, where $L$ is the specified class imbalance ratio at task $t$.
In particular, in the presence of noisy labels, the streaming data {\small$\mathcal{S}_t$} for a task $t$ include falsely labeled examples, thus {\small $\mathcal{S}_t=\{(x_i, \tilde{y_i})\}_{i=1}^{|\mathcal{S}_t|}$} where $x_i$ is an example and $\tilde{y_i}$ is its noisy label which may be different from the true (\ie, not contaminated) label $y_i$.
\section{Pure and Diverse Episode Replay}
To address the online blurry continual learning with unreliable labels, we propose a method to construct and use the episodic memory.
Specifically, we propose (1) a sampling method `diverse' exemplars from the online stream for episodic memory with label purifying scheme (Sec. \ref{sub:memory_update}), and (2) to use the `purified' diverse examples from the memory by semi-supervised learning with noisy labels for extra diversity with purity (Sec. \ref{sec:sub:robustlearning}).
We call this method Purity and Diversity aware Episode Replay\xspace (\textbf{PuriDivER\xspace}).
We describe a brief version of algorithm in Alg.~\ref{alg:abstract} and detailed version in the supplementary material (Sec. 1).
\setlength{\textfloatsep}{7pt}%
\begin{algorithm}[t]
\small
\caption{Purity and Diversity aware Episode Replay\xspace}
\label{alg:abstract}
\begin{algorithmic}[1]
\State {\textbf{Input:} $\mathcal{S}_{t}$: stream data at task $t$, $\mathcal{M}$: exemplars stored in a episodic memory, $T$: the number of tasks, $\theta_0$: initial model.}
\For {$t$ = 1 {\bf to} T}
\For {each mini-batch $\mathcal{B} \in \mathcal{S}_{t}$}
%
\State{$\theta \leftarrow \theta - \alpha \nabla \sum_{i \in \mathcal{B}} \ell(\theta(x_i), \tilde{y_i})$} {\small\color{orange}\Comment{online training}}
%
\For {$x_i, \tilde{y_i}$ in $\mathcal{B}$}
\State{Update $\mathcal{M}$ from $\mathcal{M} \cup (x_i, \tilde{y_i})$}{\small\color{orange}\Comment{Sec.~\ref{sub:memory_update}}}
%
\EndFor
\EndFor
\For {$e=1$ {\bf to} MaxEpoch}
\State{Split $\mathcal{C}$, $\mathcal{R}$, $\mathcal{U}$ from $\mathcal{M}$ via Eqs.~\eqref{eq:gmm_loss} and \eqref{eq:uncertainty_loss}}
\For {each mini-batch $\mathcal{B_C} \in \mathcal{C}$, $\mathcal{B_R} \in \mathcal{R}$, $\mathcal{B_U} \in \mathcal{U}$ }
%
%
\State{$\theta \leftarrow \theta - \alpha \nabla [\ell_{cls} + \eta \ell_{reg}$]}{\small\color{orange}\Comment{Sec.~\ref{sec:sub:robustlearning}}}
\EndFor
\EndFor
%
%
%
%
\EndFor
\end{algorithmic}
\end{algorithm}
\subsection{Episodic Memory Construction}
\label{sub:memory_update}
Selecting a diverse set of examples for the episodic memory is arguably one of the beneficial steps to improve accuracy of CL model~\cite{bang2021rainbow}.
Since labels are unreliable in our setup, however, this approach would expedite overfitting to falsely labeled examples because they are likely regarded as the ones that are highly diverse thus included in the memory and used in training.
On the other hand, to address purity, we may use a small-loss trick for purity aware sampling, but it only selects the examples with low diversity.
Thus, the diversity and purity are in trade-off.
To address the dilemma, we define a sampling score function that considers both aspects for the episodic memory, and it is lower the better.
Specifically, the proposed score function consists of two factors; (1) purity of an example by assuming that the `small-loss examples' are likely correctly labeled, and (2) the similarity in representation space between the `relevant representation' of the sample to all other samples with the same noisy label in the memory for diversity. %
The representation vector is defined as:
\begin{definition}
\label{definition_relevant}
Let {$f(x_i) \in \mathbbm{R}^n$} be the representation vector of an example $x_i$, where $f(\cdot)$ be a representation learner. A \textbf{relevant representation} {$f_{rel}(x_i; j)$} for a class $j$ is defined as a subset of elements {$e (\in f(x_i)$)} such that {\small $f_{rel}(x_i; j)=\{ e \in f(x_i) ~|~ w{(e,j)} > \frac{1}{|C|} \sum_{c=1}^{C}w{(e,c)}\}$}, where {$w{(e,c)}$} is a weight parameter of the classification FC layer associated with the element $e$, its inputs to the FC layer, and class $j$.
\label{def:relevant_feature}
\end{definition}
Formally, we define and use the score function of an example $x_i$ to select samples, considering both the purity and diversity with its noisy label $\tilde{y_i}$ as:
\begin{equation}
\small
\label{eq:score}
\begin{aligned}
S(&x_i, \tilde{y_i}) = (1-\alpha_k) \overbrace{\ell\big(x_i, \tilde{y_i} \big)}^{\text{purity}} \\
& + \alpha_k \overbrace{ \frac{1}{\big|\mathcal{M}[\tilde{y_i}]\big|} \sum_{ \hat{x_i} \in \mathcal{M}[\tilde{y_i}]}{\rm cos}\big(f_{rel}(x_i; \tilde{y_i}), f_{rel}(\hat{x_i}; \tilde{y_i})\big)}^{\text{diversity}},
\end{aligned}
\end{equation}
where $\mathcal{M}$ is the episodic memory at the current moment, $k$ is minibatch index to which $x_i$ is belong and $\mathcal{M}[\tilde{y_i}]$ is a set of examples annotated as $\tilde{y_i}$ in the memory.
We use the cosine similarity (\ie, $\cos(\cdot, \cdot)$) to measure the similarity between two representations.
$\alpha_k$ is the balancing coefficient of diversity and purity.
When the score is high, the sample is more likely corrupted in label and does not contribute to diversity much.
Specifically, the high value of the first term (for purity) implies that $\tilde{y_i}$ can be a corrupted label with high probability.
The high value of the second term (for diversity) implies that the examples annotated with $\tilde{y_i}$ in the memory are similar to $x_i$, which can have less impact to train the model.
By the computed score, we update the memory by dropping a single example with the highest score when we add a new sample from the data stream.
Finding a proper $\alpha_k$ is another non trivial issue. %
\vspace{-1em}
\paragraph{Adaptive Balancing Coefficient.}
We argue that the optimal balancing coefficient $\alpha_k$ could vary depending on the label noisiness or learning difficulty of each example\,(Sec.~\ref{sec:coefficent} for empirical analysis).
To make the algorithm adaptive to learning difficulty and noisiness of an example, we additionally propose an adaptive $\alpha_k$. %
As argued in curriculum learning literature~\cite{bengio2009curriculum,graves2017automated}, easy or clean examples are favored in the early stage of training of a model.
Similarly, we conjecture that diverse examples are more important at the later stage of training for better generalization.
To implement this idea that implicitly considers learning difficulty and noise ratio, we propose an adaptive balancing coefficient for a $k^{th}$ minibatch based on the example's training loss that is a proxy of label noisiness and learning difficulty (\ie, if loss is large, learning that sample is difficult) as:
\begin{equation}
\alpha_k = 0.5 \cdot \min \left( 1 / {\ell(\mathbf{X}_k,\mathbf{\tilde{Y}}_k)}, 1 \right),
\end{equation}
where $\ell(\mathbf{X}_k,\mathbf{\tilde{Y}}_k)$ is the average loss for all examples in the $k^{th}$ batch.
We empirically validate its effectiveness in Sec.~\ref{sec:coefficent}.
\subsection{Episodic Memory Usage}
\label{sec:sub:robustlearning}
Even with the memory of diverse and expectedly pure samples, the episodic memory may include noisy examples, since the label corrupted examples are mostly one with high diversity. %
However, due to the small size of the episodic memory, robust learning with the memory does not bring significant accuracy improvement.
Here, we propose a hybrid learning scheme that combines re-labeling and unsupervised learning with unreliably labeled examples.
Specifically, we first split the examples in the episodic memory into clean and noisy subsets based on the small-loss trick that is widely used when handling noisy labels~\cite{li2019dividemix, arazo2019betamixture}.
We then fit a GMM to the training loss of all examples in the memory such that it estimates the probability of an example being $p_G(\cdot)$~\cite{li2019dividemix}.
Given a noisy example $x_i$ with its unreliable label $\tilde{y_i}$, we obtain probability of label purity by the posterior probability of GMMs as:
\begin{equation}
p_{G}\big(g | \ell(x_i, \tilde{y_i}; \Theta)\big) = \frac{p_{G}\left(\ell(x_i, \tilde{y_i};\Theta) | g \right) \cdot p_{G}(g)}{p_{G}\left(\ell(x_i, \tilde{y_i}; \Theta) \right)},
\end{equation}
where $g$ denotes a Gaussian modality for the small-loss examples, $\Theta$ denotes weight parameters of the model, $\ell(x_i,\tilde{y_i};\Theta) = - \log(p_{m} (x_i, \tilde{y_i}; \Theta))$ and $p_{m}(x_i, c)$ is the softmax output of the model for class $c$.
We finally obtain the clean set $\mathcal{C}$ and noisy set $\mathcal{N}$ as:
\begin{equation}
\begin{gathered}
\mathcal{C} := \big\{ (x_i, \tilde{y_i}) \!\in\! \mathcal{M} : p_{G}\big(g | \ell(x_i, \tilde{y_i}; \Theta)\big) \!\geq \!0.5\big\}, \\
\mathcal{N} := \big\{ (x_i, \tilde{y_i})\! \in\! \mathcal{M} : p_{G}\big(g | \ell(x_i, \tilde{y_i}; \Theta)\big) \!< \!0.5\big\}.
\label{eq:gmm_loss}
\end{gathered}
\end{equation}
In modern approaches of handling noisy labels~ \cite{han2018coteaching, yu2019coteachingplus, song2021robust}, only the clean set is used to train the model in a supervised manner, while the noisy set is discarded for robust learning.
However, in continual learning, as an episodic memory only contains a few number of samples, we need to utilize as many samples as possible, instead of discarding any.
A straightforward way of using them is to purify them.
However, considering that the memory contains samples with various classification confidences (\ie, logit values of a model), if we use the low confidence examples for re-labeling, they are likely incorrectly re-labeled (\ie, purified) due to the perceptual consistency of a neural net.~\cite{reed2015bootstrap}.
To address this issue, we further split the noisy set into two subsets; one with high confidence to be re-labeled and the other with low confidence to be used for unsupervised learning.
Then, we re-label the former but consider the latter as an unlabeled examples and employ the unsupervised learning; specifically, we use `consistency regularization.'
In particular, to split the noise set into the two sets, we define \emph{predictive uncertainty} as:
\begin{equation}
\label{eq:uncertainty}
{\rm U}(x_i) = 1.0 - \max_{c} \big(p_{m}(x_i, c; \Theta)\big),
\end{equation}
where $c \in \{1, \dots ,C\}$.
According to our empirical analysis (see Fig.~\ref{fig:validity_gmm_fitting}-(b)), the uncertainty of the two sets follows \emph{bi-modal} distributions similar to the loss distribution of clean and noise examples. To distinguish two modalities without knowing ground-truth labels,
we again fit a GMM to the uncertainty of the (expected) noisy examples in the noise set $\mathcal{N}$.
Similar to Eq.~\ref{eq:gmm_loss}, we split the noise set into the `re-labeling set' ($\mathcal{R}$) and the `unlabeled set' ($\mathcal{U}$) as:
\begin{align}
&\mathcal{R} := \big\{ (x_i, \tilde{y_i}) \!\in\! \mathcal{N} : p_{G}\big(u | {\rm U}(x_i)\big)\big) \!\geq \!0.5\big\} \nonumber, \\
&\mathcal{U} := \big\{ (x_i, \tilde{y_i})\! \in\! \mathcal{N} : p_{G}\big(u | {\rm U}(x_i)\big) \!< \!0.5\big\},
\label{eq:uncertainty_loss}
\end{align}
where $u$ is the Guassian component for the low-uncertainty examples.
Since the examples with high uncertainty are difficult to estimate the true label, we treat them as the unlabeled set instead to prevent false supervision~\cite{rizve2020uncertainty_aware}.
\vspace{-1em}\paragraph{Re-labeling on $\mathcal{R}$.}
We refurbish the example with low uncertainty (\ie, high confidence) by the convex combination of its given noisy label $\tilde{y_i}$ and the model's prediction $p_{m}(x_i)$, whose coefficient is its confidence, \ie, the posterior probability of the mixture component $u$ as:
\begin{equation}
\label{eq:relabel}
\hat{y_i} = p_{G}(u | {\rm U}(x_i)) \cdot p_{m}(x_i) + \big(1.0-p_{G}(u | {\rm U}(x_i))\big) \cdot \tilde{y_i}.
\end{equation}
Employing a soft re-labeling approach to progressively refine the given noisy label based on the model's prediction evolving during training, we mitigate the overfitting to incorrectly modified labels at the beginning of training.
Hence, the training loss for the clean set ($\mathcal{C}$) and re-labeling set ($\mathcal{R}$) is formulated with their label supervision as:
\begin{equation}
\!\!\ell_{cls} = \frac{1}{|\mathcal{C} \cup \mathcal{R}|} \cdot (\!\!\!\!\!\sum_{(x_i, \tilde{y}_i) \in \mathcal{C}} \!\!\!\!\!\ell(x_i, \tilde{y}_i; \Theta) + \!\!\!\!\!\!\sum_{(x_j, \hat{y}_j) \in \mathcal{R}}\!\!\!\!\!\ell(x_j, \hat{y}_j; \Theta)\big).\!
\end{equation}
\vspace{-1em}
\paragraph{Semi-supervised Learning with $\mathcal{U}$.}
We finally learn information from less confident samples in $\mathcal{U}$.
As their labels are very unreliable, relabeling might not correct them.
Thus, we consider them as unlabeled data and use consistency regularization, which is widely used in the semi-supervised learning literature\,\cite{berthelot2019mixmatch, tarvainen2017mean}.
It helps learn useful knowledge from the examples without their labels by penalizing the prediction difference between the two examples transformed from the same one as:
\begin{equation}
\label{eq:ssl}
\ell_{reg} = \frac{1}{|\mathcal{U}|} \sum_{x_i \in \mathcal{U}} \big|\big|p_{m}\big(s(x_i);\Theta\big) - p_{m}\big(w(x_i);\Theta\big)\big|\big|_2,
\end{equation}
where $s(\cdot)$ and $w(\cdot)$ are strong and weak augmentation functions for an example $x_i$.
We use AutoAugment\,\cite{cubuk2019autoaugment} as $s(\cdot)$ and random horizontal flipping as $w(\cdot)$.
Thus, our final loss function on the three meticulously designed subsets, namely a clean set $\mathcal{C}$, a re-labeled set $\mathcal{R}$, an unlabeled set $\mathcal{U}$, and $\mathcal{M}=\mathcal{C} \cup \mathcal{R} \cup \mathcal{U}$, can be written as:
\begin{equation}
\label{eq:final}
\ell(\mathcal{M}) = \ell_{cls}(\mathcal{C} \cup \mathcal{R}) + \eta \cdot \ell_{reg}(\mathcal{U}).
\end{equation}
\section{Experiments}
\subsection{Experimental Set-up}
\label{sec:exp_setup}
\paragraph{Datasets.}
We empirically validate our PuriDivER\xspace on image classification tasks on the blurry CL setups~\cite{bang2021rainbow} with corrupted labels.
We use CIFAR-10, CIFAR-100\,\cite{cifar}, a real-world noisy data of large-scale crawled food images; Food-101N~\cite{lee2018cleannet_food101n}, and a subset of real-world noisy data consisting of large-scale web images whose classes are same as ImageNet~\cite{deng2009imagenet}; WebVision~\cite{li2017webvision}.
\vspace{-1em}\paragraph{Noisy Label Set-ups.}
Following~\cite{li2019dividemix, han2018coteaching, yu2019coteachingplus, song2019selfie}, we inject two types of synthetic noise that is widely used in the literature to emulate noisy label in CIFAR-10/100; namely symmetric\,(SYM) and asymmetric\,(ASYM) label noise.
Symmetric noise flips the ground-truth (GND) label into other possible labels with equal probability, while asymmetric noise flips the GND into one with high probability.
For thorough evaluations, we adjust the ratio of label noise from 20\% to 60\%.
We use the real label noise in Food-101N and WebVision datasets.
According to \cite{song2020learning}, estimated noise ratio of both datasets are $20.0\%$.
We provide the detailed experimental configurations for online CL with noisy labels in the supplementary material (Sec. 2).
\begin{comment}
\begin{table*}[t]
\centering
\caption{Last test accuracy on CIFAR-10 (K=500) and CIFAR-100 (K=2,000) with SYM-\{20\%, 40\%, 60\%\} and ASYM-\{20\%. 40\%\}, WebVision (K=1,000) and Food-101N (K=2,000), where $K$ denotes size of episodic memory.}
\label{tab:cifar_result}
\resizebox{1.0\linewidth}{!}{%
\begin{tabular}{@{}lrrrrrrrrrrrr@{}}
\toprule
& \multicolumn{5}{c}{CIFAR-10} & \multicolumn{5}{c}{CIFAR-100} & \multicolumn{1}{c}{WebVision} & \multicolumn{1}{c}{Food-101N}\\
\cmidrule(lr){2-6} \cmidrule(lr){7-11} \cmidrule(lr){12-12} \cmidrule(lr){13-13}
{Methods}& \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} & \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} &\\
& %
\multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} &
\multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{Real} & \multicolumn{1}{c}{Real} \\
\cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-9} \cmidrule(lr){10-11} \cmidrule(lr){12-12} \cmidrule(lr){13-13}
RSV~\cite{riemer2018learning} & 54.5 \footnotesize{$\pm$ 2.1} & 39.2 \footnotesize{$\pm$ 0.9} & 28.7 \footnotesize{$\pm$ 0.4} & 53.6 \footnotesize{$\pm$ 1.6} & 40.0 \footnotesize{$\pm$ 1.2}
& 29.4 \footnotesize{$\pm$ 0.1} & 19.3 \footnotesize{$\pm$ 1.2} & 10.5 \footnotesize{$\pm$ 0.4} & 29.8 \footnotesize{$\pm$ 0.8} & 20.3 \footnotesize{$\pm$ 1.0} & 18.4 \footnotesize{$\pm$ 0.8} & 11.6 \footnotesize{$\pm$ 1.0} \\
~~ $+$ SELFIE~\cite{song2019selfie} & 54.5 \footnotesize{$\pm$ 1.7} & 39.2 \footnotesize{$\pm$ 1.1}& 28.8 \footnotesize{$\pm$ 2.9} & 51.8 \footnotesize{$\pm$ 4.1} & 40.4 \footnotesize{$\pm$ 1.4}
& 28.9 \footnotesize{$\pm$ 0.4} & 19.5 \footnotesize{$\pm$ 1.5} & 10.5 \footnotesize{$\pm$ 0.4} & 29.8 \footnotesize{$\pm$ 0.9} & 20.1 \footnotesize{$\pm$ 1.2} & 19.1 \footnotesize{$\pm$ 0.4} & 11.1 \footnotesize{$\pm$ 1.3}\\
~~ $+$ Co-teaching~\cite{han2018coteaching} & 56.1 \footnotesize{$\pm$ 2.3}& 39.8 \footnotesize{$\pm$ 4.4} & 30.5 \footnotesize{$\pm$ 3.6} & 53.5 \footnotesize{$\pm$ 2.9} & 38.7 \footnotesize{$\pm$ 1.3}
& 30.4 \footnotesize{$\pm$ 0.3} & 22.0 \footnotesize{$\pm$ 1.2} & 13.3 \footnotesize{$\pm$ 0.3} & 30.8 \footnotesize{$\pm$ 1.4} & 20.3 \footnotesize{$\pm$ 0.6} & 16.5 \footnotesize{$\pm$ 0.3} & 11.3 \footnotesize{$\pm$ 1.0}\\
~~ $+$ DivideMix~\cite{li2019dividemix} & 56.1 \footnotesize{$\pm$ 1.3} & 43.7 \footnotesize{$\pm$ 0.3} & 35.1 \footnotesize{$\pm$ 1.9} & 56.1 \footnotesize{$\pm$ 0.6} & 38.9 \footnotesize{$\pm$ 2.5}
& 30.5 \footnotesize{$\pm$ 0.7} & 23.1 \footnotesize{$\pm$ 1.6} & 13.1 \footnotesize{$\pm$ 0.5} & 30.2 \footnotesize{$\pm$ 0.5} & 20.1 \footnotesize{$\pm$ 0.7} & 11.7 \footnotesize{$\pm$ 1.1} & 7.3 \footnotesize{$\pm$ 0.4}\\
\cmidrule(lr){1-13}
GBS~\cite{prabhu2020gdumb} & 54.8 \footnotesize{$\pm$ 1.2} & 41.8 \footnotesize{$\pm$ 0.9} & 27.3 \footnotesize{$\pm$ 2.1} & 54.2 \footnotesize{$\pm$ 1.7} & 40.4 \footnotesize{$\pm$ 1.1}
& 28.0 \footnotesize{$\pm$ 0.2} & 18.8 \footnotesize{$\pm$ 1.7} & 10.2 \footnotesize{$\pm$ 0.8} & 29.5 \footnotesize{$\pm$ 0.9} & 20.3 \footnotesize{$\pm$ 0.5} & 20.3 \footnotesize{$\pm$ 2.1} & 10.5 \footnotesize{$\pm$ 0.4} \\
~~ $+$ SELFIE~\cite{song2019selfie} & 55.4 \footnotesize{$\pm$ 0.8} & 41.6 \footnotesize{$\pm$ 0.3} & 27.8 \footnotesize{$\pm$ 1.8} & 51.3 \footnotesize{$\pm$ 4.7} & 40.7 \footnotesize{$\pm$ 0.9}
& 28.0 \footnotesize{$\pm$ 0.6} & 18.4 \footnotesize{$\pm$ 1.9} & 9.9 \footnotesize{$\pm$ 0.7} & 29.6 \footnotesize{$\pm$ 0.9} & 19.8 \footnotesize{$\pm$ 0.6} & 20.0 \footnotesize{$\pm$ 2.1} & 10.4 \footnotesize{$\pm$ 0.3}\\
~~ $+$ Co-teaching~\cite{han2018coteaching} & 55.1 \footnotesize{$\pm$ 0.9} & 42.7 \footnotesize{$\pm$ 0.9} & 31.4 \footnotesize{$\pm$ 3.6} & 54.0 \footnotesize{$\pm$ 0.9} & 39.5 \footnotesize{$\pm$ 1.3}
& 29.5 \footnotesize{$\pm$ 0.7} & 20.9 \footnotesize{$\pm$ 1.3} & 12.8 \footnotesize{$\pm$ 1.5} & 29.0 \footnotesize{$\pm$ 1.6} & 20.5 \footnotesize{$\pm$ 1.3} & 17.8 \footnotesize{$\pm$ 1.8} & 10.5 \footnotesize{$\pm$ 0.2}\\
~~ $+$ DivideMix~\cite{li2019dividemix} & 57.8 \footnotesize{$\pm$ 1.9} & 48.8 \footnotesize{$\pm$ 1.9} & 34.3 \footnotesize{$\pm$ 1.3} & 57.4 \footnotesize{$\pm$ 0.6} & 44.6 \footnotesize{$\pm$ 5.5}
& 29.6 \footnotesize{$\pm$ 0.8} & 21.4 \footnotesize{$\pm$ 1.1} & 13.2 \footnotesize{$\pm$ 0.2} & 28.7 \footnotesize{$\pm$ 0.7} & 19.6 \footnotesize{$\pm$ 1.1} & 14.0 \footnotesize{$\pm$ 0.6} & 6.9
\footnotesize{$\pm$ 0.1}\\
\cmidrule(lr){1-13}
RM~\cite{bang2021rainbow} & 57.1 \footnotesize{$\pm$ 0.1} & 46.5 \footnotesize{$\pm$ 2.6} & 33.5 \footnotesize{$\pm$ 3.0} & 58.3 \footnotesize{$\pm$ 2.6} & 46.2 \footnotesize{$\pm$ 1.9} & 31.7 \footnotesize{$\pm$ 1.3} & 23.9 \footnotesize{$\pm$ 0.9} & 14.2 \footnotesize{$\pm$ 0.4} & 32.0 \footnotesize{$\pm$ 1.0} & 21.6 \footnotesize{$\pm$ 1.2} & - & - \\
~~ $+$ SELFIE~\cite{song2019selfie} & 56.8 \footnotesize{$\pm$ 1.3} & 44.8 \footnotesize{$\pm$ 0.6} & 31.8 \footnotesize{$\pm$ 4.4} & 57.9 \footnotesize{$\pm$ 1.5} & 46.9 \footnotesize{$\pm$ 1.9} & 32.1 \footnotesize{$\pm$ 0.8} & 22.1 \footnotesize{$\pm$ 1.0} & 12.4 \footnotesize{$\pm$ 0.7} & 31.7 \footnotesize{$\pm$ 0.4} & 20.9 \footnotesize{$\pm$ 0.9} & - & -\\
~~ $+$ Co-teaching~\cite{han2018coteaching} & 57.5 \footnotesize{$\pm$ 1.8} & 47.6 \footnotesize{$\pm$ 0.7} & 35.1 \footnotesize{$\pm$ 2.0} & 58.5 \footnotesize{$\pm$ 1.5} & 45.9 \footnotesize{$\pm$ 2.0} & 31.9 \footnotesize{$\pm$ 0.9} & 22.8 \footnotesize{$\pm$ 0.5} & 14.4 \footnotesize{$\pm$ 0.2} & 32.4 \footnotesize{$\pm$ 0.4} & 21.3 \footnotesize{$\pm$ 1.1} & - & -\\
~~ $+$ DivideMix~\cite{li2019dividemix} & 61.3 \footnotesize{$\pm$ 0.8} & 50.9 \footnotesize{$\pm$ 3.3} & 34.9 \footnotesize{$\pm$ 3.1} & 60.6 \footnotesize{$\pm$ 1.7} & 46.4 \footnotesize{$\pm$ 5.1} & 31.2 \footnotesize{$\pm$ 0.7} & 23.4 \footnotesize{$\pm$ 0.9} & 14.8 \footnotesize{$\pm$ 0.8} & 30.6 \footnotesize{$\pm$ 0.3} & 21.1 \footnotesize{$\pm$ 0.6} \\
\cmidrule(lr){1-13}
\textbf{PuriDivER\xspace} (ours) & \textbf{61.3 \footnotesize{$\pm$ 2.1}} & \textbf{59.2 \footnotesize{$\pm$ 0.3}} & \textbf{52.4 \footnotesize{$\pm$ 2.0}} & \textbf{61.6 \footnotesize{$\pm$ 1.6}} & \textbf{47.1 \footnotesize{$\pm$ 3.2}}
& \textbf{35.6 \footnotesize{$\pm$ 0.4}} & \textbf{33.4 \footnotesize{$\pm$ 0.3}} & \textbf{28.8 \footnotesize{$\pm$ 0.6}} & \textbf{34.6 \footnotesize{$\pm$ 0.3}} & \textbf{25.7 \footnotesize{$\pm$ 1.1}} & \textbf{25.8 \footnotesize{$\pm$ 0.7}} & \textbf{13.4 \footnotesize{$\pm$ 0.3}}\\
\bottomrule
\end{tabular}%
}
\end{table*}
\end{comment}
\begin{table*}[t!]
\centering
\caption{Last test accuracy on CIFAR-10 (K=500) and CIFAR-100 (K=2,000) with SYM-\{20\%, 40\%, 60\%\} and ASYM-\{20\%. 40\%\}, where $K$ denotes size of episodic memory.}
\vspace*{-0.2cm}
\label{tab:cifar_result}
\resizebox{1.0\linewidth}{!}{%
\begin{tabular}{@{}lrrrrrrrrrr@{}}
\toprule
& \multicolumn{5}{c}{CIFAR-10} & \multicolumn{5}{c}{CIFAR-100} \\
\cmidrule(lr){2-6} \cmidrule(lr){7-11}
{Methods}& \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} & \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} \\
& \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} &
\multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} \\
\cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-9} \cmidrule(lr){10-11}
RSV~\cite{riemer2018learning} & 54.5 \footnotesize{$\pm$ 2.1} & 39.2 \footnotesize{$\pm$ 0.9} & 28.7 \footnotesize{$\pm$ 0.4} & 53.6 \footnotesize{$\pm$ 1.6} & 40.0 \footnotesize{$\pm$ 1.2}
& 29.4 \footnotesize{$\pm$ 0.1} & 19.3 \footnotesize{$\pm$ 1.2} & 10.5 \footnotesize{$\pm$ 0.4} & 29.8 \footnotesize{$\pm$ 0.8} & 20.3 \footnotesize{$\pm$ 1.0} \\
~~ $+$ SELFIE~\cite{song2019selfie} & 54.5 \footnotesize{$\pm$ 1.7} & 39.2 \footnotesize{$\pm$ 1.1}& 28.8 \footnotesize{$\pm$ 2.9} & 51.8 \footnotesize{$\pm$ 4.1} & 40.4 \footnotesize{$\pm$ 1.4}
& 28.9 \footnotesize{$\pm$ 0.4} & 19.5 \footnotesize{$\pm$ 1.5} & 10.5 \footnotesize{$\pm$ 0.4} & 29.8 \footnotesize{$\pm$ 0.9} & 20.1 \footnotesize{$\pm$ 1.2} \\
~~ $+$ Co-teaching~\cite{han2018coteaching} & 56.1 \footnotesize{$\pm$ 2.3}& 39.8 \footnotesize{$\pm$ 4.4} & 30.5 \footnotesize{$\pm$ 3.6} & 53.5 \footnotesize{$\pm$ 2.9} & 38.7 \footnotesize{$\pm$ 1.3}
& 30.4 \footnotesize{$\pm$ 0.3} & 22.0 \footnotesize{$\pm$ 1.2} & 13.3 \footnotesize{$\pm$ 0.3} & 30.8 \footnotesize{$\pm$ 1.4} & 20.3 \footnotesize{$\pm$ 0.6} \\
~~ $+$ DivideMix~\cite{li2019dividemix} & 56.1 \footnotesize{$\pm$ 1.3} & 43.7 \footnotesize{$\pm$ 0.3} & 35.1 \footnotesize{$\pm$ 1.9} & 56.1 \footnotesize{$\pm$ 0.6} & 38.9 \footnotesize{$\pm$ 2.5}
& 30.5 \footnotesize{$\pm$ 0.7} & 23.1 \footnotesize{$\pm$ 1.6} & 13.1 \footnotesize{$\pm$ 0.5} & 30.2 \footnotesize{$\pm$ 0.5} & 20.1 \footnotesize{$\pm$ 0.7}\\
\cmidrule(lr){1-11}
GBS~\cite{prabhu2020gdumb} & 54.8 \footnotesize{$\pm$ 1.2} & 41.8 \footnotesize{$\pm$ 0.9} & 27.3 \footnotesize{$\pm$ 2.1} & 54.2 \footnotesize{$\pm$ 1.7} & 40.4 \footnotesize{$\pm$ 1.1}
& 28.0 \footnotesize{$\pm$ 0.2} & 18.8 \footnotesize{$\pm$ 1.7} & 10.2 \footnotesize{$\pm$ 0.8} & 29.5 \footnotesize{$\pm$ 0.9} & 20.3 \footnotesize{$\pm$ 0.5} \\
~~ $+$ SELFIE~\cite{song2019selfie} & 55.4 \footnotesize{$\pm$ 0.8} & 41.6 \footnotesize{$\pm$ 0.3} & 27.8 \footnotesize{$\pm$ 1.8} & 51.3 \footnotesize{$\pm$ 4.7} & 40.7 \footnotesize{$\pm$ 0.9}
& 28.0 \footnotesize{$\pm$ 0.6} & 18.4 \footnotesize{$\pm$ 1.9} & 9.9 \footnotesize{$\pm$ 0.7} & 29.6 \footnotesize{$\pm$ 2.1} & 10.4 \footnotesize{$\pm$ 0.3}\\
~~ $+$ Co-teaching~\cite{han2018coteaching} & 55.1 \footnotesize{$\pm$ 0.9} & 42.7 \footnotesize{$\pm$ 0.9} & 31.4 \footnotesize{$\pm$ 3.6} & 54.0 \footnotesize{$\pm$ 0.9} & 39.5 \footnotesize{$\pm$ 1.3}
& 29.5 \footnotesize{$\pm$ 0.7} & 20.9 \footnotesize{$\pm$ 1.3} & 12.8 \footnotesize{$\pm$ 1.5} & 29.0 \footnotesize{$\pm$ 1.6} & 20.5 \footnotesize{$\pm$ 1.3} \\
~~ $+$ DivideMix~\cite{li2019dividemix} & 57.8 \footnotesize{$\pm$ 1.9} & 48.8 \footnotesize{$\pm$ 1.9} & 34.3 \footnotesize{$\pm$ 1.3} & 57.4 \footnotesize{$\pm$ 0.6} & 44.6 \footnotesize{$\pm$ 5.5}
& 29.6 \footnotesize{$\pm$ 0.8} & 21.4 \footnotesize{$\pm$ 1.1} & 13.2 \footnotesize{$\pm$ 0.2} & 28.7 \footnotesize{$\pm$ 0.7} & 19.6 \footnotesize{$\pm$ 1.1} \\
\cmidrule(lr){1-11}
RM~\cite{bang2021rainbow} & 57.1 \footnotesize{$\pm$ 0.1} & 46.5 \footnotesize{$\pm$ 2.6} & 33.5 \footnotesize{$\pm$ 3.0} & 58.3 \footnotesize{$\pm$ 2.6} & 46.2 \footnotesize{$\pm$ 1.9} & 31.7 \footnotesize{$\pm$ 1.3} & 23.9 \footnotesize{$\pm$ 0.9} & 14.2 \footnotesize{$\pm$ 0.4} & 32.0 \footnotesize{$\pm$ 1.0} & 21.6 \footnotesize{$\pm$ 1.2} \\
~~ $+$ SELFIE~\cite{song2019selfie} & 56.8 \footnotesize{$\pm$ 1.3} & 44.8 \footnotesize{$\pm$ 0.6} & 31.8 \footnotesize{$\pm$ 4.4} & 57.9 \footnotesize{$\pm$ 1.5} & 46.9 \footnotesize{$\pm$ 1.9} & 32.1 \footnotesize{$\pm$ 0.8} & 22.1 \footnotesize{$\pm$ 1.0} & 12.4 \footnotesize{$\pm$ 0.7} & 31.7 \footnotesize{$\pm$ 0.4} & 20.9 \footnotesize{$\pm$ 0.9} \\
~~ $+$ Co-teaching~\cite{han2018coteaching} & 57.5 \footnotesize{$\pm$ 1.8} & 47.6 \footnotesize{$\pm$ 0.7} & 35.1 \footnotesize{$\pm$ 2.0} & 58.5 \footnotesize{$\pm$ 1.5} & 45.9 \footnotesize{$\pm$ 2.0} & 31.9 \footnotesize{$\pm$ 0.9} & 22.8 \footnotesize{$\pm$ 0.5} & 14.4 \footnotesize{$\pm$ 0.2} & 32.4 \footnotesize{$\pm$ 0.4} & 21.3 \footnotesize{$\pm$ 1.1} \\
~~ $+$ DivideMix~\cite{li2019dividemix} & 61.3 \footnotesize{$\pm$ 0.8} & 50.9 \footnotesize{$\pm$ 3.3} & 34.9 \footnotesize{$\pm$ 3.1} & 60.6 \footnotesize{$\pm$ 1.7} & 46.4 \footnotesize{$\pm$ 5.1} & 31.2 \footnotesize{$\pm$ 0.7} & 23.4 \footnotesize{$\pm$ 0.9} & 14.8 \footnotesize{$\pm$ 0.8} & 30.6 \footnotesize{$\pm$ 0.3} & 21.1 \footnotesize{$\pm$ 0.6} \\
\cmidrule(lr){1-11}
\textbf{PuriDivER\xspace} (ours) & \textbf{61.3 \footnotesize{$\pm$ 2.1}} & \textbf{59.2 \footnotesize{$\pm$ 0.3}} & \textbf{52.4 \footnotesize{$\pm$ 2.0}} & \textbf{61.6 \footnotesize{$\pm$ 1.6}} & \textbf{47.1 \footnotesize{$\pm$ 3.2}}
& \textbf{35.6 \footnotesize{$\pm$ 0.4}} & \textbf{33.4 \footnotesize{$\pm$ 0.3}} & \textbf{28.8 \footnotesize{$\pm$ 0.6}} & \textbf{34.6 \footnotesize{$\pm$ 0.3}} & \textbf{25.7 \footnotesize{$\pm$ 1.1}} \\
\bottomrule
\end{tabular}%
}
\vspace*{-1.5em}
\end{table*}
\vspace{-1em}\paragraph{Metrics.}
As a main performance metric, we report the \emph{last} test\,(or validation) accuracy, which is the most widely used metric in CL literature~\cite{rwalk, han2018coteaching}, where ``last" refers to the moment when all tasks arrive.
To quantitatively evaluate robustness in CL with noisy labels, we propose metrics of `purity' and `diversity' for the episodic memory $\mathcal{M}$ as:
\begin{equation}
\footnotesize
\label{eq:metric}
\!\begin{aligned}
& {\rm Purity} = \frac{\sum_{(x_i,\tilde{y_i}) \in \mathcal{M}} \mathbbm{1}(\tilde{y_i}=y_i)}{|\mathcal{M}|},\\
& {\rm Div.} = \frac{1}{C} \sum_{c=1}^{C} \frac{2}{|\mathcal{M}_{c}|(|\mathcal{M}_{c}|\! - \!1)} \!\!\sum_{
\substack{x_i, x_j \in \mathcal{M}_{c}\\
x_i \neq x_j}}\!\!\! ||f (x_i) \!-\! f(x_j) ||_2,\!\!\!\!\!
\end{aligned}
\end{equation}
where $f(x_i)$ is the representation vector of an example $x_i$ by a jointly trained (using all tasks, not in CL setup) model, and $\mathcal{M}_c$ is a subset of $\mathcal{M}$ consisting of training examples whose ground-truth label is $c$, and $C$ is the number of classes.
`Purity' measures how many clean examples are correctly included in the memory.
`Diversity' measures how much the examples in the memory are spread out in the representation space per class. We describe the trade-off of purity and diversity in the supplementary material (Sec. 4).
\vspace{-1em}\paragraph{Baselines.}
We compare our PuriDivER\xspace with the combination of representative memory sampling methods for continual learning and robust learning methods for noisy labels. As summarized in Sec.~\ref{sec:related_work}, the memory sampling methods include \textit{reservoir sampling}\,(RSV)\,\cite{riemer2018learning}, \textit{greedy balancing sampler}\,(GBS)~\cite{prabhu2020gdumb}, and \textit{rainbow memory}\,(RM)~\cite{bang2021rainbow}.
Since RM originally updates memory per every task, we update memory of RM at every batch for online CL scenario. %
For the robust learning baselines, we consider three widely used approaches in the literature for addressing noisy labels; a re-labeling approach \textit{SELFIE}~\cite{song2019selfie}, a sample selection approach \textit{Co-teaching}~\cite{han2018coteaching}, and a semi-supervised learning approach \textit{DivideMix}~\cite{li2019dividemix}.
We compared PuriDivER\xspace to them; three memory only sampling methods with three robust learning methods combined plus three using memory sampling only, total of twelve.
\vspace{-1em}
\paragraph{Implementation Details.} We use ResNet~\cite{he2016resnet} family as a backbone for all compared algorithms; ResNet18, ResNet32, ResNet34 and ResNet34 are used for CIFAR-10/100, Food-101N, and WebVision, respectively.
For CIFARs, we train ResNet using an initial learning rate of $0.05$ with cosine annealing and a batch size of 16 for 256 epochs, following \cite{bang2021rainbow}.
For Food-101N and WebVision, we use the same training hyper-parameters for CIFARs except the training epochs (256 $\to$ 128).
In all experiments, we use 1.0 for $\eta$ in Eq.~\ref{eq:final}, and use CutMix~\cite{yun2019cutmix} and AutoAugment~\cite{cubuk2019autoaugment} for data augmentation with the memory.
For reliable validation, we repeat all the experiments thrice with a single NVIDIA P40 GPU and report the average results.
{
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{X}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\begin{table}[t]
\caption{Last validation accuracy on WebVision (K=1,000) and Food-101N (K=2,000), where $K$ is episodic memory size.}
\vspace{-2em}
\begin{center}
\footnotesize
\begin{tabular}{L{3.6cm} L{1.75cm} X{1.75cm}}
\toprule
Methods & WebVision & Food-101N \\\midrule
RSV~\cite{riemer2018learning} & 18.4 \footnotesize{$\pm$ 0.8} & 11.6 \footnotesize{$\pm$ 1.0} \\
RSV$+$ SELFIE~\cite{song2019selfie}& 19.1 \footnotesize{$\pm$ 0.4} & 11.1 \footnotesize{$\pm$ 1.3} \\
RSV$+$ Co-teaching~\cite{han2018coteaching}& 16.5 \footnotesize{$\pm$ 0.3} & 11.3 \footnotesize{$\pm$ 1.0} \\
RSV$+$ DivideMix~\cite{li2019dividemix} & 11.7 \footnotesize{$\pm$ 1.1} & 7.3 \footnotesize{$\pm$ 0.4} \\
\cmidrule(lr){1-3}
GBS~\cite{prabhu2020gdumb} & 20.3 \footnotesize{$\pm$ 2.1} & 10.5 \footnotesize{$\pm$ 0.4} \\
GBS $+$ SELFIE~\cite{song2019selfie} & 20.0 \footnotesize{$\pm$ 2.1} & 10.4 \footnotesize{$\pm$ 0.3} \\
GBS $+$ Co-teaching~\cite{han2018coteaching} & 17.8 \footnotesize{$\pm$ 1.8} & 10.5 \footnotesize{$\pm$ 0.2} \\
GBS $+$ DivideMix~\cite{li2019dividemix} & 14.0 \footnotesize{$\pm$ 0.6} & 6.9 \footnotesize{$\pm$ 0.1} \\
\cmidrule(lr){1-3}
RM~\cite{bang2021rainbow} & 23.1 \footnotesize{$\pm$ 0.1} & 11.7 \footnotesize{$\pm$ 0.2} \\
RM$+$ SELFIE~\cite{song2019selfie} & 21.4 \footnotesize{$\pm$ 1.1} & 12.0 \footnotesize{$\pm$ 0.2} \\
RM$+$ Co-teaching~\cite{han2018coteaching} & 21.8 \footnotesize{$\pm$ 0.8} & 12.0 \footnotesize{$\pm$ 0.4} \\
RM$+$ DivideMix~\cite{li2019dividemix} & 18.2 \footnotesize{$\pm$ 0.8} & 9.2 \footnotesize{$\pm$ 0.9} \\\midrule
\textbf{PuriDivER\xspace} (Ours) & \textbf{25.8 \footnotesize{$\pm$ 0.7}} & \textbf{13.4 \footnotesize{$\pm$ 0.3}} \\ \bottomrule
\end{tabular}
\end{center}
\label{tab:real_result}
\vspace{-1em}
\end{table}
}
\begin{comment}
{
\begin{table}[t]
\centering
\caption{Last validation accuracy on WebVision (K=1,000) and Food-101N (K=2,000), where $K$ is episodic memory size.}
\vspace{-1.5em}
\label{tab:real_result}
\resizebox{0.85\linewidth}{!}{%
\begin{tabular}{@{}lrr@{}}
\toprule
Methods & WebVision & Food-101N \\
\cmidrule(lr){1-3}
RSV~\cite{riemer2018learning} & 18.4 \footnotesize{$\pm$ 0.8} & 11.6 \footnotesize{$\pm$ 1.0} \\
RSV$+$ SELFIE~\cite{song2019selfie}& 19.1 \footnotesize{$\pm$ 0.4} & 11.1 \footnotesize{$\pm$ 1.3} \\
RSV$+$ Co-teaching~\cite{han2018coteaching} & 16.5 \footnotesize{$\pm$ 0.3} & 11.3 \footnotesize{$\pm$ 1.0} \\
RSV$+$ DivideMix~\cite{li2019dividemix} & 11.7 \footnotesize{$\pm$ 1.1} & 7.3 \footnotesize{$\pm$ 0.4} \\
\cmidrule(lr){1-3}
GBS~\cite{prabhu2020gdumb} & 20.3 \footnotesize{$\pm$ 2.1} & 10.5 \footnotesize{$\pm$ 0.4} \\
GBS $+$ SELFIE~\cite{song2019selfie} & 20.0 \footnotesize{$\pm$ 2.1} & 10.4 \footnotesize{$\pm$ 0.3} \\
GBS $+$ Co-teaching~\cite{han2018coteaching} & 17.8 \footnotesize{$\pm$ 1.8} & 10.5 \footnotesize{$\pm$ 0.2} \\
GBS $+$ DivideMix~\cite{li2019dividemix} & 14.0 \footnotesize{$\pm$ 0.6} & 6.9 \footnotesize{$\pm$ 0.1} \\
\cmidrule(lr){1-3}
\textbf{PuriDivER\xspace} (ours) & \textbf{25.8 \footnotesize{$\pm$ 0.7}} & \textbf{13.4 \footnotesize{$\pm$ 0.3}} \\
\bottomrule
\end{tabular}%
}
\end{table}
}
\end{comment}
\begin{figure*}[t!]
\centering
\begin{subfigure}[t]{0.495\linewidth}
\includegraphics[width=0.49\textwidth]{figures/cifar10_sym40_accuracy.pdf}
\hfill
\includegraphics[width=0.496\textwidth]{figures/cifar10_sym40_purity.pdf}
\caption{CIFAR-10}
\label{fig:cifar10_sym40}
\end{subfigure}
\begin{subfigure}[t]{0.495\linewidth}
\includegraphics[width=0.49\textwidth]{figures/cifar100_sym40_accuracy.pdf}
\hfill
\includegraphics[width=0.496\textwidth]{figures/cifar100_sym40_purity.pdf}
\caption{CIFAR-100}
\label{fig:cifar100_sym40}
\end{subfigure}
\vspace{-1em}
\caption{Last test accuracy as a function of memory purity when the task injection progresses on CIFAR-10/100 with SYM-40\%. We provide more results with various noise ratio in the supplementary material (Sec. 3).}
\label{fig:cifar_result}
\vspace{-1em}
\end{figure*}
\begin{figure}[t!]
\centering
\begin{subfigure}[t]{0.49\linewidth}
\includegraphics[width=\textwidth]{figures/loss_uncerts/loss_1_13_bins50.pdf}
%
\label{fig:historgram_loss}
\end{subfigure}
\begin{subfigure}[t]{0.49\linewidth}
\includegraphics[width=\textwidth]{figures/loss_uncerts/uncert_2_117_bins30.pdf}
%
\label{fig:histogram_uncert}
\end{subfigure}
\vspace{-1.8em}
\caption{Distribution of examples in the episodic memory training on CIFAR-10 with SYM-20\%. GMMs effectively distinguish between (left) clean and noisy labels by loss, and (right) correct and incorrect predictions by uncertainty (Eq.~\ref{eq:uncertainty})}
\label{fig:validity_gmm_fitting}
%
\end{figure}
\subsection{Results}
\label{sec:results}
We compare the proposed PuriDivER\xspace with twelve baselines on the two CIFARs datasets with varying symmetric and asymmetric noise, and summarize the results in Tab.~\ref{tab:cifar_result}.
We also compare methods on real-world noisy datasets; WebVision and Food-101N datasets in Tab.~\ref{tab:real_result}.
As shown in the two tables, PuriDivER\xspace consistently outperforms all other compared methods.
Comparing PuriDivER\xspace with other methods, in particular, accuracy increases up to 16\% on CIFARs, 11\% and 3\% on WebVision and Food-101N, respectively.
Interestingly, the performance gain becomes large as the noise ratio increases or the difficulty of training data increases from CIFAR-10 to 100.
Noticeably, SELFIE~\cite{song2019selfie} does not improve the accuracy in average when combined with the three memory sampling approaches.
We believe that the SELFIE rather produces many false corrections in the online learning setup, since it requires an abundant number of data for re-labeling unlike episodic memory that contains a small number of data.
Despite the use of multiple networks, Co-teaching~\cite{han2018coteaching} marginally improves the performance. %
Unlike SELFIE and Co-teaching, DivideMix considerably improves the accuracy in CIFAR-10, but not in CIFAR-100 with asymmetric noise and real noise datasets, which have more realistic label noise.
We expect that the size of (expected) noisy dataset is larger when splitting whole dataset into the clean and the noisy data, as noise ratio becomes larger or learning becomes more difficult.
As such, it has too small (expected) clean data to train the model due to the small size of episodic memory. In Tab.~\ref{tab:real_result}, we observe that PuriDivER\xspace presents a competitive capability on noisy CL tasks in real-world label corruption while outperforming comparable methods.
\subsection{Detailed Analyses}
\label{sec:ssl_sr}
\subsubsection{Purity of Episodic Memory}
We first investigate the effect of memory purity on the performance of our method.
We measure the last test accuracy as a function of the memory purity (Eq.~\ref{eq:metric}). %
We compare our PuriDivER\xspace with RSV, GBS and RM integrated with DivideMix in Fig.~\ref{fig:cifar_result}.
As shown in the figure, ours significantly outperforms them in both accuracy and memory purity on CIFAR-10 and CIFAR-100 by large margins.
Particularly, the performance gap between PuriDivER\xspace and other methods gradually increase as more tasks arrive by an synergistic effect of our episodic memory construction\,(Sec.~\ref{sub:memory_update}) and memory usage schemes\,(Sec.~\ref{sec:sub:robustlearning}).
Interestingly, the performance gain of PuriDivER\xspace increases as data becomes more difficult. It implies that the purity of other baselines relatively much worsen in CIFAR-100, while ours maintains its significant dominance. There are similar gains on various noise ratio as shown in the supplementary material (Sec. 3).
\vspace{-1em}
\subsubsection{Ablations on Robust Learning Components}
We now investigate the contribution of each component of the proposed robust learning approach to the accuracy. %
The both sides of Fig.~\ref{fig:validity_gmm_fitting} show the loss distribution of all examples in the memory $\mathcal{M}$ and the uncertainty distribution (Eq.~\ref{eq:uncertainty_loss}) of the examples in (expected) noisy set $\mathcal{N}$, respectively.
The loss distributions in Fig.~\ref{fig:validity_gmm_fitting}-(left) are bi-modal for clean and noisy examples, thus clearly separating them by fitting GMMs.
Likewise, the uncertainty distributions in Fig.~\ref{fig:validity_gmm_fitting}-(right) are bi-modal as well for the correctness of model's predictions.
Hence, re-labeling using the model's prediction for the left Gaussian components (\ie, certain examples) ensures that the proposed re-labeling method achieves high precision.
\begin{table}[t]
\centering
\caption{Ablation study for PuriDivER\xspace on CIFAR-10 and CIFAR-100 with various noise ratios and types. SYM and ASYM refer to the symmetric and asymmetric label noise, respectively. }
\vspace{-0.5em}
\label{tab:dpm_ablation}
\resizebox{1.0\linewidth}{!}{%
\begin{tabular}{@{}ccrrrrrrrrrr@{}}
\toprule
& & \multicolumn{5}{c}{CIFAR-10 (K=500)} & \multicolumn{5}{c}{CIFAR-100 (K=2,000)} \\
\multicolumn{2}{c}{Robust Learning}& \multicolumn{3}{c}{SYM} & \multicolumn{2}{c}{ASYM} & \multicolumn{3}{c}{SYM} & \multicolumn{2}{c}{ASYM} \\
Re-label & Consistency &
\multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} &
\multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} \\
\cmidrule(lr){1-2} \cmidrule(lr){3-5} \cmidrule(lr){6-7} \cmidrule(lr){8-10} \cmidrule(lr){11-12}
& & \textbf{61.8} & 55.4 & 46.9 & 60.6 & 46.4
& 33.1 & 26.8 & 18.6 & 31.5 & 21.3 \\
\checkmark & & 57.7 & 55.4 & 44.1 & 61.0 & 46.6
& 34.7 & 31.5 & 26.2 & 33.2 & 22.7 \\
& \checkmark & 48.6 & 46.2 & 31.3 & 52.1 & 36.7
& 31.7 & 24.3 & 18.1 & 29.9 & 20.3 \\
\cmidrule(lr){1-12}
\checkmark & \checkmark & 61.3 & \textbf{59.2} & \textbf{52.4} & \textbf{61.6} & \textbf{47.1}
& \textbf{35.6} & \textbf{33.4} & \textbf{28.8} & \textbf{34.6} & \textbf{25.7} \\
\bottomrule
\end{tabular}%
}
\vspace{-0.5em}
\end{table}
Tab.~\ref{tab:dpm_ablation} summarizes the contribution of the re-labeling and consistency regularization in PuriDivER\xspace.
Using either re-labeling or consistency regularization alone does not improve the accuracy in many experiments because re-labeling would make many false correction, and consistency regularization utilizes only a small size of clean set $\mathcal{C}$.
For those reasons, they also drastically decrease the performance as the noise ratio increases.
In contrast, training the model for the clean and re-labeled set $\mathcal{C} \cup \mathcal{R}$ with the consistency loss for the unlabeled set $\mathcal{U}$ significantly improves the accuracy by up to 10.2\% compared to the baseline without them.
By using the both methods, since a good number of examples in the re-label set $\mathcal{R}$ would be correctly labeled, the $\mathcal{R}$ can also be utilized to train the model better with clean set $\mathcal{C}$.
Further, as we re-split the three sets $\mathcal{C}$, $\mathcal{R}$ and $\mathcal{U}$ at every epoch, it is likely that many data will have both effects of re-labeling and consistency regularization over the epochs, which leads to further improvement.
\begin{table}[t!]
\centering
\caption{Last test accuracy over various static $\alpha$ on CIFAR-10 and CIFAR-100 with SYM-\{20\%, 40\%, 60\%\} and ASYM-\{20\%, 40\%\}. $K$ is the size of episodic memory.}
\vspace{-1em}
\label{tab:various_coeff}
\resizebox{1.0\linewidth}{!}{%
\begin{tabular}{@{}crrrrrrrrrr@{}}
\toprule
& \multicolumn{5}{c}{CIFAR-10 (K=500)} & \multicolumn{5}{c}{CIFAR-100 (K=2,000)} \\
\cmidrule(lr){2-6} \cmidrule(lr){7-11}
& \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} & \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} \\
$\alpha$ &
\multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} &
\multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} \\
\cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-9} \cmidrule(lr){10-11}
0.1 & 57.4 & 55.1 & 51.6 & 58.9 & 47.4
& 36.1 & 33.6 & \textbf{28.1} & 34.0 & \textbf{25.6} \\
0.3 & 58.1 & 55.3 & \textbf{52.6} & 58.4 & \textbf{49.0}
& 35.5 & \textbf{33.6} & 27.3 & 34.6 & 25.5 \\
0.5 & \textbf{60.5} & \textbf{57.0} & 47.1 & \textbf{60.4} & 46.7
& \textbf{37.0} & 32.3 & 23.0 & \textbf{36.6} & 25.5 \\
0.6 & 29.5 & 30.3 & 24.4 & 36.0 & 33.7
& 25.3 & 18.9 & 13.5 & 26.7 & 18.2 \\
1.0 & 26.1 & 19.4 & 19.3 & 33.0 & 28.1
& 15.2 & 10.5 & 7.2 & 20.7 & 16.6 \\
\bottomrule
\end{tabular}
}
\vspace{-1.0em}
\end{table}
\begin{figure}[t!]
\centering
\begin{subfigure}[t]{0.49\linewidth}
\includegraphics[width=\textwidth]{figures/various_coeff_a.pdf}
%
\label{fig:various_coeff_a}
\end{subfigure}
\begin{subfigure}[t]{0.49\linewidth}
\includegraphics[width=\textwidth]{figures/various_coeff_b.pdf}
%
\label{fig:various_coeff_b}
\end{subfigure}
\vspace{-2em}
\caption{Accuracy by different $\alpha$ on CIFAR-10 with SYM-\{20\%, 40\%, 60\%\}; (left) comparison of the last test accuracy with and without the adaptive strategy, (right) comparison of the mean of $\alpha$ for each task with the adaptive strategy.}
\vspace{-0.5em}
\label{fig:various_coeff}
\end{figure}
\vspace{-0.5em}
\subsubsection{Balancing Coefficient}
\label{sec:coefficent}
Tab.~\ref{tab:various_coeff} illustrates the effect of balancing coefficient $\alpha$ on the accuracy.
As shown in the table, the test accuracy decreases drastically when $\alpha > 0.5$ because diversity dominantly influences memory sampling rather than memory purity.
In the presence of label noise, this suggests that memory purity plays a significant role in performance, as opposed to the conventional CL methods that mainly emphasize example diversity~\cite{bang2021rainbow}.
Hence, we set the range of adaptive balancing coefficient $\alpha$ to (0, 0.5) instead of (0, 1).
Additionally note that the best $\alpha$ value depends on the noise ratio. %
Generally, with increased noise ratios, a smaller $\alpha$ incurs higher accuracy since memory purity is far more important than diversity when label noise is severe.
\vspace{-1em}\paragraph{Efficacy of Adaptive Strategy.}
We compare the performance of PuriDivER\xspace with and without using the proposed adaptive balancing coefficient strategy, and summarize the results in Fig.~\ref{fig:various_coeff}-(left).
PuriDivER\xspace with the adaptive strategy always outperforms others.
In addition, as shown in Fig.~\ref{fig:various_coeff}-(right), the $\alpha$ values are properly determined by PuriDivER\xspace with the adaptive strategy for three difference noise scenarios.
The $\alpha$ tends to increase as the task number increases except for the initial task.
It implies that small-loss\,(clean) examples are favored at the earlier stage of training for robust learning, while diverse examples are favored at the later stage of training for better generalization.
Therefore, the proposed adaptive strategy allows PuriDivER\xspace to exploit the best $\alpha$ value for the various noise scenario.
\vspace{-1em}
\setlength{\columnsep}{10pt}%
\begin{wrapfigure}{r}{0.4\linewidth}
\vspace{-2em}
\includegraphics[width=1\linewidth]{figures/time_analysis.pdf}
\vspace{-2em}
\caption{Total training time and accuracy on CIFAR-10 SYM-40\% for various methods.}
\label{fig:time}
\vspace{-1.5em}
\end{wrapfigure}
\subsubsection{Time Cost}
In online continual learning, time cost is significant for the model to adapt the distribution change of data stream. Unfortunately, there is a trade-of between time and accuracy. In Fig.~\ref{fig:time}, RSV, GBS and RM have small amount of training time but poor accuracy, while SPR takes too much time to be utilized in online setup.
Despite the additional time cost for memory construction compared to RSV and GBS, PuriDivER\xspace exhibits a good trade-off between the accuracy and time cost, compared to others.
\section{Conclusion}
We address a setup of online and blurry CL with noisy labels, which occurs frequently in real world AI deployment scenarios.
Specifically, we propose a method to address this practical task by adaptively balancing diversity and purity by an episodic memory management scheme followed by a robust learning with semi-supervised learning for additional diversity and purity enforcement for the memory usage.
We also define an adaptively balancing coefficient to accommodate various noise ratio and sample-wise learning efficiency.
We empirically validate that our PuriDivER\xspace not only improves accuracy over combinations of prior arts but also helps better sampling for memory.
\vspace{-1.3em}\paragraph{Limitation.}
Although PuriDivER\xspace outperforms prior arts by large margins, developing methods in noisy CL setups are in its nascent steps;
\eg, no new class is added as the task progresses.
Also, scaled-up empirical validation is important and desirable.
\vspace{-1.3em}\paragraph{Potential Negative Societal Impact.}
As the CL method is for deploying AI to broader context, the data can come from any sources thus the data privacy issue may arise.
Although the proposed method has \emph{no intention} to allow such consequences, the method may carry such negative effects.
Efforts to prevent such concerns would be a focus of secure machine learning research.
\footnotesize{\vspace{-1.3em}\paragraph{Acknowledgement.} All authors thank NAVER Smart Machine Learning (NSML)~\cite{kim2018nsml} for experimental environments. This work was partly supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No.2022R1A2C4002300) and Institute for Information \& communications Technology Promotion (IITP) grants funded by the Korea government (MSIT) (No.2020-0-01361-003 and 2019-0-01842, Artificial Intelligence Graduate School Program (Yonsei University, GIST), and No.2021-0-02068 Artificial Intelligence Innovation Hub).}
{\small
\bibliographystyle{ieee_fullname}
\section{Detailed Algorithm}
\label{app:detailed}
Algorithm~\ref{alg:detailed} describes overall procedure of PuriDivER\xspace. For each task, a model is trained with online data stream $S_t$ via SGD optimizer (Lines 3--5). Since we can see the data at once by definition of online learning, episodic memory is updated every batch. To get the diversified examples in the memory, we consider the examples of memory and a new example from batch as memory candidates, then remove one that has the maximum value of score function (Lines 7--9). After constructing memory, the model trains with memory. Since the memory might have contaminated data by selecting examples considering both diversity and purity, we split the memory as three parts every epoch; clean set $\mathcal{C}$, noisy but high model's confident set $\mathcal{R}$, noisy and low model's confident set $\mathcal{U}$ (Lines 11--13). Finally, we apply to the different loss function of each set that is appropriate for handling noisy labels (Lines 14--15).
\begin{algorithm}[h!]
\small
\caption{Purity and Diversity aware Episode Replay\xspace}
\label{alg:detailed}
\begin{algorithmic}[1]
\State {\textbf{Input:} $\mathcal{S}_{t}$: stream data at task $t$, $\mathcal{M}$: exemplars stored in a episodic memory, $T$: the number of tasks, $\theta_0$: initial model.}
\For {$t$ = 1 {\bf to} T}
%
\For {each mini-batch $\mathcal{B} \in \mathcal{S}_{t}$}
%
%
\State{/* {\color{orange}Online Training} */}
\State{$\theta \leftarrow \theta - \alpha \nabla \sum_{i \in \mathcal{B}} \ell(\theta(x_i), \tilde{y_i})$}
%
\State{/* {\color{orange} Memory Construction} */}
\For {$x_i, \tilde{y_i}$ in $\mathcal{B}$}
\State{$\mathcal{M} \leftarrow \mathcal{M} \cup (x_i, \tilde{y_i})$}
\State{$\mathcal{M}$.remove($\arg\max_{(x,\tilde{y}) \in \mathcal{M}} S(x, \tilde{y})$) by \bmp{Eq. 2} }
%
\EndFor
\EndFor
\State{/* {\color{orange} Memory Usage} */}
\For {$e=1$ {\bf to} MaxEpoch}
\State{Split $\mathcal{C}$, $\mathcal{N}$ from $\mathcal{M}$ via \bmp{Eq. 5}}
\State{Split $\mathcal{R}$, $\mathcal{U}$ from $\mathcal{N}$ via \bmp{Eq. 7}}
%
%
\For {each mini-batch $\mathcal{B_C} \in \mathcal{C}$, $\mathcal{B_R} \in \mathcal{R}$, $\mathcal{B_U} \in \mathcal{U}$ }
%
\State{$\theta \leftarrow \theta - \alpha \nabla [\ell_{cls} + \eta \ell_{reg}$]}
\EndFor
\EndFor
\EndFor
\end{algorithmic}
\end{algorithm}
\section{Detailed Configuration for Online Continual Learning}
\label{app:config_stream_data}
To split dataset into several tasks, we follow [\bmp{5}] to make \textit{blurry-CL}. \textit{Blurry-CL} contains two types of classes, major and minor classes. We set $L=0.1$, so the number of minor classes are 10\% of the entire of classes at each task.
Since some labels might be incorrect, real class distribution of each task might be different. We configure CIFAR-10/100, WebVision and Food-101N as 5, 5, 10 and 5 tasks, respectively. Since Food-101N has 101 classes, the number of major classes is 21 at the last task. Furthermore, we consider online-CL which the incoming samples are presented to a model only once except for the examples from the memory.
\section{Accuracy and memory purity by various noise ratios}
\label{app:various_noise_ratio}
We add experimental results of the last accuracy and memory purity of PuriDivER\xspace on CIFAR-10/100 with the symmetric noise 20\% and 60\% in Fig.~\ref{fig:cifar10_appendix_result} and ~\ref{fig:cifar100_appendix_result}.
We can find consistent results as in \bmp{Fig. 2}.
On different scenarios, PuriDivER\xspace outperforms the other baselines for both accuracy and memory purity over the entire task stream.
Especially, in memory purity, PuriDivER\xspace greatly outperforms the other baselines, and it shows that our method can effectively find clean labels from corrupted data for the online continual learning setup. Since we believe that memory sampling and robust learning from PuriDivER\xspace are the relationship to help each other, so the last accuracy and memory purity increases and have larger gap as the task number increases.
\begin{figure*}[h!]
\centering
\begin{subfigure}[t]{0.495\linewidth}
\includegraphics[width=0.495\textwidth]{figures/cifar10_sym20_accuracy.pdf}
\hfill
\includegraphics[width=0.495\textwidth]{figures/cifar10_sym20_purity.pdf}
\caption{CIFAR-10 with SYM-20\%}
\label{fig:cifar10_sym20}
\end{subfigure}
\begin{subfigure}[t]{0.495\linewidth}
\includegraphics[width=0.495\textwidth]{figures/cifar10_sym60_accuracy.pdf}
\hfill
\includegraphics[width=0.495\textwidth]{figures/cifar10_sym60_purity.pdf}
\caption{CIFAR-10 with SYM-60\%}
\label{fig:cifar10_sym60}
\end{subfigure}
\caption{Illustration of last accuracy and memory purity changes as the task number increases on CIFAR-10 with SYM-\{20\%, 60\%\}.}
\label{fig:cifar10_appendix_result}
\end{figure*}
\begin{figure*}[h!]
\centering
\begin{subfigure}[t]{0.495\linewidth}
\includegraphics[width=0.495\textwidth]{figures/cifar100_sym20_accuracy.pdf}
\hfill
\includegraphics[width=0.495\textwidth]{figures/cifar100_sym20_purity.pdf}
\caption{CIFAR-100 with SYM-20\%}
\label{fig:cifar100_sym20}
\end{subfigure}
\begin{subfigure}[t]{0.495\linewidth}
\includegraphics[width=0.495\textwidth]{figures/cifar100_sym60_accuracy.pdf}
\hfill
\includegraphics[width=0.495\textwidth]{figures/cifar100_sym60_purity.pdf}
\caption{CIFAR-100 with SYM-60\%}
\label{fig:cifar100_sym60}
\end{subfigure}
\caption{Illustration of last accuracy and memory purity changes as the task number increases on CIFAR-100 with SYM-\{20\%, 60\%\}.}
\label{fig:cifar100_appendix_result}
\end{figure*}
\begin{figure*}[h!]
\centering
\begin{subfigure}[t]{0.25\linewidth}
\includegraphics[width=\textwidth]{figures/diversity_vs_purity_sym20.pdf}
\caption{}
\label{fig:cifar10_sym20_div_pur}
\end{subfigure}
\hspace{1em}
\begin{subfigure}[t]{0.25\linewidth}
\includegraphics[width=\textwidth]{figures/diversity_vs_purity_sym40.pdf}
\caption{}
\label{fig:cifar10_sym40_div_pur}
\end{subfigure}
\hspace{1em}
\begin{subfigure}[t]{0.25\linewidth}
\includegraphics[width=\textwidth]{figures/diversity_vs_purity_sym60.pdf}
\caption{}
\label{fig:cifar10_sym60_div_pur}
\end{subfigure}
\caption{Illustration of diversity and purity in the memory as the coefficient $\alpha$ changes on CIFAR-10 with (a) SYM-20\%, (b) SYM-40\%, and (c) SYM-60\%. }
\label{fig:cifar10_diversity_vs_purity}
\end{figure*}
\begin{figure*}[h!]
\centering
\begin{subfigure}[t]{0.25\linewidth}
\includegraphics[width=\textwidth]{figures/cifar100_diversity_vs_purity_sym20.pdf}
\caption{}
\label{fig:cifar100_sym20_div_pur}
\end{subfigure}
\hspace{1em}
\begin{subfigure}[t]{0.25\linewidth}
\includegraphics[width=\textwidth]{figures/cifar100_diversity_vs_purity_sym40.pdf}
\caption{}
\label{fig:cifar100_sym40_div_pur}
\end{subfigure}
\hspace{1em}
\begin{subfigure}[t]{0.25\linewidth}
\includegraphics[width=\textwidth]{figures/cifar100_diversity_vs_purity_sym60.pdf}
\caption{}
\label{fig:cifar100_sym60_div_pur}
\end{subfigure}
\caption{Illustration of diversity and purity in the memory as the coefficient $\alpha$ changes on CIFAR-100 with (a) SYM-20\%, (b) SYM-40\%, and (c) SYM-60\%. }
\label{fig:cifar100_diversity_vs_purity}
\end{figure*}
\section{Diversity vs. Purity}
\label{app:div_pur}
To analyze how diversity and purity in a memory change according to coefficient $\alpha$, we plot the diversity and purity metrics (defined in \bmp{Eq. 12}) in Fig.~\ref{fig:cifar10_diversity_vs_purity} and \ref{fig:cifar100_diversity_vs_purity} for various noise ratios.
As hyper-parameter $\alpha$ increases, the diversity score increases while the purity score decreases in all figures.
When $\alpha$ is increased beyond a certain value, it can be seen that purity is sacrificed for the sample diversity.
If there are too many noisy labels in a memory, a trained model would inevitably learn the noisy labels, which can lead to performance degradation.
Therefore, the best strategy is to set the $\alpha$ before the abrupt decrease in the purity score.
For example, in Fig.~\ref{fig:cifar10_sym20_div_pur} and \ref{fig:cifar10_sym40_div_pur}, memory purity is over 95\% until $\alpha=0.5$, and then falls to less than 50\% when $\alpha$ is set to 0.6.
Thus, the best strategy for balancing the diversity and memory purity can be obtained at $\alpha=0.5$.
Meanwhile, in the case of Fig.~\ref{fig:cifar10_sym60_div_pur}, memory purity drops to 70\% at $\alpha=0.5$, so it can be expected that the best performance is obtained at $\alpha=0.3$, before memory purity is too much degraded.
This is because memory purity becomes more important as the ratio of noisy labels contained in memory increases.
These results are consistent with the results in \bmp{Tab. 4}.
\begin{table}[t!]
\centering
\caption{Comparison of our method and SPR in disjoint setup.}
\vspace{-1em}
\label{tab:comp_spr}
\resizebox{1.0\linewidth}{!}{%
\begin{tabular}{@{}lrrrrrc@{}}
\toprule
& \multicolumn{5}{c}{CIFAR-10} & \multicolumn{1}{c}{WebVision} \\
\cmidrule(lr){2-6} \cmidrule(lr){7-7}
& \multicolumn{3}{c}{Sym.} & \multicolumn{2}{c}{Asym.} \\
Methods &
\multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & \multicolumn{1}{c}{60} & \multicolumn{1}{c}{20} & \multicolumn{1}{c}{40} & Real \\
\cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-7}
Self-Centered filter [\bmp{17}] & 36.5 & 35.7 & 32.5 & 37.1 & 36.9 & 33.0 \\
Self-Replay [\bmp{17}] & 40.1 & 31.4 & 22.4 & 44.1 & 43.2 & 48.0 \\
SPR [\bmp{17}] & 43.9 & 43.0 & 40.0 & 44.5 & 43.9 & 40.0 \\
\cmidrule(lr){1-1} \cmidrule(lr){2-4} \cmidrule(lr){5-6} \cmidrule(lr){7-7}
\textbf{PuriDivER\xspace} (Ours) & \textbf{61.2} & \textbf{60.9} & \textbf{56.0} & \textbf{62.4} & \textbf{46.4} & \textbf{51.8} \\
\bottomrule
\end{tabular}
}
\vspace{-0.2em}
\end{table}
\section{Comparison to SPR in Disjoint Tasks}
\label{app:spr}
As SPR [\bmp{17}] is proposed for similar task setup, we compare our PuriDivER\xspace to SPR [\bmp{17}] in the disjoint setup for which the SPR is proposed, and summarize the results in Tab.~\ref{tab:comp_spr}.
Following their experimental setup, we configure five tasks with randomly paired classes for CIFAR-10, %
and use the top 14 largest classes in seven tasks with randomly paired classes for WebVision.
SPR uses two different memories; a delayed buffer, which the incoming data is saved temporarily, and a purified buffer which maintains purified data, and a fixed memory size of 500 or 1,000 for CIFAR-10 or WebVision, respectively.
As the delayed buffer is only utilized to auxiliary model (called Self-Replay Model) to use only purified examples for model training, their actual memory size is $2\times$ of the episodic memory.
Hence, we set memory size as 1,000 and 2,000 in CIFAR-10 and WebVision for fair comparison.
Interestingly, PuriDivER\xspace outperforms SPR by 3\%-18\% in all experiments (Tab.~\ref{tab:comp_spr}).
We believe it is because the SPR always purifies incoming contaminated data stream before training the model, but it has a high risk of overfitting by false model predictions.
\end{document} | {'timestamp': '2022-03-31T02:19:31', 'yymm': '2203', 'arxiv_id': '2203.15355', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15355'} | arxiv |
\section{Neurons and Synapses}
Neuronal representations at various spatiotemporal scales are critical for neural computation within the mammalian nervous system which includes information processing at cellular scales such as synaptic transmission between individual synapses or groups of synapses across membranes such as dendrites, axonal transmission between axons terminals and cell bodies called perikarya or soma within a neuron cell body, intraneuronal dendritic compartments, interneuronal compartments. From subcellular organelles to neural ensembles; from ion channels localized clusters composed mainly of two subunits each, namely ion channels (see Section 2) organized into tetramers each having 4 pore domains connected together by intracellular linkages such those found throughout neuronal systems. From molecular genetic perspectives, many questions regarding how cells process sensory information have led researchers to focus their attention towards identifying genes coding for proteins which regulate neurotransmission \cite{1}. Specifically, this is due to a need to understand how emergent properties emerge from these network structures at multiple spatiotemporal
scales. One such cellular automaton-based model has been proposed earlier. \cite{2} Spiking Neurons provide answers because they produce high frequency signals encoding sensory stimuli during synaptic communication where neurotransmitters induce either opening or closing ion channels allowing ions flow through open gates inducing an allosteric change permitting influxes/effluxes upon depolarization/hyperpolarization states thereby producing an action potential spike representing an encoded symbol according to its timing over time.
\bigskip
Over the past decades scientists have sought ways develop mathematical constructs able describe voltage dynamics within neurones thereby providing insight into their functionality including modeling single neuron response curves mathematically using first principles describing input parameters derived from empirical data points obtained via invasive techniques which involves recording extracellularly potentials directly related to membrane potentials along dendritic arborizations which can be considered equivalent computationally speaking if not identical; given its ability perform computations via differential equations.
\section{Ion Channels and Transporters - The Building Blocks Of Brain Function And Disease}
Ionic currents carried out by selective transmembrane proteinaceous pores play crucial roles inside living cells involved in maintaining homeostatic equilibrium known collectively as homeostasis. \cite{3} Many disorders including epilepsy, autism, schizophrenia, Alzheimer’s disease have been linked directly or indirectly via mutations disrupting ionic channel function.\cite{4}\cite{5}\cite{6}\cite{7}\cite{8}\cite{9}\cite{10} Current interests involve studying single channel properties however it has become more tractable now because its open probability is affected mostly by an electrical signal transmitted through other types of gated receptor like ligand gated receptors (Ligand binding domain – LBD – GPCR signaling). Currents carried out by selective transmembrane proteinaceous pores play crucial roles inside living cells involved maintaining homeostasis.
\section{Networks Of Neuron Cell Assemblies With Multiple Levels Of Compartmentalization}
Network modeling can be used either topologically describing links among individual elements constituting nodes within a network,or mathematically using equations based upon continuous space differential equations that describe dynamics over time. Network Analysis provides quantitative measures related to functional connectivity allowing inferences about structure-function relationships. For example, functional connectivity reflects topological specificity. \cite{11}
Network analysis refers either structural relations defined among elements forming connections using anatomical tracing techniques wherein fibers are visualized microscopically following histological staining \cite{12,13,14} or functional relations defined according data obtained through mathematical analysis; e g fMRI images reflecting statistical fluctuations during resting state EEG activity corresponding respectively anatomical structure formation through growth and development,or dynamical self organization via interaction. Network Analysis provides quantitative measures related to functional connectivity allowing inferences about structure-function relationships. \cite{15,16}
\section{Large Scale Integration Across Multiple Layers As Well As In Vivo Connectomes}
Large scale integration across multiple layers refers specifically to spatially distant cortical areas that interact functionally often called long range coupling. \cite{17} It contrasts with local computations referring specifically computation performed by spatially compact assemblies consisting mainly excitatory projection neurons located primarily in superficial laminae while also interacting with inhibitory interneurons embedded predominantly within deeper layers; thus representing feedforward input projections into local target pyramidal cells which are themselves reciprocally interconnected amongst one another often called horizontal interactions. Long Range coupling represents wide spectrum ranging from fast action potential propagation across small diameter unmyelinated axons typically of white matter tracts to slower electrical signalling mediated most notably by gap junctions between astroglial cells located adjacent pyramidal neurons where they provide support functions involving K+ recycling required for proper neuronal firing responseto synaptic input but not necessarily restricted thereto.
\section{Modeling Spatial Pattern Formation Including Self Organized Criticality}
One approach toward building functional networks within a larger brain structure such as cortex is by understanding how local microcircuits interact over space to form global behaviors. Therefore it is important not only to model the dynamics of single neurons but also their collective interactions over multiple time scales. This involves taking into account both the intrinsic dynamical properties of individual neurons such as firing rate adaptation and excitability through voltage gated ion channels and their specific morphological distributions or connection topology. In the previous work, \cite{1} it was discusses how cellular automata could account For the generation of global rhythmic patterns in brainwaves. For example if one neuron fires more frequently than another then its influence should be weighted more highly when modeling synaptic connections between two cells whose firing rates overlap. Such a formalism naturally leads toward self organized criticality (or fractal caused cellular automata) \cite{2} where an ensemble displays scale free behavior like those found throughout nature across many spatiotemporal scales ranging from earthquakes through avalanches during sleep cycles up until neuronal avalanche during seizures observed following traumatic brain injury (TBI) \cite{2}. Since many physiological phenomena display power law statistics one often refers back to statistical physics where they are known simply as critical.
\bigskip
Examples include phase transitions, magnetization profiles through spin glasses etc. While nonlinear differential equations cannot analytically derive critical states they can predict them numerically provided enough degrees freedom exist in order for them too have similar weights across different time lags making it less susceptible too external noise effects which would cause deviations away from a power law distribution, however stochastic terms must be introduced when considering single neuron systems even if just modelled stochastically so that they remain at least marginally stable against large changes due simply because there was never really any external input/noise imposed upon them.
\bigskip
However such methods may result too strong once long range correlations start forming since they do not distinguish between high activity events produced by temporally correlated inputs vs uncorrelated inputs which can induce spurious correlations along other dimensions within the system leading eventually towards synchronization (refer \cite{2}) rather than dephasing among cells which seems counter intuitive since synchrony indicates relatively higher levels of information flow within each particular cell group but does not imply any meaningful communication among different cell groups; furthermore increased levels synchrony may actually represent instability instead since synchronization tends toward producing coherent signals while desynchronization produces incoherent signals except under very special circumstances wherein some amount of synchrony remains especially when oscillations occur within certain frequency bands thereby allowing coupling via oscillatory entrainment between coupled oscillators producing coherent signals.
\section{STP IN NEURAL NETWORKS}
Most existing neurobiologically motivated neural network simulations are typically focused at an average level where most synapses have identical dynamics so that averaged quantities such as synaptic currents can be simply computed by adding up presynaptic spikes convolved by postsynaptic potentials or currents. However, significant variability is often observed within single synapses which suggests that synapse specific behaviors might be important.
\bigskip
Furthermore, different synapse types exhibit widely varying decay time constants ranging from seconds down to milliseconds, which cannot all be described by averaging over an ensemble distribution of long and short term plasticity type synapses together. Therefore it is necessary to incorporate into simulations more detailed biologically realistic forms for synaptic weights like spike timing dependent plasticity (STDP) or use stochastic rules like those used earlier for modeling spike count driven learning in analog systems where memory units compete through a {Global Fitness Function} rather than local changes driven solely by synaptic strength such as those presented previously.
\bigskip
Synaptic dynamics naturally lead one naturally into thinking about various kinds of randomness involved here including randomness introduced via noisy spiking events which may occur sporadically during ongoing activity or randomly at each firing event across a broad frequency range depending upon whether postspike refractoriness occurs or not. This leads naturally into further speculation about what kinds of intrinsic noise could exist inside biological neurons themselves given their active membranes---many studies have shown various degrees and sources/sources giving rise to noise throughout neuronal membranes - some very low levels while others higher but still subthreshold levels depending upon context. For example, fast voltage gated ionic channels introduce high levels discrete noise whose statistics reflect certain aspects of underlying channel behavior whereas other slow channels do not fluctuate greatly across membrane potential values thus creating small amplitude white shot noise whose statistics depend on membrane capacitance.
\bigskip
Note too how this discussion starts getting pretty abstract here especially when looking beyond cell membranes towards dendritic spines where even more complicated biochemical effects must take place eventually leading ultimately perhaps back again towards simplified neuron model simulations? At least something along these lines can be observed when looking at two competing theories describing structural vs nonspatial learning theories starting off with point neuron model simulation experiments designed primarily around differences between Hebbian theory's maximization principle versus Anti Hebbian theory's minimization principle followed then later shifting attention away from differential equations towards more direct use within simpler particle swarm optimization techniques wherein a number representing fitness could change according to temporal evolution via gradient descent techniques implemented through evolutionary procedures.\cite{18,19,20,21,22,23} We leave this part for future discussion.
\section{PDNF Models Simulating Brain Connectivity Densities Using Computational Approaches}
Computational modeling studies have played an important role not only when examining cellular level features such as single neuron dynamics but also when investigating large scale system level functions including information processing by ensembles. For simple models, there have been proposals consisting only two populations or layers 1 and 2 interacting via spike timing dependent synaptic plasticity (STDP). These show that after repeated trials even though individual layer 1 neurons do not exhibit any particular behavior like learning they still generate useful outputs when used in larger groups because they induce layer 2 cells into synchronization via their interaction through STDP. While this is similar conceptually to many learning rules used currently it highlights the fact that just because individual units are not exhibiting any specific computation does not mean that they may be unable to perform useful computations together once placed within a more global context which introduces additional parameters such as structure formation within network.
\bigskip
Recently it has been proposed that since real world inputs are highly variable spatially over space and time nonlinearity plays an important role particularly at higher cognitive levels so it seems reasonable therefore to examine what effects nonlinearly induced spatial patterns can have at higher levels of neuronal activity. \cite{24,25,26} To investigate this phenomenon one needs to study local excitatory connections involving spiking neural networks among neocortical pyramidal cells where excitatory synapses were distributed according to various inhomogeneous probability distributions corresponding roughly speaking either planar projections like those found between retinal ganglion cells or 3D isotropic volumes like those observed between cortical pyramidal cells thereby creating local connection topologies resembling random graphs or small world graphs respectively.
\bigskip
In addition, long term depression (LTD) induction under certain conditions depending upon local excitation relative inhibition (E/I) ratios result specifically altering dendritic depolarization patterns could lead eventually to changes at the neuronal level due primarily alterations made locally during LTP induction cycles especially if occurring across multiple layers simultaneously thereby suggesting one means through which synapse placement could contribute towards emergence/formation of criticality phenomena during development.\cite{2}
\bigskip
Also in the past, it had been demonstrated using single compartment biophysical simulations incorporating realistic synaptic delays \cite{27} along dendrites where postsynaptic current densities vary inversely proportional to intercellular distances corresponding, generally speaking, with either GABAergic inhibition being relatively sparse compared with excitation or vice versa found significant evidence supporting theories about autism related disorders especially given previously reported anatomical abnormalities along apical dendrites \cite{28, 29} near perisomatic regions among autistic individuals although more detailed experimental testing would be required before conclusions regarding autism pathophysiology could be drawn.
\bigskip
Several other recent advances include theoretical treatments linking fractal geometry together with neuronal calcium currents \cite{30} producing self organizing wave forms using Hodgkin Huxley type equations. These ideas might eventually play a role in learning abilities especially relating toward memory formation based upon its ability for generating robust low frequency oscillation patterns seen experimentally during slow wave sleep. Other similar types of theoretical treatments include modeling aspects related towards epilepsy mechanisms whereby inhibitory interneuron induced synchronization phenomena mediated through electrical coupling between neighboring cells may ultimately lead into epileptogenic burst firing behavior particularly among thalamo cortical projection systems whereby inhibitory feedback loops may cause abnormal synchronous oscillations capable potentially causing seizures resulting from abnormally increased numbers and synchrony strength while perhaps conversely bursts occurring asynchronously rather than being precisely locked onto each other's discharge times caused weaker entrainment leading into decreased synchronized oscillatory activities possibly preventing seizure generation altogether suggesting various possible treatment options aimed primarily toward reduction instead regulation control methods taking advantage largely from nonlinear characteristics
\section{Conclusion: The Path Forward}
Computational neuroscience has made significant strides over the past few decades towards understanding how neural circuits encode information about sensory inputs into observable behaviours, and recently it has expanded its scope to investigate higher cognitive functions like language, decision making, motor control, social cognition. Much progress was facilitated by new experimental techniques such as optogenetics which allowed precise stimulation or inhibition of specific cell types within neural circuits in vivo leading to breakthroughs not possible before ephys recordings became feasible at sufficiently high bandwidths ($>$ 1 KHz). While these techniques were critical for uncovering mechanisms behind computations performed by individual cells or small neuronal populations inside living brains, they typically require invasive manipulation through electrodes/optical fibers implanted inside the cortex or sensory organ such that manipulations cannot be readily generalized across species nor across different individuals within a given species without substantial training time prior experimentation.
\bigskip
Additionally, extracellular electrodes used in ephys recording usually have low signal quality compared with microelectrodes used for intracellular recording so they are not suitable for single neuron electrophysiology recordings needed to study activity dependent synaptic plasticity which requires minimal levels background noise/interference during long durations acquisition sessions spanning minutes up hours during development or days during adulthood due increased habituation caused by elevated levels of calcium transients associated with activity dependent plasticity often measured using fluorescent calcium indicators.
\bigskip
In contrast microfabrication technology developed over past two decades enables construction and implementation of devices called 'neural probes' capable measuring cellular electrical activities from submicron thin membranes embedded within biologically compatible polymer layers fabricated onto silicon wafers compatible with fabrication methods commonly used by semiconductor industry; when inserted into brains in vivo, their electrochemical interfaces offer stable electrochemical measurements capable of resolving single action potentials firing events along individual neurons down 10--20 microns deep below cortical surface enabling measurement more closely matching what happens inside living brains than ever before allowing researchers unprecedented access into inner workings physiological details underlying behaviorally relevant computations performed inside human beings especially when combined simultaneously along many parallel paths rather than focusing on individual aspects alone; once prototyped onto wafer substrates through application specific integrated circuit (ASIC) manufacturing methods leveraging CMOS compatibility available commercially today they can also be repurposed into commercial devices marketed worldwide already serving countless diverse industrial sectors ranging from healthcare monitoring through agriculture bioengineering.
\bigskip
Despite tremendous potential afforded them by availability via commercialization thousands already existing designs implemented all around you probably never knew existed but may soon become widely adopted technologies providing society previously impossible scale economies favoring cost effectiveness when scaling production exponentially; design efforts therefore have shifted away form reliance solely on electronic design automation software suites incorporating rules written directly against transistor level schematics now easily replicated quickly even if schematics change requiring recompiling again triggering generation update cycles often taking days until final product shipped whereas hardware engineering revolves around fabricating chips either manually one after another ad nauseam after spending weeks sketching out initial idea followed immediately afterwards months later waiting anxiously until device arrived only then proceed manually writing code against it carefully documenting each step being taken every day driving productivity rapidly towards end goal much faster than software tool suite counterparts.
\end{multicols}
\bibliographystyle{plain}
| {'timestamp': '2022-04-15T02:24:11', 'yymm': '2203', 'arxiv_id': '2203.15415', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15415'} | arxiv |
\section{Introduction}
\label{sec:introduction}
The segmentation of continuous speech is one process required for speech translation (ST).
In text-to-text machine translation (MT), an input text is usually segmented into sentences using punctuation marks as boundaries.
However, such explicit boundaries are unavailable in ST.
Pre-segmented speech in a bilingual speech corpus can be used when training an ST model, but not in realistic scenarios.
Since existing ST systems cannot directly translate long continuous speech, automatic speech segmentation is needed.
\par
Pause-based segmentation using voice activity detection (VAD) is commonly used for segmenting speech for preprocessing automatic speech recognition (ASR) and ST, even though pauses do not necessarily coincide with semantic boundaries.
Over-segmentation, in which a silence interval fragments a sentence, and under-segmentation, in which multiple sentences are included in one segment while ignoring a short pause, are problems that reduce the performances of ASR and ST \cite{wan2021segmenting}.
\par
In this study, we propose a novel speech segmentation method\footnote{
There is an independent work by Tsiamas et al., (2022) (https://arxiv.org/abs/2202.04774).} based on the segment boundaries in a bilingual speech corpus.
ST corpora usually include bilingual text segment pairs with corresponding source language speech segments.
If we can similarly segment input speech to such ST corpora, we might successfully bridge the gap between training and inference.
Our proposed method uses a Transformer encoder \cite{vaswani2017attention} that was trained to predict segment boundaries as a frame-level sequence labeling task for speech inputs.
\par
The proposed method is applicable to cascade and end-to-end STs because it directly segments speech.
Cascade ST is a traditional ST system that consists of an ASR model and a text-to-text MT model.
An end-to-end ST uses a single model to directly translate source language speech into target language text.
We limit our scope to a conventional end-to-end ST, which treats segmentation as an independent process from ST.
Integrating a segmentation function into end-to-end ST is future work.
\par
We conducted experiments with cascade and end-to-end STs on MuST-C \cite{di2019must} for English-German and English-Japanese.
In the English-German experiments, the proposed method achieved improvements of -9.6 WER and 3.2 BLEU for cascade ST and 2.7 BLEU for end-to-end ST compared to pause-based segmentation.
In the English-Japanese experiments, the improvements were -9.6 WER and 0.5 BLEU for cascade ST and 0.6 BLEU for end-to-end ST.
A hybrid method with the proposed segmentation model and VAD further improved both language pairs.
\section{Related work}
Early studies on segmentation for ST considered modeling with the Markov decision process \cite{mansour2010morphtagger, sinclair2014semi}, conditional random fields \cite{nguyen-vogel-2008-context, lu2010better}, and support vector machines \cite{diab-etal-2004-automatic, sadat-habash-2006-combination, matusov-etal-2007, rangarajan-sridhar-etal-2013-segmentation}.
They focused on cascade ST systems that consist of an ASR model and a statistical machine translation (SMT) model, which were superseded by newer ST systems based on neural machine translation (NMT).
\par
In recent studies, many speech segmentation methods based on VAD have been proposed for ST.
Gaido et al. \cite{DBLP:journals/corr/abs-2104-11710} and Inaguma et al. \cite{inaguma-etal-2021-espnet} used the heuristic concatenation of VAD segments up to a fixed length to address the over-segmentation problem.
Gállego et al. \cite{gallego2021end} used a pre-trained ASR model called wav2vec 2.0 \cite{baevski2020wav2vec} for silence detection.
Yoshimura et al. \cite{yoshimura2020end} used an RNN-based ASR model to consider consecutive blank symbols (``\_") as a segment boundary in decoding using connectionist temporal classification (CTC).
Such CTC-based speech segmentation has an advantage; it is easier to intuitively control segment lengths than with a conventional VAD
because the number of consecutive blank symbols that is considered a boundary can be adjusted as hyperparameters.
However, these methods often split audio at inappropriate boundaries for ST because they mainly segment speech based on long pauses.
\par
Re-segmentation using ASR transcripts is widely used in cascade STs.
Improvements in MT performance have been reported by re-segmenting transcriptions to sentence units using punctuation restoration \cite{lu2010better, rangarajan-sridhar-etal-2013-segmentation, cho2015punctuation, ha2015kit, cho17_interspeech} and language models \cite{stolcke1996automatic, wang2016efficient}.
Unfortunately, they are difficult to use in end-to-end ST and cannot prevent ASR errors due to pause-based segmentation.
We discuss ASR degradation due to speech segmentation with VAD in section \ref{subsec:results-baselines}.
\par
Finally, we refer to speech segmentation methods based on segmented speech corpora that are more relevant to our study.
Wan et al. \cite{wan2021segmenting} introduced a re-segmentation model for modifying the segment boundaries of ASR output using movie and TV subtitle corpora.
Wang et al. \cite{wang2019online} and Iranzo-Sánchez et al. \cite{iranzo-sanchez-etal-2020-direct} proposed an RNN-based text segmentation model using the segment boundaries of a bilingual speech corpus.
Unlike these methods that require ASR transcripts, our proposed method directly segments speech and can be used in an end-to-end ST as well as in a cascade ST.
\section{Proposed method} \label{sec:method} Our method defines speech segmentation as a frame-level sequence labeling task of acoustic features.
This section describes the following details of it: the process that extracts training data for the speech segmentation task from the speech translation corpus (\ref{subsec:data}), the architecture of the proposed model (\ref{subsec:model}), and the training (\ref{subsec:training}) and inference algorithms (\ref{subsec:inference}).
\subsection{Data extraction} \label{subsec:data}
We use a bilingual speech corpus that includes speech segments aligned to sentence-like unit text as training data for speech segmentation from continuous speech into units suitable for translation.
Data extraction examples are shown in Fig. \ref{fig:sample}.
Two consecutive segments are concatenated and assigned a label, $x\in\{0, 1\}$, representing that the corresponding frame is inside (0) and outside (1) of the utterance.
\setlength\textfloatsep{15pt}
\begin{figure}[t]
\centering
\includegraphics[keepaspectratio, width=7.7cm]{figures/data_extraction.pdf}
\caption{Data extraction examples from MuST-C: Labels 0 and 1 are assigned to each FBANK frame based on each segment's starting and ending times.}
\label{fig:sample}
\end{figure}
\subsection{Segmentation model} \label{subsec:model}
The architecture of the proposed speech segmentation model is illustrated in Fig. \ref{fig:model}.
It consists of a 2D convolution layer, Transformer encoder layers, and an output layer (Linear+Softmax), which outputs label probability $\hat{x}_n\in R^2$ at the $n$-th frame of the convolution layer.
The convolution layer reduces the sequence length by a quarter to handle long speech sequences.
Downsampling is applied to teacher label $x$ to align its length with the model’s output.
Here, labels are simply extracted at regular time intervals calculated from the input-output length ratio.
\begin{figure}[t]
\centering
\includegraphics[keepaspectratio, width=5.9cm]{figures/model.pdf}
\caption{Transformer encoder-based speech segmentation model}
\label{fig:model}
\end{figure}
\subsection{Training} \label{subsec:training}
The model is trained using the data extracted in section \ref{subsec:data} and
learns to minimize cross-entropy loss $\mathcal{L}_{seg}(\hat{x},x)$ between prediction $\hat{x}$ and label $x$:
\begin{equation}
\label{eq:loss}
\begin{split}
\mathcal{L}_{seg}(\hat{x},x):=-\sum_{n=1}^N\left\{
w_s\log\frac{\exp(\hat{x}_{n,1})}{\exp(\hat{x}_{n,0}+\hat{x}_{n,1})}x_{n,1}\right. \\
\left.+~(1-w_s)\log\frac{\exp(\hat{x}_{n,0})}{\exp(\hat{x}_{n,0}+\hat{x}_{n,1})}x_{n,0}
\right\}
\end{split},
\end{equation}
where $w_s$ is a hyperparameter that adjusts the weights of the unbalanced labels.
Since most of the labels are $0$ (within utterances), we increase the weight on the loss of label $1$ (outside utterances).
We set $w_s=0.9$ based on the best loss of the validation data in a preliminary experiment.
\subsection{Inference} \label{subsec:inference}
During inference, speech is segmented at a fixed-length $T$ and input independently into the segmentation model.
Fixed-length segments are then resegmented according to the labels predicted by the segmentation model.
The segmentation model simply selects label $l_n \in \{0,1\}$ with the highest probability at each time $n$:
\begin{equation}
\label{eq:single}
l_n := \mathop{\rm arg~max}\limits(x_n).
\end{equation}
\subsubsection{Hybrid method} \label{subsubsec:hybrid}
In addition, to make the predictions more appropriate, we combined the model predictions calculated in Eq. (\ref{eq:single}) with the results of the VAD tool:
\begin{equation}
\label{eq:hybrid}
l_n := \left\{
\begin{array}{ll}
\mathop{\rm arg~max}\limits(x_n) \land \mathrm{vad}_n & (len(n-1) < maxlen) \\
\mathop{\rm arg~max}\limits(x_n) \lor \mathrm{vad}_n & (len(n-1) \geq maxlen), \\
\end{array}
\right.
\end{equation}
where $\mathrm{vad}_n \in \{0,1\}$ is the VAD output at time $n$, corresponding to the active and inactive frames.
Segment length $len(n) $ at time $n$ is denoted as follows:
\begin{equation}
len(n) := \left\{
\begin{array}{lr}
len(n-1) + 1&(l_n = 1) \\
0&(l_n = 0) \\
\end{array},
\right.
\end{equation}
where $len(0) := 0$.
Eq. (\ref{eq:hybrid}) implies that a frame can only be included in a segment boundary when segmentation model \textbf{and} VAD agree.
This agreement constraint may result in very long segments, so we relax it not to require the agreement once the segment length exceeds $maxlen$.
In that case, a frame can be included in a segment boundary if either the segmentation model \textbf{or} the VAD allows it.
\section{Experimental setup}
\subsection{Tasks} \label{subsec:task}
We conducted experiments with English to German and English to Japanese ST.
We used MuST-C v1 for the English-German and v2 for the English-Japanese experiments.
Each dataset consisted of triplets of segmented English speech, transcripts, and target language translations.
The English-German and English-Japanese datasets contained about 230k and 330k segments.
As acoustic features, we used 83-dimensional vectors consisting of an 80-dimensional log Mel filterbank (FBANK) extracted by Kaldi\footnote{https://github.com/kaldi-asr/kaldi} and 3-dimensional pitch information.
We preprocessed the text data with Byte Pair Encoding (BPE) to split the sentences into subwords with SentencePiece \cite{kudo2018sentencepiece}.
A dictionary with a vocabulary of 8,000 words was shared between the source and target languages.
\par
To evaluate the performance, we aligned the outputs of a model for automatically segmented speeches by each segmentation method (section \ref{subsec:method}) to the reference text with an edit distance-based algorithm \cite{matusov2005evaluating}.
We then calculated WER for ASR and BLEU for MT and ST.
\renewcommand{\arraystretch}{1.1}
\begin{table}[t]
\centering
\caption{Model settings: {\dag}version 0.10.3}
\label{table:config}
\begin{tabular}{|l|clc|}
\hline
Settings (ESPnet{\dag} options) & \multicolumn{1}{c|}{ASR} & \multicolumn{1}{l|}{ST} & \multicolumn{1}{l|}{MT} \\ \hline\hline
Epochs (epochs) & \multicolumn{1}{c|}{45} & \multicolumn{2}{c|}{100} \\ \hline
Encoder layers (elayers) & \multicolumn{2}{c|}{12} & 6 \\ \hline
Decoder layers (elayers) & \multicolumn{3}{c|}{6} \\ \hline
FNN dimensions (eunits, dunits) & \multicolumn{3}{c|}{2048} \\ \hline
Attention dimensions (adim) & \multicolumn{3}{c|}{256} \\ \hline
Attention heads (aheads) & \multicolumn{3}{c|}{4} \\ \hline
Mini-batch (batch-size) & \multicolumn{2}{c|}{64} & 96 \\ \hline
Gradient accumulation (accum-grad) & \multicolumn{2}{c|}{2} & 1 \\ \hline
Gradient clipping (grad-clip) & \multicolumn{3}{c|}{5} \\ \hline
Learning rate (transformer-lr) & \multicolumn{1}{c|}{5} & \multicolumn{1}{l|}{2.5} & 1 \\ \hline
\begin{tabular}[c]{@{}l@{}}Warmup\\ (transformer-warmup-steps)\end{tabular} & \multicolumn{3}{c|}{25000} \\ \hline
Label smoothing (lsm-weight) & \multicolumn{3}{c|}{0.1} \\ \hline
Attention dropout (dropout-rate) & \multicolumn{3}{c|}{0.1} \\ \hline
\end{tabular}
\end{table}
\subsection{ST systems} \label{subsec:st}
We used the Transformer implementation of ESPnet\footnote{https://github.com/espnet/espnet} \cite{watanabe2018espnet, inaguma-etal-2020-espnet} to build the ASR and MT models for the cascade ST and an ST model for the end-to-end ST.
For the ASR and ST models using acoustic features as input, we added a 2D-convolution layer before the transformer encoder layers.
The model settings are shown in Table \ref{table:config}.
We trained the ASR model with hybrid CTC/attention \cite{watanabe2017hybrid} that incorporates the CTC loss into the Transformer.
The weight on the CTC loss was set to 0.3.
The ST model parameters were initialized with the encoder of the ASR model.
The parameters of each model were stored for each epoch.
After training to the maximum number of epochs, we averaged the parameters of five epochs with the highest validation scores for evaluation.
\subsection{Segmentation methods} \label{subsec:method}
\subsubsection{Baseline 1: VAD}
As a baseline, we used WebRTC VAD, a GMM-based VAD.
We tried nine conditions in the range of \textit{Frame size}=\{10, 20, 30 ms\} and \textit{Aggressiveness}=\{1, 2, 3\}.
\subsubsection{Baseline 2: fixed-length}
Fixed-length is a length-based approach that splits speech at a pre-defined fixed length \cite{sinclair2014semi}.
Although over- and under-segmentations are likely to occur because the method does not take acoustic and linguistic clues into account, its advantage is that the segment length was kept constant.
We tried ten fixed-length settings with parameters ranging from 4 to 40 seconds at 4-second intervals.
\subsubsection{Speech segmentation optimization}
We performed speech segmentation using our proposed model described in section \ref{subsec:model}.
During training, two consecutive segments were concatenated, as described in section \ref{subsec:data}.
The model’s setting was almost identical as that of the ASR encoder shown in Table \ref{table:config}.
However, since the speech segment concatenation roughly doubles the average length of the input, we set the number of mini-batches to 32 and the number of gradient accumulations to 4.
Fixed-length $T$ of the input during the inference was set to 20 seconds based on the best score of the validation data.
\subsubsection{Hybrid method}
We also performed the hybrid method with our model and VAD, as introduced in section \ref{subsubsec:hybrid}.
For the hybrid method, we used a WebRTC VAD with (frame size, aggressiveness) = (10 ms, 2) and set \textit{maxlen} to ten seconds.
\begin{figure}[t]
\centering
\includegraphics[keepaspectratio, width=8cm]{figures/plot_wer_bleu.pdf}
\caption{Baseline scores on English-German cascade ST: Vertical axis indicates BLEU (left) and WER scores (right) for ASR and MT models.}
\label{fig:baseline}
\end{figure}
\section{Results and discussion}
\subsection{Baselines}
\label{subsec:results-baselines}
Figure \ref{fig:baseline} shows the ASR and MT results by cascade ST for each fixed-length.
For comparison, the scores for the setting with the highest BLEU of VAD are shown as straight lines (Best VAD).
With the fixed-length approach, WER and BLEU improved in proportion to the input length and deteriorated after reaching a certain length.
This result suggests that longer segments can prevent the degradation of the ASR and ST performances due to automatic segmentation.
On the other hand, we identified an upper limit to the segment length that the model successfully handled, which depends on its capability.
Therefore, automatic speech segmentation is important to prevent ST performance degradation.
In addition, the best VAD results were worse than the best fixed-length results (Best Fixed-length)\footnote{A similar trend was shown in a previous study \cite{DBLP:journals/corr/abs-2104-11710}.},
suggesting that over- and under-segmentation due to pause-based segmentation significantly reduced the ASR and ST performances.
\begin{table}[t]
\centering
\caption{Results measured in WER and BLEU for tst-COMMON on MuST-C English-German cascade and end-to-end ST.}
\label{table:ende}
\begin{tabular}{l|cc|c}
\hline
& \multicolumn{2}{c|}{Cascade ST} & End-to-end ST \\ \hline
& WER & BLEU & BLEU \\ \hline
Oracle & 12.60 & 23.59 & 22.50 \\ \hline
Best VAD & 30.59 & 17.02 & 16.40 \\
Best Fixed-length & 20.60 & 19.29 & 17.96 \\
Our model & 20.99 & 20.18 & 19.10 \\
~~+VAD hybrid & \textbf{19.06} & \textbf{20.99} & \textbf{19.87} \\ \hline
\end{tabular}
\end{table}
\begin{table}[t]
\centering
\caption{Results measured in WER and BLEU for tst-COMMON on MuST-C English-Japanese cascade and end-to-end ST.}
\label{table:enja}
\begin{tabular}{l|cc|c}
\hline
& \multicolumn{2}{c|}{Cascade ST} & End-to-end ST \\ \hline
& WER & BLEU & BLEU \\ \hline
Oracle & 9.30 & 12.50 & 10.60 \\ \hline
Best VAD & 25.81 & 9.26 & 8.14 \\
Best Fixed-length & 18.89 & 9.64 & 8.52 \\
Our model & 16.21 & 9.71 & 8.77 \\
~~+VAD hybrid & \textbf{13.67} & \textbf{10.60} & \textbf{9.24} \\ \hline
\end{tabular}
\end{table}
\subsection{Proposed method}
Table \ref{table:ende} shows the overall results of the English-German experiments.
Our model outperformed VAD and the fixed-length segmentations for both cascade and end-to-end STs.
Roughly speaking, there are improvements in +3 BLEU for the Best VAD and in +1 BLEU for the Best Fixed-length.
This suggests that our model can split the speech into segments that correspond to sentence-like units suitable for translation.
\par
In addition, the hybrid method with VAD significantly improved both cascade (-1.93 WER and +0.81 BLEU) and end-to-end STs (+0.77 BLEU).
We confirmed that a hybrid method with our model and VAD greatly improved the translation performance.
However, room for improvement remains compared to the oracle segments contained by the MuST-C corpus.
\par
Table \ref{table:enja} shows the overall results of the English-Japanese experiments.
They resemble those in English-German; our model outperformed the existing methods, and a hybrid with VAD achieved more significant improvements.
We conclude that the proposed method is also effective for distant language pairs.
\begin{table}[t]
\centering
\caption{Example of ASR and MT outputs with segmentation positions: $\blacksquare$ indicates segment boundaries.}
\label{table:case-exp}
\begin{tabularx}{\linewidth}{p{23.7mm}|X} \hline
\textbf{Oracle (ASR)} &
\textit{bonobos are together with chimpanzees you aposre living closest relative $\blacksquare$} \\
\textbf{Oracle (MT)} &
\textit{Bonobos sind zusammen mit Schimpansen, Sie leben am nachsten Verwandten. $\blacksquare$} \\ \hline
\textbf{Best VAD (ASR)} &
\textit{bonobos are $\blacksquare$ together with chimpanzees you aposre living closest relative that ...} \\
\textbf{Best VAD (MT)} &
\textit{Bonobos sind es. $\blacksquare$ Zusammen mit Schimpansen leben Sie im Verhaltnis zum ...} \\ \hline
\textbf{Our model (ASR)} &
\textit{bonobos are together with chimpanzees you aposre living closest relative $\blacksquare$} \\
\textbf{Our model (MT)} &
\textit{Bonobos sind zusammen mit Schimpansen, Sie leben am nachsten Verwandten. $\blacksquare$} \\ \hline
\end{tabularx}
\end{table}
\begin{figure}[t]
\centering
\includegraphics[keepaspectratio, width=7cm]{figures/waveform.pdf}
\caption{Visualization of waveforms and segmentation positions}
\label{fig:case-wave}
\end{figure}
\subsection{Case study}
Table \ref{table:case-exp} shows an example of the ASR and MT outputs of the cascade ST using VAD and our segmentation model.
In VAD, more over- and under-segmentation occurred compared to the oracle segments.
In the example, the best VAD resulted in over-segmentation (``\textit{bonobos are $\blacksquare$ together}") and under-segmentation (``\textit{relative that ...}").
These errors caused differences in the oracle segments in the MT results.
On the other hand, our model split the speech at a boundary close to an oracle segment and obtained the same translation results.
\par
Figure \ref{fig:case-wave} shows an example of the waveforms and their segmentation positions.
The top two waveforms show that our model and VAD caused over-segmentation.
As the bottom waveform shows, hybrid decoding split the audio at a boundary near the oracle and
alleviated the problem by requiring an agreement between our model and the VAD.
\section{Conclusions}
We proposed a speech segmentation method based on a bilingual speech corpus.
Our method directly split speech into segments that correspond to sentence-like units to bridge the gap between training and inference.
Our experimental results showed the effectiveness of the proposed method compared to conventional segmentation methods on both cascade and end-to-end STs.
We also demonstrated that combining the predictions of our model and VAD further improved the translation performance.
\par
Future work will integrate a segmentation function into an end-to-end ST.
In this study, we treated segmentation as an independent process from ST, although it should be included in the \emph{end-to-end} ST.
We will investigate ways to integrate our proposed segmentation method into ST for streaming or online processing.
Future work will also further investigate different domains, other language pairs, and noisy environments and improve the segmentation model to reduce the need for VAD.
\section{Acknowledgements}
Part of this work was supported by JST SPRING Grant Number JPMJSP2140 and JSPS KAKENHI Grant Numbers JP21H05054 and JP21H03500.
\clearpage
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-07-14T02:09:45', 'yymm': '2203', 'arxiv_id': '2203.15479', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15479'} | arxiv |
\section{Introduction}
\label{sec:intro}
\begin{figure}[t]
\centering
{\includegraphics[width=1.0\linewidth]{intro_tight.pdf}}
\caption{
The comparisons of model outputs (logits) and Kullback–Leibler (KL) distance between two networks that are trained from scratch. Analysis is conducted on CIFAR100-LT dataset with Imbalanced Factor (IF) of 100.
The logits are visualized on the basis of a random selected example,
and the KL distance is computed based on the whole test set and then
the average results of each category are counted and reported.
Although the employed two networks have the same network structure and training settings,
their predictions differ largely from each other especially in tail classes.
Bested viewed in color.
}
\label{fig_intro}
\end{figure}
In recent years, deep neural networks have achieved resounding success in various visual tasks,
i.e., face analysis~\cite{wan2020multi,zhao2003face}, action and gesture recognition~\cite{Zhou_Li_Wan_2021,mitra2007gesture}.
Despite the advances in deep technologies and computing capability,
the huge success also highly depends on large well-designed datasets of having a roughly balanced distribution,
such as ImageNet~\cite{deng2009imagenet}, MS COCO~\cite{lin2014microsoft} and Places~\cite{zhou2017places}.
This differs notably
from real-world datasets, which usually exhibit
long-tailed data distributions~\cite{wang2017learning,liu2019large}
where few head classes occupy most of the data while many tail classes have only few samples.
In such scenarios, the model is easily dominated by those few head classes,
whereas low accuracy rates are usually achieved for many other tail classes.
Undoubtedly, the long-tailed characteristics challenges deep visual recognition,
and also immensely hinders the practical use of deep models.
In long-tailed visual recognition, several works focus on designing the class re-balancing strategies~\cite{tan2017efficient,tan2019attention,he2009learning,cui2019class,huang2016learning,wang2017learning} and decoupled learning~\cite{kang2019decoupling,cao2019learning}.
More recent efforts aim to improve the long-tailed learning by using multiple experts~\cite{xiang2020learning,wang2020long,li2020overcoming,cai2021ace,zhang2021test}.
The multi-expert algorithms follow a straightforward idea of complementary learning,
which means that different experts focus on different aspects
and each of them benefits from the specialization in the dominating part.
For example, LFME~\cite{xiang2020learning} formulates a network with three experts
and it forces each expert learn samples from one of head, middle and tail classes.
Previous multi-expert methods~\cite{wang2020long,xiang2020learning,cai2021ace},
however, only force each expert to learn the knowledge in a specific area,
and there is a lack of cooperation among them.
\iffalse
In long-tailed visual recognition, most early works focus on designing the class re-balancing strategies~\cite{he2009learning,buda2018systematic,cui2019class,huang2016learning,ren2018learning,wang2017learning}
to balance the contributions of training samples for all classes.
Although class re-balancing methods can obtain some accuracy improvements,
they are often confronted with risk of overfitting
due to the distortion in data distribution or high sensitivity of hyper-parameters.
Later, some researchers~\cite{kang2019decoupling,cao2019learning}
propose to decouple the network training into representation learning and classifier learning.
The decoupled learning can address the overfitting problem via a two-stage learning manner,
but the imbalanced data distribution issues have not been well handled especially
in the representation learning stage.
More recent efforts aim to improve the long-tailed learning by using multiple experts~\cite{xiang2020learning,wang2020long,li2020overcoming,cai2021ace,zhang2021test}.
The multi-expert algorithms follow a straightforward idea of complementary learning,
which means that different experts focus on different aspects
and each of them benefits from the specialization in the dominating part.
For example, LFME~\cite{xiang2020learning} formulates a network with three experts
and it forces each expert learn samples from one of head, middle and tail classes.
Multi-expert framework usually can achieve satisfactory recognition accuracy on long-tailed recognition since each of those experts is well learned on its own field.
\fi
Our motivation is inspired by a simple experiment as shown in Fig.~\ref{fig_intro},
where the different networks vary considerably, particularly in tail classes,
even if they have the same network structure and the same training settings.
This signifies the great uncertainty in the learning process.
One reliable solution to alleviate the uncertainty is
the collaborative learning through multiple experts, namely, that each expert can be a teacher to others and also can be a student to learn additional knowledge of others.
Grounded in this, we propose a Nested Collaborative Learning (NCL) for long-tailed visual recognition.
NCL contains two main important components, namely Nested Individual Learning (NIL)
and Nested Balanced Online Distillation (NBOD),
the former of which aims to enhance the discriminative capability of each network,
and the later collaboratively transfers the knowledge among any two experts.
Both NCL and NBOD are performed in a nested way,
where the NCL or NBOD conducts the supervised learning or distillation
from a full perspective on all categories, and also implements that
from a partial perspective of focusing on some important categories.
Moreover, we propose a Hard Category Mining (HCM) to select the hard categories as the important categories,
in which the hard category is defined as the category that is not the ground-truth category
but with a high predicted score and easily resulting to misclassification.
The learning manners from different perspectives are nested, related and complementary,
which facilitates to the thorough representations learning.
Furthermore, inspired by self-supervised learning~\cite{he2020momentum},
we further employ an additional moving average model for each expert to conduct self-supervision,
which enhances the feature learning in an unsupervised manner.
In the proposed NCL,
each expert is collaboratively learned with others,
where the knowledge transferring between any two experts is allowed.
NCL promotes each expert model to achieve better and even comparable performance to an ensemble's.
Thus, even if a single expert is used, it can be competent for prediction.
Our contributions can be summarized as follows:
\iffalse
Inspired by this, the online knowledge distillation is employed for cooperation.
Moreover, we further formulate a balanced form for the distillation
for long-tailed learning.
In addition to the collaborative learning, the individual learning is also important for each expert.
Besides the common supervised loss, e.g., Cross Entropy (CE) loss or
Balance Softmax Cross Entropy (BSCE) loss~\cite{ren2020balanced},
we propose a Hard Category Focus (HCF) to improve network's discriminative capability.
It differs from traditional losses (e.g., CE loss) that focus on all categories,
and it only pays attention to some important categories that are most difficult to distinguish.
Based on the HCF, we further formulate the online knowledge distillation as Dual Balanced Online Distillation (DBOD),
which distils the knowledge from dual levels, i.e., full category level and partial category level,
to complementary and comprehensively conduct the collaborative learning.
Finally, inspired by self-supervised learning~\cite{he2020momentum},
we further employ an additional moving average model for each expert to conduct self-supervision,
which enhances features learning in a unsupervised manner.
The goal of our multi-expert framework is to strengthen the capability of each expert via collaborative Learning.
In this way, both a single network and an ensemble can be employed for evaluation,
and the single model is promoted to achieve comparable performance to an ensemble's.
\fi
\iffalse
Considering the advantages of multi-expert strategy,
our method is also constructed following this scheme.
Previous multi-expert methods~\cite{wang2020long,xiang2020learning,cai2021ace}
force each expert to only learn the knowledge from a specific area,
and there is a lack of interactions and guidance from each other.
Different from those methods, our method employs a Multi-Expert Collaborative Learning (MECL) among experts
and encourages them to learn from each other.
The proposed MECL consists of following parts.
The first part is called individual supervised learning,
which employs the individual supervised loss (e.g., Cross Entropy (CE) loss or
Balance Softmax Cross Entropy (BSCE) loss~\cite{ren2020balanced} ) to learn individual features for each expert.
To let the learning be more effective,
we further propose a Hard Category Focus (HCF), which facilitates the network to pay attention to
the most difficult categories to distinguish.
The proposed HCF is highly complementary with the traditional supervised loss,
with one oriented to all categories and the other one to only partial categories.
To collaboratively learn multiple experts,
we propose a Dual Balanced Online Distillation (DBOD) to allow each expert model distillate knowledge from others.
The proposed DBOD is different from previous distillation methods~\cite{zhang2018deep,guo2020online}
in following aspects: 1) our DBOD is with balanced configuration targeted for long-tailed learning;
2) the distillation is conducted on dual levels, i.e., full category level and partial category level,
to complementary and comprehensively exploit discriminative features.
Moreover, inspired by self-supervised learning~\cite{he2020momentum},
we further employ an addition moving average model for each expert to conduct self-supervision,
which enhances features learning in a unsupervised manner.
The goal of the proposed MECL is to improve the discriminative capability of each expert model
via the collaborative Learning,
which promotes each model to achieve comparable performance to an ensemble's.
In this way, only one model is enough for forward prediction.
\fi
\iffalse
The method is motivated by some interesting experiments as shown in Fig.~\ref{}.
The experiments show that the predictions of different networks varies greatly although they are trained with same settings.
More interestingly, the performance on tail classes is dramatically improved when employing a simple ensemble of them,
which shows the complementary representations among those models.
Inspired with Deep Mutual Learning (DML)~\cite{zhang2018deep},
we propose an collaborative learning based on online knowledge distillation
which enables experts to gain extra knowledge from each other.
Moreover, ************
\fi
\begin{itemize}
\setlength{\itemsep}{1.0pt}
\item We propose a Nested Collaborative Learning (NCL) to collaboratively learn multiple experts concurrently, which allows each expert model to learn extra knowledge from others.
\item We propose a Nested Individual Learning (NIL) and Nested Balanced Online Distillation (NBOD)
to conduct the learning from both a full perspective on all categories and
a partial perspective of focusing on hard categories.
\item We propose a Hard Category Mining (HCM) to greatly reduce the confusion with hard negative categories.
\item The proposed method gains significant performance over the state-of-the-art on five popular datasets including CIFAR-10/100-LT,
Places-LT, ImageNet-LT and iNaturalist 2018.
\end{itemize}
\section{Related Work}
\label{sec:related}
\textbf{Long-tailed visual recognition.}
To alleviate the long-tailed class imbalance,
lots of studies ~\cite{zhou2020bbn,cao2020domain,xiang2020learning,ren2020balanced,wang2020long,ye2020identifying,liu2020memory}
are conducted in recent years. The existing methods for long-tailed visual recognition
can be roughly divided into three categories: class re-balancing~\cite{he2009learning,buda2018systematic,cui2019class,huang2016learning,ren2018learning,wang2017learning},
multi-stage training~\cite{kang2019decoupling,cao2019learning} and multi-expert methods~\cite{xiang2020learning,wang2020long,li2020overcoming,cai2021ace,zhang2021test}.
Class re-balancing, which aims to re-balance the contribution of each class during training,
is a classic and widely used method for long-tailed learning.
More specifically, class re-balancing consists of data re-sampling~\cite{chawla2002smote,kang2019decoupling},
loss re-weighting~\cite{lin2017focal,wang2021seesaw,ren2020balanced,tan2020equalization}.
Class re-balancing improves the overall performance but usually at the sacrifice of the accuracy on head classes.
Multi-stage training methods divide the training process into several stages.
For example, Kang et al.~\cite{kang2019decoupling} decouple the training procedure
into representation learning and classifier learning.
Li et al.~\cite{li2021self} propose a multi-stage training strategy constructed on basis of knowledge distillation.
Besides, some other works~\cite{menon2020long,zhang2021distribution} tend to improve performance via a post-process of shifting model logits.
However, multi-stage training methods may rely on heuristic design.
More recently, multi-expert frameworks receive increasing concern,
e.g., LFME~\cite{xiang2020learning}, BBN~\cite{zhou2020bbn}, RIDE~\cite{wang2020long}, TADE~\cite{zhang2021test} and ACE~\cite{cai2021ace}.
Multi-expert methods indeed improve the recognition accuracy for long-tailed learning,
but those methods still need to be further exploited.
For example, most current multi-expert methods employ different models
to learn knowledge from different aspects, while the mutual supervision among them is deficient.
Moreover, they often employ an ensemble of experts to produce predictions, which leads to a complexity increase of the inference phase.
\textbf{Knowledge distillation.}
Knowledge distillation is a prevalent technology in knowledge transferring.
Early methods~\cite{hinton2015distilling,passalis2018learning} often adopt an offline learning strategy,
where the distillation follows a teacher-student learning scheme~\cite{hinton2015distilling,furlanello2018born},
which transfers knowledge from a large teacher model to a small student model.
However, the teacher normally should be a complex high-capacity model and the training process may be cumbersome and time-consuming.
In recent years, knowledge distillation has been extended to an online way~\cite{zhang2018deep,guo2020online,chen2020online,dvornik2019diversity},
where the whole knowledge distillation is conducted in a one-phase and end-to-end training scheme.
For example, in Deep Mutual Learning~\cite{zhang2018deep}, any one model can be a student
and can distil knowledge from all other models.
Guo et al.~\cite{guo2020online} propose to use an ensemble of soft logits to guide the learning.
Zhu et al.~\cite{lan2018knowledge} propose a multi-branch architecture with treating each branch as a student to further reduce computational cost. Online distillation is an efficient way to collaboratively learn multiple models, and facilitates the knowledge transferred among them.
\textbf{Contrastive learning.}
Many contrastive methods~\cite{he2020momentum,chen2020improved,chen2020simple,grill2020bootstrap}
are built based on the task of instance discrimination.
For example, Wu et al.~\cite{wu2018unsupervised} propose a noise contrastive estimation to compare instances
based on a memory bank of storing representations.
Representation learning for long-tailed distribution also been exploit~\cite{kang2020exploring}.
More recently, Momentum Contrast (MoCo)~\cite{he2020momentum} is proposed to produce the compared representations by a moving-averaged encoder.
To enhance the discriminative ability,
contrastive learning often compares each sample with many negative samples.
SimCLR~\cite{chen2020simple} achieves this by using a large batch size.
Later, Chen et al.~\cite{chen2020improved} propose an improved method named MOCOv2,
which achieving promising performance without using a large batch size for training.
Considering the advantages of MoCOv2, our self-supervision is also constructed based on this structure.
\begin{figure*}[t]
\centering
{\includegraphics[width=0.9\linewidth]{framework.pdf}}
\caption{
An illustration of our proposed NCL of containing three experts.
The NIL enhances discriminative ability of a single expert,
and NBOD allows knowledge transferring among multiple experts.
NIL conducts the supervised learning from both a full
and a partial view, which focus on all categories and some hard categories, respectively.
Similarly, NBOD conducts the knowledge distillation also from both a full and a partial view.
The contrastive loss is calculated by using an extra momentum encoder and MLP layers, which can be removed in evaluation. Probabilities employed in NIL and NBOD are balanced according to the data distribution.
}
\label{fig_framework}
\end{figure*}
\section{Methodology}
\label{sec:method}
The proposed NCL aims to collaboratively and concurrently learn multiple experts together
as shown in Fig.~\ref{fig_framework}.
In the following, firstly, we introduce the preliminaries,
and then present Hard Category Mining (HCM), Nested Individual Learning (NIL),
Nested Balanced Online Distillation (NBOD) and self-supervision part.
Finally, we show the overall loss of how to aggregate them together.
\subsection{Preliminaries}
We denote the training set with $n$ samples as ${ {\mathcal D}} = \{ {\bf x}_i, y_i \}$,
where ${\bf x}_i$ indicates the $i$-th image sample and $y_i$ denotes the corresponding label.
Assume a total of $K$ experts are employed and the $k$-th expert model
is parameterized with ${\bm \theta}_k$.
Given image ${\bf x}_i$, the predicted probability of class-$j$ in the $k$-th expert is computed as:
\begin{equation}\label{ce_prob}
{\tilde {\bf p}}_j({\bf x}_i;{\bm \theta}_k) = \frac{exp({ {z}_{ij}^k }) }{\sum_{l=1}^C exp({{z}_{il}^k }) }
\end{equation}
where $z_{ij}^k$ is the k-th expert model's class-$j$ output and $C$ is the number of classes.
This is a widely used way to compute
the predicted probability, and some losses like Cross Entropy (CE) loss
is computed based on it.
However, it does not consider the data distribution,
and is not suitable for long-tailed visual recognition,
where a naive learned model based on ${\tilde {\bf p}}({\bf x}_i;{\bm \theta}_k)$
would be largely dominated by head classes.
Therefore, some researchers~\cite{ren2020balanced} proposed to
compute predicted probability of class-$j$ in a balanced way:
\begin{equation}\label{bsce_prob}
{\bf p}_{j} ({\bf x}_i;{\bm \theta}_k) = \frac{n_{j} exp({ {z}_{ij}^k }) }{\sum_{l=1}^C n_l exp({{z}_{il}^k }) }
\end{equation}
where $n_j$ is the total number of samples of class $j$.
In this way, contributions of tail classes are strengthened while contributions of head classes are suppressed.
Based on such balanced probabilities, Ren et al.~\cite{ren2020balanced}
further proposed a Balanced Softmax Cross Entropy (BSCE) loss to alleviate long-tailed class imbalance
in model training.
However, BSCE loss is still not enough, where the uncertainty in training still cannot be eliminated.
\subsection{Hard Category Mining}
In representation learning, one well-known and effective strategy to boost performance
is Hard Example Mining (HEM)~\cite{hermans2017defense}.
HEM selects hard samples for training while discarding easy samples.
However, directly applying HEM to long-tailed visual recognition
may distort the data distribution and make it more skewed in long-tailed learning.
Differing from HEM, we propose a more amicable method
named Hard Category Mining (HCM) to exclusively select hard categories for training,
which explicitly improves the ability of distinguishing the sample from hard categories.
In HCM, the hard category means the category that is not the ground-truth category but with a high predicted score.
Therefore, the hard categories can be selected by comparing values of model's outputs.
Specifically, we have $C$ categories in total and suppose $C_{hard}$ categories are selected to focus on.
For the sample ${\bf x}_i$ and expert $k$, the corresponding set ${\bm \Psi}_i^k$ containing the output of selected categories is denoted as:
\begin{equation}\label{hard_select}
{\bm \Psi}_i^k = TopHard\{ z_{ij}^k | j \neq y_i \} \cup \{z_{iy_i}^k \}
\end{equation}
where $TopHard$ means selecting $C_{hard}$ examples with largest values.
In order to adapt to long-tailed learning better,
we computed the probabilities of the selected categories in a balanced way,
which is shown as:
\begin{equation}\label{hard_p}
{\bf p}^* ({\bf x}_i;{\bm \theta}_k) = \{
\frac{n_j exp( { {z}_{ij}^k }) }{\sum_{z_{il}^k \in {\bm \Psi}_i^k } n_l exp({{z}_{il}^k }) }
| {z}_{ij}^k \in {\bm \Psi}_i^k
\}
\end{equation}
\subsection{Nested Individual Learning}
The individual supervised learning on each expert is also an important component in our NCL,
which ensures that each network can achieve the strong discrimination ability.
To learn thoroughly, we proposed a Nested Individual Learning (NIL) to perform the supervision in a nested way.
Besides the supervision on all categories for a global and robust learning,
we also force the network to focus on some important categories selected by HCM,
which enhance model's meticulous distinguishing ability.
The supervision on all categories is trivial and constructed on BSCE loss.
Since our framework is constructed on multiple experts,
the supervision is applied to each expert and the loss on all categories over all experts is the sum of the loss of each expert:
\begin{equation}\label{nil_all}
L_{nil}^{all} = -\textstyle{\sum\nolimits_k} log( { {\bf p}}_{y_i} ({\bf x}_i;{\bm {\bm \theta} }_k) )
\end{equation}
For the supervision on hard categories, it also can be obtained in a similar way.
Mathematically, it can be represented as:
\begin{equation}\label{nil_hard}
L_{nil}^{hard} = -\textstyle{\sum\nolimits_k} log( { {\bf p}^*}_{y_i} ({\bf x}_i;{\bm {\bm \theta} }_k) )
\end{equation}
In the proposed NIL, the two nested supervisions are employed together to achieve a comprehensive learning,
and the summed loss is written as:
\begin{equation}\label{loss_dil}
L_{nil} = L_{nil}^{all} + L_{nil}^{hard}
\end{equation}
\iffalse
\subsection{Overview}
The proposed Multi-Expert Collaborative Learning (MECL)
collaboratively and concurrently learn multiple experts to address
uncertain predictions in the long-tailed setting,
which allows each expert to learn extra knowledge from other experts.
An illustration of our MECL is shown in Fig.~\ref{fig_framework}.
In MECL, we propose a Dual Balanced Online Distillation (DBOD) for online knowledge transferring.
The proposed DBOD differs from previous works~\cite{chen2020online,guo2020online,zhang2018deep}
from two aspects as following.
First, DBOD distills the knowledge on the re-balanced probability distribution
rather than the original probability distribution, which learns knowledge in a balanced way.
Second, the knowledge distillation is performed on dual levels.
Besides giving a full perspective on all categories,
we also add an extra distillation supervision on some important categories from a partial perspective.
The important categories are defined as hard categories, that is, categories that are easy to cause misclassification.
To achieve this, we proposed a Hard categories Focus (HCF) to focus on hard categories for training.
In addition to the cooperation among multiple experts,
the individual learning on each expert is also important.
Similar to DBOD, the individual learning is also conducted from two aspects,
where one is the traditional supervised loss on all categories, like Cross-Entropy (CE) or
Balanced Softmax Cross-Entropy (BSCE) loss,
and the other is the loss function based on HCF to focus on hard categories.
Furthermore, we employ a self-supervision to further enhance the feature learning.
In the following, we shall first introduce CE and BSCE loss,
and then present HCF, DBOD and the employed self-supervision.
Finally, we present a training scheme of how to aggregate them together.
\fi
\iffalse
The proposed MECL consists of four parts.
The first part is called individual supervised learning,
where each expert would be individually trained in supervised manner with a classification loss.
In the first part, the supervised loss is performed over all categories,
where some of them may be easy categories that contribute very little in the learning.
Therefore, we propose the second part called Hard Category Focus (HCF),
which draws the attention of the model to the most difficult categories to distinguish.
In the third part, we propose a Dual Balanced Online Distillation (DBOD)
to encourage each expert model collaboratively distillate knowledge from other models.
As shown in Fig~\ref{***}, DBOD is performed on dual levels,
i.e., full category level and partial category level,
which comprehensively transfers the knowledge to each other.
The last part is to employ the self-supervision to enhance the feature learning.
In the following, we first introduce aforementioned four components,
and then present the overall loss of how to aggregate them together.
\subsection{CE and BSCE losses}
We denote the training set with $n$ samples as ${ {\mathcal D}} = \{ {\bf x}_i, y_i \}$,
where ${\bf x}_i$ indicates the $i^{th}$ image sample and $y_i$ denotes the corresponding label.
Assume a total of $K$ experts are employed and the $k^{th}$ expert model
is parameterized with ${\bm \theta}_k$. Each model is first trained in a supervised manner
to learn their own features.
Generally, a most common loss, namely Cross-Entropy (CE) loss, is employed as the loss function, which can be formulated as:
\begin{equation}\label{ce_loss}
L_{ce}^k = - log( {\tilde {\bf p}}_{y_i} ({\bf x}_i;{\bm {\bm \theta} }_k) )
\end{equation}
where ${\tilde {\bf p}}_j({\bf x}_i;{\bm \theta}_k) = \frac{exp({ {z}_{ik} }) }{\sum_{j=1}^C exp({{z}_{ij} }) }$ represents the probability of classifying the image ${\bf x}_i$ to class $j$,
$z_{ij}$ is the model's class-$j$ output and $C$ is the number of classes.
The CE loss can deal well with the classification problem with a balanced data distribution.
However, it is not suitable for long-tailed visual recognition,
where a immaturely learned model would be largely dominated by head classes.
To alleviate the effect of long-tailed distribution,
we re-balance the classifying probability $p_{y_i} ({\bf x}_i;{\bm \theta}_k)$ as following:
\begin{equation}\label{bsce_p}
{\bf p}_{y_i} ({\bf x}_i;{\bm \theta}_k) = \frac{n_{y_i} exp({ {z}_{iy_i} }) }{\sum_{j=1}^C n_j exp({{z}_{ij} }) }
\end{equation}
where $n_j$ is the total number of samples of class $j$.
The CE loss with the re-balanced probabilities is called Balanced Softmax Cross-Entropy (BSCE) loss~\cite{ren2020balanced}, which is denoted as $L_{bsce}^k = - log( { {\bf p}}_{y_i} ({\bf x}_i;{\bm \theta}_k) )$.
Specifically, contributions of tail classes are strengthened while contributions of head classes are suppressed.
To the end, the loss to train all expert models is the sum of all individual losses:
\begin{equation}\label{bsce_all}
L_{bsce} = -\textstyle{\sum\nolimits_k} L_{bsce}^k
\end{equation}
\subsection{Hard Category Focus}
In representation learning, one well-known and effective strategy to boost performance
is Hard Example Mining (HEM)~\cite{hermans2017defense}.
HEM selects hard samples for training while discarding easy samples,
which holds that easy samples contribute very little and are even detrimental to features learning.
HEM may also be of value to long-tailed visual recognition.
However, HEM of discarding easy samples may distort the data distribution
and make it more skewed in long-tailed learning.
Differing from HEM, we propose a more amicable method
named Hard Category Focus (HCF) to exclusively select hard categories for training,
which explicitly improves the ability of distinguishing between hard categories.
In HCF, the hard category means the category that is not the ground-truth category but with a high predicted score.
Therefore, the hard categories can be selected by comparing values of model's outputs.
Specifically, we have $C$ categories in total and suppose $C_{hard}$ categories are selected to focus on.
For the sample ${\bf x}_i$, the corresponding set ${\bm \Psi}_i$ of containing the outputs of selected categories is denoted as:
\begin{equation}\label{hard_select}
{\bm \Psi}_i = TopHard\{ z_{ij} | j \neq y_i \} \cup \{z_{iy_i} \}
\end{equation}
where $TopHard$ means selecting $C_{hard}$ examples with largest values.
Then, the classification loss like BSCE also can be employed to compute the loss
over the selected set ${\bm \Psi}_i$ , which facilitates the model to distinguish the input sample
from those confusing categories.
Here we take HCF with the BSCE loss as an example. Then, the probabilities over the selected categories are re-computed as:
\begin{equation}\label{hard_p}
{\bf p}^* ({\bf x}_i;{\bm \theta}_k) = \{
\frac{n_l exp( { {z}_{il} }) }{\sum_{z_{ij} \in {\bm \Psi}_i } n_j exp({{z}_{ij} }) }
| {z}_{il} \in {\bm \Psi}_i
\}
\end{equation}
Specifically, the BSCE loss over ${\bf p}^*$ on all experts can be represented as:
\begin{equation}\label{bsce_p}
L_{hcf} = -\textstyle{\sum\nolimits_k} log( { {\bf p}}_{y_i}^* ({\bf x}_i;{\bm \theta}_k) )
\end{equation}
Our HCF also can apply to the classical CE loss,
which can be extended to other classification tasks.
\fi
\subsection{Nested Balanced Online Distillation}
To collaboratively learn multiple experts from each other,
online distillation is employed to allow each model to learn extra knowledge from others.
Previous methods~\cite{zhang2018deep,guo2020online} consider the distillation
from a full perspective of all categories, which aims to capture global and robust knowledge.
Different from previous methods, we propose a Nested Balanced Online Distillation (NBOD),
where the distillation is conducted not only on all categories,
but also on some hard categories
that are mined by HCM,
which facilitates the network to capture meticulous distinguishing ability.
According to previous works~\cite{zhang2018deep,guo2020online},
the Kullback Leibler (KL) divergence is employed to perform the knowledge distillation.
The distillation on all categories can be formulated as:
\begin{equation}\label{eq_dis_all}
L_{dis}^{all} =
\frac{1}{K(K-1)} {\sum_{k}^{K} \sum_{q \neq k}^{K} }
KL( {\bf p} ({\bf x}_i;{\bm \theta}_k) || {\bf p} ({\bf x}_i;{\bm \theta}_q) )
\end{equation}
As we can see, the distillation is conducted among any two experts.
Note here that we use balanced distributions instead of original distributions
to compute KL distance, which aims to eliminate the distribution bias under the long-tailed setting.
And this is also one aspect of how we distinguish from other distillation methods.
Moreover, all experts employ the same hard categories for distillation,
and we randomly select an expert as an anchor to generate hard categories for all experts.
Similarly, the distillation on hard categories also can be formulated as:
\begin{equation}\label{eq_dis_hard}
L_{dis}^{hard} =
\frac{1}{K(K-1)} {\sum_{k}^{K} \sum_{q \neq k}^{K} }
KL( {\bf p}^* ({\bf x}_i;{\bm \theta}_k) || {\bf p}^* ({\bf x}_i;{\bm \theta}_q) )
\end{equation}
The nested distillation on both all categories and hard categories are learned together,
which is formulated as:
\begin{equation}\label{eq_dis}
L_{dis} = L_{dis}^{all} + L_{dis}^{hard}
\end{equation}
\iffalse
The loss $L_{kl}({\bm \theta}_k,{\bm \theta}_q)$ and $L_{kl}^*({\bm \theta}_k,{\bm \theta}_q)$
are optimized concurrently to distill the knowledge from the perspective of both all categories and hard categories.
Moreover, our framework consists of multiple experts, and the knowledge transferring
between any two experts would be considered thoroughly.
Very natural, the proposed DBOD among all experts can be computed as:
\begin{equation}\label{mutual_all}
L_{dis} = \frac{1}{K(K-1)} \textstyle{\sum_{k}^{K} \sum_{q \neq k}^{K} }
\big(
L_{kl} ({\bm \theta}_k,{\bm \theta}_q)
+ L_{kl}^*({\bm \theta}_k,{\bm \theta}_q)
\big)
\end{equation}
\fi
\subsection{Feature Enhancement via Self-Supervision}
Self-supervised learning aims to improve feature representations via an unsupervised manner.
Following previous works~\cite{he2020momentum,chen2020improved},
we adopt the instance discrimination as the self-supervised proxy task,
in which each image is regarded as a distinct class.
We leverage an additional temporary average model so as to conduct self-supervised learning,
and its parameters are updated following a momentum-based moving average scheme~\cite{he2020momentum,chen2020improved}
as shown in Fig.~\ref{fig_framework}.
The employed self-supervision is also a part of our NCL,
which cooperatively learns an expert model and its moving average model to capture better features.
Take the self-supervision for expert $k$ as an example.
Let ${\bf v}_i^k$ denote the normalized embedding of the $i^{th}$ image in the original expert model,
and ${\bf {\tilde v} }_i^k$ denote the normalized embedding of its copy image with different augmentations
in the temporally average model. Besides, a dynamic queue $\mathcal{Q}^k$ is employed to
collect historical features.
The samples in the queue are progressively replaced
with the samples in current batch enqueued and the samples in oldest batch dequeued.
Assume that the queue $\mathcal{Q}^k$ has a size of $N$ and $N$ can be set to be much larger than the typical batch size, which provides a rich set of negative samples
and thus obtains better feature representations.
The goal of instance discrimination task is to increase the similarity of features of the same image
while reduce the similarity of the features of two different images.
We achieve this by using a contrastive learning loss, which is computed as:
\begin{small}
\begin{equation}\label{contrastive_loss}
L_{con}^k = -log( \frac{exp( {{\bf v}_i^k}^T {\bf {\tilde v}}_i^k /\tau )}
{ exp( { {\bf v}_i^k }^T {\bf {\tilde v}}_i^k /\tau) +
\sum_{{\bf {\tilde v}}_j^k \in { \mathcal{Q}^k}} exp( { {\bf v}_i^k }^T {\bf {\tilde v}}_j^k /\tau) } )
\end{equation}
\end{small}
where $\tau$ is a temperature hyper-parameter.
Similar to Eq.~\ref{nil_all} and Eq.~\ref{nil_hard},
the self-supervised loss over all experts can be represented as
$L_{con} = \sum\nolimits_k L_{con}^k$.
\subsection{Model Training}
The overall loss in our proposed NCL consists of three parts:
the loss $L_{nil}$ of our NIL for learning each expert individually,
the loss $L_{dis}$ of our NBOD for cooperation among multiple experts,
and the loss $L_{con}$ of self-supervision.
The overall loss $L$ is formulated as:
\begin{equation}\label{mcl_loss}
L = L_{nil} + L_{con} + \lambda L_{dis}
\end{equation}
where $\lambda$ denotes the loss weight to balance the contribution of cooperation among multiple experts.
For $L_{nil}$ and $L_{con}$,
they play their part inside the single expert,
and we equally set their weighs as 1 in consideration of generality.
\section{Experiments}
\subsection{Datasets and Protocols}
We conduct experiments on five widely used datasets,
including CIFAR10-LT~\cite{cui2019class},
CIFAR100-LT~\cite{cui2019class},
ImageNet-LT~\cite{liu2019large},
Places-LT~\cite{zhou2017places},
and iNaturalist 2018~\cite{van2018inaturalist}.
\textbf{CIFAR10-LT and CIFAR100-LT}~\cite{cui2019class} are created from
the original balanced CIFAR datasets~\cite{krizhevsky2009learning}.
Specifically, the degree of data imbalance in datasets is controlled by an Imbalance Factor (IF),
which is defined by dividing the number of the most frequent category by that of the least frequent category.
The imbalance factors of 100 and 50 are employed in these two datasets.
\textbf{ImageNet-LT}~\cite{liu2019large} is sampled from the popular ImageNet dataset~\cite{deng2009imagenet} under long-tailed setting following the Pareto distribution with power value $\alpha$=6.
ImageNet-LT contains 115.8K images from 1,000 categories.
\textbf{Places-LT} is created from the large-scale dataset Places~\cite{zhou2017places}.
This dataset contains 184.5K images from 365 categories.
\textbf{iNaturalist 2018}~\cite{van2018inaturalist} is the largest dataset for long-tailed visual recognition.
iNaturalist 2018 contains 437.5K images from 8,142 categories, and it is extremely imbalanced with an imbalance factor of 512.
According to previous works~\cite{cui2019class,kang2019decoupling}
the top-1 accuracy is employed for evaluation.
Moreover, for iNaturalist 2018 dataset,
we follow the works~\cite{cai2021ace,kang2019decoupling} to divide classes into many (with more than 100 images), medium (with 20 $\sim$ 100 images) and few (with less than 20 images) splits,
and further report the results on each split.
\subsection{Implementation Details}
For CIFAR10/100-LT, following~\cite{cao2019learning, zhang2021bag}, we adopt ResNet-32~\cite{he2016deep} as our backbone network and liner classifier for all the experiments.
We utilize ResNet-50~\cite{he2016deep}, ResNeXt-50~\cite{xie2017aggregated} as our backbone network for ImageNet-LT, ResNet-50 for iNaturalist 2018 and pretrained ResNet-152 for Places-LT respectively, based on~\cite{liu2019large,kang2019decoupling,cui2021parametric}. Following~\cite{zhang2021distribution}, cosine classifier is utilized for these models.
Due to the use of the self-supervision component, we use the same training strategies as PaCo~\cite{cui2021parametric}, i.e., training all the models for 400 epochs except models on Places-LT, which is 30 epochs.
In addition, for fair comparison, following~\cite{cui2021parametric}, RandAugument~\cite{cubuk2020randaugment} is also used for all the experiments except Places-LT. The influence of RandAugument will be discussed in detail in Sec.~\ref{Component_Analysis}.
These models are trained on 8 NVIDIA Tesla V100 GPUs.
The $\beta = C_{hard} / C$ in HCM is set to 0.3.
And the ratio of Nested Balanced Online Distillation loss $\lambda$, which plays its part among networks, is set to 0.6. The influence of $\beta$ and $\lambda$ will be discussed in detail in Sec.~\ref{Component_Analysis}.
\setlength{\tabcolsep}{5pt}
\begin{table}[t]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{l|c|cc|cc}
\toprule[1pt]
\multirow{2}{*}{Method} & \multirow{2}{*}{Ref.} & \multicolumn{2}{c|}{ CIFAR100-LT } & \multicolumn{2}{c}{ CIFAR10-LT } \\
\cline{3-6}
& & 100 & 50 & 100 & 50 \\
\hline
CB Focal loss~\cite{cui2019class} & CVPR'19 & 38.7 & 46.2 & 74.6 & 79.3\\
LDAM+DRW~\cite{cao2019learning} & NeurIPS'19 & 42.0 & 45.1 & 77.0 & 79.3\\
LDAM+DAP~\cite{jamal2020rethinking} & CVPR'20 & 44.1 & 49.2 & 80.0 & 82.2\\
BBN~\cite{zhou2020bbn} & CVPR'20 & 39.4 & 47.0 & 79.8 & 82.2\\
LFME~\cite{xiang2020learning} & ECCV'20 & 42.3 & -- & -- & --\\
CAM~\cite{zhang2021bag} & AAAI'21 & 47.8 & 51.7 & 80.0 & 83.6\\
Logit Adj.~\cite{menon2020long} & ICLR'21 & 43.9 & -- & 77.7 & --\\
RIDE~\cite{wang2020long} & ICLR'21 & 49.1 & -- & -- & --\\
LDAM+M2m~\cite{kim2020m2m}& CVPR'21 & 43.5 & -- & 79.1 & --\\
MiSLAS~\cite{zhong2021improving} & CVPR'21 & 47.0 & 52.3 & 82.1 & 85.7 \\
LADE~\cite{hong2021disentangling} & CVPR'21 & 45.4 & 50.5 & -- & --\\
Hybrid-SC~\cite{wang2021contrastive} & CVPR'21 & 46.7 & 51.9 & 81.4 & 85.4 \\
DiVE~\cite{he2021distilling} & ICCV'21 & 45.4 & 51.3 & -- & -- \\
SSD~\cite{li2021self_iccv} & ICCV'21 & 46.0 & 50.5 & -- & --\\
ACE~\cite{cai2021ace}& ICCV'21 & 49.6 & 51.9 & 81.4 & 84.9\\
PaCo~\cite{cui2021parametric} & ICCV'21 & 52.0 & 56.0 & -- & --\\
\hline
BSCE (baseline) & -- & 50.6 & 55.0 & 84.0 & 85.8 \\
Ours (single) & -- & \textbf{53.3} & \textbf{56.8} & \textbf{84.7} & \textbf{86.8} \\
Ours (ensemble) & -- & \textbf{54.2} & \textbf{58.2} & \textbf{85.5} & \textbf{87.3} \\
\bottomrule[1pt]
\end{tabular}}\caption{Comparisons on CIFAR100-LT and CIFAR10-LT datasets with the IF of 100 and 50.
}
\label{results_cifar}
\end{table}
\iffalse
\setlength{\tabcolsep}{8pt}
\begin{table*}[t]
\centering
\resizebox{0.9\linewidth}{!}{
\begin{tabular}{l|c|c|ccc|c|c|ccc|c}
\toprule[1pt]
\multirow{2}{*}{Method} & \multirow{2}{*}{Ref.} & \multicolumn{5}{c|}{ ResNet-50 } & \multicolumn{5}{c}{ ResNeXt-50 } \\
\cline{3-12}
& & GFlops & Many & Medium & Few & All & GFlops & Many & Medium & Few & All\\
\hline
BBN~\cite{zhou2020bbn} & CVPR'20 & --& --& --& --& 48.3 & --& --& --& --& 49.3\\
NCM~\cite{kang2019decoupling} & ICLR'20 & -- & 53.1 & 42.3 & 26.5 & 44.3 & -- & 56.6 & 45.3 & 28.1 & 47.3\\
cRT~\cite{kang2019decoupling} & ICLR'20 & 4.11 (1.0x) & 58.8 & 44.0 & 26.1 & 47.3 & 4.26 (1.0x) & 61.8 & 46.2 & 27.4 & 49.6\\
$\tau$-norm~\cite{kang2019decoupling} & ICLR'20 & 4.11 (1.0x) & 56.6 & 44.2 & 27.4 & 46.7 & 4.26 (1.0x) & 59.1 & 46.9 & 30.7 & 49.4\\
LWS~\cite{kang2019decoupling} & ICLR'20 & 4.11 (1.0x) & 57.1 & 45.2 & 29.3 & 47.7 & 4.26 (1.0x) & 60.2 & 47.2 & 30.3 & 49.9\\
RIDE~\cite{wang2020long} & ICLR'21 & 5.15 (1.3x) & 66.2 & 52.3 & 36.5 & 55.4 & 5.19 (1.2x) & 68.2 & 53.8 & 36.0 & 56.8\\
DisAlign~\cite{zhang2021distribution} & CVPR'21 & -- & 61.3 & 52.2 & 31.4 & 52.9 & --& --& --& --& --\\
DiVE~\cite{he2021distilling} & ICCV'21 & -- & 64.06 & 50.41 & 31.46 & 53.10 & --& --& --& --& --\\
SSD~\cite{li2021self_iccv} & ICCV'21 & --& --& --& --& --& -- & 66.8 & 53.1 & 35.4 & 56.0\\
ACE~\cite{cai2021ace} & ICCV'21 & --& --& --& --& 54.7 & --& --& --& --& 56.6\\
PaCo~\cite{cui2021parametric} & ICCV'21 & -- & 65.0 & 55.7 & 38.2 & 57.0 & -- & 67.5 & 56.9 & 36.7 & 58.2\\
\hline
Ours (single) & -- &&&&&\textbf{57.4}& \\
Ours (ensemble) & -- &&&&&\textbf{58.34}& \\
\bottomrule[1pt]
\end{tabular}
}
\caption{Comparisons on ImageNet-LT dataset.
}
\label{results_imagenet}
\end{table*}
\fi
\setlength{\tabcolsep}{6pt}
\begin{table}[t]
\centering
\resizebox{1.0\linewidth}{!}{
\begin{tabular}{l|c|cc|c}
\toprule[1pt]
\multirow{2}{*}{Method} & \multirow{2}{*}{Ref.} & \multicolumn{2}{c|}{ImageNet-LT} & Places-LT \\
\cline{3-5}
& & Res50 & ResX50 & Res152\\
\hline
OLTR~\cite{liu2019large} & CVPR'19 & -- & -- & 35.9\\
BBN~\cite{zhou2020bbn} & CVPR'20 & 48.3 & 49.3 & --\\
NCM~\cite{kang2019decoupling} & ICLR'20 & 44.3 & 47.3 & 36.4\\
cRT~\cite{kang2019decoupling} & ICLR'20 & 47.3 & 49.6 & 36.7\\
$\tau$-norm~\cite{kang2019decoupling} & ICLR'20 & 46.7 & 49.4 & 37.9\\
LWS~\cite{kang2019decoupling} & ICLR'20 & 47.7 & 49.9 & 37.6\\
BSCE~\cite{ren2020balanced} & NeurIPS'20 & -- & -- & 38.7 \\
RIDE~\cite{wang2020long} & ICLR'21 & 55.4 & 56.8 & --\\
DisAlign~\cite{zhang2021distribution} & CVPR'21 & 52.9 & -- & --\\
DiVE~\cite{he2021distilling} & ICCV'21 & 53.1 & -- & --\\
SSD~\cite{li2021self_iccv} & ICCV'21 &--& 56.0 & --\\
ACE~\cite{cai2021ace} & ICCV'21 & 54.7 & 56.6 & --\\
PaCo~\cite{cui2021parametric} & ICCV'21 & 57.0 & 58.2 & 41.2\\
\hline
BSCE (baseline) & -- &53.9&53.6&40.2\\
Ours (single) & -- &\textbf{57.4}& \textbf{58.4} & \textbf{41.5}\\
Ours (ensemble) & -- &\textbf{59.5}& \textbf{60.5}& \textbf{41.8}\\
\bottomrule[1pt]
\end{tabular}
}
\caption{Comparisons on ImageNet-LT and Places-LT datasets.
}
\label{results_imagenet}
\end{table}
\setlength{\tabcolsep}{5pt}
\begin{table}[t]
\centering
\resizebox{0.95\linewidth}{!}{
\begin{tabular}{l|c|ccc|c}
\toprule[1pt]
\multirow{2}{*}{Method} & \multirow{2}{*}{Ref.} & \multicolumn{4}{c}{ iNaturalist 2018} \\
\cline{3-6}
& & Many & Medium & Few & All \\
\hline
OLTR~\cite{liu2019large} & CVPR'19 & 59.0 & 64.1 & 64.9 & 63.9\\
BBN~\cite{zhou2020bbn} & CVPR'20 & 49.4 & 70.8 & 65.3 & 66.3\\
DAP~\cite{jamal2020rethinking}& CVPR'20 & -- & -- & -- & 67.6\\
NCM~\cite{kang2019decoupling} & ICLR'20 & \\
cRT~\cite{kang2019decoupling} & ICLR'20 & 69.0 & 66.0 & 63.2 & 65.2\\
$\tau$-norm~\cite{kang2019decoupling} & ICLR'20 & 65.6 & 65.3 & 65.9 & 65.6\\
LWS~\cite{kang2019decoupling} & ICLR'20 & 65.0 & 66.3 & 65.5 & 65.9\\
LDAM+DRW~\cite{cao2019learning} & NeurIPS'19 & -- & -- & -- & 68.0\\
Logit Adj.~\cite{menon2020long} & ICLR'21 & -- & -- & -- & 66.4\\
CAM~\cite{zhang2021bag} & AAAI'21 & -- & -- & -- & 70.9 \\
RIDE~\cite{wang2020long} & ICLR'21 & 70.9 & 72.4 & 73.1 & 72.6\\
SSD~\cite{li2021self_iccv} & ICCV'21 & \\
ACE~\cite{cai2021ace} & ICCV'21 & -- & -- & -- & 72.9\\
PaCo~\cite{cui2021parametric} & ICCV'21 & -- & -- & -- & 73.2\\
\hline
BSCE (baseline) & -- &67.5&72.0&71.5&71.6 \\
Ours (single) & -- &\textbf{72.0}&\textbf{74.9}&\textbf{73.8}&\textbf{74.2} \\
Ours(ensemble) & -- &\textbf{72.7}&\textbf{75.6}&\textbf{74.5}&\textbf{74.9} \\
\bottomrule[1pt]
\end{tabular}
}
\caption{Comparisons on iNaturalist 2018 dataset with ResNet-50.
}
\label{results_inatu}
\end{table}
\subsection{Comparisons to Prior Arts}
We compare the proposed method NCL with previous state-of-the-art methods,
like LWS~\cite{kang2019decoupling}, ACE~\cite{cai2021ace} and so on.
Our NCL is constructed based on three experts and
both the performance of a single expert and an ensemble of multiple experts are reported.
Besides NCL, we also report the baseline results of a network with using BSCE loss for comparisons.
Comparisons on CIFAR10/100-LT are shown in Table~\ref{results_cifar},
comparisons on ImageNet-LT and Places-LT are shown in Table~\ref{results_imagenet},
and comparisons on iNaturalist2018 are shown in Table~\ref{results_inatu}.
Our proposed method achieves the state-of-the-art performance on all datasets
whether using a single expert or an ensemble of all experts.
For only using a single expert for evaluation,
our NCL outperforms previous methods on CIFAR10-LT, CIFAR100-LT,
ImageNet-LT, Places-LT and iNaturalist2018 with accuracies of
84.7\% (IF of 100), 53.3\% (IF of 100), 57.4\% (with ResNet-50), 41.5\% and 74.2\%, respectively.
When further using an ensemble for evaluation,
the performance on CIFAR10-LT, CIFAR100-LT,
ImageNet-LT, Places-LT and iNaturalist2018
can be further improved to 85.5\% (IF of 100),
54.2\% (IF of 100), 59.5\% (with ResNet-50), 41.8\%
and 74.9\%, respectively.
More results on many, medium and few splits are listed in \textbf{Supplementary Material}.
Some previous multi-expert methods were constructed based on a multi-branch network with higher complexity.
For example, RIDE~\cite{wang2020long} with 4 experts brings
0.4 times more computation than the original single network.
However, our method of only using a single expert for evaluation
won't bring any extra computation but still outperforms them.
Besides, despite that some previous methods employ a multi-stage training~\cite{li2021self_iccv,kang2019decoupling}
or a post-processing~\cite{menon2020long,zhang2021distribution}
to further improve the performance, our method still outperforms them.
The significant performance over the state-of-the-art shows the effectiveness of our proposed NCL.
\subsection{Component Analysis}
\label{Component_Analysis}
\textbf{Influence of the ratio of hard categories.}
The ratio of selected hard categories is defined as $\beta = C_{hard} / C$.
Experiments on our NIL model
are conducted within the range of $\beta$ from 0 to 1 as shown in Fig.~\ref{fig_hcf} (a).
The highest performance is achieved when setting $\beta$ to 0.3.
Setting $\beta$ with a small and large values brings limited gains
due to the under and over explorations on hard categories.
\textbf{Effect of loss weight.}
To search an appropriate value for $\lambda$,
experiments on the proposed NCL with a series of $\lambda$
are conducted as shown in Fig.~\ref{fig_hcf} (b).
$\lambda$ controls the contribution of
knowledge distillation among multiple experts in total loss.
The best performance is achieved when $\lambda=0.6$,
which shows that a balance is achieved between single network training and knowledge transferring among experts.
\begin{figure}[t]
\centering
{\includegraphics[width=1.0\linewidth]{HCF_b.pdf}}
\vspace{-0.6cm}
\caption{ Parameter analysis of (a) the ratio $\beta$ and (b) the loss weight $\lambda$ on
CIFAR100-LT dataset with IF of 100.
}
\label{fig_hcf}
\end{figure}
\textbf{Impact of different number of experts.}
As shown in Fig.~\ref{fig_multi_expert}, experiments using different number of experts
are conducted.
The ensemble performance is improved steadily as the number of experts increases,
while for only using a single expert for evaluation,
its performance can be greatly improved when only
using a small number of expert networks, e.g., three experts.
Therefore, three experts are mostly employed in our multi-expert framework for a balance
between complexity and performance.
\textbf{Single expert vs. multi-expert.}
Our method is essentially a multi-expert framework,
and the comparison among using a single expert or an ensemble of multi-expert is a matter of great concern. As shown in Fig.~\ref{fig_multi_expert},
As the number of experts increases, the accuracy of the ensemble over a single expert also tends to rise.
This demonstrates the power of ensemble learning.
But for the main goal of our proposed NCL, the performance improvement over a single expert is impressive enough at the number of three.
\begin{figure}[!t]
\centering
{\includegraphics[width=0.8\linewidth]{expert_num_ana.pdf}}
\vspace{-0.3cm}
\caption{ Comparisons of using different expert numbers on CIFAR100-LT with an IF of 100.
We report the performance on both a single network and an ensemble.
Specifically, the performance on a single network is reported as the average accuracy on all experts,
and the ensemble performance is computed based on the averaging logits over all experts.
}
\label{fig_multi_expert}
\end{figure}
\textbf{Influence of data augmentations.}
Data augmentation is a common tool to improve performance.
For example, previous works
use Mixup~\cite{zhang2021bag,cai2021ace,zhong2021improving,zhang2018mixup}
and RandAugment~\cite{cubuk2020randaugment} to obtain richer feature representations.
Our method follows PaCo~\cite{cui2021parametric}
to employ RandAugment~\cite{cubuk2020randaugment} for experiments.
As shown in Table~\ref{auto_aug_analysis},
the performance is improved by about 3\% to 5\% when employing RandAugment for training.
However, our high performance depends not entirely on RandAugment.
When dropping RandAugment, our ensemble model reaches an amazing performance of 49.22\%,
which achieves comparable performance to the current state-of-the-art ones.
\setlength{\tabcolsep}{8pt}
\begin{table}[t]
\centering
\resizebox{0.8\linewidth}{!}{
\begin{tabular}{c|c|c}
\toprule[1pt]
Method & w/o RandAug & w/ RandAug\\
\hline
CE & 41.88 & 44.79 \\
BSCE & 45.88 & 50.60 \\
BSCE+NCL & 47.93 & 53.31 \\
BSCE+NCL$^\dagger$ & 49.22 & 54.42 \\
\bottomrule[1pt]
\end{tabular}
}
\caption{Comparisons of training the network with ('w/') and without ('w/o') employing RandAugment.
Experiments are conducted on CIFAR100-LT dataset with an IF of 100. $^\dagger$ Indicates the ensemble performance is reported.
}
\label{auto_aug_analysis}
\end{table}
\textbf{Ablation studies on all components.}
In this sub-section, we perform detailed ablation studies for our NCL on CIFAR100-LT dataset,
which is shown in Table~\ref{analysis_ablation}.
To conduct a comprehensive analysis,
we evaluate the proposed components including Self-Supervision ('SS' for short),
NIL, NBOD and ensemble on two baseline settings of using CE and BSCE losses. Furthermore, for more detailed analysis, we split NBOD into two parts namely BOD$_{all}$ and BOD$_{hard}$.
Take the BSCE setting as an example,
SS and NIL improve the performance by 0.82\% and 0.64\%, respectively.
And employing NBOD further improves the performance from 51.24\% to 53.19\%.
When employing an ensemble for evaluation, the accuracy is further improved and reaches the highest.
For the CE baseline setting, similar improvements can be achieved for SS, NIL, DBOD and ensemble.
Generally, benefiting from the label distribution shift, BSCE loss can achieve better performance than CE loss.
The steadily performance improvements are achieved for all components on both baseline settings,
which shows the effectiveness of the proposed NCL.
\setlength{\tabcolsep}{3pt}
\begin{table}[t]
\centering
\resizebox{0.95\linewidth}{!}{
\begin{tabular}{ccccc|c|c}
\toprule[1pt]
NIL & SS & BOD$_{all}$ & BOD$_{hard}$ & Ensemble & Acc.@CE & Acc.@BSCE\\
\hline
& & & & &44.79 &50.60 \\
\checkmark & & & & &48.18 &51.24 \\
&\checkmark & & & &46.05 &51.42 \\
\checkmark & &\checkmark & & &48.81 &52.64 \\
\checkmark & &\checkmark &\checkmark & &49.34 &53.19 \\
\checkmark &\checkmark &\checkmark &\checkmark & &49.89 &53.31 \\
\checkmark &\checkmark &\checkmark &\checkmark & \checkmark &51.04 &54.42 \\
\bottomrule[1pt]
\end{tabular}
}
\vspace{-0.3cm}
\caption{Ablation studies on CIFAR100-LT dataset with an IF of 100. 'SS' indicates self-supervision.
'BOD$_{all}$' and 'BOD$_{hard}$' represent the balanced online distillation
on all categories and only hard categories, respectively.
NBOD means the setting when both 'BOD$_{all}$' and 'BOD$_{hard}$' are employed.
Experiments are conducted on the framework of containing three experts.
}
\label{analysis_ablation}
\end{table}
\begin{figure}[t]
\centering
{\includegraphics[width=1.0\linewidth]{hcfn_top10.pdf}}
\vspace{-0.8cm}
\caption{ (a) The distribution of the largest softmax probability of hardest negative category.
(b) The average KL distance between two models' output probabilities on the test set.
Analysis is conducted on CIFAR100-LT with an IF of 100. Best viewed in color.
}
\label{fig_top10}
\end{figure}
\subsection{Discussion and Further Analysis}
\iffalse
\textbf{Distribution of hard categories.}
We count the distribution of top-10 hard categories of few split during training as
shown in Fig.~\ref{fig_top10} (a).
At the initial stage of the network training (e.g., the first ten epoches),
the network is dominated by the head classes,
which often confuses the tail classes and results into misclassification.
With employing our method to train the network,
the frequency that the head class become a difficult category for few split is reduced
(see the distribution in the final ten epoches).
This shows that the proposed HCF helps to reduce the long-tailed bias
and pull the sample away from the most difficult categories.
\fi
\textbf{Score distribution of hardest negative category.}
Deep models normally confuse the target sample with the hardest negative category.
Here we visualize the score distribution for the baseline method ('BSCE')
and our method ('BSCE+NCL') as shown in Fig~\ref{fig_top10} (a).
The higher the score of the hardest negative category is, the more likely it is to produce false recognition.
The scores in our proposed method are mainly concentrated in the range of 0-0.2,
while the scores in the baseline model are distributed in the whole interval (including the interval with large values). This shows that our NCL can considerably reduce the confusion with the hardest negative category.
\textbf{KL distance of pre/post collaborative learning.}
As shown in Fig.~\ref{fig_top10} (b),
when networks are trained with our NCL,
the KL distance between them is greatly reduced, which shows that
the uncertainty in predictions is effectively alleviated.
Besides, the KL distance is more balanced than that of BSCE and CE,
which indicates that collaborative learning is of help to the long-tailed bias reduction.
\textbf{NBOD without balancing probability.}
As shown in Fig.~\ref{balance_offdis} (a),
when removing the balanced probability in NBOD (denoted as 'NOD')
both the performance of the single expert and the ensemble
decline about 1\%, which manifests the importance of employing the balanced probability
for the distillation in long-tailed learning.
\textbf{Offline distillation vs. NBOD.}
To further verify the effectiveness of our NBOD, we employ an offline distillation for comparisons.
The offline distillation (denoted as 'NIL+OffDis')
first employs three teacher networks of NIL to train individually,
and then produces the teacher labels by using the averaging outputs over three teacher models.
The comparisons are shown in Fig.~\ref{balance_offdis} (b).
Although NIL+OffDis gains some improvements via an offline distillation,
but its performance still 1.5\% worse than that of NIL+NBOD.
It shows that our NBOD of the collaborative learning
can learn more knowledge than offline distillation.
\iffalse
\setlength{\tabcolsep}{6pt}
\begin{table}[t]
\centering
\resizebox{0.8\linewidth}{!}{
\begin{tabular}{c|ccccc|c}
\toprule[1pt]
balanced probability & Single expert & Ensemble \\
\hline
& 52.1 & 53.4 \\
\checkmark & 53.3 & 54.4 \\
\bottomrule[1pt]
\end{tabular}
}
\caption{
Comparisons of with or without using the balanced probability in NBOD.
Experiments are conducted on CIFAR100-LT dataset with an IF of 100.
}
\label{analysis_re-balancing}
\end{table}
\fi
\begin{figure}[t]
\centering
{\includegraphics[width=0.8\linewidth]{balance_ana.pdf}}
\vspace{-0.3cm}
\caption{ (a) Comparisons of using NOD or NBOD for distillation.
(b) Comparisons of using offline distillation or our NBOD. Analysis is conducted on CIFAR100-LT with an IF of 100.
}
\label{balance_offdis}
\end{figure}
\section{Conclusions}
In this work, we have proposed a Nested Collaborative Learning (NCL)
to collaboratively learn multiple experts.
Two core components, i.e., NIL and NBOD, are proposed for
individual learning of a single expert and knowledge transferring among multiple experts.
Both NIL and NBOD consider the features learning from both a full perspective and
a partial perspective, which exhibits in a nested way.
Moreover, we have proposed a HCM to capture hard categories for learning thoroughly.
Extensive experiments have verified the superiorities of our method.
\textbf{Limitations and Broader impacts.}
One limitation is that more GPU memory and computing power are needed when training our NCL with multiple experts.
But fortunately, one expert is also enough to achieve promising performance in inference.
Moreover, the proposed method improves the accuracy and fairness of the classifier,
which promotes the visual model to be further put into practical use.
To some extent, it helps to collect large datasets without forcing class balancing preprocessing,
which improves efficiency and effectiveness of work.
The negative impacts can yet occur in some misuse scenarios, e.g., identifying minorities for malicious purposes.
Therefore, the appropriateness of the purpose of using long-tailed classification technology
is supposed to be ensured with attention.
\section*{Acknowledgements}
This work was supported by the National Key Research and Development Plan under Grant 2020YFC2003901, the External cooperation key project of Chinese Academy Sciences 173211KYSB20200002, the Chinese National Natural Science Foundation Projects 61876179 and 61961160704, the Science and Technology Development Fund of Macau Project 0070/2020/AMJ, and Open Research Projects of Zhejiang Lab No. 2021KH0AB07, and the InnoHK program.
{\small
\bibliographystyle{ieee_fullname}
| {'timestamp': '2022-04-20T02:24:16', 'yymm': '2203', 'arxiv_id': '2203.15359', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15359'} | arxiv |
\section{Introduction}
Representation learning methods have drastically evolved large scientific volume exploration strategies. The popular applications include summarization, construction of mentor-mentee network~\citep{ke2021dataset}, recommendation~\citep{ostendorff2020aspect,specter2020cohan,das2020information,hope-etal-2021-extracting}, QA over scientific documents~\citep{DBLP:conf/emnlp/SuXYSBF20}, and verification of scientific claims~\citep{Wadden2020FactOF}. The growing community's interest has led to the development of several scientific document embedding models such as OAG-BERT~\citep{liu2021oag}, SPECTER~\citep{specter2020cohan}, SciBERT~\citep{beltagy-etal-2019-scibert}, and BioBERT~\citep{lee2020biobert} over the past five years.
OAG-BERT has been deployed in the Aminer production system. Given similar possibilities of future deployments of scientific document embeddings models in the existing scholarly systems, it is crucial to evaluate and identify limitations robustly. However, we do not find any existing work that critically analyzes the scientific language models to the best of our knowledge.
To motivate the reader, we present a simple experiment. Queries \textit{`document vector'} and \textit{`document vectors'} fetch no common candidates among first page results on Google Scholar and Semantic Scholar (candidates in Appendix~\ref{sec:GSSSCandidates}). This illustrates the extremely brittle nature of such systems to minor alterations in query text, leading to completely different search outcomes.
To motivate further, we experiment with textual queries encoded by the popular SciBERT model.
A perturbed text \textit{`documen vector'} (relevant in AI) is closer to the Biomedical term \textit{`Virus vector'} in the embedding space. Similar observations were found for many other queries. As scholarly search and recommendation systems are complex systems and their detailed algorithms are not publicly available, we analyze the behavior of scientific language models, which are (or will be) presumably an integral component of each of these systems. Motivated by the usage of perturbed inputs to stress test ML systems in interpretability analysis, we propose to use \textit{`textual neighbors'} to analyze how they are represented in the embedding space of scientific LMs. Unlike previous works~\citep{ribeiro-etal-2020-beyond,rychalska2019models}, which analyze the effect of perturbations on downstream task-specific models, we focus on analyzing the embeddings which are originally inputs to such downstream models. With the explosion of perturbation techniques for various kinds of robustness and interpretability analysis, it is difficult to generalize the insights gathered from perturbation experiments. We propose a classification schema based on orthography and semantics, to organize the perturbation strategies.
The distribution of various types of textual neighbors in a training corpus is non-uniform. Specifically, the low frequency of textual neighbors results in non-optimized representations, wherein semantically similar neighbors might end up distant in the space. These non-optimal representations have a cascading effect on the downstream task-specific models. In this work, we analyze whether all textual neighbors of input \textit{X} are also \textit{X}’s neighbors in the embedding space. Further, we also study if their presence in the embedding space can negatively impact downstream applications dependent on similarity-based document retrieval. Our main contributions are:
\begin{enumerate}[noitemsep,nolistsep]
\item We introduce (in Section~\ref{sec:tncategories}) five textual neighbor categories based on orthography and semantics. We further construct a non-exhaustive list of thirty-two textual neighbor types and organize them into these five categories to analyze the behavior of scientific LMs on manipulated text.
\item We conduct (in Section~\ref{sec:short-text}) robust experiments to showcase the limitations of scientific LMs under a short-text query retrieval scheme.
\item We analyze (in Section~\ref{sec:textual_neighbors}) embeddings of textual neighbors and their placement in the embedding space of three scientific LMs, namely SciBERT, SPECTER, and OAG-BERT. Our experiments highlight the capability and limitations of different models in representing different categories of textual neighbors.
\end{enumerate}
\section{Related Works}
Several works utilize Textual Neighbors to interpret decisions of classifiers~\citep{lime,gardner-etal-2020-evaluating}, test linguistic capabilities of NLP models~\citep{ribeiro-etal-2020-beyond}, measure progress in language generation~\citep{DBLP:journals/corr/abs-2102-01672}, and generate semantically equivalent adversarial examples~\citep{ribeiro-etal-2018-semantically}.
Similar to these works, we use textual neighbors of scientific papers to analyze the behavior of scientific LMs.~\citet{macavaney2020abnirml} analyze the behavior of neural IR models by proposing test strategies: constructing test samples by controlling specific measures (e.g., term frequency, document length), and by manipulating text (e.g., removing stops, shuffling words). This is closest to our work, as we also employ text manipulation to analyze the behavior of scientific language models using a simple Alternative-Self Retrieval scheme (Section~\ref{sec:exp_design}). However, our focus is not evaluation of retrieval-augmented models and we only use a relaxed document retrieval pipeline in our evaluation to analyze the behavior of scientific LMs trained on diverse domains, in encoding scientific documents. We organize the textual neighbors into categories which capture different capabilities of LMs. We also show that it is crucial to evaluate models on dissimilar texts rather than just semantically similar textual neighbors. Ours is a first work in analyzing the properties of scientific LMs for different inputs and can be utilized by future works to design and evaluate future scientific LMs. Due to space limitations, we present the detailed discussion on scientific LMs in Appendix~\ref{sec:app_scilm}.
\section{Short Queries and Textual Neighbors}
\label{sec:tncategories}
In this paper, we experiment with short queries to fetch relevant scientific documents. The term \textit{`short'} signifies a query length comparable to the length of research titles. The candidates are constructed from either title (T) or title and abstract (T+A) text. We, further, make small alterations to the candidate text to construct \textit{`textual neighbors'}. The textual neighbors can be syntactically, semantically, or structurally similar to the candidate text. Unlike previous works that explore textual neighbors to analyze and stress test complex models (Q\&A, Sentiment, NLI, NER~\citep{rychalska2019models}), we experiment directly with representation learning models and analyze the placement of textual neighbors in their embedding space.
While semantically similar neighbors are frequently used in previous works~\citep{ribeiro-etal-2018-semantically}; we also explore \textit{semantically dissimilar} textual neighbors to analyze scientific language models. While an LM is expected to represent semantically similar texts with high similarity, some orthographically similar but semantically dissimilar texts can have highly similar embeddings, which is undesirable behavior. Note that we restrict the current query set to titles for two main reasons: (i) most real-world search queries are shorter in length, and (ii) flat keyword-based search lacks intent and can lead to erroneous conclusions.
\begin{table}[!t]
\centering
\resizebox{\columnwidth}{!}{
\small{
\begin{tabular}{lp{0.13\columnwidth}l}
\rowcolor{Gray}
\multicolumn{1}{l}{\textbf{O-S}} &
\multicolumn{1}{l}{\textbf{Neighbor Code}} & \multicolumn{1}{l}{\textbf{Form}} \\ \hline
LL-PS & T\_ARot & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Rotate\end{tabular} \\ \hline
LL-PS & T\_AShuff & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Shuffle\end{tabular} \\ \hline
LL-PS & T\_ASortAsc & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Sort Ascending\end{tabular} \\ \hline
LL-PS & T\_ASortDesc & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Sort Descending\end{tabular} \\ \hline
LO-PS & T\_ADelRand & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Random word deletion 30\%\end{tabular} \\ \hline
LO-PS & T\_ADelADJ & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all ADJs\end{tabular} \\ \hline
LO-DS & T\_ADelNN & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all NNs\end{tabular} \\ \hline
LO-PS & T\_ADelVB & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all Verbs\end{tabular} \\ \hline
LO-PS & T\_ADelADV & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all ADVs\end{tabular} \\ \hline
LO-PS & T\_ADelPR & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all PRs\end{tabular} \\ \hline
LO-HS & T\_ADelDT & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all DTs\end{tabular} \\ \hline
LO-PS & T\_ADelNum & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all Numbers\end{tabular} \\ \hline
LO-DS & T\_ADelNNPH & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all NN Phrases\end{tabular} \\ \hline
LO-PS & T\_ADelTopNNPH & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete top 50\% NPs\end{tabular} \\ \hline
LO-HS & TDelADJ\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all ADJs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline
LO-HS & TDelNN\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all NNs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline
LO-HS & TDelVB\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all VBs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline
LO-HS & TDelDT\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all DTs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline
LO-DS & TDelNN & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete all NNs\\ Abs $\rightarrow$ Delete\end{tabular} \\ \hline
LO-PS & T\_ADelQ1 & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete quantile 1\end{tabular} \\ \hline
LO-PS & T\_ADelQ2 & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete quantile 2\end{tabular} \\ \hline
LO-PS & T\_ADelQ3 & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete quantile 3\end{tabular} \\ \hline
LL-HS & TNNU\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Uppercase NNs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline
LL-HS & TNonNNU\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Uppercase non NNs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline
LL-HS & T\_ANNU & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Uppercase NNs\end{tabular} \\ \hline
LL-HS & T\_ANonNNU & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Uppercase non NNs\end{tabular} \\ \hline
LO-PS & T\_A\_DelNNChar & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Delete chars from NNs\\ Abs $\rightarrow$ Delete chars from NNs\end{tabular} \\ \hline
LO-HS & TRepNNT\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Add a NN from title\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline
LO-HS & TRepNNA\_A & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Add a NN from abs\\ Abs $\rightarrow$ Preserve\end{tabular} \\ \hline
LO-DS & T\_ADelNonNNs & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Delete all non NNs\end{tabular} \\ \hline
LO-DS & T\_ARepADJ & \begin{tabular}[c]{@{}l@{}}Title $\rightarrow$ Preserve\\ Abs $\rightarrow$ Replace ADJs with antonyms\end{tabular} \\ \hline
LL-HS & T\_A\_WS & \begin{tabular}[c]{@{}l@{}}Randomly replace 50\% whitespace \\ chars with 2-5 whitespace chars\\ in the title \& abstract\end{tabular} \\ \hline
\end{tabular}
}}
\caption{Neighbor code is in format Txx\_Ayy\_zz, where xx and yy denote the perturbation to the paper title (T) and the abstract (A) respectively. zz denotes perturbation to both T and A. Missing T or A denotes that the corresponding input field is deleted completely.}
\label{tab:tneighbors}
\end{table}
Textual neighbors have a similar word form or similar meaning.
We observe that Textual neighbors possess the following properties based on two aspects: (i) Orthography (surface-level information content of text in terms of characters, words, and sentences), and (ii) Semantics. These two aspects are integral for a pair of texts to be textual neighbors. The properties of these aspects are:
\begin{enumerate}
\item \textbf{Orthography}: Orthographic-neighbors are generated by making small surface-level transformations to the input. Based on the textual content, neighbors can be generated by:
\begin{enumerate}[noitemsep,nolistsep]
\item \textbf{\textit{Lossy Perturbation (LO)}}: `Lossy' behavior indicates that the information from the original text is lost, either due to addition or deletion of textual content. E.g., random deletion of 2--3 characters from a word.
\item \textbf{\textit{Lossless Perturbation (LL)}}: `Lossless' behavior indicates that the original information content is unaltered. E.g., shuffling sentences of a paragraph.
\end{enumerate}
\item \textbf{Semantics}: Textual neighbors can either be semantically similar or not. While semantic categories are subjective, we try to define them objectively:
\begin{enumerate}[noitemsep,nolistsep]
\item \textbf{\textit{Dissimilar (DS)}}: Semantically dissimilar neighbors are generated by deletion of nouns (NNs) or noun phrases (NPs), or by changing the directionality of text such as replacing adjectives (ADJs) with antonyms.
\item \textbf{\textit{Partially Similar (PS)}}: Partially similar neighbors are constructed by sentence level modifications such as sentences scrambling (while preserving the word order in each sentence), word deletion of non-NNs (or NPs), or character deletion in words (including NNs) such that the textual neighbor preserves at least 70\% of the words in the original text.
\item \textbf{\textit{Highly Similar (HS)}}: Highly similar neighbors are constructed by (i) non-word-semantic changes such as changing the case of words or altering the whitespace characters, (ii) word deletions or additions such that the textual neighbor preserves at least 90\% of the words in the original text. Note that deletion of NNs only from the title while preserving the abstract will qualify to be the \textit{HS} category.
\end{enumerate}
\end{enumerate}
Since SPECTER and OAG-BERT utilize paper titles and abstracts to learn embeddings, we generate textual neighbors by altering texts of these two input fields. We present 32 textual neighbor types in Table~\ref{tab:tneighbors}. Each of these 32 neighbor types is categorized into one of the five categories: LO-HS, LO-PS, LO-DS, LL-HS, and LL-PS. We exclude the LL-DS category (e.g., scrambling all words in the text) as it is infrequent and less probable to occur in a real-world setting. Examples of the textual neighbors are presented in Appendix~\ref{sec:app_tneigh} (Table~\ref{apptab:examples_tneig}).
\begin{table}[!tb]
\newcolumntype{L}{>{\centering\arraybackslash}p{0.11\linewidth}}
\newcolumntype{K}{>{\centering\arraybackslash}p{0.38\linewidth}}
\centering
\resizebox{\columnwidth}{!}{
\small{
\begin{tabular}{lLKr}
\hline
\rowcolor{Gray}
\textbf{Dataset} & \textbf{Domain} & \textbf{SubDomain} & \textbf{\#Papers} \\ \hline
\textbf{ACL-ANTH} & CS & NLP & 35,482 \\ \hline
\textbf{ICLR} & CS & Deep Learning & 5,032 \\ \hline
\textbf{Arxiv-CS-SY} & CS & Systems and Control & 10,000\\ \hline
\textbf{Arxiv-MATH} & MT & Algebraic Topology & 10,000\\ \hline
\textbf{Arxiv-HEP} & HEP & HEP Theory & 10,000\\ \hline
\textbf{Arxiv-QBIO} & QB & Neurons and Cognition & 6,903 \\ \hline
\textbf{Arxiv-ECON} & ECO & Econometrics, General \& Theoretical Economics & 4,542 \\ \hline
\end{tabular}}
}
\caption{Dataset Statistics}
\label{tab:dataset}
\end{table}
\begin{figure}[!t]
\centering
\begin{tabular}{l}
\includegraphics[width=1.0\columnwidth]{figures/exp_config.png}
\end{tabular}
\caption{Alternative-Self Retrieval schemes for (a) Sec.~\ref{sec:short-text} Task I, (b) Sec.~\ref{sec:short-text} Task II, and (c) Sec.~\ref{ssec:altret_tneigh}. Green represents the relevant candidate document for the query. The query is a subset of the relevant candidate document in schemes (a) and (b), and a textual neighbor of the relevant candidate in scheme (c).}
\label{fig:altret_scheme}
\end{figure}
\section{Experiment Design}
\label{sec:exp_design}
\noindent \textbf{The Alternative-Self Retrieval:} We propose an embarrassingly simple binary retrieval scheme which contains only one relevant document in the candidate set. Alternative-Self Retrieval refers to the characteristic that the query is an altered version of the relevant candidate document. E.g., the candidate documents are the embeddings of paper title and abstract (henceforth T+A) and the query is embedding of title. We present a schematic of three Alternative-Self Retrieval schemes in Figure~\ref{fig:altret_scheme}. The retrieval is simple and we measure performance with accommodating metrics discussed in this section further. Our purpose is to analyze scientific LM embeddings under the most relaxed conditions.
\noindent \textbf{The Datasets:} We evaluate the scientific LMs on seven datasets (statistics in Table~\ref{tab:dataset}) to understand their effectiveness in encoding documents from diverse research fields. Each dataset contains the titles and abstracts of papers. We curate the ACL Anthology dataset\footnote{https://aclanthology.org/} and the ICLR dataset from OpenReview\footnote{https://openreview.net/group?id=ICLR.cc}.
To control the size of the ACL Anthology dataset, we exclude papers from workshops and non-ACL venues.
We also curate five datasets from arXiv for the domains Mathematics (MT), High Energy Physics (HEP), Quantitative Biology (QB), Economics (ECO), and Computer Science (CS). We make available our code and dataset for public access\footnote{https://github.com/shruti-singh/scilm\_exp}.
\noindent \textbf{The Notations:}
\textbf{$\mathcal{D}$} is the set of seven datasets described in Table~\ref{tab:dataset}. \textbf{$\mathcal{X}$} is the set of original input texts to the scientific LMs consisting of the paper title (T) and the abstract (A). For d $\in \mathcal{D}$, $\mathcal{X}$ = \{$x_j: x_j = \mbox{(T+A)}(p)$, where $\mbox{(T+A)}(p)=$ concat(title($p$), abstract($p$), $\forall \mbox{ paper }p \in$ d\}. $f$ represents the type of textual neighbor (represented by the neighbor code presented in Table~\ref{tab:tneighbors}). $\mathcal{Q}$ and $\mathcal{R}$ are the query and candidate set for the IR task.
\noindent \textbf{Evaluation Metrics:} We report performance scores on the following retrieval metrics: \newline
\underline{\emph{Mean Reciprocal Rank (MRR)}}: All our tasks use binary relevance of documents to compute MRR. \newline
\underline{\emph{T100}}: It represents the percentage of queries which retrieve the one and only relevant document among the top-100 documents. \newline
\underline{\emph{NN\textit{k}\_Ret}}: \% of queries in textual neighbor category whose k nearest neighbors (k-NN) retrieve the original document. \newline
\underline{\emph{AOP-10}}: Average overlap percentage among 10-NN of x and y, where x = T+A($x_j$) and y = $f(x_j)$. $f$ is a text manipulation function, represented by the textual neighbor codes presented in Table~\ref{tab:tneighbors}. \newline
\begin{table*}[!tb]
\centering
\small{
\begin{tabular}{l||cc|cc|cc||cc|cc|cc}
\hline
& \multicolumn{6}{c||}{\textbf{Task I:} $\mathcal{R} = \mathcal{X}$} & \multicolumn{6}{c}{\textbf{Task II:} $\mathcal{R} = \mathcal{X}$ $\cup$ T($\mathcal{X}$)} \\ \hline
& \multicolumn{2}{c|}{\textbf{SciBERT}} & \multicolumn{2}{c|}{\textbf{SPECTER}} & \multicolumn{2}{c||}{\textbf{OAG-BERT}} & \multicolumn{2}{c|}{\textbf{SciBERT}} & \multicolumn{2}{c|}{\textbf{SPECTER}} & \multicolumn{2}{c}{\textbf{OAG-BERT}} \\ \hline
& \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} & \textit{\textbf{MRR}} & \textit{\textbf{T100}} \\ \hline
\rowcolor{Gray}
\textbf{Arxiv-MATH} & 0.007 & 5.7 & \textbf{0.596} & \textbf{90.5} & 0.143 & 25.1 & 0 & 0 & \textbf{0.276} & \textbf{64.2} & 0.133 & 31.2 \\ \hline
\textbf{Arxiv-HEP} & 0.006 & 5.8 & \textbf{0.693} & \textbf{92.4} & 0.182 & 29.7 & 0 & 0 & \textbf{0.354} & \textbf{75.7} & 0.193 & 39.0 \\ \hline
\rowcolor{Gray}
\textbf{Arxiv-QBIO} & 0.008 & 6.6 & \textbf{0.789} & \textbf{97.5} & 0.187 & 33.0 & 0 & 0.2 & \textbf{0.507} & \textbf{90.6} & 0.194 & 36.1 \\ \hline
\textbf{Arxiv-ECON} & 0.009 & 10.4 & \textbf{0.783} & \textbf{96.2} & 0.177 & 32.5 & 0 & 0.1 & \textbf{0.519} & \textbf{87.5} & 0.176 & 37.2 \\ \hline
\rowcolor{Gray}
\textbf{Arxiv-CS\_SY} & 0.011 & 5.0 & \textbf{0.859} & \textbf{99.2} & 0.186 & 32.1 & 0 & 0.2 & \textbf{0.553} & \textbf{92.9} & 0.163 & 34.0 \\ \hline
\textbf{ICLR} & 0.004 & 5.5 & \textbf{0.586} & \textbf{91.5} & 0.140 & 29.8 & 0 & 0 & \textbf{0.221} & \textbf{66.5} & 0.128 & 33.0 \\ \hline
\rowcolor{Gray}
\textbf{ACL-ANTH} & 0.002 & 2.3 & \textbf{0.739} & \textbf{94.3} & 0.138 & 26.5 & 0 & 0 & \textbf{0.315} & \textbf{77.0} & 0.101 & 27.3 \\ \hline
\end{tabular}}
\caption{For both Task I and Task II, SPECTER consistently performs the best on all datasets. For Task II, drop in MRR and T100 scores for SPECTER is significant in comparison to Task I.}
\label{tab:exp1exp2}
\end{table*}
\begin{figure*}[!thb]
\centering
\begin{subfigure}[b]{0.32\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/tsne_plots/tsne2d_ICLR_scibert.png}
\caption{SciBERT}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.32\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/tsne_plots/tsne2d_ICLR_specter.png}
\caption{SPECTER}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.32\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/tsne_plots/tsne2d_ICLR_oagbert.png}
\caption{OAG-BERT}
\end{subfigure}
\caption{t-SNE plots for T and T+A embeddings for the ICLR dataset. Completely non-overlapping embeddings for T and T+A by SciBERT model highlight differences in encoding texts of varying lengths.}
\label{fig:e2_tsne}
\end{figure*}
\begin{figure}[!t]
\centering
\begin{subfigure}[b]{0.48\columnwidth}
\centering
\includegraphics[width=\textwidth]{figures/exp4_2/HS_ACL.png}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\columnwidth}
\centering
\includegraphics[width=\textwidth]{figures/exp4_2/HS_ArxivECON.png}
\end{subfigure}
\caption{Percentage of pair of documents for each Textual Neighbor whose similarity is greater than the average similarity. OAG-BERT has high inter similarity ($>$ 50\%), i.e. more than 50\% document pairs have cosine similarity greater than average similarity.}
\label{fig:per_hs}
\end{figure}
\begin{figure}[!tb]
\centering
\begin{subfigure}[b]{0.95\columnwidth}
\centering
\includegraphics[trim={0.1cm 0 0.1cm 0},clip,width=\textwidth]{figures/exp4_1/ACL.png}
\end{subfigure}
\caption{Inter Similarity of Textual Neighbor Vectors. Bold lines represent the $\mu$ and the $\sigma$ of pairwise similarities. Arrow heads represent min and max values. Pairwise similarities are spread out in a broad range for OAG-BERT, suggesting vectors for textual neighbors are more spread out in the vector space.
}
\label{fig:geo}
\end{figure}
\section{Analysing Embeddings for Scientific Document Titles and Abstracts}
\label{sec:short-text}
In this section, we experiment with the inputs to the scientific language models. Due to free availability and ease of parsing paper title and abstract, majority scientific LMs learn embeddings from the title and the abstract of the paper. However, multiple downstream applications such as document search involve short queries (often keywords). We present two Alternative-Self retrieval experiments to compare the embeddings of paper title (T) with the embeddings of paper titles and abstract (T+A). In both experiments, $|\mathcal{Q}|$ = 1000 queries for each dataset.
\newline \newline
\textbf{Task I: Querying titles against original candidate documents}
\label{sec:exp1}
In this Alternative-Self Retrieval setup, given a query q constructed only from the paper title, the system recommends relevant candidate document embeddings constructed from title and abstract both (T+A). This setting is similar to querying in a scientific literature search engine as the search queries are usually short. The motivation behind this experiment is to analyse the similarity among the T and the T+A embedding of a paper (Figure~\ref{fig:altret_scheme}(a)).
The experiment details are:\newline
\textit{\textbf{Query}}: $\mathcal{Q}$ = \{$q_j$: $x_j \in \mathcal{X}, f$= T, $q_j$=$f(x_j)$\}\newline
\textit{\textbf{Candidate Documents}}: $\mathcal{R}$ = \{$x_k$: $x_k \in \mathcal{X}$\}\newline
\textit{\textbf{Task}}: For $q_j \in \mathcal{Q}$, rank the candidates based on cosine similarity.\newline
\textit{\textbf{Evaluation}}: MRR and T100. For each $q_j$, there is only one relevant document in the candidate set which is the corresponding T+A embedding.\newline
We present the results for various models on different domains in Table~\ref{tab:exp1exp2}. The results suggest that SciBERT performs poorly for all domains. OAG-BERT on an average ranks the original document in the range 5-7th position. However, we also observe that even in the best case, only 33\% queries retrieve the original document in the top-100 retrieved candidates. SPECTER, on the other hand performs consistently better than both SciBERT and OAG-BERT. The MRR score suggests that on average, the original document is ranked in the top-2 documents, also has a good T100 score across all domains. However, for around 10\% of the queries in the Arxiv-MATH, Arxiv-HEP, and ICLR datasets, SPECTER does not rank the original relevant document in the top-100 retrieved candidates.
\newline
\textbf{Task II: Introducing all Titles in the Candidate Set}
\label{sec:exp2}
To increase the complexity of the previous task, we add all the title embeddings (T) in the candidate set (Figure~\ref{fig:altret_scheme}(b)). We test if the T embeddings are more similar to other titles, or to their corresponding T+A embeddings. \\
\textit{\textbf{Query}}: $\mathcal{Q}$ = \{$q_j$: $x_j \in \mathcal{X}$, $f=$ T, $q_j$=$f(x_j)$\}\newline
\textit{\textbf{Candidate Documents}}: For query $q_j$, the candidate set $\mathcal{R}_j$ is defined as, \\
$\mathcal{R}_j$=\{$f(x_i): x_i\in \mathcal{X}, f=\mbox{T, }i\ne j$\} $\bigcup$ \{$x_k$: $x_k \in \mathcal{X}$\} \newline
The task and evaluation metrics are same as Task I.
Extremely poor values for SciBERT (Table~\ref{tab:exp1exp2}) lead us to examine the vector space of embeddings presented in Figure~\ref{fig:e2_tsne} (t-SNE plots for T and T+A embeddings), revealing that T and T+A embeddings form two non overlapping clusters. Even though the title text is a subset of T+A, SciBERT embeddings are significantly different, suggesting that input length influences SciBERT. This highlights the issue in retrieval for varying length query and candidates.
We present the t-SNE plots for other datasets in the Appendix~\ref{sec:app_embscidoc}.
SPECTER still performs the best, but a significant drop in MRR and T100 suggests that both T and T+A embeddings tightly cluster together in partially overlapping small groups (can be verified from Figure~\ref{fig:e2_tsne}). However, comparable T100 for OAG-BERT to the previous experiment suggests that the model does not falter when the input text length is small. Ideally, we expect T and T+A embeddings to overlap, indicating that the embeddings of the same paper are closer. The pretraining of these models could be the reason for such distribution of T and T+A embeddings. SciBERT is trained on sentences from full text of research papers, leading to different representations for short (T) and longer (T+A) texts. As SPECTER and OAG-BERT are trained on title and abstract fields both, such non-overlapping behavior is not observed.
\section{Analysing Scientific LMs with Textual Neighbors}
\label{sec:textual_neighbors}
In the previous section, we experimented with different input fields (T vs T+A). In this section, we experiment with the 32 textual neighbors classes (which alter different input fields: T, A, or T+A). We present our results for the following experiments for the five broad categories: LL-HS, LL-PS, LL-DS, LO-HS, and LO-DS. Due to space constraints, we present plots for selective datasets for each of the experiment in the paper. The rest of the plots are presented in Appendix~\ref{sec:app_scilmtneigh}.
\subsection{Distribution of Textual Neighbors in the Embedding Space}
We measure how textual neighbor embeddings are distributed in the embedding space in each dataset when encoded by the SciBERT, SPECTER, and OAG-BERT model. For each textual neighbor class listed in Table~\ref{tab:tneighbors}, we compute pairwise similarities among all input pairs. A plot of the similarity values for different textual neighbor categories is presented in Figure~\ref{fig:geo} (additional plots in Appendix~\ref{sec:app_simtneighorg}). It can be observed that the pairwise similarities among documents are spread out in a significantly broader range for OAG-BERT than SciBERT and SPECTER on all datasets. The average similarity for all datasets by all models is above 0.5. We do not observe any significant difference in the average similarity for different textual neighbor classes. Interestingly, for the SPECTER model, the minimum similarity is greater than zero for all datasets across all neighbor categories. Document pair similarity via OAG-BERT embeddings have a low average similarity for the LO-DS category.
We present the percentage of pair of documents for each Textual Neighbor whose similarity is greater than the average similarity in Figure~\ref{fig:per_hs} (additional plots in Appendix~\ref{sec:app_simtneighorg}). OAG-BERT shows high inter similarity (greater than 50\%) for majority of textual neighbors suggesting that more than 50\% document pairs have a cosine similarity greater than average similarity. For SPECTER vectors, all types of textual neighbors have around 50\% documents pairs having a similarity greater than mean similarity. However, extremely high values of percentage of document pairs having similarity greater than average similarity for the SciBERT model on the ACL dataset, and the OAG-BERT on almost all dataset suggests that majority of the documents in the embedding space are represented compactly for all textual neighbor categories. \\
\begin{figure}[!t]
\centering
\begin{subfigure}[b]{0.48\columnwidth}
\centering
\includegraphics[trim={0.2cm 0.2cm 0.1cm 0},clip,width=\textwidth]{figures/exp5/ArxivMATHAT.png}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\columnwidth}
\centering
\includegraphics[trim={0.2cm 0.2cm 0.1cm 0},clip,width=\textwidth]{figures/exp5/ArxivQBIONC.png}
\end{subfigure}
\caption{The bottom and the stacked bars represent NN1\_Ret and NN10\_Ret respectively. Results suggest that SciBERT embeddings for textual neighbors of scientific text are the most optimal.
}
\label{fig:exp5}
\end{figure}
\begin{figure}[!t]
\centering
\begin{subfigure}[b]{0.48\columnwidth}
\centering
\includegraphics[trim={0.1cm 0.1cm 0 0},clip,width=\textwidth]{figures/exp5_2/ArxivMATHAT.png}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\columnwidth}
\centering
\includegraphics[trim={0.1cm 0.1cm 0 0},clip,width=\textwidth]{figures/exp5_2/ArxivQBIONC.png}
\end{subfigure}
\caption{Distribution of NN1\_Ret for each textual neighbor category. SciBERT embeddings preserve the hierarchy of NN1\_Ret, i.e. PS categories (LO-PS and LL-PS) have lower values than HS categories (LO-HS and LL-HS).
}
\label{fig:exp52}
\end{figure}
\subsection{Similarity of Textual Neighbors with Original Documents}
\label{ssec:altret_tneigh}
Let $\mathcal{F}$ = \{$f^1$, $f^2$, ..., $f^n$\} be the set of textual neighbor functions described in Table 1. We query different types of textual neighbor classes against the documents embeddings (T+A). We compute the percentage of queries that successfully rank the original document in the top-1 and top-10 ranked list. We expect \textit{HS} and \textit{PS} categories to rank the original document higher in the rank list, and \textit{DS} to rank it lower. If any of the textual neighbor classes or categories don't show the expected behavior, it can be asserted that the LM is brittle in representing the specific type of textual neighbor. \newline
\textit{\textbf{Query}}:$\mathcal{Q}$ = $\bigcup\limits_{f \in \mathcal{F}}\mathcal{Q}_{f}$ = $\bigcup\limits_{f \in \mathcal{F}}$\{$q_j$: $x_j \in \mathcal{X}$, $q_j$=$f(x_j)$\}\\
\textit{\textbf{Candidate Documents}}: $\mathcal{R}$ = \{$x_k$: $x_k \in \mathcal{X}$\}\\
\textit{\textbf{Task}}: For $q_j \in \mathcal{Q}$, retrieve the most similar documents based on cosine similarity.\\
\textit{\textbf{Evaluation}}: NN1\_Ret and NN1\_10. There is only one relevant document in the candidate set for each $q_j$, which is the corresponding T+A embeddings.\newline
\begin{table*}[!thb]
\centering
\small{
\resizebox{\hsize}{!}{
\begin{tabular}{|c|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|}
\hline
\rowcolor{Gray}
\textbf{TN Cat} & \multicolumn{3}{c|}{\textbf{LO-HS}} & \multicolumn{3}{c|}{\textbf{LO-PS}} & \multicolumn{3}{c|}{\textbf{LO-DS}} & \multicolumn{3}{c|}{\textbf{LL-HS}} & \multicolumn{3}{c|}{\textbf{LL-PS}} \\ \hline
\rowcolor{Gray}
\textbf{Model} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} & \multicolumn{1}{c|}{\textbf{SB}} & \multicolumn{1}{c|}{\textbf{SP}} & \multicolumn{1}{c|}{\textbf{OB}} \\ \hline
\textit{ACL-ANTH} & 51.8 & \textbf{68.9} & 4.4 & 20.5 & \textbf{61.8} & 4.3 & 12.0 & 35.6 & \textbf{2.2} & 73.0 & \textbf{81.2} & 5.1 & 13.4 & \textbf{72.0} & 5.2 \\ \hline
\textit{ICLR} & 52.2 & \textbf{74.6} & 4.7 & 18.6 & \textbf{61.8} & 4.7 & 10.9 & 33.2 & \textbf{2.3} & 71.2 & \textbf{82.2} & 5.5 & 10.8 & \textbf{75.0} & 6.0 \\ \hline
\textit{Arxiv-CS\_SY} & 52.8 & \textbf{74.8} & 5.2 & 23.2 & \textbf{66.0} & 5.1 & 11.6 & 40.9 & \textbf{2.6} & 71.7 & \textbf{83.4} & 6.0 & 14.5 & \textbf{77.6} & 6.6 \\ \hline
\textit{Arxiv-MATH} & 52.2 & \textbf{67.4} & 5.3 & 23.0 & \textbf{62.1} & 5.3 & 14.5 & 34.5 & \textbf{3.2} & 71.1 & \textbf{80.5} & 6.1 & 31.3 & \textbf{75.4} & 6.6 \\ \hline
\textit{Arxiv-ECON} & 59.0 & \textbf{75.3} & 5.8 & 27.0 & \textbf{66.4} & 5.6 & 14.1 & 40.9 & \textbf{2.8} & 71.2 & \textbf{83.2} & 6.4 & 21.4 & \textbf{76.8} & 6.8 \\ \hline
\textit{Arxiv-QBIO} & 55.2 & \textbf{74.1} & 5.4 & 23.5 & \textbf{65.1} & 4.9 & 12.1 & 38.7 & \textbf{2.6} & 71.0 & \textbf{82.9} & 5.9 & 17.1 & \textbf{76.4} & 6.3 \\ \hline
\textit{Arxiv-HEP} & 53.1 & \textbf{66.2} & 5.9 & 22.9 & \textbf{61.0} & 5.9 & 13.5 & 34.2 & \textbf{3.6} & 71.0 & \textbf{80.0} & 6.8 & 25.4 & \textbf{73.4} & 7.2 \\ \hline
\end{tabular}}
\caption{AOP-10 values for different categories.
The best results for LO-DS category are from OAG-BERT (OB), however that is because the model performs poorly on all categories of textual neighbors. Similarly, best results for the rest four categories are from SPECTER (SP), following which it also has a high overlap percentage for the LO-DS category. SciBERT (SB) embeddings perform the best for HS and DS but falter on PS semantic categories.
}
\label{tab:nn_overlap}
}
\end{table*}
We present the results in Figure~\ref{fig:exp5}. SciBERT and OAG-BERT for the LO-DS category show less than 50\% NN10\_Ret, which is desirable as LO-DS neighbors are semantically dissimilar, and hence should not be neighbors in the embedding space. SciBERT shows improvement via NN10\_Ret over NN1\_Ret for \textit{PS} categories. High NN1\_Ret for \textit{HS} categories indicates SciBERT successfully encodes highly similar texts closer than partially similar texts. OAG-BERT performs poorly for both metrics, indicating that it doesn't encode textual neighbors optimally. SPECTER embeddings perform poorly on the LO-DS category. They however achieve the maximum values showing no difference between LO vs LL, or HS vs PS categories.
To analyse the high values for SPECTER, we present the individual NN1\_Ret for each of the 32 textual neighbor classes in Figure~\ref{fig:exp52} and observe only two classes `TDelNN' and `T\_A\_DelNNChar' which lead to less than 90\% NN1\_Ret. Unlike SPECTER and OAG-BERT, SciBERT preserve the hierarchy, with \textit{Highly Similar} classes ranked higher than \textit{Partially Similar} classes. An interesting case with SciBERT embeddings is that the T\_A\_WS neighbor class belonging to the LL-HS category, has a low NN1\_Ret value across all datasets, suggesting that the SciBERT model is extremely brittle to white space character perturbations (because of the constraint on sequence length). Another breaking point for the SciBERT is the textual neighbor class T\_ARepADJ (replacing adjectives with antonyms) of LO-DS category, which shows high values (around 80\%) for NN1\_Ret which is undesirable. We observe that among the three specific LO-PS categories `T\_ADelQ1', `T\_ADelQ2', and `T\_ADelQ3', SciBERT performs worst for the `T\_ADelQ3', indicating that the last quantile of the abstract contains relevant information encoded by SciBERT. OAG-BERT shows a reverse trend to SPECTER by achieving low values for all neighbors classes indicating brittleness to text manipulation.
\begin{figure}[!t]
\centering
\begin{subfigure}[b]{0.48\columnwidth}
\centering
\includegraphics[width=\textwidth]{figures/exp6/ArxivCSSY.png}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\columnwidth}
\centering
\includegraphics[width=\textwidth]{figures/exp6/ArxivECON.png}
\end{subfigure}
\caption{AOP-10 distribution of all categories of textual neighbors. SciBERT performs poorly for LL-PS (consists of neighbors that scramble abstract sentences). If we ignore LO-DS category, SPECTER embeddings perform decently overall.
}
\label{fig:exp6}
\end{figure}
\subsection{Overlap amongst Nearest Neighbors}
We compute the overlap amongst the nearest neighbors of each textual neighbor class and the original document embeddings.
We randomly sample a query set of 2000 queries for each textual neighbor class (and their corresponding T+A embedding) and compute nearest neighbor (NN) overlap for these. In this task, we are interested in evaluating if NN-based retrieval retrieves the same documents for a textual neighbor class and T+A embedding. \newline
\textit{\textbf{Query}}: $\mathcal{Q}$ = $\mathcal{Q}_f \cup{} \mathcal{Q}_{T+A}$ \\
$\mathcal{Q}_f$ = \{$q_j$: $x_j \in \mathcal{X}_{2000}$, $q_j = f(x_j)$\} \\
$\mathcal{Q}_{T+A}$ = \{$q_j$: $x_j \in \mathcal{X}_{2000}$, $q_j = T+A(x_j)$\} \\
\textit{\textbf{Candidate Documents}}: $\mathcal{R}$ = \{$q_j$: $x_j \in \mathcal{X}$, $q_j$=$f(x_j)$\} $\cup{}$ \{$q_j$: $x_j \in \mathcal{X}$, $f=T+A$, $q_j$=$f(x_j)$\} \\
\textit{\textbf{Task}}: For each pair of $q_j, q_k \in \mathcal{Q}$, such that $q_j \in \mathcal{Q}_f$ and $q_k \in \mathcal{Q}_{T_A}$, compute the overlap among ten nearest neighbors (NN-10) of $q_j$ and $q_k$. \\
\textit{\textbf{Evaluation}}: AOP-10.\\
We present the results arranged by Textual Neighbor categories in Table~\ref{tab:nn_overlap}. The individual AOP-10 distribution of all categories of textual neighbors is presented in Figure~\ref{fig:exp6}. While overall results look good for SPECTER, it should be noted that SPECTER performs poorly for embedding LO-DS textual neighbors indicating that it has a shallow understanding of semantics. AOP-10 values for SPECTER show a positive trend: LL-HS $>$ LO-HS and LL-HS $>$ LL-PS. SciBERT performs decently for the \textit{HS} category, but its performance drops for the \textit{PS} categories. OAG-BERT has the lowest AOP-10 for all textual neighbor categories. When put in perspective against the previous NN1\_Ret and NN10\_Ret, we believe that SciBERT performs decently in encoding the HS and PS neighbors closer to the original T+A embedding. However, low value of AOP-10 for SciBERT for PS neighbors reflects that while the PS neighbors are closer to the original document in comparison to others, the original document has other nearest neighbors than the PS neighbor.
We present a matrix to summarize the capability of the models in Table~\ref{tab:tneigh_matrix} in encoding the five textual neighbor categories. The five categories arranged in increasing order of semantic similarity are: LL-HS $\geq$ LO-HS $>$ LL-PS $>$ LO-PS $>$ LO-DS. We use heuristic-based values to define optimality. For each of the five categories, we define AOP-20 thresholds to classify if the textual neighbor representations for the corresponding are optimal or not. It is expected that AOP-20 values for semantic categories should be in order: HS $>$ PS $>$ DS. AOP-20 values for orthographic categories should follow: LL $>$ LO.
\begin{table}[!t]
\centering
\resizebox{\columnwidth}{!}{
\small{
\begin{tabular}{|l|c|c|c|c|c|}
\hline
\rowcolor{Gray}
& \textbf{LL-HS} & \textbf{LO-HS} & \textbf{LL-PS} & \textbf{LO-PS} & \textbf{LO-DS} \\ \hline
\textbf{Threshold} & $>$ 75 & $>$ 70 & \multicolumn{2}{l|}{50 $<$ AOP-20 $<$ 70} & $<$ 20 \\ \hline
\textbf{SciBERT} & \cellcolor{Gray}\textbf{75.04} & 59.62 & 22.6 & 26.28 & 14.35 \\ \hline
\textbf{SPECTER} & \cellcolor{Gray}\textbf{86.77} & \cellcolor{Gray}\textbf{77.55} & 80.93 & \cellcolor{Gray}\textbf{69.03} & 41.32 \\ \hline
\textbf{OAG-BERT} & 6.84 & 6.24 & 7.31 & 5.95 & \cellcolor{Gray}\textbf{3.17} \\ \hline
\end{tabular}
}}
\caption{Capability of the models in encoding textual neighbor categories optimally in the embedding space. Gray cells represent optimal representations for each model based on AOP-20.}
\label{tab:tneigh_matrix}
\end{table}
\section{Conclusion}
We propose five categories of textual neighbors to organize the increasing number of textual neighbor types: LL-HS, LO-HS, LL-PS, LO-PS, and LO-DS. We evaluate SciBERT, SPECTER, and OAG-BERT models on thirty-two textual neighbor classes organized into the previous five categories. We show that evaluation of language models on `Semantically Dissimilar' texts is also important rather than just evaluation on `Semantically Similar' texts. We show that the SciBERT model is highly sensitive to the input length. SPECTER embeddings for all types of textual neighbors are highly similar irrespective of whether the textual neighbor is semantically dissimilar or not. SPECTER embeddings show sensitivity to the presence of specific keywords. Lastly, OAG-BERT embeddings of all categories of textual neighbors are highly dissimilar to the original title and abstract (T+A) embeddings. We believe that our insights could be used to develop better pretraining strategies for scientific document language models and also to evaluate other language models. One example for MLM (or replaced token identification) could be utilizing a weighted-penalty based loss, i.e. partially similar tokens if predicted should be penalized less in comparison to the prediction of unrelated (or dissimilar) tokens. Additionally, these insights could also be utilised by several systems that use these scientific document language models to incorporate informed strategies in downstream systems such as recommendation systems.
| {'timestamp': '2022-03-30T02:26:49', 'yymm': '2203', 'arxiv_id': '2203.15364', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15364'} | arxiv |
\section{Introduction} \label{sec:Intro}
Machine Learning (ML) models are nowadays employed in various domains with excellent performance. When the performance is key to having a competitive advantage, ML models are widespread even when the algorithmic procedure is too complicated to be understood by humans (so called ``black box" algorithms). However, in fields where the stakes for a single decision are high (healthcare, banking, etc.)~\cite{Cutillo2020} there is still scepticism in adopting such models.
Professionals are accountable for any costly mistake, and in such cases they want to fully understand and trust the outcomes of a ML model. An important element that leads to trust in ML models is to achieve more explainability in ML~\cite{Dzindolet2003}.
In recent years, the ML community has therefore been developing tools that help ML practitioners and end-users to understand the predictions of black box models, leading to a booming of the field of Explainable AI (X-AI).
As a result, X-AI methods nowadays make up a vast literature and can be categorised in several ways. One way is to distinguish the type of output explanations: \emph{global} explanations~\cite{Friedman2001, Goldstein2015}, where the aim is to identify trends in the data and explain the model as a whole, or \emph{local} explanations \cite{Ribeiro2016, Lundberg2017}, where the aim is to understand why a certain prediction is made for a given instance.
Another common differentiation is made based on whether
the method has access to the internal components of the model and its architecture.
If that is the case, we talk about a \emph{model-specific} approach, as opposed to a \emph{model-agnostic}~(e.g.~\cite{Ribeiro2016, Lundberg2017}) approach.
In this study, we propose Bellatrex: a local, model-specific method that condenses the predictions made by a random forest (RF)~\cite{Breiman2001} into a few rules. By doing so, our method uses information directly extracted from the original RF. Furthermore, the procedure is optimised to follow closely the RF predictions for every instance, and maintains the original RF high performance.
In addition to high performance, Bellatrex provides different insights by selecting rules that are dissimilar from each other. Furthermore, given its local method, the extracted rules are different for each instance.
The choice to specifically explain RF predictions is driven by the fact that RF has a great predictive performance and is
easier to train than other highly performing methods, such as deep neural networks. Moreover, RF has been extended to a wide range of learning tasks, including binary classification, multi-label classification, regression and time-to-event prediction. We should highlight that our method is designed in such a way that it is independent of the learning task at hand, and consequently, it is capable of handling all these scenarios.
Bellatrex is built on top of a trained RF and consists of four main steps. First, for a given input instance, a subset of rules is selected based on how close their prediction is with respect to the original ensemble. Second, a vector representation is built by extracting information from the rule structure. Third, dimensionality reduction of such representations is performed and lastly, we apply clustering on the projected vector representations, extracting this way only a few prototype rules. These final rules are then presented to the end user as an explanation for the forest prediction. By keeping the number of prototype rules low, we provide a few diverse explanations, which can be inspected by the user.
Preliminary results of this work were presented in an earlier workshop paper~\cite{Dedja2021} and were restricted to binary and time-to-event predictions. Here, we extend this work to regression (both single- and multi-target) and multi-label classification. Furthermore, we also provide a thorough experimental evaluation of our method against competitor methods from the literature in predictive performance, explanation complexity and explanation diversity, followed by an ablation study which validates the steps in our method. Overall, our contributions to the field of X-AI can be summarised as follows:
\begin{itemize}
\item We propose a local approach for explaining RF predictions, with a method that extracts a few meaningful decision paths from a trained RF.
Importantly, the extracted rules are tailored to the instance to be explained, which represents, to the best of our knowledge, a novelty in the field of explaining RF predictions.
\item We evaluate our local explainer in five different scenarios: binary classification, single- and multi-target regression, multi-label classification and time-to-event prediction, where the latter three are seldom explored in existing explainability methods. The inclusion of the time-to-event analysis in particular, highlights a novelty of our work since, to the best of our knowledge, no existing model-specific interpretability method is compatible with an adaptation of RF to time-to-event scenarios.
\item We make our method available to the ML community by providing a Python implementation through GitHub\footnote{https://github.com/Klest94/Bellatrex}, compatible with the scikit-learn and scikit-survival Python libraries.
\end{itemize}
The remainder of the manuscript is organised as follows: Section~\ref{sec:Related-work} positions our work within the framework of post-hoc, RF-specific explainers, and underlines the differences with the existing literature; Section~\ref{sec:Background} provides the background information for the method section (Section~\ref{sec:Method}), where our model is introduced. These are followed by Section~\ref{sec:Experiments}, dedicated to the experimental set-up and Section~\ref{sec:Results}, where the predictive performance of the method, the average complexity of the extracted rules, and the average dissimilarity of the latter are reported together with the outcomes of the ablation study. Next, we provide two examples of explanations generated by Bellatrex in Section~\ref{sec:Examples}. Finally, we draw our conclusions and share future directions of this work (Section~\ref{sec:Conclusion}).
\section{Related work} \label{sec:Related-work}
As previously mentioned, Bellatrex falls in the category of local, model-specific methods, and in particular, Bellatrex explains the outcomes of a trained random (survival) forest model in a post-hoc fashion.
Such family of RF-specific methods has produced a rich literature as shown in~\cite{Aria2021, Haddouchi2019}, and can be categorised
in three sub-categories, namely: \emph{size reduction}, \emph{rule extraction}, and \emph{local explanation}.
In this section, we discuss other model-specific approaches that use RFs as the underlying black-box model.
The earliest example of such is~\cite{Chipman1998}. This work proposed a procedure for analysing a RF in binary classification tasks, and concepts such as \emph{tree-metric}, a distance metric defined on the space of tree learners, are also introduced.
Trees are then represented in a two-dimensional space by using Multi Dimensional Scaling~\cite{Mead1992} on the tree-distance matrix. The authors then perform a qualitative study and mention the possibility of clustering the resulting tree representations.
A more recent work by~\cite{Sies2020} followed the path traced by~\cite{Chipman1998} by suggesting a range of tree similarity metrics and by performing clustering on such tree representations. Furthermore, the authors implicitly propose a vector representation of trees based on the covariates used to build them and it consists of an adaptation of the approach from~\cite{Banerjee2012}.
Given such representation, the authors clustered and extracted a few trees out of a random forest and illustrate the validity of their framework ``C443" on simulated and real world datasets.
The resulting method has some features in common with ours, namely, the idea of representing tree- (or rule-) distances for clustering purposes. However, the focus in C443 lays more on giving an overview of the possible approaches rather than optimising the performance of a surrogate model. Furthermore, the C443 method aims at global explanations (e.g. by looking at trends and sources of heterogeneity), rather than focusing at an instance-base level.
Later work by~\cite{Zhao2019} (``iForest") made use of a tree-distance metric intuition to project tree paths via t-SNE~\cite{hinton2002}, and made also use of visual analytics to improve interpretability. These visuals include a ``feature view" that shows the relationship between a selected covariate and a prediction (similarly to a Partial Dependency plot~\cite{Friedman2001}) as well as a control panel that just lets the user see the decision paths that lead to the prediction of a group of instances. Unlike Bellatrex, there is no rule extraction or forest approximation mechanism and none of the original learners are shown to the end user.
Other relevant approaches include~\cite{Moore2018}, where the authors presented a method for computing how a covariate within a value range influences the final prediction of a model, while an optimisation-based approach that exploits the bijective relationship between a tree leaf and a subspace of the input space is proposed by~\cite{Hara2018}.
Similarly, recent work~\cite{LionForest, multilabel-LionForest} proposes a method called ``LionForest", where rules are generated in a local approach fashion, and path reduction approaches are run in order to provide shorter rules with more ``conclusive" (i.e., stable) explanations.
A toolbox named ``SIRUS" is proposed in~\cite{Benard2021}, where a set of rules is extracted from an RF and shown as an explanation.
More specifically, rules are first generated by large RF and a pre-selection step picks the most commonly occurring ones. After that, a ``post-treatment" step narrows down the selection by eliminating rules associated to a linear combination of other rules of higher frequency. The procedure stops when the desired number of final rules is reached and is then shown to the end user. These final rules serve as an explanation of the original RF and their average prediction can be used as a the prediction of the obtained surrogate model.
The resulting explanation is global and consists of a limited number of rules that are stable under different subsets of data, and
whose outcome can be averaged to get a prediction.
More recently, ``RuleCOSI+"~\cite{RuleCOSI+} has been proposed as another global, rule-extraction (according to the categorisation by~\cite{Aria2021}) method that greedily combines and simplifies the corresponding base trees.
More specifically, the algorithm builds a decision list by iteratively creating new rules by merging or pruning the ones generated by the tree ensemble. At the end of each iteration step, the generated rule is added to the existing list under the condition that it is beneficial to the generalisation performance.
When no extra rules can be added, an empty rule (playing the part of an ``else" instance) is appended, and the final model consists of the set of rules found, structured as members of a decision list. That is, for a given instance to be explained, the rules are evaluated in order of appearance until one of them is found to hold and is used as the models' prediction. If no rules are fired, the final (``empty") rule is used to make the prediction.
Finally, a size-reduction, global approach is represented by ``Hierarchical Shrinkage"~\cite{HS2022} (HS) algorithm. The idea is to increase performance and robustness of tree learners by shrinking the predictions of any leaf node towards the predictions of its ancestors. The shrinking operation is performed repeatedly and is controlled by a regularisation parameter. The resulting tree has a size that can be controlled and offers a global explanation to the model.
It is worth mentioning that the aforementioned RF-specific, post-hoc explainability methods follow a global approach and therefore show the same explanation regardless of the input instance. Bellatrex, on the other side, follows a local approach that adapts its explanations to the instance of interest. This leads to an increased flexibility of the output explanation and allows Bellatrex to closely follow the predictions of the underlying RF.
\section{Background} \label{sec:Background}
Random forest~\cite{Breiman2001} (RF) is a computationally efficient ML method that delivers excellent predictive performance, and since its appearance, RFs have been extremely successful in performing classification and regression tasks. Moreover, RFs have been extended to a variety of other learning tasks, including multi-label classification~\cite{Vens2008} and survival analysis~\cite{Ishwaran2008}.
Most of the extensions that have been proposed over the years are associated with the node splitting mechanism as well as the prototype function (i.e., the function that provides predictions in the leaves), while less modifications have been proposed for other RF characteristics, such as the bootstrapping.
A common splitting criterion for RFs in binary classification is the Gini impurity index, whereas a common prototype function returns the most frequent class label among training instances falling in the leaf. For single-output regression tasks, the splitting rule that maximally reduces within-node variance in the target values is usually chosen, and the average target value is returned as prediction.
In multi-label classification, a single instance may belong to multiple classes and, hence, the task is to predict the correct subset of class labels for each instance. Multi-label classification has many applications, including text classification, image annotation, protein function prediction, etc. Several machine learning methods have been adapted to multi-label classification, including random forests~\cite{Kocev2013, Pedregosa2011}. In order to take into account the multiple labels, the splitting criterion is adapted by maximising either the average impurity reduction~\cite{Pedregosa2011} or average variance reduction~\cite{Vens2008}, across all the (binary) labels. These criteria implicitly take into account label dependence and are often preferred to methods that train output labels independently~\cite{Kocev2013}. In both cases, the leaves return a vector, where each component represents the proportion of instances annotated with the corresponding label.
Similarly, RF have been adapted to multi-target regression tasks, where multiple continuous targets are predicted at once. In this case, the reduction in within-node variance is computed for all targets and the average is taken.
Survival analysis is a branch of statistics that has only recently been explored in the machine learning community~\cite{Wang2019}. The goal of such analysis is to predict the time until an event occurs (hence, this task is also known as time-to-event prediction). Applications include clinical studies, where the outcome of interest is the time until a patient dies, suffers from complications, is discharged from hospital, etc. A key challenge in this field is the so called \emph{censoring} effect, that is when the exact time of the event is not observed, resulting in partial information. For instance, in the case of right censoring, which is the type of censoring included in our study, the recorded event time is an underestimate of the true time. This may for instance occur when a patient drops out from the study or has not reached the outcome event before the study ends. Decision trees and random forests (as well as other machine learning methods) have been adapted to survival data, they are called (Decision) Survival Trees~\cite{LeBlanc1993}
and Random Survival Forests (RSF)~\cite{Ishwaran2008}, respectively. The main splitting criterion being used is the \emph{logrank} score~\cite{Peto1972}, a criterion that guarantees good generalisation for censored time-to-event data~\cite{Ishwaran2008}.
This criterion aims at splitting the population in maximally different subgroups with maximally different hazard functions.
At each leaf node, a Kaplan-Meyer~\cite{KaplanMeyer1958} estimate of the survival function for the population that falls in that node is built.
\section{Proposed Method} \label{sec:Method}
Let $\mathcal{T}$ be a random forest and let $\bm{x}$ be an instance for which we want to find an explanation. Bellatrex uses these inputs to generate an explanation, and an overview of the procedure is illustrated in Figure~\ref{fig:method}.
\begin{figure*}[ht]
\centering
\includegraphics[width=0.9\textwidth]{Method_main_figure.pdf}
\caption{Schematic representation of the steps in Bellatrex. Given a trained RF and an instance (top left), a pre-selection is performed (top), followed by the vectorisation step. Such vectors are projected (top right) and clustered (bottom right), the final selected rules are shown to the end-user (bottom left).}
\label{fig:method}
\end{figure*}
We first extract $\tau$ trees $\mathcal{T}_i \in \mathcal{T}$ that generate the most similar predictions $\mathcal{T}_i(\bm{x})$ compared to the ensemble model prediction $\hat{y} = \mathcal{T}(\bm{x})$. Next, we represent each of the selected trees $\mathcal{T}_i$ as a vector; this vector can be a function of the tree structure, or solely depend on the path traversed by $\bm{x}$. Only a few studies~\cite{Chipman1998, Sies2020} have addressed the issue of representing decision trees as a numerical vector, and they only focus on global representations.
Given the local nature of Bellatrex, we propose two path-based approaches, where we follow the instance of interest $\bm{x}$ as it traverses the tree and record the input covariates used to perform each split.
In the first approach, which we call \emph{simple}, the vector representation $[f_1, f_2, \dots, f_p]$ consists of the number of times each of the $p$ covariates is selected to perform a split along the path traversed by~$\bm{x}$. In formulas:
\begin{equation} \label{eq:path-based}
\begin{split}
\mathcal{T}_i, \bm{x} \mapsto & \bm{f} =[ f_{1}, f_{2}, \dots, f_{p}], \text{ where} \\
f_i = & \sum_{k \in \text{path$(\bm{x})$}} \mathbbm{1} \{\text{split on covariate $i$}\}.
\end{split}
\end{equation}
Unlike the tree-based approach that arises from~\cite{Sies2020}, the path-based vector representation of $\mathcal{T}_i$ depends on the instance of interest $\bm{x}$ and is therefore more tailored to the local nature of Bellatrex.
A drawback of this representation is that splits have the same contribution regardless of the importance they have in the final predictions, whereas splits performed close to the root node should be considered as more important than the ones close to a leaf. To tackle this, we also propose a \emph{weighted} version of the previous approach, where the contribution of each node-split $k$ is weighted by the proportion of instances $\omega_k$ traversing the node.
In formulas, the representation becomes:
\begin{equation} \label{eq:weighted-path-based}
\begin{split}
\mathcal{T}_i, \bm{x} \mapsto & \bm{g} =[g_{1}, g_{2}, \dots, g_p], \text{ where} \\
g_i = & \sum_{k \in \text{path$(\bm{x})$}} \omega_k \cdot \mathbbm{1}\{ \text{split on covariate $i$}\}.
\end{split}
\end{equation}
It is worth noting that the resulting weights are positive and upper bounded by 1, which is the weight assigned to the root node split, furthermore, the assigned weights decrease as the depth increases. By doing so, rules that differ (only) in the root node splitting covariate will be further apart in Euclidean distance compared to the ones whose decision paths differ (only) in the deeper nodes, which is in agreement with common intuition.
Next, we project such vector representations to a low-dimensional space using Principal Component Analysis (PCA)~\cite{Pearson1901}. The idea is to remove the noise, to improve computational efficiency for later steps, and to enable a better visualisation of the subsequent clustering. The representations are real-valued vectors of length $d$ at this stage, where $d$ is the number of output dimensions of the PCA.
In order to obtain a diverse set of explanations, as the next step, we perform clustering on the vector representations using a standard clustering method, such as K-Means++~\cite{vassilvitskii2006} (see an example in Figure~\ref{fig:plot-clusters}).
By doing so, we group the vectors into $K$ clusters, we identify the vector closest to each cluster centre and pick the corresponding rule as a representative for explaining the outcome of the model. The rules extracted with this procedure correspond to what we call \emph{final rules}, and the nature of the partitioning step guarantees the distance among the vector representations
of the selected final rules is maximal.
It is worth noting that similar results can be obtained with other partitioning algorithms such as K-median~\cite{park2009}, as long as the aim of the algorithm is to maximise between-cluster distance.
Finally, given the $K$ clusters, the corresponding final rules $\mathcal{T}_{\tau_k}$, and the instance $\bm{x}$, we build a surrogate model prediction $\bar{y}$ as follows:
\begin{equation} \label{eq:weighted-avg}
\bar{y} = \sum_{k=1}^K w_k \mathcal{T}_{\tau_k}(\bm{x})
\end{equation}
where $w_k$ represents the weight given to the cluster $k$. We define $w_k$ as the proportion of the $\tau$ rules (selected in the first step) that are part of the cluster. It follows that $\sum w_k = 1$, and that the surrogate model predicts a weighted average of the selected rules.
\begin{figure}[ht]
\centering
\includegraphics[width=0.95\columnwidth]{plot_blood_i65_v2.png}
\caption{Left side: Example of the clustering step following rule pre-selection, vectorisation and PCA for the ``blood" dataset (Section~\ref{sec:performances} for details) and a test instance $\bm{x}$. The centroids of the K-Means++ algorithm are shown in grey, and the final representative rules are plotted with a star shape. Right side: individual rule predictions and Bellatrex final prediction for $\bm{x}$.}
\label{fig:plot-clusters}
\end{figure}
Our method requires three hyperparameters: the number of trees $\tau$ to keep in the pre-selection phase, the number of output components $d$ for PCA, and the number of clusters $K$. The optimal values can be tuned for each test instance separately, by calculating the \textit{fidelity} of the surrogate model to the original ensemble.
This measure is an indicator of how closely the original ensemble prediction is being imitated by our surrogate model, and has recently been listed~\cite{Guidotti2018} as a desirable property for interpreting black-box models. Given an instance $\bm{x}$, the prediction made by the original R(S)F $\hat{y}$ and the new surrogate prediction $\bar{y}$, we define and compute fidelity $\mathcal{F}(\bm{x})$ as:
\begin{equation} \label{eq:fidelity}
\mathcal{F}(\bm{x}) = 1 - \Vert \hat{y} - \bar{y} \Vert_2.
\end{equation}
Depending on the predictive scenario, $\hat{y}$ and $\bar{y}$ are either scalars for predicted probabilities (binary classification), estimated scalar values (regression), vectors of predicted class probabilities (multi-label classification) or real valued-vectors (multi-target regression), or scalar predicted risk scores (survival analysis).
Note that $\mathcal{F}(\bm{x}) = 1$ for a given instance $\bm{x}$ indicates perfect fidelity of Bellatrex to the original model.
As a result, the hyper-parameter combination $(\bar{K}, \bar{d}, \bar{\tau})$ that maximises $\mathcal{F}$ can be chosen.
An important advantage of our method is that it does not require an external validation set to tune these hyperparameters; the proposed method looks instead at the \emph{predicted} labels from the underlying RF model which at this stage serves as an oracle, in a procedure similar to the one described in~\cite{Zhou2016}. The hyperparameters that, for a given test instance, yield the prediction closest to the underlying RF prediction are the ones selected. By doing so, we increase the fidelity of the surrogate model to the underlying black box, and we concurrently allow a more efficient use of data, since a greater fraction of it can be used to train the underlying model instead of being left aside for the purpose of hyperparameter tuning.
Alternatively, the parameter values can be determined by the user. In the latter case, end-users have the option to choose, for example, the number of clusters and thus, explore the trade-off
between having a simple (single) explanation against obtaining multiple (different) explanations for a given example.
\subsection{Computational complexity}
We now analyse the computational complexity of Bellatrex.
Given the number of data instances $n$, the number of covariates $p$, and the number of learners $m$, the computational complexity of Bellatrex can be estimated by looking at the complexity of its four main steps:
\begin{itemize}
\item The sorting algorithm for rule pre-selection, with complexity $\mathcal{O}(m\log m)$;
\item The vectorisation process of the pre-selected rules: $\mathcal{O}(m \log n)$;
\item The dimensionality reduction step, performed with PCA, with $\mathcal{O}(n_{max}^2 n_{min})$~\cite{PCA}, where $n_{max}=\max(m,p)$ and $n_{min}=\min(m,p)$.
\item partitioning algorithm, namely K-Means++, with $\mathcal{O}(p m)$, followed by a nearest neighbour search, performed with KDTree~\cite{KDTree}, with $\mathcal{O}(p m \log(m))$.
\end{itemize}
We conclude that the computational complexity of Bellatrex is mainly driven by the dimensionality reduction step.
Translating the above analysis into practice, we observe that querying Bellatrex for an explanation
is quite fast and takes a couple of seconds to run on a laptop.
Moreover, we notice that Bellatrex is sensitive to dataset size, but not so much to the
number of trees $m$ of the underlying RF learner, which is typically $m=100$.
\section{Experiments} \label{sec:Experiments}
We evaluate our method (with simple and weighted vector representations) across multiple datasets; unless otherwise specified, the datasets are selected from publicly available repositories such as UCI\footnote{https://archive.ics.uci.edu/ml/datasets.php} and MULAN\footnote{http://mulan.sourceforge.net/datasets-mlc.html} or downloaded from \textsf{sklearn}'s library.
Overall, we include as many as 89 datasets spanning five different prediction scenarios, more specifically:
\begin{itemize} \setlength{\itemsep}{0pt}
\item 24 datasets for binary classification;
\item 14 datasets for survival analysis (time-to-event prediction);
\item 19 datasets for regression;
\item 13 datasets for multi-label classification;
\item 19 datasets for multi-target regression.
\end{itemize}
\subsection{Data and pre-processing}
We report an overview of the datasets used for our study,
where information about the number of data instances, the number of covariates, and the format of the output labels is included. For the binary classification case, the frequency of the positive class is reported, whereas for the time-to-event data we report the censoring rate.
For tasks involving a vector prediction (multi-label classification and multi-target regression), we report the number of labels (or targets) to be predicted.
A number of pre-processing steps were performed before running the experiments in Section~\ref{sec:Experiments-set-up}.
More specifically, categorical variables were one-hot encoded, instances and covariates with more than 30\%~missing values were dropped, and the remaining missing values were imputed with MICE~\cite{MICE, VanBuuren2007}. The resulting cleaned datasets properties are shown in Tables~\ref{tab:binary-info}-\ref{tab:mtr-info}.
Table~\ref{tab:binary-info} shows the binary classification scenario, whereas Table~\ref{tab:multi-label-info} shows its multi-label counterpart, where each instance can be associated to multiple labels at the same time.
\begin{table}[!ht]
\scriptsize
\begin{center}
\captionsetup{width=.9\linewidth}
\caption{Overview of the datasets for binary classification tasks}\label{tab:binary-info}
\begin{tabular}{l|cc}
\toprule
& \makecell{data size \\ $(n , p)$} & \makecell{\% positive \\ class} \\
\midrule
blood &(748 , 4) &24 \\
breast cancer diagn. &(569, 30) &37 \\
breast cancer &(699, 10) &34 \\
breast cancer progn. &(198, 33) &24 \\
breast cancer coimba &(116, 9) &55 \\
colonoscopy Green &(98, 62) &68 \\
colonoscopy Hinselm. &(97, 62) &85 \\
colonoscopy Schiller &(92, 62) &73 \\
divorce &(170, 54) &49 \\
Flowmeters &(87, 36) &60 \\
haberman &(306, 3) &26 \\
hcc-survival &(165, 49) &62 \\
ionosphere &(351, 34) &36 \\
LSVT voice &(126, 310) &67 \\
mamographic &(961, 5) &46 \\
musk &(476, 166) &43 \\
parkinson &(756, 753) &75 \\
risk factors &(858, 35) &6 \\
crashes &(540, 18) &91 \\
sonar &(208, 60) &53 \\
SPECT &(267, 22) &79 \\
SPECTF &(267, 44) &79 \\
vertebral &(310, 6) &68 \\
wholesale &(440, 7) &32 \\
\bottomrule
\end{tabular}
\footnotetext[1]{short for ``breast cancer"}
\footnotetext[2]{short for ``colonoscopy"}
\end{center}
\end{table}
\begin{table}[ht]
\scriptsize
\begin{center}
\captionsetup{width=.9\linewidth}
\caption{Overview of the datasets for multi label classification tasks}\label{tab:multi-label-info}
\begin{tabular}{l|cc}
\toprule
& \makecell{data size \\ $(n , p)$} & \makecell{number \\ of labels} \\
\midrule
birds &(645, 260) &19 \\
CAL500 &(502, 68) &174 \\
emotions &(593, 72) &6 \\
enron &(1702, 1001) &53 \\
flags &(193, 19) &7 \\
genbase &(662, 1185) &27 \\
langlog &(1460, 1004) &75 \\
medical &(978, 1449) &45 \\
ng20 &(4379, 1006) &20 \\
scene &(2407, 294) &6 \\
slashdot &(3782, 1079) &22 \\
stackex chess &(1675, 585) & 227 \\
yeast &(2417, 103) &14 \\
\bottomrule
\end{tabular}
\end{center}
\end{table}
The datasets used in the framework of the time-to-event scenario are shown in Table~\ref{tab:survival-info}
\begin{table}[!ht]
\scriptsize
\begin{center}
\caption{Overview of the time-to-event datasets.}\label{tab:survival-info}
\begin{tabular}{l|cc}
\toprule
& \makecell{data size \\ $(n , p)$} & \makecell{censoring \\ rate (\%)} \\
\midrule
addicts &(238, 3) &37 \\
breast cancer survival &(198, 80) &74 \\
DBCD &(295, 4919) &73 \\
DLBCL &(240, 7399) &43 \\
echocardiogram &(130, 9) &32 \\
FLChain &(7874, 8) &72 \\
gbsg2 &(686, 8) &56 \\
lung &(228, 8) &28 \\
NHANES I\tablefootnote{https://www.cdc.gov/nchs/nhanes/about\_nhanes.html} &(9931, 18) &65 \\
PBC &(403, 19) &56 \\
rotterdam (excl. \textsf{recurr}\tablefootnote{the \textsf{reccur} covariate is highly correlated with the final time to event}) &(2982, 11) &57 \\
rotterdam (incl. \textsf{recurr}) &(2982, 12) &57 \\
veteran &(137, 9) &7 \\
whas500 &(500, 14) &57 \\
\bottomrule
\end{tabular}
\footnotetext[2]{https://www.cdc.gov/nchs/nhanes/about\_nhanes.html}
\footnotetext[3]{the \textsf{reccur} covariate is highly correlated with the final time to event}
\end{center}
\end{table}
Finally, we consider the single target and multi-target regression scenarios. For a better comparison of prediction errors, all target covariates have been normalised to the $[0, 1]$ interval. The employed datasets are shown in Tables~\ref{tab:regression-info}-\ref{tab:mtr-info}.
\begin{table}[ht]
\scriptsize
\centering
\caption{Overview of datasets with regression tasks.}\label{tab:regression-info}
\begin{tabular}{l|cc}
\toprule
& \makecell{data size \\ $(n , p)$} \\
\midrule
airfoil &(1503, 5) \\
Ames Housing &(2915, 283) \\
auto mpg &(398, 7) \\
bike sharing &(731, 12) \\
boston housing &(506, 14) \\
california &(20640, 8) \\
car imports &(201, 63) \\
Computer&(209, 6) \\
concrete compress &(1030, 8) \\
concrete slump &(103, 9) \\
ENB2012 cooling &(768, 8) \\
ENB2012 heating &(768, 8) \\
forest fires &(517, 12) \\
PRSA data &(41757, 13) \\
slump dataset &(103, 9) \\
students maths &(395, 43) \\
wine quality all &(6497, 12) \\
wine quality red &(1599, 11) \\
wine quality white &(4898, 11) \\
\bottomrule
\end{tabular}
\end{table}
\begin{table}[ht]
\scriptsize
\caption{Overview of datasets with multi-target regression tasks.}\label{tab:mtr-info}
\begin{tabular}{l|cc}
\toprule
& \makecell{data size \\ $(n , p)$} & \makecell{number \\ of targets} \\
\midrule
andro &(49, 30) &6 \\
atp1d &(337, 370) &6 \\
atp7d &(296, 370) &6 \\
edm &(154, 16) &2 \\
enb &(768, 8) &2 \\
ENB2012 &(768, 8) &2 \\
jura &(359, 15) &3 \\
oes10 &(403, 298) &16 \\
oes97 &(334, 263) &16 \\
osales &(639, 401) &12 \\
rf1 &(9125, 64) &8 \\
rf2 &(4332, 576) &8 \\
scm1d &(9803, 280) &16 \\
scm20d &(8966, 61) &16 \\
scpf &(1137, 23) &3 \\
sf1 &(323, 10) &3 \\
sf2 &(1066, 9) &3 \\
slump &(103, 7) &3 \\
wq &(1060, 16) &14 \\
\bottomrule
\end{tabular}
\end{table}
\subsection{Competing methods} \label{sec:Competing-methods}
The proposed algorithm is compared against several competing methods. More specifically we include:
\begin{itemize}
\item Four tree-based models, of various degree of performance and interpretability.
\item Two linear models that are ante-hoc interpretable
\item Four methods from literature that provide post-hoc explanations to RF predictions
\end{itemize}
\subsubsection*{Tree-based methods} \label{sec:tree-based}
The first family of models that we compare against includes tree-based learners
such as DT and RF. These methods represent the two extremes of the performance-interpretability trade-off.
In addition, we propose two approaches, namely ``Small R(S)F" and ``OOB (Survival) Trees", that position themselves somewhere in between
The Small R(S)F method consists of training a Random (Survival) Forest with $K$ base tree learners, where the value of $K$ is chosen for each test instance to be equal to the one used by Bellatrex\footnote{For reporting predictive performance, in the interest of space, $K$ is set as in the weighted path-based Bellatrex, and similar values are observed if the unweighted path-based set-up was used instead.}.
The OOB (Survival) Trees method consists of averaging the prediction of $K$ selected trees from a full R(S)F, where the $K$ trees with smallest out-of-bag (OOB) error are selected. The value $K$ is again set to the same value as the number of final rules extracted by Bellatrex (in its weighted set-up).
\subsubsection*{Linear, ante-hoc explainable methods}
Next, we perform a performance comparison with competing methods that are \emph{ante-hoc} explainable, that is, models that are interpretable by design. We include a regularised regression model (LR) with elastic net penalty for binary classification, multi-label classification, regression, and multi-target regression. Additionally, we consider a regularised Cox-Proportional Hazard (Cox-PH)~\cite{cox1972} for time-to-event data
\subsubsection*{Post-hoc competitors}
Finally, we compare our method against recent work in literature. For this purpose we select from the related work Section~\ref{sec:Related-work} the methods that have a publicly available source code. The selection narrows down to C443~\cite{Sies2020}, SIRUS~\cite{Benard2021}, RuleCOSI+~\cite{RuleCOSI+} and HS~\cite{HS2022}. It is worth mentioning that only SIRUS and HS fully support regression tasks, and that only the latter is adapted to multi-target regression and multi-label classification. Moreover, none of the selected competing methods is adapted to a survival analysis scenario.
To begin with, to set up a comparison between C443 (available for binary classification tasks only, within the homonym package in \textsf{R}) and Bellatrex, we train the underlying RF black-box model with the same number of learners and stopping criterion as in Section~\ref{sec:Experiments-set-up}. Next, we run C443, collect the output trees, and average their prediction (weighted proportionally to cluster size) for a close comparison. As for the number of clusters
we run C443 with $K=3$, which is the upper bound for the number of rules extracted by Bellatrex.
To run the comparison with SIRUS, we keep the parameters suggested by the authors. More specifically, the underlying RF model is trained with 5000 trees and the number of final rules to be extracted is set to 10.
For RuleCOSI+, we run the proposed method
after increasing the maximum rule length to 5 and the rule confidence to be at least 0.9, we do so to achieve better performance. We therefore report RuleCOSI+ results for this particular choice of hyperparameters.
Finally, we consider Hierarchical Shrinkage~\cite{HS2022} (HS) method in its default configuration. Such configuration sets the maximum number of leaves of the underlying DT learner to 20.
\subsection{Evaluation metrics}
We consider several metrics to validate our method's performance and interpretability, as well as to compare it against similar methods in literature.
Firstly, we look at predictive performance, whoch is also a desirable property for model interpretability~\cite{Guidotti2018, Doshi-Velez-2017}. Next, we look at the complexity of the explanations generated by our method. Finally, we check against redundancy of the explanations by looking at the dissimilarity of the generated rulesets.
\subsubsection*{Performance}
The predictive performance of the models is computed by means of commonly used measures in each of the five tasks. More specifically, we evaluate the
AUROC for binary classification, the weighted average AUROC in multi-label classification (averaged over each label with weight proportional to the number of positive instances of the label),
mean absolute error
(MAE) for single target and multi-target regression tasks (in the latter case averaged over the targets), and concordance index (C-index) for the survival analysis data.
\subsubsection*{Complexity} \label{sec:complexity}
Next to predictive performance, we investigate the complexity of the generated explanations, a concept that is inversely related to model interpretability. The notion of interpretability is itself difficult to measure objectively as no general definition of interpretability exists~\cite{Molnar2020, Doshi-Velez-2017}, and many metrics have been proposed~\cite{Hoffman2018}.
However, when it comes to specifically interpreting tree-based models,
it is common to report the total number of rule-splits shown by the model explainer as a measure of interpretability~\cite{RuleCOSI+, Hara2018, inTrees}, where a lower number of rule-splits (complexity) corresponds to a higher interpretability.
Formally, consider an explanation made of rules $\mathcal{R} = \{ r_1, \dots, r_m\}$, and let $\{\text{len}(r_1), \dots, \text{len}(r_m)\}$ be their respective length (that is, number of split tests), then the \emph{complexity} of the explanation is computed as:
\begin{equation} \label{eq:avg-complexity}
\mathcal{C} = \sum_{r_i \in \mathcal{R}} \text{len}(r_i)
\end{equation}
In practice, which set of rules $\mathcal{R}$ constitute an explanation is not always well defined and can depend on the user needs. In the context of our study, since we are focusing on local explanations, we include in $\mathcal{R}$ only the rules that are effectively used for the final instance prediction. More specifically:
\begin{itemize} \label{text:complexity}
\item In case one or more decision trees are shown to the end-user as an explanation, we estimate $\mathcal{C}$ by counting only the rule(s) $r_{t_1}, \dots , r_{t_n}$ that lead to a leaf node, and we define $\mathcal{R} = \{ r_{t_1}, \dots r_{t_n} \}$. This is the case of HS, DT, C443, OOB Trees, and Small RF.
\item In case, such as in RULECOSI+, the end-user is presented an ordered decision list with $m-1$ disjoint rules and a final rule $r_m$ that serves as an ``else" clause, then one of the two scenarios holds:
\begin{itemize} \setlength{\itemsep}{0pt}
\item the activated rule is ${r_n} \neq r_m$. In this case, we consider that the activated rule is a sufficient explanation, hence we set $\mathcal{R} = \{ r_n\}$;
\item the activated rule is $r_m$, which is not a sufficient explanation since it has no antecedent and its prediction is used because none of the previous rules is activated. The explanation for the end-user is complete only if all rules are shown, therefore we set $\mathcal{R} = \{r_1, \dots r_m\}$.
\end{itemize}
\item In case of a collection of decision rules $\{ r_1, \dots, r_m\}$ such as in Bellatrex and SIRUS, we have $\mathcal{R} = \{ r_1, \dots, r_m\}$.
\end{itemize}
The above definition suggests that the complexity of an explanation increases as the rules get longer or as the cardinality of $\mathcal{R}$ increases, which is in agreement with human intuition.
Regarding this, we notice that, let $d$ be the maximum depth of a tree and $K$ the number of extracted rules by Bellatrex for a given instance, we have $\mathcal{C} \leq K d$. This means that the complexity of the final explanation can be tuned by either adjusting the maximum depth of the underlying RF, or by tuning the maximum value of $K$ in the rule extraction step of Bellatrex. Such two-fold tuning can also be performed with C443, but cannot be as effective with other methods such as SIRUS (where rules are already extremely short), or DT and HS (where $K=1$ already).
\subsubsection*{Dissimilarity}
Finally, we consider the dissimilarity of the extracted rules.
For this purpose, we define a distance on the tree-representation space. We use a generalised version of the Jaccard similarity index~\cite{Sies2020}, where the ratio between the element-wise minimum and maximum of two vectors is taken. Namely, given the vector representations $\bm{v_i}$ and $\bm{v_j}$ of two rules, we compute their similarity $\mathcal{S}$ as:
\begin{equation} \label{eq:Jaccard}
\mathcal{S}(\bm{v_i},\bm{v_j}) = \frac{\sum_{k=1}^{p} \min(v_{i k}, v_{j k})}{\sum_{k=1}^{p} \max(v_{i k}, v_{j k})}.
\end{equation}
Given an instance $\bm{x}$ and the vector representation of the associated final rules $\bm{v}_{i_1}, \dots, \bm{v}_{i_K}$, we obtain the rule dissimilarity $\mathcal{D}$ for $\bm{x}$ by computing the average pairwise dissimilarity $1- \mathcal{S}$ between the $K$ final rule vector representations:
\begin{equation} \label{eq:avg-dissimilarity}
\mathcal{D} = \frac{1}{K (K - 1)} \sum_{l \neq j}^{l, j \in \{ i_1, \dots i_K \}} 1-\mathcal{S}(\bm{v_l}, \bm{v_j})
\end{equation}
Finally, $\mathcal{D}$ is computed for every test instance, and the average is reported in the results (Section~\ref{sec:Results}). When $K=1$, dissimilarity in Equation~\eqref{eq:avg-dissimilarity} is not defined, therefore such instances are not included in the computation.
\subsection{Experimental set-up} \label{sec:Experiments-set-up}
In all experiments, we trained the original RF with 100 base learners.
As stopping criterion, we required that split-nodes included at least 5 instances, or at least 10 for the time-to-event scenario. No post-pruning techniques were applied.
The average predictive performance, complexity, as well as dissimilarity along a 5-fold cross validation is reported. The test sample size for datasets exceeding 500 instances is limited to 100 for computational reasons\footnote{Note that the algorithmic procedure of rule extraction, including hyperparameter tuning, is performed for every test instance separately.}. In the multi-label classification scenario, we drop labels that do not occur in the training or testing folds, since AUROC would otherwise not be defined.
With regards to hyperparameter tuning for the steps of our method (rule pre-selection, dimensionality reduction, clustering), the values are tested in a grid search fashion and are shown in Table~\ref{tab:hyperparameters}.
\begin{table}[ht]
\footnotesize
\centering
\begin{tabular}{|c|c|c|}
\hline
name & description & values \\
\hline
$\tau$ & \makecell{nb. of pre- \\ selected trees} & \{20, 50, 80\} \\
\hline
$d$ & \makecell{nb. of dimensions \\ after PCA} & \{2, 5, no PCA\} \\
\hline
$K$ & \makecell{nb. of clusters \\ and final rules} & \{1, 2, 3\} \\
\hline
\end{tabular}
\caption{Possible choices for the hyperparameters in Bellatrex. For every instance the combination with the highest achieved fidelity $\mathcal{F}$ is chosen.}
\label{tab:hyperparameters}
\end{table}
As explained earlier, these values are optimised for each test instance individually according to fidelity (Equation~\ref{eq:fidelity}).
The rationale behind this grid is that the possible values for $\tau$ and $d$ cover a wide range while using at most 3 different values and limit computation time.
Furthermore, the values for $K$ are chosen so that at most 3 final rules are selected, keeping the model fairly explainable.
\section{Results}\label{sec:Results}
In this Section, we report the average predictive performance, complexity, and dissimilarity of the explanations generated by our method across the different datasets. On the predictive performance side, we compare the weighted and the unweighted path-based approach of Bellatrex against the competing methods introduced in Section~\ref{sec:Competing-methods}, with the RF model be treated as an upper, black-box benchmark.
Once the best performing rule representation approach for Bellatrex is identified, its explainability and dissimilarity are compared against relevant competitors.
More specifically, the complexity (Eq.~\eqref{eq:avg-complexity}) of the output explanations is compared against rule extracting algorithms where the total number of splits can be counted
Finally, the average dissimilarity (Eq.~\eqref{eq:avg-dissimilarity}) of the rulesets extracted by Bellatrex is compared against methods that extract a similar number of rules from a RF
Tables with dataset-specific results are presented for the binary classification data, whereas, to avoid excessive repetition, only average results are reported for the remaining scenarios. The reader can find the dataset-specific results in the Appendix.
Additionally, we test the statistical significance of the observed differences (in performance, in dissimilarity and in complexity of the explanations) among methods, and we do so by conducting a post-hoc Friedman-Nemenyi test, setting the significance level to 0.05, as recommended in~\cite{Demsar2006}.
Results are visualised with critical difference diagrams, which connect methods that are not statistically significantly different by horizontal line segments. Following the same approach as before, we report the results of the Friedman-Nemenyi for the binary classification tasks in the text, and we share the results of the remaining scenarios in the Appendix.
Finally, we present an ablation study; that is, we verify whether the main steps of the proposed procedure are of added value to the method. The study is repeated for the five tasks evaluated
\subsection{Predictive performance} \label{sec:performances}
We compute the average test-set performance for every considered dataset over 5-fold cross validation. We report the average across datasets for each of the five types of prediction tasks, and we include the dataset-specific performance results for the binary classification classification case in Table~\ref{tab:binary-perf}.
\subsubsection*{Prediction performance in binary classification}
\begin{figure*}
\scriptsize
\centering
\caption{Average predictive performance (AUROC) across binary classification datasets. Our proposed methods is shown under the name ``Bellatrex" in its two approaches. The highest achieved
performances except for the ``black box" RF are shown in bold.}
\label{tab:binary-perf}
\begin{tabular}{l|cccccccccc}
\toprule
& RF & \textbf{\makecell{Bella- \\ trex}} & \makecell{OOB \\ Trees} & \makecell{Single \\ DT} & \makecell{Small \\ RF} & LR & SIRUS & C443 & \makecell{Rule \\ COSI+} & HS \\
\midrule
blood & 0.7080 & 0.7041 & 0.6474 & 0.7048 & 0.6413 & \textbf{0.7394} & 0.7327 & 0.6256 & 0.6419 & 0.7209 \\
breast cancer diagn. & 0.9836 & \textbf{0.9867} & 0.9393 & 0.9601 & 0.9526 & 0.9645 & 0.9806 & 0.9748 & 0.9400 & 0.9655 \\
breast cancer & 0.9958 & 0.9954 & 0.9665 & 0.9626 & 0.9696 & 0.9970 & \textbf{0.9974} & 0.9923 & 0.9749 & 0.9625 \\
breast cancer progn. & 0.5015 & 0.5348 & 0.5689 & 0.5893 & 0.5230 & \textbf{0.6370} & 0.5896 & 0.5504 & 0.5374 & 0.6333 \\
breast cancer coimba & 0.7569 & 0.7508 & 0.6846 & 0.7108 & 0.6085 & \textbf{0.8108} & 0.7415 & 0.6762 & 0.5938 & 0.7200 \\
Colon. Green & 0.9333 & \textbf{0.9449} & 0.8128 & 0.6962 & 0.7526 & 0.6718 & 0.7974 & 0.8333 & 0.7154 & 0.7897 \\
Colon. Hinselm. & 0.5917 & 0.6229 & 0.5875 & 0.6146 & 0.4667 & 0.4833 & \textbf{0.6458} & 0.5813 & 0.5812 & 0.5792 \\
Colon. Schiller & 0.6277 & 0.5923 & 0.5369 & 0.5600 & 0.5385 & 0.6615 & 0.6662 & \textbf{0.6969} & 0.6000 & 0.5246 \\
divorce & 0.9941 & 0.9471 & 0.9412 & 0.9349 & 0.9405 & \textbf{1.0000} & 0.9920 & 0.9716 & 0.9325 & 0.9294 \\
Flowmeters & 0.9943 & \textbf{0.9771} & 0.9271 & 0.9086 & 0.7800 & 0.4771 & 0.9286 & 0.9157 & 0.9514 & 0.9314 \\
haberman & 0.6897 & 0.6786 & 0.6400 & 0.6185 & 0.6269 & 0.6856 & \textbf{0.6883} & 0.6763 & 0.5550 & 0.6175 \\
hcc-survival & 0.8331 & \textbf{0.8250} & 0.6688 & 0.7162 & 0.7377 & 0.4192 & 0.7831 & 0.6369 & 0.6008 & 0.7138 \\
ionosphere & 0.9828 & \textbf{0.9812} & 0.9204 & 0.9276 & 0.9067 & 0.9020 & 0.9406 & 0.9420 & 0.8251 & 0.9386 \\
LSVT voice & 0.8824 & \textbf{0.8882} & 0.7404 & 0.7699 & 0.7228 & 0.6191 & 0.7993 & 0.7846 & 0.7022 & 0.7566 \\
mamographic & 0.8523 & 0.8510 & 0.8247 & 0.8355 & 0.8249 & 0.8316 & 0.8439 & 0.8352 & 0.8072 & \textbf{0.8539} \\
musk & 0.9511 & \textbf{0.9475} & 0.8300 & 0.7716 & 0.8088 & 0.9132 & 0.7562 & 0.8633 & 0.7158 & 0.7983 \\
parkinson & 0.9349 & \textbf{0.9128} & 0.7912 & 0.7819 & 0.7766 & 0.3051 & 0.7424 & 0.8099 & 0.7663 & 0.7789 \\
risk factors & 0.9709 & 0.9339 & 0.9050 & 0.9379 & 0.8745 & \textbf{0.9801} & 0.9420 & 0.7176 & 0.8179 & 0.9408 \\
simulation crashes & 0.9284 & 0.9012 & 0.8335 & 0.7594 & 0.8027 & \textbf{0.9654} & 0.8663 & 0.5799 & 0.7939 & 0.7700 \\
sonar & 0.9163 & \textbf{0.9117} & 0.7591 & 0.7498 & 0.7347 & 0.8455 & 0.8045 & 0.7493 & 0.7617 & 0.7622 \\
SPECT & 0.7695 & 0.7489 & 0.7411 & 0.6957 & 0.7037 & \textbf{0.7870} & 0.7305 & 0.7682 & 0.7169 & 0.7502 \\
SPECTF & 0.8203 & \textbf{0.7920} & 0.6193 & 0.6485 & 0.7273 & 0.7442 & 0.7838 & 0.7087 & 0.6656 & 0.6816 \\
vertebral column & 0.9550 & 0.9477 & 0.9002 & 0.8907 & 0.8530 & \textbf{0.9562} & 0.8954 & 0.8423 & 0.8962 & 0.8762 \\
wholesale & 0.9554 & \textbf{0.9525} & 0.9056 & 0.9322 & 0.9141 & 0.9023 & 0.9382 & 0.9364 & 0.9163 & 0.9390 \\
\midrule
Average & 0.8554 & \textbf{0.8470} & 0.7788 & 0.7782 & 0.7578 & 0.7625 & 0.8161 & 0.7779 & 0.7504 & 0.7889 \\
\bottomrule
\end{tabular}
\end{figure*}
We observe that Bellatrex considerably outperforms all competing methods and its performance is often on par, and sometimes better, than the original RF. In most of the cases, Bellatrex performs better than the other competing methods. Some exceptions to this trend are provided by the LR learner which, despite achieving non-remarkable performance on average, appears to be the best model in some datasets (e.g. ``blood" and ``Colon. Schiller"). This phenomenon might be explained by the intrinsically different (linear) nature of LR predictions as opposed to the other tree-based models.
In the middle range of the performance spectrum, we encounter competing methods from literature such as HS, with C443 and SIRUS scoring a couple of ``wins" and performing better than LR on average. On the lower end, we have the remaining methods: RuleCOSI+, Small RF, OOB Trees and DT. The trends from this qualitative analysis are confirmed by the Friedman-Nemenyi test $(\alpha = 0.05)$ and the resulting diagram is shown in Figure~\ref{fig:binary-FN-perform}.
\begin{figure}[ht]
\centering
\includegraphics[width=0.8\columnwidth]{BIN_Performance.pdf}
\caption{Friedman-Nemenyi test, results regarding performance on binary classification data}
\label{fig:binary-FN-perform}
\end{figure}
We can observe that the difference between RF and Bellatrex is not statistically significant, meaning that we manage to provide interpretability without significant loss in predictive performance. It is also remarkable that Bellatrex is ranked on top of all the competitor methods and is also statistically significantly different to RuleCOSI+, Small RF, OOB Trees, as well as the single DT.
This is to be expected as the competing methods offer a global approach for explanations, whereas Bellatrex follows a local approach. Furthermore, the Bellatrex instance-specific procedure is optimised towards increasing the fidelity to the original black-box model, which is a necessary condition for achieving interpretability~\cite{Guidotti2018}.
\subsubsection*{Prediction performance in TTE, regression, MLC, MTR}
Similar trends are highlighted when running Bellatrex on time-to event (TTE), regression, multi-label classification (MLC), and multi-target regression (MTR) data, with the average results being shown in Table~\ref{tab:avg-perf-all}. The competitiveness of Bellatrex against all competing methods is confirmed as Bellatrex outperforms all considered competitors. Furthermore, Bellatrex performance is on par compared to the black-box R(S)F in TTE tasks, furthermore Bellatrex is outperforming the original black-box in regression and MTR tasks; finally, a lower performance is observed for MLC tasks.
\begin{table}[ht]
\centering
\tiny
\begin{tabular}{l|cccc}
\multirow{2}{*}{Method} & \multicolumn{4}{c}{predictive scenario} \\
& survival & multi-label & regression & multi-target \\
\midrule
\makecell{R(S)F} & 0.7274 & 0.8473 & 0.0679 & 0.0531 \\
\midrule
\makecell{Bellatrex \\ weighted} & \textbf{0.7275} & \textbf{0.7894} & 0.0674 & \textbf{0.0511} \\
\midrule
\makecell{Bellatrex \\ simple} & 0.7265 & 0.7888 & \textbf{0.0673} & 0.0516 \\
\midrule
\makecell{OOB (S) \\ Trees} & 0.6719 & 0.7524 &0.0772 & 0.0562 \\
\midrule
\makecell{Small \\ R(S)F} & 0.6724 & 0.7441 & 0.0788 & 0.0591 \\
\midrule
\makecell{Single \\ (S)DT} & 0.6696 & 0.7378 & 0.0832 & 0.0593 \\
\midrule
\makecell{Linear \\ Predictor\tablefootnote{Cox-PH for time-to-event tasks, LR for the other cases}} & 0.7040 & 0.5076 & 0.0942 & 0.0758 \\
\midrule
\makecell{SIRUS} & - & - & 0.1090 & - \\
\midrule
\makecell{HS} & - & 0.7585 & 0.0890 & 0.0715 \\
\bottomrule
\end{tabular}
\footnotetext[1]{regularised Cox PH for survival scenario, regularised LR for the other scenarios}
\caption{Average performance across remaining datasets. In bold, the best achieved performance excluding the black-box R(S)F}
\label{tab:avg-perf-all}
\end{table}
This trend is to be expected, since methods like HS are based on a single DT and are therefore offering an extremely simplified prediction process, whereas methods based on LR fail to capture non-linearity and label correlations. Finally, SIRUS has been implemented for binary classification and regression problems, but has not been tested for the latter.
The results of the Friedman-Nemenyi statistical tests of these four scenarios are shown in Figure~\ref{fig:perf-nemenyi-all}.
Given that in Bellatrex the weighted path-based approach has a slightly better performance (and a more intuitive vector representation) compared to the simple one, we report from now on only the results of the former, unless otherwise specified.
\subsection{Complexity} \label{sec:complexities}
Next, we consider the complexity of explanations and compare Bellatrex against other competing methods. It is worth reminding that our definition of complexity in Eq.~\eqref{eq:avg-complexity} counts the number of split-rules performed across (possibly multiple) extracted rules. This allows to compare Bellatrex not only against tree-based methods such as DTs, Small RF and OOB Trees, but also against methods from literature that output rule-based explanation in a different format. More specifically, we can compare Bellatrex against SIRUS
, HS
, RuleCOSI+
, and C443
. We do not report the complexity $\mathcal{C}$ from RF given its black-box nature and given that its complexity is much higher than the other reported methods.
\subsubsection*{Explanation complexity in binary classification}
Specifically for binary classification tasks, we compare Bellatrex against all aforementioned methods. To determine which rules are considered as part of an explanation, we refer to our guidelines in Section~\ref{sec:complexity}. We report average complexity $\mathcal{C}$ in Table~\ref{tab:binary-complexity}, and we also include the average number of rules extracted by Bellatrex.
\begin{figure*}[ht]
\centering
\scriptsize
\caption{Average complexity of the explanations across binary classification datasets.}\label{tab:binary-complexity}
\begin{tabular}{l|cccccccccc}
\toprule
data & \makecell{Bellatrex \\ \tiny (rules)} & \makecell{OOB \\ Trees} & \makecell{Small \\ RF} & DT & {\tiny SIRUS} & \makecell{\tiny Rule \\ \tiny COSI+} & C443 & HS \\
\midrule
blood & 15.13 (1.9) & 14.94 & 14.40 & 6.39 & 12.00 & 4.09 & 22.59 & \textbf{3.39} \\
breast cancer diagn. & 5.49 (1.3) & 5.79 & 5.93 & 4.13 & 13.40 & \textbf{3.48} & 13.10 & 4.05 \\
breast cancer & 5.53 (1.2) & 6.13 & 5.00 & 4.01 & 11.60 & \textbf{3.45} & 13.48 & 4.85 \\
breast cancer progn. & 9.79 (2.0) & 10.56 & 11.19 & \textbf{4.13} & 10.00 & 9.13 & 15.61 & 4.33 \\
breast cancer coimba & 9.37 (2.2) & 9.57 & 9.36 & \textbf{3.39} & 11.20 & 8.17 & 13.89 & 4.32 \\
colonoscopy Green & 7.03 (1.9) & 8.44 & 8.23 & \textbf{3.76} & 10.20 & 5.98 & 13.07 & 4.82 \\
colonoscopy Hinselm. & 6.28 (1.7) & 6.94 & 6.31 & \textbf{2.71} & 10.20 & 4.23 & 10.92 & 4.28 \\
colonoscopy Schiller & 6.70 (1.9) & 7.97 & 7.08 & \textbf{3.03} & 10.20 & 4.83 & 11.08 & 3.41 \\
divorce & 1.47 (1.0) & 1.45 & 1.73 & \textbf{1.29} & 10.40 & 1.53 & 4.64 & 1.39 \\
Flowmeters & 4.89 (1.7) & 5.44 & 4.76 & \textbf{2.61} & 11.60 & 2.76 & 8.27 & 2.78 \\
haberman & 13.48 (1.9) & 12.88 & 13.12 & 5.73 & 13.20 & 7.25 & 19.71 & \textbf{5.22} \\
hcc-survival & 9.56 (2.2) & 10.87 & 11.00 & 4.56 & 10.00 & 7.32 & 15.64 & \textbf{4.32} \\
ionosphere & 8.01 (1.5) & 10.37 & 9.27 & \textbf{5.08} & 14.60 & 7.40 & 17.54 & 5.27 \\
LSVT voice & 6.60 (1.9) & 7.20 & 7.06 & \textbf{3.22} & 10.20 & 5.51 & 10.48 & 3.72 \\
mamographic & 16.21 (1.7) & 16.34 & 14.89 & 7.82 & 12.00 & 8.36 & 21.33 & \textbf{4.08} \\
musk & 12.48 (1.9) & 13.72 & 13.79 & 6.09 & 12.80 & 11.59 & 21.32 & \textbf{5.76} \\
parkinson & 13.39 (1.7) & 14.14 & 13.59 & 9.42 & 10.80 & 8.58 & 23.54 & \textbf{4.10} \\
risk factors & 7.27 (1.2) & 8.73 & 9.25 & 5.49 & 15.60 & \textbf{5.22} & 23.54 & 6.57 \\
simulation crashes & 6.48 (1.3) & 6.71 & 6.58 & \textbf{3.61} & 13.00 & 3.78 & 15.86 & 4.46 \\
sonar & 8.29 (2.0) & 9.33 & 9.62 & \textbf{3.74} & 10.40 & 9.42 & 14.04 & 4.02 \\
SPECT & 11.55 (1.8) & 12.04 & 12.04 & \textbf{4.17} & 15.00 & 5.40 & 11.87 & 4.77 \\
SPECTF & 7.85 (1.8) & 8.62 & 8.78 & \textbf{4.17} & 10.80 & 7.27 & 13.48 & 5.32 \\
vertebral & 7.25 (1.6) & 7.42 & 7.46 & \textbf{3.70} & 11.80 & 6.17 & 14.20 & 4.37 \\
wholesale & 6.74 (1.4) & 6.65 & 6.31 & 4.35 & 13.00 & \textbf{2.96} & 14.87 & 4.52 \\
\midrule
average & 8.62 (1.7) & 9.26 & 9.03 & 4.44 & 11.83 & 6.00 & 15.17 & \textbf{4.34} \\
\bottomrule
\end{tabular}
\end{figure*}
The results show that Bellatrex needs $8.62$ splits on average to generate an explanation.
This finding, combined with the fact that $1.7$ rules are extracted on average suggests that the final rules are usually fairly short and can be considered more interpretable than a single rule of similar total complexity.
Furthermore, we also notice that the datasets for which Bellatrex extracts the least amount of rules (such as ``divorce", ``breast cancer original" and ``risk factors") are also the ones whose binary label is easy to predict (AUROC above $0.90$) for Bellatrex (cfr. Table~\ref{tab:binary-perf}). This is coherent with the principle of non-redundancy of extracted rules that Bellatrex seems to achieve: if a single rule is enough to make accurate predictions, there should be no advantage into extracting more rules.
When comparing Bellatrex with RuleCOSI+, C443, DT, and HS, we observe that the latter two generate shorter explanations. This is to be expected since these methods use a single rule to perform predictions for a given instance. It is worth noting however, that shorter explanations come at the expense of losing performance: we are therefore witnessing another instance of interpretability-performance trade-off (see Figure~\ref{fig:trade-off-binary}).
The aforementioned trade-off is also present when comparing the results of SIRUS against HS and RuleCOSI+: SIRUS outputs rules with higher total complexity, and at the same time shows a slightly higher performance. It is worth noting that SIRUS extracts 10 rules by default, and since its average number of rulesplits (complexity) is $11.83$, it means that the vast majority of the extracted rules has depth 1, consistent with what is reported in the original paper~\cite{Benard2021}. As for C443, the achieved performance is similar to HS, whereas its total complexity is comparable to SIRUS and higher than Bellatrex. The latter results is to be expected given that C443 always extracts 3 trees and therefore 3 rules are contributing to the computation of $\mathcal{C}$, as opposed to the average 1.69 rules in Bellatrex.
Finally, OOB Trees and Small RF achieve similar complexity compared to Bellatrex, which is to be expected given that the same number of rules is extracted from a similarly constructed underlying RF.
Such differences are not significant according toto the Friedman-Nemenyi statistical test,
whereas SIRUS generates statistically significantly more rule-splits compared to Bellatrex,
RuleCOSI+ and HS. The full results can be visualised in Figure~\ref{fig:complex-nemenyi-all}.
\begin{figure}[ht]
\centering
\includegraphics[width=0.9\columnwidth]{Trade-off_BIN.pdf}
\caption{Visualisation of the performance vs. interpretability trade-off, where interpretability is approximated as $1/\mathcal{C}$. The performance-interpretability Pareto optimal frontier is shown in red.}
\label{fig:trade-off-binary}
\end{figure}
\subsubsection*{Explanation complexity in TTE, regression, MLC, MTR}
Continuing on the comparison of the (proxy for) interpretability, we compare the complexity of explanations $\mathcal{C}$ on the remaining four scenarios. We compare Bellatrex against HS for regression, multi-label, and multi-target regression scenarios,
whereas SIRUS is, for the moment being, only suitable for use in (single target) regression tasks.
An overview of the comparison is given in Table~\ref{tab:avg-complexity-all}, whereas the full results can be found in Tables~\ref{tab:survival-complexity}-\ref{tab:mtr-complexity}.
\begin{table}[ht]
\centering
\tiny
\begin{tabular}{l|cccc}
\multirow{2}{*}{Method} & \multicolumn{4}{c}{predictive scenario} \\
& survival & multi-label & regression & multi-target \\
\midrule
\makecell{Bellatrex \\ weighted} & 19.23 & 63.00 & 22.53 & 23.10 \\
\midrule
\makecell{OOB (S) \\ Trees} & 18.73 & 61.77 & 22.32 & 23.48 \\
\midrule
\makecell{Small \\ R(S)F} & 18.80 & 60.82 & 22.30 & 23.54 \\
\midrule
\makecell{Single \\ (S)DT} & 10.69 & 15.56 & 8.61 & 8.00 \\
\midrule
\makecell{SIRUS} & - & - & 13.53 & - \\
\midrule
\makecell{HS} & - & \textbf{5.14} & \textbf{4.27} & \textbf{4.15} \\
\bottomrule
\end{tabular}
\caption{Average number of rule-splits used as explanation, comparison across datasets. In bold, the shortest average explanation per scenario.}
\label{tab:avg-complexity-all}
\end{table}
The complexity of the rules extracted by Bellatrex and OOB (Survival) Trees and Small R(S)F is similar across all scenarios, in line with what is observed with the binary classification datasets. We also observe that Bellatrex generates on average longer explanations when run on multi-label datasets, and this can be due to the fact that multi-label datasets are more difficult to learn and need larger trees to fit. A confirmation of this can be found by inspecting the data: longest explanations are associated to larger datasets, with either a high number of instances or a high number of targets to predict (see Table~\ref{tab:multi-label-info}). For this case, we suggest the end user to select one (or a few) label of interest in the training phase, and the Bellatrex explanations on the reduced label set will be shorter.
Finally, it is worth mentioning that the increase in average rule length observed in multi-label datasets is common to Bellatrex, DT, OOB Trees and Small RF, whereas it does not affect HS, whose rules are significantly shorter. Detailed results of the Friedman-Nemenyi test are shared in Figure~\ref{fig:complex-nemenyi-all}.
\subsection{Dissimilarity} \label{sec:dissimilarities}
Finally, we compare the average dissimilarity $\mathcal{D}$ of the final rules extracted by Bellatrex against the ones generated by Small RF, the ones picked according to the OOB Trees method, and the ones extracted by the C443 method.
These methods are indeed the only ones that extract a comparable number of independent learners; HS on the other hand builds a single decision tree whereas SIRUS extracts at least 10 rules. Finally, RULECOSI+ does not offer a meaningful comparison since the rules that it generates are not independent: exactly one of them can be activated, under the condition that the previous ones have not been used.
\subsubsection*{Rule dissimilarity in binary classification}
The detailed results for the binary classification scenario are shown in Table~\ref{tab:binary-dissim}.
\begin{table}[ht]
\centering
\tiny
\begin{tabular}{l|cccc}
\toprule
& \makecell{OOB \\ Trees} & \makecell{Small \\ RF} & Bellatrex & C443 \\
\midrule
blood & 0.5398 & 0.5743 & \textbf{0.6366} & 0.6080 \\
B.C. diagnostic & 0.8799 & 0.8966 & 0.9569 & \textbf{0.9797} \\
B.C. original & 0.7563 & 0.7349 & 0.8534 & \textbf{0.9027} \\
B.C. prognostic & 0.9266 & 0.9251 & 0.9635 & \textbf{0.9696} \\
B.C. coimba & 0.7862 & 0.7894 & 0.8769 & \textbf{0.8923} \\
Col. Green & 0.9241 & 0.9561 & 0.9882 & \textbf{0.9955} \\
Col. Hinselm. & 0.8747 & 0.9636 & 0.9739 & \textbf{0.9866} \\
Col. Schiller & 0.9462 & 0.9659 & \textbf{0.9933} & 0.9892 \\
divorce & 0.8936 & 0.9349 & \textbf{1.0000} & 0.9959 \\
Flowmeters & 0.8513 & 0.9477 & 0.9901 & \textbf{1.0000} \\
haberman & 0.5380 & 0.5686 & 0.6589 & \textbf{0.7616} \\
hcc-survival & 0.9439 & 0.9381 & 0.9683 & \textbf{0.9998} \\
ionosphere & 0.8948 & 0.9068 & 0.9450 & \textbf{0.9741} \\
LSVT voice & 0.9826 & 0.9901 & \textbf{0.9971} & 0.9811 \\
mamographic & 0.5175 & 0.5605 & 0.6185 & \textbf{0.6367} \\
musk & 0.9773 & 0.9679 & 0.9894 & \textbf{0.9979} \\
parkinson & 0.9867 & 0.9922 & 0.9963 & \textbf{0.9996} \\
risk factors & 0.8167 & 0.8778 & 0.9414 & \textbf{0.9832} \\
simul. crashes & 0.7532 & 0.8415 & 0.9400 & \textbf{0.9896} \\
sonar & 0.9281 & 0.9555 & 0.9848 & \textbf{0.9983} \\
SPECT & 0.8617 & 0.8656 & 0.8979 & \textbf{0.9389} \\
SPECTF & 0.9231 & 0.9424 & 0.9608 & \textbf{0.9823} \\
vertebral & 0.6531 & 0.6970 & 0.7868 & \textbf{0.8439} \\
wholesale & 0.6871 & 0.7425 & 0.8277 & \textbf{0.8813} \\
\midrule
average & 0.8268 & 0.8556 & 0.9044 & \textbf{0.9286} \\
\bottomrule
\end{tabular}
\caption{Average dissimilarity index across binary classification datasets. The dissimilarities achieved by our proposed methods are shown under the name ``Bellatrex".}
\label{tab:binary-dissim}
\end{table}
When analysing average dissimilarity, we observe that C443 and Bellatrex achieve the highest dissimilarity, with C443 scoring most of the wins. These two methods consistently achieve higher dissimilarity compared to Small RF and OOB Trees. This means that
the Bellatrex algorithm is successful at picking dissimilar enough rulesets, and that these are not redundant.
We can verify how this dissimilarity in rules translates in practice in Section~\ref{sec:Examples}.
The Friedman-Nemenyi tests show that C443 and Bellatrex show a statistically significantly higher dissimilarity compared to OOB Trees and to Small RF, whose dissimilarities are driven by the intrinsic randomness of the RF algorithm. Detailed results are shared in Figure~\ref{fig:dissim-nemenyi-all}. Finally, the difference in dissimilarity between rulesets in C443 and rulesets in Bellatrex is not statistically significant.
\subsubsection*{Rule dissimilarity in TTE, regression, MLC, MTR}
The dissimilarity enforced on the final rules can be again compared against Small R(S)F and OOB (Survival) Trees in the other four types of prediction tasks, with the full results being available in the Appendix in Tables~\ref{tab:survival-dissimil}-\ref{tab:mtr-dissim}, and the respective post-hoc statistical tests in Figure~\ref{fig:dissim-nemenyi-all}.
\begin{table}[ht]
\tiny
\centering
\caption{Average dissimilarities comparison across datasets. In bold, the highest average dissimilarity per scenario}
\label{tab:avg-dissimil-all}
\begin{tabular}{l|cccc}
\multirow{2}{*}{\makecell{ \\ Method}} & \multicolumn{4}{c}{predictive scenario} \\
\cmidrule{2-5}
& survival & multi-label & regression & multi-target \\
\midrule
\makecell{Bellatrex \\ weighted} & \textbf{0.8420} & \textbf{0.9569} & \textbf{0.5459} & \textbf{0.7145} \\
\midrule
\makecell{OOB (S) \\ Trees} & 0.8219 & 0.9240 & 0.4171 & 0.5977 \\
\midrule
\makecell{Small \\ R(S)F} & 0.7945 & 0.9380 & 0.4483 & 0.6326 \\
\bottomrule
\end{tabular}
\end{table}
Bellatrex again outperforms Small R(S)F and OOB (Survival) Trees for every considered scenario. Running the Friedman-Nemenyi statistical tests shows that such differences are always significant except when considering the time-to-event datasets.
It is also worth noticing that high dimensional datasets generate the most dissimilar trees on average, and all datasets with $p > 100$ covariates are associated to average dissimilarity close to $1$, indicating almost no overlap in the splitting covariates across candidates. This trend is visible in all five considered scenarios, and is well illustrated in datasets like \textsf{parkison} ($\mathcal{D} = 0.9963$) for binary classification tasks, or \textsf{DLBCL} ($\mathcal{D} = 0.9994$) for time-to-event data.
\subsection{Ablation study} \label{sec:ablations}
As thoroughly described above, the Bellatrex method consists of four main steps: 1) pre-selection of the most relevant decision rules within the random forest, 2) mapping of the selected rules to a vector representation, 3) projection of the vector representations to a low-dimensional space and 3) the clustering step followed by the final rule extraction. The vector representation and the clustering steps are fundamental for our approach and cannot possibly be removed. To this end, in this ablation study we evaluate the added value of the rule pre-selection mechanism and of the dimensionality reduction step.
Hence, we have performed an ablation study where each step is separately employed measuring each time the end performance of our method. More specifically, we have compared four scenarios:
\begin{itemize}
\item We apply our proposed method in full, including all steps described above;
\item We apply dimensionality reduction but no pre-selection (i.e., no step~1);
\item We apply the rule pre-selection step but no dimensionality reduction (i.e. no step~3);
\item We apply neither dimensionality reduction (PCA) nor rule pre-selection (i.e., a baseline version of our method where both steps 1 and 3 are removed);
\end{itemize}
Here, we present the results related to binary classification datasets (Table \ref{tab:ablation-binary}) while the results related to the other tasks are provided in the Appendix (Tables~\ref{tab:ablation-survival}\,-\ref{tab:ablation-multitarget}). As shown, the best average performance is achieved when all steps of the proposed approach are included, affirming the added value of each of them. Furthermore, we observe the most substantial decrease in average performance when we remove both steps 1 and 3, whereas the intermediate scenarios (one step removed) fall somewhere in between.
\begin{table}[ht]
\centering
\tiny
\begin{tabular}{lrrrr}
\toprule
& \makecell{\textbf{Bellatrex} \\ (original)} & \makecell{no pre\\ selection} & \makecell{no dim. \\ reduction} & \makecell{none of \\the two} \\
\midrule
blood & 0.7041 & \textbf{0.7050} & 0.7005 & 0.6975 \\
B.C. diagn. & 0.9867 & \textbf{0.9872} & 0.9865 & 0.9823 \\
B.C. original & \textbf{0.9954} & 0.9934 & 0.9953 & 0.9922 \\
B.C. progn. & 0.5348 & 0.5226 & \textbf{0.5441} & 0.4822 \\
B.C. coimba & 0.7508 & 0.7677 & \textbf{0.7723} & 0.7600 \\
Col. Green & \textbf{0.9449} & 0.8987 & 0.8385 & 0.9205 \\
Col. Hinselm. & 0.6229 & 0.4708 & 0.6042 & \textbf{0.6396} \\
Col. Schiller & 0.5923 & \textbf{0.6754} & 0.6077 & 0.6569 \\
divorce & \textbf{0.9471} & 0.9457 & 0.9412 & 0.9401 \\
Flowmeters & \textbf{0.9771} & 0.9514 & 0.9500 & 0.9286 \\
haberman & 0.6786 & 0.6726 & 0.6769 & \textbf{0.6832} \\
hcc-survival & \textbf{0.8250} & 0.7638 & 0.8058 & 0.7412 \\
ionosphere & \textbf{0.9812} & 0.9768 & 0.9737 & 0.9444 \\
LSVT voice & \textbf{0.8882} & 0.8654 & 0.8243 & 0.8618 \\
mamographic & \textbf{0.8510} & 0.8467 & 0.8494 & 0.8396 \\
musk & \textbf{0.9475} & 0.9298 & 0.9230 & 0.8757 \\
parkinson & \textbf{0.9128} & 0.8824 & 0.9005 & 0.8340 \\
risk factors & 0.9339 & 0.9309 & \textbf{0.9351} & 0.9339 \\
simul. crashes & \textbf{0.9012} & 0.8875 & 0.8629 & 0.7775 \\
sonar & \textbf{0.9117} & 0.8928 & 0.8864 & 0.8141 \\
SPECT & 0.7489 & 0.7524 & 0.7500 & \textbf{0.7680} \\
SPECTF & 0.7920 & \textbf{0.8177} & 0.7918 & 0.7478 \\
vertebral & 0.9477 & \textbf{0.9501} & 0.9499 & 0.9414 \\
wholesale & 0.9525 & \textbf{0.9549} & 0.9529 & 0.9455 \\
\midrule
average & \textbf{0.8470} & 0.8351 & 0.8343 & 0.8212 \\
\bottomrule
\end{tabular}
\caption{Ablation study results on the binary datasets. In bold, the best achieved performance.}
\label{tab:ablation-binary}
\end{table}
\section{Illustration of Bellatrex} \label{sec:Examples}
In this Section, we show how Bellatrex works in practice, and to do so we pick two examples from the ``boston housing" regression dataset~\cite{BostonDataset}. This dataset contains $506$ neighbourhoods (``towns"), each described by 14 covariates. The target variable is the median house value, normalised to the $[0,1]$ interval.
Our first example consists of a test instance with a relatively low house value of $0.206$, for which Bellatrex predicts a value of $0.244$.
More specifically, Bellatrex reaches the prediction by discarding 20 rules in the pre-selection step and projecting the vector representation of the remaining 80 rules in 2 dimensions; such representations are grouped in a single cluster and the rule closest to the centre is selected as the final representative.
Further insights are shown in Figure~\ref{fig:boston-example41}, where the rule representations are shown.
\begin{figure}[ht]
\centering
\includegraphics[width=0.95\columnwidth]{plot_boston_i41_v2.png}
\caption{Bellatrex performed on a test instance of the \textsf{boston housing} dataset. On the left, the grey circle corresponds to the centre of the cluster; on the right, rules are coloured according to their predicted value. On both sides, the final extracted rule, closest to the centre of the cluster, is shown in a star shape.}
\label{fig:boston-example41}
\end{figure}
The left plot of the Figure shows that a single cluster is selected, and that the four rules on the right side of the plot are being treated as outliers.
On the right-side plot, the same rules are coloured according to their prediction, and these are shown to vary between $0.20$ and $0.29$.
The final representative rule is situated in the central position and is associated to a prediction close to the average value of $0.24$. Inspection of such rule is shown in Example~\ref{tab:boston-example-path}, where we show how, starting from an initial estimated equal to the average (bootstrapped) value of the root node, moves until a final value indicated by the corresponding leaf.
\begin{example}[ht]
\centering
\tiny
\begin{tabular}{lcl}
rule & (weight=1) & \makecell[l]{initial \\ estimate $=0.390$} \\
\midrule
Instance & split test & prediction\\
\midrule
(n. rooms = 5.64) & n. rooms $\leq 6.80$ & $\rightarrow 0.317$ \\
(low status = 18.34) & low status $> 14.30$ & $\rightarrow 0.209$ \\
(low status = 18.34) & low status $\leq 19.08$ & $\rightarrow 0.271$ \\
(age = 94.70) & age $> 93.90$ & $\rightarrow 0.238$ \\
(crime rate = 0.88) & crime rate $\leq 2.15$ & $\rightarrow 0.275$ \\
(low status = 18.34) & low status $> 17.07$ & $\rightarrow$ \textbf{0.244} (leaf) \\
\bottomrule
\end{tabular}
\caption{Extracted rule.}
\label{tab:boston-example-path}
\end{example}
The extracted rule is aligned with human intuition: the root node-split shows that a smaller average number of rooms (\textsf{n. rooms}) per dwelling is associated to a lower house value, with the prediction dropping from an initial estimate of $0.390$ to $0.317$. Similarly, the splits involving \textsf{low status} show that houses situated in a poorer neighbourhood (that is, with high values of \textsf{low status}), are associated to lower prices. According to this rule, the median house price of the town increases with a low \textsf{crime rate}, and decreases with high proportion of houses being built before 1940 (high value for the \textsf{age} variable).
Our second example involves a test instance of high value $y=0.660$, whose Bellatrex prediction is $0.625$ (and underlying RF prediction is $0.633$), and two rules are selected as the final prediction, as shown in Figure~\ref{fig:boston-example45} below.
\begin{figure}[ht]
\centering
\includegraphics[width=0.95\columnwidth]{plot_boston_i45_v2.png}
\caption{Bellatrex performed on a test instance of the \textsf{boston housing} dataset. The final extracted rules are shown with a star shape.}
\label{fig:boston-example45}
\end{figure}
The plot shows that two final rules are extracted, one from the large cluster on the left side, and one for the small cluster on the right side. In both cases, the predictions are close to the average, and in general,
we obtain similar predictions from rules following different splits and structures.
The extracted rules are shown in Example~\ref{tab:boston-example-path2}.
The first rule follows human intuition when assigning higher house value for higher \textsf{n. rooms} and for lower \textsf{crim. rate} rates. Furthermore, it also reflects the racial bias of the 1970 US Census~\cite{BostonDataControversy} when assigning higher value to ethnically homogeneous neighbourhoods (high values of \textsf{black} covariate).
\begin{example}
\begin{center}
\tiny
\begin{tabular}{lcl}
rule 1 & ($w_1=0.90$) & \makecell[l]{initial \\ estimate $=0.399$} \\
\midrule
Instance & split test & prediction\\
\midrule
(n. rooms = 7.18) & n. rooms $> 6.98$ & $\rightarrow 0.774$ \\
(n. rooms = 7.18) & n. rooms $\leq 7.44$ & $\rightarrow 0.647$ \\
(black = 393) & black $> 386$ & $\rightarrow 0.6642$ \\
(n. rooms = 7.18) & n. rooms $\leq 7.26$ & $\rightarrow 0.679$ \\
(crime rate = 0.03) & crime rate $\leq 0.03$ & $\rightarrow \textbf{0.625}$ (leaf)\\
\end{tabular}
\begin{tabular}{lcl}
\toprule
rule 2& ($w_2=0.10$) & \makecell[l]{initial \\ estimate $=0.379$} \\
\midrule
Instance & split test & prediction\\
\midrule
(low status = 4.03) & low status $\leq 9.71$ & $\rightarrow 0.549$ \\
(n. rooms = 7.18) & n. rooms $\leq 7.44$ & $\rightarrow 0.500$ \\
(n. rooms = 7.18) & n. rooms $> 6.73$ & $\rightarrow 0.603$ \\
(pupils ratio = 17.8) & pupils ratio $< 18.9$ & $\rightarrow 0.624$ \\
(age = 61.10) & age $\leq 87.00$ & $\rightarrow 0.612$ \\
(black = 393) & black $> 392$ & $\rightarrow 0.641$ \\
(age = 61.10) & age $> 41.95$ & $\rightarrow 0.608$ \\
(n. rooms = 7.18) & n. rooms $> 6.93$ & $\rightarrow 0.630$ \\
(pupils ratio = 17.8) & pupils ratio $> 15.50$ & $\rightarrow \textbf{0.628}$ (leaf) \\
\bottomrule
\end{tabular}
\end{center}
\caption{Extracted rules.}
\label{tab:boston-example-path2}
\end{example}
The second rule shows a similar perspective by using a different set of tests: the trend highlighted by \textsf{n. rooms} is consistent with previous findings, whereas conditions including \textsf{low status}, \textsf{pupils ratio}, and \textsf{age} appear for the first time in this example. Consistently with human intuition lower values of pupils-to-teacher ratio (\textsf{pupils ratio}) are associated with higher house value, whereas the \textsf{age} value for this instance has a small negative effect on house pricing. Finally, consistently with the previous example, a lower value for \textsf{low status} is associated to higher median house value.
\section{Conclusions and future work} \label{sec:Conclusion}
In this article, we proposed a novel method (Bellatrex) that interprets random forest predictions by extracting, for a given instance, a surrogate model consisting of the most representative decision trees in the forest.
Although we have focused on the random forest ensemble model, our proposed approach is able to accommodate other tree-ensemble models such as Extremely Randomized Trees~\cite{ExtraTrees}. Furthermore, Bellatrex is compatible with other variations of random forests such as Random Survival Forest and Random Forest Regression and has been evaluated across 89 datasets belonging to five different predictive tasks: binary classification, time-to-event prediction, multi-label classification, regression, and multi-target regression. To our knowledge, no other related work is as versatile as Bellatrex in providing explanations in so many different scenarios, or at least, no such experimental results have been reported.
Bellatrex achieves high levels of predictive performance by extracting a small number of rules, which we limited to three in our experiments.
Its performance is often on par with that of random forests, and even outperforms this benchmark in two out of five scenarios.
We can therefore conclude that our method achieves its intended goal of explaining the prediction of a random forest with a few rules, without giving up on predictive performance.
Furthermore, when compared against ante-hoc explainable methods that do not rely on a tree structure, such as LR and Cox-PH, Bellatrex comes on top.
Finally, the comparisons with state-of-the-art methods outline that Bellatrex outperforms, and often significantly, all considered methods from literature that aim at extracting explanations from a trained RF, namely C443~\cite{Sies2020}, HS~\cite{HS2022} and SIRUS~\cite{Benard2021}.
The analysis of the explanation complexity shows that Bellatrex extracts on average 2 rules with a total combined complexity (i.e. test-splits used) that is normally below 25.
Such numbers suggest that our extracted rules are fairly short on average,
even more so since two rules of length $\ell$ are more interpretable than a single rule of length $2\ell$. Rule post-pruning can further reduce total complexity and increase interpretability.
The comparison against other methods such as HS and RuleCOSI+ shows that the latter two generate shorter rules as explanations
while performing significantly worse (performance-interpretability trade-off). Finally, the SIRUS method generates explanations of comparable complexity to Bellatrex, but consists in many extremely short rules that are not as convenient to inspect.
We also studied the dissimilarity of the trees (or paths) extracted by Bellatrex.
We showed that Bellatrex has (often significantly) greater dissimilarity compared to picking the same number of random trees from the ensemble, or picking the same number of best performing trees.
This dissimilarity in Bellatrex is remarkable, as it proves to be successful despite the fact that the optimal number of clusters $K$ is not optimised for increasing dissimilarity, but rather for increasing fidelity to the original random forest. Furthermore, the high average dissimilarity suggests that the final extracted rules are not redundant, and that they give diverse possible explanations to the end user.
Our method also has some limitations, which are similar to other methods that extract learners from a tree ensemble. Firstly, the interpretability of the rules extracted by Bellatrex is challenged when such rules are too long, and to tackle this limitation, the end-user can set more stringent stopping criteria to the RF. Alternatively, in case of multi-label tasks, the end user can select a subset of labels of interest in the training phase and the resulting RF will lead to shorter rules.
Another possible limitation lies in the computational complexity of the method: although a single prediction can be explained in a short time, running the procedure on a full dataset can become computationally expensive.
Directions for future work include exploring new vector representations,
as well as evaluating Bellatrex on an even broader set of tasks,
such as multi-event survival analysis~\cite{Multi-event-SA}, online learning~\cite{river}, or network inference \cite{Biclustering}.
Post-pruning techniques can be applied on top of the extracted rules
of Bellatrex as a further improvement step, thanks to which we expect an
increase of interpretability with shorter rules, and little to no price
paid for predictive performance.
| {'timestamp': '2023-01-09T02:08:44', 'yymm': '2203', 'arxiv_id': '2203.15511', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15511'} | arxiv |
\section{Introduction} \label{sec:intro}
Sign languages are rich visual languages with large lexical vocabularies \cite{stokoe1980sign} and intricate co-articulated movements of both manual (hands and body) and non-manual (facial) features. \acf{slp}, the automatic translation from spoken language sentences to sign language sequences, must be able to produce photo-realistic continuous signing for large domains of discourse to be useful to the deaf communities.
Prior deep-learning approaches to \ac{slp} have either produced concatenated isolated sequences that disregard the natural co-articulation between signs \cite{stoll2018sign,zelinka2020neural} or continuous sequences end-to-end \cite{saunders2021continuous,saunders2020progressive,zelinka2020neural,huang2021towards} which suffer from under-articulation \cite{saunders2020adversarial}. Furthermore, these methods have struggled to generalise beyond the limited domain of weather \cite{forster2012rwth}.
In this paper, we propose an \ac{slp} method to produce photo-realistic continuous sign language videos direct from unconstrained spoken language sequences. Firstly, we translate from spoken language to gloss\footnote{Glosses are a written representation of sign that follow sign language ordering and grammar, defined as minimal lexical items \cite{stokoe1980sign}.} sequences. We next learn the temporal co-articulation between gloss-based dictionary signs, modelling the temporal prosody of sign language \cite{brentari2018production}.
To model sign co-articulation, we propose a novel Frame Selection Network{} (\textsc{FS-Net}{}) that learns the optimal subset of frames that best represents a continuous signing sequence (Fig. \ref{fig:Model_Overview} middle). We build a transformer encoder with cross-attention \cite{vaswani2017attention} to predict a temporal alignment path supervised by \ac{dtw}.
The resulting skeleton pose sequences are subsequently used to condition a video-to-video synthesis model capable of generating photo-realistic sign language videos, named \textsc{SignGAN}{} (Fig. \ref{fig:Model_Overview} right). Due to the natural presence of motion blur in sign language datasets from fast moving hands \cite{forster2014extensions}, a classical application of a hand discriminator leads to an increase in blurred hand generation. To avoid this, we propose a novel keypoint-based loss that significantly improves the quality of hand image synthesis in our photo-realistic signer generation module. To enable training on diverse sign language datasets, we propose a method for controllable video generation that models a multi-modal distribution of sign language videos in different styles.
Our deep-learning based \ac{slp} model is able to generalise to large domains of discourse, as it is trivial to increase vocabulary with a few examples of this new sign in a continuous signing context. We conduct extensive deaf user evaluation on a translation protocol of \ac{mdgs} \cite{hanke2010dgs}, showing that \textsc{FS-Net}{} improves the natural signing motion of interpolated dictionary sequences and is overwhelmingly preferred to baseline \ac{slp} methods \cite{saunders2021mixed}. Additionally, we achieve state-of-the-art back translation performance on \ac{ph14t} with a 43\% improvement over baselines, highlighting the understandable nature of our approach.
Furthermore, we evaluate \textsc{SignGAN}{} using the high quality \ac{c4a} dataset \cite{camgoz2021content4all}, outperforming state-of-the-art synthesis methods \cite{chan2019everybody,stoll2020text2sign,wang2018video,wang2018high} for quantitative evaluation and human perception studies. Finally, we conduct a further deaf user evaluation to show that \textsc{SignGAN}{} is more understandable than the skeletal sequences previously used to represent sign \cite{saunders2020progressive}.
\noindent The contributions of this paper can be summarised as:
\begin{itemize}
\item The first SLP model to produce large-scale sign language sequences from an unconstrained domain of discourse to a level understandable by a native deaf signer
\item A novel Frame Selection Network, \textsc{FS-Net}, that learns to co-articulate between dictionary signs via a monotonic alignment to continuous sequences
\item A method to generate photo-realistic continuous sign language videos, \textsc{SignGAN}{}, with a novel hand keypoint loss that improves the hand synthesis quality
\item Extensive user evaluation of our proposed approach, showing preference of our proposed method, alongside state-of-the-art back translation results
\end{itemize}
\begin{figure*}[t!]
\centering
\includegraphics[width=0.9\linewidth]{new_figures/CVPR22-Overview_GAN.pdf}
\caption{Overview of our proposed large-scale \ac{slp} method. An initial Text to Gloss (left) animates an interpolated dictionary sequence, $\mathcal{I}$, with a Frame Selection Network (\textsc{FS-Net}{}), learning the temporal alignment (middle) to a continuous signing sequence, $\mathcal{Y}$. Finally, \textsc{SignGAN}{} generates a photo-realistic sign language video, $\mathcal{V}$, (right) from the continuous skeleton pose and a given style image, $\mathcal{S}^{\mathcal{I}}$.}
\label{fig:Model_Overview}
\end{figure*}%
\section{Related Work} \label{sec:related_work}
\paragraph{Sign Language Production}
The initial focus of computational sign language technology was \ac{slr} \cite{cui2017recurrent,grobel1997isolated,koller2020quantitative} with few works tackling unconstrained \ac{slr} \cite{kadir2004minimal,cooper2007large,koller2015continuous}. More recently, focus has shifted to \ac{slt} \cite{camgoz2018neural,camgoz2020sign,ko2019neural}.
\acf{slp}, the translation from spoken to sign language, has been historically tackled using animated avatars \cite{cox2002tessa,karpouzis2007educational,mcdonald2016automated} with rules-based co-articulation that does not generalise to unseen sequences \cite{segouat2009study}.
Initial deep learning-based \ac{slp} methods concatenated isolated signs with no regards for natural co-articulation \cite{stoll2018sign,zelinka2020neural}. Recently, continuous \ac{slp} methods have directly regressed sequences of multiple signs \cite{saunders2020progressive,saunders2021continuous,huang2021towards,saunders2021mixed,saunders2021skeletal}, but exhibit under-articulated signing motion due to regression to the mean. To overcome under-articulation, we avoid generating pose directly and learn the optimal temporal alignment between dictionary and continuous sign sequences.
In addition, prior work has represented sign language as skeleton pose sequences, which have been shown to reduce the deaf comprehension compared to a photo-realistic production \cite{ventura2020can}. Previous works have attempted photo-realistic signer generation \cite{stoll2020text2sign,cui2019deep,saunders2021anonysign}, but of low-resolution isolated signs. In this work, we produce high-resolution photo-realistic continuous sign language videos directly from spoken language input, from unrestricted domains of discourse.
\paragraph{Pose-Conditioned Human Synthesis}
\acfp{gan} \cite{goodfellow2014generative} have achieved impressive results in image \cite{isola2017image,radford2015unsupervised,wang2018high,zhu2017unpaired} and, more recently, video generation tasks \cite{mallya2020world,tulyakov2018mocogan,vondrick2016generating,wang2019few,wang2018video}. Specific to pose-conditioned human synthesis, there has been concurrent research focusing on the generation of whole body \cite{balakrishnan2018synthesizing,ma2017pose,men2020controllable,siarohin2018deformable,tang2020xinggan,zhu2019progressive}, face \cite{deng2020disentangled,kowalski2020config,zakharov2019few} and hand \cite{liu2019gesture,tang2018gesturegan,wu2020mm} images.
However, there has been no research into accurate hand generation in the context of full body synthesis, with current methods failing to generate high-quality hand images \cite{ventura2020can}. Due to the hands being high fidelity objects, they are often overlooked in model optimisation. Chan \etal introduced FaceGAN for high resolution face generation \cite{chan2019everybody}, but no similar work has been proposed for the more challenging task of hand synthesis in the context of sign language, where hand to hand interaction is ubiquitous. In this work, we propose a keypoint-based loss to enhance hand synthesis.
The task of human motion transfer, transferring motion from source to target videos via keypoint extraction, is relevant to our task \cite{chan2019everybody,wei2020gac,zhou2019dance}. However, there has been limited research into the generation of novel poses, which we produce from a given spoken language sentence. Additionally, works have attempted to produce unseen appearances in a few-shot manner \cite{wang2019few,zakharov2019few}, but continue to produce only a single style at inference.
\paragraph{Sign Language Co-Articulation}
Sign language co-articulation can be defined as ``the articulatory influence of one phonetic element on another across more than one intervening element" \cite{grosvald2009long} and is an important distinction between isolated and natural continuous signing \cite{naert2017coarticulation}.
Co-articulation involves both the motion and duration of signs, with a particular focus on the transition between signs \cite{naert2017coarticulation}. The boundaries of a sign are also modified depending on the context, with continuous signing typically produced faster than their isolated counterparts \cite{segouat2009study}. In this work, we model temporal co-articulation by learning the optimal alignment between isolated signs and continuous signing sequences, predicting the duration, boundary and transition of each sign in context.
\section{Large-Scale Photo-Realistic \ac{slp}} \label{sec:methodology}
The true aim of a large-scale \ac{slp} model is to translate a spoken language sequence from an unconstrained domain of discourse, \hbox{$\mathcal{X} = (x_{1},...,x_{\mathcal{U}})$} with $\mathcal{U}$ words, to a continuous photo-realistic sign language video, \hbox{$\mathcal{V}^{\mathcal{S}} = (v_{1},...,v_{\mathcal{T}})$} with $\mathcal{T}$ frame. This is a challenging task due to the large vocabulary of unconstrained signing and the intricate spatial nature of sign, with a requirement for temporal co-articulation indicative of natural continuous signing.
We approach this problem as a multi-stage sequence-to-sequence task. Firstly, spoken language is translated to sign gloss, \hbox{$\mathcal{Z} = (z_{1},...,z_{\mathcal{W}})$}, as an intermediate representation (Sec. \ref{sec:text_to_gloss}). Next, our \textsc{FS-Net}{} model co-articulates between gloss-based dictionary signs to produce a full continuous signing sequence, \hbox{$\mathcal{Y} = (y_{1},...,y_{\mathcal{T}})$} (Sec. \ref{sec:gloss_to_sign}). Finally, given $\mathcal{Y}$ and a style image, $\mathcal{S}^{\mathcal{I}}$, our video-to-video signer generation module generates a photo-realistic sign language video, $\mathcal{Z}^{\mathcal{S}}$ (Sec. \ref{sec:sign_to_video}). An overview of our approach can be seen in Fig. \ref{fig:Model_Overview}. In the remainder of this section, we shall describe each component of our approach in detail.
\subsection{Text to Gloss} \label{sec:text_to_gloss}
Given a spoken language sequence, $\mathcal{X}$, we first translate to a sign language grammar and order, represented by a gloss sequence, \hbox{$\mathcal{Z} = (z_{1},...,z_{\mathcal{W}})$} with $\mathcal{W}$ glosses (Fig. \ref{fig:Model_Overview} left). We formulate this as a sequence-to-sequence problem, due to the non-monotonic relationship between the two sequences of different lengths. We use an encoder-decoder transformer \cite{vaswani2017attention} to perform this translation, formalised as:
\begin{equation}
\label{eq:T2G_encoder}
f_{t} = E_{T2G}(x_{t} | x_{1:\mathcal{T}})
\end{equation}
\begin{equation}
\label{eq:T2G_decoder}
g_{w+1} = D_{T2G}(g_{w} | g_{1:w-1} , f_{1:\mathcal{T}})
\end{equation}
where $f_{t}$ and $g_{w}$ are the encoded source and target tokens respectively and $g_{0}$ is the encoding of the special $\mathrm{<bos>}$ token. The output gloss tokens can be computed as $z_{w} = \operatorname*{argmax}_{i} (g_{w})$ until the special $\mathrm{<eos>}$ token is predicted.
\subsection{Gloss to Pose} \label{sec:gloss_to_sign}
Next, motivated by the monotonic relationship between glosses and signs, we produce a continuous signing pose sequence, $\hat{\mathcal{Y}} = (y_{1},...,y_{\mathcal{T}})$ with $\mathcal{T}$ frames, from the translated gloss sequence, $\mathcal{Z}$, using a learnt co-articulation of dictionary signs. We first encode the gloss sequence using a transformer encoder with self-attention, as:
\begin{equation}
h_{w} = E_{G2S}(z_{w} | z_{1:\mathcal{W}})
\end{equation}
where $h_{w}$ is the encoded gloss token for step $w$. We next collect a dictionary sample, $\mathcal{D}^{w}$, for every sign present in the gloss vocabulary. By definition, dictionary signs contain accurate and articulated sign content. Furthermore, it is trivial to expand to larger domains of discourse, simply collecting dictionary examples of the expanded vocabulary.
\paragraph{Interpolated Dictionary Representation}
Given the translated gloss sequence, $\mathcal{Z}$, we create a stack of ordered dictionary signs, $[\mathcal{D}^{1},...,\mathcal{D}^{w},\mathcal{D}^{\mathcal{W}}]$ (Bottom left of Fig. \ref{fig:Model_Overview}). As in previous works \cite{saunders2021continuous}, we represent each dictionary sign as a sequence of skeleton pose, $\mathcal{D}^{w} = (s^{w}_{1},...,s^{w}_{\mathcal{P}^{w}})$ with $\mathcal{P}^{w}$ frames. We first convert the stack of dictionary signs into a continuous sequence by linearly interpolating between neighbouring signs for a predefined fixed $\mathcal{N}_{LI}$ frames. The final interpolated dictionary sequence, $\mathcal{I} = (\mathcal{I}_{1},...,\mathcal{I}_{\mathcal{Q}})$ with $\mathcal{Q}$ frames, is the combination of skeleton pose and the respective linear interpolation.
We next build a continuous dictionary sequence representation to be used as input to \textsc{FS-Net}{}. Alongside the skeleton pose of $\mathcal{I}$, we learn a gloss embedding, $\mathcal{G}^{w}$, unique to each gloss in the vocabulary, with a separate shared embedding for all interpolation frames, $\mathcal{G}^{LI}$. Additionally, we use a counter embedding proposed by Saunders \etal \cite{saunders2020progressive}, expanded to both a specific counter, $\mathcal{C}^{w}_{p}$, relating to the progression of each dictionary sign and a global counter, $\mathcal{C}_{q}$, relating to the progress of the full sequence, $\mathcal{I}$. The final continuous dictionary representation, $\mathcal{R} = (\mathcal{R}_{1},...,\mathcal{R}_{\mathcal{Q}})$ with $\mathcal{Q}$ frames, is constructed by concatenating the corresponding skeleton, gloss and counter embeddings per frame, as:
\begin{equation}
\mathcal{R}_{q} = [s^{w}_{p},\mathcal{G}^{w},\mathcal{C}^{w}_{p},\mathcal{C}_{q}]
\label{eq:sign_representation}
\end{equation}
where frame $q$ represents a time step $p$ frames into gloss $w$.
\paragraph{Frame Selection Network}
To co-articulate between dictionary signs, we propose a Frame Selection Network{} (\textsc{FS-Net}{}) that learns to predict the temporal alignment to a continuous signing sequence, $\mathcal{Y} = (y_{0},...,y_{\mathcal{T}})$ with $\mathcal{T}$ frames (Fig. \ref{fig:Model_Overview} middle). We note that this is a monotonic sequence-to-sequence task, due to the matching order of signing and the different sequence lengths ($\mathcal{Q} \neq \mathcal{T}$).
Formally, \textsc{FS-Net}{} predicts a discrete sparse monotonic temporal alignment path, \hbox{$\hat{\mathcal{A}} \in \mathbb{R}^{\mathcal{Q} \times \mathcal{Q}}$}:
\begin{equation}
\hat{\mathcal{A}} = \textsc{FS-Net}{}(\mathcal{R}, h_{1:\mathcal{W}})
\end{equation}
where $\hat{\mathcal{A}}$ contains binary decisions representing either frame selection or skipping. Fig. \ref{fig:Model_Overview} shows an example alignment that skips the production of frames $3,5$ and $8$ in the output sequence, removing redundant frames to create a smoother co-articulated continuous sequence. We build \textsc{FS-Net}{} as a transformer encoder \cite{vaswani2017attention} with an additional cross-attention to the encoded gloss sequence. To produce the co-articulated continuous signing pose sequence, $\hat{\mathcal{Y}}$, a matrix multiplication can be applied between $\mathcal{I}$ and $\hat{\mathcal{A}}$, as:
\begin{equation}
\label{eq:continuous_output}
\hat{\mathcal{Y}} = \mathcal{I} \times \hat{\mathcal{A}}
\end{equation}
This enables the mapping between varied length sequences, with the end of sequence prediction determined as the alignment selection of the final dictionary frame.
\paragraph{Dynamic Time Warping Supervision}
In practice, directly predicting the 2D alignment, $\hat{\mathcal{A}}$, provides weak gradients due to the sparse nature of the alignment. We therefore propose to train \textsc{FS-Net}{} using a \acf{dtw} supervision signal \cite{berndt1994dtw} designed to learn the optimal monotonic temporal alignment. We pre-compute the \ac{dtw} path, $\mathcal{A}^{*} = \textsc{DTW}(\mathcal{Q},\mathcal{T})$, between the interpolated dictionary sequence, $\mathcal{I}$, and the target continuous sequence, $\mathcal{Y}$. Due to the intractability of 2D alignment path prediction, we collapse the alignment down to a 1D sequence during training, \hbox{$\hat{\textrm{A}} \in \mathbb{R}^{\mathcal{Q}} = \argmax_q ( \hat{\mathcal{A}})$}. This enables a temporal mask prediction over $\mathcal{I}$, selecting which frames of the interpolated dictionary sequence to animate in turn to create a continuous sequence.
We argue that for the majority of sequences (88\% for \ac{mdgs}), \hbox{$\mathcal{Q} >> \mathcal{T}$}, due to the faster tempo of continuous sign \cite{naert2017coarticulation}. We thus assume that no frames are added during temporal alignment, only removed. To train \textsc{FS-Net}{}, we compute a cross entropy loss $\mathcal{L}_{CE}$ between the predicted 1D temporal alignment, \hbox{$\hat{\textrm{A}} \in \mathbb{R}^{\mathcal{Q}}$}, and the ground truth \ac{dtw} alignment, $\textrm{A}^{*} \in \mathbb{R}^{\mathcal{Q} \times 1}$, as:
\begin{equation}
\mathcal{L}_{CE} (\hat{\textrm{A}},\textrm{A}^{*}) = - \frac{1}{\mathcal{Q}} \sum_{q=1}^{\mathcal{Q}} \textrm{A}^{*}_{q} \cdot{} \log (\hat{\textrm{A}}_{q})
\end{equation}
The final continuous sign pose sequence, \hbox{$\hat{\mathcal{Y}} = (y_{1},...,y_{\mathcal{T}})$}, is produced as shown in Eq. \ref{eq:continuous_output}.
\subsection{Pose to Video} \label{sec:sign_to_video}
To generate a photo-realistic sign language video, $\mathcal{V}^{\mathcal{S}}$, conditioned on the produced sign pose sequence, $\hat{\mathcal{Y}}$, we propose a method for video-to-video signer generation, \textsc{SignGAN}{} (Fig. \ref{fig:Model_Overview} right). Taking inspiration from \cite{chan2019everybody}, in the conditional \ac{gan} setup, a generator network, $G$, competes in a min-max game against a multi-scale discriminator, $D = (D_{1}, D_{2}, D_{3})$. The goal of $G$ is to synthesise images of similar quality to ground-truth images, in order to fool $D$. Conversely, the aim of $D$ is to discern the ``fake'' images from the ``real'' images. For our purposes, $G$ synthesises images of a signer, $v^{\mathcal{S}}$ given a human pose, $y_{t}$, and a style image, $\mathcal{S}^{\mathcal{I}}$.
Following \cite{isola2017image}, we introduce skip connections to the architecture of $G$ in a \textit{U-Net} structure \cite{ronneberger2015u} between each down-sampling layer $i$ and up-sampling layer $n-i$, where $n$ is the total number of up-sampling layers. Skip connections propagate pose information across the networks, enabling the generation of fine-grained details. Specifically, we add skip connections between each down-sampling layer $i$ and up-sampling layer $n-i$, where $n$ is the total number of up-sampling layers.
\paragraph{Controllable Video Generation}
To enable training on diverse sign language datasets, we use a style-controllable video generation approach \cite{saunders2021anonysign}. A style image, $\mathcal{S}^{\mathcal{I}}$, is provided to condition synthesis alongside the pose sequence, as seen in Figure \ref{fig:Model_Overview}. \textsc{SignGAN}{} learns to associate the given style, $\mathcal{S}$, with the person-specific aspects of the corresponding target image, $v^{\mathcal{S}}_{t}$, such as the clothing or face, but disentangle the signer-invariant skeleton pose.
Controllable generation allows \textsc{SignGAN}{} to make use of the variability in signer appearance in the data. A multi-modal distribution of sign language videos in different styles, $\mathcal{V}^{S}$, can be produced, where \hbox{$S \in \{1,N_{S}\}$} represents the styles seen during training \footnote{For qualitative examples (e.g. in Fig \ref{fig:Qual_Eval}), we share a single signer appearance, as we have consent from this signer to use their appearance for publication purposes.}.
\begin{figure}[t!]
\centering
\includegraphics[width=0.9\linewidth]{new_figures/ESN-Keypoint_Barbara.pdf}
\caption{Hand keypoint loss overview. A keypoint discriminator, $D_{H}$, compares keypoints extracted from generated hands, $\hat{k}_{H}$, and real hands, ${k}^{*}_{H}$.}
\label{fig:keypoint_loss}
\end{figure}%
\begin{figure*}[t!]
\centering
\includegraphics[width=0.8\linewidth]{new_figures/CVPR22_Qual-Fig_2_Skel.pdf}
\caption{Example photo-realistic frames with skeleton pose produced using \textsc{FS-Net}{} and photo-realistic video generated using \textsc{SignGAN}{}.}
\label{fig:Qual_Eval}
\vspace{-0.4cm}
\end{figure*}%
\paragraph{Hand Keypoint Loss}
Previous pose-conditioned human synthesis methods have failed to generate realistic and accurate hand images \cite{ventura2020can}. To enhance the quality of hand synthesis, we introduce a novel loss that operates in the keypoint space, as shown in Figure \ref{fig:keypoint_loss}. A pre-trained 2D hand pose estimator \cite{ge20193d}, $H$, is used to extract hand keypoints, $k_{H}$, from cropped hand regions (\textit{i.e.} a 60x60 patch centered around the middle knuckle), $v_{H}$, as \hbox{$k_{H} = H(v_{H})$}. We avoid operating in the image space due to the existence of blurry hand images in the dataset, whereas the extracted keypoints are invariant to motion-blur. A hand keypoint discriminator, $D_{H}$, then attempts to discern between the ``real'' keypoints, \hbox{$k^{\star}_{H} = H(v_{H})$}, and the ``fake'' keypoints, \hbox{$\hat{k}_{H} = H(G(y_{H}))$}, leading to the objective:
\begin{align}
\label{eq:loss_HandKey}
\mathcal{L}_{\mathrm{\textsc{Key}}}(G,D_{H}) & = \mathbb{E}_{y_{H},z_{H}} [\log D_{H}(k^{\star}_{H})] \nonumber \\
+ \mathbb{E}_{y_{H}} & [\log (1-D_{H}(\hat{k}_{H}))]
\end{align}
\paragraph{Full Objective}
In standard image-to-image translation frameworks \cite{isola2017image,wang2018high}, $G$ is trained using a combination of adversarial and perceptual losses. We update the multi-scale adversarial loss, $\mathcal{L}_{GAN}(G,D)$, to reflect the controllable generation with a joint conditioning on sign pose, $y_{t}$, and style image, $\mathcal{S}^{\mathcal{I}}$:
\begin{align}
\label{eq:loss_gan}
\mathcal{L}_{GAN}(G,D) & = \sum^{k}_{i=1} \; \mathbb{E}_{y_{t},z_{t}} [\log D_{i}(z_{t} \mid y_{t},\mathcal{S}^{\mathcal{I}})] \nonumber \\
+ \mathbb{E}_{y_{t}} [\log & (1-D_{i}(G(y_{t},\mathcal{S}^{\mathcal{I}}) \mid y_{t},\mathcal{S}^{\mathcal{I}}))]
\end{align}
where $k = 3$ reflects the multi-scale discriminator. The adversarial loss is supplemented with two feature-matching losses; $\mathcal{L}_{FM}(G,D)$, the discriminator feature-matching loss presented in pix2pixHD \cite{wang2018high}, and $\mathcal{L}_{VGG}(G,D)$, the perceptual reconstruction loss \cite{johnson2016perceptual} which compares pretrained VGGNet \cite{simonyan2014very} features at multiple layers of the network. Our full \textsc{SignGAN}{} objective, $\mathcal{L}_{Total}$, is a weighted sum of these, alongside our proposed hand keypoint loss (Eq. \ref{eq:loss_HandKey}), as:
\begin{align}
\label{eq:loss_FM}
\mathcal{L}_{Total} & =
\min_{G} (( \max_{D_{i}} \sum^{k}_{i=1} \; \mathcal{L}_{GAN}(G,D_{i})) \nonumber \\
+ \lambda_{FM} & \sum^{k}_{i=1} \; \mathcal{L}_{FM}(G,D_{i})
+ \lambda_{VGG} \; \mathcal{L}_{VGG} (G(y_{t},I^{S}),z_{t}) \nonumber \\
+ \lambda_{\textsc{Key}} & \; \mathcal{L}_{\mathrm{\textsc{Key}}}(G,D_{H}))
\end{align}
\noindent where $k = 3$ and $\lambda_{FM},\lambda_{VGG},\lambda_{\textsc{Key}}$ weight the contributions of each loss.
\section{Experiments} \label{sec:experiments}
In this section, we evaluate our large-scale photo-realistic \ac{slp} approach. We outline our experimental setup then perform quantitative, qualitative \& user evaluation.
\subsection{Experimental Setup}
To train our large-scale \ac{slp} approach, we set a new translation protocol on the Meine DGS (\ac{mdgs}) corpus\footnote{With permission from the University of Hamburg.} \cite{hanke2010dgs}, a large \ac{dgs} linguistic resource capturing free-form signing from 330 deaf participants, with a vocabulary of 10,042 glosses. To adapt the corpus for translation, we segment the free-flowing discourse into 40,230 segments of German sentences, sign gloss translations and sign language videos. We pre-process the \ac{mdgs} gloss annotations \cite{konrad2018public} and create two protocols, with either gloss variants included (\acs{mdgsv}) or removed (\ac{mdgs}). We publicly release these translation protocols\footnote{https://github.com/BenSaunders27/meineDGS-Translation-Protocols} to facilitate the future growth in large-scale \ac{slp} and \ac{slt} research, with further details provided in the appendix. A license must be obtained from the University of Hamburg to use \ac{mdgs} for computational research.
For additional experiments, we use the benchmark \ac{ph14t} dataset \cite{camgoz2018neural} from the constrained weather broadcast domain, with setup and skeletal pose configuration as in \cite{saunders2020progressive}. We collect exhaustive dictionary examples of every \ac{dgs} sign present in \ac{mdgs} and \ac{ph14t}, trimmed to remove the sign onset and offset. For samples without expressive mouthings, we insert the facial features present in a example of the respective gloss from the continuous training set. For photo-realistic video generation, we use the \ac{c4a} dataset \cite{camgoz2021content4all} due to its high video quality and diverse interpreter appearance. We use a heat-map representation as pose condition, with each skeletal limb plotted on a separate feature channel.
We build our Text to Gloss models with 2 layers, 4 heads and hidden size of 128 and our \textsc{FS-Net}{} with 2 layers, 4 heads and 64 hidden size. We set the interpolation frames, $\mathcal{N}_{LI}$, to 5 and the learning rate to $10^{-3}$. Our code is based on JoeyNMT \cite{JoeyNMT}, and implemented using PyTorch \cite{paszke2017automatic}.
\subsection{Quantitative Evaluation} \label{sec:quant_experiments}
\subsubsection{Text to Gloss} \label{sec:Text_to_Gloss_Results}
We first evaluate our Text to Gloss translation described in Sec. \ref{sec:text_to_gloss}. Table \ref{tab:SLT_Baselines} shows a performance of 21.93 BLEU-4 on \ac{ph14t}, outperforming \cite{saunders2020progressive} (20.23) but falling short of \cite{moryossef2021data} (23.17) who use larger training data. Translation performance is considerably lower on both \ac{mdgsv} and \ac{mdgs} due to the larger domain, showing that further research is required to scale the task to larger vocabularies.
\begin{table}[!h]
\centering
\resizebox{0.75\linewidth}{!}{%
\begin{tabular}{@{}p{0.0cm}cc|cc@{}}
\toprule
& \multicolumn{2}{c}{DEV SET} & \multicolumn{2}{c}{TEST SET} \\
\multicolumn{1}{c}{Dataset:} & BLEU-4 & \multicolumn{1}{c}{ROUGE} & BLEU-4 & ROUGE \\ \midrule
\multicolumn{1}{r|}{\ac{mdgsv}} & 1.96 & 24.51 & 1.16 & 25.34 \\
\multicolumn{1}{r|}{\ac{mdgs}} & 3.17 & 32.93 & 3.08 & 32.52 \\
\multicolumn{1}{r|}{\ac{ph14t}} & {\fontseries{b}\selectfont 21.93} & {\fontseries{b}\selectfont 57.25} & {\fontseries{b}\selectfont 20.08} & {\fontseries{b}\selectfont 56.63} \\
\bottomrule
\end{tabular}%
}
\caption{Text to Gloss results on \ac{mdgs} and \ac{ph14t}.}
\label{tab:SLT_Baselines}
\vspace{-0.6cm}
\end{table}
\begin{table}[!b]
\centering
\resizebox{0.9\linewidth}{!}{%
\begin{tabular}{@{}p{2.8cm}cc|cc@{}}
\toprule
& \multicolumn{2}{c}{DEV SET} & \multicolumn{2}{c}{TEST SET} \\
\multicolumn{1}{c}{Approach:} & BLEU-4 & ROUGE & BLEU-4 & ROUGE \\ \midrule
\multicolumn{1}{r|}{Progressive Transformers \cite{saunders2020progressive}} & 11.93 & 34.01 & 10.43 & 32.02 \\
\multicolumn{1}{r|}{Adversarial Training \cite{saunders2020adversarial}} & 13.16 & 36.75 & 12.16 & 34.19 \\
\multicolumn{1}{r|}{Mixture Density Networks \cite{saunders2021continuous}} & 13.14 & 39.06 & 11.94 & 35.19 \\
\multicolumn{1}{r|}{Mixture of Motion Primitives \cite{saunders2021mixed}} & 13.32 & 37.58 & 12.67 & 35.61 \\
\multicolumn{1}{r|}{Interpolated Dictionary Sequence} & 16.28 & 38.11 & 16.27 & 36.95 \\
\multicolumn{1}{r|}{\textbf{\textsc{FS-Net}{} (Ours})} & \textbf{19.14} & \textbf{40.94} & \textbf{18.78} & \textbf{40.60} \\
\bottomrule
\end{tabular}%
}
\caption{Back translation results on the \ac{ph14t} dataset for the \textit{Gloss to Pose} task.}
\label{tab:gloss_to_pose}
\end{table}
\subsubsection{Gloss to Pose}
\paragraph{Back Translation}
Back translation has developed as the state-of-the-art \ac{slp} evaluation metric \cite{saunders2020progressive}. We train an \ac{slt} model \cite{camgoz2020sign} on \ac{ph14t} with skeleton pose sequences generated using our \textsc{FS-Net}{} approach. Table \ref{tab:gloss_to_pose} shows considerable performance gains (43\%) compared to baseline methods on the Gloss to Pose task \cite{saunders2020progressive,saunders2020adversarial,saunders2021continuous,saunders2021mixed}. This highlights the increased comprehension provided by \textsc{FS-Net}{} compared to baseline end-to-end regression methods, with an ability to overcome the poor quality of the \ac{ph14t} dataset. Furthermore, it can be seen that interpolated dictionary sequences (Comparable to that of \cite{stoll2018sign}) achieve worse back translation results, highlighting the effect of \textsc{FS-Net}{} co-articulation for comprehension.
Additionally, Table \ref{tab:text_to_pose} shows further state-of-the-art results on the full pipeline of text to pose, with an initial text to gloss translation and a subsequent sign animation. This highlights the effectiveness of the full spoken language to photo-realistic video pipeline required for true \ac{slp}.
\begin{table}[!t]
\centering
\resizebox{0.9\linewidth}{!}{%
\begin{tabular}{@{}p{2.8cm}cc|cc@{}}
\toprule
& \multicolumn{2}{c}{DEV SET} & \multicolumn{2}{c}{TEST SET} \\
\multicolumn{1}{c}{Approach:} & BLEU-4 & ROUGE & BLEU-4 & ROUGE \\ \midrule
\multicolumn{1}{r|}{Progressive Transformers \cite{saunders2020progressive}} & 11.82 & 33.18 & 10.51 & 32.46 \\
\multicolumn{1}{r|}{Adversarial Training \cite{saunders2020adversarial}} & 12.65 & 33.68 & 10.81 & 32.74 \\
\multicolumn{1}{r|}{Mixture Density Networks \cite{saunders2021continuous}} & 11.54 & 33.40 & 11.68 & 33.19 \\
\multicolumn{1}{r|}{Mixture of Motion Primitives \cite{saunders2021mixed}} & 14.03 & \textbf{37.76} & 13.30 & 36.77 \\
\multicolumn{1}{r|}{\textbf{\textsc{FS-Net}{} (Ours})} & \textbf{16.92} & 35.74 & \textbf{21.10} & \textbf{42.57} \\
\bottomrule
\end{tabular}%
}
\caption{Back translation results on the \ac{ph14t} dataset for the \textit{Text to Pose} task.}
\label{tab:text_to_pose}
\end{table}
\paragraph{Sign User Evaluation}
We next perform extensive user evaluation with native signers, animating our skeleton pose outputs using \textsc{SignGAN}{}. All baselines are also generated by \textsc{SignGAN}{}, to alleviate visual differences in comparison. In total, 10 participants completed our sign user evaluation, of which all were fluent signers and 20\% were deaf. We provide all the generated user evaluation videos in the supplementary materials.
We first compare the comprehension of \textsc{FS-Net}{} compared to the state-of-the-art deep learning based \ac{slp} method \cite{saunders2021mixed}. We show participants pairs of generated videos from the same sequence, asking to select which video was more understandable. Table \ref{tab:understandable_baselines} shows how our productions were unanimously preferred to baselines for both \ac{mdgs} and \ac{ph14t}. This overwhelming result highlights both the increased comprehension of \textsc{FS-Net}{}, alongside the inability of previous methods to scale to unconstrained domains of discourse.
\begin{table}[b!]
\centering
\resizebox{0.70\linewidth}{!}{%
\begin{tabular}{@{}p{2.0cm}|ccc@{}}
\toprule
Dataset & \textsc{FS-Net}{} & Baseline \cite{saunders2021mixed} & Equal \\\midrule
\multirow{1}{*}{\ac{mdgs}} & \textbf{95\%} & 0\% & 5\% \\ \midrule
\multirow{1}{*}{\ac{ph14t}} & \textbf{95\%} & 0\% & 5\% \\
\bottomrule
\end{tabular}%
}
\caption{Comprehension user evaluation results, showing the percentage of participants who chose productions from \textsc{FS-Net}{} or a baseline \cite{saunders2021mixed} to be more understandable, or equal.}
\label{tab:understandable_baselines}
\end{table}
We next evaluate how understandable our large-scale sign productions are in isolation. We show each participant a produced video alongside a list of 10 signs, of which 5 are signed in the video, and ask them to select which signs they believe are being signed. For \textsc{FS-Net}{} productions, an average of 4.8 signs were recognised for each video. This shows our productions are easily understandable by native signers, an essential result for accurate large-scale \ac{slp}.
Our final user evaluation evaluates how co-articulated our \textsc{FS-Net}{} productions are. We show participants two videos of the same sequence, one isolated dictionary sequence and one co-articulated continuous video generated by \textsc{FS-Net}{}, and ask them to select which they believed had the most smooth transitions between signs. We first evaluate dictionary signs without trimming the sign onset and offset, with Table \ref{tab:coarticulated_signing} showing our productions were unanimously preferred. Moving to trimmed dictionary signs, \textsc{FS-Net}{} productions were preferred 40\% of the time, with 13\% equal preference. This highlights the effectiveness of \textsc{FS-Net}{} at improving co-articulation between dictionary signs and temporally aligning to continuous signing sequences.
\begin{table}[t!]
\centering
\resizebox{0.70\linewidth}{!}{%
\begin{tabular}{@{}p{2.5cm}ccc@{}}
\toprule
& \textsc{FS-Net}{} & Isolated & Equal \\\midrule
\multicolumn{1}{r|}{Non-Trimmed} & \textbf{100}\% & 0\% & 0\% \\
\multicolumn{1}{r|}{Trimmed} & 40\% & \textbf{47}\% & 13\% \\
\bottomrule
\end{tabular}%
}
\caption{Co-articulation user evaluation results, showing the percentage of participants who believed the video with the smoothest transitions was from \textsc{FS-Net}{}, isolated concatenation or equal.}
\label{tab:coarticulated_signing}
\end{table}
\begin{table}[b!]
\centering
\resizebox{0.9\linewidth}{!}{%
\begin{tabular}{@{}p{3.0cm}cccc@{}}
\toprule
& \multicolumn{1}{c}{SSIM $\uparrow$} & \multicolumn{1}{c}{Hand SSIM $\uparrow$} & \multicolumn{1}{c}{Hand Pose $\downarrow$} & \multicolumn{1}{c}{FID $\downarrow$} \\ \midrule
\multicolumn{1}{r|}{EDN \cite{chan2019everybody}} & 0.737 & 0.553 & 23.09 & 41.54 \\
\multicolumn{1}{r|}{vid2vid \cite{wang2018video}} & 0.750 & 0.570 & 22.51 & 56.17 \\
\multicolumn{1}{r|}{Pix2PixHD \cite{wang2018high}} & 0.737 & 0.553 & 23.06 & 42.57 \\
\multicolumn{1}{r|}{Stoll \etal \cite{stoll2020text2sign}} & 0.727 & 0.533 & 23.17 & 64.01 \\
\multicolumn{1}{r|}{\textsc{SignGAN}{} (Ours)} & \textbf{0.759} & \textbf{0.605} & \textbf{22.05} & \textbf{27.75} \\
\bottomrule
\end{tabular}%
}
\caption{Baseline model comparison results of photo-realistic sign language video generation.}
\label{tab:baselines_diverse}
\end{table}
\subsubsection{Pose to Video}
Finally, we evaluate our photo-realistic sign language video approach, \textsc{SignGAN}{}. We compare the performance of \textsc{SignGAN}{} against state-of-the-art image-to-image and video-to-video translation methods \cite{chan2019everybody,wang2018video,wang2018high,stoll2020text2sign}, conditioned on skeletal pose images. We measure the quality of synthesized images using the following metrics; 1) SSIM: Structural Similarity \cite{wang2004image} over the full image. 2) Hand SSIM: SSIM metric over a crop of each hand. 3) Hand Pose: Absolute distance between 2D hand keypoints of the produced and ground truth hand images, using a pre-trained hand pose estimation model \cite{ge20193d}. 4) FID: Fr\'echet Inception Distance \cite{heusel2017gans} over the full image.
\paragraph{Baseline Comparison}
We first compare \textsc{SignGAN}{} to baseline methods for photo-realistic generation given a sequence of ground truth poses as input. Table \ref{tab:baselines_diverse} shows results on the \ac{c4a} data, with \textsc{SignGAN}{} outperforming all baselines particularly for the Hand SSIM and FID. We believe this is due to the improved quality of synthesized hand images by using the proposed hand keypoint loss.
\paragraph{Ablation Study}
We perform an ablation study of \textsc{SignGAN}{}, with results in Table \ref{tab:ablation}. As suggested in Sec. \ref{sec:sign_to_video}, the hand discriminator performs poorly for both SSIM and hand SSIM, due to the generation of blurred hands. However, our proposed hand keypoint loss increases model performance considerably and particularly for Hand SSIM, emphasizing the importance of an adversarial loss invariant to blurring.
\begin{table}[t!]
\centering
\resizebox{0.9\linewidth}{!}{%
\begin{tabular}{@{}p{3.0cm}ccccc@{}}
\toprule
& \multicolumn{1}{c}{SSIM $\uparrow$} & \multicolumn{1}{c}{Hand SSIM $\uparrow$} & \multicolumn{1}{c}{Hand Pose $\downarrow$} & \multicolumn{1}{c}{FID $\downarrow$} \\ \midrule
\multicolumn{1}{r|}{Baseline} & 0.743 & 0.582 & 22.87 & 39.33 \\
\multicolumn{1}{r|}{Hand Discriminator} & 0.738 & 0.565 & 22.81 & 39.22 \\
\multicolumn{1}{r|}{Hand Keypoint Loss} & \textbf{0.759} & \textbf{0.605} & \textbf{22.05} & \textbf{27.75} \\
\bottomrule
\end{tabular}%
}
\caption{Ablation study results of \textsc{SignGAN}{}}
\label{tab:ablation}
\vspace{-0.4cm}
\end{table}
\begin{table}[b!]
\centering
\resizebox{0.5\linewidth}{!}{%
\begin{tabular}{@{}p{3.0cm}cc@{}}
\toprule
& \multicolumn{1}{c}{Body} & \multicolumn{1}{c}{Hand} \\ \midrule
\multicolumn{1}{r|}{EDN \cite{chan2019everybody}} & 100\% & 97.8\% \\
\multicolumn{1}{r|}{vid2vid \cite{wang2018video}} & 85.9\% & 84.8\% \\
\multicolumn{1}{r|}{Pix2PixHD \cite{wang2018high}} & 98.9\% & 100\% \\
\multicolumn{1}{r|}{Stoll \etal \cite{stoll2020text2sign}} & 100\% & 100\% \\
\bottomrule
\end{tabular}%
}
\caption{Perceptual study results, showing the percentage of participants who preferred \textsc{SignGAN}{} to the baseline model.}
\label{tab:perceptual}
\end{table}
\paragraph{Perceptual Study}
We perform an additional perceptual study of our photo-realistic generation, showing participants pairs of 10 second videos generated by \textsc{SignGAN}{} and a corresponding baseline method. Participants were asked to select which video was more visually realistic, with a separate focus on the body and hands. In total, 46 participant completed the study, of which 28\% were signers, each viewing 2 randomly selected videos from each baseline. Table \ref{tab:perceptual} shows the percentage of participants who preferred the outputs of \textsc{SignGAN}{} to the baseline method. It can be seen that \textsc{SignGAN}{} outputs were unanimously preferred for both body (96.2\% average) and hand (95.6\% average) synthesis. Vid2vid \cite{wang2018video} was the strongest contender, with our productions preferred only 85\% of the time.
\paragraph{Deaf User Evaluation}
Our final user evaluation compares the comprehension of photo-realistic videos against the previously-used skeletal pose representation \cite{saunders2020progressive}. We provided 5 30-second videos of ground-truth skeletal sequences and corresponding photo-realistic videos to deaf participants, asking them to rate each video out of 5 for understandability. Synthesised videos were rated higher for comprehension, at 3.9 compared to 3.2 for skeletal sequences. This suggests that photo-realistic content is more understandable to a deaf signer than a skeleton sequence.
\subsection{Qualitative Evaluation} \label{sec:qual_experiments}
We show example generated photo-realistic frames in Fig. \ref{fig:Qual_Eval}, highlighting the production quality. We provide further qualitative evaluation in supplementary materials.
\section{Potential Negative Societal Impact} \label{sec:societal_impact}
We acknowledge the potential use of \ac{slp} technology to remove the reliance on human interpreters. However, we see this work as enabling a larger provision of signed content, especially where interpretation doesn't exist \cite{dickinson2017sign}. We also recognise the potential harm if this technology produced incorrect sign language content, particularly in emergency settings. Although this paper significantly advances the \ac{slp} field, we would like to state that \ac{slp} technology is still under development and should not yet be relied upon.
\section{Conclusion} \label{sec:conclusion}
Large-scale photo-realistic \ac{slp} is important to provide high quality signing content to deaf communities. In this paper, we proposed the first \ac{slp} method to achieve both large-scale signing and photo-realistic video generation. We proposed \textsc{FS-Net}{}, which learns to co-articulate between dictionary signs by modelling the optimal temporal alignment to continuous sequences. Furthermore, we proposed \textsc{SignGAN}{} to produce photo-realistic sign language videos. We proposed a novel keypoint-based loss function that improves the quality of hand synthesis, operating in the keypoint space to avoid issues caused by motion blur.
We showed how our approach can scale to unconstrained domains of discourse and be understood by native signers, with considerable state-of-the-art \ac{ph14t} back translation performance. Additionally, we performed extensive user evaluation showing our approach increases the realism of interpolated dictionary signs, can be understood by native deaf signers and is overwhelmingly preferred to baseline methods. Finally, we showed that \textsc{SignGAN}{} outperforms all baseline methods for quantitative metrics, human evaluation and native deaf signer comprehension.
Our approach is limited by the current performance of text to gloss translation for large-scale domains. Available gloss annotations are limited, making sign language translation tasks a low-resource machine translation task \cite{moryossef2021data}. Improvements on both architectures and datasets are required to compete with spoken language \ac{nmt} methods. For future work, we plan to tackle spatial co-articulation between dictionary signs.
\section*{Acknowledgments}
This project was supported by the EPSRC project ExTOL (EP/R03298X/1), SNSF project SMILE-II (CRSII5 193686) and EU project EASIER (ICT-57-2020-101016982). This work reflects only the authors view and the Commission is not responsible for any use that may be made of the information it contains. We thank Thomas Hanke and University of Hamburg for use of the \ac{mdgs} data. We thank SWISSTXT for the use of interpreter appearance data.
{\small
\bibliographystyle{ieee_fullname}
| {'timestamp': '2022-03-30T02:26:24', 'yymm': '2203', 'arxiv_id': '2203.15354', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15354'} | arxiv |
\section{Introduction}
Strategy-proofness -- the idea that it is in an agent's interest to reveal their true preferences -- is a fundamental desideratum in mechanism design. All the other properties a mechanism may have become suspect if we can not assume that an agent will play according to the rules. Unfortunately, in the field of voting, this is a property we have to live without -- per the Gibbard-Satterthwaite theorem (\cite{Gibbard1973}; \cite{Satterthwaite1975}), the only strategy-proof rule with a range consisting of more than two candidates is dictatorship. This negative result, however, did not mean that scholars were willing to give up on either voting or resistance to strategy. Instead, the search was on for a workaround.
It was already known that the impossibility does not hold on restricted domains \cite{Dumett1961}, and if the preferences of the voters are separable \cite{Barbera1991} or single-peaked \cite{Moulin1980}, then natural families of strategy-proof voting rules exist. For those committed to the universal domain, there was the statistical approach -- all rules may be manipulable, but it could be the case that some are more manipulable than others. This lead to a voluminous literature on manipulation indices, that sought to quantify how likely a voting rule is to be manipulable (\cite{Nitzan1985}; \cite{Kelly1993}; \cite{Aleskerov1999}). With the incursion of computer science into social choice, an approach based on computational complexity came into prominence -- the idea being, if a strategic vote is computationally infeasible to find, that is almost as good as there being no strategic vote in the first place (\cite{Bartholdi1989}; \cite{Conitzer2007}; \cite{Walsh2011}).
None of these approaches were entirely convincing. Domain restrictions are by nature arbitrary, and there is little point in arguing as to how natural single-peaked preferences may be, if no real-world example actually is \cite{Elkind2017}. Manipulation indices are sensitive to the choice of the statistical culture, and are usually obtained by means of computer simulations for particular choices of the number of voters and candidates; so while an index could tell us which voting rule is more manipulable under, say, impartial culture with four voters and five candidates, it would be a stretch to extrapolate from this to statements about the manipulability of a voting rule in general. Computational complexity focuses on the worst case of finding a strategic vote, and a high worst-case complexity does not preclude the possibility of the problem being easy in any practical instance \cite{Faliszewski2011}.
In the closely related field of matching, \cite{Pathak2013} proposed a method to compare the manipulability of mechanisms that seemed to sidestep all these issues -- mechanism $f$ is said to be more manipulable than $g$ if the set of profiles on which $g$ is manipulable is included in the set of profiles on which $f$ is manipulable. No restrictions on domain, statistical culture, or computational ability is required. In the appendix to their paper, Pathak and S\"onmez theorised how the approach could be extended to other areas of mechanism design. This was taken up by the matching community (\cite{Decerf2021}; \cite{Bonkoungou2021}), but to our knowledge the only authors to apply this approach to voting were Arribillaga and Mass\'o (\cite{Arribillaga2016}; \cite{Arribillaga2017}). However, the notion used by Arribillaga and Mass\'o differed from that of Pathak and S\"onmez. A l\`a Pathak and S\"onmez, we would say that a voting rule $f$ is more manipulable than $g$ just if:
$$\forall P: \text{$g$ is manipulable at $P$}\Rightarrow\text{$f$ is manipulable at $P$}.$$
In other words, if a voter can manipulate $g$ in profile $P$, then a voter can also manipulate $f$ in the same profile. Arribillaga and Mass\'o's notion is a bit harder to parse:
$$\forall P_i: (\exists P_{-i}: \text{$g$ is manipulable at $(P_i,P_{-i})$})\Rightarrow (\exists P_{-i}': \text{$f$ is manipulable at $(P_i,P_{-i}')$}).$$
That is, if there exists a possible \emph{preference order} of voter $i$, $P_i$, such that there exists \emph{some} profile extending $P_i$, in which the voter can manipulate $g$, then there also exists a \emph{possibly different} profile extending $P_i$, in which the voter can manipulate $f$. To see why this could be an issue, recall that a voting rule is neutral if for any permutation of candidates $\pi$, $f(\pi P)=\pi f(P)$. A neutral voting rule is \emph{always} manipulable under the definition above -- by the Gibbard-Satterthwaite theorem, there exists some profile $P$ where a voter can manipulate. If we pick an appropriate permutation of candidate names, we will obtain a manipulable profile where voter $i$'s preference order is any order we want. Indeed, the papers of Arribillaga and Mass\'o deal with the manipulability of median voter schemes \cite{Moulin1980} and voting by committees \cite{Barbera1991}, both of which are fundamentally non-neutral procedures.
Most voting rules, however, are intended to capture democratic values, and so are neutral at their core; neutrality is typically relaxed only for the purposes of tie-breaking. The notion of Arribillaga and Mass\'o is inappropriate in this setting. The purpose of this paper is to see whether the original notion of Pathak and S\"onmez is any better.
\subsection{Our contribution}
We apply the manipulability notion of Pathak and S\"onmez to the families of $k$-approval and truncated Borda voting rules. We find that all members of the $k$-approval family are incomparable with respect to this notion, while in the truncated Borda family, in the special case of two voters, $(k+1)$-Borda is more manipulable than $k$-Borda; all other members are incomparable.
\section{Preliminaries}
Let $\mathcal{V}$, $|\mathcal{V}|=n$, be a set of voters, $\mathcal{C}$, $|\mathcal{C}|=m$, a set of candidates, and $\mathcal{L}(\mathcal{C})$ the set of linear orders over $\mathcal{C}$. Every voter is associated with some $\succeq_i\in\mathcal{L}(\mathcal{C})$, which denotes the voter's preferences. A profile $P\in\mathcal{L}(\mathcal{C})^n$ is an $n$-tuple of preferences, $P_i$ is the $i$th component of $P$ (i.e.\ the preferences of voter $i$), and $P_{-i}$ the preferences of all the other voters.
A voting rule is a mapping:
$$f:\mathcal{L}(\mathcal{C})^n\rightarrow \mathcal{C}$$
Note two consequences of the definition above. First, the number of voters and candidates is integral to the definition of a voting rule. I.e., for the purposes of this paper the Borda rule with $n=3, m=4$ is considered to be a different voting rule from the Borda rule with $n=4, m=3$. This is why our results meticulously consider every combination of $n$ and $m$ in detail.
Second, since we are requiring the voting rule to output a single candidate, we are assuming an inbuilt tie-breaking mechanism. For the purposes of this paper, all ties will be broken lexicographically. Capital letters will be used to denote candidates with respect to this tie-breaking order. That is, in a tie between $A$ and $B$ the tie is broken in favour of $A$. In the case of subscripts, ties are broken first by alphabetical priority then by subscript. That is, in the tie $\set{A_3,A_5,B_1}$, the winner is $A_3$ since $A$ has priority over $B$ and $3$ is smaller than 5.
In cases where we do not know a candidate's position in the tie-breaking order, we denote the candidate with lower case letters. Thus, if the tie is $\set{a,b,c}$, we cannot say who the winner is, and must proceed by cases.
We study two families of voting rules:
\begin{definition}
$k$-approval, denoted $\alpha_k$, is the voting rule that awards one point to a candidate each time that candidate is ranked in the top $k$ positions of a voter. The highest scoring candidates are the tied winners, ties are broken lexicographically.
$k$-Borda, denoted $\beta_k$, is the voting rule that awards $k-i+1$ points to a candidate each time that candidate is ranked $i$th, $i\leq k$. The highest scoring candidates are the tied winners, ties are broken lexicographically.
The corner case of $\alpha_1=\beta_1$ is also known as the plurality rule, while $\beta_{m-1}$ is known as the Borda rule.
Both families are special cases of \emph{scoring rules}, under which a candidate gains $s_i$ points each time it is ranked $i$th. Under $k$-approval, $s_1=\dots=s_k=1$, while under $k$-Borda $s_i=\max(0,k-i+1)$.
\end{definition}
We will be comparing the $k$-approval and $k$-Borda families of voting rules via the notion of manipulability pioneered by \cite{Pathak2013}.
\begin{definition}[Pathak and S\"onmez, 2013]
Let $f,g$ be two voting rules. We say that $f$ is manipulable at profile $P$ just if there exists a voter $i$ and a preference order $P_i'$ such that:
$$f(P_i',P_{-i})\succ_i f(P_i,P_{-i}).$$
We say that $f$ is more manipulable than $g$, denoted $f\geq_{\mathcal{PS}} g$, just if, for every profile $P$, if $g$ is manipulable at $P$ then so is $f$.
$f>_{\mathcal{PS}} g$ is shorthand for $f\geq_{\mathcal{PS}} g$ and $g\ngeq_{\mathcal{PS}} g$, and $f\times_{\mathcal{PS}} g$ is shorthand for $f\ngeq_{\mathcal{PS}} g$ and $g\ngeq_{\mathcal{PS}} f$.
\end{definition}
\section{$k$-Approval family}
In this section we fix $i<j$. Our end result (\autoref{thm:approval}) is that for any $n,m$, $\alpha_i\times_{\mathcal{PS}}\alpha_j$.
\begin{proposition}\label{lemLaij}
For all $n,m$: $\alpha_{i} \ngeq_{\mathcal{PS}} \alpha_{j}$.
\end{proposition}
\begin{proof}
Consider a profile with $i$ $B$ candidates, $j-i$ $A$ candidates, and $m-j$ $C$ candidates.
\[
\begin{array}{|c|c|c|c|}
\hline
n-1\text{ voters of type 1} & B_{1} \ldots B_{i} & A_{1} \ldots A_{j-i}& C_{1} \ldots C_{m-j} \\
\hline
1\text{ voter of type 2} & B_{1} \ldots B_{i} & A_{j-i} \ldots A_{1}& C_{1} \ldots C_{m-j} \\
\hline
\end{array}
\]
In $\alpha_{j}$ all $A$ and $B$ candidates are tied by score, and $A_{1}$ wins the tie. The voter of type 2 can swap $A_{1}$ for $C_{1}$. This will lower the score of $A_1$ from $n$ to $n-1$, while the other $A$ and $B$ candidates still have $n$. If $j-i>1$, the winner will be $A_2$. If $j-i=1$, the winner will be $B_1$. In either case, the outcome will be better for the manipulator.
In $\alpha_{i}$ $B_1$ wins, so every voter gets his best outcome. No one has an incentive to manipulate.
\end{proof}
\begin{lemma}\label{lem:alphabigm}
For $n=2q, m\geq 2j-1$: $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$.
\end{lemma}
\begin{proof}
The profile consists of $j-1$ $B$ candidates, $j-1$ $C$ candidates, one $A$ candidate, and $m-2j+1$ $D$ candidates. The condition that $m\geq 2j-1$ guarantees that the top $j$ candidates of voters of types 1 and 2 intersect only at $A$:
\[
\begin{array}{|c|c|c|c|}
\hline
q\text{ voters of type 1} & B_{1} \ldots B_{i} & B_{i+1} \ldots B_{j-1}A & C_1\dots C_{j-1}D_1\dots D_{m-2j+1}\\
\hline
q-1\text{ voters of type 2} & AC_1\dots C_{i-1} & C_{i} \ldots C_{j-1} & B_1\dots B_{j-1}D_1\dots D_{m-2j+1}\\
\hline
1\text{ voter of type 3} & C_{1} \ldots C_{i} & C_{i+1} \ldots C_{j-1}A & B_1\dots B_{j-1}D_1\dots D_{m-2j+1}\\
\hline
\end{array}
\]
Under $\alpha_i$, $A$ has $q-1$ points, $B_1$ through $B_{i}$ and $C_1$ through $C_{i-1}$ have $q$, $C_i$ has 1. The winner is $B_1$. The voter of type 3 can manipulate by swapping $A$ for $C_1$. $A$ will have $q$ points and will beat $B_1$ in the tie.
Under $\alpha_j$, $A$ has $n$ points and is the winner. Voters of type 2 get their best choice elected. A voter of type 1 would rather have a $B$ candidate win, but $A$ has a lead of at least one point on these. Moving $A$ below the $j$th position will only drop the score by one, and $A$ will win the tie. The voter of type 3 would rather see a $C$ candidate win, but $A$ has a lead of at least one. Dropping $A$'s score will at most force a tie, which $A$ will win.
\end{proof}
\begin{lemma}\label{aoddsmall}
For $n=2q+1, m\geq 2j-1$:
if $i\geq 2$, then $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$.
\end{lemma}
\begin{proof}
The profile consists of $j$ $B$ candidates, $j-1$ $A$ candidates, and $m-2j+1$ $C$ candidates. The condition that $m\geq 2j-1$ guarantees that the top $j$ candidates of voters of types 1 and 2 intersect only at $B_1$:
\[
\begin{array}{|c|c|c|c|}
\hline
q\text{ voters of type 1} & \overbrace{A_{1} \ldots A_{i}}^{\geq 2} & B_{1}A_{i+1}\dots A_{j-1}& B_2\dots B_jC_1\dots C_{m-2j+1} \\
\hline
q\text{ voters of type 2} & B_{i} \ldots B_{1} &B_{i+1}\ldots B_{j} & A_1\dots A_{j-1}C_1\dots C_{m-2j+1} \\
\hline
1\text{ voter of type 3} & B_{1} \ldots B_{i} & B_{i+1}\ldots B_{j} &A_1\dots A_{j-1} C_1\dots C_{m-2j+1} \\
\hline
\end{array}
\]
Under $\alpha_i$, the winner is $B_1$ with $q+1$ points. An voter of type 2 can swap $B_1$ with $B_j$, and $B_2$ will win (since $i\geq 2$, $B_1$ and $B_2$ are necessarily distinct).
Under $\alpha_j$, $B_1$ wins with $n$ points. The other $B$ candidates have at most $n-1$ points, and the $A$ candidates have at most $n-2$. A voter of type 2 would rather see another $B$ candidate win, but such a voter can only lower the score of $B_1$ by 1, and $B_1$ will win the tie against any $B$ candidate. A voter of type 1 would rather see an $A$ candidate win, but $B_1$ has a lead of at least two points, so will beat the $A$ candidates by points even if ranked last.
\end{proof}
\begin{lemma}\label{lem:aione}
For all $n,m$: if $i=1$, then $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$.
\end{lemma}
\begin{proof}
The profiles consist of candidates $A,B,C$, and $D_1$ through $D_{m-3}$.
Case one: $n$ even, $n=2q$.
\[
\begin{array}{|c|c|c|c|}
\hline
q\text{ voters of type 1} & B&AD_1\dots D_{j-2}&C D_{j-1}\dots D_{m-3} \\
\hline
q-1\text{ voters of type 2} & A&BD_1\dots D_{j-2} &CD_{j-1}\dots D_{m-3} \\
\hline
1\text{ voter of type 3} & C &AD_1\dots D_{j-2}&BD_{j-1}\dots D_{m-3} \\
\hline
\end{array}
\]
Under $\alpha_i$, $B$ has $q$ points, $A$ has $q-1$, and $C$ has 1. If $q\geq 2$, $B$ wins by score, and if $q=1$, $B$ wins the tie. The voter of type 3 can swap $C$ with $A$ to force a tie, which $A$ will win.
Under $\alpha_j$, $A$ is the winner with $n$ points. Voters of type 2 have no incentive to manipulate. A voters of type 1 would rather see $B$ win, but $B$ has at most $n-1$ points, so a voter of this type can at most force a tie, which $A$ will win. Likewise, the voter of type 3 would rather $C$ win, who has 1 point. Decreasing $A$'s score will at most force a tie.
Case two: $n$ odd, $n=2q+1$.
\[
\begin{array}{|c|c|c|c|}
\hline
q\text{ voters of type 1} & B&CD_1\dots D_{j-2}& A D_{j-1}\dots D_{m-3} \\
\hline
q\text{ voters of type 2} & A&BD_1\dots D_{j-2} &CD_{j-1}\dots D_{m-3} \\
\hline
1\text{ voter of type 3} & C &BD_1\dots D_{j-2} &AD_{j-1}\dots D_{m-3} \\
\hline
\end{array}
\]
Under $\alpha_i$, $A$ wins by tie-breaking. The voter of type 3 can swap $C$ with $B$ to give $B$ a points victory.
Under $\alpha_j$, $B$ wins with $n$ points. A voter of type 2 would rather see $A$ win, but $B$ has at least a two point lead, so he cannot force a tie. The voter of type 3 would rather $C$ win, but $C$ is behind by at least one point, so he can at best force a tie, which $B$ will win.
\end{proof}
\begin{corollary}\label{lem:ambig}
For all $n,m \geq 2j$: $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$.
\end{corollary}
\begin{proof} \autoref{lem:alphabigm}, \autoref{aoddsmall}, and \autoref{lem:aione}.
\end{proof}
\begin{lemma}\label{lem:ammiddle}
For all $n, m<2j$: if $i\geq 2$, then $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$.
\end{lemma}
\begin{proof}
Case one: $m\geq i+j$.
Since $m\geq i+j = 2i + (j-i)$, we can guarantee the existence of $2i$ $A$ candidates and $(j-i)$ $B$ candidates. The remaining $m-(i+j)$ candidates are the $C$ candidates. Observe that since $m < 2j$, the number of the $C$ candidates is smaller than the number of the $B$ candidates $(m-j-i < j-i)$.
\[
\begin{array}{|c|c|c|c|}
\hline
\floor{n/2}\text{ voters of type 1} & \overbrace{A_{1} \ldots A_{i}}^{\geq2}&B_1\dots B_{j-i}&A_{2i}\dots A_{i+1}\overbrace{C_1\dots C_{m-(i+j)}}^{<j-i} \\
\hline
\ceil{n/2}\text{ voter of type 2} & A_{i+1} \dots A_{2i}& B_{1} \ldots B_{j-i} & A_{i}\dots A_1 C_1\dots C_{m-(i+j)}\\
\hline
\end{array}
\]
Under $\alpha_i$, if $n$ is even the winner is $A_1$. A voter of type 2 can manipulate by swapping $A_{2i}$ with $A_{i}$, giving $A_i$ $n/2+1$ points. Since $i\geq 2$, $A_i\neq A_1$. If $n$ is odd, the winner is $A_{i+1}$ with $\ceil{n/2}$ points. A voter of type 1 can swap $A_1$ with $A_{2i}$ to give $A_{2i}$ $\ceil{n/2}+1$ points. Since $i\geq 2$, $A_{2i}\neq A_{i+1}$.
Under $\alpha_j$, all the $B$ candidates have $n$ points, and the winner is $B_1$. A voter of type 1 would rather see one of $A_1,\dots, A_i$ win. Since he cannot raise the score of these, he will have to lower the score of the $B$ candidates. However, there are more $B$ candidates than $C$ candidates, so if the voter were to rank all the $B$ candidates below the $j$th position, he would necessarily raise the score of one of $A_{i+1},\dots,A_{2i}$ to $\ceil{n/2}+1$. That candidate would then win by score, and he is even worse for the manipulator than $B_1$.
Likewise, a voter of type 2 would rather see one of $A_{i+1},\dots, A_{2i}$ win. He can attempt to rank all the $B$ candidates below $j$, but then one of $A_1,\dots,A_i$ will get $\floor{n/2}+1\geq\ceil{n/2}$ points and win the election (possibly by tie-breaking).
Case two: $m< i+j$.
In the profile below we have $i$ $C$ candidates, $j-i$ $B$ candidates, and $m-j$ $A$ candidates. Since $m<i+j$, $m-j<i$, so the voters of type 1 can rank all the $A$ candidates in the top $i$ positions, as well as at least one $B$ candidate.
\[
\begin{array}{|c|c|c|c|}
\hline
n-1\text{ voters of type 1} & \overbrace{B_1\dots B_{i-(m-j)}}^{\geq1}\overbrace{A_{1} \ldots A_{m-j}}^{\geq1}&\text{any order} &\text{any order} \\
\hline
1\text{ voter of type 2} & C_{1} \dots C_{i}& B_{1} \ldots B_{j-i} & A_{1}\dots A_{m-j}\\
\hline
\end{array}
\]
Under $\alpha_i$, the winner is $A_1$. The voter of type 2 can manipulate by ranking $B_1$ first.
Under $\alpha_j$, the winner is $B_1$ (either by score, or winning a tie against a $C$ candidate). The voters of type 1 get their best choice elected. The voter of type 2 would rather see a $C$ candidate win, but to do so he would have to lower the score of the $B$ candidates. If he ranks any $B$ candidate below the $j$th position, he would have to rank one of the $A$ candidate above -- that candidate would then win the election with $n$ points, and the outcome would be worse than $B_1$.
\end{proof}
\begin{corollary}\label{lem:amsmall}
For all $n, m < 2j$: $\alpha_{j} \ngeq_{\mathcal{PS}} \alpha_{i}$.
\end{corollary}
\begin{proof}
\autoref{lem:aione} and \autoref{lem:ammiddle}.
\end{proof}
\begin{theorem}\label{thm:approval}
For all $n, m$: $\alpha_{i} \times_{PS} \alpha_{j}$.
\end{theorem}
\begin{proof}
By \autoref{lemLaij}, $\alpha_i\ngeq_{\mathcal{PS}}\alpha_j$. By \autoref{lem:ambig} and \autoref{lem:amsmall}, $\alpha_j\ngeq_{\mathcal{PS}}\alpha_i$.
\end{proof}
\section{The $k$-Borda Family}
As before, we fix $i<j$. In this section we will show that for $n=2,j\neq m-1$, $\beta_j>_{\mathcal{PS}}\beta_i$ (\autoref{cor:main}), but in all other cases the rules are incomparable (\autoref{thm:bordainc}, \autoref{cor:betaibetaj}, \autoref{prop:betakborda}).
We make use of a standard result about the manipulability of scoring rules:
\begin{lemma}\label{lem:normalform}
Consider a profile $P$, and scoring rule $f$. Let $w$ be the winner under sincere voting, $f(P)=w$. Call all the candidates voter $i$ perceives to be at least as bad as $w$ (including $w$) the bad candidates. The others, the good candidates. Order the good candidates $g_1,\dots, g_q$ and the bad candidates $b_1,\dots,b_r$ from the highest to the lowest scoring in $P_{-i}$. In case of equal scores, order candidates by their order in the tie-breaking. We claim that if $i$ can manipulate $f$ at $P$, he can manipulate with the following vote:
$$P_i^*=g_1\succ\dots\succ g_q\succ b_r\succ\dots\succ b_1.$$
\end{lemma}
\begin{proof}
Let $\text{score}(c,P)$ be the score of candidate $c$ at profile $P$. Suppose voter $i$ can manipulate at $P$. That is, there is a $P_i'$ such that $f(P_i',P_{-i})=g_j$. In order to be the winner, $g_j$ must have the highest score.
\begin{equation}\label{eqngiwins}
\text{score} (g_j, P_{i}', P_{-i}) \geq \max_{c\neq g_j}(\text{score} ( c, P_{i}', P_{-i})).
\end{equation}
Observe that $\text{score} (g_j, P_{i}', P_{-i})=\text{score} (g_j, P_{-i})+s_k$, where $k$ is the position in which $g_j$ is ranked in $P_i'$. By ranking $g_1$ first in $P_i^*$ it follows that $\text{score} (g_1, P_{i}^{*}, P_{-i})=\text{score} (g_1, P_{-i})+s_1$, and observe that $\text{score} (g_1, P_{-i})\geq \text{score} (g_j, P_{-i})$, and $s_1\geq s_k$. Thus:
\begin{equation}\label{eqng1hasmore}
\text{score} ( g_1, P_{i}^{*}, P_{-i})\geq \text{score} (g_j, P_{i}', P_{-i}).
\end{equation}
We now claim that the score of the highest scoring bad candidate in $(P_i',P_{-i})$ is no higher than in $(P_i^*,P_{-i})$. For contradiction, suppose that $b_p$ is the highest scoring bad candidate in $(P_i^*,P_{-i})$, and his score is higher than any bad candidate in $(P_i',P_{-i})$. Observe that $\text{score} ( b_p, P_{i}^{*}, P_{-i}) = \text{score} ( b_p, P_{-i}) + s_{m-p+1}$. Since $\text{score} ( b_1, P_{-i}),\dots, \text{score} ( b_p, P_{-i})\geq \text{score} ( b_p, P_{-i})$, this means that bad candidates $b_1,\dots,b_p$ must all get strictly less than $s_{m-p+1}$ points in $P_i'$. However there are $p$ such candidates, and only $p-1$ positions below $m-p+1$.
Since the highest scoring candidate in $(P_i',P_{-i})$ has at least as many points as the highest scoring bad candidate, it follows that:
\begin{equation}\label{eqnbjhasless}
\max_{c\neq g_j}(\text{score} ( c, P_{i}', P_{-i}))\geq \max_{b\in\set{b_1,\dots,b_r}}(\text{score} ( b, P_{i}^{*}, P_{-i})).
\end{equation}
Combining \ref{eqngiwins}, \ref{eqng1hasmore}, and \ref{eqnbjhasless}, we conclude that $g_1$ is among the highest scoring candidates in $(P_i^*,P_{-i})$. If at least one of the inequalities is strict, $g_1$ has more points than any bad candidate and we are done.
Suppose then that all the inequalities are equal. Observe that this implies that if $g_1\neq g_j$, then $g_1$ must come before $g_j$ in the tie-breaking order. To see this, observe that if we assume $\text{score} ( g_1, P_{i}^{*}, P_{-i})= \text{score} (g_j, P_{i}', P_{-i})$, then it follows that $\text{score} ( g_1, P_{-i}) + s_1= \text{score} (g_j, P_{-i}) + s_k$, where $k$ is the position in which $g_j$ is ranked in $P_i'$. Since $\text{score} (g_1, P_{-i})\geq \text{score} (g_j, P_{-i})$, and $s_1\geq s_k$, the only way this is possible is if $\text{score} (g_1, P_{-i})= \text{score} (g_j, P_{-i})$. By definition, in the case of equal scores in $P_{-i}$, the candidate that is labelled $g_1$ must have priority in the tie-breaking.
If $g_1$ also wins the tie against any bad candidate, we are done. For contradiction, suppose a bad candidate $b_p$ wins the tie given $P_i^*$. This means that $b_p$ beats $g_1$ and $g_j$ in the tie-breaking. Observe that $b_p$ is ranked in position ${m-p+1}$ in $P_i^*$. Since $b_p$ loses in $(P_i',P_{-i})$, $b_p$ must have been ranked lower than ${m-p+1}$ in $P_i'$. This means $b_p$ was ranked lower than at least $m-p+1$ candidates. Since $m=q+r$, and there are $q$ candidates, this means $b_p$ was ranked lower than at least $r-p+1$ bad candidates. In $P_i^*$, $b_p$ is ranked below exactly $r-p$ bad candidates, so there must exist a bad candidate that was ranked above $b_p$ in $P_i'$, but is ranked below $b_p$ in $P_i^*$. Call this candidate $b_t$. By definition of $P_i^*$, it must be the case that $\text{score}(b_t,P_{-i}) >\text{score}(b_p,P_{-i})$ or $\text{score}(b_t,P_{-i}) =\text{score}(b_p,P_{-i})$ and $b_t$ wins the tie. But that is impossible, because then $b_t$ would have gained at least as many points in $(P_i',P_{-i})$ as $b_p$ did in $(P_i*,P_{-i})$, and since the score of $b_p$ in $(P_i*,P_{-i})$ is equal to $g_1$, it means $b_t$ has at least as many points in $(P_i',P_{-i})$ as $g_j$, so wins either by points or by tie-breaking.
\end{proof}
\begin{lemma}\label{prop:2qij}
For $n=2q$, all $m$: $\beta_i\ngeq_{\mathcal{PS}}\beta_{j}$.
\end{lemma}
\begin{proof}
Consider a profile with one $A$ candidate, one $B$ candidate, and $m-2$ $C$ candidates:
\[
\begin{array}{|c|c|c|c|}
\hline
1\text{ voter of type 1} & A C_{1} \ldots C_{i-1}& C_{i} \dots C_{j-2} B& C_{j-1}\dots C_{m-2}\\
\hline
1\text{ voter of type 2} & B A C_{m-2} \ldots C_{m-i+1}& C_{m-i}\dots C_{m-j+1} & C_{m-j}\dots C_1\\
\hline
q-1\text{ voters of type 3} & A C_{1} \ldots C_{i-1} & C_i\dots C_{j-1} & C_{j-2}\dots C_{m-2}B\\
\hline
q-1\text{ voter of type 4} & B C_{m-2} \ldots C_{m-i}& C_{m-i-1}\dots C_{m-j} & C_{m-j-1}\dots C_1A\\
\hline
\end{array}
\]
Under $\beta_{j}$, $A$ has $qj+(j-1)$ points. $B$ has $qj+1$. $C_1$ is the highest scoring $C$ candidate with $q(j-1)$. The winner is $A$. However, the voter of type 2 can rank $A$ last and shift the $C$ candidates up one. This gives $A$ a score of $qj$, $B$'s score is still $qj+1$, and a $C$ candidate's is at most $q(j-1)+1$. $B$ wins a points victory.
Under $\beta_i$, $A$ has $qi +(i-1)=qi+i-1$ points. $B$ has $qi$. $C_1$ has $q(i-1)$, the other $C$ candidates no more. Voters of type 1 and three have no incentive to manipulate. The voter of type 2 would rather see $B$ win, but by \autoref{lem:normalform} this would mean ranking $A$ last, and $A$ would still have $qi$ points and win the tie. A voter of type 4 would rather see anyone win, and by \autoref{lem:normalform} this involves putting either $B$ or $C_1$ first. $B$ is already ranked first and does not win, and putting $C_1$ first would give $C_1$ $q(i-1)+i=qi-q+i$ points, which is less than $A$.
\end{proof}
\begin{lemma}\label{prop:oddij}
For $n=2q+1$, all $m$: $\beta_i\ngeq_{\mathcal{PS}}\beta_{j}$.
\end{lemma}
\begin{proof}
Consider a profile with one $A$ candidate, one $B$ candidate, and $m-2$ $C$ candidates:
\[
\begin{array}{|c|c|c|c|}
\hline
1\text{ voter of type 1} & BC_1\dots C_{i-1}&C_{i}\dots C_{j-2}A&C_{j-1}\dots C_{m-2}\\
\hline
q\text{ voters of type 2} &BAC_1\dots C_{i-2}&C_{i-1}\dots C_{j-2}&C_{j-1}\dots C_{m-2}\\
\hline
q\text{ voters of type 3} &AB C_{m-2}\dots C_{m-i+1}& C_{m-i}\dots C_{m-j+1}&C_{m-j}\dots C_1\\
\hline
\end{array}
\]
Under $\beta_i$, $A$ has $qi+q(i-1)=2qi-q$ points. $B$ has $(q+1)i+q(i-1)=2qi-q+i$. All the $C$ candidates are Pareto dominated by $B$, so the winner is $B$. A voter of type 3 would like to see $A$ win, but if he ranks $B$ last, $A$ will have $2qi-q$ points to $B$'s $2qi-q+i-(i-1)=2qi-q+1$, so $B$ would still win.
Under $\beta_j$, $A$ has $qj+q(j-1)+1=2qj-q+1$, $B$ has $(q+1)j+q(j-1)=2qj-q+j$. If a voter of type three ranks $B$ last and shifts the $C$ candidates up one, $B$ will have $2qj-q+j-(j-1)=2qj-q+1$, tying with $A$, and $A$ wins the tie. It remains to check that $A$ will have more points than the highest scoring $C$ candidate, which is clearly $C_1$. After the manipulation, $C_1$'s score will increase by at most one. $C_1$'s score before manipulation is $j-1+q(j-2)$, so $A$ will beat $C_1$ if:
\begin{align*}
2qj-q+1&\geq j + qj-2q,\\
qj-q&\geq j -1 -2q,\\
qj-j&\geq -1 -q,\\
(q-1)j&\geq -1 -q.
\end{align*}
Which is always satisfied.
\end{proof}
\begin{corollary}\label{cor:betaibetaj}
For all $n, m$: $\beta_i\ngeq_{\mathcal{PS}}\beta_{j}$.
\end{corollary}
\begin{proof}
\autoref{prop:2qij} and \autoref{prop:oddij}.
\end{proof}
\begin{lemma}\label{prop:betajibordaodd}
For $n=2q+1$, all $m$: $\beta_{j}\ngeq_{\mathcal{PS}} \beta_i$.
\end{lemma}
\begin{proof}
Consider the following profile:
\[
\begin{array}{|c|c|c|c|c|c|}
\hline
q\text{ voters of type 1} & ABC_{m-2}\dots C_{m-i+1}&C_{m-i}\dots C_{m-j+1}& C_{m-j}\dots C_1 \\
\hline
q-1\text{ voters of type 2} & BAC_1\dots C_{i-2}& C_{i-1}\dots C_{j-2}&C_{j-1}\dots C_{m-2} \\
\hline
1\text{ voters of type 3} & BC_1\dots C_{i-1}& C_i\dots C_{j-1}&C_j\dots C_{m-2} A\\
\hline
1\text{ voter of type 4} & C_1\dots C_i& B C_{i+1} \dots C_{j-1}&C_{j}\dots C_{m-2} A \\
\hline
\end{array}
\]
Under $\beta_i$, $A$ has $qi+(q-1)(i-1)=2qi-q-i+1$ points. $B$ has $qi+q(i-1)=2qi-q$. $C_1$ is clearly the highest scoring $C$ candidate, and has $i+(i-1)+(q-1)(i-2)=qi+i-2q+1$ points. If $i>1$, $B$ wins a points victory, but a voter of type 1 can rank $B$ last to force a tie, which $A$ will win. If $i=1$, then $A$ wins by tie-breaking, but the voter of type 4 can rank $B$ first to make $B$ the winner.
Under $\beta_j$, $A$ has $qj+(q-1)(j-1)$. $B$ has $qj+q(j-1)+(j-i)$. A voter of type 1 would like to manipulate in favour of $A$, but if he ranks $B$ last, $B$'s score will only drop by $j-1$, and $B$ will still win.
The voter of type 4 would rather see one of $C_1$ through $C_i$ win. Observe that an upper bound on the score a $C$ candidate can get from the voters of type 1 through 3 is $q(j-1)$ -- for $q-1$ voters of types 1 and 2, each time the first group gives the candidate $j-2-k$ points, the other gives at most $k$ points, for an upper bound of $(q-1)(j-2)$. The voter of type 3 ranks all $C$ candidates one position higher, so combined with the remaining voter of type 1 the contribution to the candidate's score is at most $j-1$, which gives a total of $(q-1)(j-2)+(j-1) <q(j-1)$. If the voter ranks $B$ last and the $C$ candidate first, $B$ will still have $qj+q(j-1)$ points to the $C$'s candidate $j+q(j-1)$, so $B$ will still win.
\end{proof}
\begin{lemma}\label{prop:betajiqbigbordaeven}
For $n=2q$, all $m$: if $q>2$, $\beta_{j}\ngeq_{\mathcal{PS}} \beta_i$.
\end{lemma}
\begin{proof}
Consider the following profile:
\[
\begin{array}{|c|c|c|c|c|c|}
\hline
q-1\text{ voters of type 1} & ABC_{m-2}\dots C_{m-i+1}& C_{m-i} \dots C_{m-j+1}& C_{m-j}\dots C_1 \\
\hline
q-2\text{ voters of type 2} & BA C_{1}\dots C_{i-2}& C_{i-1} \dots C_{j-2}& C_{j-1}\dots C_{m-2} \\
\hline
1\text{ voter of type 3} & BC_{1}\dots C_{i-1}& C_{i} \dots C_{j-1}& C_{j}\dots C_{m-2} A \\
\hline
1\text{ voter of type 4} & C_{1}\dots C_{i}&B C_{i+1} \dots C_{j-1}& C_{j}\dots C_{m-2} A \\
\hline
1\text{ voter of type 5} & C_{m-2}\dots C_{m-i-1}&B C_{m-i-2} \dots C_{m-j}& C_{m-j-1}\dots C_{1} A \\
\hline
\end{array}
\]
Case one: $m>3$, and hence $C_1\neq C_{m-2}$.
Under $\beta_i$, $A$ has $(q-1)i+(q-2)(i-1)$ points and $B$ has $(q-1)i+(q-1)(i-1)$. A $C$ candidate has at most $(q-2)(i-2)+(i-1)+(i+1)$ -- observe that if the candidate gets $i-2-k$ points from a voter of type 1, he gets at most $k$ from a voter of type 2, which gives us at most $(q-2)(i-2)$ from $q-2$ of each type of voter; the voter of type 3 gives one more point to the candidate, so paired with the remaining voter of type 1, the contribution is $i-1$; as for the voters of voters of type 4 and 5, if one gives the candidate $i-k$ points, the other gives at most $k+1$, for the remaining $(i+1)$.
Since $q>2$, $A$ and $B$ have more points than the $C$ candidates. If $i>1$, $B$ also beats $A$ by points, but a voter of type 1 can rank $B$ last and shift the $C$ candidates up one to force a tie between $A$ and $B$. This operation will raise the score of a $C$ candidate by at most 1, so such a candidate will at worst enter the tie, which $A$ wins. If $i=1$, $A$ wins by tie-breaking, but a voter of type 4 can rank $B$ first to give him one more point.
Under $\beta_j$, $A$ has $(q-1)j+(q-2)(j-1)$ points, $B$ has $(q-1)j+(q-1)(j-1)+2(j-i)$. $B$ has more points than $A$, and a voter of type 1 can no longer change this by ranking $B$ last.
A voter of type 4 would like to manipulate in favour of one of $C_1$ through $C_i$. As we have argued above, such a candidate would get no more than $(q-2)(j-2)+(j-1)$ from voters of types 1 through 3, which we round up to $(q-1)(j-1)$. If the manipulator ranks this candidate first, he will get at most $2j$ from the voters of type $4,5$ for an upper bound of $2j+(q-1)(j-1)$. In comparison, $B$ gets $(q-1)j+(q-1)(j-1)$ from the voters of type 1 through 3. Since $q>2$, $B$ would still win. The argument for the voter of type 5 is analogous.
Case two: $m=3$. The same profile we had above collapses to the following:
\[
\begin{array}{|c|c|c|c|c|c|}
\hline
q-1\text{ voters of type 1} & A&B&C \\
\hline
q-2\text{ voters of type 2} & B&A& C\\
\hline
1\text{ voter of type 3} & B&C& A \\
\hline
1\text{ voter of type 4} & C&B& A \\
\hline
1\text{ voter of type 5} & C&B&A \\
\hline
\end{array}
\]
The argument with respect to $A$ and $B$ is unchanged. We need only verify that $C$ cannot win under $\beta_i$ or $\beta_j$.
Under $\beta_i$, $C$ has exactly 2 points. $A$ and $B$ are tied with $q-1$, and the voter of type 4 can only manipulate in favour of $B$ by ranking $B$ first.
Under $\beta_j$, $C$ has exactly 5 points. $B$ has at least 8, and a voter of type 4 or 5 can only lower $B$'s score by one point.
\end{proof}
\begin{lemma}\label{prop:betajiqbigbordafour}
For $n=4$, all $m$: $\beta_{j}\ngeq_{\mathcal{PS}} \beta_i$.
\end{lemma}
\begin{proof}
Case one: $i>1$.
\[
\begin{array}{|c|c|c|c|c|c|}
\hline
2\text{ voters of type 1} & BC_{m-2}\dots C_{m-i}& C_{m-i-1} \dots C_{m-j}& C_{m-j-1}\dots C_1A \\
\hline
1\text{ voter of type 2} & ABC_{1}\dots C_{i-2}& C_{i-1} \dots C_{j-2}& C_{j-1}\dots C_{m-2} \\
\hline
1\text{ voter of type 3} & AC_{1}\dots C_{i-1}& C_{i} \dots C_{j-2}B& C_{j-1}\dots C_{m-2} \\
\hline
\end{array}
\]
Under $\beta_i$, $B$ wins with $2+i-1$ points. The voter of type 2 can manipulate by ranking $B$ last.
Under $\beta_j$, $B$ wins with $3j$ points. If the voter of type 2 ranks $B$ last, $B$ will still have $2j+1$, beating $A$. The voter of type 3, likewise, cannot manipulate in favour of $A$, but could try to manipulate in favour of a $C$ candidate. If he ranks $B$ last and $C_{i-1}$ first, then $B$ will have a score of $3j-1$. We can bound $C_{i-1}$'s score by $j$ (from one voter of type 1 and type 2) $+j$ (the manipulator ranks $C_{i-1}$ first) $+x$ (the points from the remaining voter of type 1). In order for $C_{i-1}$ to win, we must have $2j+x > 3j-1$, which is clearly impossible.
Case two: $i=1$.
\[
\begin{array}{|c|c|c|c|c|c|}
\hline
2\text{ voters of type 1} & B&AC_{m-2} \dots C_{m-j+1}& C_{m-j}\dots C_1 \\
\hline
1\text{ voter of type 2} & A&C_{1}\dots C_{j-1}& C_{j-1}\dots C_{m-2}B \\
\hline
1\text{ voter of type 3} & C_{1}&AC_2\dots C_{j-1}& C_{j}\dots C_{m-2}B \\
\hline
\end{array}
\]
Under $\beta_1$, $B$ is the winner, but the voter of type 3 can manipulate in favour of $A$.
Under $\beta_j$, $A$ has $4j-3$ points to $B$'s $2j$. Since $j\geq 2$, $A$ is the winner. A voter of type 1 would rather see $B$ win, but even if he ranks $A$ last, $A$ will still have $3j-2\geq 2j$ points. A voter of type 3 would rather see $C_1$ win, but $C_1$ has $2j-1$ points, so would lose to $B$ no matter what the voter does.
\end{proof}
\begin{corollary}\label{corbetaji}
For $n>2$, all $m$: $\beta_{j}\ngeq_{\mathcal{PS}} \beta_i$.
\end{corollary}
\begin{proof}
\autoref{prop:betajibordaodd}, \autoref{prop:betajiqbigbordaeven}, and \autoref{prop:betajiqbigbordafour}.
\end{proof}
\begin{theorem}\label{thm:bordainc}
For $n>2$, all $m$: $\beta_i\times_{\mathcal{PS}}\beta_j$.
\end{theorem}
\begin{proof}
\autoref{cor:betaibetaj} and \autoref{corbetaji}.
\end{proof}
Thus far the story resembles that of $k$-approval. However, in the case of $n=2$, a hierarchy of manipulability is observed:
\begin{theorem}\label{thm:bordan2}
For $n=2$, $m>k+2$: $\beta_{k+1} \geq_{\mathcal{PS}} \beta_{k}$.
\end{theorem}
\begin{proof}
Let voter 1's preferences be $c_1\succ_1\dots\succ_1c_m$ and voter 2's $b_1\succ_2\dots\succ_2b_m$. Note that $c_1\neq b_1$, else manipulation would not be possible.
Let $\beta_k(P_1,P_2)=d$ and $\beta_{k+1}(P_1,P_2)=e$. We consider whether or not $d=e$ by cases.
Case one: $d=e$.
Assume voter 1 can manipulate $\beta_k$ in favour of $c_q\succ_1 d$. By \autoref{lem:normalform}, this means $c_q$ is the winner in the following profile:
\[
\begin{array}{|c|c|c|c|}
\hline
P_1^* & c_q b_{m}\dots b_{m-k+1}&b_{m-k} &b_{m-k-1}\dots b_1 \\
\hline
P_2 & b_1 \ldots b_k& b_{k+1} & b_{k+1}\dots b_m \\
\hline
\end{array}
\]
Let us consider who the winner must be under $\beta_{k+1}(P_1^*,P_2)$. Observe that the score of a candidate under $\beta_{k+1}$ is at most two points higher than under $\beta_k$ -- it will increase by one point for each voter who ranks the candidate in the top $k+1$ positions.
If $c_q$'s points increase by 2 points then we are done -- whenever $c_q$ has more points than $f$ under $\beta_k$, $c_q$ still has more points under $\beta_{k+1}$; and if $c_q$ is tied with $f$ under $\beta_k$ then that must mean $c_q$ beats $f$ in the tie, under $\beta_{k+1}$ $c_q$ will either tie with $f$ and win the tie, or have more points outright. Thus voter 1 can manipulate in favour of $c_q\succ_1 d$.
If $c_q$'s points increase by 1, then that must mean that voter 2 does not rank $c_q$ in the top $k+1$ positions, and a fortiori in the top $k$ positions. Thus under $\beta_k(P_1^*,P_2)$ $c_q$ has $k$ points, $b_1$ has $k$ points, and the other candidates strictly less. Under $\beta_{k+1}$ $c_q$ and $b_1$ will still tie at $k+1$, and, since $m>k+2$, the other candidates will still have strictly less.
Case two: $d\neq e$.
As we have argued before, the score of a candidate can increase by at most two points when going from $\beta_k$ to $\beta_{k+1}$. Since $d$ wins under $\beta_k$ but $e$ wins under $\beta_{k+1}$, this means that $e$'s score must increase by 2 and $d$'s by 1. This means that one voter does not rank $d$ in the top $k+1$ positions, and, since $d$ must still win under $\beta_k$, this means the other voter must rank $d$ first (at least one candidate will have a score of $k$, so the winner's score must be at least $k$). Since voter 1 is the one with an incentive to manipulate, this means the sincere profile must be the following:
\[
\begin{array}{|c|c|c|c|}
\hline
\text{Voter }1 & c_1 \ldots c_{i-1} e c_{i+1} \dots c_m \\
\hline
\text{Voter }2 & d b_2 \ldots b_{j-1} eb_{j+1} \dots b_m \\
\hline
\end{array}
\]
Under $\beta_k$ $d$ either has one point more than $e$, or they are tied and $d$ wins the tie. Under $\beta_{k+1}$ $e$ wins, which means $d$'s score increases by 1 and $e$'s by two -- thus $d$ cannot be in the top $k+1$ positions of voter 1. But this means in the sincere profile both $d$ and $c_1$ have $k$ points under $\beta_k$, and $d$ wins the tie. Voter 2 can thus manipulate $\beta_{k+1}$ as follows:
\[
\begin{array}{|c|c|c|c|}
\hline
\text{Voter }1 & c_1 \ldots c_{i-1} e c_{i+1} \dots c_m \\
\hline
\text{Voter }2 & d c_m \dots c_1 \\
\hline
\end{array}
\]
Both $d$ and $c_1$ have $k+1$ points, since $m>k+2$ the other candidates have strictly less, and $d$ wins the tie.
\end{proof}
\begin{corollary}\label{cor:main}
For $n=2$, $k<m-2$: $\beta_{j}>_{\mathcal{PS}}\beta_i$.
\end{corollary}
\begin{proof}
Transitivity of $\geq_{\mathcal{PS}}$, \autoref{thm:bordan2}, and \autoref{cor:betaibetaj}.
\end{proof}
To finish, we observe that the proviso that $m>k+2$ really is necessary -- the Borda rule proper ($\beta_{m-1}$) is incomparable with $\beta_k$.
\begin{proposition}\label{prop:betakborda}
For $n=2$, all $m$: $\beta_{m-1}\ngeq_{\mathcal{PS}} \beta_k$.
\end{proposition}
\begin{proof}
Consider the following profile, with a $B$ candidate, a $C$ candidate, and $m-2$ $A$ candidates:
\[
\begin{array}{|c|c|c|c|}
\hline
\text{Voter }1 & B C A_{1}\dots A_{k-2}&A_{k-1} \dots A_{m-2}\\
\hline
\text{Voter }2 & C A_1 \dots A_{k-1}&A_{k}\dots A_{m-2} B\\
\hline
\end{array}
\]
Under $\beta_k$, if $k>1$ then $C$ is the winner with $2k-1$ points. Voter one can manipulate by voting $B\succ A_m\succ\dots\succ A_1\succ C$. This way $B$ will have $k$ points, and the other candidates strictly less. If $k=1$ then $B$ is the winner by tie-breaking. Voter 2 can manipulate by voting for $A_1$.
Under $\beta_{m-1}$, $C$ is the winner. Voter 2 has no incentive to manipulate, voter 1 would rather see $B$ win. By \autoref{lem:normalform}, if this is possible then it is possible in the following profile:
\[
\begin{array}{|c|c|c|c|}
\hline
\text{Voter }1 & B A_{m-2} \dots A_1 C \\
\hline
\text{Voter }2 & C A_1 \dots A_{m-2} B \\
\hline
\end{array}
\]
However, in this profile all candidates are tied with $m-1$ points, and $A_1$ wins the tie, which is worse than $C$ for the manipulator.
\end{proof}
\section{Conclusion}
In this paper we have shown:
\begin{enumerate}
\item For any choice of $n,m$: $\alpha_i\ngeq_{\mathcal{PS}}\alpha_j$;
\item For $n=2,i<j,j\neq m=1$: $\beta_j>_{\mathcal{PS}}\beta_i$;
\item In every other instance, $\beta_i\ngeq_{\mathcal{PS}}\beta_j$.
\end{enumerate}
These results are negative in nature. Even in the case of two natural, hierarchical families of scoring rules, the notion of Pathak and S\"onmez fails to make a meaningful distinction between their manipulability. The quest for a useful framework for comparing the manipulability of voting rules continues.
| {'timestamp': '2022-03-30T02:32:50', 'yymm': '2203', 'arxiv_id': '2203.15494', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15494'} | arxiv |
\section{Introduction}
\vspace{-1mm}
Video frame interpolation (VFI) aims at predicting one or more intermediate frames from a given frame sequence. Given inputs $\langle x_t$, $x_{t+n}\rangle$, where $n$ is the frame gap between the inputs, existing VFI works generally follow two steps. First, they estimate the motion between $x_t$ and $x_{t+n}$ using off-the-shelf motion estimation modules or by imposing motion constraints. Then, they warp the inputs to the target time and synthesize an intermediate frame.
VFI works target temporal super-resolution on a premise that the frame rate of the input sequence is often already sufficiently high. We have experimentally verified this notion by evaluating several state-of-the-art VFI methods~\cite{niklaus2017video2,slomo,dain2019,Lee_2020_CVPR,gui2020featureflow} on input sequences sampled at different frame rates. Even though a reasonable performance decrease is an expected phenomenon, we observed a significant drop in performance when the frame rate of the input sequence decreases (see \Tref{tbl:temp_vfi}), highlighting that interpolating frames becomes very challenging as the temporal distance between consecutive frames increases. Moreover, far less attention has been given to this problem in past literature as most evaluations have been done on videos with fixed frame rate (mostly 30 fps). We argue that the main reason behind this limitation is partly associated with the working principle of VFI works. If the estimated motion between inputs is inaccurate, then the interpolated frame synthesized by time warping the inputs with the estimated motion will also likely be inaccurate. This is particularly problematic when the temporal gap between input frames is large as existing flow or kernel based motion estimation modules can not effectively handle large motions.
In this work, we tackle the long-term video interpolation problem and propose a general VFI framework robust to relatively low frame rates. Specifically, when there is a large gap between input frames, instead of predicting the motion between the inputs which will likely be imprecise and eventually lead to inaccurate interpolation, we conjecture that we can safely propagate from one side of the input to a reliable extent of time using the other input as a useful reference, \emph{i.e. } given $\langle x_t$, $x_{t+n}\rangle$, we propagate up to $x_{t+\Delta t}$ from the side of the first input $x_t$ and we similarly propagate up to $x_{t+n-\Delta t}$ from the side of the second input $x_{t+n}$, where $\Delta t$ is the extent of propagation. This is intuitive because the intermediate frames in the neighborhood of $x_t$ will most likely depend on $x_t$ compared to $x_{t+n}$, and vice versa. Once we propagate to a reliable time frame from both sides, the rest of the intermediate frames between $x_{t+\Delta t}$ and $x_{t+n-\Delta t}$ can be interpolated using existing interpolation approaches as the temporal gap is now reduced to $n-2\Delta t$.
To this end, we propose a propagation network (\textsf{PNet}) that predicts future frames by relying more on one of the inputs while attending the other. We accomplish this by extending the classic feature-to-feature (F2F) forecasting \cite{vondrick2016anticipating,couprie2018joint,vora2018future,chiu2020segmenting,vsaric2019single,saric2020warp} with a novel motion-to-feature (M2F) approach, where we introduce optical flow as another modality to guide the propagation of features and to enforce temporal consistency between the propagated features. Unlike feature supervision which makes a network more dependent on the semantics of input frames, our motion supervision allows the network to focus on the motion between inputs and ensures features are propagated accordingly irrespective of the contents of the images. Moreover, while most F2F works focus on predicting task-specific outputs such as segmentation maps, we perform RGB forecasting by designing a frame synthesis network that reconstructs frames from the propagated features in a coarse-to-fine manner.
We experimentally show that the proposed \textsf{PNet} can be used as a plug in module to make existing state-of-the-art VFI approaches \cite{niklaus2017video2,slomo,dain2019,Lee_2020_CVPR,gui2020featureflow} robust particularly when there is a considerable temporal gap between inputs. To be thorough, we adopt a light version of SloMo \cite{slomo} along with \textsf{PNet} as our full model and devise a simple, yet effective, procedure to successfully train the full model in an end-to-end manner. We comprehensively analyze our work and previous methods on several widely used datasets \cite{su2017deep,Nah_2017_CVPR,galoogahi2017need} and confirm the favorability of our approach. Moreover, we carry out ablation experiments to shed light on the network design and loss function choices.
\section{Related Works}
\label{sec:related_works}
\vspace{-1mm}
\paragraph{Video Frame Interpolation.} Early conventional methods~\cite{zitnick2004high,mahajan2009moving} relied on the optical flow between inputs and the given image formation model for synthesizing intermediate frames. Recently, several deep network based VFI approaches have been proposed. While some works \cite{long2016learning,choi2020channel} directly predict intermediate frames, most existing approaches embed motion estimation modules in their framework. According to the type of the motion estimation module used, VFI works can be broadly categorized as: phase-based, kernel-based, flow-based and a mix of the last two. Early phase-based works~\cite{meyer2015phase,meyer2018phasenet} formulated the temporal change between the inputs as phase shifts. On the other hand, kernel-based methods such as AdaConv~\cite{niklaus2017video1} and SepConv~\cite{niklaus2017video2} estimate spatially adaptive 2D and 1D kernels, respectively. Meanwhile, due to the significant progress achieved in optical flow estimation research, flow-based interpolation approaches~\cite{slomo,liu2017video,reda2019unsupervised,son2020aim,xue2019video,niklaus2018context,park2020bmbc,Peleg_2019_CVPR,yuan2019zoom,niklaus2020softmax} have grown to be popular. DVF \cite{liu2017video} and SloMo \cite{slomo} estimated flows between input frames and directly warped them to the target intermediate time while~\cite{xue2019video,niklaus2018context,park2020bmbc,niklaus2020softmax} used a trainable frame synthesis network on the warped frames to predict the intermediate frame.
DAIN~\cite{dain2019} and MEMC-Net~\cite{bao2019memc} combined kernel-based and flow-based models. AdaCoF~\cite{Lee_2020_CVPR} proposed a generalized warping module via adaptive collaboration of flows for VFI. Recently, several works~\cite{reda2019unsupervised, Peleg_2019_CVPR,choi2020scene,xu2019quadratic,chi2020all,zhangflexible,gui2020featureflow,shen2020blurry,argaw2021motion} have focused on addressing the different limitations of the VFI approaches discussed thus far. However, most existing works assume that the input sequence frame rate is often already sufficiently high, hence, long-term VFI has received far less attention in the past literature. Our work tackles this problem by proposing a novel framework that combines frame propagation and interpolation.
\vspace{-3mm}
\paragraph{Feature Propagation.} Feature-to-feature (F2F) forecasting inputs intermediate features of the past frames and anticipates their future counter parts. This approach have been previously used for action recognition \cite{vondrick2016anticipating}, instance segmentation \cite{couprie2018joint,luc2018predicting,sun2019predicting} and semantic segmentation \cite{vora2018future,chiu2020segmenting,vsaric2019single,saric2020warp} tasks. Recently, \v{S}ari\'{c} \emph{et al. } \cite{saric2020warp} proposed a feature-to-motion (F2M) module to compliment the classic F2F approach. Previous F2F or F2F + F2M based works use the encoder part of task-oriented pretrained models (\emph{e.g.}~semantic segmentation) to extract intermediate features of a set of inputs and use the extracted features to forecast features of future frame. The forecasting module is trained by optimizing the loss between the forecasted features and the extracted features of the future frame (see \Fref{fig:framework}a). During inference, the task-specific output (\emph{e.g.}~segmentation map) is obtained by feeding the forecasted feature into the decoder part of the pretrained model.
In this work, we extend feature-level propagation to a relatively unexplored task, \emph{i.e. } long-term VFI, by presenting a novel motion-to-feature (M2F) approach. Our approach is different from previous feature-level propagation methods in the following aspects. First, we introduce motion (in the form of optical flow) as another modality to guide the forecasting of features and to enforce temporal consistency between forecasted features. Second, we perform RGB forecasting by designing a frame synthesis network that outputs future frames from forecasted features. The proposed formulation is summarized in \Fref{fig:framework}b.
\begin{figure}[!t]
\centering
\includegraphics[width=1.0\linewidth,trim={21.8cm 18.9cm 28.3cm 11.7cm},clip]{fgai_fig1_edit.pdf}
\vspace{-5mm}
\caption{(a) Overview of previous feature-level propagation formulation, (b) Proposed problem formulation.}
\label{fig:framework}
\vspace{-5mm}
\end{figure}
\begin{figure*}[!t]
\centering
\includegraphics[width=1.0\linewidth,trim={3.9cm 2.8cm 6.9cm 6.65cm},clip]{fgai_cvpr_model2_edit.pdf}
\vspace{-6mm}
\caption{Overview of the proposed propagation-interpolation network (\textsf{P-INet)}. The propagation network (\textsf{PNet}) consists of an encoder network for feature extraction, \textsf{M2FNet} to bidirectionally propagate features using the encoded features as anchor and reference features, \textsf{FFNet} to estimate optical flow between features for motion supervision, and a frame decoder to reconstruct frames from propagated features. An interpolation network (\textsf{INet}) is used to interpolate the intermediate frames between the end propagated frames.}
\vspace{-5.5mm}
\label{fig:model_new}
\end{figure*}
\section{Methodology}
\label{sec:methodology}
Given a pair of consecutive frames $\langle x_t,x_{t+n}\rangle$ from a low-frame-rate video, we aim to generate a high quality, high-frame-rate sequence $\{x_t, x_{t+1}, \ldots, x_{t+n-1}, x_{t+n}\}$ by jointly optimizing interlinked propagation and interpolation networks in an end-to-end manner. The overview of our proposed framework is shown in \Fref{fig:model_new}.
\subsection{Propagation Network (\textsf{\textbf{PNet}})}
\label{sec:pnet}
\vspace{-0.5mm}
We use an encoder-decoder architecture for \textsf{PNet}. First, we design an encoder network ${\mathcal{E}}$ to extract features from the input frames $\langle x_t,x_{t+n}\rangle$ in a top-down manner (\Eref{eq: encode}). The encoder is a feed-forward network with 5 convolutional blocks, each block containing 2 layers of convolution with kernel size $3 \times 3$. Except for the first block, features are downsampled to half of their spatial size and the number of channels is doubled after each convolutional block.
\begin{equation}
\big\{u_t^l\big\}_{l=1}^{k} = {\mathcal{E}} (x_t)\hspace{4mm}\big\{u_{t+n}^l\big\}_{l=1}^{k} = {\mathcal{E}} (x_{t+n})
\label{eq: encode}
\end{equation}
where $l$ denotes a level in the feature pyramid with a total of $k$ levels ($k = 5$ in our experiments) and $u_t^l$ denotes an encoded feature of the first input $x_t$ at level $l$. To propagate to the frame $x_{t + \Delta t}$ (from $x_t$ side), we first perform feature-level forecasting using the encoded features of $x_t$ and $x_{t+n}$, \emph{i.e. } $\{u_t^1, \ldots, u_t^k\}$ and $\{u_{t+n}^1, \ldots, u_{t+n}^k\}$, as \textit{anchor} and \textit{reference} features, respectively. We then use a decoder network to reconstruct $x_{t + \Delta t}$ from the propagated features in a bottom-up manner.
\vspace{-3.4mm}
\paragraph{Motion-to-Feature Forecasting.} We design a motion-to-feature network (\textsf{M2FNet}) to forecast the future counterparts of the encoded features. \textsf{M2FNet} takes the anchor and reference features as inputs and anticipates the motion to propagate the anchor feature to its future counterparts. Then, it transforms the anchor feature according to the estimated motion. To take the complex motion dynamics between the input frames into account and better exploit the inter-frame spatio-temporal correlation, we propagate to multiple frames simultaneously. \textsf{M2FNet} has 2 components: global (${\mathcal{D}}_G$) and local (${\mathcal{D}}_L$) motion decoders. ${\mathcal{D}}_G$ learns the global motion between the encoded features, and predicts affine transformation parameters $\theta_{[R|T]}$ to spatially transform the anchor feature to its future counterparts (see \Eref{eqn:global1} and \Eref{eqn:global2}). We use spatial transformer network~\cite{jaderberg2015spatial} for for ${\mathcal{D}}_G$.
\vspace{-1.5mm}
\begin{equation}
\big\{\theta_{[R_{t+i}|T_{t+i}]}\big\}_{i=1}^{m} = {\mathcal{D}}^l_{G}\big(u_t^l~||~u^l_{t+n}\big)
\label{eqn:global1}
\vspace{-3mm}
\end{equation}
\vspace{-3mm}
\begin{equation}
\big\{\hat{u}^l_{t+i}\big\}_{i=1}^{m} = \textsf{transform}\ \big(u_t^l,\ \big\{\theta_{[R_{t+i}|T_{t+i}]}\big\}_{i=1}^{m}\big)
\label{eqn:global2}
\end{equation}
where $||$ denotes channel-wise concatenation, $m$ refers to the number of features (frames) propagated from the anchor feature $u_t$ and $\hat{u}^l_{t+i}$ represents the output of ${\mathcal{D}}_G$ at time step $t+i$ and feature level $l$. As ${\mathcal{D}}_G$ is limited to learning only non-local motion, in order to capture the locally varying motion, we further refine the outputs of ${\mathcal{D}}_G$ with a local motion decoder (${\mathcal{D}}_L$). ${\mathcal{D}}_L$ inputs the globally transformed feature $\hat{u}_{t+i}$ along with the anchor and reference features, and outputs the forecasted feature $u_{t+i}$ (see \Eref{eqn:local}). ${\mathcal{D}}_L$ has 3 densely connected convolutional layers \cite{huang2017densely} each with kernel size $3 \times 3$ and stride $1$. As the forecasted feature $u_{t+i}$ is decoded in a coarse-to-fine manner, a residual connection is built by feeding the the upsampled decoded feature from previous feature level $l+1$ into ${\mathcal{D}}_L$ as shown in \Eref{eqn:local}. A deconvolution layer of kernel size $4 \times 4$ and stride size $2$ is used to upsample ($\times 2$) features.
\begin{equation}
u_{t+i}^l= {\mathcal{D}}^l_L \big(\hat{u}^l_{t+i}~||~u_t^l~||~u_{t+n}^l~||~\textsf{up}.(u_{t+i}^{l+1})\big)
\label{eqn:local}
\vspace{-1mm}
\end{equation}
where $i = \{1,\ldots,m\}$, \textsf{up}. stands for upsampling and $u^l_{t+i}$ is the forecasted feature at level $l$. In principle, ${\mathcal{D}}_L$ can decode both local and global motions. However, explicitly modelling global motions with ${\mathcal{D}}_G$ is shown to be effective for the task at hand (see \Sref{sec:ablation}).
\begin{figure}[!t]
\centering
\includegraphics[width=1.0\linewidth,trim={20.3cm 23.9cm 33.1cm 7.8cm},clip]{fgai_flow.pdf}
\vspace{-5.5mm}
\caption{Optical flow estimation pattern when propagating to $m$ future counterparts.}
\vspace{-6.3mm}
\label{fig:flow_pattern}
\end{figure}
\vspace{-2.5mm}
\paragraph{Optical Flow Estimation.} \textsf{M2FNet} learns to propagate features via motion supervision. For instance, to ensure that the forecasted feature $u_{t+i}$ can be reconstructed to $x_{t+i}$, we constrain the endpoint error between the flows $f_{x_{t+i} \rightarrow x_t}$ and $\hat{f}_{u_{t+i} \rightarrow u_t}$, which are computed between frames $\langle x_t,x_{t+i}\rangle$ and features $\langle u_t,u_{t+i}\rangle$, respectively. As the ground truth flow $f_{x_{t+i} \rightarrow x_{t}}$ does not exist for real high-speed videos, we generate a pseudo-ground truth flow using pretrained state-of-the-art optical flow models~\cite{IMKDB17,Sun2018PWC-Net}. To estimate the flow $\hat{f}_{u_{t+i} \rightarrow u_t}$, we design a feature flow network (\textsf{FFNet}) which inputs two sets of features, \emph{i.e. }~$\big\{u_{t+i}^l\big\}_{l=1}^{k}$ and $\big\{u_{t}^l\big\}_{l=1}^{k}$, and regresses a flow in a coarse-to-fine manner. We use the architecture of the optical flow estimator in PWC-Net\cite{Sun2018PWC-Net} for \textsf{FFNet}. To predict the flow between the anchor feature $u_t$ and a forecasted feature $u_{t+i}$, we preform the following steps. First, at each level $l$, we backwarp the second feature $u_{t}^l$ (to the first feature $u_{t+i}^l$) with $\times 2$ upsampled flow from previous level $l+1$ (see \Eref{eqn:warp}). A correlation layer \cite{fischer2015flownet,Sun2018PWC-Net,hui2018liteflownet} is then used to compute the cost volume between the first feature $u_{t+i}^l$ and the backwarped feature $w_{t+i}^l$. The first feature, the cost volume and the upscaled flow are feed into \textsf{FFNet} to predict a flow as shown in \Eref{eqn:decode_flow}.
\begin{equation}
w_{t+i}^l = \textsf{backwarp}\big(u_{t}^l, \textsf{up}.(\hat{f}^{l+1}_{{t+i}\rightarrow t})\big)
\label{eqn:warp}
\vspace{-4mm}
\end{equation}
\begin{equation}
\hat{f}_{{t+i}\rightarrow t}^l = \textsf{FFNet} \big(u_{t+i}^l \oplus \textsf{corr}.(u_{t+i}^l,w_{t+i}^l) \oplus \textsf{up}.(\hat{f}^{l+1}_{{t+i}\rightarrow t})\big)
\label{eqn:decode_flow}
\end{equation}
\Fref{fig:flow_pattern} depicts the flow estimation pattern when propagating to $m$ future counterparts of the anchor feature $u_t$. We compute several optical flows to ensure that features are propagated by anticipating the complex motion between the input frames and not simply in a linear manner. Specifically, we estimate the flow between the anchor feature and each forecasted feature (shown in \textcolor{red} {red} in \Fref{fig:flow_pattern}) so that \textsf{M2FNet} learns to forecast features according to their proximity to the anchor feature \emph{i.e. }~${\mathcal{D}}_G$ and ${\mathcal{D}}_L$ decode smaller motions for features close to the anchor feature and larger motions for those further away. We also estimate flow between the forecasted features themselves (depicted in \textcolor{green} {green}) in order to account for inter-frame motion between propagated features. To address any potential ambiguity in the direction of propagation, we compute the flow between the last forecasted feature and the reference feature (shown in \textcolor{blue} {blue}).
\vspace{-2.5mm}
\paragraph{Feature-to-Frame Decoding.} The forecasted features and optical flows are then used to decode frames. For this purpose, we design a frame decoder (${\mathcal{D}}_F$) which regresses frames from the corresponding forecasted features. When decoding the current frame, ${\mathcal{D}}_F$ incorporates contextual and temporal information from the past frames via attention mechanism (see \Fref{fig:frame_synthesis}). This is accomplished by warping the past features into the current time step with the corresponding estimated optical flows and combining the warped features using attention weights as shown in \Eref{eqn:attend}. The attention vector ($\alpha$) is a learnable, one-dimensional weight parameter with elements initially set to 1. For better reconstruction of occluded regions in the predicted frames, ${\mathcal{D}}_F$ also uses the anchor and reference features. Like the feature forecasting and flow estimation steps, frames are decoded in a coarse-to-fine manner. At each feature level $l$, ${\mathcal{D}}_F$ inputs the forecasted feature ($u_{t+i}^l$), attended past features ($v_{t+i}^l$), encoded features ($u_t^l$ and $u_{t+n}^l$) and $\times 2$ upscaled frame predicted from previous level $l+1$ (see \Eref{eqn:decode_frame}). ${\mathcal{D}}_F$ is composed of 3 densely connected convolutional layers each with kernel size $3 \times 3$ and stride $1$, where the last layer outputs a frame.
\vspace{-1.2mm}
\begin{equation}
{v}_{t+i}^l = \sum_{j=t}^{t+i-1}{\alpha_j . \textsf{backwarp}(u^l_j, \hat{f}^l_{{t+i}\rightarrow j})}
\label{eqn:attend}
\end{equation}
\vspace{-3mm}
\begin{equation}
\hat{x}^l_{t+i} = {\mathcal{D}}^l_F\big(u_{t+i}^l~||~v_{t+i}^l~||~u_t^l~||~u_{t+n}^l~||~\textsf{up}.(\hat{x}^{l+1}_{t+i})\big)
\label{eqn:decode_frame}
\vspace{-0.5mm}
\end{equation}
\begin{figure}[!t]
\centering
\includegraphics[width=1.0\linewidth,trim={25.5cm 22.6cm 25.25cm 6.3cm},clip]{frame_synthesis_edit.pdf}
\caption{Frame synthesis of $\hat{x}_{t+m}$ at feature level $l$.}
\label{fig:frame_synthesis}
\vspace{-5.6mm}
\end{figure}
\vspace{-2mm}
\subsection{Propagation-Interpolation Network (\textsf{\textbf{P-INet}})}
\vspace{-1mm}
The proposed propagation network (\textsf{PNet}) can be used either as a stand-alone model or a plug-in module with existing VFI works (see \Sref{sec:experiment}). However, we have experimentally observed few trade-offs. First, when the temporal gap between inputs is small, \textsf{PNet} gives a sub-optimal performance compared to the state-of-the-art VFI approaches. This is mainly because \textsf{PNet}, by design nature, propagates to future counterparts of the anchor frame by using the other input as a reference, \emph{i.e. } it relies more on one of the inputs by default. This leads to a performance trade-off since an interpolation method, intuitively speaking, should evenly rely on both inputs when there is a small gap between them. Second, as expected, the quality of frames eventually deteriorates as we propagate further away from the anchor frame. For completeness of the proposed approach, thereby alleviating the observed trade-offs, we adopt a light version of \textsf{SloMo} \cite{slomo} as an interpolation network (\textsf{INet}) along with \textsf{PNet} as our full model, \emph{i.e. } \textsf{P-INet}. The \textsf{SloMo} used in our work contains 50\% fewer weight parameters compared to the model used in \cite{slomo}. We train \textsf{P-INet} in an end-to-end manner by guiding it to propagate, interpolate or propagate and interpolate depending on the \textit{temporal gap} between inputs and the \textit{timestamp} of the intermediate frame to be predicted as summarized in \Aref{algo:train_algo}.
We use a bidirectional propagation and interpolation scheme since it gives us the flexibility to experiment with long-range temporal gaps. The reliable time frame of propagation $\Delta t (n)$ is defined as $\min(\ceil*{(n-M)/2}, M)$, where $n > M$. In other words, \textsf{PNet} adaptively propagates until the temporal gap between the end propagated frames is less than or equal to $M$. As most VFI works conduct experiments at 30 fps by downsampling 240 fps videos ($\approx$ frame gap of 8) and because our approach uses 3 intervals, we set $M=8$ and $N=24$ during training. We experiment with up to 30 frame gaps during testing to analyze if our approach extends to even larger gaps (see \Sref{sec:experiment}).
\setlength{\textfloatsep}{1.5mm}
\begin{algorithm}[!t]
\footnotesize
\LinesNotNumbered
\DontPrintSemicolon
\SetAlgoLined
\SetNoFillComment
\textbf{Input}\ : $\langle x_{t},x_{t+n}\rangle$ \tcp*{$n$ is the frame gap}
\textbf{Output}\ : $\hat{x}_{t+i}$, where $1<i<n$
Let $N$ be the maximum frame gap in the dataset, $M$ be the upper limit for small frame gap, and $\Delta t (n)$ be a reliable time frame of propagation which is dependent on $n$ \;
\ForEach{input sample}{
\eIf (\tcp*[h]{small gap}){$n \le M$}{
$\hat{x}_{t+i} = $ \textsf{INet} $(x_{t},x_{t+n})$ \textbf{for} all $i$ \;
}(\tcp*[h]{large gap ($M < n \le N$)}){
\uIf(\tcp*[h]{propagate from $x_t$}){$i \le \Delta t (n)$}{
$\hat{x}_{t+i} = \textsf{PNet}$ $(x_{t},x_{t+n})$\;
}
\uElseIf{$ \Delta t (n) < i < n-\Delta t (n)$}{
\tcp*[h]{propagate and interpolate}\
$\hat{x}_{t + \Delta t (n)} = \textsf{PNet}$ $(x_{t},x_{t+n})$\;
$\hat{x}_{t+ n - \Delta t (n)} = \textsf{PNet}$ $(x_{t+n},x_{t})$\;
$\hat{x}_{t+i} \ = $ \textsf{INet} $(\hat{x}_{t + \Delta t (n)},\hat{x}_{t+ n - \Delta t (n)})$\;
}
\uElse(\tcp*[h]{propagate from $x_{t+n}$}){
$\hat{x}_{t+i} = \textsf{PNet}$ $(x_{t+n},x_{t})$\;
}
}
}
\caption{\footnotesize{Training strategy for the \textsf{P-INet}}}
\label{algo:train_algo}
\end{algorithm}
\vspace{-0.4mm}
\subsection{Loss Functions}
\vspace{-0.5mm}
We train our network in an end-to-end manner by jointly optimizing the estimated flows, propagated frames and interpolated frames. To train \textsf{M2FNet}, we compute the endpoint error between the estimated flows and pseudo-ground truth flows across different levels as shown in \Eref{eqn:loss_flow}. To propagate to $m$ features, a total of $\frac{m}{2}(m+1)+1$ flows are estimated. We also investigate training our network by selectively optimizing some of the flows (see \Sref{sec:ablation}).
\vspace{-1mm}
\begin{equation}
{\mathcal{L}}_\textsf{M2FNet} = \sum_{i=1}^{\frac{m}{2}(m+1)+1}\sum_{l=1}^{k}\omega_1^l\big|f_i^l-\hat{f}_i^l\big|_{2}
\label{eqn:loss_flow}
\vspace{-1.5mm}
\end{equation}
where $\omega_1^l$ is a flow loss weight coefficient at level $l$. For sharp frame decoding, we train \textsf{PNet} with the multi-scale $\ell_1$ photometric loss. We also use gradient difference loss \cite{mathieu2015deep} (${\mathcal{L}}_\textsf{GDL}$) between the predicted frames and their ground truth to mitigate blurry predictions (see \Eref{eqn:loss_frame}).
\vspace{-1.5mm}
\begin{equation}
{\mathcal{L}}_\textsf{PNet} = \sum_{i=1}^{m}\sum_{l=1}^{k}\omega_2^l\big|x_i^l-\hat{x}_i^l\big|_{1} + {\mathcal{L}}_\textsf{GDL} (x_i, \hat{x}_i)
\label{eqn:loss_frame}
\vspace{-1.35mm}
\end{equation}
where $\omega_2^l$ is a frame loss weight coefficient at level $l$. We use the training loss of \textsf{SloMo} discussed in Section 3.3 of \cite{slomo} to train \textsf{INet}. We refer the reader to \cite{slomo} for details. The total training loss for \textsf{P-INet} is defined as weighted sum of all losses as shown in \Eref{eqn:loss_total}.
\vspace{-2mm}
\begin{equation}
{\mathcal{L}}_\textsf{total} = \lambda_1{\mathcal{L}}_\textsf{M2FNet} + \lambda_2{\mathcal{L}}_\textsf{PNet} + \lambda_3{\mathcal{L}}_\textsf{INet}
\label{eqn:loss_total}
\vspace{-2.5mm}
\end{equation}
\section{Experiment}
\label{sec:experiment}
\vspace{-0.5mm}
\begin{table*}[!t]
\caption{Quantitative comparison at different fps. The numbers in \textcolor{red}{red} and \textcolor{blue}{blue} represent the best and second best results, respectively.}
\label{tbl:temp_vfi}
\vspace{-2.5mm}
\begin{adjustbox}{width=\linewidth}
\setlength{\tabcolsep}{4.5pt}
\renewcommand{\arraystretch}{1.035}
\begin{tabular}{l|cccccc|cccccc|cccccc}
\toprule
& \multicolumn{6}{c|}{\textsf{Adobe240} \cite{su2017deep}} & \multicolumn{6}{c|}{\textsf{GOPRO}~\cite{Nah_2017_CVPR}} & \multicolumn{6}{c}{\textsf{NfS}~\cite{galoogahi2017need}} \\ \cmidrule(lr){2-7} \cmidrule{8-13} \cmidrule(lr){14-19}
Method & \multicolumn{2}{c}{30 fps} & \multicolumn{2}{c}{15 fps} & \multicolumn{2}{c|}{8 fps} & \multicolumn{2}{c}{30 fps} & \multicolumn{2}{c}{15 fps} & \multicolumn{2}{c|}{8 fps} & \multicolumn{2}{c}{30 fps} & \multicolumn{2}{c}{15 fps} & \multicolumn{2}{c}{8 fps} \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(lr){8-9} \cmidrule(lr){10-11} \cmidrule(lr){12-13}\cmidrule(lr){14-15}\cmidrule(lr){16-17}\cmidrule(lr){18-19}
& PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM & PSNR & SSIM \\ \midrule
\textsf{SepConv}~\cite{niklaus2017video2}&29.91 &0.915&23.94&0.811& 19.88&0.707&28.64&0.871&23.23&0.694&19.74&0.560&31.84&0.915&26.73&0.811&23.00&0.707 \\
\textsf{SloMo}~\cite{slomo} &30.03&0.917&24.30&0.818&20.17&0.717&29.03&0.917&23.58&0.818&19.99&0.718&31.83&0.917&26.95&0.818&23.19&0.717 \\
\textsf{DAIN}~\cite{dain2019} &\textcolor{red}{30.53}&\textcolor{red}{0.924}&\textcolor{blue}{24.39}&\textcolor{blue}{0.824}&\textcolor{blue}{20.21}&\textcolor{blue}{0.721}&\textcolor{blue}{29.25}&\textcolor{red}{0.924}&\textcolor{blue}{23.63}&\textcolor{blue}{0.824}&\textcolor{blue}{20.18}&0.721&\textcolor{red}{32.46}&\textcolor{red}{0.924}&\textcolor{blue}{27.19}&\textcolor{blue}{0.824}&\textcolor{blue}{23.36}&0.720 \\
\textsf{AdaCoF}~\cite{Lee_2020_CVPR}&30.14&0.896&24.11&0.741&20.07&0.567&29.05&0.876&23.49&0.701&19.89&0.571&32.28&0.919&27.05&0.819&23.23&0.719 \\
\textsf{FeFlow}~\cite{gui2020featureflow} &\textcolor{blue}{30.48}&{0.902}&24.19&0.737&20.04&0.576&\textcolor{red}{29.30}&\textcolor{blue}{0.921}&23.51&0.822&19.82&\textcolor{blue}{0.724}&\textcolor{blue}{32.42}&\textcolor{blue}{0.921}&27.05&0.822&23.16&\textcolor{blue}{0.724} \\ \midrule
\textsf{INet} &30.30&0.920&24.21&0.819&20.12&0.718&29.17&0.919&23.59 &0.821&20.04&0.722&32.03&0.920&26.99&0.822&23.27&0.721 \\
\textbf{\textsf{P-INet}} &30.30&\textcolor{blue}{0.920}&\textcolor{red}{27.10}&\textcolor{red}{0.890}&\textcolor{red}{24.00}&\textcolor{red}{0.810}&29.17&0.919&\textcolor{red}{26.45}&\textcolor{red}{0.879}&\textcolor{red}{23.90}&\textcolor{red}{0.804}&32.03&0.920&\textcolor{red}{28.98}&\textcolor{red}{0.874}&\textcolor{red}{26.23}&\textcolor{red}{0.798} \\ \bottomrule
\end{tabular}
\end{adjustbox}
\vspace{-2.8mm}
\end{table*}
\begin{figure*}[!t]
\begin{center}
\setlength{\tabcolsep}{0.3pt}
\renewcommand{\arraystretch}{0.2}
\resizebox{1.0\linewidth}{!}{%
\begin{tabular}{cccccc}
\tiny{\textsf{Inputs Overlay}} & \tiny{\textsf{DAIN} \cite{dain2019}} & \tiny{\textsf{AdaCoF} \cite{Lee_2020_CVPR}} & \tiny{\textsf{FeFlow} \cite{gui2020featureflow}} & \tiny{\textsf{\textbf{P-INet}}} & \tiny{\textsf{GT}} \\
\includegraphics[width=0.1\linewidth]{qual_compare/0002_overlay.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0002_dain.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0002_adacof.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0002_feflow.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0002_ours.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0002_gt.png}\\
\includegraphics[width=0.1\linewidth]{qual_compare/0004_overlay.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0004_dain.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0004_adacof.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0004_feflow.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0004_ours.png}&
\includegraphics[width=0.1\linewidth]{qual_compare/0004_gt.png}\\
\end{tabular}}
\end{center}
\vspace{-6mm}
\caption{Qualitative comparison of our method and state-of-the-art VFI approaches for inputs with large temporal gap.}
\label{tbl:qual_compare}
\vspace{-5.5mm}
\end{figure*}
\paragraph{Datasets.} Most existing VFI works use Vimeo-90K \cite{xue2019video} dataset which has 51312 triplets, where each triplet contains 3 consecutive video frames. However, as this dataset is not applicable to train a network for long-term VFI, we generate a dataset by sampling frames at different fps from high-speed video datasets. For this purpose, we use \textsf{Adobe240} \cite{su2017deep}, \textsf{GOPRO} \cite{Nah_2017_CVPR} and Need-for-Speed (\textsf{NfS}) \cite{galoogahi2017need} datasets, which contain 133, 33 and 100 videos, respectively. These datasets provide 240 fps videos which capture diverse combination of camera and object motions in real-world scenarios, and thus are suitable for the task at hand. A majority of the videos, however, have less than 1000 frames which makes it challenging to extract enough training samples with large temporal gaps. Hence, instead of training separately on each dataset, we used a total of 176 videos (103 from \textsf{Adobe240}, 3 from \textsf{GOPRO} and 70 from \textsf{NfS}) for training. The remaining 90 videos (30 from each dataset) are used for testing. We prepare train and test sets by extracting samples with variable length ranging from 9 to 31 consecutive frames in a video. In other words, we sample video clips at different frame rates in the range of approximately 30 fps to 8 fps, respectively. Following \cite{xue2019video}, we resize each frame in the dataset to a resolution of $448 \times 256$ to suppress noise and create consistency in size across videos.
\vspace{-6mm}
\paragraph{Implementation Details.}
We implement our network in PyTorch \cite{paszke2019pytorch} and optimize it using Adam \cite{KingmaB14} with parameters $\beta_1$ , $\beta_2$ and \textit{weight decay} fixed to $0.9$, $0.999$ and $4e-4$, respectively. The loss weight coefficients are set to $\omega^5 = 0.08$, $\omega^4 = 0.04$, $\omega^3 = 0.02$, $\omega^2 = 0.01$ and $\omega^1 = 0.005$ from the lowest to the highest resolution, respectively, for both ${\mathcal{L}}_\textsf{M2FNet}$ and ${\mathcal{L}}_\textsf{PNet}$. We train \textsf{P-INet} for 200 epochs with the learning rate initially set to $\lambda=1e-4$ and gradually decayed by half at 100, 150 and 175 epochs. For the first 40 epochs, we only train the \textsf{M2FNet} by setting $\lambda_1 = 1$, $\lambda_2 = 0$ and $\lambda_3 = 0$ to facilitate motion estimation and feature propagation. For the remaining epochs, we fix $\lambda_1$, $\lambda_2$ and $\lambda_3$ to 1. We use a mini-batch size of 4 and randomly crop image patches of size $256 \times 256$ during training. The pseudo-ground truth optical flows for supervising \textsf{M2FNet} are computed on-the-fly using FlowNet 2 \cite{IMKDB17}.
\vspace{-0.5mm}
\subsection{Experimental Results}
\vspace{-0.6mm}
In this section, we comprehensively analyze our work and several state-of-the-art VFI approaches for which open source implementations are available. These include \textsf{SepConv} \cite{niklaus2017video2}, \textsf{SloMo}~\cite{slomo}, \textsf{DAIN}~\cite{dain2019}, \textsf{AdaCoF}~\cite{Lee_2020_CVPR} and \textsf{FeFlow}~\cite{gui2020featureflow}. For fair comparison, we retrain these models using our training set by following their official code. We deploy a multi-frame interpolation training scheme for \textsf{P-INet}, \textsf{SloMo}~\cite{slomo} and \textsf{DAIN}~\cite{dain2019} as it is possible while we use single-frame interpolation scheme for others. For quantitative evaluation, we use PSNR and SSIM metrics.
\vspace{-3.1mm}
\paragraph{Temporally Robust VFI.}
Here, we analyze the robustness of different VFI models for input sequences with different temporal gaps. In \Tref{tbl:temp_vfi}, we compare our approach and state-of-the-art VFI methods on single frame interpolation of test videos sampled at 3 different frame rates: 30 fps, 15 fps and 8 fps. As can be inferred from \Tref{tbl:temp_vfi}, \textsf{P-INet} performs competitively for smaller temporal gaps and significantly better than SOTA approaches for larger temporal gaps. For instance, our approach outperforms the second best method, ~\emph{i.e. } \textsf{DAIN}\cite{dain2019}, by an average margin of of 2.44 dB and 3.51 dB at 15 fps and 8 fps, respectively. Moreover, the performance gap for \textsf{DAIN} between 30 fps and 8 fps is 9.50 dB on average. By contrast, the performance gap for our model is 5.79 dB. This shows the effectiveness of our approach for low-frame-rate videos. It can also be noticed from \Tref{tbl:temp_vfi} that the joint training of \textsf{PNet} and \textsf{INet} is beneficial even for smaller frame gaps. For instance, \textsf{INet} outperforms \textsf{SloMo} \cite{slomo} by an average margin of 0.2 dB at 30 fps. In \Fref{tbl:qual_compare}, we qualitatively compare the frames interpolated by our method and SOTA VFI approaches for input samples with large temporal gap. As can be seen from the figure, our approach interpolates sharper images with clearer contents compared to other VFI approaches.
\vspace{-3.65mm}
\begin{figure*}[!t]
\centering
\includegraphics[width=1.0\linewidth,trim={0.3cm 0.35cm 0.3cm 0.1cm},clip]{fpnet_sota.pdf}
\vspace{-6.5mm}
\caption{Quantitative analysis of \textsf{PNet} with state-of-the-art VFI approaches.}
\label{fig:fpnet_interp}
\vspace{-2.5mm}
\end{figure*}
\begin{figure*}[!t]
\begin{center}
\setlength{\tabcolsep}{0.3pt}
\renewcommand{\arraystretch}{0.2}
\resizebox{1.0\linewidth}{!}{%
\begin{tabular}{ccccccc}
\tiny{\textsf{Inputs Overlay}} & \tiny{\textsf{FeFlow} \cite{gui2020featureflow}} & \tiny{\textsf{\textbf{PNet}} + \textsf{FeFlow}\cite{gui2020featureflow}} & \tiny{\textsf{DAIN} \cite{dain2019}} &
\tiny{\textsf{\textbf{PNet}} + \textsf{DAIN} \cite{dain2019}} & \tiny{\textsf{GT}} \\
\includegraphics[width=0.1\linewidth]{qual_cascade/0053_overlay.png}&
\includegraphics[width=0.1\linewidth]{qual_cascade/0053_feflow.png}&
\includegraphics[width=0.1\linewidth]{qual_cascade/0053_fpnet_feflow.png}&
\includegraphics[width=0.1\linewidth]{qual_cascade/0053_dain.png}&
\includegraphics[width=0.1\linewidth]{qual_cascade/0053_fpnet_dain.png} &
\includegraphics[width=0.1\linewidth]{qual_cascade/0053_gt.png}\\
\includegraphics[width=0.1\linewidth]{qual_cascade/0000_overlay.png}&
\includegraphics[width=0.1\linewidth]{qual_cascade/0000_feflow.png}&
\includegraphics[width=0.1\linewidth]{qual_cascade/0000_fpnet_feflow.png}&
\includegraphics[width=0.1\linewidth]{qual_cascade/0000_dain.png}&
\includegraphics[width=0.1\linewidth]{qual_cascade/0000_fpnet_dain.png}&
\includegraphics[width=0.1\linewidth]{qual_cascade/0000_gt.png}
\end{tabular}}
\end{center}
\vspace{-6.5mm}
\caption{Qualitative analysis of \textsf{PNet} cascaded with state-of-the-art VFI approaches.}
\label{tbl:qual_fpnet}
\vspace{-2.5mm}
\end{figure*}
\begin{figure*}[!t]
\centering
\includegraphics[width=1.0\linewidth,trim={0.3cm 0.15cm 0.25cm 0.25cm},clip]{temp_smooth.pdf}
\vspace{-6.3mm}
\caption{Quantitative analysis of intermediate frames at different time steps for long-term VFI.}
\vspace{-5.3mm}
\label{fig:temp_smooth}
\end{figure*}
\paragraph{\textsf{PNet} with VFI Methods.}
To highlight the versatility of the proposed \textsf{PNet} for long-term VFI, we couple \textsf{PNet} with VFI approaches and perform intermediate frame interpolation for input sequences with relatively large frame gap ranging from 11 to 30. Following the procedure in \Aref{algo:train_algo}, we first propagate bidirectionally using \textsf{PNet} from a pretrained \textsf{P-INet}. Then, we interpolate an intermediate frame between the propagated frames using state-of-the-art VFI methods~\cite{slomo,dai2008motion,Lee_2020_CVPR,gui2020featureflow}. The averaged results on the 3 datasets are plotted in \Fref{fig:fpnet_interp}. As can be inferred from the figure, the cascade models consistently outperform their vanilla baseline by a notable margin. The qualitative analysis in \Fref{tbl:qual_fpnet} also shows that, when the temporal distance between the inputs is large, incorporating \textsf{PNet} results in interpolated frames with more \textit{accurate} contents compared to directly using SOTA VFI approaches. The static regions in \Fref{tbl:qual_fpnet} appear slightly less sharp for cascade models most likely because the interpolation model uses the output of \textsf{PNet} as inputs rather than the raw input frames.
\vspace{-4mm}
\paragraph{Long-term Multi-Frame Interpolation.}
Beyond evaluating the robustness of VFI approaches at different frame rates, we analyze the quality of the intermediate frames interpolated during a direct \textit{very low} fps $\rightarrow$ \textit{very high} fps upsampling. We perform 10 fps $\rightarrow$ 240 fps up-conversion in a single pass and measure the quality of the interpolated frames at each time step. In \Fref{fig:temp_smooth}, we compare our approach with \textsf{SloMo} \cite{slomo} and \textsf{DAIN} \cite{dain2019} since they are also capable of multi-frame interpolation. As expected, performance generally decreases as we move to the middle time step from both sides. However, it can be noticed from \Fref{fig:temp_smooth} that there is a rapid performance drop for \textsf{SloMo} and \textsf{DAIN} compared to \textsf{P-INet}. For instance, the average performance range, \emph{i.e. } the difference between largest and smallest PSNR values averaged over the 3 datasets, for \textsf{SloMo} is 8.62 dB. By contrast, the average performance range for \textsf{P-INet} is 6.11 dB. Instead of interpolating frames based on pre-computed motion that will likely be inaccurate due to large motion, our model adapts to propagate and interpolate frames, which explains the significant performance gain achieved over state-of-the-art approaches particularly for central time steps.
\vspace{-4.5mm}
\begin{figure*}[!t]
\begin{center}
\setlength{\tabcolsep}{0.3pt}
\renewcommand{\arraystretch}{0.5}
\resizebox{1.0\linewidth}{!}{%
\begin{tabular}{cccccc}
\tiny{\textsf{Input} ($x_t$) } & \tiny{$\hat{f}$ (\textsf{Ours})} & \tiny{$f$ (\textsf{p-GT})} & \tiny{\textsf{Input} ($x_t$) } & \tiny{$\hat{f}$ (\textsf{Ours})} & \tiny{$f$ (\textsf{p-GT})} \\
\includegraphics[width=0.1\linewidth]{qual_flow/1/0001.png}&
\includegraphics[width=0.1\linewidth]{qual_flow/1/ours.png}&
\includegraphics[width=0.1\linewidth]{qual_flow/1/gt.png}&
\includegraphics[width=0.1\linewidth]{qual_flow/9/0001.png}&
\includegraphics[width=0.1\linewidth]{qual_flow/9/ours.png}&
\includegraphics[width=0.1\linewidth]{qual_flow/9/gt.png}
\end{tabular}}
\end{center}
\vspace{-6.3mm}
\caption{Qualitative analysis of the estimated optical flows between features in comparison with the pseudo-ground truth (\textsf{p-GT}) flows.}
\label{tbl:qual_compare_flow1}
\vspace{-5mm}
\end{figure*}
\begin{figure}[!t]
\centering
\includegraphics[width=1\linewidth,trim={0.5cm 0.4cm 0.7cm 0.45cm},clip]{heatmap.pdf}
\vspace{-6mm}
\caption{Quantitative analysis of the estimated flows.}
\label{fig:heatmap}
\end{figure}
\paragraph{Optical Flow.} \Fref{tbl:qual_compare_flow1} depicts the feature flows estimated by our network in comparison with the corresponding pseudo-ground truth (\textsf{p-GT}) flows. As can be seen from \Fref{tbl:qual_compare_flow1}, our model reasonably anticipates the accurate motion to propagate features. To further confirm if ${\mathcal{D}}_G$ and ${\mathcal{D}}_L$ in the \textsf{M2FNet} properly learned to decode motions for feature propagation, we quantitatively analyze the optical flows estimated between the \textit{anchor} and the \textit{forecasted} features. To purely evaluate the magnitude of motion, we compute the sum of the absolute value of the estimated flows. In \Fref{fig:heatmap}, we plot a heat map of the magnitude of the estimated flows (rescaled between 0 \& 1) for different temporal gaps, where $z_i = \frac{1}{2}(\sum{|\hat{f}_{{t+i}\rightarrow t}|}+\sum{|\hat{f}_{{t+n-i}\rightarrow{t+n}}|})$. We can infer two key things from \Fref{fig:heatmap}. First, the proximity of the forecasted feature to the anchor is directly related to the magnitude of the estimated flow, \emph{i.e. } ${\mathcal{D}}_G$ and ${\mathcal{D}}_L$ decode smaller motions for closer features and larger motion for those that are far. Second, \textsf{M2FNet} is implicitly aware of the relative temporal distance between inputs, \emph{i.e. } the magnitude of the forecasted flows increases for increasing frame gap.
\section{Ablation Studies}
\vspace{-1.5mm}
\label{sec:ablation}
Here, we present ablation experiments on different components of \textsf{P-INet}. We evaluate the quality of all \textit{propagated} frames during long-term VFI (10 fps $\rightarrow$ 240 fps) for \textsf{Adobe240} \cite{su2017deep} and \textsf{GOPRO}\cite{Nah_2017_CVPR} test videos (see \Tref{tbl:ablation_flow}).
\vspace{-9mm}
\paragraph{Loss Functions.}
To highlight the importance of using optical flow as a guidance for feature propagation, we forecast features without estimating flows and directly regress frames from the respective forecasted features, \emph{i.e. } \textsf{P-INet} is trained without ${\mathcal{L}}_\textsf{\textsf{M2FNet}}$. A network trained without motion supervision performed significantly worse compared to a model trained with motion supervision. We also confirmed the contribution of the different groups of flows estimated in \Sref{sec:methodology}. It can be inferred from \Tref{tbl:ablation_flow} that estimating optical flows between the forecasted features is crucial as a network trained without inter-frame motion supervision (shown in \textcolor{green}{green} in \Fref{fig:flow_pattern}) gives a subpar performance. Moreover, we studied the importance of addressing potential directional ambiguity by constraining the optical flow between the end propagated feature and the reference feature (shown in \textcolor{blue}{blue} in \Fref{fig:flow_pattern}). As can be seen from \Tref{tbl:ablation_flow}, training a network without direction supervision results in a performance decrease of 0.48 dB. We analyze the benefit of the gradient difference loss \cite{mathieu2015deep} (${\mathcal{L}}_\textsf{GDL}$) in mitigating blurry frame predictions. It can be noticed from \Tref{tbl:ablation_flow} that training our model with ${\mathcal{L}}_\textsf{GDL}$ improves performance by an average margin of 0.65 dB.
\vspace{-3.5mm}
\paragraph{\textsf{M2FNet}.} We examine the importance of global (${\mathcal{D}}_G$) and local (${\mathcal{D}}_L$) motion decoders in \textsf{M2FNet}. First, we only use ${\mathcal{D}}_G$ for decoding motion. This resulted in a subpar network performance as ${\mathcal{D}}_G$ is limited to anticipating only global motion at a feature-level and the local motion apparent in the test videos can not be effectively forecasted. In theory, ${\mathcal{D}}_L$ can decode both local and global motions (without the need to explicitly model global motions with ${\mathcal{D}}_G$) as CNNs are effective in motion estimation tasks \cite{Sun2018PWC-Net,IMKDB17}. This is also empirically evident as a network trained only using ${\mathcal{D}}_L$ gives a competitive performance. However, using ${\mathcal{D}}_G$ to forecast global motions proved to give a considerable performance boost of 0.92 dB.
\vspace{-4mm}
\paragraph{Frame Decoding.} We study the importance of incorporating features of past frames when decoding the current frame in \textsf{PNet}. As can be inferred from \Tref{tbl:ablation_flow}, only attending to the \textit{anchor} feature (only warping $u_t$ in \Eref{eqn:attend}) when synthesizing frames gives a notably lower performance compared to attending all past features. Moreover, not attending to any past feature (excluding $v_{t+i}$ from \Eref{eqn:decode_frame}) during frame decoding performs significantly worse.
\begin{table}[!t]
\begin{center}
\caption{Ablation experiments}
\vspace{-2.9mm}
\label{tbl:ablation_flow}
\setlength{\tabcolsep}{5pt}
\renewcommand{\arraystretch}{0.94}
\begin{adjustbox}{width=\linewidth}
\begin{tabular}{l|cccc}
\toprule
& \multicolumn{2}{c}{\textsf{Adobe240}\cite{su2017deep}} & \multicolumn{2}{c}{\textsf{GOPRO}\cite{Nah_2017_CVPR}} \\ \cmidrule (lr){2-3} \cmidrule (lr){4-5}
\textbf{Loss Functions} & PSNR & SSIM & PSNR & SSIM \\ \midrule
w/o ${\mathcal{L}}_\textsf{\textsf{M2FNet}}$ &25.09&0.730&25.16&0.728 \\
w/o inter-frame motion &25.81&0.776&26.11&0.776 \\
w/o direction supervision &27.13&0.801&27.83&0.806\\
w/o ${\mathcal{L}}_\textsf{\textsf{GDL}}$ & 26.97 & 0.801 & 27.84 & 0.813\\ \midrule
\textbf{\textsf{M2FNet}} & & & & \\
w/o ${\mathcal{D}}_L$ &25.13&0.734&25.71&0.760 \\
w/o ${\mathcal{D}}_G$ &26.96&0.801&27.34&0.811\\ \midrule
\textbf{Frame Decoding} & & & & \\
only warping $u_t$ in \Eref{eqn:attend} & 26.82&0.793 & 27.41 & 0.812 \\
excluding $v_{t+i}$ from \Eref{eqn:decode_frame} & 26.03 &0.781&26.57& 0.789\\ \midrule
\textbf{\textsf{P-INet}} & $\textbf{27.70}$ & $\textbf{0.816}$ & $\textbf{28.43}$ & $\textbf{0.843}$ \\ \bottomrule
\end{tabular}
\end{adjustbox}
\end{center}
\vspace{-3.5mm}
\end{table}
\section{Conclusion}
\vspace{-1mm}
Our work introduces a temporally robust VFI framework by adopting a feature propagation approach. The proposed motion supervision tailors the network for the task at hand as it enforces features to be propagated according to the motion between inputs irrespective of their contents. The adaptive cascading of \textsf{PNet} with a simple interpolation backbone has significantly improved the interpolation quality for low frame rate videos as briefly analyzed in \Sref{sec:experiment}.
\vspace{-3mm}
\paragraph{Limitations.} The multi-scale approach along with aggregated motion estimation significantly increases the time complexity of our model. For instance, during 10 fps $\rightarrow$ 240 fps up-conversion given an input pair of size $448 \times 256$, \textsf{SloMo}~\cite{slomo} takes 0.32 secs while \textsf{P-INet} takes 3.37 secs. We experimentally observed failure cases when there is a fast-moving \textit{small} object in the foreground of a scene with a relatively large, dynamic background. In this scenario, \textsf{PNet} fails to detect and anticipate the motion of such objects, and instead imitates the input feature during propagation. This results in temporal jittering artifact in the interpolated video. Improving this limitation using a detection module \cite{yuan2019zoom} or an attention mechanism \cite{choi2020channel} would be an interesting future direction.
| {'timestamp': '2022-03-30T02:30:03', 'yymm': '2203', 'arxiv_id': '2203.15427', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15427'} | arxiv |
\section{Introduction}
\label{sec:intro}
\emph{Gender diversity}, or more often its lack thereof, among participants to
software development activities has been thoroughly studied in recent years. In
particular, the presence of, effects of, and countermeasures for \emph{gender
bias} in Free/Open Source Software (FOSS) have received a lot of attention
over the past decade~\cite{david2008fossdevs, qiu2010kdewomen,
nafus2012patches, kuechler2012genderfoss, vasilescu2014gender,
oneil2016debiansurvey, robles2016womeninfoss, terrell2017gender,
zacchiroli2021gender}. \emph{Geographic diversity} is on the other hand the
kind of diversity that stems from participants in some global activity coming
from different world regions and cultures.
Geographic diversity in FOSS has received relatively little attention in scholarly
works. In particular, while seminal survey-based and
point-in-time medium-scale studies of the geographic origins of FOSS
contributors exist~\cite{ghosh2005understanding, david2008fossdevs,
barahona2008geodiversity, takhteyev2010ossgeography, robles2014surveydataset,
wachs2021ossgeography}, large-scale longitudinal studies of the geographic
origin of FOSS contributors are still lacking. Such a quantitative
characterization would be useful to inform decisions related to global
development teams~\cite{herbsleb2007globalsweng} and hiring strategies in the
information technology (IT) market, as well as contribute factual information
to the debates on the economic impact and sociology of FOSS around the world.
\paragraph{Contributions}
With this work we contribute to close this gap by conducting \textbf{the first
longitudinal study of the geographic origin of contributors to public code
over 50 years.} Specifically, we provide a preliminary answer to the
following research question:
\begin{researchquestion}
From which world regions do authors of publicly available commits come from
and how has it changed over the past 50 years?
\label{rq:geodiversity}
\end{researchquestion}
We use as dataset the \SWH/ archive~\cite{swhipres2017} and analyze from it
2.2 billion\xspace commits archived from 160 million\xspace projects and authored by
43 million\xspace authors during the 1971--2021 time period.
We geolocate developers to
\DATAWorldRegions/ world regions, using as signals email country code top-level domains (ccTLDs) and
author (first/last) names compared with name distributions around the world, and UTC offsets
mined from commit metadata.
We find evidence of the early dominance of North America in open source
software, later joined by Europe. After that period, the geographic diversity
in public code has been constantly increasing.
We also identify relevant historical shifts
related to the end of the UNIX wars and the increase of coding literacy in
Central and South Asia, as well as of broader phenomena like colonialism and
people movement across countries (immigration/emigration).
\paragraph{Data availability.}
A replication package for this paper is available from Zenodo at
\url{https://doi.org/10.5281/zenodo.6390355}~\cite{replication-package}.
\section{Related Work}
\label{sec:related}
Both early and recent works~\cite{ghosh2005understanding, david2008fossdevs,
robles2014surveydataset, oneil2016debiansurvey} have characterized the
geography of Free/Open Source Software (FOSS) using \emph{developer surveys},
which provide high-quality answers but are limited in size (2-5\,K developers)
and can be biased by participant sampling.
In 2008 Barahona et al.~\cite{barahona2008geodiversity} conducted a seminal
large-scale (for the time) study on FOSS \emph{geography using mining software
repositories (MSR) techniques}. They analyzed the origin of 1\,M contributors
using the SourceForge user database and mailing list archives over the
1999--2005 period, using as signals information similar to ours: email domains
and UTC offsets.
The studied period (7 years) in~\cite{barahona2008geodiversity} is shorter than
what is studied in the present paper (50 years) and the data sources are
largely different; with that in mind, our results show a slightly larger quote of
European v.~North American contributions.
Another empirical work from 2010 by Takhteyev and
Hilts~\cite{takhteyev2010ossgeography} harvested self-declared geographic
locations of GitHub accounts recursively following their connections,
collecting information for $\approx$\,70\,K GitHub users. A very recent
work~\cite{wachs2021ossgeography} by Wachs et al.~has geolocated half a million
GitHub users, having contributed at least 100 commits each, and who
self-declare locations on their GitHub profiles. While the study is
point-in-time as of 2021, the authors compare their findings
against~\cite{barahona2008geodiversity, takhteyev2010ossgeography} to
characterize the evolution of FOSS geography over the time snapshots taken by
the three studies.
Compared with previous empirical works, our study is much larger scale---having
analyzed 43 million\xspace authors of 2.2 billion\xspace commits from 160 million\xspace
projects---longitudinal over 50 years of public code contributions rather than
point in time, and also more fine-grained (with year-by-year granularity over
the observed period). Methodologically, our study relies on Version Control
System (VCS) commit data rather than platform-declared location information.
Other works---in particular the work by Daniel~\cite{daniel2013ossdiversity}
and, more recently, Rastogi et al.~\cite{rastogi2016geobias,
rastogi2018geobias, prana2021geogenderdiversity}---have studied geographic
\emph{diversity and bias}, i.e., the extent to which the origin of FOSS
developers affect their collaborative coding activities.
In this work we characterized geographic diversity in public code for the first
time at this scale, both in terms of contributors and observation period. We do
not tackle the bias angle, but provide empirical data and findings that can be
leveraged to that end as future work.
\emph{Global software engineering}~\cite{herbsleb2007globalsweng} is the
sub-field of software engineering that has analyzed the challenges of scaling
developer collaboration globally, including the specific concern of how to deal
with geographic diversity~\cite{holmstrom2006globaldev, fraser2014eastwest}.
Decades later the present study provides evidence that can be used, in the
specific case of public code and at a very large scale, to verify which
promises of global software engineering have borne fruit.
\section{Methodology}
\label{sec:method}
\newif\ifgrowthfig \growthfigtrue
\ifgrowthfig
\begin{figure}
\includegraphics[width=\columnwidth]{yearly-commits}
\caption{Yearly public commits over time (log scale).
}
\label{fig:growth}
\end{figure}
\fi
\paragraph{Dataset}
We retrieved from \SWH/~\cite{swh-msr2019-dataset} all commits archived until \DATALastCommitDate/.
They amount to \DATACommitsRaw/ commits, unique by SHA1 identifier, harvested from \DATATotalCommitsInSH/ public projects coming from major development forges (GitHub, GitLab, etc.) and package repositories (Debian, PyPI, NPM, etc.).
Commits in the dataset are by \DATAAuthorsRaw/ authors, unique by $\langle$name, email$\rangle$ pairs.
The dataset came as two relational tables, one for commits and one for authors, with the former referencing the latter via a foreign key.
\iflong
Each row in the commit table contains the following fields: commit SHA1 identifier, author and committer timestamps, author and committer identifiers (referencing the author table).
The distinction between commit authors and committers come from Git, which allows to commit a change authored by someone else.
For this study we focused on authors and ignored committers, as the difference between the two is not relevant for our research questions and the amount of commits with a committer other than its author is negligible.
\fi
For each entry in the author table we have author full name and email as two separate strings of raw bytes.
We removed implausible or unusable names that: are not decodable as UTF-8 (\DATAAuthorsRmNondecodable/ author names removed), are email addresses instead of names (\DATAAuthorsRmEmail/ ``names''), consist of only blank characters (\DATAAuthorsRmBlank/), contain more than 10\% non-letters (\DATAAuthorsRmNonletter/), are longer than 100 characters (\DATAAuthorsRmToolong/).
After filtering, about \DATAAuthorsPlausibleApprox/ authors (\DATAAuthorsPlausiblePct/ of the initial dataset) remained for further analysis.
Note that the amount of public code commits (and authors) contained in the
initial dataset grows exponentially over
time~\cite{swh-provenance-emse}\ifgrowthfig, as shown for commits in
\Cref{fig:growth}\else: from $10^4$ commits in 1971, to $10^6$ in 1998, to
almost $10^9$ in 2020\fi. As a consequence the observed trends tend to be more
stable in recent decades than in 40+ year-old ones, due to statistics taken on
exponentially larger populations.
\paragraph{Geolocation}
\begin{figure}
\centering
\includegraphics[clip,trim=6cm 6cm 0 0,width=\linewidth]{subregions-ours}
\caption{The \DATAWorldRegions/ world regions used as geolocation targets.}
\label{fig:worldmap}
\end{figure}
As geolocation targets we use macro world regions derived from the United Nations geoscheme~\cite{un1999geoscheme}.
To avoid domination by large countries (e.g., China or Russia) within macro regions, we merged and split some regions based on geographic proximity and the sharing of preeminent cultural identification features, such as spoken language.
\Cref{fig:worldmap} shows the final list of \DATAWorldRegions/ world regions used as geolocation targets in this study.
Geolocation of commit authors to world regions uses the two complementary techniques introduced in~\cite{icse-seis-2022-gender}, briefly recalled below.
The first one relies on the country code top-level domain (ccTLD) of email addresses extracted from commit metadata, e.g., \texttt{.fr}, \texttt{.ru}, \texttt{.cn}, etc.
We started from the IANA list of Latin character ccTLDs~\cite{wikipedia-cctld} and manually mapped each corresponding territory to a target world region.
The second geolocation technique uses the UTC offset of commit timestamps (e.g., UTC-05:00) and author names to determine the most likely world region of the commit author.
For each UTC offset we determine a list of compatible places (country, state, or dependent territory) in the world that, at the time of that commit, had that UTC offset; commit time is key here, as country UTC offsets vary over time due to timezone changes.
To make this determination we use the IANA time zone database~\cite{tzdata}.
Then we assign to each place a score that captures the likelihood that a given author name is characteristic of it.
To this end we use the Forebears dataset of the frequencies of the most common first and family names which, quoting from~\cite{forebear-names}: {\itshape ``provides the approximate incidence of forenames and surnames produced from a database of \num{4 044 546 938} people (55.5\% of living people in 2014). As of September 2019 it covers \num{27 662 801} forenames and \num{27 206 821} surnames in 236 jurisdictions.''}
As in our dataset authors are full name strings (rather than split by first/family name), we first tokenize names (by blanks and case changes) and then lookup individual tokens in both first and family names frequency lists.
For each element found in name lists we multiply the place population\footnotemark{} by the name frequency to obtain a measure that is proportional to the number of persons bearing that name (token) in the specific place.
\footnotetext{To obtain population totals---as the notion of ``place'' is heterogeneous: full countries v.~slices of large countries spanning multiple timezones---we use a mixture of primary sources (e.g., government websites), and non-primary ones (e.g., Wikipedia articles).}
We sum this figure for all elements to obtain a place score, ending up with a list of $\langle$place, score$\rangle$ pairs.
We then partition this list by the world region that a place belongs to and sum the score for all the places in each region to obtain an overall score, corresponding to the likelihood that the commit belongs to a given world region.
We assign the starting commit as coming from the world region with the highest score.
The email-based technique suffers from the limited and unbalanced use of ccTLDs: most developers use generic TLDs such as \texttt{.com}, \texttt{.org}, or \texttt{.net}.
Moreover this does not happen uniformly across zones: US-based developers, for example, use the \texttt{.us} ccTLD much more seldomly than their European counterparts.
On the other hand the offset/name-based technique relies on the UTC offset of the commit timestamps.
Due to tool configurations on developer setups, a large number of commits in the dataset has an UTC offset equal to zero.
This affects less recent commits (\DATACommitsTZZTwoThousandTwenty/ of 2020s commits have a zero offset) than older ones (\DATACommitsTZZTwoThousand/ in 2000).
As a result the offset/name-based technique could end up detecting a large share of older commits as authored by African developers, and to a lesser extent Europeans.
To counter these issues we combine the two geolocation techniques together by applying the offset/name-based techniques to all commits with a non-zero UTC offset, and the email-based on to all other commits.
\section{Results and Discussion}
\label{sec:results}
\begin{figure*}
\centering
\includegraphics[width=\linewidth]{stacked.pdf}
\caption{Ratio of commits (above) and active authors (below) by world zone over the 1971--2020 period.}
\Description[Chart]{Stacked bar chart showing the world zone ratios for commits and authors over the 1971--2020 period.}
\label{fig:results}
\end{figure*}
To answer \cref{rq:geodiversity} we gathered the number of commits and distinct authors per year and per world zone.
We present the obtained results in \Cref{fig:results} as two stacked bar charts, showing yearly breakdowns for commits and authors respectively.
Every bar represents a year and is partitioned in slices showing the commit/author ratio for each of the world regions of \Cref{fig:worldmap} in that year.
To avoid outliers due to sporadic contributors, in the author chart we only consider authors having contributed at least 5 commits in a given year.
While observing trends in the charts remember that the total numbers of commits and authors grow exponentially over time.
Hence for the first years in the charts, the number of data points in some world regions can be extremely small, with negative consequences on the stability of trends.
\paragraph{Geographic diversity over time}
Overall, the general trend appears to be that the \textbf{geographic diversity in public code is increasing}: North America and Europe alternated their ``dominance'' until the middle of the 90s; from that moment on most other world regions show a slow but steady increment.
This trend of increased participation into public code development includes Central and South Asia (comprising India), Russia, Africa, Central and South America,
Notice that also zones that do not seem to follow this trend, such as Australia and New Zealand, are also increasing their participation, but at a lower speed with respect to other zones.
For example, Australia and New Zealand incremented the absolute number of their commits by about 3 orders of magnitude from 2000 to present days.
Another interesting phenomenon that can be appreciated in both charts is the sudden contraction of contributions from North America in 1995; since the charts depict ratios, this corresponds to other zones, and Europe in particular, increasing their share.
An analysis of the main contributions in the years right before the contraction shows that nine out of ten have \texttt{ucbvax.Berkeley.EDU} as author email domain, and the tenth is Keith Bostic, one of the leading Unix BSD developers, appearing with email \texttt{bostic}.
No developer with the same email domain appears anymore within the first hundred contributors in 1996.
This shows the relevance that BSD Unix and the Computer Systems Research Group at the University of California at Berkeley had in the history of open source software.
The group was disbanded in 1995, partially as a consequence of the so-called UNIX wars~\cite{kernighan2019unixhistory}, and this contributes significantly---also because of the relatively low amount of public code circulating at the time---to the sudden drop of contributions from North America in subsequent years.
Descendant UNIX operating systems based on BSD, such as OpenBSD, FreeBSD, and NetBSD had smaller relevance to world trends due to (i) the increasing amount of open source code coming from elsewhere and (ii) their more geographically diverse developer community.
Another time frame in which the ratios for Europe and North America are subject to large, sudden changes is 1975--79.
A preliminary analysis shows that these ratios are erratic due to the very limited number of commits in those time period, but we were unable to detect a specific root cause.
Trends for those years should be subject to further studies, in collaboration with software historians.
\paragraph{Colonialism}
Another trend that stands out from the charts is that Africa appears to be well represented.
To assess if this results from a methodological bias, we double-checked the commits detected as originating from Africa for timezones included in the $[0, 3]$ range using both the email- the offset/name-based methods.
The results show that the offset/name-based approach assigns 22.7\% of the commits to Africa whereas the email-based one only assigns 2.7\% of them.
While a deeper investigation is in order, it is our opinion that the phenomenon we are witnessing here is a consequence of colonialism, specifically the adoption of Europeans names in African countries.
For example the name Eric, derived from Old Norse, is more popular in Ghana than it is in France or in the UK.
This challenges the ability of the offset/name-based method to correctly differentiate between candidate places.
Together with the fact that several African countries are largely populated, the offset/name-based method could detect European names as originating from Africa.
While this cuts both way, the likelihood of a random person contributing to public code is very different between European countries, all having a well-developed software industry, and African countries that do not all share this trait.
\paragraph{Immigration/emigration}
Another area where a similar phenomenon could be at play is the evolution of Central and South America.
Contribution from this macro region appears to be growing steadily.
To assess if this is the result of a bias introduced by the name-based detection we analyzed the evolution of offset/name-based assignment over time for authors whose email domain is among the top-ten US-based entities in terms of overall contributions (estimated in turn by analyzing the most frequent email domains and manually selecting those belonging to US-based entities).
In 1971 no author with an email from top US-based entities is detected as belonging to Central and South America, whereas in 2019 the ratio is 12\%.
Nowadays more than one tenth of the people email-associated to top US-based entities have popular Central and South American names, which we posit as a likely consequence of immigration into US (emigration from Central and South America).
Since immigration has a much longer history than what we are studying here, what we are witnessing probably includes long-term consequences of it, such as second and third generation immigrants employed in white-collar jobs, such as software development.
\section{Limitations and Future Work}
\label{sec:conclusion}
We have performed an exploratory, yet very large scale, empirical study of the geographic diversity in public code commits over time.
We have analyzed 2.2 billion\xspace public commits covering the \DATAYearRange/ time period.
We have geolocated developers to \DATAWorldRegions/ world regions using as signals email domains, timezone offsets, and author names.
Our findings show that the geographic diversity in public code is increasing over time, and markedly so over the past 20--25 years.
Observed trends also co-occur with historical events and macro phenomena like the end of the UNIX wars, increase of coding literacy around the world, colonialism, and immigration.
\medskip
\emph{Limitations.}
This study relies on a combination of two geolocation methods: one based on email domains, another based on commit UTC offsets and author names.
We discussed some of the limitations of either method in \Cref{sec:method}, motivating our decision of restricting the use of the email-based method to commits with a zero UTC offset.
As a consequence, for most commits in the dataset the offset/name-based method is used.
With such method, the frequencies of forenames and surnames are used to rank candidate zones that have a compatible UTC offset at commit time.
A practical consequence of this is that for commits with, say, offset UTC+09:00 the candidate places can be Russia, Japan and Australia, depending on the specific date due to daylight saving time.
Popular forenames and surnames in these regions tend to be quite different so the likelihood of the method to provide a reliable detection is high.
For other offsets the set of popular forenames and surnames from candidate zones can exhibit more substantial overlaps, negatively impacting detection accuracy.
We have discussed some of these cases in \Cref{sec:results}, but other might be lingering in the results impacting observed trends.
The choice of using the email-based method for commits with zero UTC offset, and the offset/name-based method elsewhere, has allowed us to study all developers not having a country-specific email domain (ccTLD), but comes with the risk of under-representing the world zones that have (in part and in some times of the year) an actual UTC offset of zero.
A potential bias in this study could be introduced by the fact that the name database used for offset/name-based geolocation only contains names formed using Latin alphabet characters.
We looked for names containing Chinese, Japanese, and Korean characters in the original dataset, finding only a negligible amount of authors who use non-Latin characters in their VCS names, which leads us to believe that the impact of this issue is minimal.
We did not apply identity merging (e.g., using state-of-the-art tools like SortingHat~\cite{moreno2019sortinghat}), but we do not expect this to be a significant issue because: (a) to introduce bias in author trends the distribution of identity merges around the world should be uneven, which seems unlikely; and (b) the observed commit trends (which would be unaffected by identity merging) are very similar to observed author trends.
We did not systematically remove known bot accounts~\cite{lebeuf2018swbots} from the author dataset, but we did check for the presence of software bots among the top committers of each year. We only found limited traces of continuous integration (CI) bots, used primarily to automate merge commits. After removing CI bots from the dataset the observed global trends were unchanged, therefore this paper presents unfiltered data.
\medskip
\emph{Future work.}
To some extent the above limitations are the price to pay to study such a large dataset: there exists a trade-off between large-scale analysis and accuracy.
We plan nonetheless to further investigate and mitigate them in future work.
Multi-method approaches, merging data mining with social science methods, could be applied to address some of the questions raised in this exploratory study.
While they do not scale to the whole dataset, multi-methods can be adopted to dig deeper into specific aspects, specifically those related to social phenomena.
Software is a social artifact, it is no wonder that aspects related to sociocultural evolution emerge when analyzing its evolution at this scale.
\clearpage
| {'timestamp': '2022-03-30T02:27:00', 'yymm': '2203', 'arxiv_id': '2203.15369', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15369'} | arxiv |
\section{Introduction}
\label{sec:intro}
Synthetic Aperture Radar (SAR) is an active microwave imaging sensor with long-distance observation capability in all-day and all-weather conditions and has good adaptability to monitoring the ocean.
In ocean SAR images, ships are the most critical yet small targets to detect when developing a SAR search and tracking system.
SAR-Ship detection aims to find the pre-defined ship objects in a given SAR scene by generating accurate 2D bounding boxes to locate them.
Although many efforts have been explored to the SAR-ship detection task, it is still not completely and effectively solved, due to the non-trivial SAR imaging mechanism, where various ships are very small and blurred, and even submerged in extremely complicated backgrounds.
\begin{figure}[t]
\centering
\label{fig:ship}
\subfigure[CenterNet]
{
\begin{minipage}[b]{.2\linewidth}
\centering
\includegraphics[scale=0.21]{complexShip/small.png} \\
\includegraphics[scale=0.21]{complexShip/speckle_baseline.png}\\
\includegraphics[scale=0.21]{complexShip/complex_baseline.png}
\end{minipage}
}
\subfigure[YOLOV4]
{
\begin{minipage}[b]{.2\linewidth}
\centering
\includegraphics[scale=0.21]{complexShip/small_yolo4.png}\\
\includegraphics[scale=0.21]{complexShip/speckle_yolo.png}\\
\includegraphics[scale=0.21]{complexShip/complex_yolo.png}
\end{minipage}
}
\subfigure[EfficientDet]
{
\begin{minipage}[b]{.2\linewidth}
\centering
\includegraphics[scale=0.21]{complexShip/effi_1.png}\\
\includegraphics[scale=0.21]{complexShip/effi_2.png}\\
\includegraphics[scale=0.21]{complexShip/eff_3.png}
\end{minipage}
}
\subfigure[Ours]
{
\begin{minipage}[b]{.2\linewidth}
\centering
\includegraphics[scale=0.21]{complexShip/small_2.png}\\
\includegraphics[scale=0.21]{complexShip/speck2_ours.png}\\
\includegraphics[scale=0.21]{complexShip/complex_ours.png}
\end{minipage}
}
\caption{Ships are often small targets and submerged in extremely complicated backgrounds. Meanwhile, SAR images inevitably contain speckle noise. These adverse factors heavily hinder accurate SAR-Ship detection. When designing a neural network model, it is natural to suppress the extracted features from the adverse factors of surroundings while enhancing the beneficial features from the ship targets. The proposed SAR-ShipNet can deal with the aforementioned problems, therefore leading to better detection results than SOTAs.}
\vspace{-4mm}
\end{figure}
\begin{figure}[t]
\centering
\subfigure{
\label{Fig.sub.1}
\includegraphics[width=1\linewidth]{Structure/net5.png}}
\caption{Overview of SAR-ShipNet structure. SAR-ShipNet is composed of three modules: the feature extraction network that the backbone adds the attention mechanism, feature fusion: MRF, and elliptic gauss.}
\label{fig:net}
\vspace{-4mm}
\end{figure}
Traditional SAR target detection methods are mainly based on contrast information, geometric, texture features, and statistics. They are implemented by the hand-crafted feature extractors and classifiers. However, these methods are not only time-consuming but also lead to inaccurate detection results in complicated sea-and-land scenarios. Constant false alarm rate detectors (CFAR) \cite{gao2008adaptive}, is one of the most commonly used techniques. \cite{gao2016scheme} considers practical application situation and tries to strike a good balance between estimation accuracy and speed. \cite{leng2015bilateral,shi2013ship} introduce a bilateral CFAR algorithm for ship detection and reduced the influence of synthetic aperture radar ambiguity and ocean clutter.
With the development of deep learning, CNN-based detection models have emerged in multitude, which can automatically extract features and get rid of the shortcomings of manually designed features \cite{krizhevsky2012imagenet} for SAR-ship detection. Thus, many researchers begin to use deep learning for SAR ship detection. \cite{cui2019dense} integrates the feature pyramid networks with the convolutional block attention module. \cite{du2019saliency} introduces significant information into the network so that the detector can pay more attention to the object region. \cite{fu2020anchor} proposes an anchor-free network for ship detection, using a balancing pyramid composed of attention-guided and using different levels of features to generate appropriate pyramids. \cite{guo2021CenterNet++} improves CenterNet++ and enhanced ship feature through multi-scale feature fusion and head enhancement. These detectors have achieved great results in SAR-ship detection, there are still many problems with these detectors. These problems include misclassification caused by the high similarity of ships and islands in the complex sea and land scenes, omissions in the detection of small target ships under long-distance satellite observation, and scattering noise in the SAR imaging process.
Figure~\ref{fig:ship} shows these three types of SAR-ship detection challenges, where the local regions similar to small ship targets
spread over the whole background. Thus, exploring the interaction
information amongst SAR image features in large-range dependencies
to amplify the difference between the ship target and its background is
crucial for robust detection. However, cutting-edge learning models are limited by the locality of CNNs, which behave poorly to capture large-range dependencies.
To solve these challenges, we design a high-speed and effective detector called SAR-ShipNet. We propose a new attention mechanism, i.e., bidirectional coordinated attention (BCA), to solve the effects of complex background noise and islands on ship detection.
Next, we generate high-resolution feature maps in different feature layers instead of the previous solution of only generating one feature map. This can solve the problem of small ship targets and shallow pixels caused by long-distance detection and scattered noise.
Finally, considering the change of detection effect caused by the aspect ratio of ships, we adopt an elliptical Gaussian probability distribution scheme to replace the circular Gaussian probability distribution scheme in CenterNet, which significantly improves the detection effect of the detector without any consumption.
\section{Methodology}
\label{sec:typestyle}
\textbf{Motivation}.
SAR-ship detection encounters many challenges. Ships in SAR images are small, while backgrounds are usually complex. As a result, the small ship is easily submerged in the complex background, with a low Signal-to-Clutter Ratio (SCR). Besides, the number of ship pixels is much fewer than background pixels. That means the ship and background pixels in an image are of extreme imbalance. Meanwhile, SAR images inevitably contain speckle noise. These factors make SAR-ship detection slightly different from other detection tasks. To develop a high-precision ship detector, one should suppress the extracted features from the adverse factors of backgrounds while enhancing the beneficial features from the ship targets themselves. By completely considering both the adverse and beneficial features of SAR images with ships in them, we broadly extract different types of SAR image features, and 1) suppress data variations (e.g., complex land-sea backgrounds, scattered noise) of SAR images, and 2) enhance the features of ships that are small objects and have different aspect (length-width) ratios, therefore resulting in the improvement of ship detection. We propose a SAR-ship detection neural network (call SAR-ShipNet for short), by newly developing Bidirectional Coordinate Attention (BCA) and Multi-resolution Feature Fusion (MRF) based on CenterNet. SAR-ShipNet is composed of three modules, as shown in Figure~\ref{fig:net}.
The first module is the feature extraction network that a backbone adds the attention mechanism: BCA. The second module is feature fusion: MRF. The third module is elliptic Gauss.
\subsection{Bidirectional Coordinate Attention}
Complicated background islands and other scattered noise affect the effectiveness of ship detection. Inspired by the coordinate attention mechanism (CA) \cite{hou2021coordinate}, we propose a Bidirectional Coordinate Attention mechanism (BCA). CA aggregates information in two directions through Avgpooling and then encodes the generated feature maps into a pair of direction-aware and position-sensitive attention maps, which are complementarily applied to the input feature maps to enhance the representation of the object of interest. But there is a lot of noise redundancy in SAR pictures. Only using average pooling to aggregate information must have noise features to be extracted. It is necessary to ignore unnecessary redundant noise information in SAR pictures. Max pooling information is equally important, thus we propose a BCA mechanism that combines Avg and Max pooling (see Figure~\ref{fig:DCA Attention}).
\begin{figure}[t]
\centering
\subfigure{
\label{Fig.sub.1}
\includegraphics[width=0.9\linewidth]{Structure/comBCA.png}}
\caption{Bidirectional Coordinate Attention mechanism (BCA mechanism). ACA uses Avgpooling to aggregate features, and MCA uses Maxpooling to aggregate features.}
\label{fig:DCA Attention}
\end{figure}
BCA is formulated as follows:
\begin{equation}
\begin{aligned}
& f_{a}=\delta\left(F_{1}\left[\operatorname{avgpool}\left(x_{c}^{h}\right), \operatorname{avgpool}\left(x_{c}^{w}\right)\right]\right)\\
& g^{h}, g^{w}=\sigma\left(F_{h}\left(f_{a}^{h}\right)\right), \sigma\left(F_{w}\left(f_{a}^{w}\right)\right)\\
& y_{c}(i, j)=x_{c}(i, j) \times g_{c}^{h}(i) \times g_{c}^{w}(j)\\
\end{aligned}
\end{equation}
\begin{equation}
\begin{aligned}
& f_{m}=\delta\left(F_{2}\left[\operatorname{maxpool}\left(y_{c}^{h}\right), \operatorname{maxpool}\left(y_{c}^{w}\right)\right]\right)\\
& z^{h}, z^{w}=\sigma\left(F_{h2}\left(f_{m}^{h}\right)\right), \sigma\left(F_{w2}\left(f_{m}^{w}\right)\right)\\
& \operatorname{output}\left(x_{c}(i, j)\right)=x_{c}(i, j) \times g_{c}^{h}(i)\times g_{c}^{w}(j)\\
&\times z_{c}^{h}(i) \times z_{c}^{w}(j)
\end{aligned}
\end{equation}
where ${x}\in\mathrm{R}^{\mathrm{C}\times\mathrm{W} \times\mathrm{H}}$ is the feature map, $c$ represents the channel index, $avgpool\left(x_{c}^{h}\right)$ and $avgpool\left(x_{c}^{w}\right)$ represents the average pooled output of the c-th channel with height h in the horizontal direction and width w in the vertical direction. $[ ]$ represents the splicing operation of the feature map. ${F}_{1}$ represents the 1$\times$1 convolution. $\delta$ is the non-linear activation function, ${f_{a}}\in\mathrm{R}^{\frac{C}{\mathrm{r}}\times(\mathrm{W}+\mathrm{H}) \times 1} $ is the intermediate feature. $f_{a}^{h} \in \mathrm{R}^{\frac{\mathrm{C}}{\mathrm{r}} \times \mathrm{H} \times 1}$ and $f_{a}^{w} \in \mathrm{R}^{\frac{\mathrm{C}}{\mathrm{r}} \times \mathrm{W} \times 1}$are two vectors obtained by decomposing $f_{a}$, ${F_{h}}$ and ${F_{w}}$ are two 1${\times}$1 convolutions. $\sigma$ is the sigmoid activation function. $g^{h} \in \mathrm{R}^{\mathrm{C} \times \mathrm{H} \times 1}$ and $g^{w} \in \mathrm{R}^{\mathrm{C} \times \mathrm{W} \times 1}$ are two attention weights respectively. $y_{c}(i, j)$ is the feature point output after avgpooling attention. Similarly, the process of using the maxpooling attention mechanism is consistent with the avgpooling attention mechanism. $\operatorname{output}\left(x_{c}(i, j)\right)$ is the last output of attention through BCA. BCA makes full use of the captured position information through two different information aggregation methods so that the region of interest can be accurately captured.
\subsection{Multi-resolution Feature Fusion}
The Multi-resolution Feature Fusion module (MRF) is used to enhance the detailed information of small-scale ships to solve the problem of small ship targets and huge differences in surface morphology. In the deep network, if only the last feature layer is used to generate a high-resolution feature map, it is easy to lose the spatial position information of the ship, so we propose an MRF module to enhance ship features.
\begin{figure}[t]
\centering
\subfigure{
\label{Fig.sub.1}
\includegraphics[width=1\linewidth]{Structure/MRF.png}}
\caption{MRF module. {C3, C4, C5} are the feature layers output by the last three stages of Resnet50, Devconv is the deconvolution operation.}
\label{fig:MRF}
\end{figure}
The output of the last three stages of ResNet-50 is defined as \{C3, C4, C5\}. The MRF module uses three feature layers to generate three feature maps of the same size. Figure~\ref{fig:MRF} shows the implementation details of the MRF module. By deconvolution of \{C3, C4, C5\} multiple times. Finally, we merge the three high-resolution feature maps to enhance the detailed features of the ship. The process can be defined as:
\begin{equation}
\small
P=\operatorname{dev}_{-}3\left(C_{5}\right)+\operatorname{dev}_{-}2 \left(C_{4}\right)+\operatorname{dev}_{-}1\left(C_{3}\right)
\end{equation}
where ${dev}_{-}i$ is the deconvolution \cite{2011Adaptive} operation, $i$ is deconvolution times. P is the total feature after fusion. After the feature fusion of the MRF module, it can significantly enhance the feature extraction of ships, reduce the detection interference caused by complex backgrounds, and improve the generalization ability of the model.
\begin{table*}[]
\scriptsize
\centering
\caption{Experimental results of SAR-ShipNet and other different SAR ship detectors.}
\label{fig:all}
\begin{tabular}{ccccccccccccccc}
\toprule
\multirow{2}{*}{Method} &\multirow{2}{*}{Backbone} & \multicolumn{4}{c}{SAR-Ship} & \multicolumn{4}{c}{SSDD} & \multirow{2}{*}{FPS} & \multirow{2}{*}{Parameter}& \multirow{2}{*}{Input-size} \\
\cmidrule(r){3-6} \cmidrule(r){7-10}
&& Precision & Recall & F1& AP0.5
& Precision & Recall & F1& AP0.5 & &&\\
\midrule
YOLOV3 \cite{redmon2018YOLOV3} & DarkNet53 & 92.62 & 70.12 & 80 & 87.24& 90.67 & 67.61 & 77 & 79.06 & 83 & 234MB & 416${\times}$416 \\
YOLOV4 \cite{bochkovskiy2020YOLOV4}& DarkNet53 & 94.46 & 70.36 & 81 & 88.76& \textbf{96.94} & 75.65 & 85 & 88.46 & 70 & 245MB & 416${\times}$416 \\
YOLOX \cite{YOLOX2021}& DarkNet53 & 93.65 & 67.51 & 78 & 88.21& 90.78 & 71.36 & 80 & 85.31 & 50 & 97MB & 640${\times}$640 \\
SSD300\cite{liu2016ssd} & VGG16 & 87.79 & 72.48 & 79 & 82.90 & 93.83 & 33.04 & 49 & 74.07 & 142 & 91MB & 300${\times}$300 \\
SSD512 \cite{liu2016ssd}& VGG16 & 87.48 & \textbf{74.58} & 81 & 84.42& 90.07 & 55.22 & 68 & 70.04 & 80 & 92MB & 512${\times}$512 \\
RetinaNet\cite{lin2017focal} & ResNet50 & 91.52 & 73.24 & 81 & 88.37& 39.34 & 51.74 & 45 & 37.53 & 49 & 145MB & 600${\times}$600 \\
CenterNet\cite{zhou2019objects} & ResNet50 & 94.66 & 60.02 & 74 & 87.44& 92.57 & 59.57 & 72 & 78.86 & 127 & 124MB & 512${\times}$512 \\
FR-CNN \cite{ren2015faster} & ResNet50 & 75.68 & 70.95 & 73 & 75.19& 67.51 & 75 & 71 & 71.9 & 15 & 108MB & 600${\times}$600 \\
EfficientDet\cite{tan2020efficientdet} & EfficientNet & 89.48 & 71.77 & 80 & 85.20 & 94.33 & 39.78 & 56 & 68.27& 45 & 15MB & 512${\times}$512 \\
SAR-ShipNet(ours) & ResNet50 & \textbf{94.85} & 71.31 & \textbf{81} & \textbf{90.20}& 95.12 & \textbf{76.30} & \textbf{85} & \textbf{89.08} & 82 & 134MB & 512${\times}$512 \\
\bottomrule
\end{tabular}
\vspace{-5mm}
\end{table*}
\subsection{Elliptic Gauss}
In the original CenterNet, the center point of the object needs to be mapped to the heatmap to form a circular Gaussian distribution. This distribution is used to measure the discrete distribution of the center point. For each GT, the key point $p \in R^{2}$ corresponding to category c, then calculate the key points after down sampling $\tilde{p}=\left\lfloor\frac{p}{R}\right\rfloor$. CenterNet splat all ground truth keypoints onto a heatmap $Y \in[0,1]^{\frac{W}{R} \times \frac{H}{R} \times C}$ using a Gaussian kernel $Y_{x y c}=\exp \left(-\frac{\left(x-\tilde{p}_{x}\right)^{2}+\left(y-\tilde{p}_{y}\right)^{2}}{2 \sigma_{p}^{2}}\right)$, where $\sigma_{p}$ is an object size-adaptive standard deviation.
The Gaussian kernel generated by this method is a circular distribution. The parameter $\sigma_{p}$ in the Gaussian kernel is only related to the area of GT, and the aspect ratio of GT is not fully considered. Ships in real life usually have a large aspect ratio. To fully consider the aspect ratio of GT, we are inspired by the elliptic Gaussian method in TtfNet \cite{2019Training}. When the key point $\tilde{p}=\left\lfloor\frac{p}{R}\right\rfloor$ is dispersed on the heatmap, the 2D Gaussian kernel $Y_{x y c}$ is:
\begin{equation}
\small
\mathbf{Y}_{x, y, c}=\exp \left(-\frac{\left(x-\tilde{p}_{x}\right)^{2}}{2 \sigma_{x}^{2}}-\frac{\left(y-\tilde{p}_{y}\right)^{2}}{2 \sigma_{y}^{2}}\right)
\end{equation}
where $\sigma_{x}=\frac{\alpha w}{6}$, $\sigma_{y}=\frac{\alpha h}{6}$, $\alpha$ is a super parameter, $w$ and $h$ are the width and height of GT respectively.
\subsection{Loss Function}
Our training loss function consists of three parts:
\begin{equation}
\small
\begin{aligned}
\operatorname{Loss}=
&\frac{1}{N_{p o s}} \sum_{x y c} F L\left(\hat{p}, p\right)+\frac{\lambda_{1}}{N_{p o s}} \sum_{i}L_{1}\left(\hat{L}_{wh}, L_{w h}\right)\\
& +\frac{\lambda_{2}}{N_{p o s}} \sum_{i} L_{1}(\hat{s}, s)
\end{aligned}
\end{equation}
where ${\hat{p}}$ is the confidence of classification prediction, ${{p}}$ is the ground-truth category label, $FL$ is Focal loss\cite{lin2017focal}. ${ \hat{L}_{wh}}$ are the width and height of the predicted bounding box, ${ L_{w h}}$ are the width and height of the ground-truth bounding box. ${s}$ is the offset $\left(\sigma x_{i}, \sigma y_{i}\right)$ generated by the center point $\left(x_{i}, y_{i}\right)$ of the down-sampling process, ${\hat{s}}$ is the offset predicted value. ${N_{p o s}}$ is the number of positive samples, ${\lambda_{1}}$ and ${\lambda_{2}}$ are the weight parameters. We set $\lambda_{1}=0.1$ and $\lambda_{2}=1$.
\begin{table}
\scriptsize
\centering
\caption{Ablation experiments on the SAR-Ship dataset.}
\label{fig:comtab3}
\begin{tabular}{cccc|cccc}
\toprule
\multicolumn{2}{c}{CenterNet}&\multirow{2}{*}{MRF}&\multirow{2}{*}{EGS}& \multirow{2}{*}{Precision}&\multirow{2}{*}{Recall}&\multirow{2}{*}{ F1 }&\multirow{2}{*}{AP0.5}\\
\cline{1-2}
CA & BCA & & & & &\\
\hline
$\times$& $\times$& $\times$&$\times$& 94.66& 60.20& 74& 87.44\\
$\surd$& $\times$& $\times$&$\times$& 96.95& 51.80& 68& 88.56\\
$\times$& $\surd$& $\times$&$\times$& 96.76& 57.71& 72& 89.10\\
$\times$& $\surd$& $\surd$&$\times$& \textbf{97.06}& 50.19& 66& 89.40\\
$\times$& $\surd$& $\surd$&$\surd$& 94.85& \textbf{71.31}& \textbf{81}& \textbf{90.20}\\
\toprule
\end{tabular}
\vspace{-5mm}
\end{table}
\section{Experiments}
\subsection{Experimental Dataset}
\label{sec:majhead}
We directly evaluate the SAR-ShipNet model on the SAR-Ship \cite{wang2019sar} and SSDD\cite{li2017ship} dataset. The SAR-ship dataset contains ship slices (43819) and the number of ships (59535) and the size of the all ship slices is fixed at 256${\times}$256 pixels. The SSDD data set has a total of 1160 images and 2456 ships. We randomly divide the data set into the training set, validation set, and test set at a ratio of 7:1:2.
\subsection{Experimental results}
\begin{table}
\scriptsize
\centering
\caption{SAR-ShipNet test results of different $\alpha$.}
\begin{tabular}{c| c | c | c | c}
\hline
Parameter & Precision & Recall & F1 & AP0.5 \\
\hline
$\alpha$ = 0.1 & 96.16 & 6.12 & 12 & 87.40 \\
$\alpha$ = 0.2 & 97.84 & 7.2 & 13 & 88.16 \\
$\alpha$ = 0.3 & \textbf{98.12} & 24.38 & 39 & 88.81 \\
$\alpha$ = 0.4 & 97.58 & 42.11 & 59 & 89.48 \\
$\alpha$ = 0.5 & 95.86 & 63.12 & 76 & 89.80 \\$\alpha$ = 0.6 & 97.36 & 55.82 & 71 & 90.03 \\
$\alpha$ = 0.7 & 96.61 & 61.58 & 75 & 89.85 \\
$\alpha$ = 0.8 & 94.85 & \textbf{71.31} & \textbf{81} & \textbf{90.20} \\
$\alpha$ = 0.9 & 95.88 & 65.2 & 78 & 90.16
\\
\hline
Circular Gaussian & 97.06 & 50.19 & 66 & 89.40 \\
\end{tabular}
\label{tab:e}
\vspace{-5mm}
\end{table}
We evaluate our SAR-ShipNet on 4 evaluation metrics and compare it with other methods. Table~\ref{fig:all} shows the quantitative results of all the methods in two datasets. Compared with other detectors SAR-ShipNet achieves the best $F_{1}$, and AP on two datasets, indicating that our model has the best overall performance. This is because SAR-ShipNet uses the attention mechanism to pay more attention to ship features, and uses feature fusion to strengthen small targets and fully consider the aspect ratio of the ship. Experiments show that our model can achieve the best comprehensive performance on both the large dataset SARShip and the small dataset SSDD. Table~\ref{fig:comtab3} shows the ablation experimental results. It can be found that CA, BCA, MRF, and elliptic Gauss can increase the detection performance of the model. In particular, after adding the attention mechanism, the precision and AP have been improved, which shows that our model reduces the misclassification of islands and backgrounds into ships. Table~\ref{tab:e} shows the experimental results of the effect of hyperparameter $\alpha$ on SAR-Ship dataset. When $\alpha$ = 0.8, we get the best AP (90.20).
\section{Conclusion}
In this paper, we propose an effective SAR-ShipNet for SAR-ship detection. SAR-ShipNet mainly has three modules: the BCA mechanism, the MRF module, and the elliptic Gaussian module. BCA mechanism is used to solve the problem of ship detection in complex backgrounds. It can make the model pay attention to ship features as much as possible while ignoring background noise. The MRF module is used to solve the problems of small ship sizes and shallower pixels in long-distance observation. Elliptical Gauss fully considers the influence of ship aspect ratio detection. Experimental results show that our SAR-ShipNet achieves a competitive detection performance.
\bibliographystyle{IEEE}
| {'timestamp': '2022-03-30T02:31:57', 'yymm': '2203', 'arxiv_id': '2203.15480', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15480'} | arxiv |
\section{Introduction}
Artificial intelligence (AI) technologies under rapid development have been widely studied and deployed in various scenarios.
As a data-driven technology, its reliability and accuracy largely depend on the volume and quality of source data.
However, it is recognized as a big challenge for most enterprises to obtain a dataset with sufficient volume and quality for AI model training.
In the meantime, data privacy is another crucial issue that needs to be considered among different involved parties~\cite{xu2014information}.
To this end,
it is preferred in real-world implementations that data be kept locally,
forming a variety of isolated data islands.
This makes it difficult to directly aggregate data in the cloud and centrally train the AI models.
Therefore, federated learning (FL)~\cite{mcmahan2017communication, bonawitz2019towards, yang2019federated} has emerged as a novel paradigm to address these challenges.
A generic and practical FL framework is essentially a distributed training process, and each iteration of FL includes the following three steps~\cite{yang2019federated}. Firstly, the server broadcasts the current global model parameters to all the involved devices. Next, each device performs local model training based on its local data and then sends the local updates back to the server.
Finally, the server aggregates the local updates and generates new global model parameters for the next iteration of distributed training. In essence, the server and devices aim to collaboratively solve a distributed optimization problem, which is typically referred to as \emph{Federated Optimization}~\cite{konevcny2016federated}. Different from centralized optimization, federated optimization confronts several practical challenges including communication efficiency, data heterogeneity, security, system complexity, etc.~\cite{wang2021field}.
Among them, communication efficiency is of utmost importance since the communication between the server and devices usually suffers from unreliable network connections, limited resources, and severe latency~\cite{shi2020communication}.
To deal with the communication issue, a large amount of research has been conducted in federated optimization. On the one hand, reducing the communication volume in each iteration is an effective method.
Specifically, quantization and sparsification techniques are employed to reduce the transmitted bits and remove the redundant updates of parameters, respectively~\cite{bernstein2018signsgd, aji2017sparse}.
These compression techniques have shown remarkable effectiveness for high-dimensional models.
However, their design needs to consider the compatibility for the aggregation operation in FL~\cite{wang2021field}.
On the other hand, minimizing the total communication rounds is another primary method. To this end,
zeroth-order methods~\cite{chen2019zo, gao2020can} have been investigated for some restrictive circumstances (e.g., black-box adversarial attack, non-smooth objective function) while showing great potential as only the objective function value is required to approximate derivative information~\cite{nesterov2017random}.
In the situation where gradients are available, first-order methods are widely used.
By increasing the amount of local computation, various gradient descent based methods have been shown that can significantly decrease the total number of communication rounds~\cite{mcmahan2017communication, woodworth2020local, yuan2020federated, pathak2020fedsplit}.
Nevertheless, these existing approaches, i.e., zeroth-order and first-order approaches, are governed by the linear convergence in the best case.
As a result, the total number of iteration rounds required to achieve the desired accuracy is relatively large~\cite{bischoff2021second}.
Therefore, the second-order methods (e.g., Newton-type methods) become attractive in such a wireless environment due to their fast local quadratic convergence rate.
Nevertheless, the construction of the canonical Newton update requires both the Hessian and gradient information, where the distributed situation in FL makes gathering Hessian information a severe communication overhead.
To this end, second-order federated optimization algorithms have been investigated to resolve this issue, which can be divided into two categories~\cite{bischoff2021second}.
One is to use second-order information implicitly.
In~\cite{shamir2014communication}, a mirror descent update is carried out on the local function to approximate the Hessian information.
In~\cite{smith2018cocoa}, the dual problems of the objective function are used to serve as the local subproblems.
The other category is to use second-order information explicitly.
In~\cite{wang2018giant}, a globally improved approximate Newton method (GIANT) using local Hessian for aggregation is proposed.
In~\cite{crane2019dingo, crane2020dino}, the optimization of the gradient's norm acts as the surrogate function.
In~\cite{zhang2015disco}, Hessian-vector product computation and conjugate gradient descent are performed on the devices and the server, respectively.
The fast convergence rate with efficient communication makes the application of these second-order algorithms a great benefit to FL.
Despite the potential in the application of second-order algorithms to reduce the total communication rounds and improve the communication efficiency, the transmission of FL model parameters through wireless channels still confronts great challenges as wireless channels are always noisy with limited resources and high latency~\cite{yang2020federatedIOT, letaief2019roadmap, li2021delay}.
Based on the conventional ``transmit-then-communicate'' principle, the aggregation of FL model parameters can be achieved by digital coded transmission and orthogonal multiple access (OMA) schemes~\cite{amiri2020machine, elgabli2021harnessing, chang2020communication}.
By taking advantage of OMA and error correction techniques, local updates are transmitted separately in the quantized form and then decoded individually at the server.
In this way, the model transmission can be deemed to be reliable and trustworthy.
However, the increase in the number of devices will inevitably lead to a sharp increase in total communication latency and bandwidth requirement, which is often intolerable.
Therefore, a novel technique called over-the-air computation (AirComp)~\cite{nazer2007computation} has emerged in FL algorithm design to decrease the communication cost based on the ``compute-when-transmit'' principle~\cite{yang2020federated, zhu2019broadband, amiri2020machine, sery2020analog, liu2020privacy, elgabli2021harnessing, liu2020reconfigurable, xiaowen2021optimized, xu2021learning, zhu2020one, wei2022federated, fan2021joint}.
This technique leverages the superposition property of multiple access channels to realize the aggregation operation.
Through the simultaneous transmission of all local updates, which are aggregated over the air, the communication overheads are significantly decreased.
Specifically, the authors in~\cite{yang2020federated} proposed an AirComp-based approach for FL with joint design of device selection and beamforming to improve the statistical learning performance.
In~\cite{sery2020analog}, a novel Gradient-Based Multiple Access (GBMA) algorithm was put forward to perform FL with an energy scaling law for approaching the convergence rate of centralized training.
In~\cite{xiaowen2021optimized}, the authors investigated the power control optimization for enhancing the learning performance of over-the-air federated learning.
In~\cite{liu2020reconfigurable, wang2020federated}, intelligent reflecting surface (IRS) technology was used to achieve fast yet reliable model aggregation for over-the-air federated learning.
The authors in~\cite{xu2021learning} proposed the dynamic learning rate design for AirComp-based FL.
Overall, the application of over-the-air computation in FL also improves the communication efficiency a lot.
Based on the above observations, this paper proposes to improve communication efficiency from two aspects, i.e., reducing communication rounds and the communication overhead in each round.
To reduce the communication rounds, we shall utilize second-order information during the training process of FL.
Due to the fast convergence speed, all these existing second-order state-of-the-arts have shown substantial improvement in terms of the total iteration rounds compared with first-order methods.
However, their iterative procedures still have at least two communication rounds per iteration, i.e., the aggregation of gradient and second-order information.
To avoid such two communication rounds, a recently proposed second-order method~\cite{ghosh2020distributed} cuts down the aggregation of gradients and realizes one communication round per iteration.
Motivated by this, we adopt local Newton step aggregation for wireless FL algorithm design.
Specifically, the product of the local Hessian's inversion and the local gradient is used to construct a local Newton step for aggregation.
By this means, the devices only need to communicate once with the server per iteration, cutting down the transmission of local Hessian matrices and local gradients while keeping the convergence behavior of canonical Newton's method.
Moreover, due to the limited radio resources, we adopt over-the-air computation, which has been widely used in the existing wireless FL schemes, to further reduce the communication overheads in each round.
Based on this efficient local Newton step aggregation and AirComp technique, we propose an over-the-air second-order federated algorithm over wireless networks.
Furthermore, we provide a rigorous theoretical analysis of the convergence behavior of our proposed method.
The results show that
the transmission of the above-mentioned product is sufficient to guarantee convergence and our proposed method outperforms first-order algorithms. To be specific,
the proposed algorithm keeps a linear-quadratic convergence rate, which means it can achieve the optimal point with a quadratic convergence rate and degenerate into the linear convergence rate when it is close enough to the optimal point.
However, as a result of local Newton step aggregation, device selection, and channel noise, there is an error term in each iteration. As the training proceeds, this accumulative error term will deflect the model parameters and affect learning performance. In order to mitigate the impact of this error term, we further propose a joint optimization approach of device selection and receiver beamforming.
Specifically, Gibbs Sampling \cite{geman1984stochastic} is adopted to determine the set of selected devices, and the difference-of-convex-functions (DC) algorithm \cite{tao1997convex} is tailored to optimize the receiver beamforming during the iterative process of Gibbs Sampling.
\subsection{Contributions}
In this paper, we propose a novel over-the-air FL algorithm via the second-order optimization method.
Then, we theoretically analyze its convergence behavior, which shows that the proposed algorithm keeps a linear-quadratic convergence rate, with an accumulative error term arising during the FL process.
To minimize the error gap and achieve better performance, we formulate this problem as a combinatorial non-convex problem and propose a system optimization approach to solve it.
The main contributions of this paper are summarized as follows:
\begin{itemize}
\item[1)] We design a novel AirComp-based FL algorithm by leveraging the principles of distributed second-order optimization methods and exploiting the waveform superposition property of a wireless multi-access channel for model aggregation.
This algorithm is fundamentally different from most existing works which only consider gradient descent/SGD in training.
The utilization of second-order information significantly reduces the total communication rounds in Aircomp-based FL, which further improves the communication efficiency.
\item[2)] We theoretically analyze the convergence behaviors of our proposed over-the-air second-order federated optimization algorithm with the presence of data heterogeneity (i.e., the different data sizes), device selection, and channel noise.
The results show that our algorithm keeps a linear-quadratic convergence rate and outperforms first-order methods;
\item[3)] We formulate a system optimization problem to minimize the accumulative error gap during the execution of our proposed algorithm. Correspondingly, we propose a system optimization approach.
Through the combination of Gibbs Sampling and DC algorithm, we jointly optimize the device selection and receiver beamforming;
\item[4)]
We conduct extensive experiments to demonstrate that our proposed algorithm and system optimization approach can achieve better performance than other state-of-art approaches.
\end{itemize}
\subsection{Organization and Notations}
The remainder of this paper is organized as follows.
Section \ref{Federated Edge Learning Model and Algorithm} presents the federated learning model and our FL algorithm.
Section \ref{Theoretical Analysis} provides the convergence analysis of our proposed algorithm.
Section \ref{System Optimization} analyzes the system optimization problem arising from the error term, and describes our joint optimization method of device selection and beamforming.
The experimental results are given in Section \ref{Simulation Results}.
Finally, Section \ref{Conclusion} concludes the whole paper.
$\|\cdot\|_p$ is the $\ell_p$-norm, $\|\cdot\|_\mathsf{F}$ is the Frobenius norm.
Italic, boldface lower case and upper case letters represent scalars, vectors and matrices, respectively.
For a given set $\mathcal{X}$, $|\mathcal{X}|$ denotes the cardinality of $\mathcal{X}$.
The operators $(\cdot)^\mathsf{T}$, $(\cdot)^\mathsf{H}$, $\text{Tr}(\cdot)$ and $\text{diag}(\cdot)$ denote the transpose, Hermitian transpose, trace, and diagonal matrix, respectively.
$\mathbb{E}[\cdot]$ denotes the statistical expectation.
\section{Federated Learning Model and Algorithm}
\label{Federated Edge Learning Model and Algorithm}
\subsection{Federated Learning System}
\begin{figure}[htbp!]
\centering
\includegraphics[width=0.4\linewidth]{fig/FL_system.pdf}
\caption{Illustration of wireless FL systems.}
\label{FL system}
\vspace{-0.6cm}
\end{figure}
A typical wireless federated learning system consists of a group of distributed devices and one server, where the communication takes place over wireless channels.
As depicted in Fig.~\ref{FL system}, there are $m$ single-antenna devices and a server equipped with $k$ antennas to collaboratively complete a learning task.
We denote $\mathcal{D}$ as the entire sample set used in the FL task.
Each device $i \in \mathcal{S}$ stores a sample set $\mathcal{D}_{i} = \left\{\bm{z}_{i, j} := \left(\bm{u}_{i, j}, v_{i, j}\right)\right\}$ and $\mathcal{D} = \bigcup_{i=1}^{m} \mathcal{D}_{i}$ with $\card{\mathcal{D}} = n$, where $\mathcal{S}$ denotes the index set of devices, $\bm{u}_{i, j}$ is the feature vector and $v_{i, j}$ is the corresponding label.
As an important part of the learning task, the loss function is usually used for model parameter estimation.
Here, the loss function of the $i$-th device is defined by
\begin{small}
\begin{equation}
F_{i}\left(\bm{w}\right)=\frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} f\left(\bm{w}, \bm{z}_{i, j}\right)+\frac{\gamma}{2}\|\bm{w}\|_{2}^{2}\;.
\label{local_loss}
\end{equation}
\end{small}
The first term is the average of $f\left(\bm{w}, \bm{z}_{i, j}\right)$, where $\bm{w} \in \mathbb{R}^{d}$ is the model parameter vector and function $f$ is used to measure the prediction error of $\bm{w}$. The second term is for regularization
with $\gamma$ being the weighting parameter. FL aims to train a suitable model at the server by aggregating the results collected from multiple devices, on which the distributed models are trained based on local datasets. Specifically, the server needs to optimize the following global loss function:
\begin{small}
\begin{equation}
F \bracket{\bm{w}} = \frac{1}{n}\sum_{i=1}^{m}\card{\mathcal{D}_{i}}F_{i}\bracket{\bm{w}} \;.
\label{global_loss}
\end{equation}
\end{small}
\subsection{Federated Second-Order Optimization Algorithm}
As typical training algorithms, gradient descent methods (e.g., SGD \cite{bottou2012stochastic}, batch gradient descent) are widely used.
However, the relatively slow convergence rate of gradient descent results in too many communication rounds between the server and devices to complete the learning task.
Thus, many research works have been done to improve the communication efficiency of gradient descent in FL.
For example, some methods utilize multiple local updates to reduce the number of communication rounds \cite{mcmahan2017communication, woodworth2020local},
while several algorithms employ compression techniques to reduce transmitted bits and save communication costs~\cite{bernstein2018signsgd, aji2017sparse, vogels2019powersgd}.
Although these schemes have greatly improved the communication efficiency of gradient descent in FL, they are still limited by the linear convergence rate.
To address this issue, this paper considers second-order algorithms with a faster convergence rate such that the communication rounds can be significantly reduced.
The descent direction vector of canonical Newton's method~\cite{nocedal2006numerical} is given by
\begin{small}
\begin{equation}
\bm{p} = \left(\nabla^{2}F\left(\bm{w}\right)\right)^{-1}\nabla F\left(\bm{w}\right).
\label{Newton step}
\end{equation}
\end{small}
The canonical Newton's method can achieve a locally quadratic convergence rate so that its total iteration rounds needed to complete the learning task are much fewer than first-order algorithms.
However, in the distributed scenario, the computation of $\nabla^{2}F\left(\bm{w}\right) = \frac{1}{m}\sum_{i=1}^{m} \nabla^{2}F_{i}\left(\bm{w}\right)$ requires the aggregation of the local Hessian $\nabla^{2}F_{i}\left(\bm{w}\right)$.
The transmission of such $d \times d$ matrices inevitably brings huge communication overheads.
To resolve this issue, numerous second-order distributed machine learning algorithms have been proposed, such as DANE \cite{shamir2014communication}, DISCO \cite{zhang2015disco}, GIANT \cite{wang2018giant}, DINGO \cite{crane2019dingo}, and DINO \cite{crane2020dino}.
These methods approximate Hessian information in varied forms to avoid the direct transmission of Hessian matrices and approach the performance of canonical Newton's method.
However, at least two communication rounds per iteration are required, including the aggregation of local gradients and second-order descent directions.
Different from these second-order algorithms, which require the aggregation of local gradients $\nabla F_{i}\left(\bm{w}\right)$ to compute the global gradient $\nabla F\left(\bm{w}\right) = \frac{1}{m} \sum_{i=1}^{m} \nabla F_{i}\left(\bm{w}\right)$, a recently proposed COMRADE \cite{ghosh2020distributed} method cuts down this aggregation.
By this means, the number of communication rounds required per iteration is reduced to one, further improving the communication efficiency.
Motivated by this, we leverage the local Newton step aggregation as in~\cite{ghosh2020distributed} to achieve a faster convergence rate with fewer communication rounds.
The product of the inversion of the local Hessian matrix $\left(\nabla^{2}F_{i}\left(\bm{w}\right)\right)^{-1}$ and the local gradient $\nabla F_{i}\left(\bm{w}\right)$ is used to serve as the local descent direction vector $\bm{p}_{i} = \left(\nabla^{2}F_{i}\left(\bm{w}\right)\right)^{-1}\nabla F_{i}\left(\bm{w}\right)$ for model aggregation.
In this way, with the preserved convergence behavior of Newton's method, only one aggregation of the $d$-dimensional local descent direction vectors will be carried out in each iteration.
To be specific, at $t$-th iteration, the procedure of our proposed method is summarized as follows:
\begin{itemize}
\item[1)] \textbf{Device Selection}: The server decides the set of devices, denoted as $\mathcal{S}_{t}$, to participate in this iteration.
\item[2)] \textbf{Global Model Broadcast}: The server disseminates the current global model parameter vector $\bm{w}_{t}$ to the selected devices through the wireless channel.
\item[3)] \textbf{Local Model Update}: After the $i$-th device receives global model parameter vector $\bm{w}_{t}$,
it first computes the local gradient based on local data samples:
\begin{small}
\begin{equation}
\bm{g}_{t,i} = \nabla F_{i}\left(\bm{w}_{t}\right)=\frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} \nabla f\left(\bm{w}_{t} ,\bm{z}_{i, j}\right)+\gamma \bm{w}_{t}\;,
\label{local_gradient}
\end{equation}
\end{small}
where the derivatives are taken with respect to the first argument.
Afterwards, the $i$-th device calculates the local Hessian matrix according to local gradient and local data samples:
\begin{small}
\begin{equation}
\bm{H}_{t, i}=\nabla^2F_{i}\left(\bm{w}_{t}\right)=\frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} \nabla^{2}f\left(\bm{w}_{t}, \bm{z}_{i, j}\right)+\gamma \bm{I}_{d}\;.
\label{local_hessian}
\end{equation}
\end{small}
The $i$-th device then gets a local Newton descent direction vector from previous results:
\begin{small}
\begin{equation}
\bm{p}_{t,i} = \bm{H}_{t, i}^{-1} \bm{g}_{t,i} = \left(\nabla^{2}F_{i}\left(\bm{w}_{t}\right)\right)^{-1}\nabla F_{i}\left(\bm{w}_{t}\right).
\label{approx_newton_direction}
\end{equation}
\end{small}
In practice, this step involves the computation of Hessian matrix and its inverse operation.
To reduce the computational complexity, we adopt the conjugate gradient method~\cite{nocedal2006numerical} to obtain an approximate local Newton descent direction vector.
According to the analysis in~\cite{wang2018giant}, this approximate solution will not have a significant impact on the convergence behavior.
\item[4)] \textbf{Model Aggregation}: The devices participating in the $t$-th iteration transmit local Newton descent direction vectors $\{\bm{p}_{t,i}\}$ to the server through the wireless channel,
and the server aggregates them to obtain the global descent direction vector for this iteration:
\begin{small}
\begin{equation}
\tilde{\bm{p}}_{t} = \frac{1}{\underset{i \in \mathcal{S}_{t}}{\sum}\card{\mathcal{D}_{i}}}\underset{i \in \mathcal{S}_{t}}{\sum}\card{\mathcal{D}_{i}} \bm{p}_{t,i} \;.
\label{averaged_local_descent_direction}
\end{equation}
\end{small}
\item[5)] \textbf{Global Model Update}: Finally, the server updates the model parameter vector $\bm{w}_{t}$ through global descent direction vector $\tilde{\bm{p}}_{t}$ and learning rate $\alpha$.
\end{itemize}
\begin{small}
\begin{equation}
\bm{w}_{t+1} = \bm{w}_{t} - \alpha \tilde{\bm{p}}_{t}\;.
\label{global_update}
\end{equation}
\end{small}
Notably, the Newton's method has a faster convergence rate than the gradient descent methods because it makes full use of the curvature information of the loss function, but the aggregation of the $d \times d$ local Hessian matrices for Newton descent direction in~\eqref{Newton step} aggravates the communication overheads in another way.
As implied in Step 3) of our proposed FL scheme, it does not need to compute the global gradient $\nabla F\left(\bm{w}\right)$ and Hessian $\nabla^{2}F\left(\bm{w}\right)$ to get a precise Newton descent direction by aggregating the local $\nabla F_i\left(\bm{w}\right)$ and $\nabla^{2}F_i\left(\bm{w}\right)$.
Note that this approximation also brings a controllable error gap with the exact descent direction vector, and its impact on the convergence rate will be analyzed in Section~\ref{Theoretical Analysis}.
\subsection{Communication Model}
To further reduce the communication overheads, this subsection focuses on the design of the communication model between the server and devices.
Specifically, there are two communication-related steps in each iteration of our FL algorithm.
One is global model broadcasting in the downlink. Since only one global parameter vector needs to be broadcasted, the total communication cost of this step is negligible~\cite{sery2020analog, chang2020communication, amiri2020machine, amiri2020federated}.
The other is model aggregation in the uplink, which involves the transmission of $|\mathcal{S}_{t}|$ local descent direction vectors. Accordingly, the uploading process of this step brings the primary communication overhead in FL, which is also the focus of our communication model design.
In this paper, we consider a block fading channel.
Each block is divided into $d$ time slots, ensuring the transmission of one local descent direction vector.
Suppose the traditional orthogonal multiple access channel is used to perform the model aggregation procedure.
Each device will use one coherent block to transmit its local descent direction vector.
Consequently, the time consumed for transmission in this step will increase linearly with the number of participating devices $|\mathcal{S}_{t}|$.
Unfortunately, the number of devices $|\mathcal{S}_{t}|$ is usually very large, which inevitably leads to unacceptable communication overheads.
In order to eliminate this issue, we adopt a state-of-the-art technique named over-the-air computation (AirComp)~\cite{nazer2007computation}, which is shown to be effective in assisting the analog aggregation in FL studies~\cite{yang2020federated, zhu2019broadband, amiri2020machine, sery2020analog, liu2020privacy, elgabli2021harnessing, liu2020reconfigurable, xiaowen2021optimized}.
This technique captures the nomographic function form of averaging the local descent direction vectors and implements the summation operation by the superposition property of the wireless channel.
In this way, the server can receive the summation by letting all devices transmit their local descent direction vectors simultaneously in each block.
Therefore, the entire process of model aggregation can be completed over the air in a single coherent block, and the communication overheads can be significantly reduced.
More specifically, in the $t$-th iteration, the over-the-air computation can be represented as the nomographic function form~\cite{zhu2018mimo} : $ \hat{\bm{p}}_{t}=\psi\left(\sum_{i \in \mathcal{S}_t} \varphi_{i}\left(\bm{p}_{t,i}\right)\right).$
To reduce the transmission power, the pre-processing function $\phi_{i}$ and post-processing function $\psi$ can be designed to normalize and de-normalize the local descent direction vector $\bm{p}_{t,i}$~\cite{zhu2019broadband}.
However, due to the variety of $\bm{p}_{t,i}$ among devices, the stationary of the information-bearing symbols obtained by such normalization methods can not be guaranteed, which further leads to the inapplicability of the uniform-forcing transceiver design in the following.
Therefore, to guarantee the stationary of the information-bearing symbols, we adopt the data-and-CSI-aware design as in~\cite{guo2020analog}.
Before transmission, $\bm{p}_{t,i}$ is first pre-processed and encoded as $\bm{s}_{t,i} \in \mathbb{R}^{d}$ at the $i$-th device:
\begin{small}
\begin{equation}
\bm{s}_{t,i} = \phi_{i}\bracket{\bm{p}_{t,i}} = \frac{\card{\mathcal{D}_{i}}\bm {p}_{t,i}}{\bar{p}_{t,i}} \;,
\label{preprocess}
\end{equation}
\end{small}
where $\bar{p}_{t,i} = \card{\mathcal{D}_{i}}\norm{\bm{p}_{t,i}}$ is the product of the size of local dataset and the magnitude of $\bm{p}_{t,i}$.
In this way, the stationary of the information-bearing symbols $\{\bm{s}_{t,i}\}$ can be guaranteed.
Hence, we have $\norm{\bm{s}_{t,i}}^{2} = 1$ and $\mathbb{E}\bracket{|\bm{s}_{t,i}[j]|^{2}} = \frac{1}{d}, \;\forall j\in d$, where $\bm{s}_{t,i}[j]$ denotes the $j$-th entry of $\bm{s}_{t,i}$.
Thereafter, each entry of the transmitted signal sent by the $i$-th device is given by:
\begin{small}
\begin{equation}
\bm{x}_{t,i}[j] = b_{t,i}\bm{s}_{t,i}[j] \;,
\label{transmitted_signal}
\end{equation}
\end{small}
where $\bm{x}_{t,i}[j] \in \mathbb{R}$ and $\bm{s}_{t,i}[j] \in \mathbb{R}$ denote two representative entries of $\bm{x}_{t,i}$ and $\bm{s}_{t,i}$, respectively. $b_{t,i} \in \mathbb{R}$ is the transmitted power control factor, and the power constraint for each device in the whole process is given by:
\begin{small}
\begin{equation}
\mathbb{E}\bracket{|b_{t,i}\bm{s}_{t,i}[j]|^{2}} = b_{t,i}^{2} / d \leq P_{0}, \; \forall t, i\;,
\label{power_constraint}
\end{equation}
\end{small}
where $P_{0}$ denotes the maximum transmitted power of each device.
Let $\bm{h}_{t,i} \in \mathbb{C}^{k}$ be the channel coefficient vector between the $i$-th device and the server in the $t$-th block, which remains unchanged in each block but differs among blocks.
In addition, we assume that perfect channel state information (CSI) is available at all devices to adjust their transmitted signals based on channel coefficients~\cite{sery2020analog, amiri2020machine, liu2020privacy, zhu2019broadband, yang2020federated, wang2020federated, seif2020wireless, wang2020wireless, fang2021over}.
Then the received signal $\bm{y}_{t} \in \mathbb{C}^{k}$ at the server can be represented as follows:
\begin{small}
\begin{equation}
\bm{y}_{t} = \sum_{i\in\mathcal{S}_{t}}\bm{h}_{t,i}\bm{x}_{t,i}[j] + \bm{e}_{t} = \sum_{i\in\mathcal{S}_{t}}\tilde{\bm{h}}_{t,i}b_{t,i}\card{\mathcal{D}_{i}}\bm{p}_{t,i}[j] + \bm{e}_{t}\;,
\label{received_signal}
\end{equation}
\end{small}
where $\tilde{\bm{h}}_{t,i} = \frac{\bm{h}_{t,i}}{\bar{p}_{t,i}}$ is the effective channel coefficient introduced in~\cite{guo2020analog}, $\bm{e}_{t} \in \mathbb{C}^{k}$ denotes the additive white Gaussian noise vector with the power of $\sigma^{2}$.
We define the signal-to-noise ratio (SNR) as $P_{0} / \sigma^{2}$.
After the server receives $\bm{y}_{t}$, it can obtain the value $\bm{r}_{t}[j] \in \mathbb{C}$ before post-processing:
\begin{small}
\begin{equation}
\bm{r}_{t}[j] = \frac{1}{\sqrt{\eta_{t}}}\bm{a}_{t}^{\mathsf{H}}\bm{y}_{t} = \frac{1}{\sqrt{\eta_{t}}}\bracket{\bm{a}_{t}^{\mathsf{H}}\sum_{i\in\mathcal{S}_{t}}\tilde{\bm{h}}_{t,i}b_{t,i}\card{\mathcal{D}_{i}}\bm{p}_{t,i}[j] + \bm{a}_{t}^{\mathsf{H}}\bm{e}_{t}} \;,
\label{process_received_signal}
\end{equation}
\end{small}
where $\bm{a}_{t} \in \mathbb{C}^{k}$ represents the receiver beamforming vector and $\eta_{t}$ is the scaling factor.
For convenience, we use $\bm{H}_{t} = [\tilde{\bm{h}}_{t,1},\ldots,\tilde{\bm{h}}_{t,|\mathcal{S}_{t}|}]$ to denote the effective channel coefficient matrix,
$\bm{B}_{t} = \text{diag}\bracket{b_{t,1},\ldots,b_{t,|\mathcal{S}_{t}|}}$ to denote the power transmission matrix,
$\bm{G}_{t} = [\card{\mathcal{D}_{1}}\bm{p}_{t,1}, \ldots, \card{\mathcal{D}_{|\mathcal{S}_{t}|}}\bm{p}_{t,|\mathcal{S}_{t}|}]^{\mathsf{T}}$ to denote the signal transmission matrix, and $\bm{E}_{t} = [\bm{e}_{t,1}, \ldots, \bm{e}_{t,d}]$ to denote the noise matrix.
So the total estimated value vector $\bm{r}_{t} = [\bm{r}_{t}[1], \ldots, \bm{r}_{t}[d]]$ can be written as:
\begin{small}
\begin{equation}
\bm{r} = \frac{1}{\sqrt{\eta_{t}}}\bracket{\bm{a}^{\mathsf{H}}\bm{H}_{t}\bm{B}_{t}\bm{G}_{t} + \bm{a}_{t}^{\mathsf{H}}\bm{E}_{t}} \;.
\label{rewrite_process_received_signal}
\end{equation}
\end{small}
To alleviate the influence of the distortion caused by noise and improve the performance of over-the-air computation, each entry of $\bm{B}_{t}$ follows the uniform-forcing transceiver design~\cite{chen2018uniform}:
\begin{small}
\begin{equation}
b_{t,i} = \sqrt{\eta_{t}}\frac{\bracket{\bm{a}_{t}^{\mathsf{H}}\tilde{\bm{h}}_{t,i}}^{\mathsf{H}}}{\norm{\bm{a}_{t}^{\mathsf{H}}\tilde{\bm{h}}_{t,i}}^{2}} \;.
\label{transmit_vector}
\end{equation}
\end{small}
where the transmission scalar $b_{t,i}$ can be computed after the calculation of receiver beamforming vector in system optimization, and then feed back to each device~\cite{yang2020federated}. Substituting~\eqref{transmit_vector} into~\eqref{rewrite_process_received_signal}, we can get a simplified version of $\bm{r}_{t}$:
\begin{small}
\begin{equation}
\bm{r}_{t} = \sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}\bm{p}_{t,i}^{\mathsf{T}} + \frac{1}{\sqrt{\eta_{t}}}\bm{a}_{t}^{\mathsf{H}}\bm{E}_{t} \;.
\label{simplified_recovered_signal}
\end{equation}
\end{small}
Finally, through the post-processing function of $\psi$, the server obtains the global descent direction vector $\hat{\bm{p}}_{t}$:
\begin{small}
\begin{equation}
\hat{\bm{p}}_{t} = \psi\bracket{\bm{r}_{t}} = \frac{1}{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\bm{r}_{t}^{\mathsf{H}} = \tilde{\bm{p}}_{t} + \frac{1}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bracket{\bm{a}_{t}^{\mathsf{H}}\bm{E}_{t}}^{\mathsf{H}} \;,
\label{global_update_direction}
\end{equation}
\end{small}
where $\tilde{\bm{p}}_{t,i}$ is the averaged local descent direction vector as defined in~\eqref{averaged_local_descent_direction}.
\begin{algorithm}
\caption{Over-the-Air Second-Order Federated Algorithm}
\label{ACCADE}
\small
\For{each iteration t}
{
server chooses devices participating in this iteration and stores them as $\mathcal{S}_{t}$.\\
server broadcasts the current model parameter vector $\bm{w}_{t}$ to all devices.\\
\For{each participating device $i \;\; \textbf{in parallel}$ }{
compute local gradient $\bm{g}_{t,i} = \frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} \nabla f\left(\bm{w}_{t} ,\bm{z}_{i, j}\right)+\gamma \bm{w}_{t}$.\\
compute local Hessian matrix $\bm{H}_{t, i} = \frac{1}{\left|\mathcal{D}_{i}\right|} \sum_{\bm{z}_{i, j} \in \mathcal{D}_{i}} \nabla^{2} f\left(\bm{w}_{t}, \bm{z}_{i, j}\right)+\gamma \bm{I}_{d}$.\\
compute local Newton descent direction $\bm{p}_{t,i} = \bm{H}_{t, i}^{-1} \bm{g}_{t,i}$.\\
encode $\bm{p}_{t, i}$ as $\bm{s}_{t,i}$ according to \eqref{preprocess}. \\
transmit the signal $\bm{x}_{t,i} = b_{t,i}\bm{s}_{t,i}$ through wireless channel.
}
server receives the signal $\bm{y}_{t}$ \eqref{received_signal} and maintains $\hat{\bm{p}_{t}}$ \eqref{global_update_direction}.\\
server performs an update step $\bm{w}_{t+1} = \bm{w}_{t} - \alpha \hat{\bm{p}_{t}}$.
}
\end{algorithm}
Based on the AirComp-based communication model and second-order optimization algorithm, we propose our over-the-air second-order federated algorithm, as shown in Algorithm \ref{ACCADE}.
\section{Theoretical Convergence Analysis}
\label{Theoretical Analysis}
In this section, we provide the convergence analysis of our proposed algorithm.
A major challenge of convergence analysis is to tackle the distortion of the descent direction vector caused by channel noise,
device selection, and the use of local Newton step.
To address this issue, we study the impact of distortion with respect to these influencing factors.
In particular, we exploit the idea of sketching to analyze the approximation of local gradients and Hessian matrices.
To better elaborate our analysis, some preliminaries are firstly presented.
\subsection{Preliminaries}
The core of our proposed algorithm is using local Hessian matrices and local gradients, which is calculated through subsets of the total data set, to construct local Newton descent directions and aggregate them.
This brings the benefits of fewer communication rounds between the server and the devices.
However, since we rely on local information to approximate Newton descent directions, the quality of local Hessian/gradients, in other words, the difference between the local ones and global ones, are of concern.
In order to tackle this issue, we adopt the idea of matrix sketching~\cite{drineas2016randnla, woodruff2014sketching}.
Specifically, for a given input matrix $\bm{M} \in \mathbb{R}^{n \times d}$, we can replace it with $\bm{C} = \bm{L}^{\mathsf{T}}\bm{M} \in \mathbb{R}^{s\times d}$, where matrix $\bm{C}$ acts as the sketch of $\bm{M}$ with the sketching matrix $\bm{L} \in \mathbb{R}^{n \times s}$.
In this way, the original problem related to $\bm{M}$ can be solved more efficiently using the smaller alternative matrix $\bm{C}$ without losing too much information.
The construction of the sketch is similar to the calculation of local Hessian/gradients, where we adopt partial information of the global Hessian/gradients to serve as the local Hessian/gradients.
In this paper, we consider the row sampling scheme in matrix sketching.
The sketch $\bm{C}$ is constructed by the uniform sampled and re-scaled subset of rows of $\bm{M}$ with sampling probability $\mathbb{P}\bracket{\bm{c}_{i} = \frac{\bm{m}_{j}}{\sqrt{sp}}} = p,\; p =\frac{1}{n}$, where $\bm{c}_{i}$ and $\bm{m}_{j}$ are the $i$-th row of $\bm{C}$ and $j$-th row of $\bm{M}$, respectively.
Consequently, the sketching matrix $\bm{L}$ has only one non-zero entry in each column,
and we shall measure the difference between the local Hessian/gradients and global ones with the help of such sketching matrices.
In the following, we consider a linear predictor model $\ell: \mathbb{R} \rightarrow \mathbb{R}$, which is frequently used in machine learning research, e.g., logistic and linear regression, support vector machines, neural networks and graphical models.
The function $f\bracket{\bm{w}, \bm{z}_{i,j}}$ can thus be rewritten as $\ell\bracket{\bm{w}^{\mathsf{T}}\bm{u}_{i,j}}$.
Accordingly, we define $\boldsymbol{M}_{t}=\left[\boldsymbol{m}_{1}^{\mathsf{T}}, \ldots, \boldsymbol{m}_{n}^{\mathsf{T}}\right]^{\mathsf{T}} \in \mathbb{R}^{n \times d}$ with $\bm{m}_{t,j} = \sqrt{\ell^{\prime\prime}\bracket{\bm{w}^{\mathsf{T}}\bm{u}_{i,j}} / n}\bm{u}_{i,j} \in \mathbb{R}^{d}$, so the global Hessian matrix can be represented as $\boldsymbol{H}_{t}=\boldsymbol{M}_{t}^{\mathsf{T}} \boldsymbol{M}_{t}+\gamma \boldsymbol{I}_{d}$.
Moreover, by defining $\bm{N}_{t} = \left[\bm{n}_{1}, \ldots, \bm{n}_{n}\right] \in \mathbb{R}^{d \times n}$ with $\bm{n}_{i}= \nabla f \left(\bm{w}_{t}, \bm{z}_{i}\right)$, the global gradient $\nabla F\left(\bm{w}_{t}\right)$ can be denoted by $\bm{g}_{t}=\frac{1}{n} \bm{N}_{t} \bm{1}+\gamma \bm{w}_{t}$.
Let $\left\{\bm{L}_{i}\right\}_{i = 1}^{m}$ be the sketching matrices, the local Hessian matrices and local gradients can be reformulated as:
\begin{small}
\begin{equation}
\bm{H}_{t, i}=\bm{M}_{t}^\mathsf{T} \bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{M}_{t}+\gamma \bm{I}_{d} \;,\quad \bm{g}_{t, i}=\frac{1}{n} \bm{N}_{t} \bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{1}+\gamma \bm{w} \;.
\end{equation}
\end{small}
In addition, we define an auxiliary quadratic function as follows to facilitate our analysis:
\begin{small}
\begin{equation}
\phi(\bm{p})=\frac{1}{2} \bm{p}^\mathsf{T} \bm{H}_{t} \bm{p}-\bm{g}_{t}^\mathsf{T} \bm{p}=\frac{1}{2} \bm{p}^\mathsf{T}\left(\bm{M}_{t}^\mathsf{T} \bm{M}_{t}+\gamma \bm{I}_{d}\right) \bm{p}-\bm{g}_{t}^\mathsf{T} \bm{p} \;.
\label{quadratic function}
\end{equation}
\end{small}
As a quadratic function, the minimum point of $\phi(\bm{p})$ denoted by $\bm{p}^{*}$ can be analytically obtained, which is the same as the exact Newton descent direction vector in \eqref{Newton step}, i.e.,
\begin{small}
\begin{equation}
\bm{p}^{*}=\arg \min \phi(\bm{p})= \nabla^{2}F^{-1}\left(\bm{w}_{t}\right)\nabla F\left(\bm{w}_{t}\right) = \bm{H}_{t}^{-1} \bm{g}_{t}=\left(\bm{M}_{t}^{\top} \bm{M}_{t}+\gamma \bm{I}_{d}\right)^{-1} \bm{g}_{t} \;.
\end{equation}
\end{small}
Due to the effect of channel noise, device selection, and the use of local Newton step, the actual descent direction rather than the exact Newton step $\bm{p}^{*}$ is given by:
\begin{small}
\begin{equation}
\begin{aligned}
\hat{\bm{p}}_{t} =\,& \bm{p}^{*} + \underbrace{\left(\bar{\bm{p}}_{t} - \bm{p}^{*}\right)}_{\text{Local Hessian}} + \underbrace{\left(\bm{p}_{t} - \bar{\bm{p}}_{t}\right)}_{\text{Local Gradient}} + \underbrace{\left(\tilde{\bm{p}}_{t} - \bm{p}_{t}\right)}_{\text{Device Selection}} + \underbrace{\left(\hat{\bm{p}}_{t} - \tilde{\bm{p}}_{t}\right)}_{\text{Channel Noise}} \;,
\end{aligned}
\label{decomposition_global_update_direction}
\end{equation}
\end{small}
where $\hat{\bm{p}}_{t}$ and $\tilde{\bm{p}}_{t}$ are defined in~\eqref{global_update_direction} and~\eqref{averaged_local_descent_direction}, respectively,
$\bm{p}_{t} = \frac{1}{\underset{i \in \mathcal{S}}{\sum}\card{\mathcal{D}_{i}}}\sum_{i \in \mathcal{S}} \card{\mathcal{D}_{i}}\bm{p}_{t,i}$ is the averaged local descent direction vector without device selection, and $\bar{\bm{p}}_{t} = \frac{1}{\underset{i \in \mathcal{S}}{\sum}\card{\mathcal{D}_{i}}}\sum_{i \in \mathcal{S}} \card{\mathcal{D}_{i}}\bar{\bm{p}}_{t,i} = \frac{1}{\underset{i \in \mathcal{S}}{\sum}\card{\mathcal{D}_{i}}}\sum_{i \in \mathcal{S}} \card{\mathcal{D}_{i}}\bm{H}_{t,i}^{-1}\bm{g}_{t}$ is the Newton descent direction with the exact global gradient.
In the following analysis, we will use the quadratic function~\eqref{quadratic function} to illustrate how close $\hat{\bm{p}}_{t}$ and $\bm{p}^{*}$ are.
Besides, the error of model parameter vector in the iterates $\bm{\Delta}_{t} = \bm{w}_{t} - \bm{w}^{*}$ acts as the metric, where $\bm{w}^{*}$ denotes the optimal solution.
Throughout this paper, we consider the following assumptions, which are widely adopted in FL problems \cite{chen2020joint, liu2020reconfigurable, xiaowen2021optimized}.
\noindent\textbf{Assumption 1.} The global loss function $F$ is $L$-smooth.
\noindent\textbf{Assumption 2.} The global loss function $F$ is strongly convex, which indicates the unique optimal model parameter vector $\bm{w}^{*}$ of the FL task.
\noindent\textbf{Assumption 3.} The local loss function $F_{i}$ is twice-differentiable, smooth and convex.
\subsection{Convergence Analysis}
Since the local gradients and Hessian matrices are adopted to approximate the global descent direction, the gap between the local direction and the global direction is essential for the convergence analysis. Therefore, we first recall two lemmas to reveal their relationships.
\begin{lemma}[{\cite[variant of Lemma 2]{ghosh2020distributed}}]
Let $\lambda , \delta = \sum_{i=1}^{m} \delta_{i}, \{\delta_{i}\} \in(0,1)$ be fixed parameters, $r=\operatorname{rank}\left(\bm{M}_{t}\right)$, and $\bm{U} \in \mathbb{R}^{n \times r}$ be the orthonormal bases of the matrix $\bm{M}_{t}$.
Let $\mu \in\left[1, \frac{n}{d}\right]$ be the coherence of $\bm{M}_{t}$ defined in~[30].
Let $\left\{\bm{L}_{i} \in \mathbb{R}^{n \times \card{\mathcal{D}_{i}}}\right\}_{i=1}^{m}$ be independent uniform sampling sketching matrices with $\card{\mathcal{D}_{i}} \geq \frac{3 \mu d}{\lambda^{2}} \log \frac{d}{\delta_{i}}$.
It holds with the probability exceeding $1-\delta$ that:
\begin{small}
\begin{equation}
\left\|\bm{U}^\mathsf{T} \bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{U}-\bm{I}\right\|_{2} \leq \lambda\;, \quad \forall i \in \mathcal{S}\;.
\end{equation}
\end{small}
\end{lemma}
\begin{lemma}[{\cite[variant of Lemma 3]{ghosh2020distributed}}]
Let $\left\{\bm{L}_{i} \in \mathbb{R}^{n \times \card{\mathcal{D}_{i}}}\right\}_{i=1}^{m}$ be independent uniform sampling sketching matrices, $\delta = \sum_{i=1}^{m} \delta_{i}, \{\delta_{i}\} \in(0,1)$ be fixed parameters, then with the probability exceeding $1-\delta$, we have:
\begin{small}
\begin{equation}
\left\|\frac{1}{n} \bm{N}_{t}\bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{1}-\frac{1}{n} \bm{N}_{t} \bm{1}\right\| \leq\left(1+\sqrt{2 \ln \left(\frac{1}{\delta_{i}}\right)}\right) \sqrt{\frac{1}{\card{\mathcal{D}_{i}}}} \max _{j}\left\|\bm{n}_{j}\right\|\;.
\end{equation}
\end{small}
\end{lemma}
With Lemma 1 and Lemma 2, we further propose Lemma 3 to characterize the gap between $\hat{\bm{p}}_{t}$ and $\bm{p}^{*}$ via the support quadratic function.
\begin{lemma}
Let $\left\{\bm{L}_{i}\right\}_{i=1}^{m} \in \mathbb{R}^{n \times \card{\mathcal{D}_{i}}}$ be independent uniform sampling sketching matrices, $\phi_{t}$ be the quadratic function as defined in~\eqref{quadratic function}, $\lambda , \{\delta_{i}\} \in(0,1)$ be fixed parameters with $\tilde{\delta} = \min\{\delta_{i}\}$ and $\hat{\bm{p}}_{t}$ be the approximate descent direction vector defined in~\eqref{decomposition_global_update_direction}.
It holds that:
$$
\phi_{t}(\bm{p}^{*}) \leq \phi_{t}\left(\hat{\bm{p}}_{t}\right) \leq \epsilon^{2} +\left(1-\zeta^{2}\right) \phi_{t}(\bm{p}^{*}) \;,
$$
where
\begin{small}
\begin{equation}
\zeta^{2} = 3\tau^{2}\left(\lambda+\frac{\lambda^{2}}{1-\lambda}\right)^{2} + 24\vartheta^{2}\left(\tau\left(\lambda+\frac{\lambda^{2}}{1-\lambda}\right)+1\right)^{2}
\label{zeta}
\end{equation}
\end{small}
with $\tau=\frac{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)}{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)+n\gamma}$, $\vartheta = \max _{t} \left(1 - \frac{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right) < 1$ and
\begin{small}
\begin{equation}
\begin{aligned}
\epsilon^{2}
=& \frac{3}{\sigma_{\min}\left(\bm{H}_{t}\right)}\left\|\frac{1}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bm{a}_{t}^\mathsf{H}\bm{E}_{t}\right\|^{2} + \left[24\left(1 - \frac{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}\right] \\
&\qquad\qquad\qquad\cdot \bigg[\frac{1}{1-\lambda} \frac{1}{\sqrt{\sigma_{\min }\left(\bm{H}_{t}\right)}}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right) \max _{j} \left\| \bm{n}_{j} \right\|\bigg]^{2}.
\end{aligned}
\label{epsilon}
\end{equation}
\end{small}
\end{lemma}
The proof of Lemma~3 can be found in Appendix A.
To illustrate that $\hat{\bm{p}}_{t}$ is a good descending direction, we introduce Lemma 4 supported by the property of the quadratic function introduced in Lemma 3.
\begin{lemma}[{\cite[Lemma~6]{ghosh2020distributed}}]
Let $\zeta \in(0,1)$, $\epsilon$ be any fixed parameter, if $\hat{\bm{p}_{t}}$ satisfies $\phi\left(\hat{\bm{p}}_{t}\right) \leq \epsilon^{2}+(1-\left.\zeta^{2}\right) \min _{\bm{p}} \phi(\bm{p})$, then under Assumption 1, the error of model parameter vector $\bm{\Delta}_{t}=\bm{w}_{t}-\bm{w}^{*}$ in iterations satisfies
\begin{small}
\begin{equation}
\bm{\Delta}_{t+1}^\mathsf{T} \bm{H}_{t} \bm{\Delta}_{t+1} \leq L\left\|\bm{\Delta}_{t+1}\right\|\left\|\bm{\Delta}_{t}\right\|^{2}+\frac{\zeta^{2}}{1-\zeta^{2}} \bm{\Delta}_{t}^\mathsf{T} \bm{H}_{t} \bm{\Delta}_{t}+2 \epsilon^{2} \;,
\end{equation}
\end{small}
\end{lemma}
Based on Lemma 3 and Lemma 4, we can derive the main result:
\begin{theorem}
\label{theorem 1}
Suppose the size of local dataset at each device $\card{\mathcal{D}_{i}} \geq \frac{3 \mu d}{\lambda^{2}} \log \frac{d}{\delta_{i}}$ for some $\lambda, \delta_{i} \in(0,1)$, then under Assumption 1 with the probability exceeding $1-\delta$ we have
\begin{small}
\begin{align*}
\mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right) \leq \max \left\{\sqrt{\kappa_{t}\left(\frac{\zeta^{2}}{1-\zeta^{2}}\right)}\left\|\bm{\Delta}_{t}\right\|, \frac{L}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left\|\bm{\Delta}_{t}\right\|^{2}\right\} +\epsilon^{\prime}\;,
\end{align*}
\end{small}
where the expectation takes with respect to the channel noise $\bm{e}_{t}$, $\zeta$ is defined as \eqref{zeta},
$\kappa_{t}=\frac{\sigma_{\max }\left(\bm{H}_{t}\right)}{\sigma_{\min }\left(\bm{H}_{t}\right)}$ denotes the condition number of $\bm{H}_{t}$,
and
\[
\begin{small}
\begin{aligned}
\epsilon^{\prime} =& \frac{2\sqrt{3}}{\sigma_{\min}\left(\bm{H}_{t}\right)}\frac{d\sigma}{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\frac{\norm{\bm{a}_{t}}}{\sqrt{\eta_{t}}} + \sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\\
&\qquad\qquad\qquad\qquad\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\|\;.
\end{aligned}
\end{small}
\]
\end{theorem}
The proof can be found in Appendix B. From Theorem \ref{theorem 1}, we have the following observations.
\subsubsection{\bf The proposed algorithm keeps a linear-quadratic convergence rate}
From the analysis results, it can be seen that the term $\left\|\bm{\Delta}_{t}\right\| = \left\|\bm{w}_{t} - \bm{w}^{*}\right\|$ keeps the property in this form:
$\mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right) \leq \max \left\{\omega_{1}\left\|\bm{\Delta}_{t}\right\|, \omega_{2}\left\|\bm{\Delta}_{t}\right\|^{2}\right\} + \epsilon^{\prime}$.
When $\left\|\bm{\Delta}_{t}\right\| > \frac{\omega_{1}}{\omega_{2}}$, this property can be simplified as $ \mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right) \leq \omega_{2}\left\|\bm{\Delta}_{t}\right\|^{2} + \epsilon^{\prime} $.
It is obvious that the proposed algorithm keeps the same quadratic convergence rate as the canonical Newton's method.
At the beginning of the algorithm it can converge to the neighbor of the optimal point quickly.
When $\left\|\bm{\Delta}_{t}\right\| < \frac{\omega_{1}}{\omega_{2}}$, this property turns into $ \mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right) \leq \omega_{1}\left\|\bm{\Delta}_{t}\right\| + \epsilon^{\prime} $,
which means when $\left\|\bm{\Delta}_{t}\right\|$ is small enough during the process of the algorithm, it degenerates into the linear convergence rate.
In conclusion, the proposed algorithm keeps a linear-quadratic convergence rate and performs better than first-order algorithms.
\subsubsection{\bf The proposed algorithm is accompanied by an accumulative error term} Notice that there is an error term $\epsilon^{\prime}$ in each iteration, which comes from the approximation, device selection and channel noise.
Consider the noise-free case without device selection, which means $\sigma = 0$ and $\left|\mathcal{S}_{t}\right| = m$, this error term degenerates to:
\begin{small}
\begin{equation}
\begin{aligned}
\epsilon^{\prime}_{1} =
\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\sqrt{\frac{m}{n}}\max _{j} \left\| \bm{n}_{j} \right\|\;,
\end{aligned}
\label{epsilon1}
\end{equation}
\end{small}
which is exactly the same as the error term introduced in~\cite{ghosh2020distributed}.
With the algorithm executed iteratively, the gap between the expected global loss function value and the optimal one is upper bounded by this accumulative error term.
Therefore, the active device set $\mathcal{S}_{t}$, the receiver beamforming vectors $\left\{\bm{a}_{t}\right\}$ and the scaling factors $\left\{\eta_{t}\right\}$ need to be tuned in each iteration so as to reduce the error gap.
\section{System Optimization}
\label{System Optimization}
In this section, we first formulate a system optimization problem to minimize the error term in the convergence analysis results.
Then, we propose our approach for joint optimization of device selection and receiver beamforming vector.
\subsection{Problem Formulation}
In light of convergence analysis, to obtain a precise model parameter vector, minimizing the error gap demonstrated in Theorem 1 is a key issue.
It is observed that the coefficients of the two iterative terms $\bm{\Delta}_{t}$ and $\bm{\Delta}_{t+1}$ in Theorem 1 are independent of variables $\mathcal{S}_{t}$, $\bm{a}_{t}$ and $\eta_{t}$.
Therefore, in order to achieve the minimization of the total error gap, we only need to minimize the error term $\epsilon^{\prime}$ in each iteration as follows
\begin{small}
\begin{equation}
\label{power constraint}
\begin{aligned}
\min_{\mathcal{S}_{t}, \bm{a}_{t}, \eta_{t}}
\quad&\frac{2\sqrt{3}}{\sigma_{\min}\left(\bm{H}_{t}\right)}\frac{d\sigma}{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\frac{\norm{\bm{a}_{t}}}{\sqrt{\eta_{t}}} + \sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\\
&\qquad\qquad\qquad\qquad\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\| \\
\text{s.t.}\;\quad
& \frac{\eta_{t}}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2}} \leq dP_{0} \quad \forall i \in \mathcal{S}_{t} \;
\end{aligned}
\end{equation}
\end{small}
The power constraint in \eqref{power constraint} can be rewritten in the form of the restriction of scaling factor: $\eta_{t} \leq dP_{0}\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2}, \ \forall i \in \mathcal{S}_{t}$.
We take the negative correlation between the scaling factor $\eta_{t}$ and the objective function value $\epsilon^{\prime}$ into consideration.
$\eta_{t}$ can be set as $\eta_{t} = dP_{0}\min_{i \in \mathcal{S}_{t}}\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2}$~\cite{chen2018uniform}, and the problem can be simplified as $\mathscr{P}$:
\begin{small}
\begin{equation}
\begin{aligned}
\mathscr{P}: \min_{\mathcal{S}_{t}, \bm{a}_{t}}\quad
& \frac{\sqrt{3d}\sigma}{\sqrt{P_{0}}\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\;\; \max_{i \in \mathcal{S}_{t}}\;\; \left(\frac{\left\|\bm{a}_{t}\right\|}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|}\right) + \sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\\
&\qquad\qquad\qquad\qquad\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\|\;.
\end{aligned}
\label{system_optimization_problem}
\end{equation}
\end{small}
We have the following key observations for solving \eqref{system_optimization_problem}:
\begin{itemize}
\item [\textbullet] Intuitively, to achieve the minimization of the objective value of $\mathscr{P}$ , the number of selected devices is supposed to be maximized, then $\mathscr{P}$ will degenerate into the form of traditional beamforming optimization. However, the term $\max_{i \in \mathcal{S}_{t}}\; \left(\frac{\left\|\bm{a}_{t}\right\|}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|}\right)$
is related to device selection, which further
results in the incorrectness to directly maximize $|\mathcal{S}_{t}|$.
\item [\textbullet] By searching over all the possible participating device sets, the optimal $\mathcal{S}_{t}$ can be determined. Still, the number of devices $m$ can be very large, leading to an exponential growth of the optimization procedure in the number of devices $m$.
\item [\textbullet] After the search of participating devices, the remaining problem is a typical beamforming optimization problem, but it is still non-convex and intractable.
\end{itemize}
In conclusion, since a combinatorial search of participating devices and minimization of the non-convex objective function are involved, it is evident that $\mathscr{P}$ is a mixed-integer non-convex problem.
In order to tackle the complexity of computation and the difficulty of non-convexity, we propose an efficient method to iteratively search the optimal set of selected devices $\mathcal{S}_{t}$ while jointly optimizing the receiver beamforming vector $\bm{a}_{t}$ for each given $\mathcal{S}_{t}$.
\subsection{Receiver Beamforming Optimization}
For a given set of selected devices $\mathcal{S}_{t}$, $\mathscr{P}$ can be simplified as $\mathscr{P}_{1}: \min_{\bm{a}_{t}} \max_{i \in \mathcal{S}_{t}} \frac{\left\|\bm{a}_{t}\right\|}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|}$,
which is equivalent to:
$ \min_{\bm{a}_{t}} \max_{i \in \mathcal{S}_{t}} \frac{\left\|\bm{a}_{t}\right\|^{2}}{\left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2}}\;.$
This can be further reformulated as $\mathscr{P}_{1}^{\prime}$ according to the analysis in~\cite{chen2018uniform}:
\begin{small}
\begin{align*}
\mathscr{P}_{1}^{\prime}: \min_{\bm{a}_{t}} \quad \left\|\bm{a}_{t}\right\|^{2} \qquad \text{s.t.} \quad \left\|\bm{a}_{t}^\mathsf{H}\tilde{\bm{h}}_{t,i}\right\|^{2} \geq 1 \quad \forall i \in \mathcal{S}_{t}\;.
\end{align*}
\end{small}
It can be seen that $\mathscr{P}_{1}^{\prime}$ is actually a quadratically constrained quadratic programming problem, which is difficult to solve.
We first use the matrix lifting technique to pre-process $\mathscr{P}_{1}^{\prime}$ and turn it into a low-rank optimization form.
Specifically, let $\bm{A} = \bm{a}_{t}\bm{a}_{t}^\mathsf{H}$ with $\text{rank}\left(\bm{A}\right)=1$ and $\bm{Q}_{i}=\tilde{\bm{h}}_{t,i}\tilde{\bm{h}}_{t,i}^\mathsf{H}$, $\mathscr{P}_{1}^{\prime}$ can be recast as:
\begin{small}
\begin{align*}
\min_{\bm{A}} \quad \operatorname{Tr}\left(\bm{A}\right)\qquad
\text{s.t.} \quad \bm{A} \succeq \bm{0} ,\;\;\operatorname{rank}(\bm{A})=1,\;\; \operatorname{Tr}\left(\bm{A}\bm{Q}_{i}\right) \ge 1 \quad \forall i \in \mathcal{S}_{t}\;.
\end{align*}
\end{small}
The key to solving this low-rank optimization problem is to deal with the troublesome rank-one constraint.
A common method to solve such a problem is semidefinite relaxation (SDR)~\cite{luo2007approximation, sidiropoulos2006transmit}, which drops the rank-one constraint to obtain a relaxed problem in the form of semidefinite programming.
By this means, SDR can arrive at an approximate solution efficiently through solving the relaxed problem.
However, as the size of the problem grows, the rank-one constraint is usually unsatisfied.
In this situation, the approximate solution needs to be scaled through randomization methods, leading to an alternative solution with low accuracy~\cite{chen2018uniform}, which will further affect the learning performance of FL.
To guarantee the rank-one constraint, we can replace it with its equivalent form~\cite{yang2020federated, hua2019device}:
$
\operatorname{Tr}\left(\bm{A}\right) - \left\|\bm{A}\right\|_{2} = 0 \quad \text{with} \quad \operatorname{Tr}\left(\bm{A}\right) > 0\;.
$
Then, the original problem turns into a difference-of-convex-function (DC) program.
By solving this DC program, a more precise solution can be obtained since all constraints are satisfied.
Therefore, we develop a DC Algorithm (DCA) based on the principles in~\cite{tao1997convex, khamaru2018convergence} to solve this
problem.
Specifically, we can get the following problem by taking the new constraint as a penalty term:
\begin{small}
\begin{align*}
\min_{\bm{A}} \quad \operatorname{Tr}\left(\bm{A}\right)+\theta \left(\operatorname{Tr}\left(\bm{A}\right) - \left\|\bm{A}\right\|_{2}\right) \quad
\text{s.t.} \quad \bm{A} \succeq \bm{0}, \; \operatorname{Tr}(\bm{A})>0,\; \operatorname{Tr}\left(\bm{A}\bm{Q}_{i}\right) \ge 1 \;\; \forall i \in \mathcal{S}_{t} \; ,
\end{align*}
\end{small}
where $\theta$ is the penalty factor. Although this is still a non-convex problem owing to the concave term $- \left\|\bm{A}\right\|_{2}$,
we can take the linearization of $\left\|\bm{A}\right\|_{2}$ and convert it into a convex subproblem:
\begin{small}
\begin{align*}
\mathscr{P}_{DCA}:\min_{\bm{A}} \ & (1+\theta) \operatorname{Tr}(\bm{A})-\theta\left\langle\partial\left\|\bm{A}_{j}\right\|_{2}, \bm{A}\right\rangle \ \;
\text{s.t.} \ \bm{A} \succeq \bm{0},\; \operatorname{Tr}(\bm{A})>0,\; \operatorname{Tr}\left(\bm{A}\bm{Q}_{i}\right) \ge 1 \ \forall i \in \mathcal{S}_{t},
\end{align*}
\end{small}
where $\langle\cdot,\cdot \rangle$ denotes the inner product of two matrices and $\partial\left\|\bm{A}_{j}\right\|_{2}$ represents the subgradient of $\left\|\bm{A}_{j}\right\|_{2}$ at $\bm{A}_{j}$.
Therefore, the result can be obtained by iteratively solving $\mathscr{P}_{DCA}$ until $\operatorname{Tr}\left(\bm{A}\right) - \left\|\bm{A}\right\|_{2}$ is sufficiently small.
The overall procedure of DCA is as summarized in Algorithm \ref{DCA}.
\begin{algorithm}
\caption{DC Algorithm for Receiver Beamforming Optimization (DCA)}
\label{DCA}
\small
\textbf{input:} effective channel coefficients $\left\{\tilde{\bm{h}}_{t,i}\right\}$, penalty factor $\theta$, threshold $\xi $
turn $\mathscr{P}$ into the DCA form $\mathscr{P}_{DCA}$.
choose $\bm{A}_{0} \succeq 0$, set $j = 1$.
\While{$\left|\operatorname{Tr}\left(\bm{A}_{j-1}\right) - \left\|\bm{A}_{j-1}\right\|_{2}\right| \ge \xi$}{
compute the subgradient $\partial\left\|\bm{A}_{j-1}\right\|_{2}$.
substitute $\partial\left\|\bm{A}_{j-1}\right\|_{2}$ into $\mathscr{P}_{DCA}$, solve the subproblem and set the result as $\bm{A}_{j}$.
$j \leftarrow j+1 \;.$
}
\end{algorithm}
\begin{algorithm}
\caption{System optimization approach GS+DCA}
\label{GS-DCA}
\small
\textbf{input:} effective channel coefficients $\left\{\tilde{\bm{h}}_{t,i}\right\}$, $T^{(0)}$, $\rho$, $K$
\textbf{output:} $\mathcal{S}^{(k+1)}$ and its corresponding $\bm{a}^{(K+1)}$.
\textbf{initialization:} $\mathcal{S}^{(0)} = \mathcal{S}$
\For{iteration $k = 0, 1, 2, ... , K$}{
generate the neighboring solution set $\mathcal{F}^{(k)}$.
\For{each $\tilde{\mathcal{S}} \in \mathcal{F}^{(k)}$}{
substitute $\tilde{\mathcal{S}}$ into $\mathscr{P}_{1}$, then solve the problem using DCA to get the corresponding optimal $\tilde{\bm{a}}$.
}
sample $\tilde{\mathcal{S}}^{(k)}$ according to the probability $\mathbb{P}\left(\tilde{\mathcal{S}}^{(k)}\right)= \frac{ \exp \left(-J\left(\tilde{\mathcal{S}}^{(k)}, \tilde{\bm{a}}^{(k)}\right)/T^{(k)}\right)}{\sum_{\tilde{\mathcal{S}} \in \mathcal{F}^{(k)}} \exp \left(-J\left(\tilde{\mathcal{S}}, \tilde{\bm{a}}\right)/T^{(k)}\right)}.$
$\mathcal{S}^{(k+1)} \gets \tilde{\mathcal{S}}^{(k)},\;T^{(k+1)} \gets \rho T^{(k)}$.
}
\end{algorithm}
\subsection{Device Selection Optimization}
As mentioned above, the device selection is a combinatorial optimization problem, which is impossible to perform a traversal in the whole solution space. Thus, we adopt the well-known Gibbs Sampling (GS) \cite{geman1984stochastic} method to optimize the selection of device set iteratively.
The main idea of GS is that in each iteration, a device set is sampled from the neighbors of the current device set according to an appropriate distribution.
In this way, the set of selected devices can gradually approach the global optimal solution.
To be specific, we treat different sets of selected devices as states, and the goal is to find the state which can minimize the objective value in $\mathscr{P}$.
For the sake of such state, at iteration $k$ of GS's process, with the set of selected devices $\mathcal{S}^{(k-1)}$ given in the last iteration, we first generate the neighboring solution set of $\mathcal{S}^{(k-1)}$.
The neighboring solution set, denoted by $\mathcal{F}^{(k)}$, contains the device sets that differ from the $\mathcal{S}^{(k-1)}$ in only one entry.
For example, by assuming $\mathcal{S} = \{0, 1, 2\}$ and $\mathcal{S}^{(k-1)} = \{1, 2\}$, then we have $\mathcal{F}^{(k)} = \{\{0, 1, 2\}, \{2\}, \{1\}\}$.
After the identification of the neighboring solution set, the candidate states are also determined according to the sets in $\mathcal{F}^{(k)}$, and we need to choose a state to approach the optimal set.
Based on the distribution introduced in \cite{bremaud2013markov}, we sample a device set in $\mathcal{F}^{(k)}$ with the probability
\begin{small}
\begin{equation}
\mathbb{P}\left(\tilde{\mathcal{S}}^{(k)}\right)= \frac{ \exp \left(-J\left(\tilde{\mathcal{S}}^{(k)}, \tilde{\bm{a}}^{(k)}\right)/T^{(k)}\right)}{\sum_{\tilde{\mathcal{S}} \in \mathcal{F}^{(k)}} \exp \left(-J\left(\tilde{\mathcal{S}}, \tilde{\bm{a}}\right)/T^{(k)}\right)}\;,
\label{Gibbs_distribution}
\end{equation}
\end{small}
where $J(\bm{x}, \bm{y})$ denotes the objective function value of $\mathscr{P}$. Here, the receiver beamforming vector is calculated through DCA with the given set of selected devices.
In the distribution \eqref{Gibbs_distribution}, there is a special parameter $T^{(k)}$ serving as the temperature.
The algorithm starts from a relatively high temperature $T^{(0)}$ in order to move around the solution space freely, rather than being stuck in a local minimum point.
As the algorithm proceeds, the algorithm slowly decreases the temperature by the factor $\rho$ to focus on the states that minimize the objective function.
Besides, to reduce the computational complexity, we have adopted a similar warm start technique as in~\cite{liu2020reconfigurable}.
The optimal beamforming vector in the previous iteration is used to serve as the initial point to accelerate the process of beamforming optimization.
The overall process of system optimization is outlined in Algorithm~\ref{GS-DCA}.
\section{Simulation Results}
\label{Simulation Results}
In this section, we evaluate the performance of the proposed schemes to demonstrate the advantage of our proposed second-order federated optimization algorithm and the effectiveness of our system optimization approach.
Code for our experiments are available at: https://github.com/Golden-Slumber/AirFL-2nd.
We first consider logistic regression with the loss function of the $i$-th device
$ F_{i}\left(\bm{w}\right)=\frac{1}{|\mathcal{D}_{i}|} \sum_{\bm{z}_{i, j}=\left(\bm{u}_{i, j}, v_{i, j}\right) \in \mathcal{D}_{i}} \log \left(1+\exp \left(-v_{i, j} \bm{u}_{i, j}^\mathsf{T} \bm{w}\right)\right)+\frac{\gamma}{2}\|\bm{w}\|_{2}^{2}$,
where the regularization parameter is set to be $\gamma = 10^{-8}$.
As for datasets, we adopt four different standard datasets from the LIBSVM library: Covtype, a9a, w8a, and phishing.
In this paper, we consider a distributed wireless scenario, where these data samples are uniformly distributed in $m=20$ devices, the server is equipped with $k=5$ antennas.
The channel coefficients are given by the small-scale fading coefficients $\{\bm{h}_{t,i}^{\prime}\}$ multiplied by the path loss gain $PL_{i}$, i.e., $\bm{h}_{t,i} = PL_{i}\bm{h}_{t,i}^{\prime}$.
Here, the small-scale fading coefficients follow the i.i.d complex normal distribution $\mathcal{CN}\bracket{0,\bm{I}}$.
The path loss gain is given by $PL_{i} = \sqrt{G_{0}}\bracket{d_{0}/d_{i}}^{\nu/2}$, where $G_{0} = 10^{-3.35}$ is the average channel power gain with the distance to the server $d_{0} = 1$ m, $d_{i} \in [100, 120]$ stands for the distance between the $i$-th device and the server, and $\nu = 3.76$ represents the path loss exponent factor.
For the step size $\alpha$, we use backtracking line search to find $\alpha$ satisfying the Armijo–Goldstein condition~\cite[Chapter~3]{nocedal2006numerical}.
For the system optimization, we set $\lambda = 0.1$, $\tilde{\delta} = 0.01$, penalty factor $\theta = 1$, threshold $\xi = 10^{-10}$, initial temperature $T_{0} = 100$, $\rho=0.9$, and $K=30$.
Besides, we use Baseline 0 to denote the centralized training setting in all experiments.
Furthermore, we also consider an image classification problem on a non-i.i.d dataset constructed from the Fashion-MNIST dataset at the end of this section.
To address it, we train a softmax classifier with cross-entropy loss and $\ell_{2}$ regularization term.
To be specific, the loss function of the $i$-th device is given as
$F_{i}\left(\bm{W}\right)=\frac{1}{|\mathcal{D}_{i}|} \sum_{\left(\bm{u}, v\right) \in \mathcal{D}_{i}} \sum_{c=1}^{C} \bm{1}\{v = c\} \log \frac{\exp (\bm{u}^\mathsf{T} \bm{w}_{c})}{\sum_{j=1}^{C}\exp(\bm{u}^\mathsf{T} \bm{w}_{j})}+\frac{\gamma}{2}\sum_{c=1}^{C}\|\bm{w}_{c}\|_{2}^{2}$,
where $\bm{W} = [\bm{w}_{1}, \dots, \bm{w}_{C}]$ is the concatenation of parameter vectors related to different classes, and $C = 10$ represents the total number of classes.
\subsection{Comparison with First-Order Algorithms}
We compared our proposed algorithm with two existing AirComp-based first-order algorithms in this experiment, where SNR is set to 80 dB:
\begin{enumerate}
\item Baseline $1$: AirComp-based Federated Averaging (FedAvg) algorithm with DC-based optimization framework \cite{yang2020federated}, where the threshold of MSE is set to $5$ dB.
\item Baseline $2$: AirComp-based Fedsplit algorithm \cite{xia2020fast}, where the threshold for device selection is set to $0.5$.
\end{enumerate}
\begin{figure*}[htbp!]
\centering
\subfloat[Covtype]{
\begin{minipage}[c][1\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_first_order_demo_err_covtype_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\hfill
\subfloat[a9a]{
\begin{minipage}[c][1\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_first_order_demo_err_a9a_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\hfill
\subfloat[w8a]{
\begin{minipage}[c][1\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_first_order_demo_err_w8a_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\hfill
\subfloat[phishing]{
\begin{minipage}[c][1\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_first_order_demo_err_phishing_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\caption{Training loss of the proposed algorithm and two first-order algorithms.}
\label{with first-order loss}
\vspace{-0.5cm}
\end{figure*}
\begin{figure*}[htbp!]
\centering
\subfloat[Covtype]{
\begin{minipage}[c][1\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_first_order_demo_acc_covtype_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\hfill
\subfloat[a9a]{
\begin{minipage}[c][1\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_first_order_demo_acc_a9a_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\hfill
\subfloat[w8a]{
\begin{minipage}[c][1\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_first_order_demo_acc_w8a_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\hfill
\subfloat[phishing]{
\begin{minipage}[c][1\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_first_order_demo_acc_phishing_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\caption{Test accuracy of the proposed algorithm and two first-order algorithms.}
\label{with first-order accuracy}
\vspace{-0.5cm}
\end{figure*}
Fig. \ref{with first-order loss} and Fig. \ref{with first-order accuracy} show the performance of these algorithms in training loss and test accuracy.
Regarding the optimality gap, benefiting from the linear-quadratic convergence rate, the proposed algorithm reaches a small optimality gap in the first few dozen communication rounds, while that of the first-order methods remains at a relatively higher level.
As for the test accuracy, our proposed algorithm can quickly reach and stabilize at a high accuracy level, while the first-order methods have relatively low and fluctuating accuracy.
Overall, our proposed algorithm keeps a quadratic convergence rate at the beginning of FL process, resulting in fewer communication rounds to complete the learning task than first-order algorithms.
This further leads to less wireless channel impact and better learning performance, as illustrated in the simulation results.
\begin{figure*}[htbp!]
\centering
\subfloat[Covtype]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_second_order_demo_err_covtype_antenna_5_tau_1e-07.pdf}
\end{minipage}
}
\hfill
\subfloat[a9a]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_second_order_demo_err_a9a_antenna_5_tau_1e-07.pdf}
\end{minipage}
}
\hfill
\subfloat[w8a]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_second_order_demo_err_w8a_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\hfill
\subfloat[phishing]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_second_order_demo_err_phishing_antenna_5_tau_1e-07.pdf}
\end{minipage}
}
\caption{Training loss of the proposed algorithm and two second-order algorithms.}
\label{with second-order loss}
\vspace{-0.5cm}
\end{figure*}
\begin{figure*}[htbp!]
\centering
\subfloat[Covtype]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_second_order_demo_acc_covtype_antenna_5_tau_1e-07.pdf}
\end{minipage}
}
\hfill
\subfloat[a9a]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_second_order_demo_acc_a9a_antenna_5_tau_1e-07.pdf}
\end{minipage}
}
\hfill
\subfloat[w8a]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_second_order_demo_acc_w8a_antenna_5_tau_1e-08.pdf}
\end{minipage}
}
\hfill
\subfloat[phishing]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_second_order_demo_acc_phishing_antenna_5_tau_1e-07.pdf}
\end{minipage}
}
\caption{Test accuracy of the proposed algorithm and two second-order algorithms.}
\label{with second-order accuracy}
\vspace{-0.5cm}
\end{figure*}
\subsection{Comparison with Second-Order Algorithms}
In this experiment, we compared our proposed algorithm with the following two state-of-the-art second-order algorithms under over-the-air computation:
\begin{enumerate}
\item Baseline 3: GIANT \cite{wang2018giant} with over-the-air computation. GIANT requires an extra aggregation of local gradients, leading to two communication rounds in each iteration.
The communication model of this gradients aggregation is implemented in the same way of $\bm{p}_{t}$, as illustrated in Section II-C. Here, we set $|\mathcal{S}_{t}| = m$, and the receiver beamforming vector is optimized through DCA.
\item Baseline 4: DANE \cite{shamir2014communication} with over-the-air computation. Similar to GIANT, It also requires an aggregation of local gradients, so its implementation is the same as GIANT.
\end{enumerate}
Fig. \ref{with second-order loss} and Fig. \ref{with second-order accuracy} plot the training loss and the test accuracy, respectively, where SNR is set to 70 dB.
It is observed that our proposed algorithm converges faster and remains stable at a relatively high level of accuracy, while the compared methods, AirComp-based GIANT and AirComp-based DANE, have a slower convergence rate.
This is because both the procedures of GIANT and DANE involve aggregating local gradients to calculate the global gradient in each iteration.
This extra transmission of local gradients through a wireless environment aggravates the impact of channel noise, leading to a relatively poor convergence rate.
Therefore, we can see that our proposed algorithm outperforms AirComp-based GIANT and AirComp-based DANE.
\subsection{Effectiveness of Proposed System Optimization Approach}
In this experiment, we evaluated the performance using GS+DCA to accomplish system optimization with four settings:
\begin{enumerate}
\item perfect aggregation, where the model is aggregated without wireless channel impact.
\item GS+SDR, where the receiver beamforming optimization is performed through SDR.
\item DCA only, where we only perform beamforming optimization through DCA.
\item SDR only, where we only perform beamforming optimization through SDR.
\end{enumerate}
\begin{figure*}[htbp]
\centering
\subfloat{
\begin{minipage}[c][0.9\width]{0.3\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/system_optimization_covtype_VERSUS_SNR.pdf}
\label{with SNR}
\end{minipage}
}
\hspace{8em}
\subfloat{
\begin{minipage}[c][0.9\width]{0.3\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/system_optimization_covtype_VERSUS_ANTENNAS.pdf}
\label{with antenna}
\end{minipage}
}
\caption{Objective value of system optimization problem $\mathscr{P}$ versus SNR and number of antennas.}
\label{with optimization}
\vspace{-0.5cm}
\end{figure*}
To verify the effectiveness of the device selection, we consider the distance heterogeneity and data size heterogeneity in this experiment.
Specifically, as for distance heterogeneity, we set the distance of $10\%$ devices to be $d_{i} \in [200, 220]$ while the rest to be $d_{i} \in [50, 60]$.
As for data size heterogeneity, we set the data size of $10\%$ devices to be $\card{\mathcal{D}_{i}} \in [0.008\frac{n}{m}, 0.01\frac{n}{m}]$ while the rest to be
$\card{\mathcal{D}_{i}} \in [1.01\frac{n}{m}, 1.11\frac{n}{m}]$.
We first numerically evaluate the objective value of the system optimization problem $\mathscr{P}$ under different settings in Fig. \ref{with optimization} by averaging 100 channel realizations.
The objective value of perfect aggregation does not depend on SNR and the number of antennas since the error during the FL process in this situation only comes from the approximation as \eqref{epsilon1} indicates.
The objective values of all settings decrease as SNR and the number of antennas increase, due to the mitigation of noise effect and the increase of diversity gain \cite{chen2018uniform}, respectively.
However, the objective value of GS+DCA is smaller than that of other settings.
On the one hand, SDR fails to give a precise solution for the receiver beamforming vector as the size of the problem grows.
This further leads to the ineffectiveness of device selection in GS+SDR and worse performance compared with the settings using DCA to perform beamforming optimization.
On the other hand, device selection in GS+DCA mitigates the straggler issue caused by distance heterogeneity and data size heterogeneity, resulting in a better performance compared with DCA only.
\begin{figure*}[htbp!]
\centering
\subfloat[Covtype]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_err_covtype_antenna_5_tau_5e-05.pdf}
\end{minipage}
}
\hfill
\subfloat[a9a]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_err_a9a_antenna_5_tau_5e-05.pdf}
\end{minipage}
}
\hfill
\subfloat[w8a]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_err_w8a_antenna_5_tau_5e-05.pdf}
\end{minipage}
}
\hfill
\subfloat[phishing]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_err_phishing_antenna_5_tau_5e-05.pdf}
\end{minipage}
}
\caption{Training loss of the proposed algorithm in different system optimization settings.}
\label{with optimization loss}
\vspace{-0.5cm}
\end{figure*}
\begin{figure*}[htbp!]
\centering
\subfloat[Covtype]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_acc_covtype_antenna_5_tau_5e-05.pdf}
\end{minipage}
}
\hfill
\subfloat[a9a]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_acc_a9a_antenna_5_tau_5e-05.pdf}
\end{minipage}
}
\hfill
\subfloat[w8a]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_acc_w8a_antenna_5_tau_5e-05.pdf}
\end{minipage}
}
\hfill
\subfloat[phishing]{
\begin{minipage}[c][0.85\width]{0.23\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/with_optimization_modes_demo_acc_phishing_antenna_5_tau_5e-05.pdf}
\end{minipage}
}
\caption{Test accuracy of the proposed algorithm in different system optimization settings.}
\label{with optimization accuracy}
\vspace{-0.5cm}
\end{figure*}
Fig. \ref{with optimization loss} plots the training loss for our proposed algorithm in different system optimization settings, where SNR is set to 35 dB.
The results show that with device selection and a more precise solution given by DCA, the error term can be minimized in each iteration and a smaller optimality gap close to that of perfect aggregation can be obtained.
As revealed in Fig. \ref{with optimization accuracy}, this smaller optimality gap further leads to higher test accuracy, demonstrating that our proposed system optimization approach effectively improves learning performance.
\begin{figure*}[htbp]
\centering
\subfloat{
\begin{minipage}[c][0.8\width]{0.3\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/cross_entropy_demo_err_fashion_mnist_antenna_5_tau_1e-09.pdf}
\label{with algorithms}
\end{minipage}
}
\hspace{8em}
\subfloat{
\begin{minipage}[c][0.8\width]{0.3\textwidth}
\centering
\includegraphics[width=1\linewidth]{fig/cross_entropy_demo_acc_fashion_mnist_antenna_5_tau_1e-09.pdf}
\label{with optimization methods}
\end{minipage}
}
\caption{Simulation results on the Fashion-MNIST dataset.}
\label{with mnist}
\vspace{-0.8cm}
\end{figure*}
\subsection{Fashion-MNIST Data Set}
We consider an image classification problem on a non-i.i.d dataset constructed from the Fashion-MNIST dataset in this experiment, where $m=10$ and SNR is set to $90$ dB.
The related parameters are set to be the same as the previous experiments, and we use the percentage of correctly classified test images to evaluate the learning performance.
Fig. \ref{with mnist} presents the training loss and test accuracy versus communication rounds of our proposed algorithm and four baseline algorithms.
It reveals that our proposed algorithm significantly outperforms the baseline algorithms.
On the one hand, it keeps a better convergence rate than first-order algorithms, leading to fewer communication rounds between the devices and the server.
On the other hand, compared with other second-order algorithms under over-the-air computation, the aggregation operation only occurs once per iteration in our proposed algorithm.
Therefore, our proposed algorithm is more communication-efficient than baseline algorithms in terms of both the total iteration rounds and the communication within each iteration, which further benefit learning performance, as illustrated in Fig. \ref{with mnist}.
\section{Conclusion}
\label{Conclusion}
In this paper, we developed a communication-efficient FL system by over-the-air second-order federated optimization algorithm.
The communication rounds and communication latency at each round can be simultaneously reduced.
This is achieved by leveraging the second-order information of the learning loss function for achieving fast convergence rates and exploiting the signal superposition property of a multiple access channel for fast model aggregation.
The characterized convergence behavior reveals a linear-quadratic convergence rate for the proposed algorithm.
As the proposed algorithm is accompanied by an accumulative error term in each iteration, a system optimization problem was formulated to minimize the total error gap while achieving a precise model. We then presented Gibbs Sampling and DC programming methods to jointly optimize device selection and receiver beamforming. The experimental results illustrated that our proposed algorithm and network optimization approach can achieve high communication efficiency for FL systems.
\begin{appendices}
\section{Proof of Lemma 3}
In order to bound $\hat{\bm{p}_{t}}$ through $\bm{p}^{*}$, the difference between the values of their quadratic functions is essential.
According to \eqref{decomposition_global_update_direction}, here we decompose this difference as
\begin{small}
\begin{align*}
\phi_{t}\left(\hat{\bm{p}}_{t}\right)-\phi_{t}\left(\bm{p}^{*}\right)
=& \frac{1}{2}\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\hat{\bm{p}}_{t}-\bm{p}^{*}\right)\right\|^{2}
= \frac{1}{2}\left\|\bm{H}_{t}^{\frac{1}{2}}\left[\left(\bar{\bm{p}}_{t}-\bm{p}^{*}\right)+\left(\bm{p}_{t}-\bar{\bm{p}}_{t}\right)+\left(\tilde{\bm{p}}_{t}-\bm{p}_{t}\right)+\left(\hat{\bm{p}}_{t}-\tilde{\bm{p}}_{t}\right) \right]\right\|^{2} \\
\leq& \underbrace{\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\bm{p}_{t}-\bar{\bm{p}}_{t}\right)\right\|^{2}}_{\text{Term 1}} +\underbrace{3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t}-\bm{p}^{*}\right)\right\|^{2}}_{\text{Term 2}} + \underbrace{3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\tilde{\bm{p}}_{t} - \bm{p}_{t}\right)\right\|^{2}}_{\text{Term 3}} + \underbrace{3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\hat{\bm{p}}_{t}-\tilde{\bm{p}}_{t}\right)\right\|^{2}}_{\text{Term 4}}\;,
\end{align*}
\end{small}
As for Term 1, by Lemma 1, we have $(1-\lambda) \bm{M}_{t}^\mathsf{T} \bm{M}_{t} \preceq \bm{M}_{t}^\mathsf{T} \bm{L}_{i} \bm{L}_{i}^\mathsf{T} \bm{M}_{t} \preceq (1+\lambda) \bm{M}_{t}^\mathsf{T} \bm{M}_{t}$.
Through this we can get $(1-\lambda) \bm{H}_{t} \preceq \bm{H}_{i, t} \preceq(1+\lambda) \bm{H}_{t}$. Thus, there exists matrix $\xi_{i}$
satisfying $\bm{H}_{t}^{\frac{1}{2}} \bm{H}_{t,i}^{-1} \bm{H}_{t}^{\frac{1}{2}}=\bm{I}+\xi_{i} $ and $-\frac{\lambda}{1+\lambda} \preceq \xi_{i} \preceq \frac{\lambda}{1-\lambda}$,
which leads to a useful property: $\left\|\bm{H}_{t}^{\frac{1}{2}} \bm{H}_{t,i}^{-1} \bm{H}_{t}^{\frac{1}{2}}\right\| \leq 1+\frac{\lambda}{1-\lambda}=\frac{1}{1-\lambda}$.
With this property and Lemma 2, we can get the following inequality:
\begin{small}
\begin{align*}
\norm{\bm{H}_{t}^{\frac{1}{2}}\bracket{\bm{p}_{t} - \bar{\bm{p}}_{t}}}
&\leq \frac{1}{n} \sum_{i\in \mathcal{S}} \card{\mathcal{D}_{i}} \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{H}_{t,i}^{-1}\bm{H}_{t}^{\frac{1}{2}}}\norm{\bm{H}_{t}^{-\frac{1}{2}}\bracket{\bm{g}_{t,i}-\bm{g}_{t}}} \\
&\leq \frac{1}{1-\lambda} \frac{1}{\sigma_{min}\bracket{\bm{H}_{t}}}\frac{1}{n} \sum_{i\in \mathcal{S}} \card{\mathcal{D}_{i}} \bracket{1 + \sqrt{2 \ln{\frac{1}{\delta_{i}}}}}\sqrt{\frac{1}{\card{\mathcal{D}_{i}}}}\max_{j}\norm{\bm{n}_{j}} \\
&\leq \frac{1}{1-\lambda} \frac{1}{\sigma_{min}\bracket{\bm{H}_{t}}}\frac{1}{n}\bracket{1 + \sqrt{2 \ln{\frac{1}{\tilde{\delta}}}}}\max_{j}\norm{\bm{n}_{j}}\sqrt{\sum_{i\in \mathcal{S}}m\card{\mathcal{D}_{i}}}\\
&= \frac{1}{1-\lambda} \frac{1}{\sigma_{min}\bracket{\bm{H}_{t}}}\bracket{1 + \sqrt{2 \ln{\frac{1}{\tilde{\delta}}}}}\sqrt{\frac{m}{n}}\max_{j}\norm{\bm{n}_{j}} \;.
\end{align*}
\end{small}
For convenience, we denote:
$\mathcal{G} = \frac{1}{1-\lambda} \frac{1}{\sigma_{min}\bracket{\bm{H}_{t}}}\bracket{1 + \sqrt{2 \ln{\frac{1}{\tilde{\delta}}}}}\max_{j}\norm{\bm{n}_{j}}\;,$
and Term 1 is bounded by $\text{Term 1} \leq \frac{m}{n}\mathcal{G}^2$.
As for Term 2, based on the analysis in \cite[Lemma 6]{wang2018giant}, we have
\begin{small}
\begin{align*}
\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t}-\bm{p}^{*}\right)\right\|
&\leq \norm{\frac{1}{n}\sum_{i\in\mathcal{S}}\card{\mathcal{D}_{i}}\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t,i}-\bm{p}^{*}\right)}
\leq \frac{1}{n}\sum_{i\in\mathcal{S}}\card{\mathcal{D}_{i}}\norm{\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t,i}-\bm{p}^{*}\right)}
\leq
\zeta_{1} \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}} \;,
\end{align*}
\end{small}
with $\zeta_{1}=\tau\left(\lambda+\frac{\lambda^{2}}{1-\lambda}\right)$ and $\tau=\frac{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)}{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)+n\gamma}$.
Then Term 2 is bound by:
\begin{small}
\begin{align*}
\text{Term 2} = 3 \left\|\bm{H}_{t}^{\frac{1}{2}}\left(\bar{\bm{p}}_{t}-\bm{p}^{*}\right)\right\|^{2} \leq 3\zeta_{1}^{2} \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}}^{2} = - 3\zeta_{1}^{2} \phi\bracket{\bm{p}^{*}}.
\end{align*}
\end{small}
As for Term 3, it can be reformulated as follows:
\begin{small}
\begin{align*}
\text{Term 3}
=3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\tilde{\bm{p}}_{t} - \bm{p}_{t}\right)\right\|^{2} = 3\left\|\bm{H}_{t}^{\frac{1}{2}}\left(\frac{1}{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}\bm{p}_{t,i}-\frac{1}{n}\sum_{i\in\mathcal{S}}\card{\mathcal{D}_{i}}\bm{p}_{t,i}\right)\right\|^{2}\;.
\end{align*}
\end{small}
According to the analysis in \cite[Section 3.1]{friedlander2012hybrid}, it follows:
\begin{small}
\begin{align*}
\text{Term 3}
\leq& 12\bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}}^{2}\bracket{\norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}_{t,i} - \bm{H}_{t}^{\frac{1}{2}}\bar{\bm{p}}_{t,i}} + \norm{\bm{H}_{t}^{\frac{1}{2}}\bar{\bm{p}}_{t,i} - \bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}} + \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}}}^{2} \\
\stackrel{(a)}{\leq}& 12 \bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}}^{2}\bracket{\sqrt{\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}}\mathcal{G} +
\norm{\bm{H}_{t}^{\frac{1}{2}}\bar{\bm{p}}_{t,i} - \bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}} + \norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}}}^{2} \\
\stackrel{(b)}{\leq}& 12 \bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}}^{2}\bracket{\sqrt{\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}}\mathcal{G} +
\bracket{\zeta_{1}+ 1}\norm{\bm{H}_{t}^{\frac{1}{2}}\bm{p}^{*}}}^{2} \\
\leq& 24\bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}}^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\mathcal{G}^{2} - 24\vartheta^{2}\bracket{\zeta_{1}+ 1}^{2}\phi\bracket{\bm{p}^{*}}
\end{align*}
\end{small}
where $\zeta_{1}=\tau\left(\lambda+\frac{\lambda^{2}}{1-\lambda}\right)$, $\tau=\frac{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)}{\sigma_{\max }\left(\bm{M}^{\top} \bm{M}\right)+n\gamma}$, $\vartheta = \max _{t}\bracket{1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}} < 1$, $\left(a\right)$ and $\left(b\right)$ are obtained in the way similar to the analysis of Term 1 and Term 2.
As for Term 4, we have:
\begin{small}
\begin{align*}
\text{Term 4}
= 3\norm{\bm{H}_{t}^{\frac{1}{2}}\frac{1}{\bracket{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bm{a}_{t}^\mathsf{H}\bm{E}_{t}}^{2}
\leq \frac{3}{\sigma_{\min}\left(\bm{H}_{t}\right)}\left\|\frac{1}{\bracket{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bm{a}_{t}^\mathsf{H}\bm{E}_{t}\right\|^{2}\;.
\end{align*}
\end{small}
We can get the final result by combining the bound of Term 1, 2, 3 and 4 together:
\begin{small}
\begin{align*}
\phi\left(\hat{\bm{p}}_{t}\right)-\phi\left(\bm{p}^{*}\right) \leq \epsilon^{2}-\zeta^{2} \phi\left(\bm{p}^{*}\right)
\Rightarrow \phi\left(\bm{p}^{*}\right) \leq \phi\left(\hat{\bm{p}}_{t}\right) \leq \epsilon^{2}+\left(1-\zeta^{2}\right) \phi\left(\bm{p}^{*}\right)\;,
\end{align*}
\end{small}
where $\epsilon$ and $\zeta$ are defined as \eqref{zeta} and \eqref{epsilon}.
\section{Proof of Theorem 1}
Based on Lemma 3 and Lemma 4, we have:
\begin{small}
\begin{align*}
\bm{\Delta}_{t+1}^{\top} \bm{H}_{t} \bm{\Delta}_{t+1}
\leq& L\left\|\bm{\Delta}_{t+1}\right\|\left\|\bm{\Delta}_{t}\right\|^{2}+\frac{\zeta^{2}}{1-\zeta^{2}} \bm{\Delta}_{t}^{\top} \bm{H}_{t} \bm{\Delta}_{t}+2 \epsilon^{2}
\leq L\left\|\bm{\Delta}_{t+1}\right\|\left\|\bm{\Delta}_{t}\right\|^{2}+\left(\frac{\zeta^{2}}{1-\zeta^{2}} \sigma_{\max }\left(\mathbf{H}_{t}\right)\right)\left\|\bm{\Delta}_{t}\right\|^{2}+2 \epsilon^{2}\;.
\end{align*}
\end{small}
According to the analysis in \cite[Appendix A]{ghosh2020distributed}, this leads to:
\begin{small}
\begin{equation}
\begin{aligned}
\left\|\bm{\Delta}_{t+1}\right\|
\leq& \max \left\{\sqrt{\frac{\sigma_{\max }\left(\bm{H}_{t}\right)}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(\frac{\zeta^{2}}{1-\zeta^{2}}\right)}\left\|\bm{\Delta}_{t}\right\|, \frac{L}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left\|\bm{\Delta}_{t}\right\|^{2}\right\} +\frac{2 \epsilon}{\sqrt{\sigma_{\min }\left(\mathbf{H}_{t}\right)}}\;.
\end{aligned}
\label{inequality}
\end{equation}
\end{small}
As for the error term $\epsilon$, we have:
\begin{small}
\begin{align*}
\epsilon =& \Bigg\{ \frac{3}{\sigma_{\min}\left(\bm{H}_{t}\right)}\left\|\frac{1}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\bm{a}_{t}^\mathsf{H}\bm{E}_{t}\right\|^{2} + \left[24\left(1 - \frac{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}\right] \mathcal{G}^{2} \Bigg\}^{\frac{1}{2}} \\
\leq& \sqrt{\frac{3}{\sigma_{\min}\left(\bm{H}_{t}\right)}}\frac{d}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}}\left\|\bm{a}_{t}\right\|\left\|\bm{e}_{t}\right\| + \sqrt{24\left(1 - \frac{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}} \cdot \mathcal{G} \;.
\end{align*}
\end{small}
To handle the random variable $\bm{e}_{t}$ in $\epsilon$,
we take expectations over $\bm{e}_{t}$ on both sides of~\eqref{inequality} :
\begin{small}
\begin{align*}
\mathbb{E}\left(\left\|\bm{\Delta}_{t+1}\right\|\right)
\leq& \max \left\{\sqrt{\frac{\sigma_{\max }\left(\bm{H}_{t}\right)}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(\frac{\zeta^{2}}{1-\zeta^{2}}\right)}\left\|\bm{\Delta}_{t}\right\|, \frac{L}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left\|\bm{\Delta}_{t}\right\|^{2}\right\}+\frac{2\sqrt{3}}{\sigma_{\min}\left(\bm{H}_{t}\right)}\frac{ d\left\|\bm{a}_{t}\right\|\mathbb{E}\left(\left\|\bm{e}_{t}\right\|\right)}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}} \\
&+\sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\| \\
\stackrel{(c)}{\leq}& \max \left\{\sqrt{\frac{\sigma_{\max }\left(\bm{H}_{t}\right)}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(\frac{\zeta^{2}}{1-\zeta^{2}}\right)}\left\|\bm{\Delta}_{t}\right\|, \frac{L}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left\|\bm{\Delta}_{t}\right\|^{2}\right\}+\frac{2\sqrt{3}}{\sigma_{\min}\left(\bm{H}_{t}\right)}\frac{ d\sigma\left\|\bm{a}_{t}\right\|}{\bracket{\sum_{i \in \mathcal{S}_{t}}\card{\mathcal{D}_{i}}}\sqrt{\eta_{t}}} \\
&+ \sqrt{24\left(1 - \frac{\sum_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}{n}\right)^{2}\frac{1}{\min_{i\in\mathcal{S}_{t}}\card{\mathcal{D}_{i}}}+\frac{m}{n}}\cdot\frac{1}{1-\lambda} \frac{2}{\sigma_{\min }\left(\bm{H}_{t}\right)}\left(1+\sqrt{2 \ln \left(\frac{1}{\tilde{\delta}}\right)}\right)\max _{j} \left\| \bm{n}_{j} \right\| \;.
\end{align*}
\end{small}
\end{appendices}
\bibliographystyle{ieeetr}
| {'timestamp': '2022-03-30T02:32:31', 'yymm': '2203', 'arxiv_id': '2203.15488', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15488'} | arxiv |
\section{Introduction}
Neural sequence-to-sequence systems deliver state-of-the-art performance for automatic speech recognition (ASR). When using appropriate modeling units, e.g., byte-pair encoded characters, these systems are in principle open vocabulary systems. In practice, however, they often fail to recognize words not seen during training, e.g., named entities, numbers or technical terms.
To alleviate this problem, \cite{huber2021instant} proposed to supplement an end-to-end ASR system with a word/phrase memory and a mechanism to access this memory to recognize the words and phrases correctly.
After the training of the ASR system, and when it has already been deployed, a relevant word can be added or subtracted instantly without the need for further training.
This is achieved by,
a) a memory-attention layer which
predicts the availability and location of relevant information in the memory,
and b) a memory-entry-attention layer which extracts the information of a memory entry.
In this paper we study,
a) methods to acquire specialized words for this memory and, b)
the trade-off between improvement in recognition accuracy of new words and the potential danger of false alarms for those added words. Therefore, we extensively evaluate this system in an online low-latency setup.
The ASR model described above outputs uncased text without punctuation.
Therefore, we run a casing and punctuation model afterwards which reconstructs the casing of each word and inserts the punctuation. This model consists of a transformer encoder \cite{vaswani2017attention,pham2019very} which is run after the beam-search and outputs for each word if the word should be uppercased and if any punctuation should be emitted after the word or not.
To use the model in an online low-latency setup \cite{nguyen2021superhuman}, we do the following: The model waits for a chunk of acoustic frames with at least a predetermined duration to arrive. Then beam search is run with this input chunk. The beams (called unstable hypotheses) are then given to a stability detection
component
which returns a stable hypothesis,
e.g. the common prefix of all hypotheses. After that, the part of audio corresponding to the stable hypothesis is cut out (via an alignment) and the model waits for more audio frames.
\section{Experiments and Results}
We extended the model proposed in \cite{huber2021instant} with the ability to correctly do the casing of the new words supplied through the new words list. This is done by adapting the casing and punctuation model by using internals of the ASR model, namely the attention over the memory entries. For each word the beam-search has outputted, all the predicted memory entries (from the memory-attention layers) are compared with the word. If there is a match, the casing from the new words list is taken. Therefore, whenever a new word is recognized by the model, the correct casing from the new words list is outputted.
Furthermore, we evaluate the system in two different scenarios: First, when an operator adds new words to the system, and second, when new words are extracted from other sources, e.g. slides.
\subsection{Data}
For the first scenario, we use eight talks from the ELITR testset \cite{sltev:eacl:2021} with a total length of 3.7 hours.
For the second scenario, we use ten talks from the EMNLP 2020 conference\footnote{\url{https://2020.emnlp.org}} with a total length of 1.6 hours.
Along with the EMNLP talks, the papers and the slides of the talks are available. The text from the papers (excluding the references) is extracted with pdftotext\footnote{\url{https://en.wikipedia.org/wiki/Pdftotext}}, the text from the slides is extracted with Tesseract\footnote{\url{https://github.com/tesseract-ocr/tesseract}}, since we only had access to screenshots of the slides. We also cleaned the transcripts of all talks from typos, so that they could serve as a reliable reference.
\begin{figure}[t]
\centering
\includegraphics[trim={0 0 14cm 0},clip,width=0.9\linewidth]{images/plot_ELITR.pdf}
\caption{Recall and precision for the evaluation of the memory ASR-worker on the ELITR testset.}
\label{fig:testsetELITR}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[trim={14cm 0 0 0},clip,width=0.9\linewidth]{images/plot_ELITR.pdf}
\caption{mWER and F1-score for the evaluation of the memory ASR-worker on the ELITR testset.}
\label{fig:testsetELITR2}
\end{figure}
\subsection{Extraction of the New Words List}
We tried different methods to extract a list of new words from the document, and we ended up taking all the words of the document which are not in the training data of the ASR model. This method is simple and performed well when looking at the output words\footnote{Furthermore this method is very effective in finding errors in the transcript.}. For example in the talk \texttt{rehm\_long},\footurl{https://github.com/ELITR/elitr-testset/tree/master/documents/rehm-language-technologies} we have extracted the following list of new words:
pipelining, Friem, iAnnotate, MQM, LSPs, eServices, semantification, Aljoscha, Cortana, workflows, DFKI, annotating, NLP.
With this method, we extracted 134 terms from the ELITR testset
reference transcripts,
148 from the EMNLP testset
reference transcripts,
865 from the EMNLP papers and 584 from the EMNLP slides.
Note that, in contrast to the new-words testset in \cite{huber2021instant}, the list of new words is created automatically and might differ from a list of new or rare words a human might select.
\subsection{Evaluation with the Help of an Operator}
\begin{figure}[t]
\centering
\includegraphics[trim={0.15cm 0 17.9cm 0},clip,width=1.0\linewidth]{images/plot_EMNLP.pdf}
\caption{Recall and precision for the evaluation of the memory ASR-worker on the EMNLP testset.}
\label{fig:testsetEMNLP}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[trim={18.1cm 0 0.25cm 0},clip,width=1.0\linewidth]{images/plot_EMNLP.pdf}
\caption{mWER and F1-score for the evaluation of the memory ASR-worker on the EMNLP testset.
}
\label{fig:testsetEMNLP2}
\end{figure}
In this scenario, we evaluate the system, when the list of new words is extracted from the reference transcript (Oracle). This simulates an operator introducing new misrecognized words in the memory. We use eight talks of the ELITR testset for the evaluation.
Dependent on the approach used (x axis in \cref{fig:testsetELITR,fig:testsetELITR2}), either an empty list of new words (Empty),
i.e. the baseline,
or the full list of new words (Oracle) is used.
For the approaches ``* af. occ.'' and ``* be. occ.'', a new word is added to the list of new words \textit{after} the first \textit{occurrence} or \textit{before} the first \textit{occurrence} of that word, respectively. These two approaches simulate an operator correcting the output and either the corrected segment is reevaluated or not. The first condition reflects the case when the operator can quickly react to errors but cannot fix them once the segment has been shipped, the second condition represents the situation when either the shipping is delayed a little to give the operator a chance to introduce the correction, or when the overall system setup allows updating previous outputs. The second situation is common e.g. in re-translating systems such as ELITR \cite{bojar-etal-2021-elitr}.
Furthermore, we noticed, that sometimes false positives occurred, i.e. a word in the new words list is confused with a common word and outputted even though it is not in the audio and the reference transcript at that point. In the approaches marked with ``* ext. *'', we therefore \textit{extended} the list of new words and added these common words also to the new words list. This should help the model to distinguish between the common word and the new word.
These approaches simulate an operator adding common words to the memory when a false positive is observed.
The mWER segmenter \cite{matusov2005evaluating} is used to align the output segments with the reference segments. In \cref{fig:testsetELITR,fig:testsetELITR2}, we can see the results.
The recall, precision and F1 score is measured on the new words. The baseline model with empty memory performs poorly. For the other approaches, we see that it certainly helps to add the new word before the occurrence. The approaches with extended memory list produce substantially fewer false positives with the approach ``Oracle ext. be. occ.'' reaching an F1 score of $0.80\pm 0.02$.
Furthermore, we see that all approaches have similar word error rates (mWER) suggesting that the word error rate is not an appropriate measure for evaluating if important words are correctly recognized. Note that the talks are challenging and the transcript is not very clean and therefore the word error rates are relatively high.
We noticed that the performance of the ASR worker when used in online low-latency mode is not deterministic. This happens because the packets of audio are sent over the network and they can, dependent on the network latency, arrive earlier or later. Therefore, when the predetermined duration of audio is reached, the model can start processing a slightly smaller or longer audio input sequence.
Thus, as described above, the stable hypothesis found by the stability detection is not deterministic and therefore the same holds true for the ASR output. Therefore, we report mean and standard deviation performance over 16 runs as shown in \cref{fig:testsetELITR,fig:testsetELITR2}.
\subsection{Evaluation with Additional Sources}
In this scenario, we evaluate the system when the list of new words is extracted from additional sources. We conducted experiments on ten talks from the EMNLP 2020 conference. The list of new words was extracted from the paper or the slides (with optical character recognition), respectively, with the same method described above. For the approach ``Curr. slides'', the new words list was extracted from the previous, current and the upcoming slide.
In \cref{fig:testsetEMNLP,fig:testsetEMNLP2}, we see similar results for the approaches that were already evaluated on the ELITR testset (e.g. F1 scores of $0.66\pm 0.01$ vs. $0.65\pm 0.02$ for the oracle approaches).
For the approaches ``Paper'' and ``* slides'', we evaluate the performance on all the new words of the transcript and on the new words of the transcript intersected with the new words from the source.
We differentiate between these two evaluation methods to show the effect of the new uttered word being actually available in the source or not.
The performance on the new words of the approach ``Paper'' is not much worse than the oracle approach (F1 scores of $0.66\pm 0.01$ vs. $0.56\pm 0.01$), especially when considering the evaluation only of new words present in the paper ($0.63\pm 0.01$), compared to an F1 score of $0.09\pm 0.00$ for the approach ``Empty''.
The performance when extracting the new words list from the slides is worse when evaluating on all new words from the transcript, possibly due to the used optical character recognition.
When evaluating only on new words present in the slides, the performance is better than the corresponding approach of extracting the new words from the paper.
Combining the new words from the paper and the slides did not yield improvements.
The word error rate (mWER) stays almost the same for all approaches, however one can see that for the approaches with many words in the memory, the word error rate is a bit higher. We investigate this phenomenon further in section \ref{sec:add-exp}.
\subsection{Additional Experiments}
\label{sec:add-exp}
We investigated the usage of a large memory and took a certain number of random words from the training dataset as memory. Then we decoded the tedlium testset \cite{hernandez2018ted}. The results can be seen in \cref{fig:testsetMemorySize}: a huge number of words in the memory result in a drastically worse word error rate. This happens since a lot of false positives are occurring.
\begin{figure}[t]
\centering
\includegraphics[trim={0 0 0 0},clip,width=1.0\linewidth]{images/plot_largemem.pdf}
\caption{Evaluation of the memory ASR-worker on the tedlium testset with a large number of random words from the training dataset in the memory.}
\label{fig:testsetMemorySize}
\end{figure}
Therefore, our approach is best used with a small number of new words the model should focus on.
As the final experiment, we examined the situation when a new word in the memory is not found (by the memory-attention layers). This can happen if the pronunciation of the word differs considerable from the ``common pronunciation'' as learned by the general model. To help the model recognize the new word anyway, we propose not to search for the new word but for the word the model outputs instead. So for example if we want to recognize ``his name is ron weasly" but the model would output ``his name is ron weesley" even if the word ``weasly" is in the memory, we would use the confused form ``weesley" in the memory-attention layer which searches through the memory and eventually use ``weasly" for memory-entry-attention layer which
extracts information from
from the memory.
Note that in this case, the scenario for the practical use is severely different. Instead of the information that a novel word will probably occur somewhere in the transcript, one now needs to have the information that at a specific point a word is wrong and another word is correct at that location.
We went through the false negatives of the new words testset from \cite{huber2021instant} and applied this approach.
As a result, we obtained that the accuracy on the new words testset increased from 90.4\% to 94.1\%.
\section{Conclusion}
We demonstrated an efficient method of acquiring a new words list given a source such as supplementary paper or slides and evaluated the trade-off between improving the recognition accuracy of new words and the occurrence of too many false positives in an online low-latency environment.
We documented that standard WER does not reflect the success of recognition of these typically very important words.
We obtained an F1 score of up to $0.80$ evaluated on the recognition of new words.
\section{Acknowledgements}
We want to thank SlidesLive,\footnote{\url{https://library.slideslive.com/}} who provided us with the transcripts of the EMNLP talks.
The projects on which this paper is based were funded by the European Union under grant agreement No 825460 (ELITR), the Federal Ministry of Education and Research (BMBF) of Germany under the numbers 01IS18040A (OML) and 01EF1803B (RELATER) and the Czech Science Foundation under the grant 19-26934X (NEUREM3).
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-03-30T02:28:33', 'yymm': '2203', 'arxiv_id': '2203.15404', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15404'} | arxiv |
\section{Introduction}\label{sec:introduction}
\begin{figure}[t]
\centering
\includegraphics[width=0.45\textwidth]{figures/teaser.pdf}
\caption{Our method is trained to approximate the output of an ensemble, by using structured uncertainty prediction networks (SUPN) to predict a mean and covariance for a multivariate Gaussian distribution. This explicit distribution enables a variety of tasks including: sampling, conditioning and model introspection. }
\label{fig:teaser}
\end{figure}
Single prediction neural networks are ubiquitous in computer vision and have demonstrated extensive capability for a variety of tasks.
However, researchers are increasingly interested in capturing the uncertainty in estimation tasks to combat over-confidence and ambiguity; such concerns are important when building robust systems that connect computer vision approaches to down-stream applications.
The deployment of neural networks for safety-critical tasks, such as autonomous driving, requires an accurate measure of uncertainty.
While Bayesian Neural Networks~\cite{mackay1995probable} are often a model of choice for uncertainty estimation, ensembles~\cite{lakshminarayanan2017simple} have been proposed as a simple alternative.
Empirically, ensembles have been shown to produce good measures of uncertainty for vision tasks~\cite{li2020improving, poggi2020uncertainty} and allow practitioners to exploit associated application-specific inductive biases, for example established architectures, directly.
\paragraph{Limitations of implicit approaches}
Despite their popularity, ensembles have a number of drawbacks that we group into three themes.
Firstly, they come at an increased cost compared with deterministic networks. At training time, they require training multiple deep models, while at test time, multiple inference passes are required. MC-dropout \cite{gal2016dropout} saves computation at training time, but it still requires multiple passes at inference time.
Secondly, these approaches only provide an implicit distribution over probable model outputs. Any uncertainty captured is only accessible through ancestral sampling.
Accordingly, one cannot calculate conditional samples, or assess the likelihood of a new sample given the learned model.
Finally, and of increasing importance to the community, introspection of the trained models is very difficult.
When combining computer vision with larger systems, there is virtue to summarising the posterior distribution in a formal and compact form that can be visualised and appropriately used to inform downstream tasks.
The computational challenges have prompted work on producing a single model to approximate the output of an ensemble; so called ``ensemble distillation''~\cite{malinin2020ensemble, li2020improving,bulo2016dropout,shen2021real}.
\paragraph{Lack of structure in distillation methods}
Previous methods focus on: classification problems~\cite{malinin2020ensemble, li2020improving}, approximating only the mean of the ensemble~\cite{bulo2016dropout}, or modelling independent per-pixel variance~\cite{shen2021real}.
In contrast, while we also adopt a single model to reduce the computational cost, we propose to learn a model that approximates the ensemble by formally capturing structure in the output space; this is more appropriate for dense prediction tasks.
When making per-pixel predictions, it is common to use models that capture spatial correlation in the output space. In particular, models such as Markov or Conditional Random Fields~\cite{prince2012computer}, which capture correlations between neighbouring pixels, have been extensively used in computer vision.
However, capturing the structure of the output space is less explored in the context of modelling uncertainty.
Previous work has focused on per-pixel heteroscedastic uncertainty, by using a Gaussian~\cite{kendall2017uncertainties, shen2021real} or Laplace~\cite{klodt2018supervising} likelihood model with diagonal covariance.
Since these models do not capture correlations between pixels, samples suffer from salt-and-pepper (independent) noise.
\paragraph{Capturing structure explicitly}
Previously, adopting per-pixel uncertainty representations usually follows from the expectation that direct estimation of a full covariance structure is intractable in both storage $\mathcal{O}(\text{pixels}^2)$ and computation $\mathcal{O}(\text{pixels}^3)$.
Recently, however, Dorta~\etal~\cite{dorta2018structured} introduced Structured Uncertainty
Pprediction Networks (SUPN) for generative models. The paper extended a Variational Auto Encoder (VAE)~\cite{kingma2013auto} with a likelihood model that is Gaussian with a full covariance matrix.
The authors show how this can be predicted efficiently by using a sparse approximation of the Cholesky decomposition of the \emph{precision} matrix.
Working in the domain of the precision allows a dense covariance structure to be obtained whilst also respecting our prior that long range structure is derived from the propagation of local image statistics.
By encoding a full covariance matrix, the samples obtained from such a model capture these long range correlations in the image domain and are free from salt-and-pepper (independent) noise.
\paragraph{Contributions}
In this work, we build on SUPN~\cite{dorta2018structured} and show that a deep network can be trained in a regression setting to predict a structured Gaussian distribution that approximates the output distribution of methods that capture model uncertainty, such as ensembles~\cite{lakshminarayanan2017simple} and MC-dropout~\cite{gal2016dropout}.
We introduce a novel efficient approach to drawing conditioned or unconditioned samples from a structured multivariate Gaussian distribution with a sparsely structured precision matrix.
By taking full advantage of the closed form nature of the Gaussian distribution, our method allows introspection and enables conditioning at test time, which proves cumbersome for other methods.
Importantly, our approach is not limited to Gaussian likelihoods over the prediction space (see~\S~\ref{sec:non-gauss-likelihood}).
\paragraph{Evaluation}
We demonstrate the efficacy of our method for the task of depth estimation.
Experiments show that the new advantages can be obtained without sacrificing quantitative performance, with results comparable to the original ensemble; we consider metrics over both accuracy and the capture of uncertainty.
The samples are found to follow the ensembles without being limited in the number that can be drawn.
The compact representation is capable of encoding a rich distribution with only a modest increase in computation over a single deterministic network.
Furthermore, we demonstrate using our explicit representation to perform conditional sampling and illustrate the ability to inspect the model and visualise the correlation structure learned.
\section{Background}
Our goal is to model $p(\mLabels \given \mInputs)$, where $\mInputs$ is the observed image and $\mLabels$ is a per-pixel prediction, \eg a semantic labelling or depth map. While most deterministic deep models can be seen as capturing the mean $\mMean(\mInputs)$ of this distribution, we are interested in models that also capture the variance $\mCovariance(\mInputs)$.
\subsection{Uncertainty in Deep Models}
Previous work for probabilistic modelling using neural networks, can be broadly grouped into three categories: (1) Bayesian approaches that model uncertainty of the network parameters, (2) methods that empirically approximate Bayesian approaches by predicting multiple hypothesis, and (3) approaches that model $p(\mLabels \given \mInputs)$ directly by predicting a parametric distribution.
The literature on uncertainty modelling in neural networks is vast and we direct the interested reader to a recent review~\cite{abdar2020review}.
\paragraph{Modelling uncertainty in the parameters}
Bayesian neural networks~\cite{mackay1995probable} model uncertainty by modelling the probability distribution of the learned weights~$\mModelParams$ of the network.
The resulting posterior $p(\mLabels \given \mInputs)$ is then obtained by marginalising over the weights:
\begin{equation}
p(\mLabels \given \mInputs, \mDataset) = \int p(\mLabels \given \mInputs, \mModelParams) \, p(\mModelParams \given \mDataset)~d \mModelParams \,,
\label{eq:bayesian_networks}
\end{equation}
where $\mModelParams$ are the model parameters, and we make explicit the dependence on the dataset $\mDataset$.
While this approach is able to model arbitrary distributions $p(\mLabels|\mInputs)$,
and generate samples which are correlated in output space, it also suffers some limitations.
The majority of approaches rely on mean-field approximations over the weights to maintain tractability.
In addition, it is difficult to condition on any of the output values due to the absence of a parametric distribution over the posterior.
MC-dropout~\cite{gal2016dropout} approximates Bayesian networks by using dropout at both training and test time. Dropout was first proposed to reduce over-fitting in deep neural networks~\cite{srivastava2014dropout} and it proceeds by randomly setting some of the weights of the network to zero. It has been shown, \cite{gal2016dropout}, that this random dropping of weights at test time is akin to sampling from the distribution $p(\mModelParams \given \mDataset)$ and may be used to approximate the integral in~ \eqref{eq:bayesian_networks}.
\paragraph{Multiple hypothesis}
Ensemble methods make use of multiple models and combine them to get a single prediction.
Deep ensembles can be trained using bootstraping~\cite{lakshminarayanan2017simple}, \ie splitting the training set into multiple random subsets and training each model in the ensemble independently. Alternatively, to save computation, a deep ensemble can be trained by taking multiple snapshots~\cite{huang2017snapshot} from the same training procedure, requiring a cyclic learning rate.
Ensembles have been shown to provide good measures of uncertainty~\cite{lakshminarayanan2017simple}. They can be seen as approximating Bayesian networks by replacing the integral in~\eqref{eq:bayesian_networks} by a sum over a discrete number of models.
As discussed in \S~\ref{sec:introduction}, training and inference procedures can become expensive in terms of maintaining an increasing number of networks; practical approaches are often limited in the number of distinct models that, in turn, restricts the number test-time samples.
\paragraph{Predictive uncertainty via parametric distributions}
The other alternative to modelling uncertainty is to use a feed-forward neural network to predict the parameters of a parametric distribution~\cite{kendall2017uncertainties}.
For regression tasks, $p(\mLabels|\mInputs)$ is typically described by a Gaussian likelihood, where the mean and variance are outputs of the neural network:
\begin{equation}
p(\mLabels \given \mInputs) \sim \mNormal\big(\mLabels \given \mMean(\mInputs), \mCovariance(\mInputs) \big) \,,
\label{eq:gaussianl_likelihood}
\end{equation}
where $\mCovariance(\mInputs)$ is usually approximated by a diagonal matrix where the diagonal elements are predicted by the network.
Kendall and Gal~\cite{kendall2017uncertainties} discuss how the predicted variance can be seen as a loss attenuation factor, reducing the loss for outliers; this predicted per-pixel variance is shown to correlate with error in the predictions.
Evaluating predictive uncertainty is more efficient since a single pass of the network at test time is sufficient to fully determine the measure of uncertainty.
However, independent per-pixel uncertainty estimates fail to capture spatial correlation that is known to exist in images; samples from these models are destined to be unrealistic and suffer from salt-and-pepper noise.
\paragraph{Ensemble distillation}
Recently, there has been a growing interest in approximating the probabilistic output of an ensemble by a single model\cite{malinin2020ensemble, li2020improving,bulo2016dropout,shen2021real}. This process is commonly named ``distillation''. Most of the focus has been on classification \cite{malinin2020ensemble, li2020improving}, where the goal is to predict the class of the image. While these methods show impressive results in detecting out-of-distribution images, they are not easily extended for dense prediction tasks.
Other methods focus on approximating only the mean of the ensemble distribution \cite{bulo2016dropout}, or modelling independent per-pixel variance \cite{shen2021real}.
In contrast, our model also does ensemble distillation, but can capture structure in the output space.
\paragraph{Uncertainty in depth prediction models}
The goal of self-supervised depth estimation is to train a network to predict single image depth maps without explicit depth supervision \cite{godard2017monodepth, godard2019digging}. Instead, self-supervised approaches use geometric constraints between two calibrated stereo cameras to learn depth prediction. At test time, these methods do not require a stereo pair, only a single image.
Given the inherit ambiguity of predicting depth from a single image, depth prediction is a natural use case for uncertainty estimation in dense prediction tasks.
In \cite{poggi2020uncertainty} the authors review and compare different approaches for uncertainty prediction for self-supervised depth prediction. They focus on methods that predict multiple hypothesis, such as dropout~\cite{gal2016dropout} and ensembles~\cite{lakshminarayanan2017simple}, methods that predict per-pixel independent heteroscedastic uncertainty~\cite{klodt2018supervising}, and combinations of both.
In the experiments, we use the pre-trained networks provided by \cite{poggi2020uncertainty} to evaluate the efficiency of our method in approximating ensembles.
In particular, we use their most successful model, which combines an ensemble with predictive uncertainty. Their ensembles are trained using bootstrapping \cite{lakshminarayanan2017simple}, and they use an uncorrelated Laplace distribution for predictive parametric uncertainty.
Xia~\etal~\cite{xia2020generating} show how a probabilistic model for depth prediction can be explored by downstream tasks such as inference with additional information. They model uncertainty at a patch level in a model akin to a Markov Random Field.
In contrast to our approach, the method requires solving a complex optimization problem at inference time.
\subsection{Predicting Structured Gaussian Distributions}
\label{sec:SUPN}
To approximate an ensemble, we train a network to predict the parameters of a Gaussian distribution.
Given an input image $\mInputs$ the network outputs the parameters of a Gaussian distribution $\mMean(\mInputs)$ and $\mCovariance(\mInputs)$.
We focus on dense prediction tasks. For these tasks, if $N$ is the number of pixels in the input image, the size of $\mMean$ is also $N$ while a full $\mCovariance$ matrix has $N^{2}$ parameters.
The quadratic scaling of the number of parameters of the covariance matrix leads to the common remedy of a diagonal matrix, which requires only $N$ parameters. However, this simplifying assumption prohibits the capture of correlations between pixels.
\paragraph{Structured Uncertainty Prediction Networks}
Our approach builds on the work, \cite{williams1996using, dorta2018structured}, where the parameterisation used is the Cholesky decomposition of the precision matrix, \ie the network predicts $\mCholPrec$ directly, where $\mCholPrec \trans{\mCholPrec} = \inv{\mCovariance}$ and $\mCholPrec$ is a lower triangular matrix.
For completeness, we review some of the properties of the parameterisation presented in \cite{dorta2018structured}, which we use in our work.
When choosing a parameterisation, there are a few criteria that should be taken into account: how easy it is to evaluate the likelihood function required for training, how easy it is to sample from the distribution at inference time and how easy is to impose that the covariance matrix (or equivalently precision matrix) is symmetric and positive definite?
Direct prediction of the Cholesky factor guarantees that the precision matrix is symmetric.
To guarantee that it is positive definite, the diagonal values of the Cholesky decomposition are required to be positive; an easy constraint to enforce in practice.
This choice of parameterisation allows for easy computation of the log-likelihood of the multivariate Gaussian distribution.
However, sampling is more difficult to perform, since access to the covariance is required.
We discuss a new efficient method for sampling in \S~\ref{sec:sampling}.
\paragraph{Sparsity} Despite the advantages of using this parameterisation and the fact that the Cholesky is a lower triangular matrix, the number of elements still grows quadratically with respect to the number of pixels, $N$, making it prohibitive to directly estimate for large images.
We follow SUPN~\cite{dorta2018structured} in imposing sparsity in the Cholesky matrix $\mCholPrec$.
For each pixel, we only populate the Cholesky matrix for pixels which are in a small neighborhood, while keeping the matrix lower-triangular. We include an illustration in the supplemental material.
This sparse Cholesky matrix can be compactly represented by only predicting the non-zero values; for a $3 \times 3$ neighborhood, this corresponds to predicting the diagonal map plus 4 off-diagonal maps.
Importantly,
this representation can be encoded efficiently into popular APIs such as Tensorflow and PyTorch using standard convolutional operations.
\paragraph{Deep Gaussian MRFs}
Our model can be seen as a Gaussian Markov Random Field, since the sparsity pattern on the precision matrix directly implies the Markov property: a variable is conditional independent of all other variables given its neighbours.
Similar to our approach, \cite{chandra2016fast, vemulapalli2016gaussian, rtf2012} use a regression model to predict the parameters of a Gaussian Conditional Random Field that captures structure in output space. They show improved results for semantic segmentation. However, they focus on predicting the MAP solution and %
do not make use of the full probability distribution.
\newcommand{\mIdentity}[0]{\mathbf{I}}
\section{Method}
Our goal is to train a single network that approximates the multiple outputs of an ensemble. We assume this ensemble is given as a pre-trained network(s), %
\eg from \cite{lakshminarayanan2017simple} or \cite{huang2017snapshot}.
We predict a structured multivariate Gaussian using the sparse representation discussed in \S~\ref{sec:SUPN}.
\subsection{Training}
Given %
$I$ training images $\{\mInputs_i \given i \in [1, \mNumImages]\}$,
the pre-trained ensemble is run for the full training set, to obtain $S$ distinct predictions per image $\{\mLabels_i^s \given s \in [1, S] \}$, where $S$ is the size of the ensemble or number of MC-dropout samples.
\paragraph{Log-likelihood loss}
Our network is trained to %
minimise the negative log-likelihood of the training set:
\begin{equation}
\mathcal{L} = - \sum_{i=1}^{\mNumImages}\sum_{s=1}^{S} \, \log \mNormal\big(\mLabels_i^s \given \mMean(\mInputs_i), \mCovariance(\mInputs_i) \big) \,,
\end{equation}
where $\mNormal\big(\mLabels_i^s \given \mMean(\mInputs_i), \mCovariance(\mInputs_i) \big)$ is the probability density function of a multivariate Gaussian distribution.
\subsection{Inference}
In common with ensembles and MC-dropout, we can use our model to obtain samples from the predictive distribution $p(\mLabels \given \mInputs)$. In contrast with ensembles, our model is not restricted on the number of samples that can be taken; we discuss an efficient sampling procedure in~\S~\ref{sec:sampling}.
More importantly, since our model predicts a closed form probability function, it allows for additional inference tasks which are not possible with ensembles or MC-dropout.
\paragraph{Evaluation of the predictive log-likelihood}
Our model allows evaluating the log-likelihood for a given dense prediction. This is useful for model comparison.
\paragraph{Conditional distribution}
The output Gaussian distribution can be used to compute the conditional distribution of some pixel labels, given the label for other pixels.
The ability of drawing conditional samples has practical applications, for example: for depth completion, where the depth of a small number of pixels is provided by an external sensor, such as a LIDAR scanner; or for interactive image segmentation, where the label of a few pixels is provided by a user.
\subsection{Efficient Sampling}\label{sec:sampling}
Sampling from a Multivariate Gaussian distribution with a diagonal covariance matrix $\mCovariance = \mDiag(\sigma_1, \dots, \sigma_{\mNumPixels})$ can proceed with a straight forward sampling approach where each dimension (pixel) is independent:
\newcommand{\mLogitSample}[0]{\tilde\mLogit^{(\indSamp)}}%
\begin{equation}
\mLogitSample_{\indPix} = \mMean_{\indPix} + \sigma_{\indPix} \, \tilde\varepsilon^{(\indSamp)}_{\indPix} , \quad \tilde\varepsilon^{(\indSamp)}_{\indPix} \sim \mNormal(0, 1) \, .
\end{equation}
If the Gaussian distribution has a general covariance, however, then the sample cannot be computed independently for each pixel and must be drawn through a square root matrix of the covariance, such as the Cholesky factor:
\newcommand{\mLogitsSample}[1]{\tilde\mLogits^{(#1)}}%
\newcommand{\mNoiseSample}[1]{\boldsymbol{\tilde\varepsilon}^{(#1)}}
\begin{equation}
\mLogitsSample{\indSamp} = \mMean + \mCholCovar \, \mNoiseSample{\indSamp} , \quad \mNoiseSample{\indSamp} \sim \mNormal(\mathbf{0}, \mIdentity_{\mNumPixels}) \, ,
\label{eq:loss}
\end{equation}
where $\mCholCovar \trans{\mCholCovar} = \mCovariance$.
Computation of the dense covariance matrix from the sparse precision, followed by the Cholesky operation would involve a computational complexity of $\bigO(\mNumPixels^3)$ and $\bigO(\mNumPixels^2)$ storage making it infeasible.
\paragraph{Efficient calculation via the Jacobi method}
Fortunately, adopting a sparse structure over the Cholesky precision matrix $\mCholPrec$ means that we can perform a matrix multiplication efficiently.
We can exploit this to take approximate samples using a truncated (to $\mNumJacobiIter$ iterations) version of the Jacobi iterative solver to invert $\mCholPrec$.
This results in a tractable algorithm for obtaining approximate samples of sufficient quality. We can take multiple samples from the same distribution simultaneously while retaining efficiency.
We start with a set of $\mNumSamples$ standard Gaussian samples,
\newcommand{\mRawSamples}[0]{\boldsymbol{\tilde E}}%
\newcommand{\mJacobiSamples}[0]{}%
\begin{align}
\mRawSamples = [\mNoiseSample{1}, \dots, \mNoiseSample{\mNumSamples} ] , \quad \mNoiseSample{\indSamp} \sim \mNormal(\mathbf{0}, \mathbf{I}_{\mNumPixels}) \, .
\end{align}
We then note that the transposed, inverse of the precision Cholesky matrix can be used as a sampling matrix since
\begin{equation}
\mCovariance = \inv{\mPrecision} = \inv{(\mCholPrec \trans{\mCholPrec})} = \transInv{\mCholPrec} \inv{\mCholPrec} \, ,
\end{equation}
indicating that $\transInv{\mCholPrec}$ is the LHS of a square root matrix for $\mCovariance$.
Thus we draw low variance Monte Carlo samples as
\begin{equation}
\mAllLogitsSamples = [\mLogitsSample{1}, \dots, \mLogitsSample{\mNumSamples}] = \mMean + \transInv{\mCholPrec} \mRawSamples \, .
\end{equation}
\newcommand{\mAllZeroMeanJacobiSamples}[0]{\mathbf{S}}%
To invert $\trans{\mCholPrec}$ efficiently, we use $\mNumJacobiIter$ Jacobi iterations; these are particularly efficient to apply with a sparse matrix that is already lower triangular.
We initialise $\mAllZeroMeanJacobiSamples^{(0)} = \mRawSamples$ and then, at each iteration, update the samples with
\newcommand{\mJacobiD}[0]{D_{\Lambda}}%
\newcommand{\mJacobiU}[0]{U_{\Lambda}}%
\begin{align}
\mAllZeroMeanJacobiSamples^{(\indJacobi + 1)} \leftarrow \inv{\mJacobiD} \big( \mRawSamples - \mJacobiU \, \mAllZeroMeanJacobiSamples^{(\indJacobi)} \big) \, , \label{eqn:sampling_with_precision}
\end{align}
where $\mJacobiD := \mDiag(\trans{\mCholPrec})$ and $\mJacobiU := \trans{\mCholPrec} - \mJacobiD$, a strictly upper triangular matrix. The final samples are then obtained by the addition of the mean such that $\mAllLogitsSamples = \mMean + \mAllZeroMeanJacobiSamples$.
\newcommand{\mFilterBank}[0]{\mathbf{f}}
\newcommand{\mAllFilterBanks}[0]{\mathbf{F}}
\newcommand{\mLogDiag}[0]{\boldsymbol{\phi}}
\newcommand{\mOffDiag}[0]{\boldsymbol{\psi}}
\newcommand{\mOffDiagShuffled}[0]{\boldsymbol{\psi}_{\mathrm{shuff}}}
\newcommand{\mNumFilters}[0]{L}
\begin{algorithm}[t]
\SetAlgoLined
\KwResult{Samples drawn from a correlated multivariate Gaussian (with sparse precision)
}
Samples: $\mAllZeroMeanJacobiSamples^{(0)} \leftarrow \mRawSamples \sim \mNormal(\mathbf{0}, \mIdentity_{N})$, $N := W \times H$\;
Local connection filters: $\mAllFilterBanks = \{\mFilterBank_{l}\}_{l=1}^{\mNumFilters}$\;
Log diagonal terms: $\mLogDiag \in \mathbb{R}^{N}$\;
Off diagonal terms: $\mOffDiag \in \mathbb{R}^{\mNumFilters \times N}$\;
\algoHRule
\For{$j \leftarrow 0$ \KwTo $J-1$}{
$\mathbf{V} \leftarrow \textrm{Conv2D}(\mAllZeroMeanJacobiSamples^{(j)}, \mAllFilterBanks)$\;
$\mathbf{v} \leftarrow \sum_{l=1}^{L} [\mathbf{V} \odot \mOffDiag]_{n,l}$\;
$\mAllZeroMeanJacobiSamples^{(j+1)} \leftarrow \big[\exp(\mLogDiag)\big]^{-1} \odot (\mRawSamples - \mathbf{v})$
}
\algoHRule
Output: $\mAllZeroMeanJacobiSamples^{(J)} \approx \big( \transInv{\mCholPrec} \mRawSamples \big) \sim \mNormal(\mathbf{0}, \inv{\mPrecision})$\;
\caption{Jacobi sampling for the multivariate Gaussian distribution}
\label{algo:jacobi}
\end{algorithm}
\newcommand{\mLogitsKnown}[0]{\mLogits_{\mathrm{K}}}
\newcommand{\mLogitsUnknown}[0]{\mLogits_{\mathrm{U}}}
\newcommand{\mKnown}[0]{\boldsymbol{\alpha}}
\newcommand{\mUnknown}[0]{\boldsymbol{\beta}}
\newcommand{\mMask}[0]{\mathbf{m}}
\newcommand{\mMaskKnown}[0]{\mMask_{\mathrm{K}}}
\newcommand{\mMaskUnknown}[0]{\mMask_{\mathrm{U}}}
\paragraph{Efficient conditional sampling}
As we have a closed form representation of the output distribution:
\begin{equation}
\mLogits \sim \mNormal(\mMean, \mCovariance), \;\mCovariance = \transInv{\mCholPrec} \inv{\mCholPrec} \, ,
\end{equation}
we can find the expression for a resulting conditional distribution where we specify values for a subset of the pixels and sample from the resulting distribution over the remaining pixels.
Let us partition the pixels into a set of known values $\mLogitsKnown$ and unknown values $\mLogitsUnknown$; pixels (arbitrarily) belong to either one set or the other under a pixel-wise mask:
\begin{equation}
[\mMaskKnown]_{n} = \left\{ \begin{array}{cl}
1, & n \in \mathcal{K} \\
0, & n \in \mathcal{U}
\end{array} \right. ,\; \mMaskUnknown = 1 - \mMaskKnown \,.
\end{equation}
Thus, with slight abuse of notation, we recover the full set of values as $\mLogits = \mMaskKnown \odot \mLogitsKnown + \mMaskUnknown \odot \mLogitsUnknown$.
The conditional distribution for the unknown values, given that the known values $\mLogitsKnown = \mKnown$, is the Gaussian conditional density:
\begin{align}
p(\mLogitsUnknown \given \mLogitsKnown = \mKnown) &\phantom{:}\sim \mNormal(\mathbf{b}, \mathbf{B}) \,,\\
\mathbf{b} &:= \mMean_{\mathrm{U}} + \mCovariance_{\mathrm{UK}} \mCovariance_{\mathrm{KK}} (\mKnown - \mMean_{\mathrm{K}}) \,,\\
\mathbf{B} &:= \mCovariance_{\mathrm{UU}} - \mCovariance_{\mathrm{UK}} \inv{\mCovariance_{\mathrm{KK}}} \mCovariance_{\mathrm{KU}} \, ,
\end{align}
where the subscripts dictate the appropriate partitions of the mean vector or blocks of the covariance matrix.
Evaluating this directly, in matrix form, would again be prohibitively expensive, especially considering the matrix inversions (from precision to covariance matrices). Thankfully we can use a modified form of the Jacobi sampling method combined with Matheron's rule for conditional sampling. Matheron's rule states that if $(\mathbf{a}, \mathbf{b})$ are samples from the joint distribution $p(\mLogitsKnown, \mLogitsUnknown)$ then the random variable $\mathbf{b}$ conditioned on $\mathbf{a} = \mKnown$ can be found by:
\begin{equation}
(\mathbf{b} \mid \mathbf{a} = \mKnown) \leftarrow \mathbf{b} + \mCovariance_{\mathrm{UK}} \inv{\mCovariance_{\mathrm{KK}}} (\mKnown - \mathbf{a}) \,. \label{eqn:matheron_rule}
\end{equation}
We can use straight forward identities to convert Matheron's rule into an update equation in terms of the precision:
\begin{align}
\begin{bmatrix}
\mPrecision_{\mathrm{KK}} & \mPrecision_{\mathrm{KU}} \\
\mPrecision_{\mathrm{UK}} & \mPrecision_{\mathrm{UU}}
\end{bmatrix} \cdot
\begin{bmatrix}
\mCovariance_{\mathrm{KK}} & \mCovariance_{\mathrm{KU}} \\
\mCovariance_{\mathrm{UK}} & \mCovariance_{\mathrm{UU}}
\end{bmatrix} =&
\begin{bmatrix}
\mIdentity & \mathbf{0} \\
\mathbf{0} & \mIdentity
\end{bmatrix} \,, \\
\Rightarrow \mPrecision_{\mathrm{UK}} \, \mCovariance_{\mathrm{KK}} + \mPrecision_{\mathrm{UU}} \, \mCovariance_{\mathrm{UK}} =& \, \mathbf{0} \\
\Rightarrow \mCovariance_{\mathrm{UK}} \, \inv{\mCovariance_{\mathrm{KK}}} = - \inv{\mPrecision_{\mathrm{UU}}} \, \mPrecision_{\mathrm{UK}} & \,. \label{eqn:matheron_prec_form}
\end{align}
We have ready access to efficient evaluation of the sparse $\trans{\mCholPrec}$, as discussed in the Jacobi method. With suitable book-keeping, we can produce the appropriately shuffled local connection filters $\mAllFilterBanks_{\mathrm{shuff}} \leftarrow \textrm{Shuffle}(\mAllFilterBanks)$ and permuted off-diagonal terms $\mOffDiagShuffled \leftarrow \textrm{Shuffle}(\mOffDiag)$ to provide a similar evaluation of the sparse $\mCholPrec$. This product results in a sparse banded diagonal structure in the precision matrix $\mPrecision$. The appropriate blocks of this sparse matrix can be accessed and used to solve for the conditional update of~\eqref{eqn:matheron_rule} using a precision form of the update~\eqref{eqn:matheron_prec_form}.
\subsection{Extension to Non-Gaussian Likelihoods} \label{sec:non-gauss-likelihood}
For many dense prediction tasks, a multivariate Gaussian distribution is not an appropriate likelihood over the observations directly.
However, SUPN is still applicable for this use case, by fitting the multivariate Gaussian distribution to the logit space, \ie to the layer just before the last non-linear layer. This is then followed by an appropriate activation function.
For example, for depth prediction, the outputs of the network should be non-negative and the activation function used is a scaled sigmoid, following monodepth2 \cite{godard2019digging}.
Similarly, for the task of segmentation, the fitting of the SUPN could be done in logit space and soft-max would be used as the activation function.
\subsection{Implementation Details}
\paragraph{Architecture}
We build upon the U-Net architecture used by Monodepth2 \cite{godard2019digging}, \ie an encoder-decoder architecture where the encoder is a ResNet18 and there are skip connections between the encoder and the decoder.
We add an additional decoder to predict the Cholesky parameters. This decoder takes skip connections from the mean decoder as input. The additional decoder concatenates coordinate maps in the convolutional blocks~\cite{liu2018intriguing} to provide additional spatial information. We designed an off-diagonal prediction approach where the scale of the values is initially very small, $\approx \exp(-4)$, but adapts during training. We found this inductive bias, in lieu of formal priors, was required to predict high quality covariances.
We use a $5\times5$ neighborhood for the Cholesky decomposition; please see the supplementary details for architecture details and ablation experiments.
\paragraph{Model size}
Our model encodes the distillation of an ensemble of large models into a
single framework; we use only 24\% more parameters than a
single network (out of 8 in the ensemble).
\paragraph{Multi-scale loss}
For depth prediction, we use a multi-scale loss similar to Monodepth2 \cite{godard2019digging}, where the loss in \eqref{eq:loss} is applied across different scales.
\paragraph{Complexity}
Fixed sparsity ensures that all operations are $\mathcal{O}(N)$ for both computation and storage.
Sampling is $\mathcal{O}(J)$ (we used $J = 1000$);
empirically, the total time for a full Jacobi sample was 0.6s.
\section{Experiments}
For the experiments, we show our method applied to monocular depth estimation.
We use the KITTI dataset~\cite{geiger2013vision} and base our implementation on the Monodepth2 repository~\cite{godard2019digging} and the repository from~\cite{poggi2020uncertainty}.
\paragraph{Pre-trained ensembles}
We use the pre-trained models provided by \cite{poggi2020uncertainty}. In particular, the ensembles created through bootstrapping together with predictive uncertainty. Two different approaches are used for predictive uncertainty. Both use a diagonal multivariate Laplace distribution, but differ in the way they are trained: \textsc{Log} is trained by directly optimizing the log-likelihood of a self-supervised depth model; while \textsc{Self} uses a pretrained network for depth prediction, without uncertainty estimation, as the teacher model.
\paragraph{Metrics}
For evaluating the accuracy of the estimated depth maps we use a subset of the metrics commonly used for the Kitti dataset: absolute relative error, root mean squared error (RMSE) and the A1 metric.
For evaluation of the uncertainty estimates, we use the metrics used in \cite{poggi2020uncertainty}: area under the sparsification error (AUSE) and area under the random gain (AURG). Both these metrics rely on using per-pixel uncertainty estimates to rank pixels from less confident to more confident.
For AUSE, this ranking is compared with an oracle ranking that sorts pixels from higher error to lower error, using the different ground truth metrics for ranking. A small AUSE means that the ranking provided by the uncertainty estimate is similar to this oracle ranking.
AURG compares the ranking based on estimated uncertainty with a random ranking, large values are preferred for this metric.
Since both these established metrics only consider per-pixel estimates, we also evaluate the posterior log-likelihood of test samples from the ensembles under our model. To provide a baseline, we also train a version of our model with only a diagonal covariance structure (per-pixel), which cannot model structure. Comparing against this baseline allows us to determine if the model has correctly captured the distribution of test samples and avoided overfitting. We also measure the log-likelihood to other ensembles to ensure that the SUPN variants estimate distributions that generalise well to support other plausible samples.
\begin{table*}[t]
\caption{\textbf{Accuracy comparison}: Quantitative comparison of quality on
commonly used depth metrics (see supplement for the remaining metrics in \cite{godard2019digging}). The ``Best'' metrics sample 40 different
predictions for our model, and from the 8 ensembles for the baseline, and choose the best under each metric. Standard deviations are given in brackets. The box plot illustrates the substantial overlap in distributions.}
\label{tab:accuracy_unconditioned}
\centering
\begin{minipage}{0.23\textwidth}
\includegraphics[width=\textwidth]{figures/rebuttal_rmse_box_plot.pdf}\\
\footnotesize Box plot illustrating the strong distribution overlap between the original ensemble and the trained SUPN model for Boot+Log RMSE mean.
\end{minipage}\hfill
\begin{adjustbox}{max width=0.75\textwidth}
\begin{tabular}{lrrrrrr}
\toprule
Model name & AbsRel Mean $\downarrow$& AbsRel Best $\downarrow$ & RMSE Mean $\downarrow$ & RMSE Best $\downarrow$ & A1 Mean $\uparrow$ & A1 Best $\uparrow$ \\
\midrule
MD2 Boot+Log & 0.092 (0.035) & 0.084 (0.031) & 3.850 (1.370) & 3.600 (1.260) & 0.911 (0.064) & 0.923 (0.055) \\
MD2 Boot+Self & 0.088 (0.034) & 0.083 (0.031) & 3.795 (1.397) & 3.574 (1.323) & 0.918 (0.060) & 0.929 (0.051)\\
\midrule
Diagonal & 0.101 (0.044) & 0.103 (0.043) & 4.000 (1.457) & 4.020 (1.444) & 0.896 (0.076) & 0.894 (0.074) \\
SUPN Boot+Log & 0.104 (0.047) & 0.095 (0.039) & 4.071 (1.489) & 3.577 (1.191) & 0.892 (0.080) & 0.909 (0.069) \\
SUPN Boot+Self & 0.103 (0.049) & 0.096 (0.046) & 4.091 (1.442) & 3.800 (1.396) & 0.894 (0.078) & 0.906 (0.073) \\
\bottomrule
\end{tabular}
\end{adjustbox}
\end{table*}
\begin{table*}[t]
\caption{\textbf{Pixelwise uncertainty metrics}: AUSE (area under the sparsification error), lower is better. AURG (area under the random gain), higher is better. Uncertainy for SUPN estimated from std-deviation of 10 samples. Results marked with a * differ from the published work by \cite{poggi2020uncertainty}, as to make it comparable we do not use the Monodepth 1 post-processing. LL (Log-Likelihood) columns provide the log-likelihood of samples from the respective ensembles under the diagonal (baseline) and SUPN models. Standard deviations are given in brackets.}
\label{tab:accuracy_uncertainty}
\centering
\begin{adjustbox}{max width=\textwidth}
%
\newcommand{\lloffset}[0]{$\times10^{5}$}
\begin{tabular}{lrrrrrrrr}
\toprule
Model name & AbsRel AUSE $\downarrow$ & AbsRel AURG $\uparrow$ & RMSE AUSE $\downarrow$ & RMSE AURG $\uparrow$ & A1 AUSE $\downarrow$ & A1 AURG $\uparrow$ & LL Boot+Log \lloffset $\uparrow$ & LL Boot+Self \lloffset $\uparrow$ \\
\midrule
MD2 Boot+Log & 0.038 (0.020) & 0.021 (0.019) & 2.449 (0.877) & 0.820 (0.929) & 0.046 (0.048) & 0.037 (0.040) & & \\
MD2 Boot+Self & 0.029 (0.018) & 0.028 (0.019) & 1.924 (1.006) & 1.316 (1.000) & 0.028 (0.041) & 0.049 (0.037) & & \\
\midrule
MD2 Boot+Log* & 0.041 (0.019) & 0.018 (0.020) & 2.927 (1.327) & 0.324 (1.019) & 0.050 (0.049) & 0.032 (0.037) \\
MD2 Boot+Self* & 0.040 (0.021) & 0.017 (0.018) & 2.906 (1.458) & 0.331 (1.08) & 0.045 (0.045) & 0.031 (0.035) & & \\
\midrule
Diagonal & 0.085 (0.050) & -0.020 (0.030) & 5.075 (1.924) & -1.697 (0.799) & 0.138 (0.083) & -0.440 (0.053) & 1.77 (11.48) & 1.15 (12.78) \\
SUPN Boot+Log & 0.037 (0.027) & 0.030 (0.025) & 1.555 (1.307) & 1.856 (1.355) & 0.040 (0.063) & 0.058 (0.047) & 40.60 (1.35) & 38.18 (2.93)\\
SUPN Boot+Self & 0.050 (0.037) & 0.017 (0.028) & 2.786 (1.796) & 0.674 (1.544) & 0.062 (0.074) & 0.034 (0.055) & 36.51 (2.31) & 38.87 (1.63)\\
\bottomrule
\end{tabular}
\end{adjustbox}
\end{table*}
\subsection{Quantitative Results}
\paragraph{Depth accuracy}
In Table \ref{tab:accuracy_unconditioned} we show a quantitative comparison between the two variants of ensembles and the corresponding versions of our model, trained to approximate them. We compare the methods using the depth estimation metrics.
While the mean performance of the ensembles is slightly superior to our approximate models, the results are comparable within the margin of error. The box plot in Table~\ref{tab:accuracy_unconditioned} highlights the strong overlap in the error distribution of the ensemble and SUPN models, indicating that despite the significant reduction in the number of parameters, SUPN is able to approximate the performance of the ensemble.
Our models compare favourably with a diagonal only model.
This is particularly noticeable in the metrics for the best sample. Samples from our model consistently outperform samples from a diagonal only Gaussian.
\begin{figure*}[ht!]
\centering
\renewcommand{\arraystretch}{0.3}
\begin{adjustbox}{max width=0.85\textwidth}
\begin{tabular}{ccc}
\includegraphics[width=0.3\textwidth]{figures/correlation_cond_points643_crop.png}
&
\includegraphics[width=0.3\textwidth]{figures/correlation_cond_points171_crop.png}
&
\includegraphics[width=0.3\textwidth]{figures/correlation_cond_points516_crop.png}
\\
\includegraphics[width=0.3\textwidth]{figures/cond_bs643_1.png}
&
\includegraphics[width=0.3\textwidth]{figures/cond_bs171_1.png}
&
\includegraphics[width=0.3\textwidth]{figures/cond_bs516_1.png}
\\
\includegraphics[width=0.3\textwidth]{figures/cond_bs643_2.png}
&
\includegraphics[width=0.3\textwidth]{figures/cond_bs171_2.png}
&
\includegraphics[width=0.3\textwidth]{figures/cond_bs516_2.png}
\end{tabular}
\end{adjustbox}
\caption{Visualisation of learned covariances between example pixels (red crosses) and other pixel locations for SUPN \textsc{Boot+Log}. Red indicates high positive correlation, blue is strong negative correlation.
%
For clarity, these plots are scaled into the standard deviation range (via a signed square root operation) and plotted over a range [-0.05, 0.05].
These examples illustrate the long range correlations that can be captured from very local structure ($5 \times 5$ pixel regions) in the precision matrix. For more examples, see the supplementary video.
}\label{fig:cov}
%
\end{figure*}
\paragraph{Uncertainty estimation}
Table~\ref{tab:accuracy_uncertainty} provides a quantitative comparison in terms of uncertainty metrics. SUPN consistently outperforms the teacher ensemble model for both \textsc{Log} and \textsc{Self}.
The log-likehood values demonstrate that the correlated structure capture by SUPN is better able to explain the test outputs of the ensembles that the baseline diagonal model.
The samples routinely have higher support under the SUPN model which suggests that some of the other measures are not accurately measure the quality of the structure present in the posterior predictions of the model.
As expected, the performance of the SUPN approaches on the test set for the corresponding samples are slightly better but we note that overall the values are similar between the two methods indicating that the correlations captured are not overfit to the specific ensembles.
\subsection{Qualitative Results}
\begin{figure*}[t]
\centering
\includegraphics[width=\textwidth]{figures/example_bootlog_highres_tight.pdf}\\
\renewcommand{\arraystretch}{0.3}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{CCCC}
(a) Input image & (b) Mean disparity & (c) \textsc{Boot+Log} diff & (d) SUPN \textsc{Boot+Log} diff
\end{tabular}
\end{adjustbox}
\caption{Example depth samples (see supplementary video for more). (b)~Average normalised disparity predicted by the ensemble models. Difference between the mean and one of the (c)~\textsc{Boot+Log} ensemble or (d)~SUPN \textsc{Boot+Log}; the samples appear qualitatively similar.} \label{fig:samples}
\end{figure*}
\begin{figure*}[h!]
\centering
\renewcommand{\arraystretch}{0.3}
\begin{adjustbox}{max width=0.63\textwidth}
\begin{tabular}{ccc}
\includegraphics[width=0.58\textwidth]{figures/trim_cond_235_mask.png}
&
\includegraphics[width=0.58\textwidth]{figures/cond_235_mean_uncond.png}
&
\includegraphics[width=0.58\textwidth]{figures/cond_235_mean_cond.png}
\\
\includegraphics[width=0.58\textwidth]{figures/trim_cond_519_mask.png}
&
\includegraphics[width=0.58\textwidth]{figures/cond_519_mean_uncond.png}
&
\includegraphics[width=0.58\textwidth]{figures/cond_519_mean_cond.png}
\\
\includegraphics[width=0.58\textwidth]{figures/trim_cond_25_mask.png}
&
\includegraphics[width=0.58\textwidth]{figures/cond_25_mean_uncond.png}
&
\includegraphics[width=0.58\textwidth]{figures/cond_25_mean_cond.png}
\\[5pt]
\huge
(a) Image + conditioning locations & \huge (b) Mean disparity & \huge (c) Conditional mean disparity
\end{tabular}
\end{adjustbox}
\begin{adjustbox}{max width=0.35\textwidth}
\begin{tabular}{c}
\begin{tabular}{lrrr}
\toprule
Model name & AbsRel $\downarrow$& RMSE $\downarrow$ & A1 $\uparrow$ \\
\midrule
Ensemble & 0.088 (0.034) & 3.795 (1.397) & 0.918 (0.060) \\
\midrule
SUPN & 0.104 (0.047) & 4.071 (1.489) & 0.892 (0.080) \\
\midrule
SUPN 25$^*$ & 0.086 (0.036) &3.893 (1.541) & 0.922 (0.053) \\
SUPN 50$^*$ & 0.076 (0.031) &3.607 (1.433) &0.936 (0.041) \\
SUPN 100$^*$ & 0.064 (0.028) & 3.251 (1.290) &0.949 (0.033) \\
SUPN 200$^*$ & 0.054 (0.022) &2.873 (1.100) &0.960 (0.028) \\
\bottomrule
\end{tabular}
\\[102pt]
\large (d) Quantitative conditioning accuracy
\end{tabular}
\end{adjustbox}
\caption{Conditional prediction using sparse ground truth depth information. (a) shows 25 randomly sampled conditioning locations that have valid depth (b) shows the original mean disparity, while (c) shows the conditional mean disparity. d) Quantifies the accuracy improvement of our SUPN Boot+Log model when conditioned on $N^*$ random ground truth depth pixels, repeated 10 times per image. } \label{fig:cond_dist}
\end{figure*}
Figure~\ref{fig:samples} illustrates samples from the \textsc{Boot+Log} ensemble, and the SUPN approximation; the samples are visually similar and exhibit considerable long-range structure.
\paragraph{Introspection}
As discussed in \S~\ref{sec:introduction}, one of the advantages of an explicit distribution is that it allows for introspection. Figure~\ref{fig:cov} illustrates how the covariance between a specified pixel, and any other, can be explicitly computed.
These visualisations are the corresponding row of the covariance matrix obtained using the sampling process of~\eqref{eqn:sampling_with_precision} twice (with $\mCholPrec$ and then $\trans{\mCholPrec}$) to a one-hot vector encoding the pixel of interest on the RHS (instead of $\mRawSamples$) and no mean.
\paragraph{Conditional Distributions}
Figure~\ref{fig:cond_dist} illustrates our model's ability to condition samples on arbitrary output pixels, which is not possible in most deep probabilistic models. In this example, we use some samples from the ground truth depth as additional conditioning on the predicted distribution, and show the conditional mean.
\section{Discussion and Limitations}
Similar to other distillation methods, the performance of our method is upper-bounded by the performance of the original ensemble model. This might become an issue when the ensemble is small, and doesn't capture the full diversity of data.
We've observed visually that the log-likelihood alone is not always a good predictor of sample quality, \ie a sample might have high log-likelihood while looking implausible, this may be due to a lack of variation in the ensemble predictions. This could potentially be overcome by using priors on the predicted Gaussian distribution, and future work will consider subsequently training the model on the specified task, using the drawn samples.
As a deterministic approximation to the output of an ensemble, we seek to capture all forms of uncertainty captured by the ensemble (e.g.~aleatoric and epistemic). We acknowledge that we do not consider the epistemic uncertainty in the approximation separately, however our work may be considered orthogonal to work in this area, e.g.~BNNs, and could be readily combined.
\paragraph{Potential negative impact}
We think that uncertainty estimation is a valuable endeavor in improving deep models, and that our approach of using explicit distributions is a step in the right direction, providing tangible benefits. However, the predicted distributions have yet to be evaluated on out-of-distribution data. As with most machine learning models, we cannot expect generalisation of our SUPN prediction networks to very different data. Clearly, this approach will require extensive validation before deployment in safety-critical applications, such as autonomous driving.
\paragraph{Conclusion}
We presented a method for uncertainty estimation by distillation of ensemble models. We showed that our structured Gaussian model can be predicted by a single pass of a convolutional neural network, we have proposed an efficient method for drawing samples.
Our method was validated on the task of depth prediction from a single image. Our distilled model is able to perform similarly to the original ensemble on uncertainty metrics, while requiring fewer parameters and allowing arbitrary numbers of samples to be drawn. We have illustrated that the samples capture long-range correlations in the image domain, which is in stark contrast to prior works that use diagonal covariance matrices.
We demonstrated the benefit of our predicted distribution in terms of enabling arbitrary test-time conditioning and allowing for direct introspection of the inferred distribution.
We hope that our paper sparks interest in predictive uncertainty models that are able to model correlation in the output space, with many practical applications in computer vision and integration with subsequent down-stream tasks.
{\small
\bibliographystyle{ieee_fullname}
| {'timestamp': '2022-03-30T02:32:10', 'yymm': '2203', 'arxiv_id': '2203.15485', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15485'} | arxiv |
\section{Introduction}
Novelty detection has been addressed widely in the machine learning literature, its basic form aims at building a decision rule in order to distinguish a normal set of data points (or inliers/ negative examples) from novel patterns (or unseen/ positive examples/ novelties). At training time only examples of inliers are available, this type of learning goes by the name of inductive novelty detection. Labeled examples of novelties are unavailable during training in this case. Some notable contributions in this field include one-class classifiers that attempt to draw a discriminative boundary around the normal data such as one-class support vector machine (OCSVM) \citep{scholkopf} and deep learning related methods - especially with the advancements of adversarial learning \citep{goodfellow} - that rely on the fidelity of recontruction of the original signal \citep{schlegl,zenati,zenati2,akcay,akcay2}. One limitation of those inductive methods is their need for hyperparameter tuning; the absence of novel examples in this setup during training makes this problem hard to overcome.
The traditional inductive learning seeks to infer a decision function by using a training set and minimizing the error rate on the whole distribution of examples. Transductive learning \citep{vapnik} on the other hand is motivated by the idea that the latter approach is unnecessarily complex and that we only care about the decision function so far as the test set is concerned, and hence the (unlabeled) test set should be incorporated at training time. Novelty detection methods that adopt the latter approach are referred to as transductive, one early example adopting this setting is semi-supervised novelty detection introduced by \citep{blanchard10a}.
In this study we propose TransductGAN, a novel transductive novelty detection method using Generative Adversarial Network (GAN) \citep{goodfellow}. Our model combines an adversarial autoencoder \citep{DBLP:journals/corr/MakhzaniSJG15} that maps the data to a latent space with a GAN. It attempts to simultaneously separate the inliers from the novelties in the latent space and learns how to generate both categories of data using two distinct distributions. A standard binary classifier can then be trained using the artificially generated novel samples along with the inlier set in order to perform anomaly detection. A diagram of TransductGAN is provided in Figure \ref{TransductGAN}.
We refer to the proportion of novelties present in the unlabeled set as the contamination rate. TransductGAN and more generally transductive novelty detection methods are unsuitable for online applications as they assume access to a complete test set. Applications of interest include areas where we benefit from looking at data in a post-event format, and where the novelties are not rare as in the case of anomaly detection (although we will demonstrate empirically that our model outperforms the inductive state-of-the-art methods with a contamination rate as small as 5\%). An example of applications could be the emergence of new topics or themes on social media platforms, such discoveries could help drive the news coverage on more standard media channels. Another application could be in commercial deep neural network systems that are used for classification, and where pre-processing of data is required to maintain performance quality of pre-trained models. This can be achieved by detecting novelties in test data that were not present when models were initially trained (i.e. by monitoring the emergence of a new class). Another example is the discovery of new user profiles that have become interested in acquiring a certain product, this could help boost targeted advertising. In this study we focus on image data.
The main contributions of our work are:
\begin{itemize}
\item a novel architecture capable of learning how to generate inliers and novelties simultaneously using distinct distributions in the latent space
\item by being able to generate the novel points artificially we can train a binary classifier and tune the hyperparameters without explicitly accessing the actual outliers, this overcomes the hurdle faced by many inductive methods of how to tune their hyperparameters in the absence of novel data examples
\item the introduction of the adversarial autoencoder allows us to use more informative features from the latent space when training a binary classifier
\item our model exhibits superior performance over several state-of-the-art inductive models, and outperforms a vanilla model that is closely related to a state-of-the-art transductive method
\item full reproducibility of our model is available on github
\end{itemize}
\section{Background}
\subsection{Wasserstein generative adversarial networks with gradient penalty}
The generative adversarial network (GAN) in its original form \citep{goodfellow} comprises a generator taking as input a latent vector to produce an image output. This network competes against a discriminator tasked with identifying the fake images (produced by the generator) from the real images. By being able to produce samples identical to the real ones at convergence, the generator implicitly captures the distribution of the real image data. Although a GAN can produce visually appealing images, they are hard to train and can suffer from convergence failure or can generate poor quality images.
Subsequent work \citep{DBLP:journals/corr/SalimansGZCRC16,DBLP:journals/corr/MetzPPS16,arjovsky2017wasserstein,DBLP:journals/corr/PooleASA16,DBLP:journals/corr/abs-1803-05573} has been devoted to boosting training stability. In their work on Wasserstein GAN \citep{arjovsky2017wasserstein}, the authors highlighted that the divergences that are being minimized in the original GAN framework may not be continuous with respect to the generator's parameters which might explain the training difficulty. They instead use the earth mover distance and argue that under mild assumptions this type of loss is continuous and almost differentiable everywhere. They propose a weight clipping of the discriminator in order to enforce those assumptions. The work was further extended with the introduction of Wasserstein GAN with gradient penalty (WGAN-GP) in \citep{DBLP:journals/corr/GulrajaniAADC17} where a gradient penalty was introduced as an alternative to the weight clipping; in this work the authors propose to penalize the norm of the gradient of the discriminator with respect to its input and demonstrate this strategy yields an enhanced performance.
\subsection{Adversarial Autoencoders}
The adversarial autoencoder (AAE) \citep{DBLP:journals/corr/MakhzaniSJG15} is a regularized autoencoder where an adversarial network is tasked with ensuring that the latent code vector distribution is matched with a prior distribution that is defined by the user. The AAE includes an encoder-decoder network that maps the data from the input space to a latent space and a discriminator network that controls the distribution in the latent space. Two losses are used to train the model, the traditional reconstruction based loss that operates in the input space and an adversarial loss that operates on the latent code. The advantage of the AAE is its ability to generate meaningful samples from any part of the latent distribution and its superiority in that regard compared to more traditional methods such as variational autoencoders \citep{kingma2014autoencoding} has been demonstrated.
\section{Related work}
\subsection{Inductive methods}
During training, inductive methods in novelty detection rely on the availability of a negative dataset \( X_n \) that could be either pure or contaminated with novelties or outliers. In our study we assume that the negative dataset is always uncontaminated. There exists a variety of anomaly detection algorithms and comprehensive literature reviews presenting those algorithms as part of a taxonomy already exist, a few examples include \citep{PIMENTEL2014215,DBLP:journals/corr/abs-1901-03407}. The approaches can broadly be categorised into probabilistic models, distance-based, reconstruction-based, domain-based and information theory-based models. We will compare our methods against state-of-the-art models that are either reconstruction-based or domain-based. The main challenge with the other categories is their poor performance on complex high-dimensional data.
Some notable contributions with regards to the domain-based model include OCSVM \citep{scholkopf}, it attempts to find the boundary enclosing the inlier class by separating it from the origin using a hyperplane with maximum margin.
The reconstruction-based models rely on modelling the data samples in a latent, lower-dimensional space and on the ability to reconstruct the original samples thereafter. The novelty measure relies on the fidelity of reconstruction, i.e. it relies on some similarity measure between the original sample and its reconstructed version. Algorithms that are able to perform such tasks include neural networks and subspace-based methods. The main advantages of using such models is their scalability, with a large enough sample size they tend to surpass the more traditional methods.
One state-of-the-art method is AnoGAN, introduced by Schlegl \textit{et al.} in \citep{schlegl}. It uses a deep convolutional GAN (DCGAN, \citep{radford2015unsupervised}) to perform anomaly detection using imaging data. It trains the DCGAN using the inlier data only in the first phase. In the second phase it learns a mapping from the image space to the latent space for each sample in the test set iteratively via backpropagation, using the weighted sum of a residual loss and a discrimination loss. AnoGAN's main contribution is the anomaly scoring that involves mapping from the image to the latent space; it remains a computationally expensive procedure that also requires parameter tuning.
Efficient GAN-based anomaly detection (EGBAD) \citep{zenati} was introduced soon after and proposes to use a bi-directional GAN (BiGAN) \citep{DBLP:journals/corr/DonahueKD16,dumoulin2016adversarially} in order to overcome the costly process in AnoGAN of recovering the latent representation for a given input. BiGAN simultaneously learns an encoder that maps an input sample to a latent representation along with a generator and discriminator using inlier data. The discriminator takes as input the image sample (either generated or from training) along with its latent representation (either the encoder output or the generator input). With the exception of the introduction of the BiGAN model that allows to reduce the computational costs, the procedure to derive the anomaly score is similar to that of AnoGAN with improved performance. The hyperparameter tuning is still an open issue.
The GANomaly model was introduced in \citep{akcay} and is inspired by the AAE network. GANomaly employs a variation of this model that uses an added encoder and where the discriminator now operates over the image space. The objectives of GANomaly are similar to the ones presented in the previous two approaches, namely it attempts to use the inlier set to train the model and uses an anomaly score to identify the anomalous samples within the (contaminated) test data. Three types of losses are used to train the model. Firstly, an adversarial loss measures the \(L_2\) distance between the feature representation in the discriminator (hence using the feature matching loss) of the original (image) inputs and the generated images. Secondly, a contextual loss measures the \(L_1\) distance between the input and the generated output and allows the generator to learn contextual information about the input data. And finally an encoder loss minimizes the distance between the latent representation of the input and the latent representation of the generated output. The overall objective function becomes a weighted sum of the three losses. During testing only the encoder loss is used by the model as an novelty indicator. GANomaly's performance was tested on a variety of real-world data and has surpassed other state-of-the-art methods such as EGBAD, AnoGAN as well as more basic methods such as variational autoencoders-based anomaly detection \citep{An2015VariationalAB}. It should be mentioned that the weights of the objective function were tuned to yield an optimal performance, and in that regard the labels of the test set were used to drive the performance up.
\subsection{Transductive methods}
Transductive methods for novelty detection were originally introduced in \citep{Scott08transductiveanomaly} as a special case of their semi-supervised novelty detection algorithm (SSND) \citep{blanchard10a} where the unlabeled set is incorporated into the the task and where the end goal is to predict the labels of the unlabeled (or test) set. In that study the problem is reduced to a binary classification task subject to a user-specified constraint on the false positive rate. More recently, Tifrea \textit{et al.} introduced ensembles with regularized disagreement (ERD) \citep{DBLP:journals/corr/abs-2012-05825} by training multiple multi-class classifiers on the union of labeled and unlabeled sets. The unlabeled set is assigned random labels and the disagreement between the classifiers is used as a measure of novelty. The method assumes no knowledge of the contamination rate, however the class labels of the labeled set are assumed to be available (i.e. information about the class labels beyond the fact they are inliers). Other transductive state-of-the-art novelty detection methods that make use of the inlier class labels include \citep{DBLP:journals/corr/abs-1908-04951} where the authors train a two-head deep convolutional neural network (CNN) with one common feature extractor and two classifiers; the discrepancy of prediction between the two classifiers is used at test time to separate the inliers from the novel data. The authors have not provided any implementation for this method.
\subsection{PU learning methods}
PU learning refers to the classification of unlabeled samples given data from one class during training. A recent survey of PU learning methods can be found in \citep{DBLP:journals/corr/abs-1811-04820}. The class that is usually available in this setup is the novel/ positive class, but PU learning can also be applied to novelty detection in an unlabeled dataset with access to only the negative data during training, and some studies \citep{pmlr-v37-plessis15} consider transductive novelty detection as defined in \citep{blanchard10a} to be a special case of PU learning.
The unlabeled data is usually handled in to ways, the first set of methods \citep{Liu02partiallysupervised,10.5555/1630659.1630746} attempt to identify negative examples in the unlabeled set before training a binary classifier using the positive and newly identified negative samples. This approach is very much dependent on heuristic strategies and does not guarantee an optimal solution. The second set of methods \citep{10.5555/951949.952139,10.5555/3041838.3041895} treat the unlabeled set as negative with a weight assigned to each sample, finding the optimal weight is usually costly and the classifiers trained on those datasets suffer from an estimation bias. Several methods have since emerged that seek to build an unbiased PU classifier \citep{10.5555/2968826.2968905,pmlr-v37-plessis15,kiryo2017positiveunlabeled}, the most recent of which, the non-negative PU estimator (nnPU) \citep{kiryo2017positiveunlabeled}, was proven to be the most robust against overfitting in the presence of a flexible classifier. More recently, GAN-based models have become state-of-the-art in PU learning applications and a couple of methods are closely related to our model as they also attempt to generate counter-examples. In \citep{DBLP:journals/corr/abs-1711-08054} a generative positive-unlabeled (GenPU) model is proposed that makes use of a series of discriminators and generators to produce both positive and negative samples; GenPU requires prior knowledge of the contamination rate in the unlabeled set. The authors have not provided any implementation of that model. Following this work, Chiaroni \textit{et al.} have proposed a two-stage GAN model (D-GAN) that learns the counter-examples distribution before training a binary classifier using the fake generated negative examples and the already available positive examples. D-GAN incorporates a biased PU risk in the discriminator loss function that constrains the generator to learn the positive samples distribution exclusively. The study also demonstrates that the standard GAN loss function in use also alleviates the need of prior knowledge of the contamination rate.
\section{TransductGAN}
\begin{figure}
\centering
\includegraphics[scale=0.6]{TransGAN.PNG}
\caption{TransductGAN. \textit{The network includes an adversarial autoencoder that ensures the latent projection's distributions match with the priors as per equation \ref{eq:p_u}, and a transductive network that learns to map samples from \(p_n(\textbf{z})\) and \(p_p(\textbf{z})\) into negative and positive examples respectively. The two networks are trained simultaneously. The training of \(D_{X_n}\) is optional and only needed if generating samples from the negative data is required.}}\label{TransductGAN}
\end{figure}
\subsection{Model objectives}
TransductGAN's objectives are to be able to learn two distinct distributions, one (optionally) for the inlier data and another for the novel data while having access to a negative dataset and an unlabeled dataset. It is able to achieve that by making use of a latent space. TransductGAN is a transductive adversarial network that includes an adversarial autoencoder that matches the aggregated posterior distribution of the latent space with a bimodal distribution, and a generative model that learns how to map each mode in the latent space to either positive or negative data outputs. By being able to separate the projections of the positive and negative data in the latent space, TransductGAN is able to generate both novel and negative data separately. A binary classifier (e.g. a support vector machine) can then be trained to identify the novel data points in the unlabeled set. This operation takes place in the absence of any labeled positive data examples.
More formally, let us define the input as \(x \in \mathbbm{R}^m\) and its projection in the latent space (i.e. the output of the encoder \(E\) in Figure \ref{TransductGAN}) as \(z \in \mathbbm{R}^{n}\) with \(m>>n\). We have access to the negative dataset \(X_n=\{x_n^i\}_{i=1}^{n_n} \sim P_{x_n}\) and an unlabeled dataset that includes novel data \(X_u=\{x_u^i\}_{i=1}^{n_u} \sim P_{x_u}\). Let us also define \(y \in \{-1,+1\}\) as the class label (novel or negative). The class conditional positive density (representing the positive samples in the latent space) is:
\begin{equation}
q_p(z)=q(z|y=1),
\end{equation}
and the class conditional negative density (representing the negative data samples) in the latent space:
\begin{equation}
q_n(z)=q(z|y=-1).
\end{equation}
\noindent The unlabeled density in the latent space is hence defined as:
\begin{equation}
q_u(z)=\pi q_p(z) + (1-\pi) q_n(z).
\end{equation}
\noindent \(\pi\) is the prior for the positive class also known as the contamination rate, we assume we have access to this figure and that it is strictly positive \(\pi>0\):
\begin{equation}
\pi=p(y=1)
\end{equation}
\noindent The prior distribution we want to impose directly are \(p_n(z)\) for the negative dataset with \(N(\mu_n,\Sigma_n)\) and \(p_u(z)\) for the unlabeled dataset, and indirectly \(p_p(z)\) for the positive dataset with \(N(\mu_p,\Sigma_p)\). The unlabeled prior can also be defined as:
\begin{equation} \label{eq:p_u}
p_u(z)=\pi p_p(z) + (1-\pi)p_n(z)
\end{equation}
\noindent We assume we have access to \(n_n\) negative samples and \(n_u\) unlabeled samples.
\subsection{Training methods}
The proposed model for learning how to generate negative and positive samples is summarised in Figure \ref{TransductGAN}. The first part of the model is an adversarial autoencoder that includes the networks \(E\), \(G\), and the critic networks \(D_{z_u}\) and \(D_{z_n}\). \(E\) and \(G\) are trained to minimize a reconstruction loss, or a minimal \(L_2\) distance between an image and its reconstructed version:
\begin{equation}
L_{reconstruction}=\min_{E} \min_{G} \mathbb{E}_{x \sim P_x} \|x-G(E(x))\|_2
\end{equation}
\noindent In the above \(P_{x}\) could refer to either \(P_{X_u}\) or \(P_{X_n}\).
When using \(X_u\), \(D_{z_u}\) and \(E\) are trained to match the projections of \(X_u\) onto the latent space with \(p_u(z)\) defined in equation \ref{eq:p_u}, a Wasserstein loss with a gradient penalty (WGAN-GP) \citep{DBLP:journals/corr/GulrajaniAADC17} is used in order to ensure that. And similarly when using \(X_n\), \(D_{z_n}\) and \(E\) are trained to match the projections of \(X_n\) onto the latent space with \(p_n(z)\). In both cases, the latent loss can be defined as:
\begin{equation}
L_{regularization}=\min_{E} \max_{D} \mathbb{E}_{x \sim P_x}[D(E(x))]-\mathbb{E}_{z \sim p(z)}D(z)+\lambda \mathbb{E}_{\hat{z} \sim P_{\hat{z}}}[(\|\nabla_{\hat{z}} D(\hat{z})\|_2 - 1)^2]
\end{equation}
\noindent In the above, depending on whether we are using \(X_u\) or \(X_n\) during training, \(P_{x}\) refers to either \(P_{X_u}\) or \(P_{X_n}\). \(p(z)\) refers to either \(p_u(z)\) or \(p_n(z)\) and the critic network \(D\) refers to either \(D_{z_u}\) or \(D_{z_n}\). Similarly to the gradient penalty definition in \citep{DBLP:journals/corr/GulrajaniAADC17}, the sampling \(P_{\hat{z}}\) is a uniform distribution along straight lines between pairs of points sampled from \((q_u(z),p_u(z))\) or \((q_n(z),p_n(z))\). By imposing \(p_u(z)\) and \(p_n(z)\) on \(q_u(z)\) and \(q_n(z)\) respectively, \(q_p(z)\) will implicitly match with \(p_p(z)\).
The second part of the model focuses on \(G\), \(D_{X_u}\) and \(D_{X_n}\). The generator \(G\) will be trained to produce fake positive samples \(G(z_p)\), and (optionally) fake negative samples \(G(z_n)\). Let us define \(X_{u}^{'}\) to be the result of a concatenation operation between \(X_{n}\) and \(G(z_p)\) with proportions of \(1- \pi\) and \(\pi\) respectively. With regards to generating \(G(z_p)\), the intuition is that \(X_u\) is formed by samples from both the negative set \(X_n\) and unknown positive samples \(X_p\), we ensure \(X_n\) already forms a subset of \(X_u^{'}\), the generator \(G\) is then left with the task of complementing \(X_u^{'}\) with samples not already provided by \(X_n\), i.e. samples that are similar to the novel samples \(X_p\). The role of \(D_{x_u}\) is to challenge \(G\) to produce a set \(G(z_p)\) that is indistinguishable from \(X_p\).
With regards to generating \(G(z_n)\), this follows a standard GAN training approach where \(G\) is trained to generate fake negative samples that should look like \(X_n\), and \(D_{X_n}\) is trained to challenge \(G\) on that task.
The adversarial loss, also a WGAN-GP, is defined as:
\begin{equation}
L_{adv}=\min_{G} \max_{D} \mathbb{E}[D(X^{'})]-\mathbb{E}[D(X)]+\lambda \mathbb{E}_{\hat{x} \sim P_{\mathbf{\hat{x}}}}[(\|\nabla_{\hat{x}} D(\mathbf{\hat{x}})\|_2 - 1)^2]
\end{equation}
\noindent In the above, depending on whether we are using \(z_u\) or \(z_n\) during training, \(X^{'}\) refers to either \(X_u^{'}\) or \(G(z_n)\). \(X\) refers to either \(X_u\) or \(X_n\) and the critic network \(D\) refers to either \(D_{X_u}\) or \(D_{X_n}\). Similarly to the gradient penalty definition in \citep{DBLP:journals/corr/GulrajaniAADC17}, the sampling \(P_{\hat{x}}\) is a uniform distribution along straight lines between pairs of points sampled from \((X_{u}^{'},X_u)\) or \((G(z_n),X_n)\). A pseudocode of TransductGAN is provided in algorithm \ref{alg:TransductGAN}.
Once the TransductGAN training is completed, a binary classifier can be trained using the latent projections of \(X_n\) onto the latent space as one class and the latent projections of the fake positive images as the other class as per Algorithm \ref{alg:novelty_detector}.
\begin{algorithm}
\caption{TransductGAN. We use default values of \(\lambda=10\), \(n_{critic}=5\) \citep{DBLP:journals/corr/GulrajaniAADC17}.}
\begin{algorithmic}\label{alg:TransductGAN}
\Require the contamination rate \(\pi\), the gradient penalty coefficient \(\lambda\), the number of critic iterations per generator iteration \(n_{critic}\), the batch size \(m\).
\Require initial critics parameters \(\theta_{D_{z_u}}\), \(\theta_{D_{z_n}}\), \(\theta_{D_{X_u}}\), \(\theta_{D_{X_n}}\), initial encoder parameters \(\theta_{E}\) and initial generator parameters \(\theta_{G}\).
\State sample \(m\) samples from \(X_u\)
\State minimize \(L_{rec}\) wrt \(\theta_{E}\) and \(\theta_{G}\) and update parameters accordingly
\State sample \(z \sim p_{u}(z)\)
\State minimize \(L_{reg}\) wrt \(\theta_{E}\) and update parameters accordingly
\For {\(i=1,...,n_{critic}\)}
\State maximize \(L_{reg}\) wrt \(\theta_{D_{z_u}}\) and update parameters accordingly
\EndFor
\State sample \(m\) samples from \(X_n\)
\State minimize \(L_{rec}\) wrt \(\theta_{E}\) and \(\theta_{G}\) and update parameters accordingly
\State sample \(z \sim p_{n}(z)\)
\State minimize \(L_{reg}\) wrt \(\theta_{E}\) and update parameters accordingly
\For {\(i=1,...,n_{critic}\)}
\State maximize \(L_{reg}\) wrt \(\theta_{D_{z_n}}\) and update parameters accordingly
\EndFor
\State sample \(m\) samples from \(X_u\)
\State sample \(int(\pi*m\)) samples \(z \sim p_{p}(z)\)
\State combine \(G(z)\) with \((m-int(\pi*m))\) samples from \(X_{n}\) to form \(X_{u}^{'}\)
\State minimize \(L_{adv}\) wrt \(\theta_{G}\) and update parameters accordingly
\For {\(i=1,...,n_{critic}\)}
\State maximize \(L_{adv}\) wrt \(\theta_{D_{X_{u}}}\) and update parameters accordingly
\EndFor
\State sample \(m\) samples from \(X_n\)
\State sample \(z \sim p_{n}(z)\)
\State minimize \(L_{adv}\) wrt \(\theta_{G}\) and update parameters accordingly
\For {\(i=1,...,n_{critic}\)}
\State maximize \(L_{adv}\) wrt \(\theta_{D_{X_n}}\) and update parameters accordingly
\EndFor
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\caption{Binary classifier for novelty detection.
}\label{alg:novelty_detector}
\begin{algorithmic}
\Require Training of TransductGAN as per Algorithm \ref{alg:TransductGAN}
\State sample \(5000\) samples \(z_p\) from \( p_{p}(z)\)
\State sample \(5000\) samples \(X_n\) from \(X_n\)
\State train a two-class SVM with linear kernel with \(E(G(z_p))\) as one class and \(E(X_n)\) as another
\State apply classifier on \(E(X_u)\) as novelty detector
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\caption{Vanilla model. We use default values of \(\lambda=10\), \(n_{critic}=5\) \citep{DBLP:journals/corr/GulrajaniAADC17}.}\label{alg:vanilla}
\begin{algorithmic}
\Require the contamination rate \(\pi\), the gradient penalty coefficient \(\lambda\), the number of critic iterations per generator iteration \(n_{critic}\), the batch size \(m\).
\Require initial critics parameters \(\theta_{D_{X_u}}\) and initial generator parameters \(\theta_{G}\).
\State sample \(m\) samples from \(X_u\)
\State sample \(int(\pi*m\)) samples \(z \sim N(\mu, \Sigma)\)
\State combine \(G(z)\) with \((m-int(\pi*m))\) samples from \(X_{n}\) to form \(X_{u}^{'}\)
\State minimize \(L_{adv}\) wrt \(\theta_{G}\) and update parameters accordingly
\For {\(i=1,...,n_{critic}\)}
\State maximize \(L_{adv}\) wrt \(\theta_{D_{X_{u}}}\) and update parameters accordingly
\EndFor
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\caption{Binary classifier for novelty detection with vanilla model.
}\label{alg:novelty_detector_vanilla}
\begin{algorithmic}
\Require Training of vanilla model as per Algorithm \ref{alg:vanilla}
\State sample \(5000\) samples \(z\) from \(N(\mu,\Sigma)\)
\State sample \(5000\) samples from \(X_n\)
\State train a two-class SVM with radial basis function kernel with \(G(z)\) as one class and \(X_n\) as another
\State apply classifier on \(E(X_u)\) as novelty detector
\end{algorithmic}
\end{algorithm}
\section{Experimental results}
\subsection{Datasets}
\subsubsection{MNIST \citep{lecun}.} This dataset of handwritten digits has a training set of 60000 examples, and a test set of 10000 examples and includes 10 classes. In our novelty detection formulation we will treat one of the classes as novel and remove it from the training set, the rest of the classes will be treated as normal. We will iterate through all the class combinations when reporting our results.
\subsubsection{CIFAR10 \citep{krizhevsky}.} This dataset consists of 50000 training images and 10000 test images of 10 classes. We will proceed as with MNIST regarding our novelty detection formulation.
\subsection{Performance measure}
Our performance will be measured using the area under the curve of the Receiver Operating Characteristic (AUROC). The Receiver Operating Characteristic curve plots the true positive rate against the false positive rate as we vary the threshold of our classifier. We will also include image outputs of the produced novel images.
\subsection{Network architectures}
The transductive network architecture as highlighted in red in Figure \ref{TransductGAN} follows the same implementation \footnote{https://github.com/igul222/improved\_wgan\_training} as was provided by \citep{gulrajani2017improved}. Our open source implementation provides further details about the adversarial network implementation.
\begin{figure}[hbt!]
\centering
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=\textwidth]{mnist_outlier/mnist_real/0.png}
\caption{Real novel images}
\label{fig:mnist0}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=\textwidth]{mnist_outlier/mnist_5/0.png}
\caption{Fake novel images (5\%)}
\label{fig:mnist1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=\textwidth]{mnist_outlier/mnist_10/0.png}
\caption{Fake novel images (10\%)}
\label{fig:mnist2}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=\textwidth]{mnist_outlier/mnist_30/0.png}
\caption{Fake novel images (30\%)}
\label{fig:mnist3}
\end{subfigure}
\caption{MNIST example with '0' as novel class. For the fake examples, the value in brackets corresponds to the contamination rate in the test set that was used during training.}
\label{fig:mnist4}
\end{figure}
\begin{figure}[hbt!]
\centering
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=\textwidth]{cifar_outlier/cifar_real/ship.png}
\caption{Real novel images}
\label{fig:cif0}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=\textwidth]{cifar_outlier/cifar_5/ship.png}
\caption{Fake novel images (5\%)}
\label{fig:cif1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=\textwidth]{cifar_outlier/cifar_10/ship.png}
\caption{Fake novel images (10\%)}
\label{fig:cif2}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=\textwidth]{cifar_outlier/cifar_30/ship.png}
\caption{Fake novel images (30\%)}
\label{fig:cif3}
\end{subfigure}
\caption{CIFAR10 example with ship as novel class. For the fake examples, the value in brackets corresponds to the contamination rate in the test set that was used during training.}
\label{fig:cif4}
\end{figure}
\subsection{Methods for comparison}
We will compare our model against OCSVM, EGBAD and GANomaly. We use the scikit implementation of OCSVM \footnote{https://scikit-learn.org/stable/modules/generated/sklearn.svm.OneClassSVM.html} with the 'scale' default kernel width value. We follow the same training procedures stated in the original publications regarding EGBAD and GANomaly's results. EGBAD's results with CIFAR10 were taken from \citep{akcay}. The D-GAN implementation made available by the authors did not include the version they used with MNIST and CIFAR10 datasets; our attempt to reproduce their results resulted in a mode collapse with classification results no better than random so we have not included these in our comparison. We have however built a vanilla model of TransductGAN that is very close to D-GAN with the exception that it requires prior knowledge of the contamination rate (its performance could hence be seen as a best case scenario of D-GAN), it adopts an architecture that is similar to the transductive TransductGAN in order to ensure a fair comparison. The vanilla network does not make use of a latent space and trains a binary classifier (a SVM with a radial basis function kernel) based on the fake (positive) generated samples from the generator and the negative images \(X_n\), it is summarised in Figure \ref{vanilla}) and an outline of the overall procedure is provided in Algorithm \ref{alg:vanilla} and Algorithm \ref{alg:novelty_detector_vanilla}.
\begin{figure}
\centering
\includegraphics[scale=0.55]{vanilla_trans_gan.PNG}
\caption{Vanilla transductive model. \textit{The network is only based on a GAN model and does not exploit learning in the latent space as with TransductGAN. The generator will learn to generate positive fake images that will be used along with the negative images \(X_n\) to train a binary classifier. The algorithm is outlined in Algorithm \ref{alg:vanilla} and the classification task is summarised in Algorithm \ref{alg:novelty_detector_vanilla}.}}\label{vanilla}
\end{figure}
\begin{table}[hbt!]
\resizebox{1.25\textwidth}{!}{
\begin{tabular}{llllllllll}
&OCSVM&GANomaly&EGBAD&TransductGAN(5\%)&Vanilla(5\%)&TransductGAN(10\%)&Vanilla(10\%)&TransductGAN(30\%)&Vanilla(30\%)\\
\hline
0&0.853(0)&0.882&0.86&0.983(0.002)&0.985(0.003)&0.991(0.002)&0.995(0)&0.996(0.001)&0.998(0)\\
1&0.315(0.001)&0.663&0.314&0.994(0.001)&0.997(0)&0.996(0)&0.996(0)&0.998(0)&0.998(0)\\
2&0.775(0.002)&0.952&0.835&0.954(0.001)&0.944(0.009)&0.985(0.002)&0.981(0.001)&0.997(0.002)&0.997(0)\\
3&0.655(0.004)&0.794&0.712&0.949(0.007)&0.955(0.007)&0.975(0.005)&0.972(0.004)&0.996(0.002)&0.995(0.001)\\
4&0.498(0.003)&0.803&0.655&0.952(0.008)&0.948(0.005)&0.978(0.004)&0.976(0.005)&0.994(0.001)&0.997(0)\\
5&0.589(0.003)&0.864&0.713&0.917(0.007)&0.924(0.007)&0.975(0.002)&0.962(0.004)&0.994(0.001)&0.996(0)\\
6&0.691(0.003)&0.852&0.753&0.983(0.003)&0.987(0)&0.994(0.002)&0.994(0)&0.996(0.001)&0.998(0)\\
7&0.582(0.009)&0.697&0.525&0.96(0.005)&0.954(0.003)&0.976(0.005)&0.974(0.001)&0.993(0.001)&0.996(0)\\
8&0.544(0.002)&0.792&0.728&0.936(0.006)&0.921(0)&0.967(0.001)&0.964(0.003)&0.992(0)&0.992(0.001)\\
9&0.349(0.005)&0.534&0.547&0.938(0.012)&0.902(0.018)&0.968(0.005)&0.912(0.063)&0.988(0.002)&0.99(0.001)\\
\hline
&0.585&0.783&0.664&0.956&0.952&0.98&0.973&0.994&0.996
\end{tabular}
}
\caption{ROC (AUC) results summary - MNIST. Results for TransductGAN are from the z features. Three different random seeds are used with standard deviations shown in brackets for TransductGAN, the vanilla model and OCSVM.}
\label{tbl-2}
\end{table}
\begin{table} [hbt!]
\resizebox{1.25\textwidth}{!}{
\begin{tabular}{llllllllll}
&OCSVM&GANomaly&EGBAD&TransductGAN(5\%)&Vanilla(5\%)&TransductGAN(10\%)&Vanilla(10\%)&TransductGAN(30\%)&Vanilla(30\%)\\
\hline
plane&0.54(0.01)&0.622&0.582&0.763(0.003)&0.625(0.005)&0.81(0.004)&0.786(0.009)&0.86(0.002)&0.84(0)\\
car&0.657(0.002)&0.632&0.527&0.7(0.009)&0.756(0.018)&0.85(0.002)&0.77(0.007)&0.906(0.004)&0.843(0.037)\\
bird&0.384(0.011)&0.513&0.386&0.6(0.018)&0.39(0.011)&0.66(0.007)&0.633(0.015)&0.766(0.008)&0.713(0.018)\\
cat&0.577(0.012)&0.575&0.455&0.586(0.045)&0.56(0.013)&0.655(0.004)&0.64(0)&0.786(0.009)&0.69(0.025)\\
deer&0.32(0.005)&0.591&0.385&0.55(0.007)&0.376(0.055)&0.686(0.007)&0.62(0.008)&0.796(0)&0.713(0.006)\\
dog&0.57(0.005)&0.625&0.490&0.65(0.021)&0.62(0.01)&0.715(0.011)&0.68(0.018)&0.816(0.006)&0.753(0.004)\\
frog&0.397(0.001)&0.668&0.359&0.613(0.022)&0.493(0.073)&0.736(0.015)&0.643(0.007)&0.86(0.011)&0.746(0.011)\\
horse&0.54(0.005)&0.650&0.527&0.636(0.021)&0.606(0.007)&0.74(0.011)&0.696(0.012)&0.856(0.009)&0.78(0.031)\\
ship&0.51(0.009)&0.622&0.411&0.8(0.007)&0.736(0.008)&0.87(0.006)&0.836(0.019)&0.9(0.001)&0.89(0.003)\\
truck&0.66(0.006)&0.615&0.554&0.696(0.027)&0.77(0.007)&0.81(0.009)&0.776(0.005)&0.876(0.005)&0.816(0.028)\\
\hline
&0.515&0.611&0.468&0.6596&0.5935&0.7533&0.7053&0.8426&0.7786
\end{tabular}
}
\caption{ROC (AUC) results summary - CIFAR10. Three different random seeds are used with standard deviations shown in brackets for TransductGAN, the vanilla model and OCSVM.}
\label{tbl-3}
\end{table}
\subsection{Discussion}
The results of our experiments are presented in Table \ref{tbl-2} (MNIST) and Table \ref{tbl-3} (CIFAR10). Each row corresponds to a different novelty class and the last row summarises the average performance in terms of AUROC score. On average, our TransductGAN model outperforms GANomaly (the best performing inductive model) by 22.09\% (MNIST) and 7.95\% (CIFAR10) when the contamination rate in the test set is 5\%. With a contamination rate of 10\% TransductGAN outperforms GANomaly by 25.15\% (MNIST) and by 23.28\% (CIFAR10). When the latter figure increases to 30\%, TransductGAN outperforms GANomaly by 26.94\% (MNIST) and 37.9\% (CIFAR10). This highlights the suitability of our model in cases where the novelties are not rare, however even in cases where the contamination rate drops to 5\% our model still outperforms GANomaly. Unsurprisingly, the higher the contamination rate the better the performance as the model is able to learn from a wider pool of novel data points. This is further confirmed by assessing the improvement in image quality of the fake novel samples in Figure \ref{fig:mnist3} and Figure \ref{fig:cif3} as the contamination rate increases. It should also be noted that EGBAD and GANomaly's performances rely on hyperparameter tuning as noted in their respective publications, the tuning was carried to yield optimal performance which suggests the test set labels were used in the process. Our model, although transductive, does not make use of the test set labels at any training stage. Finally, our model also offers the advantage of generating examples of good quality novel images as shown in Figure \ref{fig:mnist3} and Figure \ref{fig:cif3}. Some further examples of novel image generation are included in Appendix \ref{appa}.
As mentioned previously, we were not able to carry any direct comparison to state-of-the-art transductive methods due to the difference in experimental design where we do not make use of the class labels in the training set (as opposed to the work of \citep{DBLP:journals/corr/abs-2012-05825} for example). The state-of-the-art PU learning method (D-GAN) did not have a full implementation available, and although it has an advantage over our method (i.e. the fact it does not require any prior knowledge of the contamination rate in the test set), it only works with a specific type of discriminator loss (the cross-entropy). Previous studies have shown the limitations of using this type of loss and have highlighted issues such as mode collapse or non-informative gradients. Optimal transport type of losses \citep{arjovsky2017wasserstein,DBLP:journals/corr/abs-1803-05573} have shown more stability in the training process, our model has the flexibility of using any of those losses during training. We have compared our method to a vanilla version of TransductGAN that is closely related to D-GAN. Its performance results are displayed under the 'Vanilla' columns (with varying rates of contamination) in Table \ref{tbl-2} and Table \ref{tbl-3}. With regards to MNIST, our model outperforms the vanilla version by 0.51\% and 0.8\% for a contamination rate of 5\% and 10\% respectively, it underperforms the vanilla version by -0.15\% for a contamination rate of 30\%. On average across all contamination rates, it outperforms the vanilla model by 0.39\%. This low performance comparison level is due to the MNIST results already being \(>0.95\) for the vast majority. With regards to CIFAR10, our model outperforms the vanilla version by 10.03\%, 6.37\% and 7.59\% for a contamination rate of 5\%, 10\% and 30\% respectively, this demonstrates a superior performance across all contamination levels.
\section{Conclusion and future work}
We have introduced a novel architecture that learns to generate inliers and novel data using separate distributions by combining an adversarial autoencoder with a GAN under a transductive mode. A binary classifier is trained in the second stage using the latent features of the encoder network to distinguish the novel samples from the inliers. By being able to generate the novel data points artificially we overcome the hurdle of hyperparameter tuning that is faced by state-of-the-art inductive methods. Our model outperforms the latter methods and is capable of reproducing good quality visual representations of the novel images. Our model also outperforms a vanilla model that is closely related to D-GAN; this highlights the advantage that the latent space projections offer in TransductGAN over the image space features in the vanilla model. TransductGAN is most suitable for situations where the novelties are not rare but also shows competitive results when the contamination rate drops to low levels. It also requires prior knowledge of the contamination rate which is a disadvantage over other state-of-the-art PU learning methods, but it allows for the use of more powerful loss functions with enhanced stability during training. Future work will focus on learning the contamination rate and assessing cases where the contamination rate falls to levels below 5\%. Future work will also extend to include labels of the inlier set during training when these are available; this should yield an enhanced performance and allow us to compare our model against a wider range of transductive models.
\section*{Acknowledgements}
\noindent JMM is supported by the Wellcome Trust under Grant No. WT102845/Z/13/Z. NT is funded by the Engineering and Physical Sciences Research Council. We would like to thank Giulia Luise and Florent Chiaroni for insightful comments.
| {'timestamp': '2022-03-31T02:27:05', 'yymm': '2203', 'arxiv_id': '2203.15406', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15406'} | arxiv |
\section{Introduction}
\label{sec::introduction}
Voronoi diagram is a partition of a set into subsets containing elements that are close to each other according to a certain metric. Even though they date centuries, Voronoi tessellations have been found immensely helpful in various applications ranging from health to computer graphics to natural sciences. The first documented application of Voronoi tessellations appeared in \cite{JohnSnowCholera} on the 1854 cholera epidemic in London in which it is demonstrated that proximity to a particular well was strongly correlated to deaths due to the disease \cite{LiliJu2011}. In more recent decades, Voronoi tessellations have almost become a common basis tool for path planning algorithms by multi-robot systems in the field of coverage control \cite{CortesMartinezMobileSensing}.
In line with the popularity of Centroidal Voronoi tessellations (CVT), remarkable amount of contributions have been made to further their development. \cite{ConstrainedCVT_QiangDu} refines the notion of Constrained CVTs and derives various properties like their characterization as energy minimizers. Focusing on one-dimensional Voronoi diagrams, \cite{OneDimVD_Franz} develops an optimal algorithm for computing collinear weighted Voronoi diagrams that is conceptually simple and attractive for practical implementations. \cite{InverseVornoiGoberna} studies the inverse Voronoi problem in-depth.
Despite the wide applicability and vast development in the literature pertaining to CVTs, there remain challenges and open questions, especially in high dimensional spaces. For dimensions greater than one, rigorously verifying a given centroidal Voronoi tessellation is a local minimum can prove difficult, for example \cite{UniquenessCVT_Urschel} uses variational techniques to give a full characterization of the second variation of a centroidal Voronoi tessellation and provides sufficient conditions for a centroidal Voronoi tessellation to be a local minimum. Moreover, in high dimensional spaces, the number of CVTs under certain conditions and their quality is elusive, and their computation remains difficult.
In this paper, we show how one can employ CVTs in one-dimensional spaces to construct a tessellation in a higher dimensional space. Then we prove that such a tessellation is a CVT in the higher dimensional space under certain conditions. Such a construction is a simple and yet a powerful technique that is guaranteed to render at least one of the many non-unique CVTs in high dimensions in a fast and efficient way with minimal computational requirements.
The desired number of centroids in the higher dimensional space is a product of the number of centroids in the one-dimensional spaces. Accordingly, if the dimension is too large, one can limit the number of centroids in one-dimensional spaces in order to keep the total number of centroids meaningful. Doing so also has the advantages of further reduction in computational time.
The paper is structured as follows. In Section \ref{sec::preliminaries} we formally define CVTs, discuss their uniqueness properties, and existing methods to compute them. In Section \ref{sec:ComputationCVTHigherDimensions} we construct a tessellation in a higher dimensional space and prove that it is also a CVT. In Section \ref{sec::numericalresults} we provide numerical results of CVTs under different high dimensional spaces, densities and number of centroids. Finally, we present some conclusions and remarks on future work in Section \ref{sec::conclusion}.
\iffalse
Disadvantages:
1. If using SNLE to obtain the CVT in 1D, then the computation grows with the number of generators. This is because we need to solve an equation for each centroid. So if N centroids is high, then solving a system of high N number of equations is computationally taxing.
2. However, if other methods like Lloyds are used to determine the CVT in 1D, then it is not as computationally taxing.
3. If "still-to-be-resolved" point 1 turns true: that is, we can't use this for spaces like circles.
From either case, we can just use the CVT from 1D, repeat that for all the dimensions we have, and club them together to obtain a CVT in the higher dimension in a straight-forward manner.
Since CVTs are not unique in higher dimensional spaces, this method ensures we get at least one of the many CVTs in that higher dimension space. Overarching idea is that we can at least get these really well drawn out perfect grids in higher dimensions in a fast and efficient way that we know will be one of the many CVTs.
Still to be resolved:
1. Can we do weird spaces like a circle where one dimension is a function of another? Do we need to use some sort of constrained CVTs?
\fi
\section{Preliminaries}
\label{sec::preliminaries}
Consider a region $\Omega \subset \mathbb{R}^n, \ n \geq 1$. Let $N \in \mathbb{N}$, $V_i \subset \Omega, \ \forall i \in I_N$, and denote index set as $I_N = \{1, 2, \hdots, N\}$. Let $\rho(.)$ denote a measure of information or the probability density over $\Omega$.
\begin{itemize}
\item[1] Tessellation: $\{V_i\}_{i\in I_N}$ is a tessellation of $\Omega$ if $V_i \cap V_j = \emptyset$ for $i \neq j$, and $\cup_{i\in I} {V}_i = {\Omega}$.
\item[2] Voronoi region and generators: The Voronoi region ${V}_{z_i}$ of the Voronoi generator $z_i$ is ${V}_{z_i} = \{x \in \Omega : ||x - z_i|| < ||x-z_j||, \ i \neq j \ \text{and} \ i,j \in I_N \}$.
\item[3] Voronoi tessellation: The set of Voronoi regions $\textbf{V}_{\textbf{z}} = \{V_{z_i}\}_{i \in I_N}$ of $\{z_i\}_{i \in I_N}$ is called a Voronoi tessellation $\{ \textbf{z},\textbf{V}_{\textbf{z}}\}$.
\end{itemize}
The mass centroid of a region $V_i \subset \Omega$ under the probability density function $\rho(.)$ is defined as:
\begin{equation}
z_{V_i,\rho}^c = \frac{\int_{V_i} x \rho(x) dx}{\int_{V_i}\rho(x) dx}
\label{eq:MassCentroidDefn}
\end{equation}
\noindent A Voronoi tessellation in which the generators are the mass centroids of their respective Voronoi regions is called a \textit{Centroidal Voronoi Tessellation} (CVT), \cite{CVT_QiangDu}. The CVT obtained for 3 generators in the region $\Omega = [0,15]$ under Uniform and Normal distributions -- $\mathcal{U}(0,15)$ and $\mathcal{N}(7.5,1)$ -- are shown in Fig. \ref{fig:CVT_defn}. The generators under Uniform ad Normal distribution over $\Omega$ are marked in star and square symbols respectively.
\begin{figure}
\centering
\includegraphics[width=\columnwidth]{CVT_defn.png}
\caption{Centroidal Voronoi Tessellations of $[0,15]$ under Uniform and Normal distributions, denoted in star and square symbols respectively.}
\label{fig:CVT_defn}
\end{figure}
\subsection{Uniqueness of CVT}
\label{subsec:UniquenessofCVT}
Given a region $\Omega \subset \mathbb{R}^n$, a positive integer $N$, and a density function $\rho(x)$ on $\Omega$, consider the functional $\mathcal{F}$ with any $N$ points $\{z_i\}_{i \in I_N} \in \Omega$ and any tessellation $\{V_i\}_{i \in I_N}$ of $\Omega$ as its input arguments:
\begin{equation}
\mathcal{F}((z_i,V_i), i \in I_N) = \sum_{i \in I_N} \int_{x\in V_i} \rho(x) ||x-z_i||^2 dx
\label{eq:functionalF_QiangDu}
\end{equation}
\noindent Proposition $3.1$ in \cite{CVT_QiangDu} states that a necessary condition for the function $\mathcal{F}$ to be minimized is that $\{V_i\}_{i \in I_N}$ are the Voronoi regions corresponding to $\{z_i\}_{i \in I_N}$, and simultaneously, $\{z_i\}_{i \in I_N}$ are the centroids of their respective Voronoi regions. In other words, the minimizer of $\mathcal{F}$ is a Centroidal Voronoi Tessellation.
Additionally, if the tessellation in \eqref{eq:functionalF_QiangDu} is fixed to be the Voronoi tessellation of $\{z_i\}_{i \in I_N}$, then the following functional $\mathcal{K}$ has the same minimizer as $\mathcal{F}$, \cite{CVT_QiangDu}.
\begin{equation}
\mathcal{K}((z_i), i \in I_N) = \sum_{i \in I_N} \int_{x\in V_{z_i}} \rho(x) ||x-z_i||^2 dx
\label{eq:functionalK_QiangDu}
\end{equation}
\noindent This functional $\mathcal{K}$ is also referred to as the energy of the tessellation or the quantization energy. It is stated and proved in Lemma $3.4$ in \cite{CVT_QiangDu} that $\mathcal{K}$ is continuous and that it possesses a global minimum. Moving from existence of the CVT to its uniqueness, \cite{CVT_QiangDu} also mentions that $\mathcal{K}$ may have local minimizers.
It is showed in \cite{CVT_Fleischer} that the solution of \eqref{eq:functionalK_QiangDu} is unique in one-dimensional regions with a logarithmically concave continuous probability density function of finite second moment. As reiterated in \cite{UniquenessCVT_Urschel}, for $n=1$, the logarithmic concavity condition implies that any CVT is a local minimum, and further, that there is a unique CVT that is both a local and a global minimum of $\mathcal{K}(\textbf{z})$, where $\textbf{z} = \{z_i\}_{i\in I_N}$. Accordingly, since the two distributions -- Uniform and Normal -- considered in Fig. \ref{fig:CVT_defn} on the one-dimensional region $\Omega = [0,15]$ are log-concave with finite second moment, we have that the CVTs showed therein are the global minima for the two distributions.
The solution of \eqref{eq:functionalK_QiangDu} is also called scalar quantizer for $n=1$ and vector quantizer for higher dimensions. The conditions for uniqueness of vector quantizers for the general case, that is, without any assumptions on the region, density or the number of quantizers $N$, remains an open area of research. However, it is proved in \cite{UniquenessCVT_Urschel} that for $N=2$, there does not exist a unique CVT for any density for $n > 1$.
For a graphic illustration on non-uniqueness of CVTs, consider a rectangle in $\mathbb{R}^2$ with six generator points under Uniform distribution. As shown in Fig. \ref{fig:NonUniqueCVT_example}, there are multiple CVTs: all the four Voronoi tessellations shown are centroidal, and additional CVTs can be obtained through rotations.
\begin{figure}
\centering
\includegraphics[width=0.9\columnwidth]{NonUniqueCVT.png}
\caption{CVT is not necessarily unique in $\mathbb{R}^2$: Four centroidal Voronoi tessellations, each of six generators, in a rectangle in $\mathbb{R}^2$ with uniform density. Voronoi regions are shown in different colors while their centroids are marked as black dots.}
\label{fig:NonUniqueCVT_example}
\end{figure}
To summarize, the solution of \eqref{eq:functionalK_QiangDu} is unique in one-dimensional regions for log-concave density functions but there does not exist a unique CVT for any density for dimensions greater than one \cite{UniquenessCVT_Urschel}.
\subsection{Computation of CVT}
\label{sec::ComputeCVTmethods}
Given a region $\Omega \subset \mathbb{R}^n$, a number of generators $N$, and a density function $\rho(x)$ over $\Omega$, there are various iterative algorithms to compute a CVT in $\Omega$. As noted in the previous Section, in general, the CVT need not be unique for any dimensional region unless certain conditions are imposed on the density function. Accordingly, the solutions rendered by all the algorithms, to compute the CVT, need not be the unique global minimizers. In this Section, we first describe perhaps the most widely employed of all the algorithms: Lloyd's algorithm, and then show a computation method to obtain the exact solution of the problem of finding the CVT in one-dimensional regions.
Introduced in \cite{CVT_Lloyd_original} to find the optimal quantization in pulse-code modulation, Lloyd's algorithm, also known as Voronoi iteration or relaxation, has been modified or adapted in various fields. At the core of it, Lloyd's algorithm is an iteration between constructing Voronoi tessellations and their centroids:
\begin{framed}
\noindent Given: $\Omega \subset \mathbb{R}^n$, $N$, $\rho(x)$ \\
Initialize: Generators $\textbf{z} = \{z_i\}_{i \in I}$, where each $z_i \in \Omega$
\begin{itemize}
\item[1] Construct the Voronoi tessellation $\textbf{V}_\textbf{z}$.
\item[2] Compute the mass centroids $z^c_{\textbf{V}_{\textbf{z},\rho}}$ of $\textbf{V}_\textbf{z}$.
\item[3] If the computed centroids meet certain stopping criteria then terminate. If not, then set $\textbf{z} = z^c_{\textbf{V}_{\textbf{z},\rho}}$, and return to Step 1.
\end{itemize}
\end{framed}
\noindent Since we are looking for a CVT, the search/iterations stop when the centroids of the Voronoi regions are the generators. Accordingly, the stopping criteria can be defined to have the generators same as the centroids with some tolerance.
Even though Lloyd's algorithm is iterative and approximate, it has certain desirable convergence properties. \cite{ConvergenceLloyd_QiangDu} rigorously proves various global convergence properties of the Lloyd's algorithm and surveys all the results concerning the convergence of the Lloyd's algorithm. Specifically for one-dimensional spaces with log-concave density function, the local convergence using the Lloyd's algorithm has been proved in \cite{CVT_1d_uniquenessKieffer}.
Another method to obtain a CVT in a one-dimensional region is SNLE (system of nonlinear equations). Perhaps the most straightforward way to compute a CVT, the core idea behind SNLE, which is the analytical computation of the CVT in one-dimensional region, is to parameterize the Voronoi regions in terms of their centroids: $V_i = [ \frac{z_{i-1}+z_i}{2}, \frac{z_i+z_{i+1}}{2}] , \forall i \in I_N$. The mass centroids from \eqref{eq:MassCentroidDefn}, with $z_{V_i,\rho}^c$ denoted as $z_i^c$ for ease of notation, can then be written in terms of the parameterized regions:
\begin{equation}
z_{i}^c = \frac{\int_\frac{z_{i-1}^c+z_i^c}{2}^{\frac{z_i^c+z_{i+1}^c}{2}} x \rho(x) dx}{\int_\frac{z_{i-1}^c+z_i^c}{2}^{\frac{z_i^c+z_{i+1}^c}{2}}\rho(x) dx}
\label{eq:Centroids_Parameterizing_1D}
\end{equation}
Writing \eqref{eq:Centroids_Parameterizing_1D} for all the centroids results in $N$ equations and $N$ number of unknowns: $z_i^c$'s. This is the system of nonlinear equations (SNLE), whose solution is the set of centroids of the CVT. In one-dimensional regions, the centroids are directly used to define the corresponding Voronoi partitions.
While the Lloyd's algorithm and SNLE obtain the CVT in a deterministic way, MacQueen's method developed in \cite{JMacQueen} takes a probabilistic approach. It was developed to partition an $n$-dimensional population into $k$ sets on the basis of a sample, and the process is also called $k-$means. As noted in \cite{CVTQiangDuParallel}, despite the elegance of MacQueen's method, the algorithm can be slow to converge due to a single random sampling point. Accordingly, \cite{CVTQiangDuParallel} presents a new method that can be viewed as a probabilistic version of Lloyd’s method and/or a generalization of the random MacQueen’s method. Some other algorithms that have faster convergence than Lloyd's have been proposed in \cite{CVT_LlyodsAlt_FastConvergenceLiu}, \cite{CVT_LloydsAlt_FastConvergenceWang}, \cite{CVT_LlyodsAlt_FastConvergenceHateley}.
However, the computation of CVT in higher dimensional spaces still remains a challenge. \cite{CVTQiangDuParallel} considers parallel implementations of Lloyd's, MacQueen's and a method developed therein, and presents the CVT results for regions up to two dimensions while noting that the method can be extended to higher dimensions. Although \cite{CVT_LlyodsAlt_FastConvergenceHateley} results in faster convergence to a CVT, it does not easily extend to higher dimensions. In the next Section, we present a way to extend SNLE (or any method to obtain one-dimensional CVTs) to obtain a higher dimensional CVT.
\section{COMPUTATION OF CVT IN HIGHER DIMENSIONS}
\label{sec:ComputationCVTHigherDimensions}
In this Section, we first propose a simple method to obtain a tessellation in any higher dimensional space from CVTs in one-dimensional spaces. Then, we present the proof that a tessellation constructed in such a way is also a CVT.
Consider a region $\Omega \subset \mathbb{R}^n, \ n > 1$, and $\Omega = \Omega_1 \times \Omega_2 \times \hdots \times \Omega_n$. Let $\rho(.)$ be the probability density function over $\Omega$, and $\rho_i(.)$ be the density function over $\Omega_i$, $\forall i \in I_n = \{1,2,\hdots, n\}$. That is, $\rho(.)$ is the joint density, and $\{\rho_i(.)\}_{i \in I_n}$ are the marginal densities.
Let the number of generators in a CVT of $\Omega_i$ under $\rho_i(.)$ be $N_i$, and let the number of generators in a CVT of $\Omega$ under $\rho(.)$ be $N$, where $N = N_1 \times \hdots \times N_n$. Denote a CVT in $\Omega_i$ as $\{\textbf{z}^*_i, \textbf{V}_{\textbf{z}^*_i}\}$. Here, $\textbf{z}^*_i = \{z^*_{i,j}\}_{j \in I_{N_i}}$ is the set of all the centroids of the CVT in $\Omega_i$, and $\textbf{V}_{\textbf{z}^*_i} = \{V_{z^*_{i,j}}\}_{j \in I_{N_i}}$ is the set of their respective Voronoi regions. Similarly, denote a CVT in $\Omega$ as $\{\textbf{z}^*,\textbf{V}_{\textbf{z}^*}\}$, where $\textbf{z}^* = \{z_k^*\}_{k \in I_N}$ denotes the centroids, $\textbf{V}_{\textbf{z}^*} = \{V_{z^*_k}\}_{k \in I_N}$ denotes their corresponding Voronoi regions.
Note that $\textbf{z}^* \in \mathbb{R}^N$ while $\textbf{z}^*_i \in \mathbb{R}^{N_i} $, and $z^*_k \in \mathbb{R}^n$ while $z^*_{i,j} \in \mathbb{R}$. Denote each element of $z^*_k \in \mathbb{R}^n$ by indexing as $z^*_k(1), z^*_k(2), \hdots, z^*_k(n)$. Additionally, note that $V_{z^*_k} \subset \mathbb{R}^n$ while $V_{z^*_{i,j}} \subset \mathbb{R}$.
Let $I_{n\times N}$ denote the matrix containing all combinations of vectors $I_{N_i}, \forall i \in I_n$. For example, if $n=2, N_1 = 2, N_2 = 3,$ then $N = 2\times3=6$ and
\begin{equation}
I_{n\times N} =
\begin{bmatrix}
1 & 1 & 1 & 2 & 2 & 2 \\
1 & 2 & 3 & 1 & 2 & 3
\end{bmatrix}
\end{equation}
With all the notations defined, we now present a straightforward method of constructing a tessellation in $\Omega$ from CVTs in $\Omega_i's$:
\begin{framed}
\hspace{1cm} \textbf{Tessellation construction in $\Omega$}
\noindent For each dimension $i \in I_n$, construct a CVT in $\Omega_i$: $\{\textbf{z}^*_i, \textbf{V}_{\textbf{z}^*_i}\}$
\noindent Obtain the $n$ coordinates of each centroid in $\Omega$ and its Voronoi region as:
$\forall k \in I_N:$
\hspace{0.5cm}$\forall i \in I_n:$
\hspace{1cm} $z^*_k = z^*_{ I_{n \times N}(i,k)}$
\hspace{1cm} $V_{z^*_k}= V_{z^*_{ I_{n \times N}(i,k)}}$
\noindent The set of all the centroids $\{z_k^*\}_{k \in I_N}$ and their Voronoi regions $\{V_{z^*_k}\}_{k \in I_N}$ make the tessellation in $\Omega$: $\{\textbf{z}^*,\textbf{V}_{\textbf{z}^*}\}$
\end{framed}
Having obtained the tessellation, we show in the following theorem that $\{\textbf{z}^*,\textbf{V}_{\textbf{z}^*}\}$ constructed from $\{\textbf{z}^*_i, \textbf{V}_{\textbf{z}^*_i}\}_{i \in I_n}$ is a CVT in $\Omega$.
{\textbf{Theorem:}} If events in $\Omega_i$ are independent of those in $\Omega_j$, $\forall i \neq j, \ i,j \in I_n$, then for some $k_i \in I_{N_i}, \forall i \in I_n$ and $\forall k \in I_N,$ we have:
\begin{equation}
z^*_k = (z^*_{1,k_1}, \ z^*_{2,k_2}, \hdots, z^*_{n,k_n})
\label{eq:TheoremCentroidStatement}
\end{equation}
\begin{equation}
V_{z^*_k} = V_{z^*_{1,k_1}} \times V_{z^*_{2,k_2}} \times \hdots \times V_{z^*_{n,k_n}}
\label{eq:TheoremVoronoiStatement}
\end{equation}
{\textbf{Proof:}}
Consider $x \in V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_n}}$, $\forall i \in I_n$, and denote $x = (x_1, \hdots, x_n)$. Because $V_{z^*_{i,k_i}}$ is the Voronoi region of $z^*_{i,k_i}$, $\forall i \in I_n$, we have for any $j_i \in I_{N_i}$:
\begin{align}
||x_i - z^*_{i,k_i}||_2 \leq ||x_i - z^*_{i,j_i}||_2 \nonumber \\
\implies (x_i - z^*_{i,k_i})^2 \leq (x_i - z^*_{i,j_i})^2
\label{eq:VoronoiRegionRnProof1}
\end{align}
Summing \eqref{eq:VoronoiRegionRnProof1} $\forall i \in I_n$,
\begin{align}
(x_1 - z^*_{1,k_1})^2 + & \hdots + (x_n - z^*_{n,k_n})^2 \leq \\ \ \ (x_1 & - z^*_{1,j_1})^2 + \hdots + (x_n - z^*_{n,j_n})^2 \\
\implies \sqrt((x_1 - z^*_{1,k_1})^2 &+ \hdots + (x_n - z^*_{n,k_n})^2) \leq \\ \sqrt((x_1 & - z^*_{1,j_1})^2 + \hdots + (x_n - z^*_{n,j_n})^2) \label{eq:VoronoiRegionRnProof2}
\end{align}
Let $\hat{z}^*_k = (z^*_{1,k_1}, z^*_{2,k_2}, \hdots, z^*_{n,k_n})$, then \eqref{eq:VoronoiRegionRnProof2} results in:
\begin{align}
||x-\hat{z}^*_k||_2 \ \ \leq \ \ ||x-z^*_j|| \nonumber \\
\implies V_{\hat{z}^*_k} = V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_1}}
\label{eq:VoronoiRegionRnProof2}
\end{align}
\noindent That is, $V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_1}}$ is the Voronoi region of $\hat{z}^*_k$. We are yet to prove that $\hat{z}^*_k$ is a centroid of a CVT in $\Omega$ under $\rho(.)$, that is, $z^*_k = \hat{z}^*_k$.
Consider the $i^{th}$ coordinate of $\hat{z}^*_k$. Since $z^*_{i,k_i}$ is the centroid of $V_{z^*_{i,k_i}}$, by definition of centroid, we have:
\begin{align}
z^*_{i,k_i} &= \frac{\int_{V_{z^*_{i,k_i}}} x_i \rho_1(x_i)}{\int_{V_{z^*_{i,k_i}}} \rho_n(x_i) dx_i} \nonumber \\
&= \frac{\int_{V_{z^*_{1,k_1}}} \rho_1(x_1)dx_1}{\int_{V_{z^*_{1,k_1}}} \rho_1(x_1)dx_1} \times \hdots \times \frac{\int_{V_{z^*_{i,k_i}}} x_i\rho_i(x_i)dx_i}{\int_{V_{z^*_{i,k_i}}} \rho_i(x_i)dx_i} \nonumber \\
&\hspace{2cm} \times \hdots \frac{\int_{V_{z^*_{n,k_n}}} \rho_n(x_n)dx_n}{\int_{V_{z^*_{n,k_n}}} \rho_n(x_n)dx_n}
\label{eq:MassCentroidRnProof1}
\end{align}
Because the events in $\Omega_i$ are independent of those in $\Omega_j$, $\forall i \neq j, \ i,j \in I_n$, we have $\rho(x_1, \hdots, x_n) = \rho_1(x_1), \hdots, \rho_n(x_n)$. Substituting this relation in \eqref{eq:MassCentroidRnProof1} implies:
\begin{align*}
z^*_{i,k_i} &= \frac{\int_{V_{z^*_{1,k_1}}} \hdots \int_{V_{z^*_{n,k_n}}} x_i \rho(x_1, \hdots, x_n) dx_1 \hdots dx_n }{\int_{V_{z^*_{1,k_1}}} \hdots \int_{V_{z^*_{n,k}}} \rho(x_1, \hdots, x_n) dx_1 \hdots dx_n }
\end{align*}
\noindent which, by definition of mass centroids, is the $i^{th}$ coordinate of the $k^{th}$ of the $N$ centroids -- $z^*_k$ -- in $\Omega$ with density $\rho(.)$. That is, $z^*_k(i) = z^*_{i,k_i}$. Since this holds for all $i \in I_n$ coordinates, we have $z^*_k = \hat{z}^*_k = (z^*_{1,k_1}, z^*_{2,k_2}, \hdots, z^*_{n,k_n})$, and hence proving \eqref{eq:TheoremCentroidStatement}. On the other hand, since $V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_1}}$ is the Voronoi region of $\hat{z}^*_k$ from \eqref{eq:VoronoiRegionRnProof2}, and $z^*_k = \hat{z}^*_k$, we have $V_{z^*_{1,k_1}} \times \hdots \times V_{z^*_{n,k_1}}$ is the Voronoi region of $z^*_k$, hence proving \eqref{eq:TheoremCentroidStatement}. Since this holds for all $N$ centroids in $\Omega$, we have that $\textbf{z}^* = \{z^*_k\}_{k \in I_N}$ and $\textbf{V}_{\textbf{z}^*} = \{V_{z^*_k}\}_{k \in I_N}$ is a CVT in $\Omega$ with density $\rho(.)$.
$\hfill \square$
Recall the non-uniqueness of CVTs in $\mathbb{R}^2$ from Fig. \ref{fig:NonUniqueCVT_example}, that shows some of the CVTs for $N=6$ generators in a rectangle in $\mathbb{R}^2$ with uniform density. We construct the CVT in Fig. \ref{fig:NonUniqueCVT_example}(d) under different conditions.
Consider $\Omega = [0,20] \times [0,10]$ in $\mathbb{R}^2$ with density $\rho(.) \sim \mathcal{N}(\mu,\Sigma)$, where $\mu = (12,7)$ and $\Sigma=[4 \ \ 0; 0 \ \ 1]$. Denote the CVT as $\{\textbf{z}^*,\textbf{V}_{\textbf{z}^*}\}$, where $\textbf{z}^* = (z^*_1, \hdots, z^*_6)$, and $z^*_k \in \mathbb{R}^2, \forall k \in I_6 = \{1, \hdots, 6\}$.
On the other hand, let $N_1 = 3$ and $N_2 = 2$. Consider the unique CVT in $\Omega_1 = [0,20]$ for $\rho_1(.) \sim \mathcal{N}(12,4)$, which is denoted $\{\textbf{z}_1^*,\textbf{V}_{\textbf{z}_1^*}\}$. Note $\textbf{z}_1^* = (z^*_{1,1}, z^*_{1,2}, z^*_{1,3})$, and $z^*_{1,j} \in \mathbb{R}, \forall j \in I_3$. Similarly, consider the unique CVT in $\Omega_2 = [0,10]$ for $\rho_1(.) \sim \mathcal{N}(7,1)$, which is denoted $\{\textbf{z}_2^*,\textbf{V}_{\textbf{z}_2^*}\}$. Note $\textbf{z}_2^* = (z^*_{2,1}, z^*_{1,2})$, and $z^*_{1,j} \in \mathbb{R}, \forall j \in I_2$. These generators are shown in Fig \ref{fig:Is1plus1equalto2_step1}: the region $\Omega_1$ and the CVT generators in it are showed in pink, and the region $\Omega_2$ and the CVT generators in it are showed in blue. While this method of obtaining a CVT in higher dimensions by employing a combination of CVTs in $\mathbb{R}$ does not result in every possible CVT of the higher dimension under the given conditions, we are guaranteed to obtain at least one of them in a straightforward manner with minimal computation.
\begin{figure}
\centering
\includegraphics[width=0.9\columnwidth]{Is1plus1equalto2_step1.png}
\caption{CVTs in $\Omega_1$ and $\Omega_2$ with densities $\mathcal{N}(12,4)$ and $\mathcal{N}(7,1)$ respectively.}
\label{fig:Is1plus1equalto2_step1}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.9\columnwidth]{Is1plus1equalto2.png}
\caption{CVT in $\Omega$ with density $\mathcal{N}(\mu,\Sigma)$ where $\mu = [12; 7]$ and $\Sigma = [4 \ \ 0; 0 \ \ 1]$ .}
\label{fig:Is1plus1equalto2_step1}
\end{figure}
\section{NUMERICAL RESULTS}
\label{sec::numericalresults}
In this Section, we present a set of numerical results to demonstrate the ease of extension in higher dimensions through the time required to compute the CVT and the CVT energy. Additionally, for 2 and 3 dimensional spaces we also present the tessellations graphically. To obtain the CVTs in one-dimensional spaces, one can employ Lloyd's algorithm or solve the system of nonlinear equations; the latter being more desirable when $N_i's$ are low.
Consider the region $\Omega _1 = \Omega _2 = [-1, 1]$ and $\Omega = \Omega_1 \times \Omega_2 \subset \mathbb{R}^2$. Following the cases taken up in \cite{CVTQiangDuParallel}, we let the density function over $\Omega$ be $e^{-10x^2}$. The CVT of 256 centroids, obtained from $16$ in each dimension, in the aforementioned $\Omega$ is shown in Fig. \ref{fig:CVT_2D_16x16_expminus10xsq}. As designed and expected, the tessellation has a well drawn out grid-like structure with the intensity of centroids being higher in the center of $\Omega$. The resulting tessellation is a CVT with (low) energy of $2.9 \times 10^{-4}$ and was obtained in computational time as less as $13.18$ minutes in an ordinary laptop -- MacBook Air 2015 with 2.2 GHz Dual-Core Intel Core i7.
\begin{figure}
\centering
\includegraphics[width=\columnwidth]{CVT_2D_16x16_expminus10xsq.eps}
\caption{CVT of 256 centroids in a two-dimensional square under $\rho_1(x_1) = \rho_2(x_2) = e^{-10x^2}$ }
\label{fig:CVT_2D_16x16_expminus10xsq}
\end{figure}
Next case of demonstration is in the region $\Omega = [0,20] \times [0,20]$ with a Gaussian density of means $\begin{bmatrix} 5 \\ 6.5 \end{bmatrix}$ and variance $\begin{bmatrix} 2 \ \ 0 \\ 0 \ \ 1 \end{bmatrix}$. Here, we consider $N_1 = 60$ and $N_2 = 50$, implying total number of centroids in $\Omega$ being $N=3000$. The resulting CVT with energy $0.0112$ is shown in Fig. \ref{fig:CVT_2D_60x50_GammaGaussianWorkComp}.
\begin{figure}
\centering
\includegraphics[width=\columnwidth]{CVT_2D_60x50_GammaGaussianWorkComp.eps}
\caption{CVT of 3000 centroids in $\Omega = [0,20]\times [0,20]$ with Gaussian density.}
\label{fig:CVT_2D_60x50_GammaGaussianWorkComp}
\end{figure}
Moving to 3 dimensional spaces, we consider $\Omega = [0,10]\times [0,10] \times [0,10]$ under Gaussian density with mean $\mu$ and variance $\Sigma$ as:
\begin{equation*}
\mu = \begin{bmatrix} 6 \\ 5 \\ 1 \end{bmatrix} \hspace{1cm}
\Sigma = \begin{bmatrix} 2 \ \ 0 \ \ 0 \\ 0 \ \ 1 \ \ 0 \\ 0 \ \ 0 \ \ 1 \end{bmatrix}
\end{equation*}
\noindent The resulting well-aligned grid looking CVT with $16$ centroids in each dimension, with energy $0.1616$, is shown in Fig. \ref{fig:CVT_3D_16x16x16_Gaussian62_51_3p51}.
\begin{figure}
\centering
\includegraphics[width=0.9\columnwidth]{CVT_3D_16x16x16_Gaussian62_51_3p51.eps}
\caption{Scalability and generalizability to any density: CVT of 4096 centroids in a 3D space under Gaussian density.}
\label{fig:CVT_3D_16x16x16_Gaussian62_51_3p51}
\end{figure}
One of the areas where higher dimensional CVTs have found an application is in the field of evolutionary optimization. Recently introduced, MAP-elites \cite{MAP_elites} is an algorithm that illuminates search spaces in evolutionary optimization, allowing researchers to understand how interesting attributes of solutions combine to affect performance. To scale up the MAP-elites algorithm, authors in \cite{CVT_MAP_elites} employ centroidal Voronoi tessellations, and therein, following \cite{CVTQiangDuParallel}, they employ MacQueen's method to obtain the CVTs and show the sufficiency of using $5000$ centroids. In line with their result, we keep the total number of centroids around the same. Accordingly, we vary $N_i, \forall i \in I_n$ such that $N = \prod_i N_i$ is around $5000$. The corresponding results are given in Table \ref{tab:HighDimensionQiangDu} where we see that the computation time decreases with the increase in dimension $n$. This is because with increase in $n$, we decrease $N_i$ to keep $N$ around $5000$. Hence, the computation of CVT in one-dimensional spaces with fewer centroids is faster. The low energy of all the tessellations is also worth noting.
\begin{table}[]
\begin{tabular}{@{}cccc@{}}
\toprule
Dimension, $n$ & $N = \prod_i N_i$ & CVT energy & Time (minutes) \\ \midrule
4 & $4096 = 8^4$ & $0.68 \times 10^{-3}$ & $6.174$ \\
5 & $4096 = 4^3 \times 8^2$ & $1.2 \times 10^{-3}$ & $4.248$ \\
8 & $6561 = 3^8 $ & $0.74 \times 10^{-3}$ & $0.641$ \\
12 & $4096 = 2^{12}$ & $0.21 \times 10^{-3}$ & $0.480$ \\ \bottomrule
\end{tabular}
\label{tab:HighDimensionQiangDu}
\caption{Tessellation energy and time taken for computing the tessellation for $\Omega_i = [-1,1], \forall i \in I_n$ under density $e^{-10x^2}$ over each $\Omega_1$.}
\end{table}
\section{CONCLUSIONS}
\label{sec::conclusion}
In order to fully rank the quality of all the CVTs under a certain higher dimensional space (read fixed region, number of centroids, and density), the knowledge of all the CVTs and their tessellation energy is required. However, the problem in such a comparison is the difficulty in obtaining CVTs in higher dimension spaces. Nevertheless, the tessellations constructed from CVTs in one-dimensional spaces, that appear to be well drawn out grid-like structures, are proved to be one of the many CVTs in such spaces of dimensions greater than 1. Hence, we are guaranteed to obtain at least one of the many non-unique CVTs in the higher dimensional space.
Additionally, as seen in the simulation results, the tessellation energy of such CVTs is quantifiably low and are obtained with minimal computational requirement. The method described does not make specific assumptions on the density function, it is scalable to a large number of centroids, and is flexible in terms of dimensions and discretization over each dimension.
However, the (only) key assumption in the construction of CVTs in a higher dimensional spaces from CVTs in one-dimensional spaces is the independence of the densities of the latter spaces. This limits the applicability of the developed idea in areas where CVTs are constrained to a surface, say computing CVT on a sphere, and will be a point of investigation for our future work.
\addtolength{\textheight}{-12cm}
| {'timestamp': '2022-03-30T02:33:06', 'yymm': '2203', 'arxiv_id': '2203.15507', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15507'} | arxiv |
\subsection{A Core Language with Effects and Handlers}
For the sake of simplicity, we take the core language described in
\cite{Pretnar2015:EFF} with additional base types corresponding to observations
and actions and a simple type system without type effects. We will not talk
about the details of the underlying effect, such as randomness, I/O, or
exceptions. Those effects are obviously needed in practice, but adding them to
the theory would be standard, so for the sake of simplicity we ignore those,
and when we write a type $T \rightarrow T'$, this function should be understood
as a function that can use those standard effects.
The grammar for terms and types is in Figure~\ref{f:effgrammar}.
\begin{figure}
\begin{framed}
\begin{align*}
\text{(Values) } V &::= x \midd \lambda x. C \midd (V,V) \midd () \midd
\underline{c} \midd \underline{f} \midd H \\
\text{(Handlers) } H &::= \key{handler} \{ \key{return} x \mapsto
C, \op{op}_1(x;k) \mapsto C, \dots, \op{op}_n(x;k) \mapsto C \} \\
\text{(Computations) } C &::= \key{return} V \midd \pi_i(V) \midd
\op{op}(V;x.C) \midd \key{let} x = C ~\key{in} C \midd V~V \midd
\key{with} V ~\key{handle} C \\
\text{(Types) } T &::= \type{B} \midd \type{Unit} \midd T \times T \midd T
\rightarrow T \midd T \Rightarrow T\\
\end{align*}
\vspace{-30pt}
\end{framed}
\caption{Syntax and Types of Terms}
\label{f:effgrammar}
\end{figure}
In other words, we work with a $\lambda$-calculus with pairs base types (ranged
over by $\type{B}$), constants and functions for those base types, denoted by
$\underline{c}$ and
$\underline{f}$. Any symbol $c \in \mathcal{C}$ is associated to a
base type $\type{B}$, while any symbol $f \in \mathcal{F}$ comes equipped with a
function type $\type{B}_1 \times \cdots \times \type{B}_n \rightarrow \type{B}$. Moreover, we
have algebraic
operations, each operation symbol $\op{op}$ coming with a type $\op{op} :
T_p \rightsquigarrow T_a \in \Sigma$ where $T_p$ is the type of parameters and $T_a$
is the arity. In a computation $\op{op}(V;x.C)$, the variable $x$ is bound in
$C$. Those operations are handled by handlers. An
handler has the following form
$$
\key{handler} \{ \key{return} x \mapsto C_r, \op{op}_1(x;k) \mapsto C_1, \dots,
\op{op}_n(x;k) \mapsto C_n \}
$$
Here, the computations $C_1,\ldots,C_n$ are pieces of code meant to handle the
corresponding algebraic operation, while $C_r$ is meant to handle a return
clause. We use the arrow $\Rightarrow$ to denote handler types, contrary to the
function type that uses $\rightarrow$. When one wants to use the aforementioned
handler for the purpose of managing some algebraic operations, we do by way of
a term in the form
$$
\key{with} V ~\key{handle} C
$$
in which $C$ is executed in a protected environment such that any algebraic
operations produced by $C$ is handled by the handler $V$, provided it is one
among those declared in it.
The typing rules for this language are given in Figure~\ref{f:efftype}. In a computation $\op{op}(V;x.C)$, $C$ can be seen as a continuation for the computation, with type $T_a \rightarrow T$, this is why in the typing of handler, the second parameter $k$ has this type. The typing rule for the handler with simple types looks like a function application, where the handler transforms a computation of type $T_2$ to a computation of type $T_1$.
\begin{figure}
\begin{framed}
\begin{center}
\AXC{}
\UIC{$\Gamma, x : T \vdash x : T$}
\DP
\qquad
\AXC{$\Gamma, x : T_1 \vdash C : T_2$}
\UIC{$\Gamma \vdash \lambda x. C : T_1 \rightarrow T_2$}
\DP
\qquad
\AXC{$\Gamma \vdash V_1 : T_1$}
\AXC{$\Gamma \vdash V_2 : T_2$}
\BIC{$\Gamma \vdash (V_1,V_2) : T_1 \times T_2$}
\DP
\\
\vspace{3mm}
\AXC{}
\UIC{$\Gamma \vdash () : \type{Unit}$}
\DP
\qquad
\AXC{$c : \type{B} \in \mathcal{C}$}
\UIC{$\Gamma \vdash \underline{c} : \type{B}$}
\DP
\qquad
\AXC{$f : \type{B}_1 \times \cdots \type{B}_n \rightarrow \type{B} \in \mathcal{F}$}
\UIC{$\Gamma \vdash \underline{f} : \type{B}_1 \times \cdots \type{B}_n \rightarrow \type{B}$}
\DP
\qquad
\\
\vspace{3mm}
\AXC{$\{(\op{op}_i : T^p_i \rightsquigarrow T^a_i) \in \Sigma \qquad
\Gamma,
x : T_i^p, k : T_i^a \rightarrow T_c \vdash C_i : T_c\}_{1 \le i \le
n}$}
\AXC{$\Gamma, x : T_v \vdash C_r : T_c $}
\BIC{$\Gamma \vdash \key{handler} \{ \key{return} x \mapsto C_r, \op{op}_1(x;k) \mapsto C_1, \dots, \op{op}_n(x;k) \mapsto C_n \} : T_v \Rightarrow T_c $}
\DP
\\
\vspace{3mm}
\AXC{$\Gamma \vdash V : T$}
\UIC{$\Gamma \vdash \key{return} V : T$}
\DP
\qquad
\AXC{$\Gamma \vdash V : T_1 \times T_2$}
\UIC{$\Gamma \vdash \pi_i(V) : T_i$}
\DP
\\
\vspace{3mm}
\AXC{$(\op{op} : T_p \rightsquigarrow T_a) \in \Sigma$}
\AXC{$\Gamma \vdash V : T_p$}
\AXC{$\Gamma, x : T_a \vdash C : T $}
\TIC{$\Gamma \vdash \op{op}(V;x.C) : T$}
\DP
\\
\vspace{3mm}
\AXC{$\Gamma \vdash C_1 : T_1 $}
\AXC{$\Gamma, x : T_1 \vdash C_2 : T_2 $}
\BIC{$\Gamma \vdash \key{let} x = C_1 ~\key{in} C_2 : T_2$}
\DP
\qquad
\AXC{$\Gamma \vdash V_1 : T_2 \rightarrow T_1$}
\AXC{$\Gamma \vdash V_2 : T_2$}
\BIC{$\Gamma \vdash V_1~V_2 : T_1$}
\DP
\\
\vspace{3mm}
\AXC{$\Gamma \vdash V : T_2 \Rightarrow T_1$}
\AXC{$\Gamma \vdash C : T_2$}
\BIC{$\Gamma \vdash \key{with} V ~\key{handle} C : T_1$}
\DP
\end{center}
\end{framed}
\caption{Typing Rules}
\label{f:efftype}
\end{figure}
Then, the dynamic semantics is given in Figure~\ref{f:effsemantics}. Algebraic
operations can commute with the $\key{let}$ constructor and handlers for other
operations. As for handlers, the return computation is handled by the return
clause, and an algebraic operation is handled by the corresponding computation
in the handler, where the continuation $k$ is replaced by the actual
continuation $C$ with the same handler.
\begin{figure}
\begin{framed}
\begin{center}
\small
\AXC{}
\UIC{$\pi_i(V_1,V_2) \rightarrow V_i$}
\DP
\qquad
\AXC{$C_1 \rightarrow C_1'$}
\UIC{$\key{let} x = C_1 ~\key{in} C_2 \rightarrow \key{let} x = C_1' ~\key{in} C_2 $}
\DP
\\
\vspace{3mm}
\AXC{}
\UIC{$\key{let} x = \op{op}(V;y.C_1) ~\key{in} C_2 \rightarrow \op{op}(V;y.\key{let} x = C_1 ~\key{in} C_2) $}
\DP
\qquad
\AXC{}
\UIC{$\key{let} x = \key{return} V ~\key{in} C_2 \rightarrow C_2 \sub{x}{V} $}
\DP
\\
\vspace{3mm}
\AXC{}
\UIC{$(\lambda x. C)~V \rightarrow C \sub{x}{V}$}
\DP
\qquad
\AXC{$V = (\underline{c_1},\dots,\underline{c_n}) $}
\AXC{$ c = f(c_1,\dots,c_n) $}
\BIC{$\underline{f}~V \rightarrow \underline{c}$}
\DP
\\
\vspace{3mm}
For the following rules, we denote $H = \key{handler} \{ \key{return} x \mapsto C_r, \op{op}_1(x;k) \mapsto C_1, \dots, \op{op}_n(x;k) \mapsto C_n \}$
\\
\vspace{3mm}
\AXC{$C \rightarrow C'$}
\UIC{$\key{with} H ~\key{handle} C \rightarrow \key{with} H ~\key{handle} C'$}
\DP
\\
\vspace{3mm}
\AXC{$\op{op} \notin \set{\op{op}_1,\dots,\op{op}_n}$}
\UIC{$\key{with} H ~\key{handle} \op{op}(V;x.C) \rightarrow \op{op}(V;x.\key{with} H ~\key{handle} C)$}
\DP
\\
\vspace{3mm}
\AXC{}
\UIC{$\key{with} H ~\key{handle} \key{return} V \rightarrow C_r \sub{x}{V}$}
\DP
\\
\vspace{3mm}
\AXC{}
\UIC{$\key{with} H ~\key{handle} \op{op}_i(V;x.C) \rightarrow C_i \sub{x}{V} \sub{k}{\lambda x. \key{with} H ~\key{handle} C }$}
\DP
\end{center}
\end{framed}
\caption{Semantics}
\label{f:effsemantics}
\end{figure}
With this, we have a complete description of a core language with effects, handlers and base types. In practice, we also want other standard constructors for booleans (if then else), lists or other data structures, but this can be easily added to the core language without any theoretical difficulties. It is then relatively standard to prove the subject reduction of this type system, proving some simple kind of safety:
\begin{theorem}[Subject Reduction]
If $\Gamma \vdash C : T$ and $C \rightarrow C'$ then $\Gamma \vdash C' : T$
\end{theorem}
\begin{proof}
The proof is standard. We start by proving a weakening lemma (if $\Gamma \vdash C : T$ then $\Gamma, x : T' \vdash C : T$) and a value substitution lemma (if $\Gamma, x:T \vdash C : T'$ and $\Gamma \vdash V : T$ then $\Gamma \vdash C \sub{x}{V} : T' $) by induction on judgment, and then we can prove subject reduction by induction on the relation $C \rightarrow C'$. The weakening lemma is useful for the cases when an algebraic operation $\op{op}$ commute with a $\key{let}$or an $\mathbf{handle}$, and the substitution lemma is useful for substitutions, which are always for values as one can see in Figure~\ref{f:effsemantics}.
\end{proof}
However, with those simple types it is not possible to prove that any typable computation reduces to a computation of the shape $\key{return} V$, because a non handled operation $\op{op}$ cannot be reduced. To have those kind of safety theorems, we need type effects, as we will see in the next section.
\subsection{Setting the Stage: Types and Algebraic Operations for RL}
Let us now instantiate more clearly the set of base types and operations for our approach. We consider that:
\begin{itemize}
\item Base types should contain at least
$\type{Bool},\type{Real},A_E,O_E,A_{\mathit{RL}},O_{\mathit{RL}}$, respectively the types for booleans,
real number for rewards, \emph{actions}, \emph{observations} and their
abstract counterparts.
\item Constants for booleans and real numbers are standard. For $A_E, A_{\mathit{RL}}$ and $O_{\mathit{RL}}$, we consider finite sets of constants, and $A_E, A_{\mathit{RL}}$ should have the same size. As for $O_E$, the set of constants depends on the environment so we have no fixed choice.
\item We have standard functions for booleans and real numbers, and equality for all those base types. We may also have additional functions for $O_E$ depending on the environment.
\item For the set of operations symbols, we suppose that we have at least the main four operations described before
\begin{align*}
\op{choice} &: \type{Unit} \rightsquigarrow A_E \\
\op{reward} &: \type{Real} \rightsquigarrow \type{Unit} \\
\op{observe} &: \type{Unit} \rightsquigarrow O_E \\
\op{do} &: A_E \rightsquigarrow \type{Unit}
\end{align*}
And, in order to make the abstraction more formal, we also add
\begin{align*}
\op{choice_{\mathit{RL}}} &: \type{Unit} \rightsquigarrow A_{\mathit{RL}} \\
\op{reward_{\mathit{RL}}} &: \type{Real} \rightsquigarrow \type{Unit}
\end{align*}
Moreover, we also need to add effects corresponding to the abstract interface. As this interface is not fixed, we chose for the sake of the example the one we used on the naive algorithm. So we add those operations:
\begin{align*}
\op{observe_{\mathit{RL}}} &: \type{Unit} \rightsquigarrow O_{\mathit{RL}} \\
\op{getactions_{\mathit{RL}}} &: O_{\mathit{RL}} \rightsquigarrow A_{\mathit{RL}}~\type{List}
\end{align*}
\end{itemize}
This describes all we need in order to formalize our approach. However, in practice, we do not want all the actors (environment, user and learner) to have access to all those operations at all time. A typical example is that the learner must not use $\op{observe}$ or have access to $O_E$ as it would break abstraction, and thus modularity. As a first approach, we define subsets of this language, by defining subsets of base types, functions and algebraic operation, so that we can define clearly which actor has access to which constructors. In the next section on safety, we will formalize this with a type system.
\begin{itemize}
\item The whole language described above, with all base types and operations is denoted $\lambda_{\mathit{eff}}^I$. This calculus will be used to define the interface, as an interface should be able to see both the constructors for the environment and for the learner in order to make the bridge.
\item We denote by $\lambda_{\mathit{eff}}^E$ the subset of this whole language without types and operations related to the learner (all types and operations with $\mathit{RL}$ in the name, such as $A_{\mathit{RL}}$, $\op{choice}_{\mathit{RL}}$, \dots). This language will be used for the main program and the handler for $\op{do}$ and $\op{observe}$, as it is basically the language with no concrete information about the learner.
\item Dually, we denote by $\lambda_{\mathit{eff}}^{\mathit{RL}}$ the language with \emph{only} the operations related to the learner. Also, in $\lambda_{\mathit{eff}}^{\mathit{RL}}$, we consider that we do not have any functions nor constants for $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$ except equality and the operations in the abstract interface. Indeed, this language will correspond to the learner, and as explained before, we want the learner to be independent from its environment. An important point to make this possible, is that the learner should be modular (or ideally, polymorphic) in the types $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$, and so having access to the constants of those types would break this principle. In particular, with this definition of $\lambda_{\mathit{eff}}^{\mathit{RL}}$, changing the size of the finite sets $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$ does not modify the language, so whatever the size may be, the learner still uses the same language.
\end{itemize}
\subsection{RL Algorithms and Environments as Handlers}
We start with the main program. As showed in the previous section, the main program is just an usual functional program that has access to the types $O_E$ and $A_E$ as well as the four main operations $\op{choice}$, $\op{reward}$, $\op{observe}$ and $\op{do}$. Thus, it corresponds to the language we denote $\lambda_{\mathit{eff}}^E$. This is the main focus of our work, to make it possible to program within this language. In order to do this we still need to handle those four operations, and for this we design several handlers.
\subsubsection{The Learner}
The learner is a handler with the state monad for the operations $\op{choice}_{\mathit{RL}}$ and $\op{reward}_{\mathit{RL}}$, written in $\lambda_{\mathit{eff}}^{\mathit{RL}}$. So, formally, the learner is a handler
$$H_{\mathit{RL}} \equiv \key{handler} \{ \key{return} x \mapsto \lambda m. \key{return} (m,x), \op{choice}_{\mathit{RL}}(k) \mapsto C_c, \op{reward}_{\mathit{RL}} (r;k) \mapsto C_r \}$$
such that
$$ k : A_{\mathit{RL}} \rightarrow S_M(T) \vdash C_c : S_M(T) \qquad r : \type{Real}, k : \type{Unit} \rightarrow S_M(T) \vdash C_r : S_M(T) $$
where $T$ is any type and $S_M(T) \equiv M \rightarrow (M \times T)$ is the type for the state monad with state $M$, that represents the \emph{memory} of the learner. With this, we obtain a handler $H_{\mathit{RL}}$ with type $T \Rightarrow S_M(T)$ for any $T$.
In this handler, we can indeed encode a RL algorithm, as we did for the naive algorithm for MAB, because, informally:
\begin{itemize}
\item The memory $M$ can contain a value function, associating an heuristic to pairs of states and actions ($O_{\mathit{RL}} \times A_{\mathit{RL}}$). It can also be used to log information if needed, typically the previous choice, the number of times choice was called \dots
\item The term for choice $C_c$ has a link with the \emph{policy} of the learner. Indeed, a policy can be seen as a function of type $M \rightarrow A_{\mathit{RL}} \times M$, where, from an internal memory of the learner, we chose an action in $A_{\mathit{RL}}$ and we can also modify the memory if needed, for example to log this choice. With this policy, it is easy to obtain a computation $C_c$ with the type described above by composing with the continuation $k$.
\item The term for $C_r$ has a link with the update of the value function after a choice. Indeed, learner usually modify their value function after a choice (or a sequence of choices). This can be seen as an update function of type $\type{Real} \times M \rightarrow M$, when we modify the memory (and thus the value function) according to the reward. Here, using a log in the memory can come in handy for most reinforcement learning algorithm to remember which choice is being rewarded. It is then easy to see that, from this update function, we can obtain a computation $C_r$ with the type described above by composing with the continuation $k$.
\end{itemize}
However, the learner will also need additional information from the environment, typically the current observable state or the list of available actions for this state, that is why we can also use the operations of the abstract interface in the computations $C_c$ and $C_r$.
\subsubsection{Hiding the Memory of the Learner}
The concept of this handler for the learner, which is typically a handler with the state monad, is standard but it is not very practical. Indeed, in the type $T \Rightarrow S_M(T)$ we can see that the handled computation needs an initial memory, and the final memory is returned at the end of the computation. However, this handled computation should be done in the main program, and the user cannot provide an initial memory since it is not supposed to know the actual type of memory. Similarly, there is no reason for the user to have direct access to the memory of the learner, so this type $M$ should be hidden in the computation type. So, in practice, we want a handler for the learner of type $T \Rightarrow T$ for any $T$. Fortunately, it is possible to do this from the previous handler, and it is a standard way to make the state invisible. Suppose that the learner provides an initial memory $m_i$. Then, it can define the following handler (with the empty set of handled operations):
$$H_{\mathit{hide}} \equiv \key{handler} \set{\key{return} f \mapsto \key{let} x = f~m_i ~\key{in} \pi_2(x)} $$
with type $S_M(T) \Rightarrow T$ for any $T$. So, by composing this handler with the previous one, we obtain a handler of type $T \Rightarrow T$, and the memory becomes totally hidden from the user. This construction is a way to mimic the $\key{finally}$clause of the \texttt{EFF}\ language, that we used in Section~\ref{s:OurApproach}, using the standard syntax of handler.
\subsubsection{The Interface}
As the previous handler uses additional algebraic operations (the one from the interface), we need to handle them. Also, the previous handler is for the operations $\op{choice}_{\mathit{RL}}$ and $\op{reward}_{\mathit{RL}}$ and we need to make the bridge between those operations and the one for the main program: $\op{choice}$ and $\op{reward}$. We do this by defining two handlers in $\lambda_{\mathit{eff}}^I$.
The first handler is a simple one, mainly abstracting the set of actions. For this, we need to define a bijection $f : A_{\mathit{RL}} \rightarrow A_E$, which is easy to do as they are both finite sets with the same size. Then, the handler for abstracting actions is given by:
\begin{align*}
H_{\mathit{Act}} \equiv \key{handler} \{ \key{return} x &\mapsto \key{return} x, \\
\op{choice}(k) &\mapsto \op{choice}_{\mathit{RL}}(();x. k~(f~x)) \\
\op{reward}(r;k) &\mapsto \op{reward}_{\mathit{RL}}(r;x. k~x) \}
\end{align*}
With this handler $H_{\mathit{Act}}$, with type $T \Rightarrow T$ for any $T$, we can go from the operations from the main program to the operation for the learner. And now the only thing to do in order to successfully use the handler defined by the learner is to define the handler for abstract interface. With the interface we defined for this example, the two operations $\op{observe_{\mathit{RL}}}$ and
$\op{getactions_{\mathit{RL}}}$, then the interface handler would look like:
$$H_{I} \equiv \key{handler} \{ \key{return} x \mapsto \key{return} x, \op{observe}_{\mathit{RL}}(k) \mapsto C_o, \op{getactions}_{\mathit{RL}} (o;k) \mapsto C_a \}$$
with
$$ k : O_{\mathit{RL}} \rightarrow T \vdash C_o : T \qquad o : O_{\mathit{RL}}, k : (A_{\mathit{RL}}~\type{List}) \rightarrow T \vdash C_a : T$$
so that the handler $H_I$ has type $T \Rightarrow T$ for any $T$.
Those computations may use the $\op{observe}$ operation, and so with this handler, that can depend on the environment, we can handle the computations coming from the handler for the learner $H_{\mathit{RL}}$. Now, only two operations remain to be handled $\op{do}$ and $\op{observe}$
\subsubsection{The Environment}
To handle the environment, we only need the types and functions of $\lambda_{\mathit{eff}}^E$, without $\op{reward}$ and $\op{choice}$. The handler for the environment should have the shape:
$$H_{E} \equiv \key{handler} \{ \key{return} x \mapsto C_r, \op{observe}(k) \mapsto C_o, \op{do} (a;k) \mapsto C_a \}$$
such that this handler is typable with type $T \Rightarrow F(T)$ for any type $T$ where $F(T)$ a transformation of $T$. The actual computations for this handler depend strongly on the environment and so we cannot give additional information for the general case. However, in order to illustrate this handler, we show how to implement it in the case where we have a specific model of the environment.
Suppose that we can model the environment by a type $E$ and two functions: $Next_E : A_E \times E \rightarrow E$ and $Observe_E : E \rightarrow O$. This may seem ad-hoc but it is in fact close to a Markov Decision Process which is a common model for the environment in RL algorithm \cite{Sutton2018:ReinforcementLearning}. Indeed, in this case the $Observe_E$ function corresponds to observing a reward and the current state of the Markov Decision Process, and the $Next_E$ function corresponds to moving in the MDP after an action in $A_E$. With those functions, we can define the following handler for the environment:
\begin{align*}
H_{E} \equiv \key{handler} \{ \key{return} x &\mapsto \lambda e. \key{return} (e,x), \\
\op{observe}(k) &\mapsto \lambda e. k~(Observe_E~e)~e \\
\op{do}(a;k) &\mapsto k~()~(Next_E~(a,e)) \}
\end{align*}
with type $T \Rightarrow S_E(T)$ for any $T$. As we saw with the learner, it is possible in this case to hide the type $E$ for the main program. This is what we did for example in the description of the MAB environment in Section~\ref{s:OurApproach}.
\subsubsection{The Main Program with Handlers}
And now, we can interpret all the four main operations for the main program. Thus, given a computation $C$ in $\lambda_{\mathit{eff}}^E$, we can handle all those operations with the computation:
$$\key{with} H_E ~\key{handle} (\key{with} H_I ~\key{handle} (\key{with} H_{\mathit{RL}} ~\key{handle} (\key{with} H_{\mathit{Act}} ~\key{handle} C)))$$
With this composition, that we could see in the main program of Section~\ref{s:OurApproach}, we obtain a handler of type $T \Rightarrow F(T)$ if the learner hides its memory as explained before. And, with a complete model of the environment, by hiding we can then obtain a type $T \Rightarrow T$.
\subsection{A Naive RL Algorithm in \texttt{EFF}}
We present our approach practically with a very basic algorithm for
reinforcement learning, which works by only remembering an evaluation function
keeping track of \emph{the expectation}
of the immediate rewards it receives for any of the actions, and chooses an
action by way of a so-called $\varepsilon$-greedy policy
\cite{Sutton2018:ReinforcementLearning}:
with probability $(1 - \varepsilon)$, it
makes the best possible choice based on the \emph{current} valuation, and
with
probability $\varepsilon$ it explores by choosing an action uniformly at
random. To implement this algorithm, we use the language \texttt{EFF}
~\cite{Pretnar2015:EFF}, an \texttt{OCAML}-based language for effects and handlers. The
syntax of \texttt{EFF}\ should be
understandable to anyone with some basic knowledge on \texttt{OCAML}, effects and
handlers. We use lists for
the sake of simplicity, although other kinds of data structures would enable
better performances. The source code as well as other examples can be found in
\cite{GhyselenEFFCode}.
\paragraph{Declaring The Abstract Interface.}
The first step towards implementing the RL algorithm consists in declaring the
sets $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$ together with the abstract interface which will
allow us to recover some information on the sets $O_{\mathit{RL}}$ and $A_{\mathit{RL}}$:
\begin{lstlisting}[style = eff]
type rl_act
type rl_obs
effect rl_observe : unit -> rl_obs
effect rl_getavailableact : rl_obs -> rl_act list
\end{lstlisting}
Here, the first effect allows the learner to observe the environment (after the
abstraction) and to get, for each observation, the list of available actions it
has to choose from. As we stated before, the learner does \emph{not} have
access to the interpretation of those two effects nor to the actual types, and
only knows that those sets of abstract actions and observations are finite,
this being enough to implement the reinforcement learning algorithm.
\paragraph{Handling Choices and Rewards.}
The handler makes essential use of the state monad, where the state represents
the memory of the learner. For the specific RL algorithm we are targeting now,
this memory consists of an element of this type:
\begin{lstlisting}[style = eff]
type memory = ((rl_obs*((rl_act*int*float) list)) list)*int*int
\end{lstlisting}
The left type of the internal memory corresponds to a \emph{value function}, for each pair of an observable and an action, we give an estimation
of the immediate reward we can obtain. It is computed as the \emph{average}
reward, and in order to do this average incrementally, it is common to also
remember the number of times a choice has been made. Then, the internal memory
also remembers the \emph{last choice made} using a pair of integers denoting
indexes in the evaluation function (we usually denote $na$ the index of an
action and $no$ the index of an observation). Then, we can implement the
$\varepsilon$-greedy policy of the learner (we only describe the important
functions and not the simple intermediate one).
\begin{lstlisting}[style = eff]
(* This function takes as input a probability and a list of reward estimation
and returns the selected action and its index in the list *)
let greedypolicy ($\epsilon$,l) =
if ((randomfloat 1.) <= $\epsilon$) then
(* Uniform choice in this case *)
begin
let na = randomint (list_length l) in
(* Find the action with index na *)
let a = findact l na in
(na,a)
end
else
(* Select the action with the maximal estimated reward *)
argmax l
;;
\end{lstlisting}
And with this, and some other auxiliary functions, we can define the handler
for the basic RL algorithm. The only non-standard clause for the handler is the
last one, starting with $\mathtt{finally}$, in this setting with a state
monad, it should be understood as the initial state for a computation.
\begin{lstlisting}[style = eff]
(*The first input is the probability of exploring,
the second is the initial estimation*)
let rl_naive $\epsilon$ v = handler
(*declare a state monad, with the type described above*)
| y -> (fun (_:memory) -> y)
| effect Choice k -> fun (l,_,_) ->
(*use the interface to get an observation*)
let o = rl_observe () in
(* extract the index no for o, with its list of estimations q *)
let (l',no,q) = getstateestimate l o v in
(* select the action a with the greedy policy *)
let (na,a) = greedypolicy ($\epsilon$,q) in
(*update the estimations*)
let l'' = updatestate l' no (fun ll -> updatechoice ll na) in
(*return action a, with the updated memory*)
(continue k a) (l'',no,na)
| effect (Reward r) k -> fun (l,no,na) ->
(*update estimations for the previous choice (no,na) *)
let l' = updatestate l no (fun q -> updatereward q na r) in
(*give the new memory to the continuation*)
(continue k ()) (l',no,na)
(*initial memory*)
| finally f -> f ([],0,0)
;;
\end{lstlisting}
Note that we initialize the estimations lists only when we see an element of
$O_{\mathit{RL}}$ for the first time. This is standard in RL because there could be an
extremely large set of states, and it may well be that not all of them are
reached --- it may be better to give an initial estimation to a state only when
we actually see this state
(in this program, this is done by the $\mathtt{geststateestimate}$ function).
We do not give the code of the update functions, which is anyway easy to write.
The nice thing of this handler is that it \emph{does not depend} on the
environment, it can of course interact with its environment (using
$\mathtt{rl\_observe}$) but it does so in a modular way, so that this program
can be used in \emph{any environment} in which we would like to experiment this
(admittedly naive) algorithm.
\subsection{The Multi-Armed Bandit in \texttt{EFF}}
We show how to make use of the RL algorithm described in the previous section
on the environment coming from MAB. The first step consists
in declaring the types for $O_E$ and $A_E$. Since rewards are earnings, and our
actions are nothing more than a choice of a specific machine,
we can proceed as follows:
\begin{lstlisting}[style = eff]
type env_obs = float
type env_act = int
\end{lstlisting}
\paragraph{Modeling the Environment}
We model MAB as a program, where we take a very simple
distribution of rewards for the sake of the example. As stated before, the
environment correspond to the handling of $\op{observe}$ and $\op{do}$.
\begin{lstlisting}[style = eff]
type env_state = float
(* The random reward of the machine a.
In a real case, this reward should be obtained
by observing the result of the slot machine *)
let getreward (a:act) = (float_of_int a) +. (randomfloat 10.) ;;
(*max corresponds to the number of slot machines *)
let MAB_handler max = handler
| y -> (fun (_:env_state) -> y)
| effect (Do a) k -> fun _ ->
(* When seeing a valid action a, we compute the gain for the
slot machine a and store the result in the memory *)
if (a > 0) && (a <= max) then (continue k ()) (getreward a)
else raise "This action is not available! \n"
(*An observation corresponds to showing the stored result *)
| effect Observe k -> fun r -> (continue k r) r
(* Initial environment, no rewards observed *)
| finally f -> f 0.
;;
\end{lstlisting}
\paragraph{Implementing the Abstract Interface}
The abstract interface is a handler that implements the types $A_{\mathit{RL}}$ and
$O_{\mathit{RL}}$, and handles the algebraic operations declared by the learner:
\begin{lstlisting}[style = eff]
(* Abstractions Types. The type unit for observations
means that the learner has no information on the environment *)
type rl_obs = unit ;;
type rl_act = int ;;
effect rl_observe : rl_obs
effect rl_getavailableact : rl_obs -> rl_act list
(*Transform a standard observation into an abstract one*)
let abstractobs (o : env_obs) :obs = () ;;
(*The handler describes:
- the abstraction of observations
- the actions available to the learner *)
let abs_MAB max =
let l = list_enumerate 1 (max + 1) in
handler
| effect rl_observe k -> let o = observe () in
continue k (abstractobs o)
| effect (rl_getavailableact o) k -> continue k l
;;
\end{lstlisting}
\paragraph{The Main Program}
With this, we have everything we need to handle the four main operations. In
order to use the learner described above, we can just open the file in which
the RL algorithm is defined and use it as a handler, with the interface
described above. For example, we can write the main program:
\begin{lstlisting}[style = eff]
#use "MAB_Environment.eff" ;;
#use "RL_Naive.eff";;
(*Multi-Armed Bandit with 6 machines *)
with (MAB_handler 6) handle
(*Provides the interface to the learner *)
with (abs_MAB 6) handle
(* Call the Basic RL algorithm described previously *)
with (rl_naive 0.05 10.) handle
(*Start writing your progam with algebraic operations
Here, we do 500 rounds *)
let rec run n r =
if n = 0 then r else
let a = choice () in (do a);
let r' = observe () in
reward r'; run (n-1) (r +. r')
in run 500 0.
;;
\end{lstlisting}
And the point is that if we want to use another learner we only have to load a
different handler for the learner, and this naive learner can be used in any
environment as long as the abstract interface is handled.
\subsection{Algebraic Operations and Effect Typing}
Type and effect systems~\cite{DBLP:conf/birthday/NielsonN99}
endowed traditional type systems with annotations giving information
on what effects are produced during program execution.
For our purposes, we can build upon well-known effect typing systems keeping
track of which operations are handled during a computation~\cite{KammarICFP2013:Handlers}.
Extending the simple type system of Section~\ref{s:Generalization} in this way,
we can then ensure well-typed programs to handle all their algebraic operations.
We now define effect typing for our core calculus and
show how to take advantage of such a typing in the context of a
reinforcement learning problem.
We define an effect signature as a collection of operations and
annotate the type of handlers with those signatures. Formally, leave the
the syntax of terms as in Figure~\ref{f:effgrammar}, but we replace
the one of types as follows:
\begin{align*}
T &::= \type{B} \midd \type{Unit} \midd T \times T \midd T \rightarrow^E T \midd T \effarrow{E}{E} T \\
E &::= \set{\op{op}: T \rightsquigarrow T} \sqcup E \midd \emptyset
\end{align*}
Typing judgments for computations now are of the form $\Gamma
\vdash_E C : T$, with the informal reading that that $C$ has type $T$ in a context where the
only \emph{unhandled} algebraic operations $C$ can possibly perform
are included in $E$. Typing judgments for values, instead,
remain the same (i.e. $\Gamma \vdash V : T$), as values not being executed,
they cannot perform any algebraic operation at all.
The inference system for our new typing judgment is given in Figure~\ref{f:efftypeeffects}.
\begin{figure}
\begin{framed}
\begin{center}
\AXC{}
\UIC{$\Gamma, x : T \vdash x : T$}
\DP
\qquad
\AXC{$\Gamma, x : T_1 \vdash_E C : T_2$}
\UIC{$\Gamma \vdash \lambda x. C : T_1 \rightarrow^E T_2$}
\DP
\qquad
\AXC{$\Gamma \vdash V_1 : T_1$}
\AXC{$\Gamma \vdash V_2 : T_2$}
\BIC{$\Gamma \vdash (V_1,V_2) : T_1 \times T_2$}
\DP
\\
\vspace{3mm}
\AXC{}
\UIC{$\Gamma \vdash () : \type{Unit}$}
\DP
\qquad
\AXC{$c : \type{B} \in \mathcal{C}$}
\UIC{$\Gamma \vdash \underline{c} : \type{B}$}
\DP
\qquad
\AXC{$f : \type{B}_1 \times \cdots \type{B}_n \rightarrow \type{B} \in \mathcal{F}$}
\UIC{$\Gamma \vdash \underline{f} : \type{B}_1 \times \cdots \type{B}_n \rightarrow \type{B}$}
\DP
\qquad
\\
\vspace{3mm}
\AXC{$E_1 = \set{\op{op}_i : T^p_i \rightsquigarrow T^a_i \mid 1 \le i \le n} \sqcup E_f \qquad E_2 = E_2' \sqcup E_f$}
\noLine
\UIC{$(\Gamma, x : T_i^p, k : T_i^a \rightarrow^{E_2} T_c \vdash_{E_2} C_i : T_c)_{1 \le i \le n} \qquad \Gamma, x : T_v \vdash_{E_2} C_r : T_c $}
\UIC{$\Gamma \vdash \key{handler} \{ \key{return} x \mapsto C_r, \op{op}_1(x;k) \mapsto C_1, \dots, \op{op}_n(x;k) \mapsto C_n \} : T_v \effarrow{E_1}{E_2} T_c $}
\DP
\\
\vspace{3mm}
\AXC{$\Gamma \vdash V : T$}
\UIC{$\Gamma \vdash_E \key{return} V : T$}
\DP
\qquad
\AXC{$\Gamma \vdash V : T_1 \times T_2$}
\UIC{$\Gamma \vdash_E \pi_i(V) : T_i$}
\DP
\\
\vspace{3mm}
\AXC{$(\op{op} : T_p \rightsquigarrow T_a) \in E$}
\AXC{$\Gamma \vdash V : T_p$}
\AXC{$\Gamma, x : T_a \vdash_E C : T $}
\TIC{$\Gamma \vdash_E \op{op}(V;x.C) : T$}
\DP
\\
\vspace{3mm}
\AXC{$\Gamma \vdash_E C_1 : T_1 $}
\AXC{$\Gamma, x : T_1 \vdash_E C_2 : T_2 $}
\BIC{$\Gamma \vdash_E \key{let} x = C_1 ~\key{in} C_2 : T_2$}
\DP
\qquad
\AXC{$\Gamma \vdash V_1 : T_2 \rightarrow^E T_1$}
\AXC{$\Gamma \vdash V_2 : T_2$}
\BIC{$\Gamma \vdash_E V_1~V_2 : T_1$}
\DP
\\
\vspace{3mm}
\AXC{$\Gamma \vdash V : T_2 \effarrow{E_1}{E_2} T_1$}
\AXC{$\Gamma \vdash_{E_1} C : T_2$}
\BIC{$\Gamma \vdash_{E_2} \key{with} V ~\key{handle} C : T_1$}
\DP
\end{center}
\end{framed}
\caption{Typing Rules with Type Effects}
\label{f:efftypeeffects}
\end{figure}
The most important rule in Figure~\ref{f:efftypeeffects} is the one for handlers
(cf. the typing rule for open handlers by \citet{KammarICFP2013:Handlers}): it
states that if a handler can handle a subset of the available operations
(denoted by $\set{\op{op}_i : T^p_i \rightsquigarrow T^a_i \mid 1 \le i \le n}$
in Figure~\ref{f:efftypeeffects})
and introduce some new operations in their computations ($E_2'$),
then the final set of free operations contains the unhandled ones in the original set ($E_f$)
together with the new operations introduced by the handler.
This new type system satisfies better safety properties than the previous one. In particular, it enjoys preservation (as the type system of previous section)
and progress.
\begin{theorem}
Progress and preservation hold for the type system in Figure~\ref{f:efftypeeffects}.
That is:
\begin{enumerate}
\item \emph{Preservation.}
If $\Gamma \vdash_E C : T$ and $C \rightarrow C'$ then $\Gamma \vdash_E C' : T$.
\item \emph{Progress.}
Suppose that all functions for base types are total for the constants in
the language. If $\vdash_E C : T$, then either there exists $C'$ such that $C
\rightarrow C'$, or $C$ has the shape $\key{return} V$ for some $V$, or $C$ has
the shape $\op{op}(V,x.C')$ with $\op{op} \in E$.
\end{enumerate}
\end{theorem}
\begin{proof}
We prove progress by induction on $C$. The use of typed effects is important to keep track of what are exactly the set of operations that can appear, and the commutation of $\op{op}$ with $\key{let}$and $\key{handler}$is also essential in this proof. The hypothesis on base type functions ensures that an application of a base type function can always be reduced. The case of $\key{with} H ~\key{handle} C$ is the most interesting one, by induction hypothesis and typing, there are four cases for the computation $C$, either it can be reduced to $C'$, and then we use the first rule for handlers of Figure~\ref{f:effsemantics}, either it is an operation $\op{op} \in E_f$ and we use the second rule, either it is a $\key{return} V$ and we use the third rule, or it is an operation $\op{op} \in E_1/E_f$ and we use the fourth rule.
\end{proof}
\begin{remark}
Even if we have focused on progress and preservation, it is worth mentioning that
that termination of the
reduction relation can be proved using standard methods~\cite{KammarICFP2013:Handlers}.
\end{remark}
We now have all the ingredients needed to encode the informal policies
we could build the MAB example upon. Let us define the following sets of
effects:
\begin{align*}
E_E &= \set{\op{observe}: \type{Unit} \rightsquigarrow O_E ~;~ \op{do} : A_E \rightsquigarrow \type{Unit}} \\
E_{\mathit{RL}} &= \set{\op{choice}: \type{Unit} \rightsquigarrow A_E ~;~ \op{reward} : \type{Real} \rightsquigarrow \type{Unit}} \\
E^{\mathit{Abs}}_{\mathit{RL}} &= \set{\op{choice}_{\mathit{RL}}: \type{Unit} \rightsquigarrow A_{\mathit{RL}} ~;~ \op{reward}_{\mathit{RL}} : \type{Real} \rightsquigarrow \type{Unit}} \\
E^{\mathit{Abs}}_I &= \set{\op{observe}_{\mathit{RL}}: \type{Unit} \rightsquigarrow O_{\mathit{RL}} ~;~ \op{getactions} : O_{\mathit{RL}} \rightsquigarrow A_{\mathit{RL}}~\type{List} ~;~ \cdots}
\end{align*}
These are, respectively, the set of effects for the environment, the learner seen by the environment, the learner seen by the learner, and the interface used by the learner.
\paragraph{The Learner}
The handler $H_{\mathit{RL}}$ for the learner should have the type
$$ \vdash H_{\mathit{RL}} : T \effarrow{E_{\mathit{RL}}^{\mathit{Abs}}}{E_I^{\mathit{Abs}}} S_M(T), $$
where $T$ is any type and $S_M(T) \equiv M \rightarrow M \times T$. This means
that the learner handles the operations $\op{choice}_{\mathit{RL}}$ and
$\op{reward}_{\mathit{RL}}$ using only the operations in the interface $E^{\mathit{Abs}}_I$.
Thus, with this type, we ensure that the learner does not have a direct access
to the environment, and it only sees effects for the abstract types $A_{\mathit{RL}}$ and
$O_{\mathit{RL}}$ and not the concrete types $O_E$ and $A_E$. Then, with hiding, we can
obtain a handler of type $T \effarrow{E_{\mathit{RL}}^{\mathit{Abs}}}{E_I^{\mathit{Abs}}} T$ as long as
the learner provides an initial memory. Notice that in this hiding handler of
type $T \effarrow{E_I^{\mathit{Abs}}}{E_I^{\mathit{Abs}}} T$, the initial memory can depend on
the abstract interface, this being useful in those cases in which some
parameters in the initial memory have to be exposed.
\paragraph{The Interface}
The interface is separated into two handlers: $H_{\mathit{Act}}$ and $H_I$. This first
handler is only a bridge between abstract actions and concrete actions. It is
not difficult to see that the former should have the type:
$$ \vdash H_{\mathit{Act}} : T \effarrow{E_{\mathit{RL}}}{E_{\mathit{RL}}^{\mathit{Abs}}} T, $$
for any type $T$, thus handling the operations $\op{choice}$ and $\op{reward}$ seen from the exterior to the internal one of the learner. As for the interface, it should be a bridge between the environment and learner abstracted by the user, so it should have the type:
$$ \vdash H_{I} : T \effarrow{E_I^{\mathit{Abs}} \sqcup E_E}{E_E} T,$$
where the fixed set of operations ($E_f$ in the rule) would be $E_E$.
\paragraph{The Environment}
As for the environment, the handler only has to handle the two operations $\op{observe}$ and $\op{do}$, without using the learner nor the interface. So, it should have the type:
$$\vdash H_E : T \effarrow{E_E}{\emptyset} F(T).$$
\subsubsection{Composition of Handlers and Main Program}
Now that we have types for each of the four handlers needed, we compose them. An important point of our effect typing is that it supports weakening: in the handler rule, we can always take a larger set $E_f$, so that we are licensed to use the handler in different contexts.\footnote{This is one of the main reasons why this rule is very useful to achieve polymorphism.} In our case, it means that we can give the following types to handlers:
\begin{align*}
\vdash H_{\mathit{RL}} &: T \effarrow{E_{\mathit{RL}}^{\mathit{Abs}} \sqcup E_E}{E_I^{\mathit{Abs}} \sqcup E_E} T \\
\vdash H_{\mathit{Act}} &: T \effarrow{E_{\mathit{RL}} \sqcup E_E}{E_{\mathit{RL}}^{\mathit{Abs}} \sqcup E_E} T \\
\vdash H_I &: T \effarrow{E_I^{\mathit{Abs}} \sqcup E_E}{E_E} T \\
\vdash H_E &: T \effarrow{E_E}{\emptyset} F(T).
\end{align*}
Consequently, we can compose them to obtain:
$$ H_E \circ H_I \circ H_{\mathit{RL}} \circ H_{\mathit{Act}} : T \effarrow{E_{\mathit{RL}} \sqcup E_E}{\emptyset} F(T).$$
When we have a model of the environment, with hiding, we have
$$ H_E \circ H_I \circ H_{\mathit{RL}} \circ H_{\mathit{Act}} : T \effarrow{E_{\mathit{RL}} \sqcup E_E}{\emptyset} T. $$
This shows that the main program can use the four main effects, as expected. Without hiding, we would have a type which is essentially the composition of the two state monads on $E$ and $M$, meaning that the program should be understood in a context with both an environment and a memory for the learner.
\subsection{Polymorphism}
The typing rule for handlers allows us to assign handlers arbitrary types $T$.
To ensure such types not to be inspected by programs, and to ensure uniqueness of
typing derivation of handlers, it is natural to extend our type system with polymorphic types. Moreover, the base types we presented for the language, $A_{\mathit{RL}}, O_{\mathit{RL}}, A_E$ and $O_E$ all depend on the actual environment, whereas we expect the handler $H_{\mathit{RL}}$ for the learner not to do so. Consequently, we may rely on polymorphism to enforce
$A_{\mathit{RL}}$ and $O_{\mathit{RL}}$ not to be inspected, this way giving a unique polymorphic type to the handler $H_{\mathit{RL}}$ and thus ensuring the latter to be usable in any environment.
Languages, however, can be polymorphic in may ways: especially in presence of effects.
We now outline what kind of polymorphism is needed for our purposes.
As a first requirement, we need to be able to declare polymorphic handlers; write their implementation once and for all; and then use them in different contexts. To do that,
we believe having handlers as first-class citizen of the language, as we presented in Figure~\ref{f:effgrammar}, is necessary. Secondly, we also want to declare polymorphic effects,
so to give a sense to those polymorphic handlers.
We take as an inspiration the language by \citet{Biernackietal2019:AbstractingEffects}. However, since the aforementioned language does not consider handlers as first-class citizens, we cannot directly rely on that.
In the rest of this section, we informally outline a possible polymorphic type assignment
for our language, leaving its formal definition and analysis (such as type soundness)
as future work.
We consider different kinds, starting from the base kinds of
types, effects, and rows, and building complex kinds using a functional arrow.
Formally, kinds are generated by the following grammar:
$$\kappa:= T \midd E \midd R \midd \kappa \rightarrow \kappa.$$
A row $\rho$ is a sequence of effects $\langle E_1 \mid \rho' \rangle$, with intuitively the same meaning as effect signature in our last type system, the main difference being that we can have polymorphism on row, and an effect can appear several time in a row (but possibly with different instantiation of their polymorphic types).
We would like to write, as in \cite{Biernackietal2019:AbstractingEffects}, the following computation:
$$\key{effect} E_{\mathit{RL}}^{\mathit{Abs}} = \forall \alpha_A :: T. \set{\op{choice}_{\mathit{RL}} : \type{Unit} \rightsquigarrow \alpha_A ; \op{reward}_{\mathit{RL}} : \type{Real} \rightsquigarrow \type{Unit}} ~\key{in} \cdots $$
declaring a new effect, called $E_{\mathit{RL}}^{\mathit{Abs}}$, waiting for a type $\alpha_A$ representing the type (of kind $T$) of actions, and then declare the types of those two algebraic operations. The kind of $E_{\mathit{RL}}^{\mathit{Abs}}$ would then be $T \rightarrow E$, so given a type of kind $T$ this indeed gives an effect of kind $E$. Similarly, the abstract interface would be declared with:
$$\key{effect} E_{I}^{\mathit{Abs}} = \forall \alpha_A :: T, \alpha_O :: T. \set{\op{observe}_{\mathit{RL}} : \type{Unit} \rightsquigarrow \alpha_O ; \op{getactions}_{\mathit{RL}} : \alpha_O \rightsquigarrow \alpha_A~\type{List}; \cdots} $$
And then, in this context, the type of the handler for the learner, $H_{\mathit{RL}}$ would be, after hiding:
$$ H_{\mathit{RL}} : \forall \alpha_A :: T, \alpha_O :: T, \alpha_T :: T, \rho :: R. \alpha_T \effarrow{\langle E_{\mathit{RL}}^{\mathit{Abs}}~\alpha_A \mid \rho \rangle }{\langle E_{I}^{\mathit{Abs}}~\alpha_A~\alpha_O \mid \rho \rangle} \alpha_T $$
meaning that for any type of actions $\alpha_A$, any type of observations $\alpha_O$, any type of computation $\alpha_T$ and any effect environment $\rho$, the handler for the learner has an identity type on the computation, handling the operations in $E_{\mathit{RL}}^{\mathit{Abs}}~\alpha_A$ and introducing the new operations of $E_I^{\mathit{Abs}}~\alpha_A~\alpha_O$. In practice, we would like $\alpha_A$ and $\alpha_O$ to always represent base types, and especially finite sets, so we would need some more restriction on this polymorphism. But informally, this is the shape of type we would like for the handler written by the learner, as it ensures that it can be used in any environment without modifications. Notice that in order to do this, we want handlers as first-class citizens but we do not need the full power of polymorphism since the algebraic operations themselves do not need to be polymorphic. This kind of polymorphism that we need differs slightly from the polymorphism mainly studied in the literature: usually, it allows the programmer to use different handlers for the same operation, however what we want in our case is to use a unique handler for different contexts.
\subsection{Imposing an Order on Operations}
Our last property of interest focuses on linearity and order of algebraic operations.
For instance, we would like to ensure that when a call to $\op{choice}$ is made, it is always followed by a $\op{do}$ and a $\op{reward}$ ($\op{observe}$ can be useful to give the reward but it is not mandatory as it should have no effect on the environment).
We now outline how such a goal can be achieved in presence of algebraic operations
relying on suitable graded type systems \cite{Kastumata2014:ParametricEffects}.
Such an approach, however, is not readily extendable to effect handlers. As far as we know, graded types have not been extended to handlers.
Informally, we define a monoid on algebraic operations and associate each computation
to an element of this monoid, the latter giving information on
the operations executed during program evaluation.
Sequential composition of computations corresponds to monoid multiplication, basic computations to the unit of the monoid, and algebraic operations to the corresponding
elements of the monoid. A typing rule (for computations) then has shape
$\Gamma \vdash_E C : T ; m$, where $m$ is an element of the monoid with, for example, the following rules:
\begin{center}
\AXC{$\Gamma \vdash V : T$}
\UIC{$\Gamma \vdash_E \key{return} V : T ; 1$}
\DP
\qquad
\AXC{$\Gamma \vdash_E C_1 : T_1 ; m_1$}
\AXC{$\Gamma, x : T_1 \vdash_E C_2 : T_2 ; m_2$}
\BIC{$\Gamma \vdash_E \key{let} x=C_1 ~\key{in} C_2 : T_2 : m_1 \cdot m_2 $}
\DP
\\
\vspace{3mm}
\AXC{$(\op{op} : T_p \rightsquigarrow T_a) \in E$}
\AXC{$\Gamma \vdash V : T_p$}
\AXC{$\Gamma, x : T_a \vdash_E C : T ; m$}
\TIC{$\Gamma \vdash_E \op{op}(V;x.C) : T ; m_{\op{op}} \cdot m$}
\DP
\end{center}
where $1$ is the unit of the monoid, $m_1 \cdot m_2$ is monoid multiplication and $m_{\op{op}}$ is the element of the monoid corresponding to the operation $\op{op}$.
In our case, the monoid would be the free monoid on the three element associated to the algebraic operations $\op{choice}, \op{do}$ and $\op{reward}$, with $\op{observe}$ confounded with the unit of the monoid, with the following equation
\begin{align*}
&m_\op{choice} \cdot m_\op{do} \cdot m_\op{reward} = 1
\end{align*}
and then, we would like the main program to be associated to an element of this monoid with the shape $m_\op{do}^n$. With this, we can ensure that, if we forget about $\op{observe}$ since it has no effect at all, then any $\op{choice}$ is always followed by exactly one $\op{do}$ and one $\op{reward}$. Moreover, only the $\op{do}$ operation can be done outside of this loop, because essentially the user can make choices without calling the learner, and for the point of view of the learner then the user would just be a part of the transition function of the environment.
However, this method, which is standard for effects, does not generalise well in presence of handlers. Indeed, we need to take into account the potentially new operations introduced by a handler, and intuitively the handler would then represent a map from the new operations to an element of the monoid. For a very simple example, consider the operation $\op{choicedoandobserve} : 1 \rightsquigarrow A_E \times O_E$ with the handler
$$\key{handler} \set{\key{return} x \mapsto x ; \op{choicedoandobserve}(k) \mapsto \op{choice}(a. \op{do}(a;\_. \op{observe}(o. k~(a,o))))}$$
doing the three operations $\op{choice}$, $\op{do}$ and $\op{observe}$ in sequence. Then, this handler should be typed with the information that the new operation $\op{choicedoandobserve}$ is associated to the element $m_\op{choice} \cdot m_\op{do} \cdot m_\op{observe}$.
We believe such a type system should be feasible, but we have no concrete formalization of this. So, as for polymorphism, those kind of type system would be desirable for safety but we leave the formalization to future work.
\section{Related Work}
The interaction between programming language theory and machine
learning is an active and flourishing research area.
Arguably, the current, most well-established products of such an
interaction are the so-called Bayesian~\cite{tran2016edward,tran2017deep,
Tolpin/Anglican/2016,DBLP:journals/jmlr/BinghamCJOPKSSH19,JSSv076i01}
and differentiable~\cite{Bergstra10theano,DBLP:conf/osdi/AbadiBCCDDDGIIK16}
programming languages, and their associated
theories~\cite{DBLP:conf/popl/Goodman13,DBLP:journals/corr/abs-1809-10756,DBLP:journals/pacmpl/AbadiP20,DBLP:journals/toplas/PearlmutterS08,DBLP:journals/lisp/SiskindP08}.
Choice-based operations are not new in programming language theory, as they
first appeared in the context of computational effects (more specifically, choice operations has been first studied as nondeterministic choices~\cite{DBLP:conf/aieeire/000161}).
However, their integration with reward constructs as a way to
structure machine learning systems as data-driven, decision-making processes is quite recent.
As an example of that, the programming language \textsf{SmartChoice}~\cite{Carbune2019:PredictedVariables} integrates choice and rewards operations
with traditional programming constructs.
To the best of the authors' knowledge, the first work dealing with
semantic foundations for choice-based programming languages is the recent
work by \citet{DBLP:conf/lics/AbadiP21}. There, a modular
approach to higher-order choice-based
programming languages is developed in terms of
the selection monad~\cite{DBLP:conf/cie/EscardoO10a,DBLP:conf/csl/EscardoOP11,
DBLP:journals/apal/EscardoO12} and its algebraic
operations~\cite{PlotkinPower/FOSSACS/01,
PlotkinPower2003:AlgebraicOperations,PlotkinPower/FOSSACS/02},
both at the level of operational and denotational
semantics. As such, that work is the closest to ours.
The results presented in this paper has been obtained starting from
an investigation of possible applications
of the aforementioned work by Abadi and Plotkin to modelling reinforcement
learning systems. We have explained in Section~\ref{selection-monad}
why, when dealing with reinforcement learning, moving from the selection
to the state monad is practically beneficial.
From a theoretical point of view,
such a shift can be seen as obtained by
looking at comodels~\cite{DBLP:journals/entcs/PowerS04} of choice operations,
which directly leads to view reinforcement learning algorithms as ultimately
defining stateful runners~\cite{DBLP:journals/entcs/Uustalu15,DBLP:conf/esop/AhmanB20}
for such operations, and thus as generic effects \cite{PlotkinPower2003:AlgebraicOperations}
for the state monad. Following this path, we have consequently relied on handlers~\cite{PlotkinPretnar/handling-algebraic-effects-2013,
Bauer-Pretnar/Programming-with-algebraic-effects,
Pretnar2015:EFF} to define modular implementations
of such generic effects, and thus of reinforcement learning algorithms.
Even if handlers and algebraic operations are well-known tools in
functional programming, to the best of our knowledge the present
work is the first one investigating their application to
modelling reinforcement learning systems.
Finally, we mention that applications of functional programming techniques in
the context of machine learning similar in spirit to ones investigated in this work,
as well as in the work by \citet{DBLP:conf/lics/AbadiP21},
have been proposed \cite{DBLP:conf/flops/CheungDGMR18}
in terms of induction and abduction constructs, rather
than in terms of choices and rewards
\section{Introduction}
\input{Introduction.tex}
\section{Structuring Reinforcement Learning Applications Through Functional
Programming}
\label{s:OurApproach}
\input{OurApproach.tex}
\section{The Selection Monad, and Why it is Not an Answer}
\label{selection-monad}
\input{Selection.tex}
\section{From Practice to Theory: Effects and Handlers}
\label{s:Generalization}
\input{Generalization.tex}
\section{Type Safety}
\input{Safety.tex}
\section{Conclusion}
\input{Conclusion.tex}
| {'timestamp': '2022-03-30T02:30:03', 'yymm': '2203', 'arxiv_id': '2203.15426', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15426'} | arxiv |
\section*{Introduction}
The explosion of available biological sequence data has led to multiple computational approaches aiming to infer three-dimensional structure, biological function, fitness, and evolutionary history of proteins from sequence data~\cite{deJuan13,Cocco18}.
Recently, self-supervised deep learning models based on natural language processing methods, especially attention~\cite{Bahdanau14} and transformers~\cite{Vaswani17}, have been trained on large ensembles of protein sequences by means of the masked language modeling objective of filling in masked amino acids in a sequence, given the surrounding ones \cite{ElnaggarPreprint,Rives21,rao2021transformer,Choromanski20,Madani20,Madani21}.
These models, which capture long-range dependencies, learn rich representations of protein sequences, and can be employed for multiple tasks.
In particular, they can predict structural contacts from single sequences in an unsupervised way~\cite{rao2021transformer}, presumably by transferring knowledge from their large training set~\cite{Bhattacharya22}.
Neural network architectures based on attention are also employed in the Evoformer blocks in AlphaFold~\cite{Jumper21}, as well as in RoseTTAFold~\cite{Baek21} and RGN2~\cite{Chowdhury21}, and they contributed to the recent breakthrough in the supervised prediction of protein structure.
Protein sequences can be classified in families of homologous proteins, that descend from an ancestral protein and share a similar structure and function.
Analyzing multiple sequence alignments (MSAs) of homologous proteins thus provides substantial information about functional and structural constraints~\cite{deJuan13}.
The statistics of MSA columns, representing amino-acid sites, allow to identify functional residues that are conserved during evolution, and correlations of amino-acid usage between columns contain key information about functional sectors and structural contacts~\cite{Casari95,Socolich05,Dunn08,Halabi09}.
Indeed, through the course of evolution, contacting amino acids need to maintain their physico-chemical complementarity, which leads to correlated amino-acid usages at these sites: this is known as coevolution.
Potts models, also known as Direct Coupling Analysis (DCA), are pairwise maximum entropy models trained to match the empirical one- and two-body frequencies of amino acids observed in the columns of an MSA of homologous proteins~\cite{Lapedes99,Weigt09,Marks11,Morcos11,Sulkowska12,Ekeberg13,Ekeberg14,Figliuzzi18,Cocco18}.
They capture the coevolution of contacting amino acids, and they provided state-of-the-art unsupervised predictions of structural contacts before the advent of protein language models.
Note that coevolutionary signal also aids supervised contact prediction~\cite{Abriata18}.
While most protein language neural networks take individual amino-acid sequences as inputs, some others have been trained to perform inference from MSAs of evolutionarily related sequences.
This second class of networks includes MSA Transformer~\cite{rao2021msa} and the Evoformer blocks in AlphaFold~\cite{Jumper21}, both of which interleave row (i.e.\ per-sequence) attention with column (i.e.\ per-site) attention.
Such an architecture is conceptually extremely attractive because it can incorporate coevolution in the framework of deep learning models using attention.
In the case of MSA Transformer, simple combinations of the model's row attention heads have led to state-of-the-art unsupervised structural contact predictions, outperforming both language models trained on individual sequences and Potts models~\cite{rao2021msa}.
Beyond structure prediction, MSA Transformer is also able to predict mutational effects~\cite{meier2021language,hie2022evolutionary} and to capture fitness landscapes~\cite{HawkinsPreprint}.
In addition to coevolutionary signal caused by structural and functional constraints, MSAs feature correlations that directly stem from the common ancestry of homologous proteins, i.e.\ from phylogeny.
Does MSA Transformer learn to identify phylogenetic relationships between sequences, which are a key aspect of the MSA data structure?
Here, we show that simple, and universal, combinations of MSA Transformer's column attention heads, computed on a given MSA, strongly correlate with the Hamming distances between sequences in that MSA.
This demonstrates that MSA Transformer encodes detailed phylogenetic relationships.
Is MSA Transformer able to separate coevolutionary signals encoding functional and structural constraints from phylogenetic correlations arising from historical contingency?
To address this question, we generate controlled synthetic MSAs from Potts models trained on natural MSAs, either without or with phylogeny.
For this, we perform Metropolis Monte Carlo sampling under the Potts Hamiltonians, either at equilibrium or along phylogenetic trees inferred from the natural MSAs.
Using the top Potts model couplings as proxies for structural contacts, we demonstrate that unsupervised contact prediction via MSA Transformer is substantially more resilient to phylogenetic noise than contact prediction using inferred Potts models.
\section*{Results}
\subsection*{Column attention heads capture Hamming distances in separate MSAs}
\label{subsec:results_separate_hamming}
We first considered separately each of 15 different Pfam seed MSAs (see \qnameref{subsec:datasets} and \cref{tab:MSA}), corresponding to distinct protein families, and asked whether MSA Transformer has learned to encode phylogenetic relationships between sequences in its attention layers.
To test this, we split each MSA randomly into a training and a test set, and train a logistic model [\cref{eq:logistic_model_defn,eq:logistic_model_loss}] based on the column-wise means of MSA Transformer's column attention heads on all pairwise Hamming distances in the training set -- see \cref{fig:msa_transformer_and_hamming_regr_schematics} for a schematic, and \qnameref{subsec:methods_supervised_hamming} for details.
\cref{fig:mean_cols_regr_results} shows the results of fitting these specialized logistic models.
\begin{figure}[htbp]
\centering
\includegraphics{MSA_Transformer_regression_schematic_v3}
\caption{\textbf{MSA Transformer: column attentions and Hamming distances.} \textbf{(a)} MSA Transformer is trained using the masked language modeling objective of filling in randomly masked residue positions in MSAs.
For each residue position in an input MSA, it assigns attention scores to all residue positions in the same row (sequence) and column (site) in the MSA.
These computations are performed by 12 independent row/column attention heads in each of 12 successive layers of the network.
\textbf{(b)} Our approach for Hamming distance matrix prediction from the column attentions computed by the trained MSA Transformer model, using a natural MSA as input.
For each $i = 1, \ldots, M$, $j = 0, \ldots, L$ and $l = 1, \ldots, 12$, the embedding vector $x_{ij}^{(l)}$ is the $i$-th row of the matrix $X_{j}^{(l)}$ defined in the main text, and the column attentions are computed according to \cref{eq:query_key_values,eq:col_attn}.}
\label{fig:msa_transformer_and_hamming_regr_schematics}
\end{figure}
For all alignments considered, large regression coefficients concentrate in early layers in the network, and single out some specific heads consistently across different MSAs -- see \cref{subfig:mean_cols_regr_plots}, first and second columns, for results on four example MSAs.
These logistic models reproduce the Hamming distances in the training set very well, and successfully predict those in the test set -- see \cref{subfig:mean_cols_regr_plots}, third and fourth columns, for results on four example MSAs.
Note that the block structures visible in the Hamming distance matrices, and well reproduced by our models, come from the phylogenetic ordering of sequences in our seed MSAs, see \qnameref{subsec:datasets}.
Quantitatively, in all the MSAs studied, the coefficients of determination ($R^2$) computed on the test sets are above $0.84$ in all our MSAs -- see \cref{subfig:mean_cols_regr_table}.
A striking result from our analysis is that the regression coefficients appear to be similar across MSAs -- see \cref{subfig:mean_cols_regr_plots}, first column.
To quantify this, we computed the Pearson correlations between the regression coefficients learnt on the larger seed MSAs.
\cref{fig:mean_cols_regr_coeffs_pearson_corr} demonstrates that regression coefficients are indeed highly correlated across these MSAs.
\begin{figure}[htbp]
\centering
\begin{subfigure}[h]{0.73\textwidth}
\centering
\includegraphics[width=\textwidth]{mean_cols_regr_results_shifted_idx}
\caption{\label{subfig:mean_cols_regr_plots}}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.25\textwidth}
\centering
\begin{tabular}{ll}
\toprule
\multicolumn{1}{c}{Family} & \multicolumn{1}{c}{$R^2$} \\
\midrule
PF00004 & 0.97 \\
PF00005 & 0.99 \\
PF00041 & 0.98 \\
PF00072 & 0.99 \\
PF00076 & 0.98 \\
PF00096 & 0.94 \\
PF00153 & 0.95 \\
PF00271 & 0.94 \\
PF00397 & 0.84 \\
PF00512 & 0.94 \\
PF00595 & 0.98 \\
PF01535 & 0.86 \\
PF02518 & 0.92 \\
PF07679 & 0.99 \\
PF13354 & 0.99 \\
\bottomrule
\end{tabular}
\caption{\label{subfig:mean_cols_regr_table}}
\end{subfigure}
\caption{\textbf{Fitting logistic models to predict Hamming distances separately in each MSA.} The column-wise means of MSA Transformer's column attention heads are used to predict normalised Hamming distances as probabilities in a logistic model.
Each MSA is randomly split into a training set comprising $70\%$ of its sequences and a test set composed of the remaining sequences.
For each MSA, a logistic model is trained on all pairwise distances in the training set. \subref{subfig:mean_cols_regr_plots} Regression coefficients are shown for each layer and attention head (first column), as well as their absolute values averaged over heads for each layer (second column).
For four example MSAs, ground truth Hamming distances are shown in the upper triangle (blue) and predicted Hamming distances in the lower triangle and diagonal (green), for the training and test sets (third and fourth columns).
Darker shades correspond to larger Hamming distances. \subref{subfig:mean_cols_regr_table} $R^2$ coefficients of determination for the predictions by each fitted model on its respective test set.}
\label{fig:mean_cols_regr_results}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics[width=0.3\textwidth]{mean_cols_regr_coeffs_pearson_corr}
\caption{\textbf{Pearson correlations between regression coefficients in larger MSAs.} Sufficiently deep ($\geq 100$ sequences) and long ($\geq 30$ residues) MSAs are considered (mean/min/max Pearson correlations: $0.80$/$0.69$/$0.87$).}
\label{fig:mean_cols_regr_coeffs_pearson_corr}
\end{figure}
\clearpage
\subsection*{MSA Transformer learns a universal representation of Hamming distances}
\label{subsec:results_common_hamming}
Given the substantial similarities between our models trained separately on different MSAs, we next asked whether a common model across MSAs could capture Hamming distances within generic MSAs.
To address this question, we trained a single logistic model, based on the column-wise means of MSA Transformer’s column attention heads, on all pairwise distances within each of the first 12 of our seed MSAs.
We assessed its ability to predict Hamming distances in the remaining 3 seed MSAs, which thus correspond to entirely different Pfam families from those in the training set.
\cref{fig:mean_cols_regr_results_many_msas} shows the coefficients of this regression (first and second panels), as well as comparisons between predictions and ground truth values for the Hamming distances within the three test MSAs (last three panels).
We observe that large regression coefficients again concentrate in the early layers of the model, but somewhat less than in individual models.
Furthermore, the common model captures well the main features of the Hamming distance matrices in test MSAs.
\begin{figure}[htbp]
\centering
\includegraphics[width=\textwidth]{mean_cols_regr_results_many_msas_shifted_idx_v2}
\caption{\textbf{Fitting a single logistic model to predict Hamming distances.}
Our collection of $15$ MSAs is split into a training set comprising $12$ of them and a test set composed of the remaining $3$.
A logistic regression is trained on all pairwise distances within each MSA in the training set.
Regression coefficients (first panel) and their absolute values averaged over heads for each layer (second panel) are shown as in \cref{fig:mean_cols_regr_results}.
For the three test MSAs, ground truth Hamming distances are shown in the upper triangle (blue) and predicted Hamming distances in the lower triangle and diagonal (green), also as in \cref{fig:mean_cols_regr_results} (last three panels).
We further report the $R^2$ coefficients of determination for the regressions on these test MSAs -- see also \cref{tab:mean_cols_regr_results_many_msas_fit_quality}.}
\label{fig:mean_cols_regr_results_many_msas}
\end{figure}
In \cref{tab:mean_cols_regr_results_many_msas_fit_quality}, we quantify the quality of fit for this model on all our MSAs.
In all cases, we find very high Pearson correlation between the predicted distances and the ground truth Hamming distances.
Furthermore, the median value of the $R^2$ coefficient of determination is 0.6, confirming the good quality of fit.
In the three shortest and the two shallowest MSAs, the model performs below this median, while all MSAs for which $R^2$ is above median satisfy $M \geq 52$ and $L \geq 67$.
We also compute, for each MSA, the slope of the linear fit when regressing the ground truth Hamming distances on the distances predicted by the model.
MSA depth is highly correlated with the value of this slope (Pearson $r \approx 0.95$).
This bias may be explained by the under-representation in the training set of Hamming distances and attention values from shallower MSAs, as their number is quadratic in MSA depth.
Ref.~\cite{rao2021msa} showed that some column attention matrices, summed along one of their dimensions, correlate with phylogenetic sequence weights (see \qnameref{subsec:methods_supervised_hamming}). This indicates that the model is, in part, attending to maximally diverse sequences.
Our study demonstrates that MSA Transformer actually learns pairwise phylogenetic relationships between sequences, beyond these aggregate phylogenetic sequence weights.
It also suggests an additional mechanism by which the model may be attending to these relationships, focusing on similarity instead of diversity.
Indeed, while our regression coefficients with positive sign in \cref{fig:mean_cols_regr_results_many_msas} are associated with (average) attentions that are positively correlated with the Hamming distances, we also find several coefficients with large negative values.
They indicate the existence of important negative correlations: in those heads, the model is actually attending to pairs of similar sequences.
Besides, comparing our \cref{subfig:mean_cols_regr_plots,fig:mean_cols_regr_results_many_msas} with Fig.~5 in Ref.~\cite{rao2021msa} shows that different attention heads are important in our study versus in the analysis of Ref.~\cite[Sec.\ 5.1]{rao2021msa}.
Specifically, here we find that the fifth attention head in the first layer in the network is associated with the largest positive regression coefficient, while the sixth one was most important there.
Moreover, still focusing on the first layer of the network, the other most prominent heads here were not significant there.
MSA Transformer's ability to focus on similarity may also explain why its performance at predicting mutational effects can decrease significantly when using MSAs which include a duplicate of the query sequence~\cite[Supplementary Fig.~9 and Table~10]{meier2021language}: in these cases, the model predicts masked tokens with very high confidence using information from the duplicate sequence.
How much does the ability of MSA Transformer to capture phylogenetic relationships arise from its training?
To address this question, we trained a common logistic model as above to predict Hamming distances, but using column attention values computed from a randomly re-initialized version of the MSA Transformer network.
We used the same protocol as in MSA Transformer's original pre-training to randomly initialize the entries of the network's row- and column-attention weight matrices $W_\mathrm{\mathrm{Q}}^{(l, h)}$, $W_\mathrm{\mathrm{K}}^{(l, h)}$ and $W_\mathrm{\mathrm{V}}^{(l, h)}$ (see \qnameref{subsec:MSA-Tr_attn}), as well as the entries of the matrix used to embed input tokens, the weights in the feed-forward layers, and the positional encodings.
Specifically, we sampled these entries (with the exception of bias terms and of the embedding vector for the padding token, which were set to zero) from a Gaussian distribution with mean $0$ and standard deviation $0.02$.
The results obtained in this case for our regression task are reported in \cref{tab:mean_cols_regr_results_many_msas_random_init_fit_quality}.
They demonstrate that, although random initialization can yield better performance than random guessing (which may partly be explained by Gordon's Theorem \cite{gordon1988milman}), the trained MSA Transformer gives vastly superior results.
This confirms that the masked language modeling pre-training has driven it towards precisely encoding distances between sequences.
For each layer and attention head in the network, MSA Transformer computes one matrix of column attention values per site -- see \cref{eq:A^lh}.
This is in contrast with row attention, which is tied (see \qnameref{subsec:MSA-Tr_attn}).
Our results are more surprising that they would be if the model's column attentions were also tied.
Indeed, during pre-training, by tuning its row-attention weight matrices to achieve optimal tied attention, MSA Transformer discovers covariance between MSA sites in early layers, and
covariance between MSA sequences is related to Hamming distance.
Finally, to explore the contribution of each column to performance in our regression task, we employed our common logistic model (trained on the means of column attention matrices) to predict Hamming distances using column attentions from individual sites.
We find that the most highly conserved sites (corresponding to columns with low entropy) lead to predictions whose errors have among the smallest standard deviations -- see \cref{tab:low_entropy_table}.
Note that we focused on standard deviations to mitigate the biases of the common logistic model (see above).
This indicates that highly conserved sites lead to more stable predictions.
\subsection*{MSA Transformer efficiently disentangles correlations from contacts and phylogeny}
MSA Transformer is known to capture three-dimensional contacts through its (tied) row attention heads~\cite{rao2021msa}, and we have shown that it also captures Hamming distances, and thus phylogeny, through its column attention heads.
Correlations observed between the columns of an MSA can arise both from coevolution due to functional constraints and from phylogeny (see \cref{fig:coevolution_potts_phylogeny}).
How efficiently does MSA transformer disentangle correlations from contacts and phylogeny?
We address this question in the concrete case of structure prediction.
Because correlations from contacts and phylogeny are always both present in natural data, we constructed controlled synthetic data by sampling from Potts models (\cref{fig:coevolution_potts_phylogeny}(b)), either independently at equilibrium, or along a phylogenetic tree inferred from the natural MSA using FastTree \cite{Price10}.
The Potts models we used were trained on each of 15 full natural MSAs (see \qnameref{subsec:datasets} and \cref{tab:MSA}) using the generative method bmDCA~\cite{Figliuzzi18,Russ20} -- see \qnameref{subsec:methods_phylogeny}.
This setup allows us to compare data where all correlations come from couplings (pure Potts model) to data that comprises phylogenetic correlations on top of these couplings.
For simplicity, let us call ``contacts'' the top scoring pairs of amino-acid sites according to the bmDCA models used to generate our MSAs, and refer to the task of inferring these top scoring pairs as ``contact prediction''.
\begin{figure}[htbp]
\centering
\includegraphics{coevolution_potts_phylogeny_schematic_v2}
\caption{\textbf{Correlations from coevolution and from phylogeny in MSAs.} \textbf{(a)} Natural selection on structure and function leads to correlations between residue positions in MSAs (coevolution).
\textbf{(b)} Potts models, also known as DCA, aim to capture these correlations in their pairwise couplings.
\textbf{(c)} Historical contingency can lead to correlations even in the absence of structural or functional constraints. }
\label{fig:coevolution_potts_phylogeny}
\end{figure}
Contact maps inferred by plmDCA~\cite{Ekeberg13,Ekeberg14} and by MSA Transformer for our synthetic datasets are shown in \cref{fig:contact_prediction_phylo}.
For datasets generated with phylogeny, more false positives, scattered across the whole contact maps, appear in the inference by plmDCA than in that by MSA Transformer.
This is shown quantitatively in \cref{tab:AUC}, which reports the area under the receiver operating characteristic curve (ROC-AUC) for contact prediction for two different cutoffs on the number of contacts.
We also quantify the degradation in performance caused by phylogeny by computing the relative drop $\Delta$ in ROC-AUC due to the injection of phylogeny in our generative process, for each Pfam family and for both plmDCA and MSA Transformer.
On average, $\Delta$ is twice or three times (depending on the cutoff) higher for plmDCA than for MSA Transformer.
We checked that these outcomes are robust to changes in the strategy used to compute plmDCA scores.
In particular, the average $\Delta$ for plmDCA becomes even larger when we average scores coming from independent models fitted on the $10$ subsampled MSAs used for MSA Transformer -- thus using the exact same method as for predicting contacts with MSA Transformer (see \qnameref{par:methods_generation_phylogeny}).
The conclusion is the same if $10$ (or $6$, for Pfam family PF13354) twice-deeper subsampled MSAs are employed.
\begin{table}[htb]
\centering
\begin{tabular}{@{}llllclllclllclll@{}}
\toprule
& \multicolumn{7}{c}{ROC-AUC for $N$ contacts} &\vphantom{}& \multicolumn{7}{c}{ROC-AUC for $2L$ contacts} \\
\cmidrule{2-8} \cmidrule{10-16}
& \multicolumn{3}{c}{plmDCA} &\vphantom{}& \multicolumn{3}{c}{MSA Trans.} && \multicolumn{3}{c}{plmDCA} &\vphantom{}& \multicolumn{3}{c}{MSA Trans.} \\
\cmidrule{2-4} \cmidrule{6-8} \cmidrule{10-12} \cmidrule{14-16}
\multicolumn{1}{c}{Pfam ID} & \multicolumn{1}{c}{Eq.} & \multicolumn{1}{c}{Tree} & \multicolumn{1}{c}{$\Delta$} && \multicolumn{1}{c}{Eq.} & \multicolumn{1}{c}{Tree} & \multicolumn{1}{c}{$\Delta$} && \multicolumn{1}{c}{Eq.} & \multicolumn{1}{c}{Tree} & \multicolumn{1}{c}{$\Delta$} && \multicolumn{1}{c}{Eq.} & \multicolumn{1}{c}{Tree} & \multicolumn{1}{c}{$\Delta$} \\
\midrule
PF00004 & 0.87 & 0.58 & 0.33 && 0.70 & 0.67 & 0.04 && 0.93 & 0.61 & 0.34 && 0.80 & 0.71 & 0.11 \\
PF00005 & 0.93 & 0.67 & 0.28 && 0.79 & 0.76 & 0.03 && 0.96 & 0.74 & 0.23 && 0.81 & 0.82 & $-0.01$ \\
PF00041 & 0.86 & 0.64 & 0.25 && 0.69 & 0.62 & 0.10 && 0.94 & 0.73 & 0.22 && 0.87 & 0.79 & 0.09 \\
PF00072 & 0.94 & 0.73 & 0.23 && 0.86 & 0.77 & 0.10 && 0.99 & 0.85 & 0.14 && 0.94 & 0.87 & 0.08 \\
PF00076 & 0.92 & 0.69 & 0.25 && 0.81 & 0.76 & 0.05 && 0.97 & 0.72 & 0.25 && 0.88 & 0.83 & 0.05 \\
PF00096 & 0.88 & 0.54 & 0.39 && 0.68 & 0.54 & 0.21 && 0.92 & 0.54 & 0.41 && 0.78 & 0.54 & 0.30 \\
PF00153 & 0.95 & 0.71 & 0.26 && 0.83 & 0.63 & 0.24 && 0.98 & 0.77 & 0.21 && 0.90 & 0.65 & 0.28 \\
PF00271 & 0.91 & 0.62 & 0.32 && 0.78 & 0.72 & 0.07 && 0.95 & 0.67 & 0.29 && 0.85 & 0.77 & 0.10 \\
PF00397 & 0.85 & 0.58 & 0.33 && 0.69 & 0.58 & 0.15 && 0.93 & 0.61 & 0.34 && 0.76 & 0.59 & 0.22 \\
PF00512 & 0.94 & 0.74 & 0.21 && 0.84 & 0.77 & 0.08 && 0.97 & 0.78 & 0.20 && 0.88 & 0.81 & 0.08 \\
PF00595 & 0.91 & 0.61 & 0.33 && 0.72 & 0.62 & 0.14 && 0.96 & 0.64 & 0.33 && 0.83 & 0.68 & 0.18 \\
PF01535 & 0.85 & 0.66 & 0.23 && 0.66 & 0.63 & 0.05 && 0.88 & 0.72 & 0.18 && 0.73 & 0.72 & 0.01 \\
PF02518 & 0.93 & 0.69 & 0.27 && 0.82 & 0.75 & 0.09 && 0.98 & 0.78 & 0.20 && 0.90 & 0.79 & 0.12 \\
PF07679 & 0.85 & 0.63 & 0.26 && 0.68 & 0.64 & 0.05 && 0.95 & 0.77 & 0.19 && 0.85 & 0.80 & 0.05 \\
PF13354 & 0.68 & 0.56 & 0.18 && 0.76 & 0.65 & 0.14 && 0.82 & 0.65 & 0.21 && 0.91 & 0.74 & 0.19 \\
\cmidrule{1-16} Average & 0.88 & 0.64 & 0.27 && 0.75 & 0.68 & 0.10 && 0.94 & 0.71 & 0.25 && 0.85 & 0.74 & 0.12 \\
\bottomrule
\end{tabular}
\caption{\textbf{Impact of phylogeny on contact prediction by plmDCA and MSA Transformer.}
We consider synthetic MSAs generated by sampling Potts models either at equilibrium (Eq.) or along inferred phylogenies (Tree).
We report the ROC-AUCs for contact prediction, computed by comparing couplings inferred from our synthetic MSAs using plmDCA and MSA Transformer, with ground-truth proxy contacts consisting of either the $N$ or the $2L$ pairs with top coupling scores according to the Potts models that generated the data (see \qnameref{subsec:methods_phylogeny}).
Here, $N$ denotes the number of pairs of residues that have an all-atom minimal distance smaller than $\SI{8}{\angstrom}$ in the experimental structure in \cref{tab:MSA}, excluding pairs at positions $i, j$ with $| i - j | \leq 4$ (in all cases, $N>2L$).
To assess the impact of phylogenetic noise, we compute $\Delta := (A_{\mathrm{eq}} - A_{\mathrm{tree}}) / A_{\mathrm{eq}}$, where $A_{\mathrm{eq}}$ is the ROC-AUC obtained from the equilibrium MSA and $A_{\mathrm{tree}}$ is the ROC-AUC obtained from the MSA with phylogeny.
\label{tab:AUC}}
\end{table}
These results demonstrate that contact inference by MSA Transformer is less deteriorated by phylogenetic correlations than contact inference by DCA.
This resilience might explain the remarkable result that structural contacts are predicted more accurately by MSA Transformer than by Potts models even when MSA Transformer's pre-training dataset minimizes diversity \cite[Sec.\ 5.1]{rao2021msa}.
\cref{tab:AUC} also shows that plmDCA performs better than MSA Transformer on the synthetic MSAs generated without phylogeny. Because these sequences are sampled independently and at equilibrium from Potts models inferred from the natural MSAs, they are by definition well-described by Potts models. However, these sequences incorporate the imperfections of the inferred Potts models (see the inferred contact maps versus the experimental ones in \cref{fig:contact_prediction_plmDCA}), in addition to lacking the phylogenetic relationships that exist in natural MSAs. These differences with the natural MSAs that were used to train MSA Transformer might explain why it performs less well than plmDCA on these synthetic MSAs, while the opposite holds for natural MSAs (see Ref.~\cite{rao2021msa} and \cref{fig:contact_prediction_plmDCA,fig:contact_prediction_MSA_Transformer}). Note that directly comparing the performance of inference between natural and synthetic data is difficult because the ground-truth contacts are not the same and because synthetic data relies on inferred Potts models and inferred phylogenetic trees with their imperfections. However, this does not impair our comparisons of the synthetic datasets generated without and with phylogeny, or of plmDCA and MSA Transformer on the same datasets. Furthermore, an interesting feature that can be observed in \cref{fig:contact_prediction_phylo}, and is quantified in \cref{tab:ppv_and_md_experimental}, is that MSA Transformer tends to recover the experimental contact maps from our synthetic data generated by bmDCA.
Specifically, some secondary structure features that were partially lost in the bmDCA inference and generation process (see the experimental contact maps in \cref{fig:contact_prediction_plmDCA}) become better defined again upon contact inference by MSA Transformer.
This could be because MSA Transformer has learnt the structure of contact maps, including the spatial compactness and shapes of secondary structures.
\section*{Discussion}
MSA Transformer is known to capture structural contacts through its (tied) row attention heads~\cite{rao2021msa}.
Here, we showed that it also captures Hamming distances, and thus phylogenetic information, through its column attention heads.
This separation of the two signals in the representation of MSAs built by MSA Transformer comes directly from its architecture with interleaved row and column attention heads.
It makes sense, given that some correlations between columns (i.e.\ amino-acid sites) of an MSA are associated to contacts between sites, while similarities between rows (i.e.\ sequences) arise from relatedness between sequences~\cite{Casari95}.
Specifically, we found that simple combinations of column attention heads, tuned to individual MSAs, can predict pairwise Hamming distances between held-out sequences with very high accuracy.
The larger coefficients in these combinations are found in early layers in the network.
More generally, this study demonstrated that the regressions trained on different MSAs had major similarities.
This motivated us to train a single model across a heterogeneous collection of MSAs, and this general model was still found to accurately predict pairwise distances in test MSAs from entirely distinct Pfam families.
This result hints at a universal representation of phylogenetic relationships in MSA Transformer.
Furthermore, our results suggest that the network has learned to quantify phylogenetic relatedness by attending not only to dissimilarity \cite{rao2021msa}, but also to similarity relationships.
Next, to test the ability of MSA Transformer to disentangle phylogenetic correlations from functional and structural ones, we focused on unsupervised contact prediction tasks.
Using controlled synthetic data, we showed that unsupervised contact prediction is more robust to phylogeny when performed by MSA Transformer than by inferred Potts models.
Language models often capture important properties of the training data in their internal representations~\cite{Rogers20}.
For instance, those trained on single protein sequences learn structure and binding sites~\cite{vig2021bertology}, and those trained on chemical reactions learn how atoms rearrange~\cite{Schwaller21}.
Our finding that detailed phylogenetic relationships between sequences are learnt by MSA Transformer, in addition to structural contacts, and in an orthogonal way, demonstrates how precisely this model represents the MSA data structure.
We note that, without language models, analyzing the correlations in MSAs can reveal evolutionary relatedness and sub-families~\cite{Casari95}, as well as collective modes of correlation, some of which are phylogenetic and some functional~\cite{Halabi09}.
Furthermore, Potts models capture the clustered organization of protein families in sequence space~\cite{Figliuzzi18}, and the latent space of variational autoencoder models trained on sequences~\cite{Riesselman18,Ding19,McGee21} qualitatively captures phylogeny~\cite{Ding19}.
Here, we demonstrated the stronger result that detailed pairwise phylogenetic relationships between sequences are quantitatively learnt by MSA Transformer.
Separating coevolutionary signals encoding functional and structural constraints from phylogenetic correlations arising from historical contingency constitutes a key problem in analyzing the sequence-to-function mapping in proteins~\cite{Casari95,Halabi09}.
Phylogenetic correlations are known to obscure the identification of structural contacts by traditional coevolution methods, in particular by inferred Potts models~\cite{Weigt09,Marks11,Qin18,Vorberg18,RodriguezHorta19,RodriguezHorta21}, motivating various corrections~\cite{Lichtarge96,Dunn08,Ekeberg13,Marks11,Morcos11,Hockenberry19,Malinverni20,Colavin22}.
From a theoretical point of view, disentangling these two types of signals is a fundamentally hard problem~\cite{WeinsteinPreprint}.
In this context, the fact that protein language models such as MSA Transformer learn both signals in orthogonal representations, and separate them better than Potts model, is remarkable.
Here, we have focused on Hamming distances as a simple measure of phylogenetic relatedness between sequences.
It would be very interesting to extend our study to other, more detailed, measures of phylogeny.
One may ask whether they are encoded in deeper layers in the network than those most involved in our study.
Besides, we have mainly considered attentions averaged over columns, but exploring in more detail the role of individual columns would be valuable, especially given the impact we found for column entropies.
More generally, our results suggest that the performance of protein language models trained on MSAs could be assessed by evaluating not only how well they capture structural contacts, but also how well they capture phylogenetic relationships.
In addition, the ability of protein language models to learn phylogeny could make them particularly well-suited at generating synthetic MSAs capturing the data distribution of natural ones~\cite{SgarbossaPreprint}.
It also raises the question of their possible usefulness to infer phylogenies and evolutionary histories.
\section*{Methods}
\subsection*{Datasets}
\label{subsec:datasets}
The Pfam database \cite{mistry2021pfam} contains a large collection of related protein regions (families), typically associated to functional units called domains that can be found in multiple protein contexts.
For each of its families, Pfam provides an expert-curated seed alignment that contains a representative set of sequences.
In addition, Pfam provides deeper ``full'' alignments, that are automatically built by searching against a large sequence database using a profile hidden Markov model (HMM) built from the seed alignments.
For this work, we considered $15$ Pfam families, and for each we constructed (or retrieved, see below) one MSA from its seed alignment -- henceforth referred to as the ``seed MSA'' -- and one from its full alignment -- henceforth referred to as the full MSA.
The seed MSAs were created by first aligning Pfam seed alignments (Pfam version 35.0, Nov.\ 2021) to their HMMs using the \texttt{hmmalign} command from the HMMER suite (\url{http://hmmer.org}, version 3.3.2), and then removing columns containing only insertions or gaps.
We retained the original Pfam tree ordering, with sequences ordered according to phylogeny inferred by FastTree \cite{Price10}.
In the case of family PF02518, out of the initial 658 sequences, we kept only the first 500 in order to limit the memory requirements of our computational experiments to less than $64\,$GB.
Of the full MSAs, six (PF00153, PF00397, PF00512, PF01535, PF13354) were created from Pfam full alignments (Pfam version 34.0, Mar.\ 2021), removing columns containing only insertions or gaps, and finally removing sequences where $10 \%$ or more characters were gaps.
The remaining nine full MSAs were retrieved from the online repository \url{https://github.com/matteofigliuzzi/bmDCA} (publication date: Dec.\ 2017) and were previously considered in Ref.~\cite{Figliuzzi18}. These alignments were constructed from full Pfam alignments from an earlier release of Pfam.
An MSA is a matrix $\mathcal{M}$ with $L$ columns, representing the different amino-acid sites, and $M$ rows. Each row $i$, denoted by $\bm{x}^{(i)}$, represents one sequence of the alignment. We will refer to $L$ as the MSA length, and to $M$ as its depth.
For all but one (PF13354) of our full MSAs, $M > 36000$.
Despite their depth, however, our full MSAs include some highly similar sequences due to phylogenetic relatedness, a usual feature of large alignments of homologous proteins.
We computed the effective depth~\cite{Weigt09} of each MSA $\mathcal{M}$ as
\begin{equation}\label{eq:Meff}
M^{(\delta)}_\mathrm{eff} := \sum_{i=1}^M w_i, \quad \text{with} \quad w_i := |\{ i' : d_\mathrm{H}(\bm{x}^{(i)}, \bm{x}^{(i')}) < \delta \}|^{-1},
\end{equation}
where $d_\mathrm{H}(\bm{x}, \bm{y})$ is the (normalized) Hamming distance between two sequences $\bm{x}$ and $\bm{y}$, i.e.\ the fraction of sites where the amino acids differ, and we set $\delta = 0.2$.
While $M^{(0.2)}_\mathrm{eff} / M$ can be as low as $0.06$ for our full MSAs, this ratio is close to 1 for all seed MSAs: it is almost $0.83$ for PF00004, and larger than $0.97$ for all other families.
Finally, for each Pfam domain considered, we retrieved one experimental three-dimensional protein structure, corresponding to a sequence present in the full MSA, from the PDB (\url{https://www.rcsb.org}).
All these structures were obtained by X-ray crystallography and have R-free values between 0.13 and 0.29.
Information about our MSAs is summarized in \cref{tab:MSA}.
All these families have been previously considered in the literature and shown to contain coevolutionary signal detectable by DCA methods~\cite{Figliuzzi18}, making our experiments on contact prediction readily comparable with previous results.
While the precise choice of Pfam families is likely immaterial for our investigation of the column attention heads computed by MSA Transformer, our domains' short lengths are convenient in view of MSA Transformer's large memory footprint -- which is $O(L M^2) + O(L^2)$.
\subsection*{MSA Transformer and column attention}
\label{subsec:MSA-Tr_attn}
We used the pre-trained MSA Transformer model introduced in Ref.~\cite{rao2021msa}, retrieved from the Python Package Index as \texttt{fair-esm 0.4.0}.
We briefly recall that this model was trained, with a variant of the masked language modeling (MLM) objective \cite{devlin2019bert}, on 26 million MSAs constructed from UniRef50 clusters (March 2018 release), and contains 100 million trained parameters.
The input to the model is an MSA with $L$ columns and $M$ rows.
First, the model pre-pends a special beginning-of-sentence token to each row in the input MSA (this is common in language models inspired by the BERT architecture \cite{devlin2019bert}).
Then, each residue (or token) is embedded independently, via a learned mapping from the set of possible amino-acid/gap symbols into $\mathbb{R}^d$ ($d = 768$).
To these obtained embeddings, the model adds two kinds of learned \cite{Rives21} scalar positional encodings \cite{gehring2017convolutional}, designed to allow the model to distinguish between (a) different aligned positions (columns), and (b) between different sequence positions (rows). (Note that removing the latter kind was shown in Ref.~\cite{rao2021msa} to have only limited impact.)
The resulting collection of $M \times (L + 1)$ $d$-dimensional vectors, viewed as an $M \times (L + 1) \times d$ array, is then processed by a neural architecture consisting of $12$ layers.
Each layer is a variant of the axial attention \cite{ho2019axial} architecture, consisting of a multi-headed (12 heads) tied row attention block, followed by a multi-headed (12 heads) column attention block, and finally by a feed-forward network.
(Note that both attention blocks, and the feed-forward network, are in fact preceded by layer normalization \cite{ba2016layer}.)
The roles of row and column attention in the context of the MLM training objective are illustrated in \cref{fig:msa_transformer_and_hamming_regr_schematics}(a). Tied row attention incorporates the expectation that 3D structure should be conserved amongst sequences in an MSA; we refer the reader to \cite{rao2021msa} for technical details.
Column attention works as follows: let $X^{(l)}_{j}$ be the $M \times d$ matrix corresponding to column $j$ in the $M \times (L + 1) \times d$ array output by the row attention block in layer $l$ with $l = 1, \ldots, 12$.
At each layer $l$ and each head $h = 1, \ldots, 12$, the model learns three $d \times d$ matrices $W^{(l, h)}_{\mathrm{Q}}$, $W^{(l, h)}_{\mathrm{K}}$ and $W^{(l, h)}_{\mathrm{V}}$ (note that these matrices, \textit{mutatis mutandis}, could be of dimension $d \times d'$ with $d' \neq d$), used to obtain three $M \times d$ matrices
\begin{equation}\label{eq:query_key_values}
Q^{(l, h)}_{j} = X^{(l)}_j W^{(l, h)}_{\mathrm{Q}}, \quad K^{(l, h)}_{j} = X^{(l)}_j W^{(l, h)}_{\mathrm{K}} , \quad V^{(l, h)}_{j} = X^{(l)}_{j} W^{(l, h)}_{\mathrm{V}},
\end{equation}
whose rows are referred to as ``query'', ``key'', and ``value'' vectors respectively.
The column attention from MSA column $j \in \{0, \ldots, L\}$ (where $j=0$ corresponds to the beginning-of-sentence token), at layer $l$, and from head $h$, is then the $M \times M$ matrix
\begin{equation}\label{eq:col_attn}
A^{(l, h)}_{j} := \mathrm{softmax}_{\mathrm{row}}\left(\frac{Q^{(l, h)}_{j} {K^{(l, h)}_{j}}^\mathrm{T}}{\sqrt{d}} \right),
\end{equation}
where we denote by $\mathrm{softmax}_{\mathrm{row}}$ the application of $\mathrm{softmax}(\xi_1, \ldots \xi_d) = (e^{\xi_{1}}, \ldots, e^{\xi_{d}}) / \sum_{k=1}^d e^{\xi_{k}}$ to each row of a matrix independently, and by $(\cdot)^\mathrm{T}$ matrix transposition.
As in the standard Transformer architecture \cite{Vaswani17}, these attention matrices are then used to compute $M \times d$ matrices $Z^{(l, h)}_{j} = A^{(l, h)}_{j} V^{(l,h)}_{j}$, one for each MSA column $j$ and head $h$.
Projecting the concatenation $Z^{(l, 1)}_{j} \mid \cdots \mid Z^{(l, 12)}_{j}$, a single $M \times d$ matrix $Z^{(l)}_{j}$ is finally obtained at layer $l$.
The collection $(Z^{(l)}_j)_{j=1, \ldots, L}$, thought of as an $M \times (L + 1) \times d$ array, is then passed along to the feed-forward layer.
\subsection*{Supervised prediction of Hamming distances}
\label{subsec:methods_supervised_hamming}
Row $i$ of the column attention matrices $A^{(l, h)}_{j}$ in \cref{eq:col_attn} consists of $M$ positive weights summing to one -- one weight per row index $i'$ in the original MSA.
According to the usual interpretation of the attention mechanism \cite{Bahdanau14, Vaswani17}, the role of these weights may be described as follows: When constructing a new internal representation (at layer $l$) for the row-$i$, column-$j$ residue position, the network distributes its focus, according to these weights, among the $M$ available representation vectors associated with each MSA row-$i'$, column-$j$ residue position (including $i' = i$).
Since row attention precedes column attention in the MSA Transformer architecture, we remark that, even at the first layer, the row-$i'$, column-$j$ representation vectors that are processed by that layer's column attention block can encode information about the entire row $i'$ in the MSA.
In~\cite[Sec.\ 5.1]{rao2021msa}, it was shown that, for some layers $l$ and heads $h$, averaging the $M \times M$ column attention matrices $A^{(l, h)}_{j}$ in \cref{eq:col_attn} from all MSA columns $j$, and then averaging the result along the first dimension, yields $M$-dimensional vectors whose entries correlate reasonably well with the phylogenetic sequence weights $w_i$ defined in \cref{eq:Meff}.
Larger weights are, by definition, associated with less redundant sequences, and MSA diversity is known to be important for coevolution-based methods -- particularly in structure prediction tasks.
Thus, these correlations can be interpreted as suggesting that the model is, in part, explicitly attending to a maximally diverse set of sequences.
Beyond this, we hypothesize that MSA Transformer may have learned to quantify and exploit phylogenetic correlations in order to optimize its performance in the MLM training objective of filling in randomly masked residue positions.
To investigate this, we set up regression tasks in which, to predict the Hamming distance $y$ between the $i$-th and the $i'$-th sequence in an MSA $\mathcal{M}$ of length $L$, we used the entries $a^{(l, h)}_{i, i'}$ at position $(i, i')$ (henceforth $a^{(l, h)}$ for brevity) from the $144$ matrices
\begin{equation}
\label{eq:A^lh}
\bm{A}^{(l, h)} := \frac{1}{2(L + 1)}\sum_{j = 0}^L \left(A^{(l, h)}_{j} + {A^{(l, h)}_{j}}^{\mathrm{T}} \right), \quad \text{with} \quad 1 \leq l \leq 12 \text{ and } 1 \leq h \leq 12.
\end{equation}
These matrices are obtained by averaging, across all columns $j = 0, \ldots, L$, the symmetrised column attention maps $A^{(l, h)}_{j}$ computed by MSA Transformer, when taking $\mathcal{M}$ as input.
We highlight that column $j = 0$, corresponding to the beginning-of-sentence token, is included in the average defining $\bm{A}^{(l, h)}$.
We fit fractional logit models via quasi-maximum likelihood estimation \cite{papke1996econometric} using the \texttt{statsmodels} package (version 0.13.2) \cite{seabold2010statsmodels}.
Namely, we model the relationship between the Hamming distance $y$ and the aforementioned symmetrised, and averaged, attention values $\bm{a} = (a^{(1,1)}, \ldots, a^{(12,12)})$, as
\begin{equation}
\label{eq:logistic_model_defn}
\mathbb{E}[y \, | \, \bm{a}] = G_{\beta_0, \, \bm{\beta}}(\bm{a}), \quad \text{with} \quad G_{\beta_0, \, \bm{\beta}}(\bm{a}) := \sigma\left( \beta_0 + \bm{a} \bm{\beta}^{\mathrm{T}} \right),
\end{equation}
where $\mathbb{E}[ \, \cdot \, | \, \cdot \, ]$ denotes conditional expectation, $\sigma(x) = (1 + e^{-x})^{-1}$ is the standard logistic function, and the coefficients $\beta_0$ and $\bm{\beta} = (\beta_1, \ldots, \beta_{144})$ are determined by maximising the sum of Bernoulli log-likelihoods
\begin{equation}
\label{eq:logistic_model_loss}
\ell(\beta_0, \bm{\beta} \, | \, \bm{a}, y) = y \log[G_{\beta_0, \, \bm{\beta}}(\bm{a})] + (1 - y) \log[1 - G_{\beta_0, \, \bm{\beta}}(\bm{a})],
\end{equation}
evaluated over a training set of observations of $y$ and $\bm{a}$.
Note that this setup is similar to logistic regression, but allows for the dependent variable to take real values between $0$ and $1$ (it can be equivalently described as a generalized linear model with binomial family and logit link).
For simplicity, we refer to these fractional logit models simply as ``logistic models''.
Our general approach to predict Hamming distances is illustrated in \cref{fig:msa_transformer_and_hamming_regr_schematics}(b).
Using data from our seed MSAs (cf.\ \cref{tab:MSA}), we performed two types of regression tasks.
In the first one, we randomly partitioned the set of row indices in each separate MSA $\mathcal{M}$ into two subsets $I_{\mathcal{M}, \, \mathrm{train}}$ and $I_{\mathcal{M}, \, \mathrm{test}}$, with $I_{\mathcal{M}, \, \mathrm{train}}$ containing $70\%$ of the indices.
We then trained and evaluated one model for each $\mathcal{M}$, using as training data the Hamming distances, and column attentions, coming from (unordered) pairs of indices in $I_{\mathcal{M}, \, \mathrm{train}}$, and as test data the Hamming distances, and column attentions, coming from pairs of indices in $I_{\mathcal{M}, \, \mathrm{test}}$.
The second type of regression task was a single model fit over a training dataset consisting of all pairwise Hamming distances, and column attentions, from the first 12 of our 15 MSAs.
We then evaluated this second model over a test set constructed in an analogous way from the remaining 3 MSAs.
\subsection*{Synthetic MSA generation via Potts model sampling along inferred phylogenies} \label{subsec:methods_phylogeny}
To assess the performance of MSA Transformer at disentangling signals encoding functional and structural (i.e.\ fitness) constraints from phylogenetic correlations arising from historical contingency, we generated and studied controlled synthetic data.
Indeed, disentangling fitness landscapes from phylogenetic history in natural data poses a fundamental challenge \cite{WeinsteinPreprint} -- see \cref{fig:coevolution_potts_phylogeny} for a schematic illustration.
This makes it very difficult to assess the performance of a method at this task directly on natural data, because gold standards where the two signals are well-separated are lacking.
We resolved this conundrum by generating synthetic MSAs according to well-defined dynamics such that the presence of phylogeny can be controlled.
First, we inferred unrooted phylogenetic trees from our full MSAs (see \qnameref{subsec:datasets}), using FastTree version 2.1 \cite{Price10} with its default settings.
Our use of FastTree is motivated by the depth of the full MSAs, which makes it computationally prohibitive to employ more precise inference methods.
Deep MSAs are needed for the analysis described below, since it relies on accurately fitting Potts models.
Then, we fitted Potts models on each of these MSAs using bmDCA \cite{Figliuzzi18} (\url{https://github.com/ranganathanlab/bmDCA}, version 0.8.12) with its default hyperparameters.
These include, in particular, regularization strengths for the Potts model fields and couplings, both set at $\lambda = 10^{-2}$.
With the exception of family PF13354, we trained all models for $2000$ iterations and stored the fields and couplings at the last iteration; in the case of PF13354, we terminated training after $1480$ iterations.
In all cases, we verified that, during training, the model's loss had converged.
The choice of bmDCA is motivated by the fact that, as has been shown in Refs.~\cite{Figliuzzi18, Russ20}, model fitting on natural MSAs using Boltzmann machine learning yields Potts models with good generative power.
This sets it apart from other DCA inference methods, especially pseudo-likelihood DCA (plmDCA)~\cite{Ekeberg13, Ekeberg14}, which is the DCA standard for contact prediction, but cannot faithfully reproduce empirical one- and two-body marginals, making it a poor choice of a generative model~\cite{Figliuzzi18}.
Using the phylogenetic trees and Potts models inferred from each full MSA, we generated synthetic MSAs without or with phylogeny, as we now explain.
In the remainder of this subsection, let $\mathcal{M}$ denote an arbitrary MSA from our set of full MSAs, $L$ its length, and $M$ its depth.
Consider a sequence of $L$ amino-acid sites.
We denote by $x_i \in \{1, \dots, q\}$ the state of site $i \in \{1, \dots, L\}$, where $q=21$ is the number of possible states, namely the 20 natural amino acids and the alignment gap.
A general Potts model Hamiltonian applied to a sequence $\bm{x} = (x_1, \ldots, x_{L})$ reads
\begin{equation}
H(\bm{x}) = -\sum_{i=1}^{L}h_{i}(x_i) - \sum_{j=1}^{L}\sum_{i=1}^{j-1}e_{ij}(x_i, x_j)\,,
\label{eq:maxent}
\end{equation}
where the fields $h_i(x_i)$ and couplings $e_{ij}(x_i,x_j)$ are parameters that can be inferred from data by DCA methods~\cite{Weigt09,Cocco18}.
In our case, they are inferred from $\mathcal{M}$ by bmDCA~\cite{Figliuzzi18, Russ20}.
The Potts model probability distribution is then given by the Boltzmann distribution associated to the Hamiltonian $H$ in \cref{eq:maxent}:
\begin{equation}
P(\bm{x})=\frac{e^{-H(\bm{x})}}{Z}\,,
\end{equation}
where $Z$ is a constant ensuring normalization.
In this context, we implement a Metropolis--Hastings algorithm for Markov Chain Monte Carlo (MCMC) sampling from $P$, where an iteration step consists of a proposed move (mutation) in which a site $i$ is chosen uniformly at random, and its state $x_i$ may be changed into another state chosen uniformly at random.
Each of these attempted mutations is accepted or rejected according to the Metropolis criterion, i.e.\ with probability
\begin{equation}
p = \min \left[ 1, \exp \left(-\Delta H \right)\right],
\label{eq:MetroCrit}
\end{equation}
where $\Delta H$ is the difference in the value of $H$ after and before the mutation.
\paragraph{Generating independent equilibrium sequences under a Potts model.}
To generate a synthetic MSAs without phylogeny from each $\mathcal{M}$, we performed equilibrium MCMC sampling from the Potts model with Hamiltonian $H$ in \cref{eq:maxent}, using the Metropolis--Hastings algorithm.
Namely, we started from a set of $M$ randomly and independently initialized sequences, and proposed a total number $N$ of mutations on each sequence.
Suitable values for $N$ are estimated by bmDCA during its training, to ensure that Metropolis--Hastings sampling reaches thermal equilibrium after $N$ steps when starting from a randomly initialized sequence~\cite{Figliuzzi18}.
We thus used the value of $N$ estimated by bmDCA at the end of training.
This yielded a synthetic MSA of the same depth $M$ as the original full MSA $\mathcal{M}$, composed of independent equilibrium sequences.
\paragraph{Generating sequences along an inferred phylogeny under a Potts model.}\label{par:methods_generation_phylogeny}
We also generated synthetic data using MCMC sampling along our inferred phylogenetic trees~\cite{Vorberg18}, using an open-source implementation available at \url{https://github.com/Bitbol-Lab/Phylogeny-Partners} (version 2.0).
We started from an equilibrium ancestor sequence sampled as explained above, and placed it at the root (note that, while FastTree roots its trees arbitrarily, root placement does not matter; see below).
Then, this sequence was evolved by successive duplication (at each branching of the tree) and mutation events (along each branch).
Mutations were again modeled using for acceptance the Metropolis criterion in \cref{eq:MetroCrit} with the Hamiltonian in \cref{eq:maxent}.
As the length $b$ of a branch gives the estimated number of substitutions that occurred per site along it~\cite{Price10}, we generate data by making a number of accepted mutations on this branch equal to the integer closest to $b L$.
Since we traversed the entire inferred tree in this manner, the resulting sequences at the leaves of the tree yield a synthetic MSA of the same depth as the original full MSA $\mathcal{M}$.
Finally, we verified that the Hamming distances between sequences in these synthetic MSAs were reasonably correlated with those between corresponding sequences in the natural MSAs -- see \cref{fig:Hamming_synthetic_MSAs}.
Because we start from an ancestral equilibrium sequence, and then employ the Metropolis criterion, all sequences in the phylogeny are equilibrium sequences.
Thus, some of the correlations between the sequences at the leaves of the tree can be ascribed to the couplings in the Potts model, as in the case of independent equilibrium sequences described above.
However, their relatedness adds extra correlations, arising from the historical contingency in their phylogeny.
Note that separating these ingredients is extremely tricky in natural data~\cite{WeinsteinPreprint}, which motivates our study of synthetic data.
Our procedure for generating MSAs along a phylogeny is independent of the placement of the tree's root.
Indeed, informally, a tree's root placement determines the direction of evolution; hence, root placement should not matter when evolution is a time-reversible process.
That evolution via our mutations and duplications is a time-reversible process is a consequence of the fact that we begin with equilibrium sequences at the (arbitrarily chosen) root.
More formally, for an irreducible Markov chain with transition matrix $\mathcal{P}$ and state space $\Omega$, and for any $n \geq 1$, let $\mathrm{Markov}_n(\pi, \mathcal{P})$ denote the probability space of chains $(X_k)_{0 \leq k \leq n}$ with initial distribution $\pi$ on $\Omega$.
If $\pi$ is the chain's stationary distribution and $\pi$ satisfies detailed balance, then, for any number of steps $n \geq 1$, any chain $(X_k)_{0 \leq k \leq n} \in \mathrm{Markov}_n(\pi, \mathcal{P})$ is reversible in the sense that $(X_{n - k})_{0 \leq k \leq n} \in \mathrm{Markov}_n(\pi, \mathcal{P})$.
In our case, since the Metropolis--Hastings algorithm constructs an irreducible Markov chain whose stationary distribution satisfies detailed balance, and since duplication events are also time-reversible constraints imposed at each branching node, all ensemble observables are independent of root placement as long as the root sequences are sampled from the stationary distribution.
\paragraph{Assessing performance degradation due to phylogeny in coupling inference.}\label{par:performance_degradation}
DCA methods and MSA Transformer both offer ways to perform unsupervised inference of structural contacts from MSAs of natural proteins.
In the case of DCA, the established methodology~\cite{Ekeberg13,Ekeberg14,Figliuzzi18} is to (1) learn fields and couplings [see \cref{eq:maxent}] by fitting the Potts model, (2) change the gauge to the zero-sum gauge, (3) compute the Frobenius norms, for all pairs of sites $(i,j)$, of the coupling matrices $\left( e_{ij}(x, y) \right)_{x, y}$, and finally (4) apply the average product correction (APC)~\cite{Dunn08}, yielding a coupling score $E_{ij}$.
Top scoring pairs of sites are then predicted as being contacts.
In the case of MSA Transformer~\cite{rao2021msa}, a single logistic regression (shared across all possible input MSAs) was trained to regress contact maps from a sparse linear combination of the symmetrized and APC-corrected row attention heads (see \qnameref{subsec:MSA-Tr_attn}).
We applied these inference techniques, normally used to predict structural contacts, on our synthetic MSAs generated without and with phylogeny (see above).
As proxies for structural contacts, we used the pairs of sites with top coupling scores in the Potts models used to generate the MSAs.
Indeed, when presented with our synthetic MSAs generated at equilibrium, DCA methods for fitting Potts models should recover the ranks of these coupling scores well.
Hence, their performance in this task provide a meaningful baseline against which performance when a phylogeny was used to generate the data, as well as MSA Transformer's performance, can be measured.
As a DCA method to infer these coupling scores, we used plmDCA~\cite{Ekeberg13,Ekeberg14} as implemented in the \texttt{PlmDCA} Julia package (\url{https://github.com/pagnani/PlmDCA}, version 0.4.1), which is the state-of-the-art DCA method for contact inference.
We fitted one plmDCA model per synthetic MSA, using default hyperparameters throughout; these include, in particular, regularization strengths set at $\lambda = 10^{-2}$ for both fields and couplings, and automatic estimation of the phylogenetic cutoff $\delta$ in \cref{eq:Meff}.
We verified that these settings led to good inference of structural contacts on the original full MSAs by comparing them to the PDB structures in \cref{tab:MSA} -- see \cref{fig:contact_prediction_plmDCA}.
For each synthetic MSA, we computed coupling scores $E_{ij}$ for all pairs of sites.
While Potts models need to be fitted on deep MSAs to achieve good contact prediction, MSA Transformer's memory requirements are considerable even at inference time, and the average depth of the MSAs used to train MSA Transformer was 1192~\cite{rao2021msa}.
Concordantly, we could not run MSA Transformer on any of the synthetic MSAs in their entirety.
Instead, we subsampled each synthetic MSA 10 times, by selecting each time a number $M_\mathrm{sub}$ of row indices uniformly at random, without replacement.
We used $M_\mathrm{sub} \approx 380$ for family PF13354 due to its greater length, and $M_\mathrm{sub} \approx 500$ for all other families.
Then, we computed for each subsample a matrix of coupling scores using MSA Transformer's row attention heads and the estimated contact probabilities from the aforementioned logistic regression.
Finally, we averaged the resulting 10 matrices to obtain a single matrix of coupling scores.
We used a similar strategy (and the same randomly sampled row indices) to infer structural contact scores from the natural MSAs -- see \cref{fig:contact_prediction_MSA_Transformer}.
Consistently with findings in Ref.~\cite{rao2021msa}, MSA Transformer generally performs better than plmDCA (\cref{fig:contact_prediction_plmDCA}) at contact inference.
\section*{Data availability}
All datasets used in our work (namely, the natural MSAs and PDB structures described in \qnameref{subsec:datasets} and listed in \cref{tab:MSA}, as well as the corresponding synthetic MSAs generated for the analysis in \qnameref{subsec:methods_phylogeny}) are available at \url{https://zenodo.org/record/7096792}.
\section*{Code availability}
Our code is available at \url{https://zenodo.org/record/7096792}.
\bibliographystyle{naturemag}
| {'timestamp': '2022-09-22T02:12:12', 'yymm': '2203', 'arxiv_id': '2203.15465', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15465'} | arxiv |
\section{Introduction}
\label{sec:intro}
Spoofing attacks and countermeasures for automatic speaker verification (ASV) have aroused keen interests in academia and the industry.
While ASV systems aim to verify the identity of target speakers, spoofing attacks attempt to manipulate the verification results using various technologies, leading to dramatic performance degradation \cite{wu2015asvspoof, kinnunen2017asvspoof, todisco2019asvspoof, yamagishi2021asvspoof, wang2021comparative}.
In order to ensure the robustness and security of ASV systems, CM is a necessary technique to detect and defend spoofing attacks.
The vulnerability of ASV systems was revealed in \cite{wu2015asvspoof, kinnunen2017asvspoof, todisco2019asvspoof, yamagishi2021asvspoof}, under speech synthesis and voice conversion (VC) attacks.
Currently, various techniques have been proposed to perform effective attacks, including audio replay \cite{wu2014study}, adversarial noise \cite{kreuk2018fooling, das2020attacker}, more advanced text-to-speech (TTS) and VC models \cite{de2010evaluation, wu2014voice, kons2013voice}.
In addition, many works have been done to investigate state-of-the-art CM strategies.
The current solutions leverage end-to-end deep neural networks (DNNs) \cite{monteiro2019development, monteiro2020generalized}, trying to distinguish artifacts and unnatural cues of spoofing speech from bona fide speech.
And thanks to a series of challenges and datasets \cite{wu2015asvspoof, kinnunen2017asvspoof, todisco2019asvspoof, yamagishi2021asvspoof}, many novel techniques were introduced to achieve promising CM performances \cite{monteiro2019development, monteiro2020generalized,zhang2021one, wu2022partial,chen2020generalization, jung2021aasist,li2021replay, tak2021graph, jung2019replay,shim2020integrated,jung2020study,shim2019self, tak2022automatic,tak2021end,kamble2018effectiveness,tak2020spoofing,tak2018novel}.
However, previous works only take the stand-alone CM models into account.
Recently, a spoofing aware speaker verification (SASV) challenge \cite{jung2022sasv} was proposed as a special session in ISCA INTERSPEECH 2022.
This challenge aims to facilitate the research of integrated CM and ASV models, arguing that jointly optimizing CM and ASV models will lead to better performance.
To measure the performance of integrated models, a SASV-EER was proposed in this challenge as a primary metric, which is a variant of classic equal error rate (EER). Under this metric, the test utterances in trials belong to one of three types: impostors, target speakers, and spoofing attacks.
In further, the SASV-EER can be subsetted into SV-EER (impostors vs. targets) and SPF-EER (targets vs. spoof). The former is for evaluating speaker verification performance, and the latter is for evaluating anti-spoofing performance.
In this way, this metric expects the model can accept target speakers and reject any alternatives, including the impostors and spoofing attacks.
This metric is a straightforward assessment for integrated SASV systems.
This paper described our submitted system for the SASV Challenge 2022.
In order to take advantage of existing well-designed models in CM and ASV areas, we proposed a novel multi-model and multi-scale fusion framework.
Compared with purely scoring fusion and embedding fusion methods, this framework utilizes embeddings from CM models in the first-level fusion, propagating CM embeddings into a CM block to obtain a CM score.
In the second-level fusion, the CM score and ASV scores directly from ASV systems will be concatenated into a prediction block for the final decision.
In contrast to our previous work \cite{wu2022sasv} that only simply concatenates the embeddings from different CM models, we considered the potentials of pooling strategies in terms of feature aggregation, and investigated various pooling methods \cite{you2019multi, snyder2018x, zhu2018self, okabe2018attentive} when fusing embeddings across different CM models.
Based on the proposed fusion framework, we presented the fusion strategies of a series of state-of-the-art CM and ASV models with different pooling strategies to boost the fusion results.
As a result, the best single fusion system has achieved the SASV-EER of 0.97\% on the evaluation set.
Then by ensembling the top-5 fusion systems, the final SASV-EER reached 0.89\% on the evaluation set, while this number in the best baseline system from the SASV challenge is 6.37\%.
\begin{figure*}[ht]
\centering
\centerline{\includegraphics[width=1.0\linewidth]{figures/method.png}}
\caption{The proposed multi-model \& multi-level fusion framework.}
\label{fig:method}
\end{figure*}
\section{Background}
\subsection{SASV strategies}
Given the enrollment utterance $x_{e}$ and the testing utterance $x_{t}$, spoofing-aware speaker verification (SASV) systems aim at telling $y_{t} = 1$ if $x_{t}$ comes from the same speaker as $x_{e}$, or $y_{t} = 0$ if $x_{t}$ comes from another speaker or $x_{t}$ is a spoofing attack. There are two typical strategies for constructing a SASV system: multi-task learning strategy and fusion-based strategy.
The multi-task learning strategy trains the models jointly with both speaker verification and anti-spoofing objectives, which is intuitive to be adopted.
The two objectives share the same backbone and thus the features and embeddings, while each objective has its own predicting head and loss function.
It is worth noting that speaker verification and anti-spoofing objectives are contradictory in some respects.
The former drives the model to erase device and environment information to more robustly identify speakers; in contrast, the latter prompts the model to capture device and environment traces, then tells forged spoofing from authentic utterances \cite{shim2020integrated}.
Alternatively, the fusion-based strategy has the potential to reach better SASV performance leveraging state-of-the-art CM and ASV models trained on large-scale datasets.
Considering this superiority, we propose our solutions for the SASV challenge based on a novel multi-model and multi-level fusion strategy.
\subsection{Baseline systems}
The challenge organizer provides two baseline systems. Each system is based upon ECAPA-TDNN model \cite{desplanques2020ecapa} as the ASV subsystem and AASIST model \cite{jung2021aasist} as the CM subsystem. The key difference between the two systems is how they fuse ASV and CM subsystem - Baseline1 adopts the score-level fusion, while Baseline2 adopts the embedding-level fusion.
\section{Method}
\begin{figure*}[ht]
\centering
\subfigure[ECAPA-TDNN]{
\centering
\includegraphics[width=0.32\linewidth]{figures/experiments/ecapa_sv_test.pdf}
}
\subfigure[AASIST]{
\centering
\includegraphics[width=0.32\linewidth]{figures/experiments/aas_cm_test.pdf}
}
\subfigure[Proposed top-5 ensemble system]{
\centering
\includegraphics[width=0.32\linewidth]{figures/experiments/fusion-sap-768.pdf}
}
\centering
\caption{The histogram plots of the output scores predicted by ASV, CM, and the proposed top-5 ensemble system. Other proposed system variants also have similar histogram shapes as (c).}
\label{fig:hist}
\end{figure*}
Although achieving acceptable performances, baseline systems' fusion strategies are relatively simple and naive. Baseline1's score-level fusion does not guarantee that the ASV score and the CM score belong to a unified space and an identical magnitude. Baseline2 crudely concatenates three embeddings and throws the product into a DNN, lacking fine-grained fusion. These inadequacies motivate us to explore further possibilities of fusion strategies in the SASV task.
In this paper, we proposed a multi-model and multi-level fusion strategy. In terms of the width, it employs multiple pre-trained ASV and CM models as plug-and-play components, where users can expand or shrink the scale of the model according to their needs. In terms of the depth of this strategy, it fuses CM embeddings to calculate a score in the first-level fusion, which is then integrated with the ASV models' outputs, and yields the final prediction in the second-level fusion.
\subsection{Overall structure}
The overall framework is shown in Figure \ref{fig:method}, where $x_{e}$ and $x_{t}$ are the input enrollment and testing utterances, respectively; \textit{ASV-1}, \textit{ASV-2}, ..., \textit{ASV-m} denote $m$ pre-trained ASV models; \textit{CM-1}, \textit{CM-2}, ..., \textit{CM-n} denote $n$ pre-trained CM models. Given a trial $\{x_{e}, x_{t}\}$, a series of cosine scores $\{s_{sv}^1, s_{sv}^2, \ldots, s_{sv}^m\}$ are derived from $m$ ASV models. Given the testing utterance $x_{t}$, a series of CM embeddings $\{h^{1}, h^{1}, \ldots, h^{n}\}$ are extracted through $n$ CM models. Next comes the first level of fusion, where the $n$ embeddings are integrated into a $h_{cm}$ by concatenation or a pooling method.
Our previous work \cite{wu2022sasv} investigated the capacity of concatenation for SASV.
In this work, we further extend the potential of concatenation by making the CM block in Figure \ref{fig:method} deeper, and we also adopt pooling methods to further improve the fusion performance.
Further, $h_{cm}$ goes through a CM Block to better digest fused embeddings and then a 2-dimension countermeasure score $s_{cm}$ is predicted. With $s_{cm}$ and $\{s_{sv}^1, s_{sv}^2, \ldots, s_{sv}^m\}$ well prepared, they are concatenated and fed into the Predictor to yield the final prediction $\hat{y_t}$, where the second-level fusion is performed.
\subsection{Strategies in the first-level fusion}
For the first-level fusion, we attempt concatenation \cite{wu2022sasv} or one of the four kinds of pooling methods to synthesize $h_{cm}$ separately, and have conducted extensive experiments accordingly.
Suppose $\bm{H}=\{h^{1}, h^{1}, \ldots, h^{n}\}$, and the length of all the CM embeddings are projected into a same length $d_h$ by feed forward layers before performing concatenation or pooling. The four candidate pooling methods are Temporal Average Pooling (TAP) \cite{you2019multi}, Temporal Statistics Pooling (TSP) \cite{snyder2018x}, Self-attentive Pooling (SAP) \cite{zhu2018self}, and Attentive Statistics Pooling (ASP) \cite{okabe2018attentive}.
TAP is to calculate the mean value along the channels to obtain the $h_{cm}$.
TSP calculates channel-wise mean and standard deviation, then concatenates the mean vector and standard deviation vector together as $h_{cm}$.
In SAP, the self-attention mechanism takes $\bm{H}$ as input and outputs an annotation matrix $\bm{A}$:
\begin{equation}
\bm{A} = softmax(tanh(\bm{H}^T\bm{W}_1)\bm{W}_2)
\label{eq:SAP-weight}
\end{equation}
where $\bm{W}_1$ is a matrix of size $d_h\times d_a$; $\bm{W}_2$ is a matrix of size $d_a\times d_r$, and $d_r$ is a hyper-parameter that represents the number of attention heads; The $softmax(·)$ is performed column-wise. We set $d_r=1$, therefore $\bm{A}$ degenerates into an annotation vector. Weighted by $\bm{A}$, $h_{cm}$ is calculated as the weighted mean:
\begin{equation}
h_{cm} =\Tilde{\mu} = \bm{HA}
\label{eq:SAP-mean}
\end{equation}
For ASP, not only it calculate a attention-weighted mean as SAP do, but also it calculate a attention-weighted standard deviation:
\begin{equation}
\Tilde{\sigma} =\sqrt{\sum_{i=1}^{n}{\alpha^i h^i\odot h^i }-\Tilde{\mu}\odot\Tilde{\mu}}
\label{eq:ASP-sigma}
\end{equation}
where $\alpha^i$denotes the $i^{th}$ element of the annotation vector $\bm{A}$, $\odot$ represents the Hadamard product. By concatenating $\Tilde{\mu}$ and $\Tilde{\sigma}$, $h_{cm}$ is derived.
After one of the above pooling methods or concatenation, derived $h_{cm}$ goes through CM Block, which is a multi-layer perceptron, and generates a two-dimension score reflecting the possibilities the testing utterances is the target or not.
\subsection{Loss function}
The ASV and CM models parameters are well pre-trained and thus frozen.
The learnable modules include CM Block and the Predictor, which are multi-layer perceptrons. To prompt the model to learn to distinguish the target trials from other trials, we use the cross-entropy loss on $s_{cm}$ output by CM Block and $\hat{y}_{t}$ output by the Predictor respectively.
\section{Experiments}
\label{sec:exp}
\subsection{Experimental setup}
In the SASV Challenge 2022 \cite{jung2022sasv}, participants are restricted to utilise ASVspoof 2019 \cite{wang2020asvspoof} and VoxCeleb2 \cite{chung2018voxceleb2} datasets for training the anti-spoofing and ASV model, respectively.
Three EERs, namely SV-EER, SPF-EER and SASV-EER are measured as the evaluation metrics, and SASV-EER is the main metric in the Challenge.
For the ASV models, we use Resnet34 \cite{he2016deep}, ECAPA-TDNN \cite{desplanques2020ecapa} and MFA-Conformer \cite{zhang2022conformer}.
For the countermeasure models, we use AASIST \cite{jung2021aasist}, AASIST-L, and RawGAT-ST \cite{tak2021end}, where AASIST-L is a light version of AASIST.
The fusion model in Figure~\ref{fig:method} is trained by Adam optimizer with an initial learning rate of 0.0001.
We set the batch size as 32, and the epoch number as 40.
\begin{table*}[ht]
\centering
\renewcommand\arraystretch{1.0}
\setlength\tabcolsep{12pt}
\caption{Performance of all systems on the ASVspoof 2019 development and evaluation sets.}
\label{tab:all-eer}
\begin{tabular}{lccccccc}
\hline
\hline
& \multirow{2}{*}{\textbf{System}} & \multicolumn{2}{c}{\textbf{SV-EER}} & \multicolumn{2}{c}{\textbf{SPF-EER}} & \multicolumn{2}{c}{\textbf{SASV-EER}} \\
& & Dev & Eval & Dev & Eval & Dev & Eval \\
\hline
(A) & ECAPA-TDNN & 1.64 & 1.86 & 20.28 & 30.75 & 17.37 & 23.84 \\
\hline
(B) & AASIST & 46.01 & 49.24 & 0.07 & 0.67 & 15.86 & 24.38
\\
\hline
(C1) & Baseline1 \cite{jung2022sasv} & 32.88 & 35.32 & 0.06 & 0.67 & 13.07 & 19.31
\\
(C2) & Baseline2 \cite{jung2022sasv} & 12.87 & 11.48 & 0.13 & 0.78 & 4.85 & 6.37
\\
\hline
(D) & MFA-Conformer + AASIST & 1.48 & 1.47 & 0.20 & 1.08 & 0.88 & 1.35
\\
\hline
(E1) & SV-ALL + AASIST & 1.42 & 1.30 & 0.27 & 1.61 & 0.81 & 1.41
\\
(E2) & SV-ALL + AASIST-L & 1.42 & 1.33 & 0.47 & 3.99 & 0.88 & 2.95
\\
(E3) & SV-ALL + RawGAT-ST & 1.82 & 1.64 & 0.40 & 0.82 & 1.28 & 1.39
\\
\hline
(F1) & MFA-Conformer + CM-ALL-CAT-256 & 1.91 & 1.66 & 0.20 & 0.64 & 1.01 & 1.30
\\
(F2) & ECAPA-TDNN + CM-ALL-CAT-256 & 1.39 & 1.73 & 0.20 & 0.74 & 0.81 & 1.40
\\
(F3) & Resnet34 + CM-ALL-CAT-256 & 1.28 & 1.12 & 0.26 & 1.43 & 0.74 & 1.32
\\
\hline
(G1) & SV-ALL + CM-ALL-CAT-256 & 1.27 & 1.20 & 0.20 & 1.15 & 0.81 & 1.17
\\
(G2) & SV-ALL + CM-ALL-CAT-512 & 1.35 & 1.15 & 0.20 & 1.12 & 0.74 & 1.14
\\
(G3) & SV-ALL + CM-ALL-CAT-768 & 1.34 & 1.12 & 0.20 & 0.99 & 0.81 & \textbf{1.08}
\\
(G4) & SV-ALL + CM-ALL-CAT-1024 & 1.28 & 1.21 & 0.20 & 0.83 & 0.74 & \textbf{1.08}
\\
(G5) & SV-ALL + CM-ALL-CAT-2048 & 1.35 & 1.10 & 0.23 & 1.41 & 0.74 & 1.31
\\
\hline
(H1) & SV-ALL + CM-ALL-TAP-768 & 1.35 & 0.99 & 0.2 & 1.10 & 0.61 & \textbf{1.02}
\\
(H2) & SV-ALL + CM-ALL-TSP-768 & 1.21 & 1.12 & 0.20 & 1.47 & 0.74 & 1.31
\\
(H3) & SV-ALL + CM-ALL-SAP-768 & 1.15 & 1.04 & 0.17 & 0.93 & 0.54 & \textbf{0.99}
\\
(H4) & SV-ALL + CM-ALL-ASP-768 & 1.18 & 1.37 & 0.15 & 1.58 & 0.67 & 1.51
\\
(H5) & SV-ALL + CM-ALL-TAP-1024 & 1.28 & 1.15 & 0.13 & 0.56 & 0.61 & \textbf{0.97}
\\
(H6) & SV-ALL + CM-ALL-TSP-1024 & 1.11 & 1.12 & 0.20 & 1.77 & 0.61 & 1.43
\\
(H7) & SV-ALL + CM-ALL-SAP-1024 & 1.15 & 1.16 & 0.20 & 1.45 & 0.61 & 1.28
\\
(H8) & SV-ALL + CM-ALL-ASP-1024 & 1.51 & 1.68 & 0.40 & 1.01 & 1.08 & 1.49
\\
\hline
(I1) & Top-5 Ensemble & 1.08 & 1.01 & 0.20 & 0.71 & 0.67 & \textbf{0.89}
\\
\hline
\hline
\end{tabular}
\end{table*}
\subsection{Experimental results and analysis}
As the requirements by SASV Challenge 2022, we evaluated systems on ASVspoof 2019 development and evaluation sets and reported SA-EER, SPF-EER and SASV EER, shown in Table \ref{tab:all-eer}.
A and B denote systems using pure ASV or CM. We omit other systems using only single ASV or CM due to space limitation, yet they are with the same trend.
C1-C2 denote two baselines provided by the Challenge organizer.
D-H8 are variants based on the proposed fusion strategy. D denote the fusion systems using only one ASV model and one CM model, e.g.,
'ECAPA-TDNN + AASIST' denotes the fusion of ECAPA-TDNN as the ASV model, and AASIST as the CM model.
Other systems using only one ASV and CM models are with the same trend.
E1-E3 denote systems fusing all three ASV models with one CM model. Note that D-E3 ignore the first-level fusion.
F1-F3 denote systems fusing one ASV model and all three CM models.
G1-H8 represent systems incorporating all three ASV models and all three CM models, but with different first-level fusion strategies and different sizes of CM Block. For example, 'SV-ALL + CM-ALL-CAT-768' denotes its first-level fusion uses concatenation (abbreviated as 'CAT' in the table), and fused $h_{cm}$ is projected to 768 dimensions in CM Block's first layer. I1 is the ensemble system involving the top-5 best evaluation set SASV-EER systems in A-H8. Figure \ref{fig:method} illustrates the histogram plots of three typical systems: (a) ECAPA-TDNN, a SOTA ASV system; (b) AASIST, a SOTA CM system; (c) Proposed top-5 ensemble system.
\subsubsection{Single-objective systems}
\textit{Only using speaker verification models.} ECAPA-TDNN performed well on the speaker verification sub-task and achieved 1.86\%, 1.38\% and 1.08\% SV-EERs on the evaluation set, respectively. However, they perform unacceptably on the anti-spoofing sub-task, yielding 30.75\%, 30.22\%, 29.76\% SPF-EER. Spoiled by the spoofing attacks, it is unpractical to perform SASV tasks using only the ASV models.
Take ECAPA-TDNN model as an example, as shown in Figure \ref{fig:hist} (a), the pure ASV model can separate target and non-target trials while can hardly distinguish spoofing trials from genuine trials. This phenomenon is predictable because the objective of speaker verification models tends to erase the in-congruent device and environment information to more robustly identify speakers. However, these real-world traces should have helped to defend against spoofing attacks.
\textit{Only using anti-spoofing models.} In contrast, AASIST, the state-of-the-art CM model, can significantly discriminate spoofing utterances, but randomly guess on the speaker identification sub-task, mainly because of their speaker-unrelated objectives. They achieve SPF-EERs of 0.67\%, 0.84\%, 0.96\% on anti-spoofing, while yielding SV-EERs close to 50\% for speaker verification. This phenomenon can also be observed in Figure \ref{fig:hist} (b), where the target and non-target trials' distribution are almost totally overlapped.
\subsubsection{Baseline systems}
Compared to the above single-objective models, two baseline systems reveal superiority in the SASV challenge. Among them, Baseline2 achieves a SASV-EER of 8.75\% on the evaluation set, which is better than Baseline1's 19.15\%. We argue that the reason is that the simple score-level fusion used in Baseline1 does not guarantee that ASV and CM scores belong to a unified space with a consistent magnitude. As shown in Figure \ref{fig:hist}, the ASV score ranges from -1 to 1, while the CM score ranges from -20 to 15. Straightforward addition will make the ASV score submerged by the CM score. In comparison, Baseline2 uses a trainable deep neural network to digest ASV and CM embeddings better, which can contribute to distinguishing the target from non-target and spoofing trials. However, the performance of Baseline2 on the speaker verification sub-task is still not satisfactory, which motivates us to propose the multi-model
and multi-level fusion strategy.
\subsubsection{Proposed fusion systems}
The proposed strategy fuses three SOTA ASV models and three SOTA CM models.
With different settings, variety of variant fusion systems (D-H8) are elaborately designed, and an additional ensemble system (I1) is constructed by integrating the top-5 best evaluation set SASV-EER systems from A-H8. Table \ref{tab:all-eer} illustrates the performance of all systems, and G1 is the best result of our previous work \cite{wu2022sasv}.
From Table \ref{tab:all-eer}, all the proposed systems outperform the baseline models with a large margin on the SASV-EER metrics, while retaining universally good performances on SV-EER and SPF-EER.
The proposed models perform consistently well on the speaker verification task, and quite a few can reach or even surpass the performance of the SOTA ASV models. G1-H8 show better performance than D-F3 in general, benefiting from the more comprehensive model fusion.
Using concatenation for the first-level fusion, we attempt different CM Block sizes. From G1 to G5, as we increase the size of the CM Block, the SASV-EER of the system decreases.
Until adding a layer with an output dimension of 2048 to the bottom of the CM Block, the performance saturates.
Since G3 and G4 have the best SASV-EER, we employ their CM Block settings and further explore the impact of replacing concatenation with different pooling methods.
In H1-H8, under both CM block settings, TAP bring more benefits to the system than other methods.
Both statistics pooling methods (TSP, ASP) are less effective than TAP, SAP, and concatenation.
A possible reason is that we only compute the standard deviation for up to three CM embeddings, which is not stable during training.
Rather than representing useful knowledge, the standard deviation seems to be more of a noise.
We argue that if more CM models enroll, the system will benefit from statistics pooling methods, and we will leave it as future work.
The best individual system is with SASV-EER as 0.97\%. Moreover, the top-5 ensemble system (I1) achieves a SASV-EER as low as 0.89\%, which is a 86\% relative improvement compared to Baseline2.
Figure \ref{fig:hist} (c) shows that the distributions of the target, non-target and spoofing trials are well-separated, which verifies the effectiveness of the proposed method.
\section{Conclusion}
This work proposes a novel multi-model and multi-level fusion strategy to tackle the SASV task.
The two-level fusion method can take advantage of the state-of-the-art ASV and CM models.
As a result, the best single fusion system achieves the SASV-EER of 0.97\%.
What's more, by ensembling the top-5 systems, the final SASV-EER reaches 0.89\% on the evaluation set, which is 86\% relative reduction compared to the best baseline, Baseline2, and 24\% relative reduction compared to our previous work \cite{wu2022sasv}.
In the future work, we will introduce more CM models to investigate the potential of the proposed method.
\input{main.bbl}
\bibliographystyle{IEEEtran}
\end{document}
| {'timestamp': '2022-03-30T02:27:11', 'yymm': '2203', 'arxiv_id': '2203.15377', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15377'} | arxiv |
\section{Introduction}
\noindent The classical linear-time / branching-time
spectrum~\cite{Glabbeek90} organizes a plethora of notions of
behavioural equivalence on labelled transition systems at various
levels of granularity ranging from (strong) bisimilarity to trace
equivalence. Similar spectra appear in other system types, e.g.~on
probabilistic systems, again ranging from branching-time equivalence
such as probabilistic bisimilarity to linear-time ones such as
probabilistic trace equivalence~\cite{JouSmolka90}. While the
variation in system types (nondeterministic, probabilistic, etc.) is
captured within the framework of \emph{universal
coalgebra}~\cite{Rutten00}, the variation in the granularity of
equivalence, which we shall generally refer to as the \emph{semantics}
of systems, has been tackled, in coalgebraic generality, in a variety
of approaches~\cite{HJS07,KR15,JSS15,JLR18}. One setting that
manages to accommodate large portions of the
linear-time / branching-time spectrum, notably including also
intermediate equivalences such as ready similarity, is based on
\emph{graded monads}~\cite{MPS15,DMS19,FMS21a}.
An important role in the theoretical and algorithmic treatment of a
behavioural equivalence is classically played by equivalence
games~\cite{Glabbeek90,Stirling99}, e.g.~in partial-order
techniques~\cite{hnw:por-bisimulation-checking} or in on-the-fly
equivalence checking~\cite{h:bisim-verif-journal}. In the present
work, we contribute to \emph{graded semantics} in the sense indicated
above by showing that, under mild conditions, we can extract from a
given graded monad a Spoiler-Duplicator game~\cite{Stirling99} that
characterizes the respective equivalence, i.e.~ensures that two states
are equivalent under the semantics iff Duplicator wins the game.
As the name suggests, graded monads provide an \emph{algebraic} view
on system equivalence; they correspond to \emph{grad\-ed theories},
i.e.~algebraic theories equipped with a notion of \emph{depth} on
their operations. It has been noticed early on~\cite{MPS15} that many
desirable properties of a semantics depend on this theory being
\emph{depth-1}, i.e.~having only equations between terms that are
uniformly of depth~1. Standard examples include distribution of
actions over non-deterministic choice (trace semantics) or
monotonicity of actions w.r.t.~the choice ordering
(similarity)~\cite{DMS19}. Put simply, our generic equivalence game
plays out an equational proof in a depth-1 equational theory in a
somewhat nontraditional manner:
Duplicator starts a round by playing a set of equational assumptions
she claims to hold at the level of successors of the present state,
and Spoiler then challenges one of these assumptions.
In many concrete cases, the game can be rearranged in a straightforward
manner to let Spoiler move first as usual; in this view, the equational claims
of Duplicator roughly correspond to a short-term strategy determining the
responses she commits to playing after Spoiler's next move. In particular,
the game instantiates, after such rearrangement, to the standard pebble
game for bisimilarity. We analyse additional cases, including similarity
and trace equivalence, in more detail. In the latter case, several natural
variants of the game arise by suitably restricting strategies played by
Duplicator.
It turns out that the game is morally played on a form of
pre-determinization of the given coalgebra, which lives in the
Eilenberg-Moore category of the zero-th level of the graded monad, and as
such generalizes a determinization construction that applies in
certain instances of coalgebraic language semantics of
automata~\cite{JSS15}. Under suitable conditions on the graded monad,
this pre-determinization indeed functions as an actual
determinization, i.e.~it turns the graded semantics into standard
coalgebraic behavioural equivalence for a functor that we construct on
the Eilenberg-Moore category. This construction simultaneously
generalizes, for instance, the standard determinization of serial labelled
transition systems for trace equivalence and the identification of
similarity as behavioural equivalence for a suitable functor on
posets~\cite{KKV12} (specialized to join
semilattices).
While graded semantics has so far been constrained to apply only to
finite-depth equivalences (finite-depth bisimilarity, finite trace
equivalence, etc.), we obtain, under the mentioned conditions on the
graded monad, a new notion of infinite-depth equivalence induced by a
graded semantics, namely via the (pre-)determinization. It turns out
the natural infinite version of our equivalence game captures
precisely this infinite-depth equivalence. This entails
a fixpoint characterization of graded semantics on finite systems,
giving rise to perspectives for a generic algorithmic treatment.
\paragraph{Related Work.} Game characterizations of process
equivalences are an established theme in concurrency theory;
they tend to be systematic but not generic~\cite{Glabbeek90,CD08}.
Work on games for spectra of quantitative equivalences is positioned
similarly~\cite{FLT11,fl:quantitative-spectrum-journal}. The idea of developing \mbox{(bi)}simulation
games in coalgebraic generality goes back to work on branching-time
simulations based on relators~\cite{Baltag00}. There
is recent highly general work, conducted in a fibrational setting, on
so-called codensity games for various notions of
bisimilarity~\cite{kkhkh:codensity-games}. The emphasis in this work
is on generality w.r.t.~the measure of bisimilarity, covering,
e.g.~two-valued equivalences, metrics, pre-orders, and topologies,
while,
viewed through the lens of spectra of equivalences, the
focus remains on branching time. The style of the codensity game is
inspired by modal logic, in the spirit of coalgebraic Kantorovich
liftings~\cite{BaldanEA18,WildSchroder20};
Spoiler plays predicates thought of as arguments of modalities.
Work focused more specifically on games for Kantorovich-style
coalgebraic behavioural equivalence and behavioural
metrics~\cite{km:bisim-games-logics-metric} similarly concentrates on
the branching-time case. A related game-theoretic characterization is
implicit in work on $\Lambda$-(bi)similarity~\cite{GorinSchroder13},
also effectively limited to branching-time. Comonadic game
semantics~\cite{ADW17, AS18, CD21} proceeds in the opposite way
compared to the mentioned work and ours: It takes existing games as
the point of departure, and then aims to develop categorical models.
Graded semantics was developed in a line of work mentioned
above~\cite{MPS15,DMS19,FMS21a}. The underlying notion of
graded monad stems from algebro-geometric work~\cite{Smirnov08}
and was introduced into computer science (in substantially higher generality)
in work on the semantics of effects~\cite{Katsumata14}. Our pre-determinization
construction relates to work on coalgebras over algebras~\cite{BK11}.
\paragraph*{Organization.} We discuss preliminaries on categories,
coalgebras, graded monads, and games in \cref{sec:prelims}. We
recall the key notions of graded algebra and canonical graded algebra
in~\cref{sec:algebras}, and graded semantics in~\cref{sec:semantics}.
We introduce our pre-determinization construction in \cref{sec:determinization},
and finite behavioural equivalence games in \cref{S:games}. In
\cref{sec:infinte-depth}, we consider the infinite version of the
game, relating it to behavioural equivalence on the pre-determinization. We
finally consider specific cases in detail in~\cref{sec:cases}.
\section{Preliminaries}\label{sec:prelims}
We assume basic familiarity with category theory~\cite{AHS90}. We
will review the necessary background on coalgebra~\cite{Rutten00},
graded monads~\cite{Smirnov08,MPS15}, and the standard bisimilarity
game~\cite{Stirling99}.
\paragraph*{The category of sets.}
Unless explicitly mentioned otherwise, we will
work in the category $\mathbf{Set}$ of sets and functions
(or \emph{maps}), which is both complete and
cocomplete. We fix a terminal object $1=\{\star\}$
and use $!_{X}$ (or just $!$ if confusion is
unlikely) for the unique map $X\to 1$.
In the subsequent sections, we will mostly draw examples from (slight
modifications of) the following (endo-)functors on $\mathbf{Set}$. The
\emph{powerset functor} $\pow$ sends each set $X$ to its set of
subsets $\pow X$, and acts on a map $f\colon X\to Y$ by taking direct
images, i.e.~$\pow f(S):= f[S]$ for $S\in\pow X$.
We write $\pow_{\mathsf f}$ for the \emph{finitary powerset functor} which sends
each set to its set of finite subsets; the action of $\pow_{\mathsf f}$ on maps is
again given by taking direct images. Similarly, $\pow^+$ denotes the
non-empty powerset functor
($\pow^+(X)=\{Y\in\pow(X)\mid Y\neq\emptyset\}$), and $\pow_{\mathsf f}^+$ its
finitary subfunctor
($\pow_{\mathsf f}^+(X)=\{Y\in\pow_{\mathsf f}(X)\mid Y\neq\emptyset\}$).
We write $\CalD X$ for the set of \emph{distributions} on a set $X$:
maps $\mu\colon X\to [0,1]$ such that $\sum_{x\in X}\mu(x)=1$. A
distribution $\mu$ is \emph{finitely supported} if the set
$\{x\in X~|~\mu(x)\neq 0\}$ is finite. The set of finitely supported
distributions on $X$ is denoted $\CalD_f X$. The assignment
$X\mapsto\CalD X$ is the object-part of a functor: given
$f\colon X\to Y$, the map $\CalD f\colon\CalD X\to \CalD Y$ assigns to a
distribution $\mu\in\CalD X$ the \emph{image} distribution
$\CalD f(\mu)\colon Y\to [0, 1]$ defined by
$\CalD f(\mu)(y)=\sum_{x\in X\mid f(x)=y} \mu(x)$. Then,
$\CalD f(\mu)$ is finitely supported if $\mu$ is, so $\CalD_f$ is
functorial as well.
\takeout{
We will also consider the \emph{contravariant powerset functor}
$\Q\colon\mathbf{Set}\to\mathbf{Set}^{op}$, which acts on sets according to $\pow$,
i.e.~$\Q(X):= \pow X$, but sends a map $f\colon X\to Y$ to the
\emph{inverse image map} $\Q f\colon\pow Y\to \pow X$ defined by
$S\mapsto f^{-1}[S]$. The composite functor
$\CalN:=(\mathbf{Set}\xra{\Q}\mathbf{Set}^{op}\xra{\Q^{op}}\mathbf{Set})$ is called the
\emph{neighborhood functor}. Explicitly, $\CalN$ is the endofunctor
on $\mathbf{Set}$ which sends a set $X$ to the set $\pow(\pow X)$ of all
\emph{neighborhoods} of~$X$, and it sends a map $f\colon X\to Y$
to the map $\CalN f\colon\CalN X\to \CalN Y$ defined by the
assignment
$\mathscr S\mapsto\{S\in \pow Y~|~f^{-1}[S]\in \mathscr S\}$.
\takeout{
We will also work with the \emph{(finitely supported)
distribution functor} $\CalD\colon\mathbf{Set}\to\mathbf{Set}$ is the functor
which sends a set $X$ to the set of \emph{(finitely supported)
probability distributions on $X$}. That is, $\CalD X$ consists of
all maps $\varphi\colon X\to [0,1]$ (where $[0,1]$ denotes the
real unit interval) such that
\[
\sum_{x\in X}\varphi(x) = 1
\]
and such that the \emph{support}
$\Support(\varphi):=\{x\in X\mid\varphi(x)\ne 0\}$ is finite. It
is well known (and easy to see) that each $\varphi\in\CalD X$
is equivalently presented as the formal convex sum
\[
\sum_{x\in\Support(\varphi)} \varphi(x)\cdot x.
\]
In this notation, the action $\CalD f\colon \CalD X\to\CalD Y$
on a map $f\colon X\to Y$ is conveniently described via the
assignment
$\sum_{i\leq k}r_i\cdot x_i \mapsto \sum_{i\leq k} r_i\cdot f(x_i).$
\noindent
\paragraph*{Coalgebra.}
We will review the
basic definitions and results of \emph{universal
coalgebra}~\cite{Rutten00}, a categorical framework for the uniform
treatment of a variety of reactive system types.
\begin{defn}
For an endofunctor $G\colon\CatC\to\CatC$ on a
category $\CatC$, a \emph{$G$-coalgebra} (or just
\emph{coalgebra}) is a pair $(X, \gamma)$ consisting
of an object $X$ in $\CatC$ and a morphism
$\gamma\colon X\to GX$.
A \emph{(coalgebra) morphism} from $(X, \gamma)$ to
a coalgebra $(Y, \delta)$ is a morphism $h\colon X\to Y$
such that $\delta\cdot h = Fh\cdot\gamma$.
\end{defn}
\noindent Thus, for $\CatC = \mathbf{Set}$, a coalgebra consists of a set $X$
of \emph{states} and a map $\gamma\colon X\to GX$, which we view as a
transition structure that assigns to each state $x\in X$ a structured
collection $\gamma(x)\in GX$ of \emph{successors} in $X$.
\begin{expl}\label{E:coalg}
We describe some examples of functors on $\mathbf{Set}$ and their coalgebras
for consideration in the subsequent. Fix a finite set $\A$ of
\emph{actions}.
\begin{enumerate}
\item\label{E:coalg:1} Coalgebras for the functor $G=\pow(\A\times -)$
are just
\emph{$\A$-labelled transition systems (LTS)}: Given such a
coalgebra $(X, \gamma)$, we can view the elements
$(a, y)\in\gamma(x)$ as the $a$-successors of~$x$. We call
$(X, \gamma)$ \emph{finitely branching} (resp.~\emph{serial}
if~$\gamma(x)$ is finite (resp.~non-empty) for all~$x\in X$.
Finitely branching (resp.~serial) LTS are coalgebras for
the functor $G=\pow_{\mathsf f}(\A\times -)$ (resp. $\pow^+(\A\times -)$).
\takeout{
\item A coalgebra for the neighborhood functor $\CalN$ is a
\emph{neighborhood frame}~\cite{HKP09}: a map
$\nu\colon X\to \CalN X$ assigning each state $x\in X$ to its
set of \emph{neighbourhoods} $\nu(x)\in\CalN X$.%
\smnote{I wouldn't write $\pow(\pow X)$; this gives the wrong
impression that $\N$ is the double covariant powerset functor.}
A morphism
of neighborhood frames (also: \emph{bounded morphism}) from
$(X, \nu)$ to $(X', \nu')$ is a map $f\colon X\to X'$ such that for
all $x\in X$: $f^{-1}[V]\in\nu(x)$ iff $V\in\nu'(f(x))$ for all
$V\in\pow X'$.
\item A coalgebra $(X,\gamma)$ for the functor $G=\CalD(\A\times -)$
is a \emph{(generative) probabilistic transition system} (PTS): The
transition structure~$\gamma$ assigns to each state $x\in X$ a
distribution $\gamma(x)$ on pairs $(a,y)\in\A\times X$. We think of
$\gamma(x)(a, y)$ as the probability of executing an $a$-transition
to state~$y$ while sitting in state~$x$.
A PTS $(X, \gamma)$ is \emph{finitely branching} if $\gamma(x)$ is
finitely supported for all $x\in X$; then, finitely branching PTS
are coalgebras for $\CalD_f(\A\times -)$.
\end{enumerate}
\end{expl}
Given coalgebras $(X, \gamma)$ and $(Y, \delta)$ for an endofunctor
$G$ on $\mathbf{Set}$, states $x\in X$ and $y\in Y$ are
\emph{$G$-behaviourally equivalent} if there exist coalgebra morphisms
\[
(X,\gamma) \xra{f} (Z,\zeta) \xla{g} (Y,\delta)
\]
such that $f(x)= g(y)$. Behavioural equivalence can be approximated
via the (initial $\omega$-segment of the) \emph{final chain}
$(G^n1)_{n\in\omega}$, where $G^n$ denotes $n$-fold application of
$G$.
The \emph{canonical cone} of a coalgebra
$(X, \gamma)$ is then the family of maps $\gamma_n\colon X\to G^n1$
defined inductively for $n\in\omega$ by
\begin{align*}
\gamma_0 &= \big(X\xra{!} 1\big), \text{and} \\
\gamma_{n+1} &= \big(X \xra{\gamma} GX \xra{G\gamma_n} GG^n 1 = G^{n+1}1\big).
\end{align*}
States $x, y\in X$ are \emph{finite-depth behaviourally equivalent} if
$\gamma_n(x)= \gamma_n(y)$ for all $n \in \omega$.
\begin{rem}\label{rem:finite-depth}
It follows from results of Worrell~\cite{Worrell05} that behavioural
equivalence and finite-depth behavioural equivalence coincide for
finitary functors on $\mathbf{Set}$, where a functor $G$ on $\mathbf{Set}$ is
\emph{finitary} if it preserves filtered colimits. Equivalently, for
every set $X$ and each $x \in GX$ there exists a finite subset $Y
\subseteq X$ such that $x = Gi[GY]$, where $i\colon Y \hookrightarrow X$ is
the inclusion map~\cite[Cor.~3.3]{amsw19-1}.
\end{rem}
\paragraph*{Bisimilarity games.}
We briefly recapitulate the classical \emph{bisimilarity game}, a
two-player graph game between the players Duplicator (D) and Spoiler
(S); player~D tries to show that two given states are bisimilar,
while~S tries to refute this. \emph{Configurations} of the game are
pairs $(x, y)\in X\times X$ of states in a LTS $(X, \gamma)$. The game
proceeds in rounds, starting from the \emph{initial configuration},
which is just the contested pair of states. In each round, starting
from a configuration $(x, y)$,~S picks one of the sides, say,~$x$, and
then selects an action $a\in\A$ and an $a$-successor~$x'$ of~$x$;
player~D then selects a corresponding successor on the other side, in
this case an $a$-successor~$y'$ of~$y$. The game then reaches the new
configuration $(x', y')$. If a player gets stuck, the play is
\emph{winning} for their opponent, whereas any infinite play is
winning for~D.
It is well known (e.g.~\cite{Stirling99}) that~D has a
winning strategy in the bisimilarity game at a configuration $(x, y)$
iff $(x, y)$ is a pair of bisimilar states. Moreover, for finitely
branching LTS, an equivalent formulation may be given in terms of the
\emph{$n$-round bisimilarity game}:
the rules of the $n$-round game are the same as those above, only
now~D wins as soon as at most~$n$ rounds have been played. In fact, a
configuration $(x, y)$ is a bisimilar pair precisely if~D has
a winning strategy in the $n$-round bisimilarity game for all
$n\in\omega$.
We mention just one obvious variation of this game that characterizes
a different spot on the linear-time/branching-time spectrum: The
\emph{mutual-simulation game} is set up just like the bisimulation
game, except that~S may only choose his side once, in the first round,
and then has to move on that side in all subsequent rounds (in the
bisimulation game, he can switch sides in every round if he
desires). It is easily checked that states~$x,y$ are mutually similar
iff~S wins the position $(x,y)$ in the mutual-simulation game. We will
see that both these games (and many others) are obtained
as instances of our generic notion of graded equivalence game.
\paragraph*{Graded monads.}
We now review some background material on graded monads
\cite{Smirnov08, MPS15}:
\begin{defn}\label{D:gradedmonad}
A \emph{graded monad} $\M$ on a category $\CatC$ is a triple
$(M, \eta, \mu)$ where $M$ is a family of functors
$M_n\colon\CatC\to\CatC$ on $\CatC$ ($n\in\omega$),
$\eta\colon \mathsf{id} \to M_0$ is a natural transformation (the
\emph{unit}), and $\mu$ is a family of natural transformations%
\begin{equation}
\mu^{n,k}\colon M_nM_k\to M_{n+k} \tag{$n,k\in\omega$}
\end{equation}
(the \emph{multiplication}) such that the following diagrams commute
for all $n,m,k\in\omega$:
\begin{equation}\label{diagram:unitlaw}
\begin{tikzcd}[column sep=40]
&
M_n
\arrow[ld, "M_n\eta"'] \arrow[rd, "\eta M_n"] \arrow[d, "\Id"]
\\
M_nM_0
\arrow[r, "{\mu^{n,0}}"]
&
M_n
&
M_0M_n \arrow[l, "{\mu^{0,n}}"']
\end{tikzcd}
\end{equation}
\begin{equation}\label{diagram:associativelaw}
\begin{tikzcd}[column sep = 60]
M_nM_kM_m
\arrow[r, "{M_n\mu^{k,m}}"]
\arrow[d, "{\mu^{n,k}M_m}"']
&
M_{n}M_{k+m} \arrow[d, "{\mu^{n,k+m}}"]
\\
M_{n+k}M_m \arrow[r, "{\mu^{n+k,m}}"]
&
M_{n+k+m}
\end{tikzcd}
\end{equation}
We refer to~\eqref{diagram:unitlaw} and~\eqref{diagram:associativelaw}
as the \emph{unit} and \emph{associative} laws of $\M$,
respectively. We call $\M$ \emph{finitary} if all of the
functors $M_n\colon\CatC\to\CatC$ are finitary.
\end{defn}
\noindent
The above notion of graded monad is due to Smirnov \cite{Smirnov08}.
Katsumata~\cite{Katsumata14}, Fujii et al.~\cite{FKM16}, and
Mellies~\cite{Mellies17} consider a more general notion of graded (or
\emph{parametrized}) monad given as a lax monoidal action of a
monoidal category $\Mon$ (representing the system of grades) on a
category $\CatC$. Graded monads in the above sense are recovered by
taking~$\Mon$ to be the (discrete category induced by the) monoid
$(\N, +, 0)$.
The graded monad laws imply that the triple $(M_0, \eta, \mu^{0,0})$
is a (plain) monad on the base category $\CatC$; we use this freely
without further mention.
\begin{expl}\label{E:graded-monad}
We review some salient constructions~\cite{MPS15} of graded
monads on $\mathbf{Set}$ for later use.
\begin{enumerate}
\item\label{E:graded-monad:1} Every endofunctor $G$ on $\mathbf{Set}$
induces a graded monad~$\M_G$ with underlying endofunctors
$M_n:= G^n$ (the $n$-fold composite of~$G$ with itself); the unit
$\eta_X\colon X\to G^0X= X$ and multiplication
$\mu_X^{n,k}\colon G^nG^kX\to G^{n+k}X$ are all identity maps.
We will later see that~$\M_G$ captures (finite-depth) $G$-behavioural
equivalence.
\item\label{item:graded-kleisli}
Let $(T, \eta, \mu)$ be a monad on $\mathbf{Set}$, let $F$ be
an endofunctor on $\mathbf{Set}$, and let $\lambda\colon FT\to TF$
be a natural transformation such that
\[
\lambda\cdot F\eta=\eta F
\qquad\text{and}\qquad
\lambda \cdot F\mu = \mu F \cdot T\lambda \cdot \lambda T
\]
(i.e.~$\lambda$ is a distributive law of the functor~$F$ over the
monad~$T$). For each $n\in\omega$, let
$\lambda^n\colon F^nT\to TF^n$ denote the natural transformation
defined inductively by
\[
\lambda^0:= \mathsf{id}_T; \qquad \lambda^{n+1}:= \lambda^n F\cdot F^n\lambda.
\]
We obtain a graded monad with $M_n:= TF^n$, unit $\eta$, and
components $\mu^{n,k}$ of the multiplication given as the
composites
\[
TF^nTF^k\xra{T\lambda^n F^k} TTF^nF^k = TTF^{n+k}\xra{ \mu F^{n+k}} TF^{n+k}.
\]
Such graded monads relate strongly to Kleisli-style coalgebraic
trace semantics~\cite{HJS07}.
\item\label{item:T-traces} We obtain (by instance of the example above) a graded monad
$\M_T(\A)$ with $M_n= T(\A^n\times -)$ for every monad $T$ on
$\mathbf{Set}$ and every set~$\A$. Thus, $\M_T$ is a graded monad for
traces under effects specified by~$T$; e.g.~for $T=\CalD$, we will
see that $\M_T(\A)$ captures probabilistic trace equivalence on
PTS.
\item\label{E:graded-monad:4}Similarly, given a monad $T$, an
endofunctor $F$, both on the same category $\CatC$, and a
distributive law $\lambda\colon TF \to FT$ of~$T$ over $F$, we
obtain a graded monad with $M_n := F^nT$, unit and
multiplication given analogously as in
item~\ref{item:graded-kleisli} above
(see~\cite[Ex.~5.2.6]{MPS15}). Such graded monads relate strongly
to Eilenberg-Moore-style coalgebraic language semantics~\cite{bms13}
\end{enumerate}
\end{expl}
Graded variants of Kleisli triples have been introduced and proved
equivalent to graded monads (in a more general setting)
by Katsumata~\cite{Katsumata14}:
\begin{notn}\label{N:star}
We will employ the \emph{graded Kleisli star} notation:
for $n\in\omega$ and a morphism $f\colon X\to M_k Y$, we
write%
\begin{equation}\label{Eqn:Kleisli-star}
f^*_n:= \big(M_nX\xra{M_nf} M_nM_k\xra{\mu^{n,k}}M_{n+k}Y\big).
\end{equation}
In this way, we obtain a morphism satisfying the following graded
variants~\cite[Def.~2.3]{Katsumata14} of the usual laws of the
Kleisli star operation for ordinary monads: for every $m\in\omega$ and
morphisms $f\colon X\to M_nY$ and $g\colon Y\to M_kZ$ we have:%
\begin{align}
f^*_0\cdot\eta_X &= f, \label{item:star-2} \\
(\eta_X)^*_n &= \mathsf{id}_{M_n X}, \label{item:start-3}\\
(g^*_{n}\cdot f)^*_m &= g^*_{m+n}\cdot f_m^*. \label{item:star-1}
\end{align}
\end{notn}
\paragraph*{Graded theories.}
Graded theories, in a generalized form in which arities of operations
are not restricted to be finite, have been proved equivalent to graded
monads on $\mathbf{Set}$~\cite{MPS15} (the finitary case was implicitly
covered already by Smirnov~\cite{Smirnov08}). We work primarily with
the finitary theories below; we consider infinitary variants of such
theories only when considering infinite-depth equivalences
(\cref{sec:infinte-depth}).
\begin{defn}\label{def:theory}
\begin{enumerate}
\item A \emph{graded signature} is a set $\Sigma$ of \emph{operations}
$f$ equipped with a finite \emph{arity} $\mathsf{ar}(f) \in \omega$ and a
finite \emph{depth} $d(f)\in\omega.$ An operation of arity 0 is
called a \emph{constant}.
\item
Let $X$ be a set of \emph{variables} and let
$n\in\omega$. The set $\Termsarg{\Sigma, n}(X)$
of \emph{$\Sigma$-terms of uniform depth $n$ with
variables in $X$} is defined inductively as follows:
every variable $x\in X$ is a term of uniform depth
$0$ and, for $f\in\Sigma$ and
$t_1,\dots, t_{\mathsf{ar}(f)}\in\Termsarg{\Sigma, k}(X)$,
$f(t_1,\dots, t_{\mathsf{ar}(f)})$ is a $\Sigma$-term
of uniform depth $k+ d(f)$. In particular,
a constant $c$ has uniform depth $k$ for all $k\geq d(c)$.
\item A \emph{graded $\Sigma$-theory} is a set $\E$ of
\emph{uniform-depth equations}: pairs $(s, t)$, written `$s=t$',
such that $s,t\in\Termsarg{\Sigma, n}(X)$ for some $n\in\omega$;
%
we say that $(s, t)$ is \emph{depth-$n$}.
A theory is \emph{depth-$n$} if all of its equations and
operations have depth at most $n$.
\end{enumerate}
\end{defn}
\begin{notn}\label{N:substitution}
A \emph{uniform-depth substitution} is a map
$\sigma\colon X\to\Termsarg{\Sigma, k}(Y)$,
where $k\in\omega$ and $X, Y$ are sets.
Then $\sigma$ extends to a family of maps
$\bar{\sigma}_n\colon\Termsarg{\Sigma, n}(X)\to\Termsarg{\Sigma, k+n}(Y)$
($n\in\omega$) defined recursively by
\[
\bar{\sigma}_n(f(t_1,\dots, t_{\mathsf{ar}(f)})) =
f(\bar{\sigma}_m(t_1),\dots, \bar{\sigma}_m(t_{\mathsf{ar}(f)})),
\]
where $t_i\in\Termsarg{\Sigma, m}$ and
$d(f)+m = n$. For a term $t\in T_{\Sigma, k}(X)$,
we also write $t\sigma:= \bar{\sigma}_n(t)$ when
confusion is unlikely.
\end{notn}
\noindent
Given a graded theory $\T=(\Sigma, \E)$, we have essentially the
standard notion of equational derivation (sound and complete over
graded algebras, cf.\ \cref{sec:algebras}), restricted to
uniform-depth equations. Specifically, the system includes the
expected rules for reflexivity, symmetry, transitivity, and
congruence, and moreover allows substituted introduction of axioms: If
$s=t$ is in~$\E$ and~$\sigma$ is a uniform-depth substitution, then
derive the (uniform-depth) equation $s\sigma=t\sigma$. (A substitution
rule that more generally allows uniform-depth substitution into
derived equations is then admissible.) For a set~$Z$ of uniform-depth
equations, we write
\begin{equation*}
Z\vdash s=t
\end{equation*}
if the uniform-depth equation $s=t$ is derivable from equations in~$Z$
in this system; note that unlike the equational axioms in~$\E$, the
equations in~$Z$ cannot be substituted into in such a derivation (they
constitute assumptions on the variables occurring in~$s,t$).
We then see that~$\T$ induces a graded monad~$\M_{\T}$ with $M_nX$
being the quotient of $\Termsarg{\Sigma, n}(X)$ modulo derivable
equality under $\E$; the unit and multiplication of $\M_{\T}$ are
given by the inclusion of variables as depth-0 terms and the
collapsing of layered terms, respectively. Conversely, every graded
monad arises from a graded theory in this way~\cite{MPS15}.
We will restrict attention to graded monads presented by depth-$1$
graded theories:
\begin{defn}
A \emph{presentation} of a graded monad $\M$ is a graded theory $\T$
such that $\M\cong\M_{\T}$, in the above notation. A graded monad
is \emph{depth-1} if it has a depth-$1$ presentation.
\end{defn}
\begin{expl}\label{E:graded-theory}
Fix a set $\A$ of actions. We describe \mbox{depth-$1$} graded theories
associated (via the induced behavioural equivalence,
\cref{sec:semantics}) to standard process equivalences on LTS and
PTS~\cite{DMS19}.
\begin{enumerate}
\item\label{item:jsl-a} The graded theory $\JSL(\A)$ of
\emph{$\A$-labelled join semilattices} has as depth-1 operations all
formal sums
\[
\textstyle\sum_{i=1}^na_i(-),
\quad
\text{for \mbox{$n\ge 0$} and $a_1,\dots,a_n\in\A$}
\]
(and no depth-$0$ operations); we write~$0$ for
the empty formal sum. The axioms of $\JSL(\A)$ consist of all
depth-1 equations $\sum_{i=1}^na_i(x_i) = \sum_{j=1}^m b_j(y_j)$
(where the~$x_i$ and~$y_j$ are variables, not necessarily distinct)
such that
$\{(a_i, x_i)~|~1\le i\leq n\}=\{(b_j, y_j)~|~1\le j\leq m\}$. The
graded monad induced by $\JSL(\A)$ is $\M_G$ for
$G=\pow_{\mathsf f}(\A\times(-))$
(cf.~\cref{E:graded-monad}.\ref{E:graded-monad:1}).
\item\label{item:pt-a} The \emph{graded theory of probabilistic
traces}, $\mathsf{PT}(\A)$, has a depth-0 convex sum operation
\[
\textstyle\sum^n_{i = 1} p_i\cdot(-)
\quad
\text{for all $p_1, \ldots, p_n \in [0,1]$ such that
$\sum^n_{i=1} p_i = 1$}
\]
and unary depth-1 operations $a(-)$ for all actions $a\in\A$. As
depth-0 equations, we take the usual equational axiomatisation of
convex algebras, which is given by the equation
$\sum^n_{i = 1}\delta_{ij}\cdot x_j = x_i$ (where $\delta_{ij}$
denotes the Kronecker delta function) and all instances of the
equation scheme
\[
\sum^n_{i = n} p_i\cdot \sum^m_{j=1} q_{ij}\cdot x_j =
\sum_{j=1}^m \Big(\sum^{n}_{i=1}p_iq_{ij}\Big)\cdot x_j.
\]
We further impose depth-1 equations
stating that actions distribute over
convex sums:
\[
a\Big(\sum_{i=1}^np_i\cdot x_i\Big) = \sum_{i=1}^n p_i\cdot a(x_i).
\]
The theory $\mathsf{PT}(\A)$ presents~$\M_{\CalD_f}(\A)$,
where $\CalD_f$ is the finitely supported distribution monad
(cf.~\cref{E:graded-monad}.\ref{item:T-traces}).
\item\label{item:traces-a} We mention two variations on the graded
theory above. First, the \emph{graded theory of (non-deterministic)
traces} presenting $\M_{\pow_{\mathsf f}}(\A)$ has depth-0
operations~$+$,~$0$ and equations for join-semilattices with bottom,
and unary depth-1 operations~$a$ for $a\in\A$ as in
\ref{item:jsl-a} above; the depth-1 equations now state that
actions distribute over joins and preserve bottom. Second, the
\emph{graded theory of serial (non-deterministic) traces} arises by
omitting~$0$ and associated axioms from the graded theory of traces,
and yields a presentation of $\M_{\pow_{\mathsf f}^+}(\A)$.
\item\label{item:simulation-a} The \emph{graded theory of simulation}
has the same signature and depth-0 equations as the graded theory of
traces,
along with depth-1 equations stating that actions are monotone:
\[
a(x+y) + a(x) = a(x+y).
\]
The theory of simulation equivalence then
yields a presentation of the graded monad
with $M_nX$ defined inductively along with
a partial ordering as follows: We take
\mbox{$M_0X = \pow_{\mathsf f}(X)$} ordered by set inclusion.
We equip $\A\times M_nX$ with the product ordering
of the discrete order on $\A$ and the given
ordering on $M_nX$. Then $M_{n+1}X = \pow_{\mathsf f}^{\downarrow}(\A\times M_nX)$ is
the set of downwards-closed finite subsets of
$\A\times M_nX$.
\end{enumerate}
\end{expl}
In the following lemma, an \emph{epi-transformation} is a natural
transformation $\alpha$ whose components $\alpha_X$ are surjective maps.
\begin{notheorembrackets}
\begin{lem}[{\cite{MPS15}}]\label{L:depth-1}
A graded monad $\M$ on $\mathbf{Set}$ is \emph{depth-1} if and only if
all $\mu^{1,n}$ are epi-transformations and the following is
object-wise a coequalizer diagram in the category of
Eilenberg-Moore algebras for the monad $M_0$ for all
$n\in\omega$:
\begin{equation}
\begin{tikzcd}[column sep = 35]\label{Diagram:depth1}
M_1M_0M_n \arrow[r, "M_1\mu^{0,n}", shift left] \arrow[r,
"\mu^{1,0}M_n"', shift right] & M_1M_n \arrow[r, "\mu^{1,n}"] &
M_{1+n}.
\end{tikzcd}
\end{equation}
\end{lem}
\end{notheorembrackets}
\section{Graded Behavioural Equivalences}\label{sec:semantics}
We next recall the notion of a graded semantics~\cite{MPS15}
on coalgebras for an endofunctor on $\mathbf{Set}$;
we illustrate several instantiations of subsequent interest.
\begin{defn}[Graded semantics]
A \emph{(depth-1) graded semantics} for an endofunctor
$G\colon\mathbf{Set}\to\mathbf{Set}$ is a pair $(\alpha, \M)$ consisting of a
(depth-1) graded monad $\M$ on $\mathbf{Set}$ and a natural transformation
$\alpha\colon G\to M_1$ .
\end{defn}
\noindent
Given a $G$-coalgebra $(X,\gamma)$, the graded
semantics $(\alpha, \M)$ induces a sequence of
maps $\gamma^{(n)}\colon X\to M_n1$ inductively
defined by
\begin{align*}
\gamma^{(0)} &:= (X\xra{\eta_X}M_0X\xra{M_0!}M_01); \\
\gamma^{(n+1)} &:= (X\xra{\alpha_X\cdot\gamma} M_1X
\xra{M_1\gamma^{(n)}} M_1M_n 1
\xra{\mu^{1,n}_1} M_{1+n}1)
\end{align*}
(or, using the graded Kleisli star,
$\gamma^{(n+1)} = (\gamma^{(n)})^*_1\cdot\alpha_X\cdot\gamma$). We call
$\gamma^{(n)}(x)\in M_n1$ the \emph{$n$-step $(\alpha, \M)$-behaviour}
of $x\in X$.
\begin{defn}[Graded behavioural equivalence]
States ${x\in X, y\in Y}$ in $G$-coalgebras $(X, \gamma)$ and
$(Y, \delta)$ are \emph{depth-n behaviourally equivalent} under
$(\alpha, \M)$ if ${\gamma^{(n)}(x) = \delta^{(n)}(y)}$, and
\emph{$(\alpha, \M)$-behaviourally equivalent} if
$\gamma^{(n)}(x) = \delta^{(n)}(y)$ for all $n\in\omega$. We
refer to $(\alpha,\M)$-behavioural equivalence as a
\emph{graded behavioural equivalence} or just a \emph{graded
equivalence}.
\end{defn}
\begin{expl}\label{E:semantics}
We recall~~\cite[Section 4]{DMS19} several graded
equivalences, restricting primarily to LTS and PTS.
\begin{enumerate}
\item\label{item:sem-beh}
For an endofunctor $G$ on $\mathbf{Set}$, finite-depth
$G$-behavioural equivalence arises as the
graded equivalence with $\M = \M_G$ and
$\alpha = \mathsf{id}$, where $\M_G$ is the graded
monad of
\cref{E:graded-monad}.\ref{E:graded-monad:1}.
By~\cref{rem:finite-depth}, it follows that
$(\mathsf{id}, \M_G)$ captures full coalgebraic bisimilarity
in case $G$ is finitary.
\item\label{item:sem-trace} Let $(X, \gamma)$ be an LTS, let
${x\in X}$, and let ${w\in\A^*}$ be a finite word over $\A$. We
write $x\xra{w} y$ if the state $y$ can be reached on a path whose
labels form the word $w$. A \emph{finite trace} at $x\in X$ is a
word $w\in\A^*$ such that $x\xra{w} y$ for some $y\in X$; the set of
finite traces at $x$ is denoted $\tau(x)$. States $x,y\in X$ are
trace equivalent if $\tau(x)=\tau(y)$. Trace equivalence on finitely
branching LTS is captured by the graded equivalence induced by
$\M=\M_{\pow_{\mathsf f}}(\A)$
(cf.~\cref{E:graded-monad}.\ref{item:T-traces}), again with
$\alpha=\mathsf{id}$; replacing $\pow_{\mathsf f}$ with $\pow^+$ (or with $\pow_{\mathsf f}^+$)
yields trace equivalence on serial (and finitely branching) LTS.
\item\label{item:sem-prob} Probabilistic trace equivalence on PTS is
the graded equivalence induced by $\M=\M_{\CalD_f}(\A)$
(cf.~\cref{E:graded-monad}.\ref{item:T-traces}) and
$\alpha = \mathsf{id}$: The maps~$\gamma^{(k)}$ equip states with
distributions on length-$k$ action words, and the induced
equivalence identifies states $x$ and $y$ whenever these
distributions coincide at~$x$ and~$y$ for all~$k$.
\item\label{item:sem-sim}
Simulation equivalence on LTS can also be
construed as a graded equivalence by taking
$\M$ to be the graded monad described in
\cref{E:graded-theory}.\ref{item:simulation-a},
and
\begin{eqnarray*}
\alpha_X\colon\pow_{\mathsf f}(\A\times
X) & \to & \pow^{\downarrow}_f(\A\times\pow_{\mathsf f} X) \\
S\ & \mapsto &
{\downarrow}\{(a,\{x\})\mid (a,x)\in S\}
\end{eqnarray*}
where $\downarrow$ takes downsets.
\end{enumerate}
\end{expl}
\begin{rem}
It follows from the depth-1 presentations described
in~\cref{E:graded-theory} that the graded semantics mentioned in
\cref{E:semantics} are depth-1.
\end{rem}
\section{Graded Algebras}\label{sec:algebras}
Graded monads come equipped with graded analogues
of both the Eilenberg-Moore and Kleisli constructions for
ordinary monads. In particular, we have a
notion of \emph{graded algebra}~\cite{FKM16, MPS15}:
\begin{defn}[Graded algebra]\label{D:gradedalgebra}
Let $k\in\omega$ and let $\M$ be a graded
monad on a category $\CatC$. An \emph{$M_k$-algebra}
$A$ consists of a family of $\CatC$-objects $(A_n)_{n\leq k}$
(the \emph{carriers}) and a family of $\CatC$-morphisms%
\begin{equation}
a^{n,m}\colon M_nA_m\to A_{n+m} \tag{$n+m\le k$}
\end{equation}
(the \emph{structure}) such that $a^{0,n}\cdot\eta_{A_n} = \mathsf{id}_{A_n}$
($n\leq k$) and
\begin{equation}\label{Diagram:gradedalgebralaw}
\begin{tikzcd}[column sep = 35]
M_nM_mA_r \arrow[d, "\mu^{n,m}"'] \arrow[r, "M_na^{m,r}"]
&
M_nA_{m+r} \arrow[d, "a^{n,m+r}"] \\
M_{n+m}A_{r} \arrow[r, "a^{n+m,r}"]
&
A_{n+m+r}
\end{tikzcd}
\end{equation}
for all $n,m,r\in\omega$ such that $n+m+r\leq k$. The \emph{i-part} of
an $M_k$-algebra $A$ is the $M_0$-algebra $(A_i, a^{0,i})$.
A \emph{homomorphism} from $A$ to an $M_k$-algebra
$B$ is a family of $\CatC$-morphisms
$h_n\colon A_n\to B_n$ ($n\leq k$) such that
\[
h_{n+m} \cdot a^{n,m} = b^{n,m}\cdot M_nh_m
\quad\text{for all $n,m\in\omega$ s.th.~$n+m\le k$.}
\]
We
write $\Alg_k(\M)$ for the category of $M_k$-algebras
and their homomorphisms.
We define \emph{$M_{\omega}$-algebras} (and their
homomorphisms) similarly, by allowing the indices $n,m,r$
to range over $\omega$.
\end{defn}
\begin{rem}
The above notion of $M_{\omega}$-algebra corresponds with the
concept of graded Eilenberg-Moore algebras introduced by Fujii et
al.~\cite{FKM16}. Intuitively, $M_{\omega}$-algebras are devices for
interpreting terms of unbounded uniform depth. We understand
$M_k$-algebras~\cite{MPS15} as a refinement of $M_{\omega}$-algebras
which allows the interpretation of terms of uniform depth \emph{at
most~$k$}. Thus, $M_k$-algebras serve as a formalism for
specifying properties of states exhibited in \emph{$k$ steps}. For
example, $M_1$-algebras are used to interpret one-step modalities of
characteristic logics for graded semantics~\cite{DMS19,FMS21a}.
Moreover, for a depth-1 graded monad, its $M_\omega$-algebras may
be understood as compatible chains of $M_1$-algebras~\cite{MPS15},
and
a depth-1 graded monad can be reconstructed from its $M_1$-algebras.
%
\end{rem}
\noindent We will be chiefly interested in $M_0$- and $M_1$-algebras:
\begin{expl}
Let $\M$ be a graded monad on $\mathbf{Set}$.
\begin{enumerate}
\item An $M_0$-algebra is just an Eilenberg-Moore algebra for the
monad $(M_0, \eta, \mu^{0,0})$. It follows that $\Alg_0(\M)$ is
complete and cocomplete, in particular has coequalizers.
\item An $M_1$-algebra is a pair $((A_0, a^{0,0}), (A_1, a^{0,1}))$ of
$M_0$-algebras -- often we just write the carriers $A_i$ to also
denote the algebras, by abuse of notation -- equipped with a
\emph{main structure map} $a^{1,0}\colon M_1A_0\to A_1$ satisfying
two instances of~\eqref{Diagram:gradedalgebralaw}. One instance
states that $a^{1,0}$ is an $M_0$-algebra homomorphism from
$(M_1A_0, \mu^{0,1}_A)$ to $(A_1, a^{0,1})$ (\emph{homomorphy}); the
other expresses that $a^{1,0}\cdot \mu^{1,0}= a^{1,0}\cdot
M_1a^{0,0}$ (\emph{coequalization}):
\begin{equation}\label{Diagram:coequalization}
\begin{tikzcd}[column sep = 35]
M_1M_0A_0 \arrow[r, "\mu^{1,0}", shift left] \arrow[r,
"M_1a^{0,0}"', shift right] & M_1A_0 \arrow[r, "a^{1,0}"] & A_1.
\end{tikzcd}
\end{equation}
\end{enumerate}
\end{expl}
\begin{rem}
The free $M_n$-algebra on a set~$X$ is formed in the expected way,
in particular has
carriers~$M_0X,\dots,M_nX$, see~\cite[Prop.~6.3]{MPS15}.
\end{rem}
\paragraph*{Canonical algebras.}
We are going to review the basic definitions and results on
\emph{canonical $M_1$-algebras}~\cite{DMS19}. Fix a graded
monad $\M$ on $\mathbf{Set}$.
We write $(-)_i\colon\Alg_1(\M)\to\Alg_0(\M)$, $i = 0,1$,
for the functor which sends an $M_1$-algebra $A$ to its $i$-part
$A_i$ and sends a homomorphism $h\colon A\to B$ to
$h_i\colon A_i\to B_i$.
\begin{defn}\label{D:canonical}
An $M_1$-algebra~$A$ is \emph{canonical} if it is free over its
$0$-part with respect to $(-)_0\colon\Alg_1(\M)\to\Alg_0(\M)$.
\end{defn}
\begin{rem}\label{rem:canonical}
The universal property of a canonical algebra~$A$ is the following:
for every $M_1$-algebra $B$ and every $M_0$-algebra homomorphism
$h\colon A_0\to B_0$, there exists a unique $M_1$-algebra
homomorphism $h^\#\colon A\to B$ such that $(h^{\#})_0 = h_0$.
\end{rem}
\begin{notheorembrackets}
\begin{lem}[{\cite[Lem.~5.3]{DMS19}}]\label{L:canonical-algebra}
An $M_1$-algebra $A$ is canonical if and only if
(\ref{Diagram:coequalization}) is a coequalizer in $\Alg_0(\M)$.
\end{lem}
\end{notheorembrackets}
\begin{expl}\label{E:canonical}
Let $X$ be a set and let $\M$ be a depth-1 graded monad on $\mathbf{Set}.$
For each ${k\in\omega}$, we may view $M_kX$ as an $M_0$-algebra with
structure $\mu^{0,k}$. For the $M_1$-algebra $(M_kX, M_{k+1}X)$
(with main structure map $\mu^{1,k}$), the instance of
Diagram~(\ref{Diagram:coequalization}) required
by~\cref{L:canonical-algebra} is a coequalizer
by~\cref{L:depth-1}; that is, $(M_kX, M_{k+1}X, \mu^{1,k})$ is
canonical.
\end{expl}
\section{Pre-Determinization in Eilenberg-Moore}\label{sec:determinization}
We describe a generic notion of pre-determinization (the terminology
will be explained in \cref{rem:determinization}) for coalgebras of
an endofunctor $G$ on $\mathbf{Set}$ with respect to a given depth-1 graded
semantics $(\alpha,\M)$, generalizing the Eilenberg-Moore-style
coalgebraic determinization construction by Silva et
al.~\cite{BBSR13}. The behavioural equivalence game introduced in the
next section will effectively be played on the pre-determinization of
the given coalgebra. We will occasionally gloss over issues of finite
branching in the examples.
We first note that every $M_0$-algebra $A$ extends (uniquely) to a
canonical $M_1$-algebra $EA$ (with $0$-part $A$), whose $1$-part and
main structure are obtained by taking the coequalizer of the pair of
morphisms in \eqref{Diagram:coequalization} (canonicity then follows
by~\cref{L:canonical-algebra}). This construction forms the object
part of a functor $\Alg_0(\M)\to\Alg_1(\M)$ which sends a homomorphism
$h\colon A\to B$ to its unique extension $Eh:=h^\sharp\colon EA\to EB$
(cf.~\cref{rem:canonical}). We write $\mybar{0.8}{2pt}{M}_1$ for the endofunctor on
$\Alg_0(\M)$ given by
\begin{equation}\label{eq:barM}
\mybar{0.8}{2pt}{M}_1:= (\Alg_0(\M)\xra{E}\Alg_1(\M)\xra{(-)_1}\Alg_0(\M)),
\end{equation}
where $(-)_1$ is the functor taking $1$-parts. Thus, for an
$M_0$-algebra~$A_0$, $\mybar{0.8}{2pt}{M}_1(A_0)$ is the vertex of the coequalizer
\eqref{Diagram:coequalization}.
By \cref{E:canonical}, we have
\begin{equation}
\label{eq:barM-can}
\mybar{0.8}{2pt}{M}_1(M_kX,\mu^{0,k}_X)=(M_{k+1}X,\mu^{0,k+1}_X)
\end{equation}
for every set~$X$ and every $k\in\omega$. In particular,
\begin{equation}\label{Eq:determinization}
U\mybar{0.8}{2pt}{M}_1 F = M_1
\end{equation}
where $F\dashv U\colon \Alg_0(\M) \to \mathbf{Set}$ is the canonical
adjunction of the Eilenberg-Moore category of~$M_0$ -- that is,~$U$ is
the forgetful functor, and~$F$ takes free $M_0$-algebras, so
$FX=(M_0X,\mu^{00}_X)$. For an $M_1$-coalgebra
$f\colon X\to M_1X=U\mybar{0.8}{2pt}{M}_1 FX$, we therefore obtain a homomorphism
$f^\#\colon FX\to\mybar{0.8}{2pt}{M}_1 FX$ (in $\Alg_0(\M)$) via adjoint
transposition. This leads to the following pre-determinization
construction:
\begin{defn}\label{D:determinization}
Let $(\alpha, \M)$ be a depth-1 graded semantics on
$G$-coalgebras.
The \emph{pre-determinization} of a $G$-coalgebra
$(X, \gamma)$ under $(\alpha, \M)$
is the $\mybar{0.8}{2pt}{M}_1$-co\-al\-gebra
\begin{equation}\label{eq:det}
(\alpha_X\cdot\gamma)^\#\colon FX\to \mybar{0.8}{2pt}{M}_1 FX.
\end{equation}
\end{defn}
\begin{rem}\label{rem:determinization}
\begin{enumerate}
\item\label{item:predet-det} We call this construction a
\emph{pre-}de\-ter\-mi\-ni\-zat\-ion because it will serve as a
\emph{determinization} -- in the expected sense that the
underlying graded equivalence transforms into behavioural
equivalence on the determinization -- only under additional
conditions. Notice that given a $G$-coalgebra $(X,\gamma)$,
(finite-depth) behavioural equivalence on the $\mybar{0.8}{2pt}{M}_1$-coalgebra
$(\alpha_X\cdot\gamma)^*_0$ is given by the canonical cone into
the final chain
\begin{equation*}
1 \xla{!} \mybar{0.8}{2pt}{M}_1 1 \xla{\overbar M_1 !} \mybar{0.8}{2pt}{M}_1^{2}1 \xla{\overbar
M_1^2 !} \cdots
\end{equation*}
while graded behavioural equivalence on $(X,\gamma)$ is given by
the maps $\gamma^{(k)}$ into the sequence $M_01,M_11,M_21,\dots$,
equivalently given as homomorphisms
$(\gamma^{(k)})^*_0\colon FX\to(M_k1,\mu^{0,k}_1)$, whose domains
can, by~\eqref{eq:barM-can}, be written as the sequence
\begin{equation*}
F1,\quad \mybar{0.8}{2pt}{M}_1 1,\quad \mybar{0.8}{2pt}{M}_1^21,\quad \ldots
\end{equation*}
of $M_0$-algebras. The two sequences coincide in case $M_01=1$,
and indeed one easily verifies that in this case, finite-depth
behavioural equivalence on $\mybar{0.8}{2pt}{M}_1$-coalgebras coincides with
$(\alpha,\M)$-behavioural equivalence. For instance, this holds
in the case of probabilistic trace equivalence
(\cref{E:semantics}.\ref{item:sem-prob}), where $M_0=\CalD$, so
$M_01=1$. In the case of trace equivalence
(\cref{E:semantics}.\ref{item:sem-trace}), $M_01=1$ can be
ensured by restricting to serial labelled transition systems,
which, as noted in \cref{E:coalg}.\ref{E:coalg:1}, are
coalgebras for $\pow^+(\A\times -)$ with~$\pow^+$ denoting
non-empty powerset, so that in the corresponding variant of the
graded monad for trace semantics, we have $M_0=\pow^+$ and hence
$M_01=1$.
On the other hand, the condition $M_01=1$ fails for trace
equivalence of unrestricted systems where we have~\mbox{$M_0=\pow$,}
which in fact
constitutes a radical example where behavioural equivalence on the
pre-determization is strictly coarser than the given graded
equivalence. In this case, since the actions preserve the
bottom~$0$, we in fact have~$\mybar{0.8}{2pt}{M}_1 1=1$: it follows that \emph{all}
states in $\mybar{0.8}{2pt}{M}_1$-coalgebras are behaviourally equivalent (as
the unique coalgebra structure on~$1$ is final).
\item Using~\eqref{Eq:determinization}, we see that the underlying
map of the pre-determinization of a coalgebra $(X,\gamma)$ is
$(\alpha_X \cdot \gamma)^*_0 \colon M_0X \to M_1 X = U_0\mybar{0.8}{2pt}{M}_1 F_0
X$ (written using graded Kleisli star as
per~\cref{N:star}). Indeed, one easily shows that
$(\alpha_X \cdot\gamma)^*_0$ is an $M_0$-algebra
morphism
$(M_0 X, \mu^{0,0}_X)\to\mybar{0.8}{2pt}{M}_1
(M_0X,\mu^{0,0}_X)=(M_1X,\mu^{0,1}_X)$ satisfying
$(\alpha_X \cdot \gamma)^*_0 \cdot \eta_X = \alpha_X \cdot
\gamma$. Thus, it is the adjoint transpose in~\eqref{eq:det}.
\item As indicated above, pre-de\-ter\-mi\-ni\-za\-tion captures the
Eilenberg-Moore style generalized determinization by Silva et
al.~\cite{BBSR13} as an instance. Indeed, for a monad $T$ and an
endofunctor $F$, both on the category $\CatC$, one considers a
coalgebra $\gamma\colon X \to FTX$. Assuming that $FTX$ carries
the structure of an Eilenberg-Moore algebra for $T$ (e.g.~because
the functor~$F$ lifts to the category of Eilenberg-Moore algebras
for $T$), one obtains an
$F$-coalgebra $\gamma^\sharp\colon TX \to FTX$ by taking the
unique homomorphic extension of $\gamma$. Among the concrete
instances of this construction are the well-known powerset
construction of non-deterministic automata (take $T = \pow$ and
$F = 2 \times (-)^A$), the non-determinization of alternating
automata and that of Markov decision processes~\cite{JSS15}.
To view this as an instance of pre-de\-ter\-mi\-ni\-za\-tion, take
the graded monad with $M_n = F^nT$
(\cref{E:graded-monad}.\ref{E:graded-monad:4}), let $G = FT$,
and let $\alpha = \mathsf{id}_{FT}$. Using~\eqref{Eq:determinization}, we
see that $(\alpha_X \cdot \gamma)^\#$ in~\eqref{eq:det} is the
generalized determinization $\gamma^\sharp$ above.
\item We emphasize that the construction applies completely
universally; e.g.~we obtain as one instance a `determinization' of
serial labelled transition systems modulo similarity, which
transforms a coalgebra $X\to\pow^+(\A\times X)$ into an
$\mybar{0.8}{2pt}{M}_1$-coalgebra
$\pow^+(X)\to\pow^{\downarrow}(\A\times \pow^+(X))$
(\cref{E:graded-theory}.\ref{item:simulation-a}); instantiating
the observations in item~\ref{item:predet-det}, we obtain that
finite-depth behavioural equivalence of $\mybar{0.8}{2pt}{M}_1$-coalgebras (see
\cref{expl:barM} for the description of~$\mybar{0.8}{2pt}{M}_1$) coincides with
finite-depth mutual similarity.
\end{enumerate}
\end{rem}
\begin{expl}\label{expl:barM}
We give a description of the functor~$\mybar{0.8}{2pt}{M}_1$ on $M_0$-algebras
constructed above in some of the running examples.
\begin{enumerate}[wide]
\item For graded monads of the form $\M_G$, which capture
finite-depth behavioural equivalence
(\cref{E:graded-monad}.\ref{E:graded-monad:1}), we have
$M_0=\Id$, so $M_0$-algebras are just sets, and under this
correspondence, $\mybar{0.8}{2pt}{M}_1$ is the original functor~$G$.
\item\label{item:mono-traces} Trace semantics of LTS
(\cref{E:graded-theory}.\ref{item:traces-a}): Distribution of
actions over the join semilattice operations ensures that depth-1
terms over a join semilattice~$X$ can be normalized to sums of the
form $\sum_{a\in \A}a(x_a)$, with $x_a\in X$ (possibly
$x_a=0$). It follows that $\mybar{0.8}{2pt}{M}_1$ is simply given by
$\mybar{0.8}{2pt}{M}_1 X=X^\A$ ($\A$-th power, where~$\A$ is the finite set of labels).
Other forms of trace semantics are treated similarly.
\item In the graded theory for simulation
(\cref{E:graded-theory}.\ref{item:simulation-a}), the
description of the induced graded monad~\cite{DMS19} extends
analogously to~$\mybar{0.8}{2pt}{M}_1$, yielding that $\mybar{0.8}{2pt}{M}_1 B$ is the join
semilattice of finitely generated downwards closed subsets of
$\A\times B$ where, again,~$\A$ carries the discrete
ordering.
\end{enumerate}
\end{expl}
\begin{rem}
The assignment $\M \mapsto \mybar{0.8}{2pt}{M}_1$ exhibits the category $\mathscr{K}$ of
depth-1 graded monads whose $0$-part is the monad
$(M_0, \eta, \mu^{0,0})$ as a coreflective subcategory (up to
isomorphism) of the category $\Fun(\mathbf{Set}^{M_0})$ of all endofunctors
on the Eilenberg-Moore category of that monad.
Indeed, given an endofunctor $H$ on $\mathbf{Set}^{M_0}$ we form the
$6$-tuple
$(M_0, UHF, \eta, \mu^{0,0}, \mu^{0,1},\mu^{1,0}),$
where the latter two natural transformations arise from the counit
$\varepsilon\colon FU \to \Id$ of the canonical adjunction $F\dashv U\colon\Alg_0(\M_0)\to\mathbf{Set}$:
\begin{align*}
\mu^{0,1} &= (M_0UHF = UFUHF \xra{U\varepsilon HF} UHF\big);\\
\mu^{1,0} &= (UHFM_0 = UHFUF \xra{UHF\varepsilon F} UHF\big).
\end{align*}
It is not difficult to check that this data satisfies all applicable
instances of the graded monad laws. Hence, it specifies a
depth-1 graded monad $R(H)$~\cite[Thm.~3.7]{DMS19}; this
assignment is the object part of a functor $R\colon\Fun(\mathbf{Set}^{M_0})\to\mathscr{K}$.
In the other direction, we have for each depth-1 graded monad $\M$
with $0$-part $M_0$ the endofunctor $I(\M) =
\mybar{0.8}{2pt}{M}_1$. By~\eqref{Eq:determinization}, we have $RI(\M) = \M$.
Now, given a depth-1 graded monad $\M$ and an endofunctor $H$ on
$\mathbf{Set}^{M_0}$, consider $\mybar{0.8}{2pt}{M}_1 = IR(H)$ (so that $M_1 = UHF$). We
obtain for every algebra $(A,a)$ in $\mathbf{Set}^{M_0}$ a homomorphism
$c_{(A,a)}\colon \mybar{0.8}{2pt}{M}_1 (A,a) \to H(A,a)$ by using the coequalizer
defining $\mybar{0.8}{2pt}{M}_1(A,a)$ (cf.~\cref{L:canonical-algebra}):
\[
\begin{tikzcd}
M_1M_0 A
\ar[yshift=2]{r}{\mu^{0,1}_A}
\ar[yshift=-2]{r}[swap]{M_1a}
&
M_1A=HFA
\ar[->>]{r}
\ar{rd}{Ha}
&
\mybar{0.8}{2pt}{M}_1 (A,a)
\ar[dashed]{d}{c_{(A,a)}}
\\
&&
H(A,a)
\end{tikzcd}
\]
Note that $M_1M_0A$ is the carrier of the Eilenberg-Moore algebra
$HFA = H(M_0A, \mu^{0,0}_A)$ and similarly for the middle object (in
both cases we have omitted the algebra structures given by
$\mu^{0,1}_{M_0 A}$ and $\mu^{0,1}_A$ coming from the graded monad
$I(H)$). It is easy to see that the homomorphism $Ha$ merges the
parallel pair, and therefore we obtain the dashed morphism such that
the triangle commutes, yielding the components of a natural
transformation $c\colon \mybar{0.8}{2pt}{M}_1 \to H$ which is couniversal: for each
depth-1 graded monad $\mathbb N$ whose $0$-part is $M_0$ and each
natural transformation $h\colon \mybar{0.8}{2pt}{M}_1 \to H$, there is a unique
natural transformation $m_1\colon N_1 \to M_1 = UHF$ such that
$m = (id_{M_0}, m_1)$ is a morphism of graded monads from
$\mathbb N$ to~$\M$ and $c \cdot I(m) = h$. This shows that $I
\dashv R$.
\end{rem}
\section{Behavioural Equivalence Games}\label{S:games}
Let $\CalS = (\alpha, \M)$ be a depth-1 graded semantics for an
endofunctor $G$ on $\mathbf{Set}$. We are going to describe a game for playing
out depth-$n$ behavioural equivalence under $\CalS$-semantics on
states in $G$-coalgebras.
We first give a description of the game in the syntactic language of
graded equational reasoning, and then present a more abstract
categorical definition. Given a coalgebra $(X,\gamma)$, we will see
the states in~$X$ as variables, and the map $\alpha_X\cdot\gamma$ as
assigning to each variable~$x$ a depth-1 term over~$X$; we can regard
this assignment as a (uniform-depth) substitution~$\sigma$. A
configuration of the game is a pair of depth-0 terms over~$X$; to play
out the equivalence of states $x,y\in X$, the game is started from the
initial configuration $(x,y)$. Each round of the game then proceeds
in two steps: First, Duplicator plays a set~$Z$ of equalities between
depth-0 terms over~$X$ that she claims to hold under the
semantics. This move is admissible in the configuration $(s,t)$
if~$Z\vdash s\sigma=t\sigma$. Then, Spoiler challenges one of the
equalities claimed by Duplicator, i.e.~picks an
element~$(s',t')\in Z$, which then becomes the next configuration. Any
player who cannot move, loses. After~$n$ rounds have been played,
reaching the final configuration $(s,t)$, Duplicator wins if
$s\theta =t\theta$ is a valid equality, where~$\theta$ is a
substitution that identifies all variables. We refer to this last
check as \emph{calling the bluff}. Thus, the game plays out an
equational proof between terms obtained by unfolding depth-0 terms
according to~$\sigma$, cutting off after~$n$ steps.
We introduce some technical notation to capture the notion of
admissibility of~$Z$ abstractly:
\begin{notn}\label{N:admissible}
Let $Z\subseteq M_0X\times M_0X$ be a relation, and let
$c_Z\colon M_0X\to C_Z$ be the coequalizer in $\Alg_0(\M)$ of the
homomorphisms $ \ell_0^*, r_0^*\colon M_0Z\to M_0X $ given by
applying the Kleisli star~\eqref{Eqn:Kleisli-star} to the
projections $\ell, r\colon Z\to M_0X$. We define a homomorphism
$\mybar{0.7}{1.75pt}{Z}\colon M_0X\to M_1C_Z$ in $\Alg_0(\M)$ by
\begin{equation}\label{eq:barZ}
\mybar{0.7}{1.75pt}{Z} = \big(M_0X\xra{(\alpha_X\cdot\gamma)^*_0} M_1X = \mybar{0.8}{2pt}{M}_1 M_0X
\xra{\overbar M_1 c_Z} \mybar{0.8}{2pt}{M}_1 C_Z\big)
\end{equation}
(omitting algebra structures, and again using the Kleisli star).
\end{notn}
\begin{rem}\label{R:coeq}
Using designators as in \cref{N:admissible}, we note:
\begin{enumerate}
\item\label{R:coeq:1}\label{R:coeq:2} By the universal property of
$\eta_Z\colon Z \to M_0Z$, an $M_0$-algebra homomorphism
$h\colon M_0X \to A$ merges $\ell, r$ iff it merges
$\ell^*_0, r^*_0$. This implies that the coequalizer $M_0X \xra{c_Z}C_Z$
quotients the free $M_0$-algebra $M_0X$ by the congruence
generated by~$Z$. Also, it follows that in case~$Z$ is already an
$M_0$-algebra and $\ell, r\colon Z \to M_0X$ are $M_0$-algebra
homomorphisms (e.g.~when $Z$ is a congruence), one may take
$c_Z\colon M_0X \to C_Z$ to be the coequalizer of $\ell, r$.
\item\label{item:barZ} The map $\mybar{0.7}{1.75pt}{Z}\colon M_0X\to\mybar{0.8}{2pt}{M}_1 C_Z$
associated to the relation $Z$ on $M_0X$ may be understood as
follows. As per the discussion above, we view the states of the
coalgebra $(X,\gamma)$ as variables, and the map
$X\xra{\gamma} GX\xra{\alpha_X} M_1X$ as a substitution mapping a
state $x \in X$ to the equivalence class of depth-1 terms encoding
the successor structure $\gamma(x)$. The second factor $\mybar{0.8}{2pt}{M}_1 c_Z$
in~\eqref{eq:barZ} then essentially applies the relations given by
the closure of $Z$ under congruence w.r.t.~depth-0 operations,
embodied in~$c_Z$ as per~\ref{R:coeq:1}, under depth-1 operations
in (equivalence classes of) of depth-1 terms in $M_1X$; to sum up,
$\mybar{0.8}{2pt}{M}_1 c_Z$ merges a pair of equivalence classes $[t], [t']$ iff
$Z\vdash t=t'$ in a depth-1 theory presenting $\M$ (in notation as
per \cref{sec:prelims}).
\end{enumerate}
\end{rem}
\begin{defn}\label{def:game}
For $n\in\omega$, the \emph{$n$-round $\CalS$-behavioural
equivalence game} $\CalG_n(\gamma)$ on a $G$-coalgebra
$(X, \gamma)$ is played by Duplicator (D) and Spoiler
(S). \emph{Configurations} of the game are pairs
$(s,t)\in M_0(X)\times M_0(X)$. Starting from an \emph{initial
configuration} designated as needed, the game is played for~$n$
rounds. Each round proceeds in two steps, from the current
configuration~$(s,t)$: First, D chooses a relation
$Z\subseteq M_0X\times M_0X$ such that $\mybar{0.7}{1.75pt}{Z}(s) = \mybar{0.7}{1.75pt}{Z}(t)$
(for~$\mybar{0.7}{1.75pt}{Z}$ as per \cref{N:admissible}). Then,~S
picks an element~$(s',t') \in Z$, which becomes the next configuration. Any
player who cannot move at his turn, loses. After~$n$ rounds have
been played,~D wins if $M_0!(s_n) = M_0!(t_n)$; otherwise,~S wins.
\end{defn}
\begin{rem}
By the description of~$\mybar{0.7}{1.75pt}{Z}$ given in
\cref{R:coeq}.\ref{item:barZ}, the categorical definition of the
game corresponds to the algebraic one given in the lead-in
discussion. The final check whether $M_0!(s_n)=M_0!(t_n)$
corresponds to what we termed \emph{calling the bluff}. The apparent
difference between playing either on depth-0 terms or on elements
of~$M_0X$, i.e.~depth-0 terms modulo derivable equality, is absorbed
by equational reasoning from~$Z$, which may incorporate also the
application of depth-0 equations.
\end{rem}
\begin{rem}
A pair of states coming from different coalgebras $(X,\gamma)$ and
$(Y,\delta)$ can be treated by considering those states as elements
of the coproduct of the two coalgebras:
\[
X+Y \xra{\gamma + \delta} GX + GY \xra{[G\mathsf{inl}, G\mathsf{inr}]} G(X+Y),
\]
where $X \xra{\mathsf{inl}} X+Y \xla{\mathsf{inr}} Y$ denote the coproduct
injections. There is an evident variant of the game played on two
different coalgebras $(X,\gamma)$, $(Y,\delta)$, where moves of~D
are subsets of $M_0X\times M_0Y$. However, completeness of this
version depends on additional assumptions on~$\M$, to be clarified
in future work. For instance, if we instantiate the graded monad for
traces with effects specified by~$T$
(\cref{E:graded-monad}.\ref{item:T-traces}) to~$T$ being the free
real vector space monad, and a state~$x\in X$ has successor
structure $2\cdot x'-2\cdot x''$, then~D can support equivalence
between~$x$ and a deadlock~$y\in Y$ (with successor structure~$0$)
by claiming that $x'=x''$, but not by any equality between terms
over~$X$ with terms over~$Y$. That is, in this instance, the variant
of the game where~D plays relations on $M_0X\times M_0Y$ is not
complete.
\end{rem}
\noindent Soundness and completeness of the game with respect to
$\CalS$-behavioural equivalence is stated as follows.
\begin{thm}\label{T:sound-complete}
Let $(\alpha, \M)$ be a depth-1 graded semantics for a functor~$G$
such that $\mybar{0.8}{2pt}{M}_1$ preserves monomorphisms, and let $(X, \gamma)$ be
a $G$-coalgebra. Then, for all $n\in\omega$,~D wins $(s, t)$ in
$\CalG_n(\gamma)$ if and only if
$(\gamma^{(n)})^*_0(s) = (\gamma^{(n)})^*_0(t)$.
\end{thm}
\begin{cor}
States $x,y$ in a $G$-coalgebra $(X, \gamma)$ are
$\CalS$-behaviourally equivalent if and only if~D wins
$(\eta(x), \eta(y))$ for all $n\in\omega$.
\end{cor}
\begin{rem}\label{rem:monos}
In algebraic terms, the condition that~$\mybar{0.8}{2pt}{M}_1$ preserves
monomorphisms amounts to the following: In the derivation of an
equality of depth-1 terms~$s,t$ over~$X$ from depth-0 relations
over~$X$ (i.e.~from a presentation of an $M_0$-algebra by relations
on generators~$X$), if~$X$ is included in a larger set~$Y$ of
variables with relations that conservatively extend those on~$X$,
i.e.~do not imply additional relations on~$X$, then it does not
matter whether the derivation is conducted over~$X$ or more
liberally over~$Y$. Intuitively, this property is needed because not
all possible $n$-step behaviours, i.e.~elements of~$Y=M_n1$, are
realized by states in a given coalgebra on~$X$. Preservation of
monos by~$\mybar{0.8}{2pt}{M}_1$ is automatic for graded monads of the form $\M_G$
(\cref{E:graded-monad}.\ref{E:graded-monad:1}), since $M_0=\Id$
in this case. In the other running examples, preservation of monos
is by the respective descriptions of~$\mybar{0.8}{2pt}{M}_1$ given in
\cref{expl:barM}.
\end{rem}
\begin{expl}\label{expl:bisim-instance}
We take a brief look at the instance of the generic game for the
case of bisimilarity on finitely branching LTS (more extensive
examples are in \cref{sec:cases}), i.e.~we consider the depth-1
graded semantics $(\mathsf{id}, \M_G)$ for the functor
$G=\pow_{\mathsf f}(\A\times(-))$. In this case, $M_0=\Id$, so when playing on
a coalgebra $(X,\gamma)$,~D plays relations~$Z\subseteq X\times
X$. If the successor structures of states~$x,y$ are represented by
depth-1 terms $\sum_{i}a_i(x_i)$ and $\sum_j b_j(y_j)$,
respectively, in the theory $\JSL(\A)$
(\cref{E:graded-theory}.\ref{item:jsl-a}), then~D is allowed to
play~$Z$ iff the equality $\sum_{i}a_i(x_i)=\sum_j b_j(y_j)$ is
entailed by~$Z$ in $\JSL(\A)$. This, in turn, holds iff for
each~$i$, there is~$j$ such that $a_i=b_j$ and $(x_i,y_j)\in Z$, and
symmetrically. Thus~$Z$ may be seen as a pre-announced
non-deterministic winning strategy for~D in the usual bisimilarity
game where~S moves first (\cref{sec:prelims}):~D announces that
if~S moves from, say,~$x$ to~$x_i$, then she will respond with
some~$y_j$ such that $a_i=b_j$ and $(x_i,y_j)\in Z$.
\end{expl}
\section{Infinite-depth behavioural
equivalence}\label{sec:infinte-depth}
\sloppypar
\noindent We have seen in \cref{sec:determinization} that in case
\mbox{$M_01=1$}, $(\alpha, \M)$-behavioural equivalence
on~$G$-coalgebras coincides, via a determization construction, with
finite-depth behavioural equivalence on $\mybar{0.8}{2pt}{M}_1$-coalgebras for a
functor $\mybar{0.8}{2pt}{M}_1$ on $M_0$-algebras constructed from~$\M$. If~$G$ is
finitary, then finite-depth behavioural equivalence coincides with
full behavioural equivalence~(\cref{rem:finite-depth}), but in
general, finite-depth behavioural equivalence is strictly
coarser. Previous treatments of graded semantics stopped at this
point, in the sense that for non-finitary functors (which describe
infinitely branching systems), they did not offer a handle on
infinite-depth equivalences such as full bisimilarity or
infinite-trace equivalence. In case $M_01=1$, a candidate for a notion
of infinite-depth equivalence induced by a graded semantics arises via
full behavioural equivalence of $\mybar{0.8}{2pt}{M}_1$-coalgebras. We fix this notion
explicitly:
\begin{defn}
States $x,y$ in a $G$-coalgebra $(X,\gamma)$ are
\emph{in\-fin\-ite-depth $(\alpha,\M$)-behaviourally equivalent}
if~$\eta(x)$ and~$\eta(y)$ are behaviourally equivalent in the
pre-det\-er\-min\-i\-za\-tion of~$(X,\gamma)$ as described in
\cref{S:games}.
\end{defn}
\noindent We hasten to re-emphasize that this notion in general only
makes sense in case $M_01=1$. We proceed to show that infinite-depth
equivalence is in fact captured by an infinite variant of the
behavioural equivalence game of \cref{S:games}.
Since infinite depth-equivalences differ from finite-depth ones only
in settings with infinite branching, we do not assume in this section
that~$G$ or~$\M$ are finitary, and correspondingly work with
generalized graded theories where operations may have infinite
arities~\cite{MPS15}; we assume arities to be cardinal numbers. We
continue to be interested only in depth-1 graded monads and theories,
and we fix such a graded monad~$\M$ and associated graded theory for the
rest of this section. The notion of derivation is essentially the same
as in the finitary case, the most notable difference being that the
congruence rule is now infinitary, as it has one premise for each
argument position of a given possibly infinitary operator. We do not
impose any cardinal bound on the arity of operations; if all
operations have arity less than~$\kappa$ for a regular
cardinal~$\kappa$, then we say that the monad is
\emph{$\kappa$-ary}.
\begin{rem}\label{R:final-coalg}
One can show using tools from the theory of locally presentable
categories that $\mybar{0.8}{2pt}{M}_1$ has a final coalgebra if~$\M$ is
$\kappa$-ary in the above sense. To see this, first note that
$\Alg_0(\M)$ is locally $\kappa$-presentable if $M_0$ is
$\kappa$-accessible~\cite[Remark~2.78]{AR94}. Using a somewhat
similar argument one can prove that $\Alg_1(\M)$ is also locally
$\kappa$-presentable. Moreover, the functor $\mybar{0.8}{2pt}{M}_1$ is
$\kappa$-accessible, being the composite~\eqref{eq:barM} of the left
adjoint $E\colon \Alg_0(\M) \to \Alg_1(\M)$ (which preserves all
colimits) and the $1$-part functor
$(-)_1\colon \Alg_1(\M) \to \Alg_0(\M)$, which preserves
$\kappa$-filtered colimits since those are formed componentwise.
It follows that $\mybar{0.8}{2pt}{M}_1$ has a final
coalgebra~\cite[Exercise~2j]{AR94}. Alternatively, existence of a
final $\mybar{0.8}{2pt}{M}_1$-coalgebra will follow from \cref{thm:fin-coalg}
below. %
\end{rem}
\noindent
Like before, we \emph{assume that $\mybar{0.8}{2pt}{M}_1$ preserves monomorphisms}.
\begin{expl}
We continue to use largely the same example theories as in
\cref{E:graded-theory}, except that we allow operations to be
infinitary. For instance, the \emph{graded theory of complete join
semilattices over~$\A$} has as depth-1 operations all formal sums
$\sum_{i\in I}a_i(-)$ where~$I$ is now some (possibly infinite)
index set; the axioms are then given in the same way as in
\cref{E:graded-theory}.\ref{item:jsl-a}, and all depth-1
equations
\[
\textstyle \sum_{i\in I}a_i(x) = \sum_{j\in J} b_j(y)
\]
such that $\{(a_i, x_i)\mid i\in I\}=\{(b_j, y_j)\mid j\in J\}$.
This theory presents the graded monad~$\M_G$ for
$G=\pow(\A\times(-))$.
\end{expl}
\noindent The infinite game may then be seen as defining a notion of
derivable equality on infinite-depth terms by playing out a
non-standard, infinite-depth equational proof; we will make this view
explicit further below. In a less explicitly syntactic version, the
game is defined as follows.
\begin{defn}[Infinite behavioural equivalence game]
The \emph{infinite $(\alpha,\M$)-behavioural equivalence game}
$\CalG_\infty(\gamma)$ on a $G$-coalgebra~$(X,\gamma)$ is played by
Spoiler~(S) and Duplicator~(D) in the same way as the finite
behavioural equivalence game (\cref{def:game}) except that the
game continues forever unless one of the players cannot move. Any
player who cannot move, loses. Infinite matches are won by~D.
\end{defn}
\noindent As indicated above, this game captures infinite-depth
$(\alpha,\M)$-behavioural equivalence (under the running assumption
that~$\mybar{0.8}{2pt}{M}_1$ preserves monomorphisms):
\begin{thm}\label{thm:infinite-depth-games}
Given a $G$-coalgebra~$(X,\gamma)$, two states~$s,t$ in the
pre-determinization of~$\gamma$ are behaviourally equivalent iff D
wins the infinite $(\alpha,\M$)-behavioural equivalence game
$\CalG_\infty(\gamma)$ from the initial configuration $(s,t)$.
\end{thm}
\begin{cor}
Two states $x,y$ in a $G$-coalgebra $(X,\gamma)$ are infinite-depth
$(\alpha,\M)$-behaviourally equivalent iff D wins the infinite
$(\alpha,\M$)-behavioural equivalence game $\CalG_\infty(\gamma)$
from the initial configuration $(\eta(x),\eta(y))$.
\end{cor}
\begin{rem}
Like infinite-depth $(\alpha,\M)$-behavioural equivalence, the
infinite $(\alpha,\M$)-behavioural equivalence game is sensible only
in case $M_01=1$. For instance, as noted in
\cref{sec:determinization}, in the graded monad for trace
semantics (\cref{E:graded-theory}.\ref{item:pt-a}), which does not
satisfy this condition, behavioural equivalence of
$\mybar{0.8}{2pt}{M}_1$-coalgebras is trivial. In terms of the game,~D wins every
position in $\CalG_\infty(\gamma)$ by playing
$Z=\{(t,0)\mid t\in M_0X\}$ -- since the actions preserve the bottom
element~$0$, this is always an admissible move. In the terminology
introduced at the beginning of \cref{S:games}, the reason that~D
wins in this way is that in the infinite game, her bluff is never
called ($M_0!(t)$ will in general not equal $M_0!(0)=0$). However, see
\cref{expl:inf-depth}.\ref{item:inf-trace} below.
\end{rem}
\begin{expl}\label{expl:inf-depth}
\begin{enumerate}
\item\label{item:inf-trace} As noted in
\cref{rem:determinization}.\ref{item:predet-det}, the graded
monad for trace semantics can be modified to satisfy the
condition~$M_01=1$ by restricting to serial labelled transition
systems. In this case, infinite-depth $(\alpha,\M)$-behavioural
equivalence is precisely infinite trace equivalence, and captured
by the corresponding instance of the infinite behavioural
equivalence game.
\item In the case of graded monads $\M_G$
(\cref{E:graded-monad}.\ref{E:graded-monad:1}), which so far
were used to capture finite-depth behavioural equivalence in the
standard (branching-time) sense, we have $M_0=\Id$; in particular,
$M_01=1$. In this case, the infinite-depth behavioural equivalence
game instantiates to a game that characterizes full behavioural
equivalence of $G$-coalgebras. Effectively, a winning strategy
of~D in the infinite game~$\CalG_\infty(\gamma)$ on a
$G$-coalgebra $(X,\gamma)$ amounts to a
relation~$R\subseteq X\times X$ (the positions of~D actually
reachable when~D follows her winning strategy) that is a
\emph{precongruence} on~$(X,\gamma)$~\cite{AczelMendler89}.
\end{enumerate}
\end{expl}
\begin{rem}[Fixpoint computation]
Via its game characterization (\cref{thm:infinite-depth-games}),
infinite-depth $(\alpha,\M)$-behavioural equivalence can be cast as
a greatest fixpoint, specifically of the monotone function~$F$ on
$\pow(M_0X\times M_0X)$ given by
\begin{equation*}
F(Z)=\{(s,t)\in M_0X\times M_0X\mid \mybar{0.7}{1.75pt}{Z}(s)=\mybar{0.7}{1.75pt}{Z}(t)\}.
\end{equation*}
If~$M_0$ preserves finite sets, then this fixpoint can be computed
on a finite coalgebra $(X,\gamma)$ by fixpoint iteration; since
$F(Z)$ is clearly always an equivalence relation, the iteration
converges after at most $|M_0X|$ steps, e.g.~in exponentially many
steps in case $M_0=\pow$. In case $M_0X$ is infinite (e.g.~if
$M_0=\CalD$), then one will need to work with finite representations
of subspaces of~$M_0X\times M_0X$. We leave a more careful analysis
of the algorithmics and complexity of solving infinite
$(\alpha,\M)$-behavioural equivalence games to future work. We do
note that on finite coalgebras, we may assume w.l.o.g.~that both the
coalgebra functor~$G$ and graded monad~$\M$ are finitary, as we can
replace them with their finitary parts if needed (e.g.~the powerset
functor $\pow$ and the finite powerset functor~$\pow_{\mathsf f}$ have
essentially the same finite coalgebras). If additionally~$M_01=1$,
then~$(\alpha,\M)$-behavioural equivalence coincides with
infinite-depth $(\alpha,\M)$-behavioural equivalence, so that we
obtain also an algorithmic treatment of $(\alpha,\M)$-behavioural
equivalence. By comparison, such a treatment is not immediate from
the finite version of the game, in which the number of rounds is
effectively chosen by Spoiler in the beginning.
\end{rem}
\noindent Assume from now on that $\M$ is $\kappa$-ary.
We note that in this case, we can describe the final $\mybar{0.8}{2pt}{M}_1$-coalgebra
in terms of a syntactic variant of the infinite game that is played on
infinite-depth terms, defined as follows.
\begin{defn}[Infinite-depth terms]
Recall that we are assuming a graded signature~$\Sigma$ with
operations of arity less than~$\kappa$. A \emph{(uniform)
infinite-depth \mbox{($\Sigma$-)}term} is an infinite tree with
ordered branching where each node is labelled with an
operation~$f\in\Sigma$, and then has as many children as given
by the arity of~$f$; when there is no danger of confusion, we
will conflate nodes with (occurrences of) operations. We require
moreover that every infinite path in the tree contains infinitely
many depth-1 operations (finite full paths necessarily end in
constants). We write $\Termsarg{\Sigma,\infty}$ for the set of
infinite-depth $\Sigma$-terms. By cutting off at the top-most
depth-1 operations, we obtain for every $t\in\Termsarg{\Sigma,\infty}$
a \emph{top-level decomposition} $t=t_1\sigma$ into a depth-1 term
$t_1\in\Termsarg{\Sigma,1}(X)$, for some set~$X$, and a substitution
$\sigma\colon X\to\Termsarg{\Sigma,\infty}$.
\end{defn}
\begin{defn}
The \emph{syntactic infinite $(\alpha,\M$)-behavioural equivalence
game} $\CalG^\mathsf{syn}_\infty$ is played by~S and~D. Configurations of
the game are pairs $(s,t)$ of infinite-depth $\Sigma$-terms. For
such $(s,t)$, we can assume, by the running assumption that~$\mybar{0.8}{2pt}{M}_1$
preserves monomorphisms, that the top level decompositions
$s=s_1\sigma$, $t=t_1\sigma$ are such that
$s_1,t_1\in\Termsarg{\Sigma,1}(X)$,
$\sigma\colon X\to\Termsarg{\Sigma,\infty}$ for the
same~$X,\sigma$. Starting from a designated initial configuration,
the game proceeds in rounds. In each round, starting from a current
such configuration~$(s,t)$,~D first chooses a
relation~$Z\subseteq\Termsarg{\Sigma,0}(X)\times\Termsarg{\Sigma,0}(X)$
such that $Z\vdash s_1 = t_1$ in the graded theory that
presents~$\M$ (cf.~\cref{sec:prelims}). \mbox{Then, S} selects an
element $(u,v)\in Z$, upon which the game reaches the new
configuration $(u\sigma,v\sigma)$. The game proceeds forever unless
a player cannot move. Again, any player who cannot move, loses, and
infinite matches are won by~D. We write $s\sim_{\mathcal{G}} t$ if~D
wins~$\CalG^\mathsf{syn}_\infty$ from position $(s,t)$.
\end{defn}
\noindent We construct an $\mybar{0.8}{2pt}{M}_1$-coalgebra on the set
\(
U=\Termsarg{\Sigma,\infty}/{\sim_{\mathcal{G}}}
\)
of infinite-depth terms modulo the winning region of~D as follows. We
make~$U$ into an $M_0$-algebra by letting depth-0 operations act by
term formation. We then define the coalgebra
structure~$\zeta\colon U \to \mybar{0.8}{2pt}{M}_1 U$ by
\(
\zeta(q(t_1\sigma)) = \mybar{0.8}{2pt}{M}_1((q\cdot\sigma)^*_0)([t_1])
\)
(using Kleisli star as per \cref{N:star}) where
$t_1\sigma$ is a top-level decomposition of an infinite-depth term,
with $t_1\in\Termsarg{\Sigma,1}(X)$;
\[
[-]\colon \Termsarg{\Sigma,1}(X)\to M_1X=\mybar{0.8}{2pt}{M}_1 M_0 X
\quad\text{and}\quad
q\colon \Termsarg{\Sigma,\infty}\to U
\]
denote canonical quotient maps.
These data are well-defined.%
\begin{thm}\label{thm:fin-coalg}
The coalgebra $(U,\zeta)$ is final.%
\end{thm}
\section{Case studies}\label{sec:cases}
We have already seen (\cref{expl:bisim-instance}) how the standard
bisimilation game arises as an instance of our generic game. We
elaborate on some further examples. %
\takeout{\subsection{Trace equivalence} In this subsection, we
illustrate the admissible moves of Duplicator in concrete terms and,
subsequently, establishing the game-theoretic characterisation of
trace equivalence.
\bknote{Example~2.9 does not talk about trace equivalence, we should explain the connection better.}
To this end, consider an LTS $\gamma\colon X\to\pow_{\mathsf f}(\A\times X)$
and recall the depth-1 graded monad attributed to trace equivalence
from \cite{MPS15}.
\takeout{In particular, $\Sigma=\{\bot,\vee\} \cup \{a.\_ \mid a\in \A\}$ with action prefixing as the only depth-1 operation; $\E$ has all the axioms of join semilattice and the following depth-1 equations.
\[
a.\bot = \bot \qquad a.(x\vee y) = a.x \vee a.y
\]}
\takeout{We begin by stating the coequaliser $C_Z,c_Z$ for a given relation $Z$ (cf.\thinspace Notation~\ref{N:admissible}) in more concrete terms. Define $Z' \subseteq M_1 X \times M_1 X$ as follows:
\[
t \mathrel {Z'} t' \iff \exists_{s\in M_1 Z}\ l_1^*s =t \land r_1^*s=t'.
\]
Then the object $C_Z$ is given by the quotient set $M_1X/ Z''$, where $Z''$ is the least equivalence which is closed with respect to all the depth-0 operations and which includes $Z'$. In short, we say that $Z''$ is the \emph{congruence closure} of $Z'$.
\begin{propn}
The object $C_Z$ together with its quotient map $c_Z$ indeed forms the coequaliser of the arrows $l_1^*,r_1^*$.
\end{propn}}
\begin{expl}
Consider the following process terms (defined in a fragment of CCS
signature):
\[
p_1\equiv a.p_1',\ p_2\equiv a.p_2' + b.p_2'',\ p_3\equiv b.p_3',
\]
where $p_1',p_2',p_2'',p_3'$ are all inaction (i.e.~the constant $\0$) and $\equiv$ denotes the syntactic equality. Clearly we find that the set $s=\{p_1,p_2\}$ and $t=\{p_2,p_3\}$ are trace equivalent.
In particular, $s,t$ have the same traces of length 1, which we argue next through our game. Duplicator plays the relation $Z$ viewed as a set of equations between $M_0$-terms:
\[
Z = \{p_1' + p_2' = p_2',\ p_3' + p_2'' = p_2'' \}.
\]
We claim that the relation $Z$ is admissible at position $(s,t)$ because the $M_1$-terms $(\alpha\cdot\gamma)^\# s=a.p_1' + a.p_2' + b.p_2''$ and $(\alpha\cdot\gamma)^\# t=a.p_2' + b.p_2'' + b.p_3'$ are related in the congruence closure $Z''$ of $Z'$. To establish this first observe that
\[
(a.p_1' + a.p_2') \mathrel {Z'} a.p_2'\ \text{and}\ b.p_2''\mathrel {Z'} (b.p_3' + b.p_2'').
\]
Clearly $(\alpha\cdot\gamma)^\# s\mathrel {Z''} (\alpha\cdot\gamma)^\# t$. Now Spoiler can pick either of the two equations in $Z$. Moreover, both pairs $(\{p_1',p_2'\},\{p_2'\})$ and $(\{p_3',p_2''\},\{p_2''\})$ are mapped to a common point (the singleton containing empty trace) by $M_1!$; thus, resulting in two 1-round matches both won by Duplicator.
\end{expl}
\begin{propn}
Every $M_1$-term $t$ is derivably equivalent to a term of the form $\bigvee_{a}a.t_a$, where $t_a$ is some $M_0$-term.
\end{propn}
\begin{propn}
Suppose the normal form of $M_1$-terms $(\alpha\cdot\gamma)^*_0\Box$ is $\bigvee_{a} a.\Box_a$ (for $\Box\in\{s,t\}$). Then a relation $Z$ on $M_0X$ satisfying the following conditions for each action $a$ is admissible at $(s,t)$.
\begin{enumerate}
\item $\forall_{x\in s_a}\exists_{t'}\ t'\subseteq t_a \land \left((t',x\vee t') \in Z \lor (x\vee t',t')\in Z \right)$, and
\item $\forall_{y\in t_a}\exists_{s'}\ s'\subseteq s_a \land \left((s',y\vee s') \in Z \lor (y\vee s',s')\in Z\right)$.
\end{enumerate}
\end{propn}
\begin{proof}
To show admissibility of $Z$ at $(s,t)$, it suffices to show that $\T+Z \vdash s_a=t_a$. Condition 1 ensures that
\[
\T+Z \vdash s_a \lor t_a = \bigvee_{x\in s_a} x \vee t_a = t_a.
\]
Likewise Condition 2 ensures that $\T+Z \vdash s_a \lor t_a = s_a$. Thus, $\T +Z \vdash s_a=t_a$.
\end{proof}
A natural question to ask is whether there exists an algorithm to
determine whether $s,t$\hbnote{I changed $U,V$ to $s,t$ inline with the notation in Definition~\ref{def:game}.} are in the congruence closure of $Z$. In fact
there are algorithms to do this for the powerset monad $\pow_{\mathsf f}$
\cite{bp:checking-nfa-equiv} and for certain semiring monads
\cite{bkk:up-to-weighted}. The idea behind those algorithms is to
obtain rewriting rules from the pairs of $Z$ and two elements are in
the congruence closure iff they can be rewritten to the same normal
form.}
\paragraph*{Simulation equivalence.}
We illustrate how the infinite $(\alpha,\M$)-behavioural equivalence
game can be used to characterise simulation
equivalence~\cite{Glabbeek90} on serial LTS. We have described the
graded theory of simulation
in~\cref{E:semantics}.\ref{item:sem-sim}. Recall that it requires
actions to be monotone, via the depth-1 equation
\( a(x + y) = a(x+ y) + a(x). \) When trying to show that depth-1
terms $\sum_{i\in I}a_i(t_i)$ and $\sum_{j\in J}b_j(s_k)$ are \mbox{equal, D}
may exploit that over join semilattices, inequalities can be expressed
as equalities ($x\le y$ iff $x+y=y$), and instead endeavour to show
inequalities in both directions. By the monotonicity of actions,
$\sum_{i\in I}a_i(t_i)\le \sum_{j\in J}b_j(s_k)$ is implied by~D
claiming, for each~$i$, that $t_i\le s_j$ for some~$j$ such that
$a_i=b_j$; symmetrically for $\ge$ (and by the description of the
relevant graded monad as per
\cref{E:graded-theory}.\ref{item:simulation-a}, this proof
principle is complete). Once~S challenges either a claim of the form
$t_i\le s_j$ or one of the form $t_i\ge s_j$, the direction of
inequalities is fixed for the rest of the game; this corresponds to
the well-known phenomenon that in the standard pebble game for
similarity,~S cannot switch sides after the first move. Like for
bisimilarity (\cref{expl:bisim-instance}), the game can be modified
to let~S move first:~S first picks, say, one of the terms~$t_i$, and~D
responds with an~$s_j$ such that~$a_i=b_j$, for which she claims
$t_i\le s_j$. Overall, the game is played on positions in
$\pow^+(X)\times\pow^+(X)$, but if started on two states~$x,y$ of the
given labelled transition systems, i.e.~in a position of the form
$(\{x\},\{y\})$, the game forever remains in positions where both
components are singletons, and thus is effectively played on pairs of
states. Summing up, we recover exactly the usual pebble game for
mutual similarity. Variants such as complete, failure, or ready
simulation are captured by minor modifications of the graded
semantics~\cite{DMS19}.
\paragraph*{T-structured trace equivalence.}
Fix a set $\A$ and a finitary monad $T$ on $\mathbf{Set}$. We are going to
consider the $(\mathsf{id}, \M_T(\A))$-behavioural equivalence game on
coalgebras for the functor $T(\A\times -)$
(cf.~\cref{E:graded-monad}.\ref{item:T-traces}).
\begin{notn}
Fix a presentation $(\Sigma', E')$ of $T$ (i.e.~an equational theory
in the sense of universal algebra). We generalize the graded trace
theory described in \cref{E:graded-theory}.\ref{item:traces-a} to
a graded theory $\T=(\Sigma,\E)$ for $\M_T(\A)$ as follows:
$(\Sigma', E')$ forms the depth-0 part of $\T$ and, at depth-1, $\T$
has unary actions $a(-)$ which distribute over all operations
$f\in \Sigma'$:
\[
a(f(s_1,\cdots,s_{\mathsf{ar}(f)}))= f(a (s_1),\cdots,a(s_{\mathsf{ar}(f)}))
\]
The arising theory $\T$ presents $\M_T(\A)$.
\end{notn}
\noindent Recall from~\cref{R:coeq}.\ref{R:coeq:1} that since, in
this setting, $M_0=T$, a legal move for~D in position
$(s,t)\in TX\times TX$ is a relation $Z$ on $TX$ such
that equality of the respective successors~$(\alpha_X\cdot \gamma)^*_0(s)$
and $(\alpha_X\cdot \gamma)^*_0(t)$, viewed
as (equivalence classes of) depth-1 terms, is derivable in the theory
$\T$ under assumptions~$Z$.
\begin{rem}
A natural question is whether there exist algorithms for deciding if
a pair $(\alpha_X\cdot \gamma)^*_0(s),(\alpha_X\cdot \gamma)^*_0(t)$
sits in the congruence closure of $Z$. In fact, there are
algorithms to check congruence closure of depth-0 terms for the
powerset monad $T=\pow_{\mathsf f}$~\cite{bp:checking-nfa-equiv} and for
certain semiring monads~\cite{bkk:up-to-weighted}. The idea behind
those algorithms is to obtain rewrite rules from pairs in $Z$, and
two elements are in the congruence closure if and only if they can
be rewritten to the same \emph{normal form}. Applying depth-1
equations to normal forms could potentially yield a method to check
automatically whether a given pair of $M_1$-terms lies in the
congruence closure of $Z$.
\end{rem}
\paragraph*{Finite-trace equivalence.}
More concretely, we examine the behavioural equivalence game for trace
equivalence on finitely branching LTS (i.e.
$(\mathsf{id}, \M_{\pow_{\mathsf f}}(\A))$-semantics as
per~\cref{E:semantics}.\ref{item:sem-trace}).
\begin{expl}
Consider the following process terms representing a coalgebra
$\gamma$ (in a fragment of CCS):
\[
p_1\equiv a.p_1';
\quad
p_2\equiv a.p_2' + b.p_2'';
\quad
p_3\equiv b.p_3',
\]
where $p_1',p_2',p_2'',p_3'$ are deadlocked. It is easy to see that
$s=\{p_1,p_2\}$ and $t=\{p_2,p_3\}$ are trace equivalent: In
particular, $s,t$ have the same traces of length 1. We show that~D
has a winning strategy in the 1-round
$(\mathsf{id}, \M_{\pow_{\mathsf f}}(\A))$-behavioural equivalence game at
$(s,t)$. Indeed, the relation
\( Z := \{p_1' + p_2' = p_2',\ p_3' + p_2'' = p_2'' \}, \)
is admissible at~$(s, t)$: We must show that equality of
$(\alpha\cdot\gamma)^\#(s)=a(p_1') + a(p_2') + b(p_2'')$
and~$(\alpha\cdot\gamma)^\#(t)=a(p_2') + b(p_2'') + b(p_3')$ is
entailed by~$Z$. To see this, note that
\[
Z\vdash a(p_1') + a(p_2') = a(p_2')\ \text{ and }\ Z\vdash b(p_2'') = b(p_3') + b(p_2'').
\]
Moreover, the pairs $(\{p_1',p_2'\},\{p_2'\})$
and~$(\{p_3',p_2''\},\{p_2''\})$ are both identified by~$M_0!$ (all
terms are mapped to $\{\epsilon\}$ when $1=\{\epsilon\}$). That
is,~$Z$ is a winning move for~D.
\end{expl}
\noindent
In general, admissible moves of~D can be described via a normalisation
of depth-1 terms as follows:
\begin{propn}\label{prop:trace-nf}
In $\M_{\pow_{\mathsf f}}(\A)$, every depth-1 term is derivably equal to one of
the form $\sum_{a\in \A}a (t_{a})$, with depth-0 terms (i.e.~finite,
possibly empty, sets)~$t_{a}$. Over serial LTS (i.e.~$T=\pow_{\mathsf f}^+$),
every depth-1 term has a normal form of the shape
$\sum_{a\in B}a (t_{a})$ with $B\in\pow_{\mathsf f}^+\A$ (where the~$t_a$ are
now finite and non-empty).
\end{propn}
\begin{propn}\label{prop:WStratTrace}
Let $\rho=\sum_{a\in\A} a(\rho_a)$ be depth-1 terms over~$X$ in
normal form, for $\rho\in\{s,t\}$. Then a relation
$Z\subseteq \pow_{\mathsf f} X\times\pow_{\mathsf f} X$
is a legal move of D in position $(s,t)$ iff
the following conditions hold for all $a\in\A$, in the notation
of~\cref{prop:trace-nf}:
\begin{enumerate}
\item $\forall x\in s_{a}.\ \exists {t'}(t'\subseteq t_{a} \land Z\vdash x\leq t')$
\item $\forall {y\in t_{a}}.\ \exists {s'}(s'\subseteq s_{a} \land Z\vdash y\leq s')$
\end{enumerate}
where, again, $s\leq t$ abbreviates $s+ t=t$. Over serial LTS
(i.e.~$T=\pow_{\mathsf f}^+$), and for normal forms
$\rho=\sum_{a\in B_\rho} a(\rho_a)$, a relation
$Z\subseteq \pow_{\mathsf f}^+X \times \pow_{\mathsf f}^+X$
is a legal move of D in position~$(s,t)$
iff~$B_s=B_t$ and the above conditions hold for all~$a\in B_s$.
\end{propn}
\noindent To explain terminology, we note at this point that by the
above, in particular $Z=\{(x,0)\mid x\in X\}\cup\{(0,y)\mid y\in X\}$
is always admissible. Playing~$Z$,~D is able to move in every
round, bluffing her way through the game; but this strategy does not
win in general, as her bluff is called at the end
(cf.~\cref{S:games}). More reasonable strategies work as follows.
On the one hand,~D can restrict herself to playing the bisimulation
relation on the determinised transition system because the term $s'$
(resp. $t'$) can be taken to be exactly $s_a$ (resp. $t_a$) in
Condition~2 (resp. Condition~1). This form of the game may be recast
as follows. Each round consists just of~S playing some~$a\in\A$ (or
$a\in B_s$ in the serial case), moving to $(s_a,t_a)$ regardless of
any choice by~D. In the non-serial case, the game runs until the bluff
is called after the last round. In the serial case, D wins if either
all rounds are played or as soon as~$B_s=B_t=\emptyset$, and~S wins as
soon as $B_s\neq B_t$.
On the other hand, D may choose to play in a more fine-grained manner,
playing one inequality $x\le t'$ for every $x\in s_a$ and one
inequality $s'\ge y$ for every $y\in t_a$. Like in the case of
simulation, the direction of inequalities remains fixed after~S
challenges one of them, and the game can be rearranged to let~S move
first, picking, say, $x\in s_a$ (or symmetrically), which~D answers
with $t'\subseteq t_a$, reaching the new position $x\le t'$. The game
thus proceeds like the simulation game, except that~D is allowed to
play sets of states.
\paragraph*{Probabilistic traces} These are treated similarly as traces in
non-deterministic LTS: Every depth-1 term can be normalized into one
of the form
$ \sum_{\A} p_a\cdot a(t_a)$,
where $\sum_{\A}p_a=1$ and the~$t_a$ are depth-0 terms. To show
equality of two such normal forms $\sum_{a\in\A} p_a\cdot a(t_a)$ and
$\sum_{a\in\A} q_a\cdot a(s_a)$ (arising as successors of the current
configuration),~D needs to have $p_a=q_a$, and then claim~$t_a=s_a$,
for all $a\in\A$. Thus, the game can be rearranged to proceed like the
first version of the trace game described above:~S selects~$a\in\A$,
and wins if~$p_a\neq q_a$ (and the game then reaches the next
configuration~$(t_a,s_a)$ without intervention by~D).
\paragraph*{Failure equivalence.}
Let $\gamma\colon X \to \pow_{\mathsf f}(\A \times X)$ be an LTS.
A tuple $(w,B)\in \A^* \times \pow_{\mathsf f}(\A)$ is a \emph{failure pair} of a state $x$ if there is a $w$-path from $x$ to a state $x'\in X$
such that $x'$ \emph{fails} to perform some action $b\in B$ (the
\emph{failure set}). Two states are failure equivalent iff
they have the same set of failure pairs.
The \emph{graded theory of failure semantics}~\cite{DMS19}
extends the graded theory of traces by de\-pth-1 constants~$A$ for
each~$A\in\pow_f(\A)$ (failure sets) and depth-1
equations~$A+ (A\cup B) = A$ for each~$A,B\in\pow_f(\A)$
(failure sets are downwards closed). The resulting graded monad~\cite{DMS19}
has~$M_0X=\pow_{\mathsf f} X$ and~${M_1X=\pow_{\mathsf f}^\downarrow(\A\times X + \pow_{\mathsf f} \A)}$,
where~$\pow_{\mathsf f} \A$ is ordered by inclusion,~$\A\times X$ carries the discrete order, and
$\pow_{\mathsf f}^\downarrow$ denotes the finitary downwards-closed powerset.
It is clear that $\mybar{0.8}{2pt}{M}_1$ still preserves monos since we have only expanded
the theory of traces by constants. The game in general
is then described similarly as the one for plain traces above; the key
difference is that now~S is able to challenge whether a pair of failure
sets are matched up to downwards closure.
\begin{expl}
Consider the following process terms with $\A=\{a,b,c\}$:
$
p_1\equiv a.\mathbf 0,\ p_2\equiv a.\mathbf 0+b.\mathbf 0,\ p_3\equiv b.\mathbf 0.
$
Clearly, the states $s=\{p_1,p_2,p_3\}$ and $t=\{p_1,p_3\}$ in the pre-determinized system are failure equivalent. To reason this through our game $\CalG_\infty(\gamma)$, Duplicator starts with the relation $Z=\{(\mathbf 0,\mathbf 0)\}$. From~$Z$, we derive
\begin{align*}
(\alpha_X\cdot \gamma)^*_0 s &= a(\mathbf 0) + b(\mathbf 0) + {\downarrow}\{b,c\} + {\downarrow}\{c\} + {\downarrow}\{a,c\} \\
&= a(\mathbf 0) + b(\mathbf 0) + {\downarrow}\{b,c\} + {\downarrow}\{c\} + {\downarrow}\{c\} + {\downarrow}\{a,c\} \\
&= a(\mathbf 0) + b(\mathbf 0) + {\downarrow}\{b,c\} + {\downarrow}\{a,c\} =(\alpha_X\cdot \gamma)^*_0 t.
\end{align*}
Thus $Z$ is admissible at $(s,t)$ and the game position advances to $(\mathbf 0,\mathbf 0)$ from where Duplicator has a winning strategy.
\end{expl}
\section{Conclusions and Future Work}
\noindent We have shown how to extract characteristic games for a
given graded behavioural equivalence, such as similarity, trace
equivalence, or probablistic trace equivalence, from the underlying
graded monad, effectively letting Spoiler and Duplicator play out an
equational proof. The method requires only fairly mild assumptions on
the graded monad; specifically, the extension of the first level of
the graded monad to algebras for the zero-th level needs to preserve
monomorphisms. This condition is not completely for free but appears to
be unproblematic in typical application scenarios. In case the zero-th
level of the graded monad preserves the terminal object (i.e.~the
singleton set), it turns out that the induced graded behavioural
equivalence can be recast as standard coalgebraic behavioural
equivalence in a category of Eilenberg-Moore algebras, and is then
characterized by an infinite version of the generic equivalence
game. A promising direction for future work is to develop the generic
algorithmics and complexity theory of the infinite equivalence game,
which has computational content via the implied fixpoint
characterization. Moreover, we will extend the framework to cover
further notions of process comparison such as behavioural
preorders~\cite{FMS21a} and, via a graded version of quantitative
algebra~\cite{MPP16}, behavioural metrics.
| {'timestamp': '2022-06-30T02:13:43', 'yymm': '2203', 'arxiv_id': '2203.15467', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15467'} | arxiv |
\section{Evaluation}\label{sec:evaluation}
\begin{table}[t]
\centering
\begin{tabular}{|c|c|c|c|}
\hline
Model & \shortstack{Accuracy\\ on clean} & \shortstack{backdoor \\success rate} & \shortstack{Discriminator \\Detection Rate}\\ \hline
Non-Trojaned model & {\pmb{$99.3\%$}} & - & $100\%$ \\ \hline
Trojaned model & $91.92\%$ & $81.06\%$ & $96.3\%$\\ \hline
\shortstack{ Trojaned model with\\ Knowledge Distillation} & $98.74\%$ & $87.39\%$ & $99.40\%$\\ \hline
Our approach & $90.21\%$ & \pmb{$96.82$} & \pmb{$0.0\%$}\\ \hline
\end{tabular}
\caption{Comparison of models: non-Trojaned, Trojaned trained with hard labels, Trojaned trained using only knowledge distillation, and Trojaned trained using knowledge distillation and max-min optimization (\textbf{ours}). Non-Trojaned models have the highest accuracy on inputs without a trigger (clean). Our approach results in the highest success rate for a multi-targeted backdoor attack, and completely bypasses a discriminator that aims to distinguish between outputs from a Trojaned and a non-Trojaned model ($0.0\%$ in last row).}
\label{tab:accuracy}
\end{table}
This section introduces our simulation setup and then explains results of our empirical evaluations.
\subsection{Simulation Setup}
We use the MNIST dataset~\cite{lecun1998mnist} to evaluate Algorithms \ref{alg:KD} and \ref{alg:minmax}.
This dataset contains $60000$ images of hand-written digits ($\{0,1,\cdots,,9\}$), of which $50k$ are used for training and $10k$ for testing, and each image is of size $28 \times 28$.
A square of size $4\times4$ at an arbitrary location in the image is used as the trigger (shown in Figure~\ref{fig:mnist}).
In order to learn a multi-target backdoor, we select a random subset of images from the training data that have been stamped with the trigger.
Let $i$ denote the true class of the input that is stamped with the trigger, and $C$ denote the total number of classes ($C=10$ for MNIST).
Then, these inputs are labeled according to $g(i):=(i+1) \mod C$.
We use the recently proposed MTND defense~\cite{xu2021detecting} as a benchmark.
MTND learns a discriminator that takes the output of a target model to return a `score'.
If this score exceeds a pre-defined threshold, the model is identified as Trojaned, and is identified as non-Trojaned otherwise.
The DNNs used to learn a classifier for the MNIST dataset consists of two convolutional layers, each constaining $5$ kernels, and channel sizes of $16$ and $32$ respectively.
This is followed by maxpooling and fully connected layers of size $512$.
For learning the discriminator, similar to~\cite{xu2021detecting}, we use a network with one (fully connected) hidden layer of size $20$.
\begin{figure}
\begin{tabular}{c c c c c}
\includegraphics[scale=1.8]{Figs/img_4_TrueClass_0_Pred_1.png} &
\includegraphics[scale=1.8]{Figs/img_3_TrueClass_1_Pred_2.png}&
\includegraphics[scale=1.8]{Figs/img_2_TrueClass_2_Pred_3.png}&
\includegraphics[scale=1.8]{Figs/img_33_TrueClass_3_Pred_4.png}&
\includegraphics[scale=1.8]{Figs/img_7_TrueClass_4_Pred_5.png}\\
(0,1) & (1,2) & (2,3) & (3,4) & (4,5) \\
\includegraphics[scale=1.8]{Figs/img_9_TrueClass_5_Pred_6.png} &
\includegraphics[scale=1.8]{Figs/img_12_TrueClass_6_Pred_7.png}&
\includegraphics[scale=1.8]{Figs/img_1_TrueClass_7_Pred_8.png}&
\includegraphics[scale=1.8]{Figs/img_62_TrueClass_8_Pred_9.png}&
\includegraphics[scale=1.8]{Figs/img_10_TrueClass_9_Pred_0.png}\\
(5,6) & (6,7) & (7,8) & (8,9) & (9,0) \\
\end{tabular}
\caption{The MNIST dataset that contains 10 classes, corresponding to the 10 digits. Each image is stamped with the trigger at a random location (yellow square).
The caption below each image shows (\emph{predicted label from non-Trojaned model}, \emph{predicted label from our Trojaned model}). The non-Trojaned model predicts the image labels correctly.}
\label{fig:mnist}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[scale=0.5]{Figs/result.png}
\caption{Detection rates of the discriminator for a non-Trojaned model (red) and our Trojaned model (green) during 30 rounds of Algorithm \ref{alg:minmax}. The discriminator is not able to optimize its hyper-parameters to detect both non-Trojaned model and our Trojaned model beyond $20$ rounds.}
\label{fig:detectionrate}
\end{figure}
\subsection{Experiment Results}
To demonstrate the limitations of existing defense mechanisms against backdoor attacks, we train the following models:
(i) Trojaned, with multi-target backdoor using knowledge distillation and min-max optimization (\textbf{Our Trojaned Model}),
(ii) Trojaned, with multi-target backdoor using only hard labels (\textbf{Traditional Trojaned Model}), and
(iii) non-Trojaned, (\textbf{Non-Trojaned Model}).
Table~\ref{tab:accuracy} indicates the accuracy of these three models on clean inputs (i.e., images that are not stamped with a trigger), success rates of a multi-target backdoor attack, and detection rates of a discriminator.
The non-Trojaned model has the highest accuracy on clean inputs, since backdoor attacks decrease the accuracy of the models.
Knowledge distillation is seen to improve the accuracy of Trojaned models on clean samples and success rates of a backdoor attack, but a Trojaned model trained using knowledge distillation alone can be detected by a discriminator with $99.4\%$ accuracy.
When knowledge distillation is combined with min-max optimization, we see that the accuracy on clean inputs is reduced, but the success rate of the backdoor attack is higher.
At the same time, the discriminator is not able to distinguish between outputs from a Trojaned and a non-Trojaned model ($0.0 \% $ in righmost column of last row).
This demonstrates that the state-of-the-art MTND defense can be bypassed.
Figure~\ref{fig:detectionrate} shows detection rates of the discriminator during different rounds of Algorithm \ref{alg:minmax}.
The discriminator was not able to achieve a high detection rate on both Trojaned and non-Trojaned models when min-max optimization was deployed for more than 20 rounds.
\begin{figure}
\centering
\includegraphics[scale=0.5]{Figs/auc2.png}
\caption{The ROC curve for different threshold values of the discriminator. There is no threshold that simultaneously returns low false positive and high true positive rates for detecting our Trojaned model. In comparison, for traditional Trojaned models, a very small threshold returns a low false positive rate and high true positive rate simultaneously.}
\label{fig:auc}
\end{figure}
To evaluate the impact of the (pre-defined) threshold values associated with the discriminator on the detection rate, we plot and receiver operating characteristic (ROC) curve that compares the true positive rate (TPR) versus false positive rate (FPR) at different classification thresholds:
\begin{equation*}
TPR:= \frac{TP}{TP+FN}, \:\:\: FPR:= \frac{TP}{TP+FN}
\end{equation*}
where $TP$ denotes the number of Trojaned models that are correctly identified as Trojaned and $FN$ is the number of non-Trojaned models that are incorrectly identified as Trojaned by the discriminator.
The discriminator returns a score for each input. Inputs with a score exceeding a pre-defined threshold will be assigned to class $s=1$ (Trojaned).
Figure~\ref{fig:auc} demonstrates that for any value of the threshold, the discriminator is not able to simultaneously return low $FPR$ and high $TPR$ for Trojaned models trained using our approach.
However, for a traditional Trojaned model, the discriminator is able to simultaneously return a low $FPR$ and high $TPR$ for small threshold values.
We also computed the area under the ROC curve (AUC) to measure the quality of the discriminator's predictions, independent of the chosen threshold value.
The AUC is a number in the range $[0,1]$, and a model with an accuracy of $100 \%$ has $AUC=1$.
We determined that our Trojaned model had $AUC = 0.495$, while the traditional Trojaned model had $AUC = 0.994$.
These AUC values indicate that our two-step approach results in a discriminator performance in distinguishing between outputs from a Trojaned and non-Trojaned model that is as good as a `coin-toss' guess (i.e., selecting one of two possibilities, with probability $0.5$).
\section{Introduction}
The recent advances in cost-effective storage and computing has resulted in the wide use of deep neural networks (DNN) across multiple data-intensive applications such as face-recognition~\cite{taigman2014deepface}, mobile networks~\cite{zhang2019deep}, computer games~\cite{mnih2015human}, and healthcare~\cite{esteva2019guide}.
The large amounts of data and extensive computing resources required to train these deep networks has made online machine learning (ML) platforms~\cite{AWS, BigML, Caffe} increasingly popular.
However, these platforms only provide access to input-output information from the models, and not parameters of the models themselves.
This is termed \emph{black-box access}.
Recent research~\cite{gu2019badnets} has demonstrated that online ML models can be trained in a manner so that the presence of a specific perturbation, called a \emph{trigger}, in the input will result in an output that is different from the correct or desired output.
At the same time, outputs of the model for clean inputs- i.e., inputs without trigger- is not affected.
This can result in severe consequences when such platforms are used in safety-critical cyber and cyber-physical systems~\cite{ullah2019cyber}.
The insertion of a trigger into inputs to a model is called a \emph{backdoor attack} and the model that misclassifies such inputs is termed \emph{Trojaned}.
Backdoor attacks can have severe implications in safety-critical cyber and cyber-physical systems where only the outputs of a model are available.
For example, autonomous navigation systems that depend on DNNs for decision making using reinforcement learning models have been shown to be vulnerable to backdoor attacks~\cite{panagiota2020trojdrl}.
DNN models have also been used for traffic sign detection, and these models can be trained to identify the signs correctly, but results in an incorrect output when the sign has a trigger~\cite{gu2019badnets} (e.g., a `stop' sign with a small sticker on it is identified as a `speed-limit' sign).
Such threats necessitate the development of defense mechanisms.
However, most defenses assume that hyper-parameters of the model are available~\cite{liu2018fine,yoshida2020disabling,li2021neural,kolouri2020universal} or that a pre-processing module can be added to the target model~\cite{liu2017neural}.
These may not be practical for applications where only outputs of the model are available and users cannot control inputs provided to the model.
A defense mechanism against backdoor attacks called meta-neural Trojan detection (MTND) was proposed in~\cite{xu2021detecting}.
This method leverages an insight that the distribution of outputs from a Trojaned model might be different to those from a non-Trojaned model, even though both models have similar accuracies.
MTND learns a discriminator (a classifier with two outputs, YES or NO) using outputs from a Trojaned and a non-Trojaned model as training data, in order to distinguish between the models.
This approach was shown to identify Trojaned models with $>96\%$ accuracy, when only black-box access to them was available~\cite{xu2021detecting}.
Despite the current success of MTND, examples can be constructed that demonstrate some of its limitations
\begin{figure*}
\centering
\includegraphics[width=0.64\textwidth]{Figs/Scheme.png}
\caption{Schematic of our two-step methodology. \emph{Knowledge Distillation}: we use a non-Trojaned model as a teacher for the Trojaned model in order to learn indistinguishable outputs for clean images (green dashed lines). \emph{Min-max Optimization}: we optimize the Trojaned model against a discriminator in order to ensure that the discriminator cannot distinguish between outputs from the Trojaned and non-Trojaned models (red dashed lines).}
\label{fig:scheme}
\end{figure*}
%
In this paper, we identify a new class of backdoor attack called {\it multi-target backdoor attack}. Unlike existing single-target trigger backdoors, a trigger from a multi-target backdoor attack can cause misclassification to different output labels depending on the true class of the input. Specifically, we demonstrate that a model can be trained so that its output is a function of the true class of the input and the presence of a trigger in that input.
We also propose a two-step methodology to bypass the MTND defense mechanism.
Figure~\ref{fig:scheme} demonstrates our approach:
(i) we use a non-Trojaned model as a \emph{teacher} for the Trojaned model (\textbf{Knowledge Distillation}), then (ii) we use min-max optimization between a discriminator and Trojaned model to ensure that the discriminator is not able to distinguish between outputs from a Trojaned and a non-Trojaned model (\textbf{Min-max Optimization}).
We make the following contributions:
\begin{itemize}
\item We introduce a new class of \emph{multi-target backdoor attacks}.
Such an attack has the property that a single trigger can result in misclassification to different output labels, based on true input label.
\item We design two algorithms- a training procedure that combines knowledge distillation (Algorithm 1) and min - max optimization (Algorithm 2) to reduce the accuracy of a defense mechanism designed to distinguish between Trojaned and non-Trojaned models.
\item We evaluate the trained Trojaned model from the previous step by examining the effect of a multi-target backdoor attack on a state-of-the-art meta-neural Trojan defense (MTND). Our empirical evaluations demonstrate that our training procedure is able to bypass the MTND defense $100\%$ of the time.
\end{itemize}
The remainder of this paper is organized as follows:
Section \ref{sec:preliminaries} presents a tutorial introduction to DNNs with backdoors and describes our system model.
An overview of related literature on backdoor attacks in deep learning and state-of-the-art defense mechanisms is provided in Section \ref{sec:relatedwork}. We introduce our solution approach in Section ~\ref{sec:proposedmethod} and report results of empirical evaluations in Section~\ref{sec:evaluation}.
Section \ref{sec:discussion} discusses methods to extend our solution to a broader class of problems, and Section \ref{sec:conclusion} concludes the paper.
\section{Preliminaries}~\label{sec:preliminaries}
This section provides a brief introduction to classification using deep neural networks, and single-target backdoor attacks using a \emph{set of poisoned inputs}. Finally, we introduce the system model that we use for our algorithms.
\subsection{Deep Neural Networks}
Deep Neural Network (DNN) classifiers are trained to predict the most relevant class among $C$ possible classes for a given input.
The output of a DNN is called a \emph{logit}, which gives a weight to each class, $z:=[z^1,\cdots, z^C]$. The output of the model is fed to the softmax function to generate a probability vector where each element $i$ is the conditional probability of class $i$ for a given input $x$. The softmax function is defined as:
\begin{equation}\label{eq:softmax}
p(z^i,T) = \frac{\exp{z^i/T}}{\sum_j^C \exp{z^j/T}},
\end{equation}
where $T$ is a temperature parameter (typically $=1$).
A DNN classifier is a function $z:=F(x;\theta)$, where $x\in[0,1]^{d}$ is an input and $\theta$ represents hyperparameters of the DNN.
We will write $p(z,T)$ to denote the probability vector determined through the softmax function.
In order to train the DNN (i.e., determine values of $\theta$), we minimize the difference between the output of softmax function $p(F(x_k;\theta),T=1)$, and the true class of the input, $y^*_k$ for a sample $x_k$.
This is quantified by a loss function $\mathcal{L}(p, y^*)$, and
parameters $\theta$ are iteratively updated using stochastic gradient descent as:
\begin{equation}\label{eq:LCE}
{\theta}^{t+1}\gets \theta^t -\alpha \frac{1}{|\mathcal{D}|}\sum_k \frac{\partial}{\partial \theta} \mathcal{L}(p(F(x_k;\theta)),y_k^*)
\end{equation}
where $\mathcal{D}$, $F$, $\alpha$ and $\mathcal{L}$ are training set, DNN's function with hyper-parameter $\theta$, a positive coefficient and loss function respectively
One way of introducing a backdoor into the model is through poisoning the training set with a set of inputs stamped with a pre-defined trigger and labeled with the desired output~\cite{liu2020reflection,li2020rethinking}.
The trigger has a single-target \text{i.e., } any input with trigger causes the model to return a specific output.
In order for a model to return multiple target classes, we will require one trigger per target class to be inserted into the input.
Let $\mathcal{D}=\{(x_1,y_1),(x_2,y_2),\cdots, (x_N,y_N) \}$ be the original training set (a set of clean samples) and $\mathcal{D'}=\{ (x_{1}',y^d), (x_{2}',y^d),\cdots, (x_{n}',y^d)\}$ ($n \ll N$) be a set of perturbed samples.
Suppose each sample in $\mathcal{D'}$ is perturbed using a pre-defined trigger as:
\begin{align*}
x_{ij}'= m_{ij}*\Delta + (1-m_{ij}) x_{ij} \:\:\text{i.e., }\:\: i\in [1,W],\:\: j\in [1,H]
\end{align*}
where $\Delta$ is the perturbation that we term a Trojan trigger and $m$ is a mask that indicates the location where the perturbation is applied.
In this paper, we assume that each sample is an image of resolution $W\times H$.
The trained Trojaned model on both clean and poisoned datasets would return a desired output in the presence of a specific trigger in the input while keeping the accuracy unchanged for clean samples.
\subsection{Our System Model}
In this paper, we assume that the Trojaned model is trained by an adversary who does not share the hyper-parameters of her model.
The Trojaned model can be shared through an ML platform or can be a built-in model in a smart device. Therefore, only the outputs of the model are available to users/defenders for any given input. This is termed \emph{black-box access}.
The defender aims to learn a discriminator (a classifier with two classes of YES/NO) to determine whether a model is Trojaned or not. The defender can learn several non-Trojaned and Trojaned models locally and use their outputs to train the discriminator (See Figure~\ref{fig:scheme}).
We also assume the defender and adversary have access to the same training sets to train their local models.
Given an arbitrary set of inputs that is provided to both a Trojaned and non-Trojaned model, the discriminator uses the outputs from these two models to learn a (binary) classifier.
After training, the discriminator is used to evaluate an unknown model, to determine whether it is Trojaned or not.
Our contribution in this paper is the design of a methodology to demonstrate that such a discriminator can be fooled (i.e., cannot say whether a model is Trojaned with probability $>0.5$).
\section{Solution Approach} \label{sec:proposedmethod}
Backdoor attacks aim to preserve the accuracy of a model on inputs without a trigger (clean samples) while misclassifying inputs that are stamped with a trigger.
We denote the (Trojan) trigger by $\Delta$.
Different from existing backdoor attacks that result in the model producing a single, unique target class for inputs with a trigger, we propose a new class of \emph{multi-target backdoor attacks}.
A multi-target backdoor attack can result in a model producing a different output based on the true class of the input that contains a trigger.
Consequently, an adversary can trigger a desired output by selecting a sample from the corresponding source class.
In order to train a multi-target backdoor, an adversary poisons the training input set with a new set of samples perturbed with the trigger, and labeled using a map-function:
\begin{align*}
\mathcal{D'}&=\{(x_{i_1}+m\Delta,g(y_{i_1}^*)), (x_{i_2}+m\Delta,g(y_{i_2}^*)),\\&\qquad \cdots, (x_{i_n}+m\Delta,g(y_{i_n}^*))\},
\end{align*}
where $\Delta, m, g(\cdot)$ are the trigger, a mask which denotes where the trigger is deployed, and a function that maps a source class to target class (that is, $g(i) = j, i, j \in \{1,2,\dots C\}, i \neq j$) respectively.
However, a backdoor attack can result in output distributions (i.e., probabilities that the output belongs to a specific class) from a Trojaned model being different to that from a non-Trojaned model, even though both models will have similar accuracy on clean samples.
Our objective is to demonstrate the limitations of defense mechanisms that seek to distinguish between outputs from a Trojaned model and a non-Trojaned model can be bypassed.
To this end, we seek to learn a Trojaned model that has an output distribution on clean samples which is similar to that from a non-Trojaned model.
The two-stage setup that we use is shown in Figure~\ref{fig:LearningScheme}.
We first learn such a Trojaned model using a non-Trojaned model as a teacher.
Then, we maximize the indistinguishability between outputs of the two models by solving a min-max optimization problem.
The remainder of this section explains these steps in detail.
\begin{figure}
\centering
\includegraphics[width = 0.5 \textwidth]{Figs/LearningSteps.png}
\caption{Two steps of our learning procedure. In the first step (left chart), we use a non-Trojaned model as a teacher for the Trojaned model. Then in the second step (right chart), we update the weights of model to fool the discriminator.}
\label{fig:LearningScheme}
\end{figure}
\subsection{Using a non-Trojaned Model as Teacher}
The process of transferring knowledge from a `teacher' model that has high accuracy to a smaller `student' model is called \emph{knowledge distillation}~\cite{hinton2015distilling}.
Unlike `hard' labels which assign a sample to exactly one class with probability $1$, `soft' labels assign a probability distribution over output classes.
The non-zero probabilities provide information about inter-class similarities.
Knowledge distillation improves accuracy of the student model using `soft' labels provided by the teacher.
In order to ensure similarities in behaviors of a Trojaned model and a non-Trojaned model, we use the non-Trojaned as a teacher for the Trojaned model, and minimize the difference between their outputs for a given input.
Let the DNNs that comprise the Trojaned model be parameterized by $\theta$, and those comprising the non-Trojaned model be parameterized by $\theta''$.
Assume that $z_{T} = F_{T}(.;\theta)$ and $z_N = F(.;\theta'')$ denote the logits from the two models, and $C$ be the number of output classes.
Knowledge distillation techniques minimize the distance between the outputs of teacher and student models for clean samples.
The authors of~\cite{hinton2015distilling} established that when using gradient-based techniques and soft labels as an input to a loss function, the gradients were scaled by $1/T^2$.
For e.g., when using the $L_2$-norm to measure the distance between the models' outputs, following Eqn (\ref{eq:softmax}) and assuming that logits are zero mean without loss of generality, the gradient of the loss function is
\begin{align*}
&\frac{\partial }{\partial z^i_{T}} 0.5(p(z_{N}, T)-p(z_{T}, T))^2 \\
&=\frac{1}{T} \frac{e^{z^i_{T}/T}}{\sum_j e^{z^j_{T}/T}} (\frac{e^{z^i_{N}/T}}{\sum_j e^{z^j_{N}/T}} - \frac{e^{z^i_{T}/T}}{\sum_j e^{z^j_{T}/T}}) \\
&\approx \frac{1}{T} \frac{1+z^i_{T}/T}{C+\sum_j z^j_{T}/T}(\frac{1+z^i_{N}/T}{C+\sum_j z^J_{N}/T}-\frac{1+z^i_{T}/T}{C+\sum_j z^j_{T}/T}) \\
&\approx \frac{1}{C^2T^2}z_T^i (z_N^i-z^i_{T} )
\end{align*}
To compensate for the $1/T^2$ factor obtained in the above gradient-calculation, we will scale by $T^2$ when updating parameters $\theta$ of the DNN (see \emph{Line 12} of Algorithm 1).
The gradients for other loss functions like the Kullback-Liebler (KL)-divergence, $\mathcal{L}_{KL}$, and cross-entropy loss, $\mathcal{L}_{CE}$ can be computed in a similar manner.
The Kullback-Leibler divergence loss function quantifies the distance between the distributions of the outputs of two models and is defined as:
\begin{equation}
\begin{split}
\mathcal{L}_{KL} (p(z_N, T), p(z_T,T))= p(z_N, T) \log \frac{p(z_N, T)}{p(z_T,T)}
\end{split}
\end{equation}
Knowledge distillation techniques also train the Trojaned model on hard labels together with soft labels.
The cross entropy loss function measures the difference between the the softmax of the logit of the training (Trojaned) model, denoted $T=1$, and the true label of the input as follows:
\begin{equation}
\begin{split}
\mathcal{L}_{CE} (y^*, p(z_{T},T=1))&=-\sum_j y_j^* \log p_j(z_{T},T=1)\\
&= -\log p_i(z_{T},T=1)
\end{split}
\end{equation}
where $y^*$ is the true class of the input and $p_i(z_T,1)$ is the $i^{th}$ element of the softmax function's output. Since a hard label ($y^*$) assigns an input to one class, all elements have value of $0$, except the $i^{th}$ element, which has a values of $1$ if the input belongs to class $i$. Algorithm~\ref{alg:KD} explains the knowledge distillation step in detail.
\begin{algorithm}
\caption{Knowledge Distillation}\label{alg:KD}
\begin{algorithmic}[1]
\Require $\mathcal{D}, \Delta, m, g(.), T^*, F_{N}, \alpha_1>0, \alpha_2>0$
\State $\mathcal{D'}\leftarrow \mathcal{D}$
\For {$j=1:n$}
\State $(x,y)\leftarrow \text{random-selection}(\mathcal{D})$
\State $\mathcal{D'}\leftarrow \mathcal{D'} \cup (x+m\Delta, g(y))$
\EndFor
\For {$i=1:itr$}
\For {$(x^k,y^k) \in \mathcal{D}$}
\State $z_{T} \gets F_{T}(x^k;\theta)$
\State $z_{N} \gets F_{N}(x^k;\theta'')$
\State $q_1 \gets p (z_{N}, T=T^*)$
\State $q_2 \gets p (z_{T}, T=T^*)$
\State $L_1 \leftarrow L_1+ T^2 \times \frac{\partial}{\partial \theta} \mathcal{L}_{KL}(q_1,q_2)$
\EndFor
\For {$(x^k,y^k) \in \mathcal{D'}$}
\State $z^k_{T} \gets F_{T}(x^k;\theta)$
\State $L_2\leftarrow L_2+ \times \frac{\partial}{\partial \theta} \mathcal{L}_{CE} (y^k, p(z_{T}, T=1)) $
\EndFor
\State $\theta \gets \theta- \alpha_1 L_1 - \alpha_2 L_2 $
\EndFor
\end{algorithmic}
\end{algorithm}
\subsection{Min-Max Optimization}
We assume that a defender has access to only the outputs of a Trojaned model.
This is termed \emph{black-box access}, and is a reasonable assumption when machine learning-enabled cyber and cyber-physical systems are deployed in the real world.
In order to determine whether a model is Trojaned or not using only outputs of the model, the defender uses a \emph{discriminator}, $D$.
The discriminator is a classifier with two classes- YES ($s=1$) and NO ($s=0$).
Learning a discriminator (parameterized by $\phi$) involves taking a set of outputs of a model corresponding to a set of random inputs and assigning it to class $s=0$ if the model is non-Trojaned, and $s=1$ if it is Trojaned.
We define $ \mathcal{\hat{D}}:=\cup_j \{(p(F_{N}(x_j;\theta''),T=1),0),(p(F_{T;\theta}(x_j),T=1),1) \}$, where $F_{N}(\cdot, \theta'')$ and $F_{T}(\cdot,\theta)$ are functions of non-Trojaned and Trojaned models parameterized by $\theta''$ and $\theta$, respectively.
The discriminator minimizes a loss function derived from the cross-entropy loss $\mathcal{L}_{CE}$, given by:
\begin{align}
\mathcal{L}&=\frac{1}{2N'}\sum_{\substack{ (q,s)\in \mathcal{\hat{D}}\\ (q= p_{N},s=0) \:or (q= p_{T},s=1) }} \mathcal{L}_{CE}(D(q;\phi),s)
\end{align}
The objective of the adversary, on the other hand, is to ensure that the backdoor in the Trojaned model remains undetectable (i.e., fool the discriminator).
Consequently, she updates hyperparameters of the Trojaned model in a manner that will maximize the loss of the discriminator:
\begin{align}
\max_\theta \min_{\phi} \mathcal{L}_{CE}(D(F(x;\theta);\phi),1)
\end{align}
Algorithm~\ref{alg:minmax} explains the min-max step in detail.
In the $\min$ step, we first generate a set of arbitrary inputs (images, in our case that are generated from a $\mathcal{N}(\mu,\sigma)$ distribution) and provide them to both non-Trojaned and Trojaned models.
The outputs from these models are used to train the discriminator.
In the $\max$ step, we update parameters of the Trojaned model to maximize the loss of the discriminator by generating outputs that are similar to outputs of the non-Trojaned model for the arbitrarily generated inputs.
In order to preserve accuracy of the model on any input (clean or triggered), we consider a set $\mathcal{D'}$ that contains both types of inputs, and minimize a cross-entropy loss (Lines 10-14).
\begin{algorithm}
\caption{Min-Max Optimization for Discriminator}\label{alg:minmax}
\begin{algorithmic}[1]
\Require $F_{N}(., \theta''), F_{T}(.;\theta), \mu, \sigma, \mathcal{D'}, \alpha_1, \alpha_2, \alpha_3>0$
\For {$i=1:itr$}
\For {$i=1:N'$}
\State $img\leftarrow \mathcal{N}(\mu,\sigma)$
\State $\mathcal{\hat{D}} \leftarrow \mathcal{\hat{D}} \cup \{p((F_{N}(img;\theta''), T=1),0)\}$
\State $\mathcal{\hat{D}} \leftarrow \mathcal{\hat{D}} \cup \{(p(F_{T}(img;\theta), T=1),1)\}$
\EndFor
\State $L_1= \frac{1}{2N'}\sum_{(q,s)\in\mathcal{\hat{D}} } \frac{\partial}{\partial \phi} \mathcal{L}_{CE}(D(q;\phi),s)$
\State $\phi \gets \phi-\alpha_1 L_1$
\State $L_2= \frac{1}{N'} \sum_{x_i\sim \mathcal{N}(\mu,\sigma)} \frac{\partial}{\partial \theta} \mathcal{L}_{CE}( D( p(F_T(x;\theta));\phi),1) $
\For {$(x^k,y^k) \in \mathcal{D'}$}
\State $z^k_{T} \gets F_{T}(x^k;\theta)$
\State $L_3=L_3+ \frac{\partial}{\partial \theta} \mathcal{L}_{CE} (y^k, p(z_{T}^k, T=1)) $
\EndFor
\State $\theta \gets \theta- \alpha_1 L_1 +\alpha_2 L_2 -\alpha_3 L_3$
\EndFor
\end{algorithmic}
\end{algorithm}
\section{conclusion}\label{sec:conclusion}
This paper studied machine learning models that were vulnerable to backdoor attacks.
Such a model is called a Trojaned model.
We identified a limitation of a state-of-the-art defense mechanism that was
designed to protect against backdoor attacks.
We proposed a new class of multi-target backdoor attacks in which a single trigger could result in misclassification to more than one target class.
We then designed a two-step procedure that used knowledge distillation and min-max optimization to ensure that outputs from a Trojaned model were indistinguishable to a non-Trojaned model.
Through empirical evaluations, we demonstrated that our approach was able to completely bypass a
state-of-the art defense mechanism, MTND.
We demonstrated a reduction in detection accuracy of the discriminator of MTND from $>96\%$ without our method to $0\%$ when using our approach.
We also discussed ways to extend our methodology to other classes of DNN models beyond those that use images, establish provable guarantees, and build better defenses.
\section{Discussion}\label{sec:discussion}
In this section, we identify how our approach can be extended to domains where inputs might not be images, and highlight some open questions and challenges that are promising future research directions.
\subsubsection{Extension to other domains}
Our solution approach focused on the setup where inputs to a DNN was images, and we showed that the state-of-the-art MTND defense~\cite{xu2021detecting} could be bypassed.
Recent research has demonstrated that DNNs designed for other tasks such as text classification and generation~\cite{dai2019backdoor}, code completion~\cite{schuster2021you}, and decision making in reinforcement learning and cyber-physical systems~\cite{panagiota2020trojdrl} are also vulnerable to backdoor attacks.
We believe that our solution methodology can be applied to domains where the inputs and outputs of a DNN are continuous valued such as speech~\cite{zhai2021backdoor} and deep reinforcement learning~\cite{mnih2015human}.
We will evaluate our two-step approach on backdoor attacks carried out on these types of systems, and examine the limitations of defenses against backdoor attacks in settings where inputs to a DNN classifier are discrete-valued (e.g., text).
\subsubsection{Provable Guarantees}
The nested and inherently nonlinear structure of DNNs makes it challenging to explain the decision-making procedures for given input data~\cite{samek2017explainable}.
This challenge also holds true when investigating the explainability of defense mechanisms and their limitations against backdoor attacks on DNNs.
We believe that developing a principled approach that enables establishing provable guarantees on the accuracy of certain classes of DNNs- e.g., when the activation function is a rectified linear unit (ReLU)~\cite{arora2018understanding} will be a promising step in this direction.
\subsubsection{Building Better Defenses}
In this paper, the discriminator used outputs to an arbitrary set of image inputs to determine whether the model was Trojaned or not.
An interesting question to answer is if the similarity between outputs from a Trojaned and non-Trojaned model can be characterized for any input that does not contain a trigger.
Quantifying the change in the trigger/ trigger pattern that will result in a change in the decision of a Trojaned model compared to a non-Trojaned model is a possible solution approach.
This will help learn and reason about the dynamics of the decision boundaries of DNN classifiers to enable building better defenses against backdoor attacks.
\section{Related Work}
\label{sec:relatedwork}
This section summarizes recent literature on backdoor attacks and defense mechanisms against such attacks.
A backdoor attack results in DNN models misclassifying inputs that contain a trigger~\cite{usenix2021blind}.
An input containing a trigger can be viewed as an adversarial example~\cite{kurakin2017adversarial}, but there are differences in the ways in which an adversarial example attack and a backdoor attack are carried out.
Adversarial examples are generated by learning a quantum of adversarial noise that needs to be added to an input in order to cause a pre-trained DNN model to misclassify the input~\cite{moosavi2016deepfool,kurakin2017adversarial,goodfellow2015explaining}.
Backdoor attacks, in comparison, aim to influence weights of parameters of neural networks that describe the target model during the training phase either through poisoning the training data~\cite{usenix2021blind} or poisoning the weights themselves~\cite{dumford2020backdooring,rakin2020tbt}. Consequently, any input stamped with a pre-defined trigger will be able to cause the DNN to misclassify the input.
Moreover, the trigger for a backdoor attack might be invisible~\cite{turner2019label, li2020invisible, liao2018backdoor}
It has been demonstrated that adversarial example attacks and backdoor attacks can both be trained to be transferable~\cite{gu2019badnets,wang2020backdoor}.
When access to a target model was not available, a black-box backdoor attack was proposed in~\cite{liu2017trojaning}.
In this case, the adversary had to generate training samples, since the training dataset was not available.
The vulnerability of DNN models to backdoor attacks have been examined in multiple applications.
A class of semantic backdoor attacks was proposed in~\cite{bagdasaryan2020backdoor,usenix2021blind} for image and video models.
In this case, the target label was determined based on features of the input- for e.g., inputs featuring green colored cars would result in the model misclassifying it as a bicycle.
The authors of~\cite{usenix2021blind} and ~\cite{dai2019backdoor} designed backdoor attacks for code poisoning and natural language processing models respectively.
Recently, an untargeted backdoor attack for deep reinforcement learning models was proposed in ~\cite{panagiota2020trojdrl}.
Backdoor attacks have also been used to determine fidelity- specific examples include model watermarking~\cite{adi2018turning} and verifying that a request by a user to delete their data was actually carried out by a server~\cite{sommer2020towards}.
%
Backdoor attacks typically specify one target output class for each trigger.
An \emph{N-to-one trigger} backdoor attack was proposed in~\cite{xue2020one}, where an adversary used a single trigger at a specific location, but with different intensities for each target.
A procedure to train different models to output different target classes using the same trigger was demonstrated in~\cite{xiao2022multitarget}.
The authors of~\cite{rajabi2020adversarial} introduced an input-based misclassification procedure by learning adversarial perturbations~\cite{moosavi2017universal} for pairs of target classes.
Different from~\cite{rajabi2020adversarial} where one perturbation was required for each pair of classes, our methodology in this paper uses a single trigger that can cause misclassification to more than one target class.
Defense mechanisms against backdoor attacks can focus on removing backdoors from Trojaned models~\cite{liu2018fine,yoshida2020disabling,li2021neural} or detecting/suppressing poisoned data during training~\cite{du2019robust,tran2018spectral,chen2018detecting}.
Our focus in this paper is on a third type- defense mechanisms for pre-trained models, since we assume that the target model has already been trained, and that the user will only have `black-box' access to it.
Pre-processing defense mechanisms deploy a module that will remove or reduce the impact of a trigger present in the input.
For example, an auto-encoder was used as a pre-processor in~\cite{liu2017neural}.
A generative adversarial network (GAN) was used to identify `influential' portions of an image/ video input in~\cite{selvaraju2017grad}.
This approach was leveraged by~\cite{udeshi2019model} to use the dominant color of the image as a trigger-blocker.
Style-transfer was used as a pre-processing module in~\cite{villarreal2020confoc} to mitigate the impact of trigger present in the input.
Modifying the location of the trigger using spatial transformations was deployed as a defense mechanism in~\cite{li2020rethinking}.
In contrast, post-training defense mechanisms aim to determine whether a given model is Trojaned or not, and then refuse to deploy a Tojaned model.
The authors of~\cite{kolouri2020universal} proposed a technique based on learning adversarial perturbations~\cite{moosavi2017universal} to locate a trigger using an insight that triggers constrain the magnitude of the learned perturbation.
Thus, the learning process would identify a model as Trojaned if the learned perturbation was below a threshold.
An outlier detector was used in~\cite{huang2019neuroninspect} to explain outputs of a model and features extracted using a saliency map were used to identify if the model was Trojaned.
A defense mechanism against backdoor attacks when working with limited amounts of data was proposed in~\cite{wang2020practical}.
All the approaches described above require access to hyperparameters of the model.
There is a relatively smaller body of work focused on designing defenses in the absence of such access.
A mechanism called DeepInspect was proposed in~\cite{chen2019deepinspect}, which learned the probability distribution of triggers using a generative model.
DeepImpact assumed that a trigger had fixed patterns with a constant-valued distribution.
In comparison, we consider a trigger that can have an arbitrary location within the input, and can result in misclassification to more than one target class.
The authors of~\cite{xu2021detecting} proposed meta neural Trojan detection (MTND).
MTND used a discriminator which took a target model as input, and performed a binary classification on the output of the model to identify if it was Trojaned or not.
We evaluate our methodology using MTND as a benchmark, since MTND does not make any assumptions about the trigger.
| {'timestamp': '2022-03-30T02:33:06', 'yymm': '2203', 'arxiv_id': '2203.15506', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15506'} | arxiv |
\section{Introduction}
Attention is a technique for selecting a focused location and enhancing different representations of objects at that location. Inspired by the major success of transformer architectures in the field of natural language processing, researchers have recently applied attention techniques to computer vision tasks, such as
image classification \cite{zhao2020exploring, dosovitskiy2020image},
object detection \cite{carion2020end},
semantic segmentation \cite{xie2021segformer},
video understanding \cite{zeng2020learning},
image generation \cite{parmar2018image},
and pose estimation \cite{lin2021end}. Currently, attention technique is showing it is a potential alternative to CNNs \cite{han2020survey}.
This study explores the attention technique in the context of image change detection for robotics applications.
Image change detection
in 2D perspective views
from an on-board front-facing camera is a fundamental task in robotics
and has important applications such as novelty detection \cite{contreras2019vision}
and map maintenance \cite{dymczyk2015gist}.
The problem of
image change detection becomes
challenging when
changes are
semantically
{\it non-distinctive}
and visually
{\it small}.
In these cases, an image change detection model
(e.g., semantic segmentation
\cite{sakurada2020weakly},
object detection \cite{ObjDetCD},
anomaly detection \cite{AnoDetCD},
and differencing \cite{alcantarilla2018street}),
which is trained
in a past domain
to discriminate between the foreground and the background, may fail to classify an unseen object into the correct foreground or background class.
Intuitively, such a small non-distinctive change may be better handled by
the recent paradigm of
self-attention mechanism, which is the goal of our study.
\figA
Incorporating
a self-attention mechanism
into
an image change detection model
is not straightforward
owing
to the unavailability of
labeled training data.
Existing attention models
have primarily been
studied
in such application domains where rich training data are available \cite{zhao2020exploring}.
They are typically pre-trained on big data
and further fine-tuned in the target domain.
This training process is very expensive for robotics applications,
where robots need to adapt on-the-fly to a new test domain and detect change objects.
Therefore, a new unsupervised domain-adaptive attention model is required.
We propose a new technique
called domain-invariant attention mask
that
can
adapt
an image change detection model
on-the-fly to
a new target domain,
without modifying the input or output layers,
but
by introducing an attention mechanism to
the intermediate layer (Fig. \ref{fig:tobirae}).
A major advantage of our proposed approach,
owing to
its reliance on
high-level
contextual attention information
rather than low-level visual features,
is its potential to
operate effectively
in test domains
with unseen complex backgrounds.
In this sense,
our approach
combines
the advantages
of two major research directions in the change detection community:
pixel-wise differencing \cite{sakurada2020weakly,chen2021dr}
and
context-based novelty detection \cite{contreras2019vision,pimentel2014review},
by incorporating all available information into the attention mechanism.
Our contributions can be summarized as follows:
(1)
We explore a new approach,
called domain-adaptive attention model,
to image change detection for robotics applications,
with an ability of unsupervised on-the-fly domain adaptation.
(2)
Instead of considering
pixel-wise differencing \cite{sakurada2020weakly,chen2021dr}
and
context-based novelty detection \cite{contreras2019vision,pimentel2014review},
as two independent approaches,
our framework
combines the advantages
of both approaches
by
incorporating all available
information into the attention mechanism.
(3)
We present a practical system for image change detection
using state-of-the-art techniques such as
image registration \cite{Hausler_2021_CVPR},
pixel warping \cite{truong2021learning},
and
Siamese ConvNet \cite{sakurada2020weakly}.
Experiments,
in which an indoor robot aims to detect visually small changes in everyday navigation,
demonstrate
that our attention technique
significantly boosts
the state-of-the-art image change detection
model.
\section{Related Work}
\subsection{Image Change Detection}
Image change detection is a long standing issue of
computer
vision and it has various applications such as
satellite image \cite{rs11111382,chen2020dasnet}, and autonomous driving \cite{alcantarilla2018street,sakurada2017dense}.
Existing
studies are
divided into 2D or 3D,
according to the sensor modality,
and
we focus on
image change detection
in 2D perspective views
from an on-board front-facing camera
in this study.
Since the camera is a simple and inexpensive sensor, our 2D approach can be expected to have
an extremely wide range of applications.
Pixel-wise differencing techniques for image change detection rely on the assumption of precise image registration
between live and reference images \cite{SatelliteCD}.
This method is effective
for
classical applications
such as satellite imagery \cite{SatelliteCD},
in which
precise registration is available in the form of 2D rotation-translation.
However,
this is not the case for
our
perspective view
applications \cite{PerspectiveCD},
in which
precise pixel-wise registration
itself
is a
challenging
ill-posed problem.
This problem may be alleviated
to some extent
by introducing
an image warping technique,
as we will discuss in Section \ref{sec:pixel_warping}.
However,
such pixel warping is far from perfect,
and may yield false alarms in image change detection.
Novelty detection is a major alternative approach to image change detection \cite{sofman2011anytime}.
In that, novelties are detected as deviations from a nominal image model
that is pre-trained from unlabeled images in a past training domain.
Unlike pixel-wise differencing,
this technique
can naturally capture the contextual information of the entire image to determine whether there are any changes in the image.
However,
on the downside,
the change regions cannot be localized within the image
even if the existence of the change is correctly predicted.
Therefore,
existing researches of
novelty detection
in the literature
have focused on
applications
such as
intruder detection \cite{IntruderDet},
in which
the presence or absence of change, not the position of the changing object, is the most important outcome information.
Several
new
architectures
targeting small object change detection have recently been presented.
For example,
Klomp et al. proposed to use Siamese
CNN to detect markers for improvised explosive devices (IEDs)
\cite{klomp2020real},
where
they tackled the resolution problem by
removing the output-side layer of ResNet-18 \cite{he2016deep} to improve the detection performance of small objects.
Our approach differs from these existing approaches
in that
(1)
it does not require to modify the input and output layers of the architecture,
and
(2)
it is able to utilize contextual information.
\subsection{Attention}
Inspired by the major success of transformer architectures in the field of natural language processing,
researchers have recently applied attention techniques to computer vision tasks,
such as image classification \cite{zhao2020exploring,dosovitskiy2020image},
object detection \cite{carion2020end}, semantic segmentation \cite{xie2021segformer}, video understanding \cite{zeng2020learning},
image generation \cite{parmar2018image}, and pose estimation \cite{lin2021end}.
Because self-attention captures long-range relationships with low computational complexity,
it is considered a potential alternative to convolutional neural networks (CNNs) \cite{han2020survey}.
Recently, several studies have reported the effectiveness of attention in change detection tasks.
HPCFNet
\cite{HPCFNet}
represents
attention
as
a correlation between feature maps,
DR-TA Net
\cite{chen2021dr}
evaluates
temporal
attention
by computing
the similarity and dependency
between
a feature map pair,
to realize attention-based change detection.
CSCDNet
\cite{sakurada2020weakly}
employs
a correlation filter
to compensate
for
the uncertainty
in the non-linear transformation
between live and reference images.
From the perspective of robotic applications,
one of major limitations
of the current self-attention techniques
is that they require
a large training set
to reduce domain dependency.
In our contribution,
we introduce a novel
domain-adaptive
attention
technique
that is
specifically
tailored for
unsupervised on-the-fly domain adaptation.
\figB
\section{Approach}
Our goal is to incorporate an unsupervised attention model into the image change detection model
without
modifying
the input
and output layers
of the model (Fig. \ref{fig:full}).
In this section,
we
implement
this idea
on a prototype
robotic SLAM system.
First,
we perform
a preprocessing
to compensate for the viewpoint error
and the resulting uncertainty
in non-linear mapping from the 3D real environment to
a 2D image plane of the on-board camera.
This preprocessing
consists
of
LRF-SLAM based viewpoint estimation (Section \ref{sec:lrfslam})
followed
by pixel-wise warping
(Section \ref{sec:pixel_warping}).
However,
even with
such a preprocessing,
the images are often affected
by unpredictable nonlinear mapping errors.
To address this,
we introduce a novel attention mask to direct the robot's attention
to differentiate the foreground from the background (Section \ref{sec:attention_mask_gen}).
As an advantage,
our approach
can insert this attention mask into the intermediate layer,
without modifying the input or output layers (Section \ref{sec:attention_layer}).
Furthermore,
we make use of
the pixel-wise confidence
to further
improve the image change detection performance (Section \ref{sec:post_processing}).
The individual modules are detailed as followings.
\figC
\subsection{Dataset Collection}\label{sec:lrfslam}
Figure \ref{fig:mobile_robot}
shows
the indoor robot experimental platform.
We employ
LRF-SLAM in \cite{lrfslam}
as a method for aligning live images with the reference images.
An input live image
is paired with
a reference image if its angle deviation from the live image is less than the threshold
of 1 degree.
If no such
reference image exists,
it
is paired
with the nearest neighbor viewpoint
to the live image's viewpoint,
without considering the angle information.
\figD
\subsection{Pixel Warping}
\label{sec:pixel_warping}
We further compensate
for the viewpoint misalignment in LRF-SLAM by introducing an image warping technique.
A warp is a 2D function, $u(x, y)$,
which maps a position $(x, y)$ in the reference image to
a position $u=(x', y')$ in the live image.
Dense image alignment, which is recently proposed in \cite{truong2021learning}, is employed to find an appropriate warp,
by minimizing an energy function in the form:
\begin{equation}
-\log p(Y | \Phi(X;\theta))= \sum_{ij}\log p(y_{ij}|\varphi_{ij}(X;\theta))
\end{equation}
where
$X$ is input image pair $X = (I^q, I^r)$,
$Y$ is ground-truth flow, $\Phi$ and $\varphi$ are predicted parameters.
An example of pixel warping is shown in Fig. \ref{fig:pixel_warp}.
\figF
\subsection{Attention Mask Generation}
\label{sec:attention_mask_gen}
We here introduce a novel domain-invariant attention mask (Fig. \ref{fig:attention_mask}),
inspired by self-attention mechanism \cite{dosovitskiy2020image}.
Recall that
in
standard self-attention \cite{vaswani2017attention},
the interrelationships of the elements in the sequence
are obtained
by computing a weighted sum over all values ${\bf v}$ in the sequence
for each element in an input sequence ${\bf z} \in R^{N \times D}$.
The attention weights are based on the pairwise similarity between
two elements of the sequence and their respective
query ${\bf q}$ and key ${\bf k}$ representations:
\begin{equation}
[{\bf q}, {\bf k}, {\bf v}] = {\bf zU}_{qkv} \hspace{2cm} {\bf U}_{qkv} \in \mathbb{R}^{D \times 3D_h}
\end{equation}
\begin{equation}
\label{eq:sa}
SA({\bf z}) = softmax({\bf qk}^T / \sqrt{D_h}){\bf v}
\end{equation}
In the proposed method,
this {\it SA} term is replaced with:
\begin{equation}
Proposed({\bf q_{p}},{\bf k_{p}},{\bf m_{cnn}}) = PatchMatch({\bf q_{p}},{\bf k_{p}}) \odot {\bf m_{cnn}}.
\end{equation}
Here, ${\bf q_{p}} \in \mathbb{R}^{h_{np} \times w_{np} \times D_p}$
and
${\bf k_{p}} \in \mathbb{R}^{h_{np} \times w_{np} \times D_p}$
are patches extracted from live and reference images, respectively.
${\bf m_{cnn}} \in \mathbb{R}^{h_{cnn} \times w_{cnn} \times D_{cnn}}$
is an intermediate feature of the Siamese CNN. The $PatchMatch$ is
the function
that predicts whether
or not a pair of $D_p$-dim vectors of ${\bf q_{p}}$ and ${\bf k_{p}}$ match.
We generate a binary attention mask by incorporating the attention mechanism.
First,
the image is reshaped into a sequence of 2D patches, each of which is described by a local feature vector.
We employ the 128-dim deep PatchNetVLAD \cite{Hausler_2021_CVPR}
descriptor as the local feature vector.
The attention score is then computed for each region of interest.
We
then
evaluate
the attention score
as the
patch-wise
dissimilarity (i.e., L2 distance)
between
live and reference image pairs.
Then,
RANSAC geometric verification is performed to filter out
false alarms
that are
originated from change patches.
Finally,
we
obtain
the attention regions
as
scattered discrete regions of
live patches
with positive attention score,
which
makes a binary attention mask.
\algA
Algorithm \ref{alg-attention-mask_gen} presents the algorithm for creating the attention mask.
It aims to
compute
a binary
attention mask
$Mask$
for
an array of
$W_p\times H_p$
patches
at time instance $t$
from
a sequence of live images within
the time interval $[t-T, t+T]$.
The algorithm
begins with
the initialization of the mask variable $Mask$,
and
iterates for each live image,
the following steps:
First,
it extracts
from an input image
a set of
PatchNetVLAD feature vectors (``$ExtractPF$''),
each of which
belongs to one of reference patches.
Then,
for each live feature,
it searches
for
its mutual nearest neighbor
(``$MNN$")
reference patch
in terms of the L2 norm of their PatchNetVLAD features.
Here,
the mutual nearest neighbor search is defined as the process of searching for pairs of matching live and reference elements that
are closest to each other.
Only feature pairs that have passed the mutual nearest neighbor search are sent to the next RANSAC process.
Then,
it performs
geometric verification by RANSAC \cite{ransac} (``$RANSAC$").
Finally,
it outputs
pixel
with
values greater than or equal to threshold,
in the form of the binary attention mask:
\begin{equation}
\label{eq:binary_elem}
\mathbf{b}[i,j] = \left\{
\begin{array}{ll}
1 & \mbox{If $inliers[i,j]$ passed RANSAC}\\
0 & \mbox{Otherwise}
\end{array}
\right.
.
\end{equation}
\subsection{Attention Mask Layer}\label{sec:attention_layer}
We
now
insert
the attention mask
into the standard
image change detection model
of the Siamese CNN (Section \ref{sec:attention_mask_gen}).
For the Siamese CNN, we use the state-of-the-art architecture of CSCDNet \cite{sakurada2020weakly}.
The attention mask layer takes the CNN feature map and attention mask as inputs and outputs the CNN features masked in the channel direction.
We inserted the attention mask before correlation operation (i.e., before concatenating decoded feature).
We perform the process of masking the CNN Siamese feature map in the channel direction.
Let
$\mathbf{fmap_{new}} \in \mathbf{R}^{W \times H}$
denote the feature map after attention is applied.
Let
$\mathbf{fmap_{old}} \in {R}^{W \times H \times C}$
denote the feature map obtained from Siamese CNN.
Here, $W$ denote the tensor width,
$H$ denote the tensor height,
and $C$ denote the tensor channel.
Let
$\mathbf{mask} \in \mathbf{R}^{W \times H}$
denote the attention mask.
Then,
the attention mask element
at the $i$-th row,
$j$-th column
and $k$-th channel is:
\begin{equation}
\label{eq:merge}
\mathbf{fmap_{new}}[i,j,k] = \mathbf{fmap_{old}}[i,j,k] \cdot \mathbf{mask}[i,j].
\end{equation}
This operation is applied to the both branches of the Siamese CNN.
\subsection{Post Processing}\label{sec:post_processing}
Post-processing is introduced to eliminate false alarms in the detection results.
We evaluate
the uncertainty
in the output layer of
the dense image alignment model
and use it to evaluate
the confidence of prediction at each pixel.
Intuitively,
a high probability of pixel warping uncertainty
indicates
that no corresponding pixel exists;
therefore is a high possibility of change.
Conversely,
low probability
indicates that the corresponding pixel exists;
therefore is a low possibility of change.
This masking process can be simply expressed as
an
Hadamard product
operation, in the following form:
\begin{equation}
\label{eq:unc_merge}
\mathbf{output_{new}}[i,j] = \mathbf{output_{old}}[i,j] \cdot \mathbf{uncertainty}[i,j].
\end{equation}
Here, $\mathbf{output_{old}} \in \mathbf{R}^{W \times H}$ represents the change probability value map of the output of
the Siamese CNN.
$\mathbf{uncertainty} \in \mathbf{R}^{W \times H}$ represents the uncertainty of each pixel warp of a live image.
$\mathbf{output_{new}} \in \mathbf{R}^{W \times H}$ represents the probability of change for each pixel after the merging process.
\section{Evaluation Experiments}
\subsection{Dataset}
We collected
four datasets,
``convenience store,''
``flooring,''
``office room,''
and ``hallway,''
in four distinctive environments.
Eight independent image sequences
are collected
from the four different environments.
The number of images
are
534, 491, 378, and 395,
respectively
for
``flooring,"
``convenience store,"
``office,"
and
``hallway".
Examples of these images are shown in Fig. \ref{fig:dataset}.
The image size was $640\times 480$.
The
ground-truth change object regions
in each live image
are manually annotated
using PaddleSeg \cite{liu2021paddleseg, paddleseg2019}
as the annotation tool.
\figE
\subsection{Settings}
The state-of-the-art model,
CSCDNet \cite{sakurada2020weakly},
is used as our base architecture,
which we aim to boost in this study.
It is also used as a comparing method to verify
whether the proposed method
can actually boost the CSCDNet.
The network is initialized
with the weight pre-trained on ImageNet \cite{deng2009imagenet}.
The pixel-wise binary cross-entropy loss is used as loss function as in the original work of CSCDNet \cite{sakurada2020weakly}.
PDCNet \cite{truong2021learning}
is used to align reference images.
Adam optimizer \cite{kingma2014adam}
is used for the network training.
Learning rate is 0.0001.
The number of iterations is 20,000.
The batch size is 32.
A nearest neighbor interpolation
is used
to resize the attention mask
to
fit into the attention mask layer.
The length of reference image sequence is set to $T=10$ in default.
A single NVIDIA GeForce RTX 3090 GPU
with PyTorch framework is used.
Pixel-wise precision, recall, and F1 score are used as performance index.
\figG
\subsection{Quantitative Results}
Figure \ref{fig:Performance}
shows performance results.
As can be seen,
the proposed method
outperformed the comparing method
for almost all combinations
of training and test sets
considered here.
Notably, the proposed method
extremely
outperformed the comparing method when it was trained on the ``flooring'' dataset.
The ``flooring'' is the simplest background scene.
Therefore, the image change detection model trained on that could be generalized to other complex domains as well.
However, the proposed method performed almost the same as the comparing method when it was trained on the other complex background scenes.
As an example, for the convenience store dataset,
the robot navigates through a narrow and messy passage that makes its visual appearance very different from that of the other two datasets.
This makes
the
proposed
training
algorithm
less effective for
the training set.
It is noteworthy
that
such an effect
of visual appearance
might be
mitigated by introducing
view synthesis technique such as \cite{kupyn2019deblurgan},
which is a direction of future research.
\figH
\subsection{Qualitative Results}
Figure \ref{fig:examples} shows example results
in which
the proposed attention mechanism
was
often
successful
in improving the performance of the CSCDNet.
Especially,
the proposed method
was effective for
complex background scenes,
owing to the ability of the proposed attention mechanism
to make use of contextual information.
\figI
\subsection{Ablation Study}
Table \ref{Table:ablation_warp_unc}
presents the results of
a series of ablation studies
by turning off some of the modules in the proposed framework.
For all ablations, the flooring dataset is used as the training data.
For the ``convenience store'' dataset,
the performance is
significantly higher
with than without
the post-processing technique
in Section \ref{sec:post_processing}.
Because of the complex background of this dataset,
pixel warping often fails,
and the proposed method was effective in suppressing
such effects
that are originated from complex backgrounds.
For the ``office'' and ``hallway'' datasets,
the performance is almost the same
between
with and without
the technique.
Since the background was less complex in these datasets,
pixel warp failures were less common,
therefore the effect of estimating uncertainty was small.
Next, another ablation with different settings of the length of reference image sequences are conducted.
As can be seen, the performance is best at $T$=10.
As expected, higher performance was obtained with longer reference sequences.
From the above results,
it could be concluded that
both of PDCNet and pixel warping
play important roles
and
can actually improve the performance
of image change detection.
\section{Conclusions}
In this research,
we tackled the challenging problem of small object change
detection
via everyday indoor robot navigation.
We proposed
a new self-attention technique with
unsupervised on-the-fly domain adaptation,
by introducing an attention mask into the intermediate layer of
an image change detection model,
without modifying the input and output layers
of the model.
Experiments using a novel dataset on small object change detection verified
that
the proposed method significantly boosted the state-of-the-art model for image change detection.
| {'timestamp': '2022-04-26T02:32:40', 'yymm': '2203', 'arxiv_id': '2203.15362', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15362'} | arxiv |
\section{Related Work}
\label{sec:related_work}
\textbf{Hybrid networks.} The idea originated in research presented in \cite{oyallon2017firstHybrid} where E. Oyallon et al. experimented with replacing initial layers of ResNet \cite{he2016resNet} and Wide ResNet \cite{zagoruyko2016wrn} with a scattering transform. This approach allowed deeper analysis and better interpretation of complex deep learning techniques and demonstrated that predefined filters grant theoretical guarantees required for building better networks and more stable representations. Presented results saw a sizeable improvement as compared to previous scattering-based approaches \cite{brunaMallat2013invariant_scatSVM}. Despite that, the performance with respect to fully-trained counterparts was still low. However, the promising properties of hybrid networks encouraged research to continue and alternative approaches were introduced. For example, Dual-Tree Complex Wavelet Transform-based network \cite{singh2017dtcwScat} or a Locally Invariant Convolutional Layer \cite{cotter2019learnableScat} which pioneered learning in the scattering domain. Although novel approaches including those reviewed in \cite{minskiy2021scatReview} saw further performance improvement, the issue of a significant performance gap between hybrid and fully-trained networks remained.
\textbf{Hand-crafted features.} A wide variety of predefined filters has been applied to hybrid designs, most of which are wavelet-based. Researchers employed both discrete and continuous wavelets including Haar \cite{fujieda2018waveletCNN}, Gabor \cite{czaja2019gaborHybrid}, and Morlet \cite{mallat2012scatTransform} wavelets. Later, it was demonstrated that wavelets are most efficient when they are used in a layered CNN-like configuration, such as Scattering Transform \cite{brunaMallat2013invariant_scatSVM} and Dual-Tree Complex Wavelet Transform \cite{selesnick2005dtcwt}.
Following the approach of E. Oyallon et al. \cite{oyallon2017firstHybrid}, we employ scattering transform, $S$, as the hand-crafted part for our hybrid network. It is formed by cascading wavelet transforms and modulus nonlinearity functions \cite{mallat2012scatTransform}. It guarantees translation invariance and linear response to deformations by separating the information along with multiple scales and orientations. As this work focuses on image classification, the wavelets are calculated from a zero-average complex wavelet $\psi$ as follows \cite{zarka2019scatDictonary}:
\begin{equation*}
\psi_{j,\theta}(u) = 2^{-2j}\psi(2^{-j}r_{-\theta}u),
\end{equation*}
\begin{equation*}
\psi_{j,\theta,\alpha} = Real(e^{-i\alpha}\psi_{j,\theta})
\end{equation*}
where $r_{-\theta}$ defines rotation, $2^j$ defines dilation, and $\alpha$ - phase shift.
In the proposed design we employ the first-order scattering coefficients which, for a given image $x$, are calculated by averaging rectified wavelet coefficients with a sub-sampling stride of $2^J$:
\begin{equation*}
Sx(u,k,\alpha) = |x\star\psi_{j,\theta,\alpha}|\star\phi_J(2^Ju); k=(j, \theta)
\end{equation*}
where non-linearity is obtained with a complex modulus function and $\phi_J$ is a Gaussian dilated by $2^J$ \cite{brunaMallat2013invariant_scatSVM} that eliminates the variations at scales smaller than $2^J$. Further details on the parameter selection are available in section \ref{sec:taining_details}.
\section{Building an Inductive Hybrid Network}
\label{sec:building_an_e-hybrid_network}
To address the weaknesses of existing hybrids, such as lacking performance and adaptability, we introduce an inductive approach as an alternative to the currently popular stacking paradigm. Conceptually, instead of replacing initial network stages, we enrich the backbone data flow along the entire network path with the output of a scattering transform. By design, this fusion allows scattering features to guide the training process, while the network can adaptively regulate their effect using the deep learning strategy. As a result, our architecture benefits from well-defined and informative hand-crafted features, as well as from an adaptable and flexible deep learning-based approach. The following two sections detail the building blocks of the proposed architecture and explain our design decisions.
\subsection{Hybrid Fusion Blocks}
\label{sec:hybrid_blocks}
Hybrid architecture furnishes a network with two complementary types of representations: fixed, hand-crafted with defined properties and learnt features that are adaptable to the data. The biggest challenge, then, is to fuse those while preserving the necessary information to maximise the classification performance. In our design, Hybrid Fusion Blocks enable that and steer the training procedure more effectively by drawing from the strengths of both types of features.
Hybrid Fusion Blocks are designed as encapsulated units and cause no additional disruption to the main network data flow. Figure \ref{fig:hybrid_blocks} illustrates how two streams of coefficients are embedded into a single tensor identical in shape to the output of the previous network layer. First, we perform feature expansion by concatenating scattering activations with an output of the previous layer, both of which are batch normalised. Then, inspired by the highly efficient MBConv block \cite{sandler2018mobilenetv2} we apply depth-wise convolution with a 3x3 kernel, followed by the Squeeze and Excitation (SE) stage. SE procedure allows the network to perform a re-adjustment through which it selectively emphasises informative features and suppresses less descriptive ones \cite{hu2018SEblock} enabling the network to prioritise scattering representations early in the process and regulate their effect as training progresses. Hybrid Fusion Block is concluded with point-wise convolution.
The above-described is the default Hybrid Fusion architecture (HF-$E$), we also introduce two alternatives to test the effects of batch normalisation during feature expansion and depth-wise convolution. This way, the HF-$H$ block has batch normalisation disabled in the first stage. While HF-$Z$ omits the depth-wise convolution procedure as shown in Figure \ref{fig:hybrid_blocks}.
Additionally, to assess the influence of DropConnect \cite{wan2013dropConnect} and skip connection features when applied to the HF block, we evaluate three sub-variations for each of the three architectures. Option 0: without DropConnect and no skip connection; (1) no DropConnect with a skip connection; (2) with both DropConnect a skip connection enabled. Hence, the total number of block variations is nine, all of which are listed in Table \ref{tab:all_results}.
\begin{table}[!b]
\newcolumntype{C}[1]{>{\hsize=#1\hsize\centering\arraybackslash}X}
\begin{tabularx}{\linewidth}{ l c c }
\hline
Operator & Output Res & \# Channels \\
\hline
1. Conv3x3 & 112x112 & 32 \\
2. MBConv1, 3x3 & 56x56 & 16 \\
\textbf{3. HF-1, 3x3} & \textbf{56x56} & \textbf{24} \\
4. MBConv6, 3x3 & 28x28 & 24 \\
\textbf{5. HF-2, 3x3} & \textbf{28x28} & \textbf{40} \\
6. MBConv6, 5x5 & 14x14 & 40 \\
7. MBConv6, 3x3 & 14x14 & 80 \\
8. MBConv6, 5x5 & 7x7 & 112 \\
9. MBConv6, 5x5 & 7x7 & 192 \\
10. MBConv6, 3x3 & 7x7 & 320 \\
11. Conv1x1, Pooling, FC & 7x7 & 1280 \\
\hline
\end{tabularx}
\caption{Overview of E-HybridNet-$E$ architecture for an input of resolution 224x224 pixels.}
\label{tab:hybryd_dataflow}
\end{table}
\subsection{Scalable Network Architecture}
\label{sec:network_architecture}
Our feature embedding approach requires careful spatial feature resolution management, which restricts a selection of compatible backbone networks. The primary challenge is to align the two streams of features, network activations and scattering transform output, with respect to their spatial resolution.
One of the networks that meet this requirement is EfficnetNet \cite{tan2019efficientnet}. Scattering networks can be parameterised (as per section \ref{sec:taining_details}) to achieve alignment with respect to the resolution of the corresponding spatial features. Although other architectures previously employed with hybrids such as ResNet \cite{he2016resNet, oyallon2018firdtOrderScat}, Wide-ResNet \cite{zagoruyko2016wrn, oyallon2018scatAnalsysis} and VGG \cite{simonyan2014vgg, cotter2019learnableScat} also fulfill our resolution requirement, EfficientNet seem favorable due to its high performance-complexity trade-off, flexibility and wide recognition in applications related to image classification.
Previous research showed \cite{oyallon2018scatAnalsysis, cotter2019learnableScat} that scattering features are most effective when applied to early CNN stages. Hence, to build E-HybridNet we insert one Hybrid Fusion Block (HF-1) before original stage 3 of EfficientNet and another one (HF-2) just after it. Table \ref{tab:hybryd_dataflow} portrays the E-HybridNet-B0-$E$ architecture and demonstrates the integration of two Hybrid Fusion Blocks. We apply a two-step process to enhance the effect and form a flow of scattering features.
Importantly, due to the flexibility of the backbone network and adaptable HF block design, E-HybridNet is a highly scalable architecture. Unlike other existing hybrid networks, its complexity can easily be adjusted without re-configuring the predefined part.
\begin{table*}[!ht]
\centering
\begin{tabular}{ l| c c c c }
\hline
Network Type & Caltech-256, \% & Flowers-102, \% & CoronaHack-2, \% & CoronaHack-3, \%\\
\hline
\textbf{EfficientNet-B0} & 54.23 & 94.63 & 92.58 & 85.66 \\
E-HybridNet-B0-$E$0 & \textbf{60.24} & \textbf{97.75} & 95.10 & 87.73 \\
E-HybridNet-B0-$E$1 & 60.08 & 96.52 & \textbf{95.49} & \textbf{87.82} \\
E-HybridNet-B0-$E$3 & 58.92 & 97.63 & 95.21 & 86.27 \\
\hline
E-HybridNet-B0-$Z$0 & 59.50 & 97.12 & 94.09 & 84.24 \\
E-HybridNet-B0-$Z$1 & \textbf{60.27} & 96.73 & 93.86 & \textbf{89.44} \\
E-HybridNet-B0-$Z$3 & 57.63 & \textbf{97.63} & \textbf{94.32} & 85.82 \\
\hline
E-HybridNet-B0-$H$0 & \textbf{60.09} & 96.52 & \textbf{95.15} & 80.49 \\
E-HybridNet-B0-$H$1 & 58.94 & 96.14 & 94.85 & \textbf{83.52} \\
E-HybridNet-B0-$H$3 & 59.93 & \textbf{97.03} & 92.73 & 81.46 \\
\hline
\textbf{EfficientNet-B3} & 49.07 & 96.35 & 92.35 & 80.56 \\
E-HybridNet-B3-$E$0 & 52.40 & 96.55 & \textbf{95.19} & 85.39 \\
E-HybridNet-B3-$E$1 & 54.88 & 96.84 & 93.59 & 86.35 \\
E-HybridNet-B3-$E$3 & \textbf{56.78} & \textbf{97.17} & 94.38 & \textbf{87.44} \\
\hline
E-HybridNet-B3-$Z$0 & \textbf{56.23} & \textbf{96.75} & \textbf{94.86} & 85.00 \\
E-HybridNet-B3-$Z$1 & 52.53 & 96.96 & 93.22 & \textbf{86.68} \\
E-HybridNet-B3-$Z$3 & 54.99 & 96.42 & 94.21 & 85.58 \\
\hline
E-HybridNet-B3-$H$0 & \textbf{55.83} & 96.95 & \textbf{93.31} & 83.93 \\
E-HybridNet-B3-$H$1 & 54.75 & \textbf{97.53} & 92.63 & \textbf{85.07} \\
E-HybridNet-B3-$H$3 & 53.75 & 96.91 & 92.38 & 84.87 \\
\hline
\end{tabular}
\caption{Results for EfficientNet B0, B3 and hybrid networks based on those.}
\label{tab:all_results}
\end{table*}
\section{Experimental Setup}
This section reviews key elements of the experimental setup and justifies the reasons behind certain decisions.
\subsection{Datasets}
\label{sec:datasets}
Datasets were selected based on the following principles: (i) data is representative of a real-world problem; (ii) to form a variety of tasks with generic and specific data; (iii) data is of relatively high image resolution
; (iv) the size of the dataset is not too large due to a considerable number of required experiments. Following is a brief introduction to each of the datasets employed.
Flowers-102 \cite{nilsback2008flowers}: a topic-specific and structure intensive dataset. It consists of 6,652 training and 819 test images non-uniformly split across 102 classes. CoronaHack \cite{cohen2020coronaHack} is a medical dataset that consists of a mixture of CT scans and X-ray images. It features 5,309 training and 624 test images that can be split either into 2 (disease, no disease) or 3 (virus, bacteria and healthy) categories. We test our networks on both variations. Caltech-256 \cite{griffin2006caltech256} presents 256 imbalanced categories of real-life objects, it has a training set of 23,824 images and a testing set of 5,956.
\textbf{Evaluation metric.} As all datasets are imbalanced, the often-used accuracy metric would not be representative as it is highly sensitive to that. Hence, mean Average Precision (mAP) is employed as the main evaluation metric and all results presented in the following discussions will refer to mAP.
\subsection{Training Details}
\label{sec:taining_details}
\textbf{Training procedure.} The primary challenge was to create an environment to fairly compare a wide variety of networks. For this, we followed an approach suggested in \cite{minskiy2021scatReview} and employed a standard training procedure across all experiments. To remove the optimisation bias, we trained all networks from scratch and kept most parameters constant. These include cross-entropy loss function, cosine-annealing scheduler with a step size equal to the number of epochs and SGD optimisation strategy. A minority of parameters varied depending on the dataset, such as the number of epochs, batch size and initial learning rate. More details are available in the project's GitHub directory: https://github.com/dminskiy/EHybridNet-icpr2022.
\textbf{Scattering features.} To ensure the scattering coefficients align with the EfficientNet backbone in terms of the feature spatial size as per section \ref{sec:network_architecture} the following scattering configurations were employed. For the first Hybrid Fusion Block, HF-1, $J$ was set to 2, whereas for the second, HF-2, $J=3$. The common parameters for both layers are the scattering order of 1, 8 angles $\theta$ and 4 phases $\alpha$. Scattering coefficients are computed with a modified to allow multi-GPU support Kymatio \cite{andreux2020kymatio} package, please see the project's directory for details.
\begin{figure}[!b]
\centerline{\includegraphics[width=\linewidth]{media/comparison_of_HF_blocks.png}}
\caption{Performance comparison of Hybrid Fusion Block architectures.}
\label{fig:nets_outperformed_hybrids_B0&3}
\end{figure}
\begin{table*}[!ht]
\centering
\begin{tabular}{ l| c c| c c| c c }
\toprule
\multirow{2}{*}{Dataset} &
\multicolumn{2}{c|}{All of training data} &
\multicolumn{2}{c|}{50\% of training data} &
\multicolumn{2}{c}{25\% of training data} \\
& {Hybrid, \%} & {EfficientNet, \%} & {Hybrid, \%} & {EfficientNet, \%} & {Hybrid, \%} & {EfficientNet, \%} \\
\midrule
Caltech-256 & \textbf{60.24} & 54.23 & \textbf{54.60} & 46.68 & \textbf{45.81} & 38.03 \\
Flowers-102 & \textbf{97.75} & 94.63 & \textbf{95.81} & 91.88 & \textbf{92.14} & 85.52 \\
CoronaHack-2 & \textbf{95.10} & 92.58 & \textbf{94.93} & 90.85 & \textbf{92.70} & 88.92 \\
CoronaHack-3 & \textbf{87.73} & 85.66 & \textbf{85.79} & 85.26 & \textbf{79.32} & 78.42 \\
\bottomrule
\end{tabular}
\caption{Results with limited training data for E-HybridNet-B0-$E$0 and EfficientNet-B0.}
\label{tab:limited_data_results}
\end{table*}
\section{Evaluation and Analysis}
In this section, we first explore the properties of the E-HybridNet, then evaluate its performance against the baseline EfficientNet. Finally, we assess the effect of scattering features on the network's efficiency in normal and data-limited conditions.
\subsection{E-HybridNet Performance}
\label{sec:hybrid_performance}
\textbf{Hybrid Fusion Block architecture}.
First, we evaluate the effects of different design choices on the overall network performance, concentrating on the comparison of three primary design groups (HF-$E$, HF-$Z$ and HF-$H$) as per section \ref{sec:hybrid_blocks}. The impact of skip connections and DropConnect is considered later in the section.
To select the best architecture, we count the number of networks each of the candidate hybrid designs has outperformed and accumulate it across our four evaluation datasets and two network complexity configurations (B0 and B3), results are shown in figure \ref{fig:nets_outperformed_hybrids_B0&3}. To select the best performing design, we group the obtained results based on Hybrid Fusion Block variations ($E$, $Z$ or $H$). Thereby, we observe that HF-$E$ based networks outperformed 44.1\% of other hybrids, followed by HF-$Z$ design (better in 32.99\% cases) and HF-$H$ (22.92\%). These findings indicate the importance of batch normalisation before the features are concatenated, as this is the only difference between the leading HF-$E$ and the least effective HF-$H$ designs. Similarly, the depth-wise convolution stage proved effective as it allowed HF-$E$ architecture to be over 10\% more efficient than the HF-$Z$ design that does not have this feature.
\textbf{Hybrid Fusion Block variations.}
DropConnect and skip connection modules are present within the original EfficientNet architecture and play an important role in its success. Here, we analyse their effect on the E-HybrdNet, for this we apply the same method as before and count the number of peer-hybrids each individual architecture outperforms.
Figure \ref{fig:nets_outperformed_hybrids_B0&3} presents the aggregate result between B0 and B3-based networks and shows that the effect of these features depends on the fusion block architecture. The skip connection module, on average, did not change the performance of Hf-$E$ networks, for both HF-$E$0 and HF-$E$1 the number of outperformed networks remained the same, at 13.54\%. HF-$Z$ hybrids, on the other hand, benefited from the addition of the skip connection - the success rate improved by 1.74\%. Whereas, HF-$H$ architecture saw a drop in performance with the addition of this feature (-1.39\%). As for the DropConnect, the presence of this module took HF-$E$3 design to 17.01\%, the highest amongst all networks. However, its effect on other architectures was negative, reducing the performance by 2.78\% and 2.43\% for HF-$Z$ and HF-$H$ respectively.
In summary, we observe that DropConnect and skip connection modules can improve the adaptability of the network and they are most effective with the base E-hybridNet architecture - HF-$E$.
\textbf{Comparison with EfficientNet.}
The major drawback of previous hybrid architectures is their relatively low classification performance as compared to their conventional counterparts. Hence, in this experiment, we compare the performance of the base hybrid architecture (HF-$E$0) against the vanilla EfficientNet in B0 and B3 configurations applied to four diverse datasets.
Results presented in Table \ref{tab:all_results} evidence the dominance of the hybrid that is on average 3.43\% more accurate than the reference network with a maximum gap of over 6\% in B0 setup. When the backbone complexity is increased to B3, the average hybrid's advantage is 2.8\% with a maximum of 4.83\% To the best of our knowledge, it is the first time a hybrid network could consistently outperform the baseline network on a variety of tasks when entire training data is available.
\begin{figure}[!b]
\centerline{\includegraphics[width=\linewidth]{media/ablation_study.png}}
\caption{Results of the ablation study.}
\label{fig:deactivation}
\end{figure}
\subsection{Ablation Study}
\label{sec:Effect_of_Scattering_Features}
Here, we evaluate the contribution of scattering features to the performance of our hybrid design. As our HF block fuses scattering coefficients with an output of the corresponding network layer (network features, in short), an idea of the ablation study, therefore, is in disabling parts of the Hybrid Fusion Block. In one case, the scattering features are omitted from the merging stage while, in the other, the network features fed into the block will be ignored. As before, we use HF-$E$0 hybrid configuration for evaluation.
Figure \ref{fig:deactivation} summarises the results of this experiment across four datasets and following networks: EfficientNet-B0 (Reference), E-HybridNet-B0-$E$0 (Hybrid), E-HybridNet-B0-$E$0 with scattering features omitted (Hybrid Scat Disabled) and E-HybridNet-B0-$E$0 with network features ignored (Hybrid Net Disabled). Across the four datasets, the average loss in performance due to the lack of scattering features is 5.08\%, while the average performance drop due to the network features not being present is 1.48\% as compared to the baseline hybrid result. This indicates the significance of scattering features in hybrid architecture and shows that they are, indeed, the driving factor for its success. Additionally, we note that the average performance loss caused by disabling both hybrid and networks features (3.64\%) is approximately equal to the average gain of the hybrid versus the EfficientNet-B0 (3.76\%) architecture. This can be interpreted as "disabling" both parts of the Hybrid Fusion Block (or effectively removing the hybrid part of the network) is the same as running the standard EfficientNet-B0. Importantly, most of the loss when moving from hybrid to standard design is due to a lack of scattering features.
\subsection{Generalisation}
\label{sec:generalsiation}
Historically, hybrids' ability to generalise from small amounts of data have been their strongest advantage over their fully-trained counterparts. To validate that our design preserves this strength, we compare the base hybrid network (HF-$E$0) and its baseline EffcientNet-B0 in data-limited scenarios. We use our four evaluation datasets with 50\% and 75\% of the training samples removed randomly.
From results presented in Table \ref{tab:limited_data_results}, we observe that the hybrid network was constantly ahead of EfficientNet-B0. On average, E-HybridNet was 3.43\%, 4.11\% and 4.77\% more accurate than the reference architecture with full, half and quarter of the training set available. It corresponds to approximately 0.7\% of relative gain for the hybrid as the amount of data is halved. Hence, we conclude that our fusion procedure embeds scattering features effectively, aids CNN generalisation and improves overall performance in data-limited scenarios.
\section{Conclusions}
In this work, we introduced the E-Hybrid network, the first scattering based hybrid network that consistently outperformed its conventional counterparts. The evaluation showed that our design improves mAP by up to 6\% with an average gain of 3.11\% across tested datasets.
We also presented Hybrid Fusion Blocks, the integral part of the novel design. They allow a network to benefit from the adaptability of CNNs while being guided by powerful hand-crafted representations.
Our analysis showed that scattering features were indeed the driving force behind the success of the proposed hybrid design and constituted a major part of the performance gain. They also allowed E-HybridNets to be superior in data-limited scenarios, considerably improving the network's generalisation.
\textbf{Current limitations and further work.} Despite the advantages of the novel architecture, certain aspects of it provide further research opportunities. For instance, currently, each Hybrid Fusion Block requires recalculation of scattering features which slows inference and training speeds by around 60\%. Another important area that has not been fully addressed yet is training optimisation for E-Hybrid networks, so far they have been tested mostly under a common setup strategy to facilitate the concept verification and enable a fair comparison. There is also a number of scattering and backbone architectures that could be explored within the proposed architectural paradigm. Therefore, we believe that this work is only a promising start in exploring a wide range of research opportunities in hybrid networks.
\bibliographystyle{latex12}
| {'timestamp': '2022-03-30T02:27:56', 'yymm': '2203', 'arxiv_id': '2203.15392', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15392'} | arxiv |
\section{Introduction} \label{introduction}
Imitation learning (IL) empowers non-experts to train robotic systems for arbitrary tasks. Improvements in IL would support more widespread adoption of robotic technologies in the home and workplace, but IL methods often require large amounts of supervised training data \cite{bc} and/or employ unintuitive data collection approaches \cite{dart, dagger}, creating a bottleneck in the adoption of these technologies.
A more natural approach to training of robotic agents is through supervisor \textit{interventions}, in which the supervisor (human operator) only intervenes in the agent's activity to provide corrections when it is approaching or has reached an undesirable state. The intervention approach is natural, because over time, it incrementally reduces the need for the supervisor to take over as the agent improves its performance, and it also reflects the way humans learn motor tasks such as driving a car with a coach. Furthermore, as opposed to imitation learning with supervisor-generated data only, intervention-based learning produces vast amounts of agent-generated data that could support it in further optimizing the agent’s policy.
Reinforcement learning (RL) methods are designed specifically to optimize agents based on such agent-generated data. Advances in RL have recently led to several breakthroughs in creating superhuman agents for games such as Atari, Go, and Chess \cite{muzero} as well as new successes in controlling complex physical characters within simulated environments \cite{deepmimic}. However, the main disadvantage of RL methods for real environments is that they require vast amounts of agent-generated trial-and-error data as they explore the environments.
Another factor that may obstruct widespread adoption of robots is the task-specific feature engineering required in most robotic systems. This has been mitigated somewhat by the aforementioned advances in deep reinforcement learning, which have broadened the generality of neural network models for policies, value estimators, and planning, but because RL tasks often require a certain amount of past experience along with the current observation for agents to perform tasks effectively, different tasks may still require different model architectures, which may be difficult for non-experts to design.
In this paper, we propose a framework aimed at facilitating users in training real-world robot agents on multiple tasks with very little supervision and fine tuning using the following components.
\begin{itemize}
\item A new intervention-based imitation learning (IIL) algorithm that combines IL (BC \cite{bc}) and RL (TD3 \cite{td3}) techniques to train agents on both supervisor-generated and agent-generated data concurrently.
\item A general multi-task model capable of simultaneously processing demonstrations, supervisor corrections, past experience, and the current observation sequence.
\end{itemize}
In the rest of this paper, we provide an overview of related work, formulate the IIL problem, describe our solution, describe experiments to validate the approach, then conclude with perspectives on the future potential of ReIL.
\section{Related Work} \label{related-work}
We build upon and address some of the limitations present in other proposed IIL algorithms such as HG-DAgger \cite{hg_dagger}, ``Learning to Drive in a Day" (which we abbreviate L2D) \cite{l2d}, EIL \cite{eil}, EGPO \cite{egpo}, IWR \cite{iwr}, and IARL \cite{iarl}.
An IIL environment generates two types of data, namely supervisor-generated data and agent-generated data. Some IIL algorithms train agents with only supervisor-generated or only agent-generated data. For instance, L2D utilizes RL to optimize a lane keeping agent by rewarding total distance traveled before supervisor intervention. The authors were remarkably able to train a functional lane keeping agent in a real driving environment in just 30 minutes. However, in our experiments, we have found that adding IL on top of the L2D approach greatly improves the rate at which it learns a task. On the other hand, HG-DAgger has been shown to greatly improve the performance of agents in terms of the amount of supervisor corrections required, compared to standard behavior cloning (BC) \cite{bc} and DAgger. HG-DAgger works by simply imitating supervisor corrections with BC. However, because HG-DAgger relies solely on supervisor-generated data, the agent would not continue to learn when it is performing well enough to execute without supervisor corrections. Furthermore, any IIL method that only utilizes supervised learning, including HG-DAgger and IWR, may require agents to be pre-trained with BC to produce an initial state visitation distribution sufficient for further intervention-based training, as the agent would not learn to avoid the actions that lead to interventions directly.
Besides not using all available data for learning, another specific limitation of several current state of art methods is that they either do not use or misuse estimates of cumulative discounted future reward. For example, EGPO and IARL are intervention-based RL approaches that successfully optimize an agent for navigation tasks. However, unlike L2D, these methods lack episode termination upon supervisor intervention, breaking the critical assumption that the value of a particular state-action pair is the expected cumulative future reward that would be obtained by the agent on executing that action. This introduces the possibility of a value overestimation bias for actions that lead to supervisor corrections. To make this clear, consider the case where the same reward function is applied to both supervisor-generated data and agent-generated data. Under such conditions, the supervisor may initially obtain much higher rewards than the agent, thereby creating a scenario where agent actions that lead to supervisor corrections have overestimated values. This would generally incentivize agents to ``cheat" by purposely generating undesirable actions that induce corrections. IARL avoids this problem by introducing a heuristic of differentiating the reward $r_t$ applied to the supervisor and the agent: \(r_t^{mix} = r_t - g_t\beta\), where $\beta$ is a positive constant and \(g_t = 1\) during supervisor corrections and $0$ otherwise. This differentiation prevents training on a single value function for both types of data. On the other hand, EGPO does permit the use of the same reward function for both supervisor and agent actions, but this permission leads to a requirement for an additional constrained optimization to minimize supervisor interventions.
Although methods such as IARL and EGPO utilize cumulative discounted future reward in ways that require additional heuristics to avoid undesirable behavior, eliminating value estimators entirely, as some other methods do, is also undesirable, as it delegates responsibility for comparing the relative quality of actions to the user. EIL is an IIL method that outperforms BC, DAgger, and also HG-DAgger. However, these methods do not utilize expected cumulative future reward, instead introducing a manually determined hyperparameter that determines the quality of each data-point for the process of optimization.
\section{Problem Formulation} \label{problem-formulation}
In this section, we describe the IIL problem in terms of two objectives, a formal IIL objective and an informal system design objective.
\subsection{Intervention-based Imitation Learning Objective}
The agent $\pi_{\theta}$ is assumed to operate within an environment given as a tuple $(S,A,P,R^{task},\pi_s)$, where $S$ and $A$ are the sets of possible states and actions, $P$ and $R^{task}$ denote the transition probability function and the task-specific reward function, and $\pi_s$ denotes the policy of the supervisor. An IIL trajectory is a sequence of tuples $(s_t, a_t, f^{demo}_t) \in S\times A\times \{0,1\}$ for $t \in 1..T$. We assume that $a_t = (1-f^{demo}_t)\pi_{\theta^{t}}(s_t) + f^{demo}_t\pi_s(s_t)$, where $f^{demo}_t = 0$ for agent-generated data and $f^{demo}_t = 1$ for supervisor-generated data. Moreover, the supervisor is assumed to have a set of acceptable state-action pairs for a task $\mathcal{D}_{good} \subseteq S \times A$ and that when $(s_t, \pi_{\theta^{t}}(s_t)) \not\in \mathcal{D}_{good}$, the supervisor intervenes and corrects the agent.
In such situations, would like an agent capable of performing arbitrary tasks optimally in the sense of the following objective.
\begin{equation} \label{eq:objective}
\begin{gathered}
\mathop{\text{max}}_{\theta}\Big(\mathop{\mathbb{E}}_{s_{k+1} \sim P(s_k, \pi_\theta(s_k))}[\sum_{k=0}^{T-1}{\gamma^{k}R^{task}(s_{k+1}, \pi_{\theta}(s_{k+1}))]\Big)},\\
\text{subject to}\; s_k \in \mathcal{D}_{good},
\end{gathered}
\end{equation}
where $\gamma$ $[0, 1)$ is the discount factor. We also note the assumption of IIL that only $A$ is known to the agent; information about $S$, $\mathcal{D}_{good}$, $P$, $R^{task}$, and $\pi_{s}$ must be gathered through exploration.
Although an optimal agent would not require supervisor interventions at all, explicitly optimizing to prevent such interventions does restrict the agent's state visitation to $s \in \mathcal{D}_{good}$. This restriction, by limiting the scope of exploration for the agent, actually eases its optimization.
Hence, we define the IIL objective to be the maximization of the agent's task-specific performance simultaneous with preventing supervisor interventions. Furthermore, the supervisor corrections are assumed to bring the agent’s state to $s \in \mathcal{D}_{good}$ as soon as feasible. Therefore, we additionally add an objective to imitate the supervisor corrections where $s \not\in \mathcal{D}_{good}$, as this may further support the satisfaction of Equation (\ref{eq:objective}).
\subsection{System Design Objective}
Finding an agent satisfying Equation (\ref{eq:objective}) requires a training algorithm and a policy model. For IIL problem settings in the real world, it is important that both of these components facilitate users in training agents. Because training robots in real environments can be labor intensive and/or expensive, we focus on maximizing the sample efficiency of the framework by developing an algorithm that can be trained offline. Furthermore, so that different policy models are not needed for different tasks, we develop a multi–task model that can reduce or eliminate task-specific feature engineering.
\section{Approach} \label{approach}
\subsection{Intervention-based Imitation Learning Algorithm}
Given $(S,A,P,R^{task},\pi_s)$, we aim to define a corresponding Markov decision process (MDP) $(S,A,P,R)$ that can be solved using RL techniques. That is to say, we reduce IIL to RL by designing a reward function $R$ that, when optimized by a RL agent, will ultimately satisfy Equation (\ref{eq:objective}).
First, we tackle the aforementioned problem of possible value overestimation bias in IIL by defining a surrogate IIL objective function that is the expected cumulative discounted future reward up to the point of supervisor intervention or task termination as follows.
\begin{equation} \label{eq:surrogate_objective}
\begin{gathered}
Q(s_t,a_t) = \mathop{\mathbb{E}}_{s_{t+1} \sim P(s_t, \pi_\theta(s_t))}[\sum_{k=0}^{K-t}{\gamma^{k}R(s_{t+k},a_{t+k})].}
\end{gathered}
\end{equation}
We define $K = \text{min}(T, \text{min}(\{t^{int} \in t..T \mid f^{demo}_{t^{int}+1} = 1\}))$. Besides preventing value overestimation bias that may incentivize the agent to purposely ``cheat”, as in EGPO, this formulation also allows the value estimator to be trained on both agent and supervisor generated data, as the only possible value estimation bias would be underestimation of the values of supervisor actions.
To find $\pi_\theta$, we will utilize the actor-critic RL formulation in which a critic with parameters $\phi$ estimates the value in Equation (\ref{eq:surrogate_objective}) utilizing the Bellman equation
\begin{equation}
Q_{\phi}(s_t,a_t) = R(s_t,a_t) + \gamma\big(1-\Omega^{mix}_{t}\big)Q_{\phi}\big(s_{t+1}, \pi_{\theta}(s_{t+1})\big),
\end{equation}
where
\begin{equation}
\begin{gathered}
\Omega^{mix}_t = \text{max}(\Omega^{int}_t, \Omega^{task}_t), \\
\Omega^{int}_t = \text{max}(f^{demo}_{t+1}-f^{demo}_t, 0).
\end{gathered}
\end{equation}
$\Omega^{mix}_t$, $\Omega^{int}_t$, and $\Omega^{task}_t \in \{0,1\}$ are all binary flags raised to effectively terminate the episode by restricting the value at $t$ to only $R(s_t,a_t)$.
Next, in order to encourage the agent to minimize supervisor interventions, we design reward function $R$ as
\begin{equation} \label{eq:reward_func}
R(s_t,a_t) = (1-\Omega^{int}_t)R^{task}(s_t,a_t) + \Omega^{int}_tr^{int},
\end{equation}
where $r^{int}$ is a constant satisfying
\begin{equation} \label{eq:reward_constraint}
r^{int} < \mathop{\text{min}}_{s\in S,a \in A}(R^{task}(s,a))/(1-\gamma).
\end{equation}
$r^{int}$ is the reward given upon supervisor intervention, and $R^{task}$ is any arbitrary reward function for the given task. For example, $R^{task}$ could be the magnitude of the velocity given by $a_t$, as it is in L2D. Note that $r^{int}$ must be lower than the minimum value attainable from $R^{task}$; which we assume to be the value of an action leading to an infinite sequence of $\text{min}(R^{task})$ reward. This means that the proposed MDP will lead to an agent that minimizes supervisor interventions, as the value of any action leading to an intervention now becomes strictly lower than an action that does not.
Furthermore, we claim that optimizing the proposed MDP is strictly equivalent to optimizing Equation (\ref{eq:objective}) for any sub-trajectory that does not lead to supervisor intervention. This means that as long as intervention is avoided, our proposed MDP is a standard MDP, making our approach compatible with maximization of performance against any $R^{task}$. In order to solve this MDP, we utilize TD3 \cite{td3}, a RL algorithm for deterministic policies in continuous action spaces.
However, as mentioned earlier, solely utilizing RL has several disadvantages in real environments, as it requires random exploration of the environment. We therefore introduce BC to augment the exploratory learning with imitation of supervisor corrections. We modify the TD3 objective function as follows.
\begin{multline}
J(\theta) = \mathop{\sum}_{(s,a,f^{demo}) \sim \mathcal{D}_{mem}}\Big[\alpha \underbrace{Q_{\phi}\big(s,\pi_{\theta}(s)\big)}_\text{TD3 objective} -\\
f^{demo}\underbrace{||\pi_{\theta}(s) - a||^2}_{\text{BC objective}}\Big],
\end{multline}
where $\mathcal{D}_{mem}$ is a set of state-action-controller tuples collected from training rollouts and $\alpha$ is a hyperparameter that can be tuned to balance the influence of the RL and BC objectives functions.
\begin{figure}
\centerline{\includegraphics[width=2.5in]{figures/overview.png}}
\caption{ReIL principles.}
\label{fig:ReIL-Overview}
\end{figure}
Previous work on offline RL that we abbreviate TD3+BC \cite{td3+bc} utilizes a similar objective function combining TD3 and BC allowing the off-policy RL algorithm to be trained offline. Offline RL is convenient in that it enables training of agents without the online feedback required for other RL algorithms. This is especially advantageous when training on real environments that make online training labor intensive and/or expensive. In TD3+BC, the BC term is applied at every timestep and helps regularize TD3, pushing the agent towards actions taken in the dataset without incentivizing unexplored actions whose values may be overestimated. However, naively utilizing the TD3+BC objective function for the task of IIL hinders the early trainability of the agent, as the agent initially produces poor actions that should not be imitated with BC. Therefore, we further modify the objective function by adding a hyperparameter $\beta < 1$ to allow BC for agent-generated actions with less weight than supervisor-generated ones as follows.
\begin{multline} \label{eq:obj-final}
J(\theta) = \mathop{\sum}_{s,a,f^{demo} \sim \mathcal{D}_{mem}} \Big[\alpha Q_{\phi}\big(s,\pi_{\theta}(s)\big) - \\
\big(f^{demo} +\beta(1-f^{demo})\big)||\pi_{\theta}(s) - a||^2\Big].
\end{multline}
Fig. \ref{fig:ReIL-Overview} illustrates the intuition behind Equation (\ref{eq:obj-final}).
\subsection{Multi-Task Imitation Learning Model}
The techniques developed in the previous section ensure that our IIL agents make effective use of both supervisor and agent generated actions. In this section, in order to ensure the best possible sample efficiency and generality of the framework, we develop a model capable of being conditioned on demonstrations, past experience, and current observations. This provides several theoretical advantages:
\begin{itemize}
\item The model can be utilized for memory-dependent tasks, such as in obstacle avoidance, in which it is critical to remember the location of the obstacle currently being avoided, reducing task-specific feature engineering.
\item The model has the capacity to take appropriate actions learned from past supervisor corrections.
\item The same model can be trained on multiple tasks by conditioning with different user demonstrations, raising the possibility of generalizing and capturing similarities across different tasks.
\end{itemize}
In order to develop such a model, we adapt an existing meta-learning model to the task of imitation learning. Meta-learning is a field that focuses on creating agents that rapidly learn from new information. Effective meta-learning models are therefore capable of rapidly adapting to past experience to infer appropriate actions. SNAIL \cite{snail} is a meta-learning model that combines the advantages of both convolutional neural networks \cite{wavenet} and attention mechanisms \cite{transformer} by stacking these types of layers on top of one another. Moreover, SNAIL employs dense connections \cite{denseblock} across these layers, allowing the gradient to efficiently propagate throughout the entire stack of layers. These architectural choices make SNAIL suitable for temporal data such as the past experience of an agent. The SNAIL authors created an agent capable of efficiently navigating through complex mazes on second attempts by directly referencing the past experience of states and actions executed in the first attempt. We note that demonstrations in IL and past experience in RL are qualitatively similar, making it sensible to adapt SNAIL to the problem of imitation.
\begin{figure}
\centerline{\includegraphics[width=3.5in]{figures/MimeticSNAIL.png}}
\caption{Illustration of the MimeticSNAIL model. The output is conditioned on the demonstration, agent actions, and supervisor corrections.}
\label{fig:MimeticSNAIL}
\end{figure}
Fig. \ref{fig:MimeticSNAIL} illustrates our proposed SNAIL IL model, which we call MimeticSNAIL. Two modifications were made to the original model architecture, as follows.
\begin{enumerate}
\item Append the previous demonstration flag $f^{demo}_{t-1}$ to the latent vector fed to SNAIL.
\item Augment the attention mechanism with a linear bias in the form of ALiBi \cite{alibi} as follows.
\end{enumerate}
\begin{equation}
\text{Attention} = \text{softmax}\Big(\frac{\boldsymbol{QK}^T}{\sqrt{l_k}} - m|\boldsymbol{t}^T - \boldsymbol{t}| + \boldsymbol{M}\Big)\boldsymbol{V}.
\end{equation}
Here $\boldsymbol{Q}$, $\boldsymbol{V}$, $\boldsymbol{K}$, $\boldsymbol{M}$ are the query, value, key, and the causal mask matrices. The key matrix is $(T^{demo}+t) \times l_K$, $\boldsymbol{t}$ is a column vector of time frames, e.g. $[1,...,T^{demo},1,...,t]^T$, $m$ is a parameter included in $\phi$ or $\theta$, and $T^{demo}$ is the final timestep of the demonstration. This modification introduces a recency bias to the attention mechanism, and also increases the relative attention placed on demonstration time frames $t^{demo}$ in proximity to the queried time frame $\boldsymbol{t}$.
Additionally, the actor model’s output contains a task-termination flag denoted as $f^{tf}_\theta = \pi^{tf}_{\theta}(s)$, which, when raised, can be used to begin the next task automatically. This allow users to train the model on arbitrarily long tasks by queing a list of shorter sub-tasks. This sequencing can be learned by copying the supervisor's task termination signal $f^{s}$ provided during training and additionally including the following objective function in the overall objective for $\theta$.
\begin{multline}
J^{tf}(\theta) = \mathop{\sum}_{(s,a,f^{demo}) \sim \mathcal{D}_{mem}}\big(1-f^{tf}_s\big)\log\big(1-\pi^{tf}_{\theta}(s)\big) + \\
f^{tf}_s\log\big(\pi^{tf}_{\theta}(s)\big).
\end{multline}
\section{Experiments} \label{experiment}
We conducted experiments in simulation and real environments, aiming to compare the performance of different IIL algorithms with respect to supervisor burden.
\subsection{Experimental Setup}
\begin{table}
\caption{Simulated Cartpole Algorithm Parameters}
\begin{center}
\resizebox{\columnwidth}{!}{
\begin{tabular}{ |c|c|c|c|c|c|c|c|c|c|c|c| }
\hline
Algorithm & Batch & U/S & $\text{LR}_{\theta}$ & Decay & $\text{LR}_{\phi}$ & $\gamma$ & Delay & Noise & U/P & $\alpha$ & $\beta$ \\
\hline
ReIL, IARL & 24 & 50 & $10^{-6}$ & $10^{-4}$ & $10^{-4}$ & 0.99 & 0.005 & 0.2 & 2 & 0.05 & 0.1, 0.0\\
\hline
HG-DAgger & 24 & 50 & $10^{-6}$ & $10^{-4}$ & - & - & - & - & - & - & - \\
\hline
\end{tabular}}
\end{center}
\footnotesize{Batch = Mini-batch size, U/S = Updates per env. step, $\text{LR}_\theta$ = Actor learning rate, Decay = Actor weight decay, $\text{LR}_\phi$ = Critic learning rate, $\gamma$ = Discount factor, Delay = TD3 policy update delay parameter, Noise = TD3 target actor noise, U/P = TD3 actor update period}
\label{table:cartpole_algorithm}
\end{table}
\begin{table}
\caption{Mobile Robot Navigation Algorithm Parameters}
\begin{center}
\resizebox{\columnwidth}{!}{
\begin{tabular}{ |c|c|c|c|c|c|c|c|c|c|c|c| }
\hline
Algorithm & Epoch & $\text{LR}_\theta$ & Decay & $\text{LR}_\phi$ & $\gamma$ & Delay & Noise & U/P & $\alpha$ & $\beta$\\
\hline
ReIL & 10 & $2(10^{-4})$ & $10^{-3}$ & $5(10^{-4})$ & 0.95 & 0.005 & 0.2 & 2 & 0.2 & 0.1\\
\hline
HG-DAgger & 10 & $2(10^{-4})$ & $10^{-3}$ & - & - & - & - & - & - & -\\
\hline
\end{tabular}}
\end{center}
\footnotesize{Epoch = Epochs per episode, $\text{LR}_\theta$ = Actor learning rate, Decay = Actor weight decay, $\text{LR}_\phi$ = Critic learning rate, $\gamma$ = Discount factor, Delay = TD3 policy update delay, Noise = TD3 target actor noise, U/P = TD3 Actor update period}
\label{table:mobile_robot_algorithm}
\end{table}
We set up two environments: the OpenAI CartPole-V1 simulation and a real mobile robot equipped with a front facing monocular camera aimed at different indoor visual navigation tasks.
\subsubsection{Simulated Cart-pole}
The OpenAI CartPole-V1 environment was modified to support a continuous action space $A=[-1,1]$, and we utilized the original constant reward function $R^{task} = r^{int} = 1$, which satisfies Equation (\ref{eq:reward_constraint}). To simulate the supervisor in the simulation, we trained an agent to expert level with the standard TD3 algorithm in a non-IIL environment, and set the space of acceptable state-action pairs to $\mathcal{D}_{good} = \big\{(s, a) \in \mathbb{R}^4 \times A \mid |s_1|<2.0, |s_3| < 12\pi/180\big\}$. In the cartpole simulation, $s$ contains the cartpole's linear position, linear velocity, angle, and angular velocity, respectively. For this simple environment, we utilized a fully connected neural network for both the actor and the critic. We then compared ReIL, IARL,\footnote{Instead of the PPO algorithm \cite{ppo} used in IARL, we used TD3 to isolate the differences between our implementation of IARL and ReIL to only the reward function and objective function.} HG-DAgger, and ReIL with RL (TD3) only, which we denote as ReIL (Only RL). Note that ReIL (Only RL) is essentially the L2D algorithm with the cartpole reward function. The reward function for IARL is $R(s_t,a_t) = 1 - f^{demo}_t$. Additional algorithm-specific details are listed in TABLE \ref{table:cartpole_algorithm}.
The goal of the agent was to balance the cartpole for 3000 consecutive timesteps. As metrics, we measured the success rate and the total number of supervised steps required for the successful runs of each algorithm across multiple runs.
\begin{figure}
\centerline{\includegraphics[width=1.6in]{figures/mobile_robot.png}}
\caption{Indoor mobile robot platform for testing IIL methods.}
\label{fig:mobile_robot}
\end{figure}
\begin{figure}
\centering
\subfloat[\centering Obstacle avoidance task]{{\includegraphics[width=1.5in]{figures/oa.png} }}
\qquad
\subfloat[\centering Target hitting task]{{\includegraphics[width=1.5in]{figures/th.png} }}
\caption{Sample sequences of agent observations.}
\label{fig:observations}
\end{figure}
\subsubsection{Real World Mobile Robot Navigation}
To test and compare our algorithm in the real world, we developed a ROS2-enabled mobile robot equipped with a front facing monocular camera as shown in Fig. \ref{fig:mobile_robot}. The agent was set up as a high-level controller that outputs a vector of desired linear and angular velocities $a = \{ (v, \omega) \in \mathbb{R}^2 \mid |v| \leq 0.1 \; \text{m/s}, |\omega| \leq 0.4\;\text{rad/s}\}$ at 2Hz based on its visual input. The low-level controller converts the desired body velocities to the necessary wheel velocities and controls the wheels using an independent PI controller for each wheel and an outer-loop P controller for the wheel differential, all running at 100Hz. We lowered the image resolution to $40\times30$ RGB pixels to keep computational requirements modest. We formulated a universal reward function usable for any episodic IIL task as follows.
\begin{equation}
\begin{gathered}
R^{task}(s_t, a_t) = 1, t \in [1..T-1], \\
R^{task}(s_T, a_T) = 2/(1-\gamma), r^{int} = 0.
\end{gathered}
\end{equation}
We tested this reward function with tasks including obstacle avoidance and target hitting, with sample observations as shown in Fig. \ref{fig:observations}. We train the agents both online and offline; the agents trained offline utilized all of the data collected during the online training experiments. Each online training experiment was conducted in either one or two runs of 100 episodes.
For these difficult navigation tasks, we utilize two separate MimeticSNAIL models, one for the actor and one for the critic. Both models process the $40\times30$ pixel observations with a 16-channel then a 32-channel convolutional layer, both with $4\times4$ kernels and $\text{stride} = 2$, followed by two fully-connected layers with 100 units, outputting a 100-dimensional latent vector that is then fed into the SNAIL portion of the model. The SNAIL model uses a TCBlock(L, 30), an AttentionBlock(16, 16), and a TCBlock(L, 30) with L = 75.\footnote{Due to space limitations, we refer readers to SNAIL \cite{snail} for details on the TCBlock and the AttentionBlock.} The output of the SNAIL portion of the model is fed to an additional fully-connected layer to finally output either $(a, f^{tf})$ for the actor or $Q_\phi$ for the critic. The agent did not receive any demonstration before RL began, and on every episode, it faced a new obstacle or target configuration.
We mainly compare ReIL, ReIL (Only BC) and algorithms pre-trained with BC, including HG-DAgger and ReIL (Pre-trained). Further algorithm-specific details are listed in TABLE \ref{table:mobile_robot_algorithm}.
Because performance is more difficult to assess in noisy real world environments than in simulation, we measured the following four separate metrics.
\begin{enumerate}
\item \textit{Average episode length}: The time it takes the agent to complete the task, which is a rough estimate of the agent's efficiency at completing the task.
\item \textit{Average absolute angular acceleration}: An estimate of the smoothness of the agent-generated trajectory, which can highlight undesirable oscillatory behavior. Computed as $\frac{1}{T}\sum_{t=1}^T|\omega_{t}-\omega_{t-1}|$.
\item \textit{Number of supervised steps}: An estimate of the supervisor's burden during online training or offline execution.
\item \textit{Action error}: An estimate of the agent's performance in imitating the supervisor. The data are collected by having the supervisor provide DAgger-like off-policy desired actions during times that the agent is controlling the robot. Computed as the normalized RMSE between supervisor and agent actions ${\sqrt{\frac{1}{T}\sum_{t = 1}^{T}||\frac{\pi_\theta(s_t)-\pi_s(s_t)}{2a_{\text{max}}}||^2}}$ where $a_{\text{max}} = (0.1, 0.4)$.
\end{enumerate}
\begin{figure}
\centerline{\includegraphics[width=3.5in]{figures/cartpole_results.png}}
\caption{Simulation results. Total supervised steps required vs. the agent's average performance. A moving average filter of $n = 10$ has been applied.}
\label{fig:cartpole-result}
\end{figure}
\begin{figure}
\centering
\subfloat[\centering][The time required for the agent trained with ReIL (Only BC) increases over time.]{{\includegraphics[width=3.5in]{figures/oa_average_time.png} }}
\qquad
\subfloat[\centering][The HG-DAgger trained agent suffers from increased oscillation as supervisor corrections increase. ]{{\includegraphics[width=3.5in]{figures/oa_average_absolute_angular_acceleration.png}}}
\qquad
\subfloat[\centering][All algorithms lowered the average number of supervised steps per episode over time.]{{\includegraphics[width=3.5in]{figures/oa_supervised_steps.png} }}
\caption{Obstacle avoidance results. A moving average filter of $n = 10$ has been applied to (b) and (c).}
\label{fig:mobile-robot-result}
\end{figure}
We note here that comparisons with other algorithms reflect contrasts with specific details of these algorithms, not a complete implementation of the algorithm.
\begin{table}
\caption{Simulated Cartpole Results}
\centering
\begin{tabular}{ |c|c|c| }
\hline
Algorithm & Supervised Steps & Success Rate\\
\hline
ReIL & \textbf{270.7 (53.21)} & $20/20$\\
\hline
ReIL (Only RL) & 978.667 (393.26) & $3/4$\\
\hline
HG-DAgger & \textbf{251.6 (45.144)} & $20/20$\\
\hline
IARL & 411.27 (267.731) & $16/20$\\
\hline
\end{tabular}
\label{table:cartpole_result}
\end{table}
\begin{table}[]
\caption{Mobile Robot Navigation Results}
\begin{center}
\resizebox{\columnwidth}{!}{
\begin{tabular}{|l|l|l|l|l|l|l|}
\hline
Task & Mode & Algorithm & Error & Supervised & Steps & Angular Acc. \\ \hline
\multirow{6}{*}{OA} & \multirow{4}{*}{Online} & ReIL & 0.29 (0.061) & 3.65 & 40.4 (1.783) & \textbf{0.07 (0.016)} \\ \cline{3-7}
& & ReIL (Only BC) & 0.322 (0.063) & 4.5 & 46.17 (3.92) & 0.081 (0.022) \\ \cline{3-7}
& & ReIL (Pre-trained) & \textbf{0.27 (0.058)} & 3.58 & \textbf{35.28 (0.918)} & \textbf{0.063 (0.02)} \\ \cline{3-7}
& & HG-DAgger & 0.285 (0.062) & 4.58 & 35.64 (0.846) & 0.14 (0.057) \\ \cline{2-7}
& \multirow{2}{*}{Offline} & ReIL & \textbf{0.247 (0.034)} & 0.27 & 35.73 (1.062) & \textbf{0.056 (0.009)} \\ \cline{3-7}
& & HG-DAgger & 0.307 (0.055) & 1.00 & 35.87 (0.46) & 0.158 (0.022) \\ \hline
\multirow{4}{*}{TH} & \multirow{2}{*}{Online} & ReIL & 0.301 (0.079) & 2.72 & \textbf{19.98 (1.493)} & 0.086 (0.024) \\ \cline{3-7}
& & ReIL (Only BC) & 0.317 (0.082) & 3.06 & 22.55 (3.02) & 0.085 (0.022) \\ \cline{2-7}
& \multirow{2}{*}{Offline} & ReIL & 0.288 (0.058) & 0.0 & 17.47 (0.61) & \textbf{0.09 (0.028)} \\ \cline{3-7}
& & HG-DAgger & 0.277 (0.039) & 0.0 & 17.73 (0.64) & 0.128 (0.027) \\ \hline
\end{tabular}}
\label{table:mobile_robot_result}
\end{center}
\footnotesize{OA = Obstacle avoidance, TH = Target hitting, Mode = Online/Offline, Error = Average action error, Supervised = Average supervised steps per episode, Steps = Average steps per episode, Angular Acc. = Average absolute angular acceleration. Results significantly better than others according to a two-tailed t-test are highlighted in \textbf{bold} for each task and mode of training.}
\end{table}
\section{Results} \label{result}
Results for the simulated cartpole environment are shown in TABLE \ref{table:cartpole_result} and Fig. \ref{fig:cartpole-result}, and the results for the real world visual navigation tasks are shown in TABLE \ref{table:mobile_robot_result} and Fig. \ref{fig:mobile-robot-result}.
We note that for a simple simulated environment such as CartPole-V1, HG-DAgger performs very effectively, despite not being trained on agent-generated data. ReIL was also successful in reaching the goal of 3000 consecutive steps in 20/20 runs and used approximately the same amount of supervised steps as did HG-DAgger. IARL was only 80\% successful in reaching the goal and also required more supervised steps compared to ReIL and HG-DAgger for those successful runs. Finally, ReIL (Only RL), which is essentially L2D, was only successful in 3/4 runs and required a considerably larger amount of supervisor corrections.
These simple simulation results might lead us to the simple conclusion that methods using BC are more effective than methods using RL; however, in the more complex visual navigation tasks, we find that the performance of methods solely relying on BC deteriorates as the amount of data increases. For ReIL (Only BC), this phenomenon can be seen in Fig. \ref{fig:mobile-robot-result} (a) --- the episode length grows over time as a result of imitating sub-optimal agent-generated data with BC. We note that IWR may also experience this deterioration, as it similarly utilizes BC on both supervisor and agent actions. As for HG-DAgger, Fig. \ref{fig:mobile-robot-result} (b) indicates that the path generated by the agent is increasingly oscillatory as the number of supervisor corrections increases. This behavior is expected, as HG-DAgger does not learn to avoid supervisor interventions, but only learns to make corrections from undesirable states. Users utilizing HG-Dagger may therefore have to balance the amount of BC pre-training, in which the supervisor demonstrates the whole task without the agent, and the amount of IIL supervisor corrections in order to minimize these oscillations.
In contrast, the reinforced method ReIL does not experience deterioration in performance over time (as shown in Fig. \ref{fig:mobile-robot-result} (a) and (b)), as the critic takes into account both agent-generated and supervisor-generated data and assesses the relative quality of each data point according to a reward function. Comparing ReIL and HG-DAgger in the offline training setting (see TABLE \ref{table:mobile_robot_result}), in which they shared the same dataset, we see again the superior performance of ReIL and the viability of training it offline. On a final note, the MimeticSNAIL model utilized in the visual navigation tasks did not require any manual fine tuning, making it simple to train agents on multiple tasks.
\section{Conclusion} \label{conclusion}
In this paper, we describe the design and empirical evaluation of ReIL, a framework for intervention-based imitation learning that combines the advantages of imitation learning and reinforcement learning approaches. Our experimental results on real world navigation tasks indicate that the combination of these two components enhances both the performance and the trainability of the agent in comparison with current work that utilizes only one or the other of these components. Furthermore, we also hypothesize an advantage of ReIL over other similar algorithms such as IARL and find empirical support for that hypothesis in ReIL's performance in the simulated cartpole balancing task.
In future work, we hope to create an IIL algorithm that utilizes ReIL's value estimator (critic) to predict and propose supervisor interventions \textit{before} the agent makes a mistake. This could simplify training of the actor, as it will no longer need to explore the environment with RL to learn desirable actions that help avoid interventions.
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-03-30T02:27:39', 'yymm': '2203', 'arxiv_id': '2203.15390', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15390'} | arxiv |
\section{Introduction}
\label{s:introduction}
As cybersecurity skills require higher-order thinking, the best way to develop and ameliorate these abilities is through hands-on training~\cite{mcmurtrey2008,hatzivasilis2020}.
In many learning areas, hands-on training produces a tangible output, e.g., a code that can be checked, analyzed, and evaluated. However, this is not the case of cybersecurity, where learning goals consist of process-oriented tasks related to attack or defense skills, e.g., scanning the network for vulnerable servers or protecting the server by a firewall. Modern cyber ranges, in which practical cybersecurity training is often organized~\cite{Knupfer2020,ukwandu2020,yamin2020,chouliaras2021}, provide only limited data about these tasks in the form of event logs, which makes it hard to answer questions like ``Where did the trainees get in trouble and why?'' without deep insight into their behavior.
Process mining (PM) methods have great potential in answering analytical questions in process-oriented application domains~\cite{PMbook}. Our goal is to utilize them for cybersecurity training analysis.
However, the quality and practical usability of models produced by existing PM algorithms are influenced by many factors, as schematically depicted in Figure~\ref{fig:teaser}. This paper addresses open questions that affect the usability of existing PM techniques for scalable post-training analysis of hands-on cybersecurity exercises, aiming to provide guidelines for their usage. Specifically, we formulated the following research questions.
\textbf{RQ1: Data Abstraction -- how to convert cyber training data to the format suitable for process mining?} The PM workflow is used to find a descriptive model of the process. The idea lies in transferring event logs captured during training sessions into behavioral graphs that would provide better cognitive features for understanding users' behavior than the raw data. As the data collected from hands-on training environments are highly variable, the suitable mapping to the input of PM algorithms is unclear. Our goal is to propose a unified data abstraction that can serve as a generic approach to data preprocessing in different cyber ranges with various data sources.
\textbf{RQ2: Process Discovery -- what are the key obstacles in the process discovery phase and how to overcome them?} Having the data in the format suitable for process discovery algorithms does not guarantee that generated process models are reasonable. Many input data characteristics affect the process discovery and its practical usability for educational process mining. We aim to identify key features of cyber training data and discuss the limits and obstacles of the process discovery phase.
\textbf{RQ3: Exploratory Analysis -- how to deal with the complexity of process graphs during analysis?} Even a relevant process graph obtained by process discovery can become too big and complex for practical learning analytics. Their cognitive features can decrease and become similar to searching for answers in the raw data. Therefore, we research exploratory tactics that can help to tackle the graph complexity problem. We combine specific features of the cybersecurity training data with well-established visual analysis approaches to discuss and demonstrate their usability for interactive learning analytics.
In this paper, we restrict ourselves to the in-class (i.e., supervised) \emph{Capture The Flag} (CTF) cybersecurity games~\cite{werther2011,vigna2014,davis2014,svabensky2018,oslejsek2019}. They follow puzzle-based gamification principles, where puzzles are used as a metaphor for getting students to think about how to frame and solve unstructured problems~\cite{michalewicz2008}. This training type is very popular in the education of beginners, e.g., students of cybersecurity courses.
\section{Related Work}
The idea of using process mining methods for learning analytics is not new. The term educational process mining (EPM) is often used for the application of PM to raw educational data~\cite{romero2016}. Bogarin et al.~\cite{RWBogarin2018education} provide a comprehensive overview of EPM techniques and challenges. We use their classification of event log challenges to clarify features of cybersecurity CTF games and then to address key hurdles, especially the data complexity.
PM has already been applied in numerous specific educational situations. Macak et al.~\cite{macak2021using} used process mining to understand student coding-behavior patterns from the Git log of their projects. Mukala et al.~\cite{rwMukala} use process mining to obtain and analyze students' learning habits from Coursera. It is also used to detect students' learning difficulties by Bannert et al.~\cite{rwBannert}. Multiple other approaches use process mining to gain a better understanding of the educational process from Moodle logs~\cite{rwBogar,romero2016}. Our work shares some ideas and principles with these approaches. Still, it addresses a different application domain --- puzzle-based cybersecurity training, aiming to utilize the specific data properties to deal with process mining challenges.
Some papers also directly address the utilization of process mining for the analysis of hands-on cybersecurity exercises~\cite{weiss2016,weiss2017,andreolini2020,svabensky2021}. These approaches demonstrate that directed graphs carefully constructed from command history can provide useful information about trainees' behavior. The graphs are built on restricted data samples to deal with the complexity --- only commands identified as significant are selected. Our research is more generic, covering a wider variety of training events and enabling to extent process modeling with new data types. Another difference is in the conceptual approach. The previous approaches are based on conformance checking, i.e., monitoring and checking whether the real execution of the process corresponds to the reference process model. Our solution focuses on exploratory learning analytics based on general process discovery methods where no process model of expected behavior is assumed.
Mirkovic et al.~\cite{mirkovic2020} use terminal histories and exercise milestones to enable automated assessment of hands-on cybersecurity training.
In contrast, our work aims to introduce a human into the analytical loop~\cite{oslejsek2018} when process models are reconstructed from logs automatically but then interactively analyzed by domain experts so that they are able to reveal hidden relationships in the data.
\section{RQ1: Data Abstraction} \label{sec:data-abstraction}
In this section, we classify cybersecurity training data and provide their unified mapping into the input of process discovery algorithms to address the research question \emph{RQ1}.
The proposed solution builds on our long-term experience in developing \emph{KYPO Cyber Range}\footnote{KYPO is a Czech acronym for Cybersecurity Polygon.}~\cite{vykopal2017}.
that we are operating since 2013 and which serves as a platform for regular practical training of students of our university. We also closely collaborate with domain experts (cybersecurity educators) from our university who represent target users of post-training analysis tools.
\subsection{Principles of CFT games}
Cybersecurity CTF games consist of well-described cybersecurity goals divided into consecutive tasks (puzzles). Completing each task yields a text string called the \emph{flag} that must be inserted into the system to proceed to the subsequent task. Moreover, trainees can take hints or skip the entire task. Points are awarded or deducted for these actions so that the final scores of individual trainees are mutually comparable and can be used for their basic evaluation.
Trainees perform cybersecurity tasks on remote hosts located inside isolated computer networks. Modern cyber ranges provide a virtualized implementation of such networks, where each trainee has its own copy of the network and is able to access hosts via remote command lines or desktops, likewise in the physical world.
\subsection{Data Types} \label{sec:data-description}
Cyber ranges provide telemetry data in the form of events. They are captured from multiple sources and can provide different levels of granularity~\cite{svabensky2021monitoring}. This paper discusses three distinct data categories, but other data types or levels can be included if available.
\begin{table}[t]
\centering
\caption{Game events and their meaning.}\label{tab:gameEvents}
\begin{tabular}{ |c|l| }
\hline
\textbf{Event} & \textbf{Description: The trainee ...} \\
\hline
TrainingRunStarted & \dots started the training.\\ \hline
TaskCompleted & \dots submitting a correct flag. \\ \hline
WrongFlagSubmitted & \dots submitted a wrong flag. \\ \hline
HintTaken & \dots took a hint. \\ \hline
SolutionDisplayed & \dots viewed the task solution. \\ \hline
\end{tabular}
\end{table}
\textbf{Game events} are produced by the gaming interface of KYPO Cyber Range. Its goal is to provide instructions and guide trainees through the whole training session. User interaction with the interface produces events that capture the gameplay state in the training scenario. Events summarized in Table~\ref{tab:gameEvents} reflect the puzzle-based principles, and they are typical for all games regardless of the content.
\textbf{Bash commands} are produced inside computer networks in which the cybersecurity tasks are solved. Currently, commands executed on the UNIX command line (shell) are available.
\textbf{Metasploit tool} capture the usage of the Metasploit framework -- a popular command-line application used for penetration testing. These events are also captured at hosts of the computer network, likewise the bash history, but represent even a finer-grained type of data.
Each event, regardless of its type or granularity, is extended with additional pieces of information, such as the trainee's identifier, timestamp, and the task (puzzle) in which the event appeared. Moreover, individual event types can have specific mandatory or optional data. For example, the submission of the flag always includes also the flag value, and commands may include their parameters.
\subsection{Unified Data Mapping}
All process mining techniques require the presence of data with specific semantics~\cite{PMbook}: (a) Each event in the log file needs to refer to a single process instance, named \emph{case}, (b) each event needs to refer to a step in the process, named \emph{activity}, and (c) events within the case have to be ordered, either sequentially or by including \emph{timestamp}.
These minimal requirements ensure that each case represented by the sequence of activities can be treated as a \emph{trace} of user actions, enabling the process discovery algorithms to produce graph models capturing all the traces compactly.
Unfortunately, CFT data are highly variable. They can differ in abstraction and semantics, as shown by the three aforementioned data types --- game events, bash commands, and the Metasploit tool.
To deal with variability, we introduce a generic data abstraction layer that makes the mapping smooth and transparent regardless of the specific training content. The proposed classification scheme serves as a mediator between heterogeneous event logs of the cyber range and the data format required by process mining techniques. Table~\ref{tab:abstraction} provides a mapping example, where a snippet of CTF data (four events) is mapped into the abstraction layer.
\begin{table*}[htb]
\centering
\caption{Mapping of raw data onto the unified CTF data abstraction and process mining inputs.}\label{tab:abstraction}
\begin{tabular}{|l|c|c|c|c|c|}
\hline
\textbf{Process mining input:} & & \emph{activity} & & \emph{time/ordering} & \emph{caseID} \\ \hline
\textbf{Data abstraction: } & \textbf{\textsc{event type}} & \textbf{\textsc{event}} & \textbf{\textsc{event parameters}} & \textbf{\textsc{timestamp}} & \textbf{\textsc{trainee}} \\\hline
\textbf{Raw data (snippet): } & game & HintTaken 41-1 & & 2020-05-14 10:16:11 & user 1 \\
& game & HintTaken 41-2 & & 2020-05-14 10:16:34 & user 1 \\
& msf & exploit & -j & 2020-05-14 10:18:23 & user 2 \\
& bash & nmap & -sL 10.1.26.9:5050 & 2020-05-14 10:32:16 & user 1 \\
\hline
\end{tabular}
\end{table*}
\textbf{\textsc{Event type:}} A rough classification defining different types of events. We can distinguish player actions in the game from reactions of the system on the player's actions, or assessment events, for instance~\cite{salen2004}. The exact classification used for process mining depends on available data and analytical goals. Usually, each event type has its specific structure (required or optional data), and they affect how the pieces of information are spread across the other elements of the data abstraction. This paper deals with three aforementioned event types: \texttt{game} events capturing the players' progress, \texttt{bash} commands used on network hosts, and \texttt{msf} for Metasploit commands also used on hosts. Additional types can be easily defined.
\textbf{\textsc{Event:}} Finer classification of \textsc{event types}. Events represent a primary subject of behavioral analysis. They should capture significant steps in the development of training sessions. Therefore, they represent the \emph{activities} of the process models. In CTF games, events are either game events defined in Table~\ref{tab:gameEvents} or any shell or Metasploit commands.
\textbf{\textsc{Event parameters:}} Optional data associated with \textsc{events}. Additional information that extend \textsc{events} and enable the analyst to distinguish finely between them. For example, shell or Metasploit commands can have additional arguments, or the \emph{HintTaken} game event can be equipped with a short hint description.
\textbf{\textsc{Timestamp:}} A timestamp of the \textsc{event}. This is required because of the aggregation of multiple \textsc{event types}.
\textbf{\textsc{Trainee:}} An anonymized unique identifier of the trainee who produced the \textsc{event}. Using the \textsc{trainee} identifier as the \emph{caseID} ensures that the process discovery reconstructs the walkthroughs of individual trainees. The walkthrough perspective presents a primary subject of learning analytics. It enables analysts to compare trainees' behavior mutually as well as to analyze the expected versus anomalous behavior with respect to the training definition.
\begin{figure}
\centering
\includegraphics[scale=0.45]{figures/Fig5smaller.pdf}
\caption{Level of detail based on event type, shown on task~41. The red arrows highlight a flow in the gameplay caused by a bug in platform implementation.}
\label{fig:flow}
\end{figure}
\subsection{Usability}
We conducted practical experiments with PM4Py~\cite{pm4py} library to check the utilization of CTF data mapping for process discovery. The experiments proved that the proposed workflow is able to generate meaningful process models from our raw data at runtime.
Our initial research revealed that heuristic nets especially fit the analytical goals of educators the best. Even though the goal of these experiments was not to study the impact of obtained models on learning analytics, we were able to notice several interesting facts from process graphs. For example, the game task captured in Figure~\ref{fig:flow} can be considered tough for the trainees because they all took two hints, then two gave up (they looped at the solution with the correct flag). One trainee found and submitted the correct flag on the second try.
Using the same model, we also have discovered a flaw in the implementation of KYPO Cyber Range. If trainees submitted the correct flag after displaying a task solution, they were redirected to the solution page instead of being moved to the next puzzle.
\section{RQ2: Process Discovery} \label{s:rq2}
The proposed data abstraction enables us to use cyber-training data transparently in process mining algorithms. However, the practical usability of process discovery for learning analytics is affected by many factors.
The most significant challenges that appear when using event logs for educational process mining are addressed in the previous research~\cite{RWBogarin2018education,romero2016}. Using their classification, we analyzed raw data of multiple training sessions to identify the most significant features that affect the utilization of cyber training logs in post-training process discovery. Fifteen training sessions of six different CTF games were analyzed for statistical properties like training duration or the number of log events of different types.
In what follows, we summarize our observations and lessons learned. Each data characteristic is introduced by the problem statement followed by our findings.
\subsection{Data Size}
The number of cases or events in event logs may become so high that they exceed the time or memory requirements of process discovery algorithms. Moreover, as we aim at providing interactive data exploration, the speed of PM generation should be close to real-time.
The real amount of collected data depends on the number of participants, the difficulty of the training content (i.e., the amount of potentially recorded activities), and training duration. CTF games are intended primarily for beginners and then relatively small -- consisting of 4-6 cybersecurity tasks (puzzles) solvable in roughly 120 minutes (observed minimum was 65, maximum 210, average 119). Moreover, in-class training sessions considered in this paper restrict the data even more. It is because also the number of trainees is limited. In our datasets, the number of trainees varied between 4 and 20, 10 on average.
The number of logged events (and then potential nodes of the process graphs) in our datasets varied between 370--3000 per the whole training session (average 1100, median 814) and between 53--150 per participant (average 108, median 111).
The data amount does not pose any problems to current process discovery algorithms that can treat such an amount of data very quickly~\cite{Hernandez2015}.
On the other hand, our experiments revealed that the
problem could be with the comprehensibility of produced models, even for limited in-class CTF data. Obtained graphs consisting of tens or hundreds of nodes are usually too complex to be cognitively treated by analysts. Employment of data filtering and interactive exploration is, therefore, necessary.
\subsection{Distribution of Data Sources}
Data for educational process mining may be distributed over a variety of sources, e.g., theory and practice classroom or online learning environments. These sources provide event logs with different structures and meanings, which makes their unification and aggregation for process discovery challenging.
We focus on only the data collected from cyber ranges. Considering other supporting sources of information is out of the scope of this paper. However, the problem with data distribution occurs as well because modern cyber ranges produce data from at least two data sources: (a) the gaming environment responsible for the training tasks and learning milestones and (b) sandboxes (computer networks) where the tasks are performed. Nevertheless, the data abstraction discussed in Section~\ref{sec:data-abstraction} solves this problem by unifying the way the data from multiple data sources is handled and used transparently for process discovery.
\subsection{Granularity}
Events in event logs may have a different level of detail. The data presented in Section~\ref{sec:data-abstraction} demonstrates that this problem also occurs in the cyber training logs.
Thanks to the unified data abstraction, the granularity poses no technical problem for the process discovery of cyber training logs because the data can be mapped transparently. Moreover, this unified approach brings significant advantages when data with different granularity are put together. Multiple levels of granularity can define multiple levels of abstraction that can drive data exploration strategies, as discussed in Section~\ref{s:rq3}.
\subsection{Noise in the Data}
Noise is defined as exceptional behavior which is not representative of the typical behavior of the process.
We observed that many students leave the training unfinished due to the lack of time or the loss of motivation. Normally, this kind of noise could pose troubles for educational PM analysis. However, the puzzle-based structure of CTF games provides clear milestones --- correct flags that explicitly delimit borders of training phases. Therefore, it is easy to spot this situation in process graphs and further investigate the reason. In general, the puzzle-based structure can be considered a template of expected behavior, and any difference revealed by PM models can indicate flows in the game design or the training organization worth further investigation.
\subsection{Incompleteness}
Possible data incompleteness is tightly connected to the measurement infrastructure and techniques. Although the individual cyber ranges can differ in these aspects, they are often complex, distributed with asynchronous computation, based on underlying virtualization, and then unreliable. Our long-term experience with organizing cyber training sessions of many types reveals that many things can go wrong due to failures in low-level virtualization services, network connectivity, or improper usage. These failures then cause missing data.
The experiments have shown that keeping this incomplete data in the dataset can produce biased process models. Unfortunately, it is usually very difficult to notice from process graphs that there is something wrong with the raw event logs. Data cleansing and completeness checking have to be usually done in the preprocessing phase of the analytical workflow.
\subsection{Timestamps}\label{s:timestamps}
Events need to be ordered per case to be used for process discovery. Our experiments revealed three significant issues in the collected cyber training data.
Distributed environments like cyber ranges can produce timestamps that are not sufficiently synchronized. Only a small shift in times can re-order events and then produce significantly different process models. Therefore, precise synchronization at the level of the underlying infrastructure is required.
Trainees can start the exercise at different times, even if they sit in the same classroom. This aspect becomes even more significant if the training is not organized as a fixed-time group session, but the training content is available online at any time. Fortunately, the puzzle-based structure of CTF games enables us to identify the exact start of the gameplay of individual trainees and then compute relative
times instead of using absolute times, obtaining meaningful
process models.
An even worse situation can appear if the trainees can ``pause the training''. It does not happen on session-based training courses with a tight schedule. However, loosely conceived training programs would enable participants to stop playing for a while and continue with tasks later, even the next day.
Therefore, datasets from the loosely organized training events require much more attention and expertise to be paid by the analyst, who has to take care of time corrections and interpretation of obtained models.
\section{RQ3: Exploratory Analysis} \label{s:rq3}
Despite the limited size of event logs produced by in-class CTF games, the experiments turned out that obtained process graphs can be too complex and incomprehensible for effective analysis. As the complexity of process graphs can pose a critical aspect for practical usability, we discuss possible strategies for tackling this problem in this section.
\subsection{Filtering Driven by Data Abstraction}
The granularity of training logs discussed in Section~\ref{s:rq2} can be used to control the level of detail and then the size of obtained process graphs. This kind of semantic classification can be used for efficient data filtering and implementing the well-known Shneiderman's visual information-seeking principle: Overview first, zoom and filter, then details-on-demand~\cite{shneiderman1996}.
The granularity is encoded in the \emph{Event types} data abstraction parameter that defines different semantic views of the data. CTF \emph{game events} delimit boundaries of individual puzzles in which other events appear. On the other hand, \emph{bash commands} represent a detailed view of solving tasks within a puzzle. \emph{Metasploit commands} also provide a similar view but at an even more fine-grained level of detail -- the usage of a specific hacking tool.
Based on this observation, filtering of the process model to only a specific \textsc{event type} could provide the desired level of detail and then reduce information complexity. Figure~\ref{fig:teaser} depicts the model limited to the Metasploit only, while in Figure~\ref{fig:flow}, only game events are selected, entirely omitting bash and Metasploit commands.
Another graph complexity reduction technique utilizes the distribution of the raw data between \emph{event} and \emph{event parameter}. Consider the situation when a trainee takes a hint 41-1 and then a hint 41-2. If these events are mapped into the data abstraction like in Table~\ref{tab:abstraction}, then the process discovery algorithm distinguishes between hints 41-1 and 41-2, creates separate nodes for them and produces a model like that in Figure~\ref{fig:flow}. On the contrary, if we change the mapping so that \textsc{event} = ``\emph{HintTaken}'' and hint numbers 41-1 and 41-2 are provided only as \textsc{event parameters}, then a simplified model is produced with only a single joint ``41-HintTaken'' node covering all hints taken in the task.
This filtering principle is even more important for Bash and Metasploit commands than game events because trainees have big freedom of what to type on the command line. Mapping only command names without parameters to \textsc{events} seems to be a reasonable strategy for initial analysis. On the other hand, an \texttt{ssh} command, for instance, says nothing about the remote connection that has been made. In this case, the analyst should rather map the connection argument to the \textsc{event} and then produce separate nodes like \texttt{``ssh [email protected]''} and \texttt{``ssh [email protected]''} in the process graph. Only then, the analyst is able to explicitly see different attempts (traces) and evaluate their correctness.
Therefore, the mapping has to be used carefully and iteratively during the analytical process to balance information hiding with graph complexity.
\subsection{Puzzle-based Fragmentation and Drill Down}
While the unified data abstraction can serve as a fine-grained filtering mechanism of the entire process model across multiple puzzles, the puzzle-based structure of the training content provides a vertical fragmentation of the data usable for drill-down exploration. Process graphs can be logically split into loosely coupled coherent parts that correspond to individual puzzles, as shown in Figure~\ref{fig:fragmentation}, where the puzzles of tasks 43, 44, and an info puzzle are visually recognizable.
\begin{figure}
\centering
\includegraphics[scale=0.22]{figures/fragmentation.png}
\caption{Approximate visualization of tasks difficulty (up) and corresponding process graph (bottom). Only \emph{game events} are included in the process graph. Only tasks 43, 44, and the info puzzle are shown in this example to save space.}
\label{fig:fragmentation}
\end{figure}
Based on this observation, we can tackle the complexity of multi-puzzle graphs by allocating puzzles' boundaries and using obtained graph fragments for coarse-grained filtering and data aggregation. Statistical data of each fragment (puzzle) can be distilled into an overview of the whole training session, while smaller detail process graphs of individual puzzles can be used for detail-on-demand exploration.
Figure~\ref{fig:fragmentation} illustrates this multi-layer approach. A high-level overview of the training session consists of a series of circles whose size and color can encode interesting metrics. For example, spheres' size can be calculated from the number of activities -- nodes of the puzzle's process graph. In this case, the size of task 44 would indicate that it is the most complicated part of the training with a lot of recorded activities (note that Bash and Metasploit commands are omitted from the graph view in Figure~\ref{fig:fragmentation}, but they can be calculated in the complexity metric and reflected in the sphere's size). Then the analyst can interactively drill down into selected puzzles to analyze the reason that could be either the task complexity (it requires many commands to be used) or difficulty (trainees struggled with the task completion and then generated many events).
The number of activities discussed in the previous example is not the only possible metric. Alternate metrics can provide a different perspective on the training results. For example, the number of displayed solutions can indicate how many trainees gave up the puzzle due to the task's difficulty, demotivation, or lack of time.
\section{Discussion and Future Work}
This section summarizes our results, putting emphasis on simplifications that we put on the training data.
\subsection{Limitations}
Results of this study are limited by two key constraints put on hands-on training: puzzle-based gamification and in-class education.
Considering only well-structured puzzle-based CTF games enables us to better classify data and fragment complex process models for drill-down exploration. We omit other training concepts, e.g., complex Cyber Defense Exercises~\cite{patriciu2009} that are intended for experienced professionals. They use wide network topologies, provide freedom in the exercise scenarios to simulate reality, and participants collaborate in teams, which may produce higher amounts of less-structured data and then violate prerequisites of our observations.
In-class training is limited to time and number of participants, which helps us keep data size within reasonable limits. However, cybersecurity training programs can also have the form of online courses accessible at any time by an unlimited number of participants. These courses can produce a significantly larger amount of data and pose some troubles with time dependencies that are crucial for correct process discovery, as discussed in Section~\ref{s:timestamps}. Therefore, extending our approach beyond in-class teaching requires further research.
We are also aware that data sets used in this paper were collected from CTF games organized by a single team in a single cyber range, which could affect our observations and limit generalization. On the other hand, to the best of our knowledge, other modern cyber ranges supporting CTF training style, e.g., Cyris, CyTrONE, or Ares~\cite{pham2016,beuran2018, Ares}, share the same concepts and principles that are discussed in this paper. Therefore, the training content and collected data may differ in detail, but the key aspects like size or types of events are very similar.
\subsection{Implications for Teaching Practice}
It is tough to identify flows in training design or analyze trainees' behavior without transforming events into models with better cognitive features. The proposed unified data abstraction can be directly used to map the data from cyber ranges into the input of exiting process mining tools and algorithms.
On the other hand, the practical usability of these generic tools can be limited. Their usability depends on the support of discussed data filtering and exploration techniques that are often domain-specific. Therefore, we are currently working on integrating these techniques into the analytical interface of KYPO Cyber Range so that the process mining analysis becomes an integral part of the training life cycle.
\iffalse
\subsection{Alternate Views to Process Graphs}
Using puzzle-based fragmentation together with the filtering driven by data abstraction can provide a powerful combination enabling analysts to maintain the complexity of process graphs interactively. However, the graph representation of process models is not the only one possible. Process models can be considered so-called \emph{multivariate graphs} that appear in many application domains.
Dealing with the complexity of multivariate graphs by complementary visualizations is a broadly researched field within the visual analytics discipline~\cite{kriglstein2016}. According to the classification~\cite{nobre2019}, process graphs of CTF games are of medium or large size, k-partite, they have heterogeneous nodes with few attributes and homogeneous edges. Based on these observations, the best alternate visualization techniques should combine an \emph{attribute-driven faceting} with \emph{quilts} and \emph{integrated} or \emph{juxtaposed} view operations. However, the design of concrete analytical visualizations remains a challenging task requiring further research.
\fi
\section{Conclusion}
This paper explores the practical usability of existing process mining algorithms to analyze cybersecurity training sessions and provides observations that support this direction.
Despite the variability of data collected from cyber ranges, we proposed a unified data abstraction for using the data as the input required by process mining algorithms. We tested the usability with data captured in a cyber range that we operate. The practical experiments proved the usefulness of our approach for answering questions related to learning analytics and evaluating corresponding hypotheses but also revealed limits caused by concrete features of the raw data.
We analyzed data from 15 training sessions to reveal significant features that affect the practical usability of process discovery algorithms. The main problem we faced was the complexity of the obtained graphs. Therefore, we introduced several strategies of data filtering and interactive data exploration that are built on the features of puzzle-based in-class form of exercises.
\begin{acks}
This research was supported by the Security Research Programme of the Czech Republic 2015–2022 (BV III/1–VS) granted by the Ministry of the Interior of the Czech Republic under No. VI20202022158 – Research of New Technologies to Increase the Capabilities of Cybersecurity Experts.
\end{acks}
\bibliographystyle{ACM-Reference-Format}
| {'timestamp': '2022-03-30T02:29:59', 'yymm': '2203', 'arxiv_id': '2203.15425', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15425'} | arxiv |
\section{Methods}
\label{sec:methods}
\figframework
Our aim was to build a flexible and manipulative style space. In particular, we considered the following objectives.
(i) Visual similarity should be considered. For example, visually similar pairs, such as a wolf and a dog, should be placed in similar places in the style space.
(ii) There should be a representative value, such as a discrete label, providing a good starting point when the user wants to fine-tune the result.
\subsection{Framework}
The framework overview is shown in Fig.~\ref{fig:framework}, which shows the sampling strategies for the style code and the training procedures of the entire model.
\noindent\textbf{Style-aware discriminator}\quad Given an image $\textbf{x} \in \mathcal{X}$, discriminator $D$ returns a vector as output. The discrimination head $h_D$ determines whether $\textbf{x}$ is a real or fake image, and the style head outputs the latent code $\textbf{z}_s = h_s(D(\textbf{x}))$. We formulate the traditional discriminator $f_D(\textbf{x})$ and the style encoder $f_s(\textbf{x})$ as $h_D(D(\textbf{x}))$ and $h_s(D(\textbf{x}))$, respectively.
\noindent\textbf{Prototypes}\quad We represent the style space using a set of L2-normalized vectors $\textbf{C} \in \mathbb{R}^{K\times D}$ rather than predefined labels or pseudo-labels, where $K$ and $D$ denote the number of prototypes and style code dimension, respectively. We denote $\textbf{c}_k$ as an element of $\textbf{C}$.
\noindent\textbf{Generator}\quad The generator comprises an encoder and a decoder, similar to typical current I2I translation generators \cite{choi2020stargan}. The encoder $G_{enc}(\textbf{x})$ extracts style-agnostic content code $\textbf{z}_c \in \mathbb{R}^{D\times W \times H}$ from input $\textbf{x}$, and decoder $G_{dec}(\textbf{z}_c,\textbf{z}_s)$ synthesizes a new image reflecting content code and style code. Similar to Karras \etal \cite{Karras2020training}, we use a 2-layer multi-layer perceptron (MLP) to transform the normalized style code $\textbf{z}_s$ into valid features. The generator uses weight modulation \cite{karras2020analyzing} or AdaIN \cite{huang2017arbitrary} for latent injection.
\subsection{Modeling the style space}
Intuitively, an ideal style encoder would output the same code even though the input image was geometrically transformed. This idea is the fundamental concept underlying contrastive learning \cite{oord2018representation,chen2020simple,he2020momentum,li2020prototypical,caron2020unsupervised}, which has been actively studied in recent years. We adopted self-supervised learning in our framework to learn the style space.
\noindent\textbf{Data augmentation}\quad The goal of existing contrastive learning is to classify object instances other than the style in images. Chen \etal \cite{chen2020simple} proposed a specific augmentation pipeline (\eg, random crop, color distortion) which has become the preferred approach. However, distorting the color does not serve our purpose since style is deeply related to color. Hence we use geometric transforms (\eg, scale, rotation) to learn content invariant representation, and cutout \cite{devries2017improved} to learn styles such as gender and facial expressions for human faces. We also use random crop and resize following the work of \cite{chen2020simple}.
\noindent\textbf{SwAV}\quad We used the SwAV framework \cite{caron2020unsupervised}, online clustering based self-supervised learning, because it aligns with our goals in terms of updating prototypes and achieving better performance for small batch sizes. The basic concept is that encoded representations from both views (\ie, augmented images) for the same image predict each other's assignments $\textbf{q}$. The objective for learning style space is expressed as:
\begin{equation}
\mathcal{L}_{swap} = l(\textbf{q}^{(2)}, \textbf{z}_s^{(1)}) + l(\textbf{q}^{(1)}, \textbf{z}_s^{(2)}),
\end{equation}
where $l(\textbf{q}, \textbf{z}_s) = -\sum_{k}^{K} \textbf{q}_k (\exp(\frac{\textbf{z}_s\cdot \textbf{c}_k}{\tau})/\sum_{k'}^K\exp(\frac{\textbf{z}_s\cdot \textbf{c}_{k'}}{\tau}))$, $\tau$ is a temperature parameter, and $\textbf{q}$ is a code computed using the Sinkhorn algorithm \cite{cuturi2013sinkhorn,caron2020unsupervised}. Note that swapped prediction loss can be replaced by other self-supervised learning objectives, such as InfoNCE \cite{oord2018representation}, by sacrificing the advantages of the prototype.
\subsection{Learning to synthesize}
During training, we sample a target style code $\tilde{\textbf{z}_s}$ from the prototype or dataset $\mathcal{X}$. When sampling from the prototype, we use perturbed prototypes or samples that are linearly interpolated between two prototypes (see Appendix~\ref{appx:a3} for more details). Then, we apply a stop-gradient to prevent the style space from being affected by other objectives.
As shown in Fig.~\ref{fig:framework} (c), the generator $G$ synthesizes a fake image $G(\textbf{x}, \tilde{\textbf{z}_s})$. To enforce synthesized image be realistic, we adopted a non-saturating adversarial loss \cite{goodfellow2014gan}:
\begin{equation}
\mathcal{L}_{adv} = \mathbb{E}_{\textbf{x}} \left[ \log(f_D(\textbf{x})) \right] +
\mathbb{E}_{\textbf{x},\tilde{\textbf{z}_s}} \left[ \log(1 - f_D(G(\textbf{x}, \tilde{\textbf{z}_s}))) \right].
\end{equation}
We also employed R1 regularization \cite{mescheder2018r1reg} following previous works \cite{choi2020stargan,baek2021rethinking,lee2021contrastive,park2020swapping,kim2021exploiting}.
We adopted a \textit{style reconstruction loss} to ensure the generator $G$ utilize the style code:
\begin{equation}
\mathcal{L}_{style} = \mathbb{E}_{\textbf{x},\tilde{\textbf{z}_s}}[||\tilde{\textbf{z}_s} - f_{s}(G(\textbf{x}, \tilde{\textbf{z}_s})) ||_2^2],
\end{equation}
Previous multi-domain and multi-modal I2I translation methods \cite{choi2020stargan,huang2018munit,baek2021rethinking} introduced similar objectives, the difference between the current and previous approaches is that we do not update a style encoder using this objective.
\subsection{Disentanglement of style and content}
An ideal image manipulation network should be able to separate an image into two mutually exclusive representations and synthesize them back into the original image without information loss \cite{huang2018munit}. Thus, the framework must satisfy the following:
\begin{equation}
\phi(\textbf{x}, G(f_c(\textbf{x}), f_s(\textbf{x}))) = 0,
\end{equation}
where $\phi(\cdot)$ is a distance measure in pixel space; and $f_c(\textbf{x})$, $f_s(\textbf{x})$ are encoding functions for content and style, respectively.
To achieve this, we employ a \textit{reconstruction loss}:
\begin{equation}
\mathcal{L}_{recon} = \mathbb{E}_{\textbf{x}} \left[ \phi(\textbf{x}, G(\textbf{x}, \texttt{sg}(f_s(\textbf{x})))) \right],
\end{equation}
where \texttt{sg} denotes a stop-gradient operation. This objective encourages $G_{enc}$ to encode mutually exclusive features with the style code since $f_s(\textbf{x})$ is not updated. Although any distance measure in pixel space can be used, we used learned perceptual image patch similarity (LPIPS) \cite{zhang2018unreasonable} since we empirically found this works better than Euclidean or Manhattan distance.
In order to learn content space through the reconstruction loss above, it is necessary to condition that the generator should not ignore input latents code. For example, the generator may ignore the content code and perform reconstruction with only style code. To prevent this, we enforce the generator to preserve input content code using a \textit{content reconstruction loss}:
\begin{equation}
\mathcal{L}_{content} = \mathbb{E}_{\textbf{x},\tilde{\textbf{z}_s}}\left[\frac{1}{WH}\sum_{i,j}^{W,H} ||\textbf{z}_{c,i,j} - \tilde{\textbf{z}}_{c,i,j}||_2^2 \right],
\end{equation}
where $\textbf{z}_c$, $\tilde{\textbf{z}_c}$ are $G_{enc}(\textbf{x})$, $G_{enc}(G(\textbf{z}_c,\tilde{\textbf{z}_s}))$, respectively.
This objective enforces patch-level similarity between inputs and outputs, similar to PatchNCE \cite{park2020contrastive}. However, our proposed objective is simpler since we only compare the last layer features, and our objective does not contrast features between patches.
In practice, we found that there was no need to apply this loss every step, and hence we apply the objective every 16th step. We assume that this is because similar results can be obtained through a \textit{reconstruction loss}.
\noindent\textbf{Overall objectives}\quad Our final objective function for the discriminator is $\mathcal{L}_{StyleD} = \mathcal{L}_{adv} + \lambda_{swap} \mathcal{L}_{swap}$,
and for the generator is $\mathcal{L}_{G} = \mathcal{L}_{adv} + \lambda_{sty} \mathcal{L}_{style} + \lambda_{rec} \mathcal{L}_{recon}$,
where $\lambda_{sty}, \lambda_{rec}$ are hyperparameters for each term, and we use for all $\lambda = 1.0$ except $\lambda_{rec} = 0.3$ for AdaIN-based models. We set $K$ as 32 and 64 for AFHQ and CelebA-HQ, respectively. Please refer to Appendix~\ref{appx:a} for more details.
\subsection{Local image translation}
One advantage of factored representations is having a higher degree of freedom when editing an image. The content of an image can easily be copied or moved by editing in the content space \cite{park2020swapping}. To progress further, we propose a simple method of patch-level image translation. Kim \etal \cite{kim2021exploiting} proposed mixing spatial information in the latent space to enable local editing. Similarly, we mix spatial information in the feature space.
\begin{equation}
\textbf{f}_{o}
= \textbf{m} \otimes \textrm{\texttt{mod}}(\textbf{f}_i, \textbf{z}_s^{(i)})
+ (1 - \textbf{m}) \otimes \textrm{\texttt{mod}}(\textbf{f}_i, \textbf{z}_s^{(j)}),
\end{equation}
where $\textbf{f}$ and $\textbf{m}$ are feature map and mask, and \texttt{mod} is modulated convolution \cite{karras2020analyzing} or AdaIN. For patch-level image translation, we simply replace the entire modulated convolution layer \cite{karras2020analyzing} with above. To ensure content is maintained even when several styles are mixed, we mixed two styles with a random mask when calculating a content preserving loss.
\section{Implementation}
\label{appx:a}
\subsection{Architecture}
\label{appx:a1}
The overall architecture of our method follows StarGAN v2 \cite{choi2020stargan}. We normalized the output content code in each pixel to the unit length following Park \etal \cite{park2020swapping}. When using the StyleGAN2-based generator, we replaced the instance normalization of the content encoder with pixel normalization \cite{karras2018progressive}. We did not use an equalized learning rate \cite{karras2020analyzing}.
The style-aware discriminator consists of $M = 0.25 * \log_2(\textrm{resolution})$ residual blocks followed by an average pooling. The style head and the discrimination head are two-layer MLPs. We used the same discriminator for the StyleGAN2-based and AdaIN-based models. We set dimension of prototypes to 256. We set $K$ to 32 for AFHQ, 64 for CelebA-HQ, and 128 for LSUN churches and FFHQ.
\subsection{Augmentation}
\label{appx:a2}
\noindent\textbf{Geometric transform}\quad We used the \texttt{RandomRation} and \texttt{RandomScaleAdjustment} augmentations. We applied reflection padding to avoid empty areas in the image before applying the geometric transform. We chose the rotation angle to be between -30 and 30 and the scale parameter between 0.8 and 1.2. Each transform was applied with a probability of 0.8.
\noindent\textbf{Cutout}\quad The style of the human face domain is integral to characteristics other than color and texture, including gender, expression, and accessories. We can read such information (\ie, the style) from an image even when part of a human face is occluded. Accordingly, we employed cutout augmentation. In practice, we used the \texttt{RandomErasing} method from the \texttt{torchvision} library with the following probability and scale parameters: \texttt{p=0.8} and \texttt{scale=(0.1, 0.33)}.
\noindent\textbf{Color distortion}\quad We observed that when the variation of the dataset is significant (\eg, FFHQ) or when the batch size is small, it was not possible to manipulate short hair into long hair. In that case, we employed weak color jittering. More specifically, we applied the \texttt{ColorJitter} method with the following parameters with a probability of 0.8: \texttt{brightness=0.2}, \texttt{contrast=0.2}, \texttt{saturation=0.2}, \texttt{hue=0.01}. Note that, we applied this augmentation only with the CelebA-HQ dataset using AdaIN and the FFHQ experiments.
\subsection{Style code sampling}
\label{appx:a3}
We sampled the style code from the dataset $\mathcal{X}$ with a probability $p$. Otherwise, we sampled from the prototypes. When sampling from a dataset, we used a randomly shuffled minibatch $\textbf{x}^{\prime}$ to create a style code $\tilde{\textbf{z}_s} = f_s(\textbf{x}^{\prime})$. In the case of sampling from the prototypes, we used the following pseudocode. In practice, we set $p$ to 0.8 except in the case of for longer training (25 M), where we used 0.5.
\begin{lstlisting}[language=Python]
# C: prototypes (K x D)
# N: batch size
# K: number of prototypes
# D: prototype dimension
@torch.no_grad()
def sample_from_prototypes(C, N, eps=0.01):
K, D = C.shape
samples = C[torch.randint(0, K, (N,))]
if torch.rand(1) < 0.5: # perturbation
eps = eps * torch.randn_like(samples)
samples = samples + eps
else: # interpolation
targets = C[torch.randint(0, K, (N,))]
t = torch.rand((N, 1))
samples = torch.lerp(samples, targets, t)
return F.normalize(samples, p=2, dim=1)
\end{lstlisting}
\subsection{Training details}
\label{appx:a4}
In every iterations, we sampled a minibatch $\textbf{x}$ of $N$ images from the dataset. To calculate the \textit{swapped prediction loss}, we created two different views $\textbf{x}_1 = \mathcal{T}_1(\textbf{x}), \textbf{x}_2 = \mathcal{T}_2(\textbf{x})$, where $\mathcal{T}$ is an augmentation. We reused the $\textbf{x}_1$ as the input of the generator. We obtained style codes by sampling the prototype with probability $p$ or encoding reference images $\textbf{x}^{\prime} = \textrm{\texttt{shuffle}}(\textbf{x}_1)$ with probability ($1-p$). In practice, we usually set $p$ as 0.8, but 0.5 when training is long enough (longer than 5 M). When sampling from the prototype, the first two of Eq. 2 was selected uniformly. The adversarial loss for updating the discriminator $D$ was calculated for $G(\textbf{x}_1, \textbf{s})$, and the adversarial loss for updating the generator $G$ was calculated for $G(\textbf{x}_1, \textbf{x})$ and the reconstructed image.
We applied the lazy R1 regularization following \cite{karras2020analyzing}. To stabilize the SwAV training, we adopted training details from the original paper \cite{caron2020unsupervised}. In more detail, we fixed the prototype for the first 500 iterations and used the queue after the 20,000th iteration if $K < N$. We linearly ramped up learning rate for the first 3000 iterations.
We initialized all of the networks using Kaiming initialization \cite{he2015delving}. Following Choi \etal \cite{choi2020stargan}, we used ADAM \cite{kingma2015adam} with a learning rate of 0.0001, $\beta_1 = 0.0$ and $\beta_2 = 0.99$. We scaled the learning rate of the mapping network by 0.01, similar to previous studies \cite{karras2019style,choi2020stargan}. By default, we used a batch size of 16 for the AdaIN-based model and 32 for the StyleGAN2-based model. We used a larger batch size (64) and longer training (25 M) for the FFHQ and LSUN churches datasets. We observed that the performance improves as the batch size and the number of training images increase.
\section{Additional results}
\label{appx:b}
\subsection{Quantitative results for the unlabeled datasets}
\tabunlabel
\tablerp
We measured the quality of the latent-guided and reference-guided synthesis on the unlabeled datasets in Table~\ref{tab:unlabel}. The proposed method significantly outperforms the Swapping Autoencoder \cite{park2020swapping} on the LSUN churches validation set. For reference, we also report the results of unconditionally generated StyleGAN2 images. Even though the proposed method is inferior to unconditional GANs (\ie, StyleGAN2 \cite{karras2020analyzing}), note that unconditional GANs are unsuitable for image editing \cite{park2020swapping}.
\subsection{Quality of the style interpolation}
\figlerp
To evaluate the quantitative results of the style interpolation, we calculated FID between the training set and images synthesized using interpolated styles ($\textrm{FID}_{lerp}$). We sampled images from two different domains and generated ten style codes by interpolating their corresponding style code. Then, we synthesized ten images using those style codes (we used the first sample as a source image). We created 30,000 fake images for the AFHQ and a total of 20,000 fake images for CelebA-HQ. As shown in Table~\ref{tab:lerp}, the proposed method outperforms the supervised approaches \cite{choi2020stargan,liu2021smoothing} in terms of FID. Fig.~\ref{fig:lerp} shows the qualitative comparison between the proposed model and baselines. The proposed approach was the only model that produced smooth interpolation results while maintaining the content such as backgrounds.
\subsection{Additional qualitative results}
Here, we include qualitative results for various datasets. Fig.~\ref{fig:afhqv2} shows the results of the model trained at 512$\times$512 resolution on the AFHQ v2 dataset. Fig.~\ref{fig:ffhq} and~\ref{fig:church} show the reference-guided image synthesis results on unlabeled datasets (FFHQ and LSUN churches). Fig.~\ref{fig:flower} shows the reference-guided image synthesis results for the Oxford-102 dataset. Finally, we visualize all prototypes learned with the AFHQ and CelebA-HQ datasets in Fig.~\ref{fig:proto}.
\section{Additional analyses}
\label{appx:c}
\subsection{Effect of the style-aware discriminator}
\label{appx:c1}
\figsep
The low k-NN metric of the \texttt{separated} method implies that the style space is not highly correlated with the species. This is further supported by the qualitative results. As shown in Fig.~\ref{fig:sep}, the \texttt{separated} method learns to translate the tone of the image rather than desired style (\ie, the species), which explains the very high mFID\footnote{In the AFHQ dataset, the models that cannot change species result in high mFID, since the FID between different species can be rather large. For example, the FID between a real cat and real dog is 170.4.}.
\subsection{Ablation based on the number of prototypes}
\tababalk
In Table~\ref{tab:abalk}, we evaluate the effect of the number of prototypes ($K$) on the proposed method. We trained the AdaIN-based model with varying $K$ using the AFHQ dataset. We observed that the appropriate number of prototypes was critical to the synthesis quality. However, even when the value of $K$ was large, the mFID value did not deviate from a certain range. We did not conduct experiments to determine the optimal value of $K$ for the other datasets; instead, we set the value of k based on the number of images in the dataset.
\figafhq
\figffhq
\figchurch
\figflower
\figproto
\section{Experiments}
\label{sec:exp}
\figlatent
\subsection{Experimental setup}
We not only employed a StyleGAN2-based generator but also considered models using AdaIN to enable a fair comparison with I2I translation models that use AdaIN.
\noindent\textbf{Datasets}\quad We trained the proposed and various comparator models on AFHQ, AFHQ v2 \cite{choi2020stargan}, CelebA-HQ \cite{karras2018progressive}, FFHQ \cite{karras2019style}, Oxford-102 \cite{Nilsback08}, and LSUN churches \cite{yu2015lsun}. Since high resolution models requires considerable training time, the proposed and comparison models were trained and evaluated at 256$\times$256 resolution. For AFHQ and CelebA-HQ, we used the splits provided by Choi \etal \cite{choi2020stargan}.
\noindent\textbf{Baselines}\quad Our primary goal is to synthesize an image with a reference image or a latent sampled from a learned space (\ie, I2I translation). We compared the proposed approach with recent supervised \cite{choi2020stargan,liu2021smoothing} and unsupervised \cite{baek2021rethinking,lee2021contrastive} methods. In contrast with most I2I translation methods, the proposed approach has further applications such as image editing. To compare real-time image editing capability, we compared our approach with Swapping Autoencoder (SwapAE) \cite{park2020swapping} and StyleMapGAN \cite{kim2021exploiting}.
We used pre-trained networks provided by the authors whenever possible. Otherwise, we trained the models from scratch using the official implementation, except for CLUIT, where we employed our implementation because the authors have not yet published their code. We showed 1.6 and 5 M images to the AdaIN- and StyleGAN2-based models, respectively. For StyleMapGAN, we used pre-trained networks trained for 5 M images.
\subsection{Main results}
We quantitatively and qualitatively evaluated the proposed approach and the baselines on two datasets: AFHQ and CelebA-HQ.
\noindent\textbf{Latent-guided image synthesis}\quad We report Fr\'{e}chet Inception Distance (FID) \cite{heusel2017fid} and Kernel Inception Distance (KID) \cite{binkowski2018demystifying} to evaluate the latent-guided image synthesis quality, calculating FID and KID between 50,000 synthesized images and training samples. Parmer \etal \cite{parmar2021cleanfid} recently demonstrated that values of these metrics depend on the resizing method; therefore, we calculated FID and KID for all methods using Pillow-bicubic \cite{clark2015pillow}.
To synthesize images, we used a style code sampled using the strategy used in the training. To evaluate supervised methods \cite{choi2020stargan,liu2021smoothing}, we created a style code using randomly sampled domain and noise. We performed style mixing with randomly sampled latent with StyleMapGAN \cite{kim2021exploiting}. In Table~\ref{tab:results}, the proposed model showed better results than the existing unsupervised methods and comparable results to the supervised methods. Although the result of the proposed approach is slightly worse than StarGAN v2 in AFHQ, our approach allows users to choose one of several prototypes, whereas StarGAN v2 only allows users to choose from three classes. In Fig.~\ref{fig:latent}, we show the prototype-guided synthesis results of our methods trained on unlabeled datasets. Note that we directly used prototypes obtained during the training without additional processing.
\figref
\tabresult
\noindent\textbf{Reference-guided image synthesis}\quad Although FID/KID protocol can estimate the manipulated image quality, it provides good performance scores even if the generator ignores the given latent (\eg, reconstruction). Therefore, we evaluated reference-guided image synthesis to evaluate whether the generator reflects the latent corresponding to each domain. Following \cite{choi2020stargan}, we synthesize images using a source-reference pair from each task (\eg, cat$\rightarrow$dog, male$\rightarrow$female) and calculate FID and KID with a training set of a target domain. We report average values of all tasks (mFID and mKID).
As shown in the first two rows of Fig.~\ref{fig:reference}, supervised approaches \cite{choi2020stargan,liu2021smoothing} often misrecognized the style of reference images within the same classes. However, the proposed method successfully captures the styles of reference images. Furthermore, while other methods failed to preserve the details of the source image, the proposed method was the only method that preserved details such as pose and background.
\tabuserstudy
\noindent\textbf{User study}\quad To investigate the human preferences, we conducted a survey using the Amazon MTurk platform. We randomly generated 100 source-reference pairs per dataset and asked the respondents to answer three questions: (Q1) Which one best reflects the style of the reference while preserving the content of the source? (Q2) Which one is the most realistic? (Q3) Which one would you use for manipulating an image? Each set was answered by 10 respondents. As shown in Table~\ref{tab:userstudy}, the respondents obviously preferred our method in the AFHQ. In the CelebA-HQ, our model was not preferred over the supervised models (which use attribute labels and a pre-trained face alignment network); nevertheless, our model was still the most preferred among the unsupervised methods.
See Appendix~\ref{appx:b} for additional results including experiments on AFHQ v2 and Oxford-102.
\figcontrol
\subsection{Controllable image translation}
\noindent\textbf{Real image projection}\quad To edit an image in the latent space, we first need to project the image into the latent space. What matters here is how quickly and accurately the image can be reconstructed. We measured the runtime and LPIPS \cite{zhang2018unreasonable} between the input and reconstructed images. As shown in Table~\ref{tab:projection}, our model can embed an image into the latent space faster and more accurately than other real-time image editing methods.
\noindent\textbf{Style interpolation}\quad With the proposed method, it is possible to control only the style of the image as desired. In Fig.~\ref{fig:control} (a), we first projected images into content and style space, then interpolated style code with randomly selected prototypes. The results show that the proposed approach is suitable for controlling the results of synthesized images.
\tabproj
\noindent\textbf{Content transplantation}\quad Although we did not specifically target content transplantation, the proposed method supports this application. We achieved this by copying the content code from another content code. After manipulating the content code, we synthesized the image using a style code of the source image. As shown in Fig.~\ref{fig:control} (b), our model shows qualitatively similar results to the StyleMapGAN, which specifically targeting the local editing. Since our model separated the content and style, it is also possible to transplant only the content (\ie, a big smile) without changing the style (\ie, a beard) (bottom).
\noindent\textbf{Local image translation}\quad Fig.~\ref{fig:control} (c) shows the results of local image translation. The first two rows are the result of using vertically split masks. The red box in the bottom row indicates the mask for reference 1. The proposed method can synthesize the content using multiple styles.
\figsearch
\tabcombine
\subsection{Analysis}
\noindent\textbf{Effect of the style-aware discriminator}\quad We trained the model with a separated discriminator and style encoder to analyze the effect of integrating the discriminator and style encoder. The difference is that we used the hard-assigned prototypes as pseudo-label for the multi-task discriminator. To evaluate the alignment between learned style representation and domain labels, we measured the k-NN accuracy used for self-supervised learning \cite{he2020momentum,caron2021emerging}. In Table~\ref{tab:combine}, \texttt{separated} achieved significantly lower k-NN accuracy, and failed to relfect the style of the target images (high mFID). See Appendix ~\ref{appx:c1} for a further discussion.
\figablation
\noindent\textbf{Effect of data augmentation}\quad We employed random resized crop, rotation, and scale for augmentation, along with random erasing for facial datasets (\eg, CelebA-HQ, FFHQ).
Among them, we analyzed the effect of color distortion and cutout, which are major differences compared with other methods \cite{baek2021rethinking,lee2021contrastive}. As shown in Fig.~\ref{fig:search}, different augmentation choice leads to different style space. This result further leads to incorrect or unwanted synthesis results (Fig.~\ref{fig:ablation}). For example, when the color distortion is used, the style space ignores the color. On the other hand, if the cutout is not applied in the human face domain, learned style space failed to capture the attribute information such as gender.
\noindent\textbf{Speed and memory}\quad Table~\ref{tab:memory} shows the trainable parameter counts and the training time of each method. The proposed approach is more efficient and faster than conventional I2I translation methods because it requires one less module for training and has fewer modules than SwapAE, which uses two discriminators. Nevertheless, the proposed method achieved comparable or better performance, which shows the efficiency of our method.
\tabmemory
\section{Related work}
\label{sec:related}
\noindent\textbf{Multi-domain I2I translation}\quad StarGAN \cite{choi2018stargan} enabled many-to-many translation using a given attribute label, but this and similar approaches have the disadvantage of being deterministic for a given input and domain. Subsequent studies suggested using reference images rather than labels \cite{liu2019few,saito2020coco}, enabling translation based on an image from unseen classes in the same domain. StarGAN v2 \cite{choi2020stargan} introduced a noise-to-latent mapping network to synthesize diverse results for the same domain, but since all of these methods depend on labels defined for classification, representations for image manipulation cannot be learned. Therefore, we developed a new multi-domain I2I approach from two perspectives. The proposed method learns a style-specific representation suitable for image manipulation without relying on labels; and then provides more user-controllability while supporting various applications.
To overcome the problem of label dependency, Bahng \etal \cite{bahng2020exploring} clustered the feature space for pre-trained networks to create pseudo-labels and corresponding latent code. Similarly, TUNIT trained a guiding network using contrastive learning and clustering directly in target data \cite{baek2021rethinking}. These methods obtain pseudo-labels that can be substituted for class labels; however, the proposed approach models a continuous style space rather than discrete pseudo-labels. Thus the proposed model is significantly more efficient than previous approaches. CLUIT \cite{lee2021contrastive} recently proposed using contrastive learning through a discriminator, but used contrastive learning to replace the multi-task discriminator. Therefore, the style encoder exists independently, in contrast with the proposed model. Furthermore, CLUIT requires additional process (\eg, clustering), to obtain a style code without a reference image.
\noindent\textbf{Learning-based image editing}\quad Recently, Karras \etal discovered that GANs naturally learn to disentangle pre-defined latent space \cite{karras2019style,karras2020analyzing}. Several subsequent sutides proposed image editing methods using StyleGANs \cite{abdal2019image2stylegan,abdal2020image2stylegan++,zhu2020domain}. However, these methods suffered from the long time it takes to find a corresponding latent. Recently, StyleMapGAN \cite{kim2021exploiting} and Swapping Autoencoder (SwapAE) \cite{park2020swapping} proposed directly encoding an image into the latent, enabling real-time and various image editing applications. Our study is different in that content and style can be manipulated separately because of disentangled latent space. SwapAE has a separate latent space called texture and structure, similar to the proposed method, but is challenging to operate without a reference image. In addition, its texture-focused representation does not work well for tasks that require dramatic changes, such as the interspecies variation of animal faces (Fig.~\ref{fig:reference}). On the other hand, since the proposed method learns the style space and the prototype, manipulating an image without a reference image is possible. Furthermore, because our method is designed for I2I translation, more challenging manipulations are possible.
\noindent\textbf{Discriminator and self-supervised learning}\quad GANs \cite{goodfellow2014gan} have always suggested that discriminators could be feature extractors, and many previous studies have demonstrated that GANs benefit from representation learning through a discriminator \cite{chen2019self,li2021jigsawgan,liu2020towards,jeon2021fa,jeong2020training}. We also utilize self-supervised learning via the discriminator, but differ from previous approaches in that the primary purpose of the self-supervised learning is to function as an encoder, not just to improve the quality. Hence, our discriminator continues to work as an encoder after training; as opposed to most current GANs, which abandon discriminators after training.
\section{Introduction}
\label{sec:intro}
Image-to-image (I2I) translation aims to manipulate the style of an existing image, where style refers to generic attributes that can be applied to any image in a dataset (\eg, texture or domain). Content generally refers to the remaining information, such as the pose and structure. This task has shown significant progress with generative adversarial network (GAN) \cite{goodfellow2014gan} developments. Recent studies have expanded the functionality to multi-modal and multi-domains using domain-specific discriminators and latent injection \cite{huang2017arbitrary}, enabling the direct manipulation of existing images using domain labels or reference images \cite{choi2018stargan,choi2020stargan,liu2019few,saito2020coco,liu2021smoothing}.
However, despite promising functionality advances, there remains considerable room for development in terms of controllability. For example, users can only control the classes used for training. Although a reference image can be used to control output but this can often lead to erroneous results, particularly for misrecognition within the same class; and another common problem is inability to fine-tune the output. Since the label space does not consider the semantic distance between classes, the learned style space cannot reflect these semantic distances, which leads to unrealistic images when controlling the results by manipulating the style code \cite{liu2021smoothing}.
This study investigates I2I translation controllability, \ie, to be able to edit the result as desired using the style code, without being limited to the previously defined label space. The proposed model learns the style space using prototype-based self-supervised learning \cite{caron2020unsupervised} with carefully chosen augmentations. Although the current domain-specific discriminators are not designed for an external continuous space, this is possible if the discriminator knows the style internally. Therefore, we propose a \textit{Style-aware Discriminator}, combining a style encoder and a discriminator into a single module. Thus, the proposed model is somewhat lighter by reducing one module and achieves better performance because of to the better representation space of the discriminator. We used the style code sampled from prototypes during training to improve the controllability; and feature-level and pixel-level reconstructions to improve the consistency. Thus, the proposed model goes beyond image translation to support various applications, including style interpolation and content transplantation. Finally, we propose feedforward local image translation by exploiting spatial properties of the GAN feature space.
We evaluated the model on several challenging datasets: Animal Faces HQ (AFHQ) \cite{choi2020stargan}, CelebA-HQ \cite{karras2018progressive}, LSUN churches \cite{yu2015lsun}, Oxford-102 \cite{Nilsback08}, and FlickrFaces-HQ (FFHQ) \cite{karras2019style}. Extensive experiments confirm that the proposed method outperforms current state-of-the-art models in terms of both performance and efficiency without semantic annotations. The proposed model can also project an image into the latent space faster than baselines while achieving comparable reconstruction results.
The contributions from this study are summarized as follows: (i) We propose an integrated module for style encoding and adversarial losses for I2I translation, as well as a data augmentation strategy for the style space. The proposed method reduces the parameter count significantly and does not require semantic annotations. (ii) We achieve state-of-the-art results in \textit{truly} unsupervised I2I translation in terms of the Fr\'{e}chet Inception Distance (FID) \cite{heusel2017fid}. The proposed method shows similar or better performance compared with supervised methods. (iii) We extend image translation functionality to various applications, including style interpolation, content transplantation, and local image translation.
\section{Discussion and limitation}
\label{sec:discuss}
In this study, we proposed a \textit{style-aware discriminator}, which learns a style space in a self-supervised manner and guides the generator. Here, we discuss reasons why the proposed approach can be successfully trained. First, representation learning using human-defined labels cannot be a representation for style space. In contrast, the proposed method learns latent space specifically designed for style. Second, in the existing I2I translation, both the generator and the style encoder are updated together by the signal from the discriminator. In this case, the separation between content and style is ambiguous. Conversely, the proposed model can have a separate content space with the style encoder being updated completely separately from the generator, which results in better disentanglement. Finally, a style-aware discriminator can provide a better signal to the generator since it has a better understanding of the style space.
Yet still, the proposed method cannot preserve the face identity of the source image, unlike \cite{choi2020stargan,liu2021smoothing}. One can therefore consider using a pre-trained network for identity or landmark following previous works \cite{choi2020stargan,patashnik2021styleclip}. However, preserving the identity may increase risks of misuse or abuse. Therefore, we did not force the proposed method to preserve the facial identity of a source image. Though, preserving the facial identity without using additional information (\eg, face landmark or id) will be a valuable future work.
| {'timestamp': '2022-03-30T02:27:10', 'yymm': '2203', 'arxiv_id': '2203.15375', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15375'} | arxiv |
\section{Introduction}
Cardinality estimation, or the distinct counting problem, is a fundamental data analysis task.
Typical applications are found in network traffic monitoring \cite{estan2003bitmap},
query optimization \cite{selinger1989access}, and counting unique search engine queries \cite{heule2013hyperloglog}.
A key challenge
is to perform this estimation in small space
while processing each data item quickly.
Typical approaches for solving this problem at scale involve data sketches such
as the \acrfull{fm} sketch \cite{flajolet1985probabilistic},
\acrfull{hll} \cite{flajolet2007hyperloglog}, Bottom-$k$
\cite{bar2002counting, cohen2007summarizing, beyer2009distinct}.
All these provide approximate cardinality estimates but use bounded space.
While research has historically focused on the accuracy, speed, and space usage of these sketches, recent work examines their privacy guarantees. These privacy-preserving properties have grown in importance as companies have built tools that can grant an appropriate level of privacy to different people and scenarios. The tools aid in satisfying users' demand for better data stewardship,
while also ensuring compliance with regulatory requirements.
We show that \emph{all} cardinality estimators in a class of
hash-based, order-invariant sketches with bounded size are $\epsilon$-differentially private (DP) so long as the algorithm is combined with a simple
down-sampling procedure and the true cardinality satisfies a mild lower bound.
This lower bound requirement can be guaranteed
to hold by inserting sufficiently many ``phantom elements'' into the stream when initializing the sketch.
We also show that, even with no modification, algorithms in our
class satisfy $(\epsilon, \delta)$-differential privacy,
where $\delta$ falls exponentially with the stream cardinality.
Our novel analysis has significant benefits.
First, prior works on differentially private cardinality estimation have analyzed only specific sketches \cite{tschorsch2013algorithm, von2019rrtxfm, choi2020differentially, smith2020flajolet}. Moreover,
many of the sketches analyzed (e.g., \cite{tschorsch2013algorithm, smith2020flajolet}), while
reminiscent of sketches used in practice,
in fact
differ from practical sketches in important ways.
For example,
Smith et al.
\cite{smith2020flajolet} analyze
a \emph{variant} of \acrshort{hll} that Section \ref{s:hlls} shows has an update time that can be $k$ times slower than an \acrshort{hll} sketch with $k$ buckets.
While our analysis covers an entire class of sketches at once,
our error analysis improves upon prior work in many
cases when specialized to specific sketches.
For example, our analysis yields tighter privacy bounds for HLL than the one given in \cite{choi2020differentially}, yielding both an $\epsilon$-DP guarantee, rather than
an $(\epsilon, \delta)$-DP guarantee, as well as tighter bounds on the failure probability $\delta$---see Section \ref{s:hlls} for details.
Crucially, the class of sketches
we analyze captures many (in fact, almost all to our knowledge)
of the sketches that are actually used in practice.
This means that
existing systems
can be used in contexts requiring
privacy, either without modification
if streams are guaranteed to satisfy
the mild cardinality lower bound we require,
or with a simple pre-processing
step described if such cardinality lower bounds
may not hold. Thus, existing data infrastructure can be easily modified to provide DP guarantees, and in fact
existing sketches can be easily migrated to DP summaries.
\subsection{Related work}
\label{sec:related-work}
One perspective is that cardinality estimators cannot simultaneously preserve privacy and offer
good utility \cite{desfontaines2019cardinality}.
However, this impossibility result applies only when an adversary
However, this impossibility result applies only when an adversary can create and merge an arbitrary number of sketches, effectively observing an item's value many times.
It does not address the privacy of one sketch itself.
Other works have studied more realistic models where either the hashes are public, but private noise is added to the sketch
\cite{tschorsch2013algorithm, mir2011pan, von2019rrtxfm},
or the hashes are secret \cite{choi2020differentially}
(i.e., not known to the adversary who is trying to ``break'' privacy). This latter setting turns out to permit less noisy cardinality estimates.
Past works study specific sketches or a variant of a sketch.
For example,
Smith et al. \cite{smith2020flajolet}
show that an \acrshort{hll}-type sketch is
$\epsilon$-DP
while \cite{von2019rrtxfm} modifies the \acrshort{fm} sketch using coordinated sampling, which is also based on a private hash.
Variants of both models are analyzed by Choi et al. \cite{choi2020differentially},
and they show (amongst other contributions) a similar
result to \cite{smith2020flajolet}, establishing that an \acrshort{fm}-type sketch is
differentially private.
Like these prior works, we focus on the setting when \emph{the hash functions are kept secret} from the adversary.
A related problem of differentially private estimation of cardinalities under set operations is studied by \cite{pagh2021efficient}, but they assume the inputs to each sketch are already de-duplicated.
There is one standard caveat: following prior works
\cite{smith2020flajolet, choi2020differentially}
our privacy analysis assumes
a perfectly random hash function.
One can
remove this assumption both in theory and practice by
using a cryptographic hash function. This will
yield a sketch that satisfies either a
computational variant of differential privacy called
SIM-CDP, or standard information-theoretic notions of differential privacy
under the assumption that the hash function
fools space-bounded computations \cite[Section 2.3]{smith2020flajolet}.
Other works also consider the privacy-preserving properties of common $L_p$ functions over data streams.
For $p=2$, these include fast dimensionality reduction \cite{blocki2012johnson,upadhyay2014randomness}
and least squares regression \cite{sheffet2017differentially}.
Meanwhile, for $0 < p \le 1$, frequency-moment estimation has also been studied \cite{wang2022differentially}.
Our focus is solely the cardinality estimation problem when $p=0$.
\subsection{Preliminaries}
More formally, we consider the following problem.
\paragraph{Problem Definition}
Let $\ensuremath{\mathcal D} = \{x_1, \ldots, x_n\}$ denote a stream of samples with each identifier $x_i$ coming from a
large universe $U$, e.g., of size $2^{64}$.
The objective is to estimate the cardinality, or number of distinct identifiers, of $\ensuremath{\mathcal D}$ using an algorithm $S$ which is given privacy parameters
$\epsilon, \delta \ge 0$ and a space bound $b$, measured in bits.
\begin{definition}[Differential Privacy \cite{dwork2006calibrating}]
A randomized algorithm $S$ is $(\epsilon, \delta)$-differentially private
($(\epsilon, \delta)$-DP for short or if $\delta=0$, \emph{pure} $\epsilon$-DP) if for any pair of data sets $\ensuremath{\mathcal D}, \ensuremath{\mathcal D}'$
that differ in one record and for all $\ensuremath{S}$ in the range of $S$,
$\Pr (S(\ensuremath{\mathcal D}') \in \ensuremath{S}) \le e^{\epsilon} \Pr (S(\ensuremath{\mathcal D}) \in \ensuremath{S}) + \delta$
with probability over the internal randomness of the algorithm $S$.
\end{definition}
Rather than analyzing any specific sketching algorithm,
we analyze a natural class of randomized distinct counting sketches.
Algorithms in this class operate in the following manner:
each time a new stream item $i$ arrives,
$i$ is hashed using some uniform
random hash function $h$, and then $h(i)$
is used to update the sketch, i.e., the update procedure
depends only on $h(i)$, and is otherwise independent of $i$.
Our analysis applies to any such
algorithm that depends only on the
\emph{set} of observed hash values. Equivalently,
the sketch state is
invariant both to the order in which stream items arrive,
and to item duplication.\footnote{
A sketch is \emph{duplication-invariant} if and only if its state when run on any stream
$\sigma$ is identical to its state when run on the stream $\sigma'$, in which
all elements of the stream $\sigma$ appear exactly once.
}
We call this class of algorithms \emph{hash-based, order-invariant} cardinality estimators.
Note that for any hash-based, order-invariant cardinality estimator,
the distribution of the sketch
depends only on the cardinality of the stream.
All distinct counting sketches of which we are aware that are invariant to permutations of the input data are included in this class.
This includes \acrshort{fm}, LPCA, Bottom-$k$, Adaptive Sampling, and HLL as shown in Section \ref{sec:example-sketches}.
\begin{definition}[Hash-Based, Order-invariant Cardinality Estimators]
Any sketching algorithm that depends only on the \emph{set} of hash values of stream items using a uniform random hash function is a \emph{hash-based order-invariant cardinality estimator}.
We denote this class of algorithms by $\ensuremath{\mathcal C}$.
\end{definition}
We denote a sketching algorithm with internal randomness $r$ by $S_r$ (for hash-based algorithms, $r$ specifies the random hash function used).
The algorithm takes a data set $\ensuremath{\mathcal D}$ and generates a data structure $S_r(\ensuremath{\mathcal D})$ that is used to estimate the cardinality. We refer to this structure as the \emph{state of the sketch}, or simply the \emph{sketch}, and the values it can take by $s \in \Omega$.
Sketches are first initialized and then items are inserted into the sketch with an \texttt{add} operation that may or
may not change the sketch state.
The size of the sketch is a crucial constraint, and we denote the space consumption in bits by $b$.
For example, \acrshort{fm} consists of $k$ bitmaps of length $\ell$.
Thus, its state $s \in \Omega = \{0, 1\}^{k \times \ell}.$
Typically, $\ell = 32$, so that $b = 32 k$.
Further examples are given in Section \ref{sec:example-sketches}.
Our goal is to prove such sketches are differentially private.
\label{s:fmdeets}
\section{Hash-Based Order-Invariant Estimators are Private}
\label{sec:sketches are private}
The distribution of any hash-based, order-invariant cardinality estimator
depends only on the cardinality
of the input stream, so without loss of generality
we assume the input is $\ensuremath{\mathcal D}=\{1, \dots, n\}$.
Denote the set $\ensuremath{\mathcal D} \backslash \{i\}$ by $\ensuremath{\mathcal D}_{-i}$
for $i \in \ensuremath{\mathcal D}$ and
a sketching algorithm with internal randomness $r$ by $S_r(\ensuremath{\mathcal D})$.
By definition, for an $\epsilon$-differential privacy guarantee, we must show that the Bayes factor comparing the hypothesis $i \in \ensuremath{\mathcal D}$ versus $i \notin \ensuremath{\mathcal D}$ is appropriately bounded:
\begin{align}
\label{eqn:DP inequality}
e^{-\epsilon} < \frac{\Pr_r(S_r(\ensuremath{\mathcal D}) = s)}{\Pr_r(S_r(\ensuremath{\mathcal D}_{-i}) = s)} < e^{\epsilon} \quad \forall s \in \Omega, i\in \ensuremath{\mathcal D}.
\end{align}
\textbf{Overview of privacy results.}
The main result in our analysis bounds
the privacy loss of a hash-based, order-invariant sketch in terms of
just two sketch-specific quantities.
Both quantities intuitively capture how sensitive
the sketch is to the removal or insertion of a single
item from the data stream.
The first quantity is a bound $k_{max}$
on the number of items that would change the sketch if \emph{removed} from the stream.
Denote the items whose removal from the data set changes the sketch by
\begin{align} \label{eq:krdef}
\ensuremath{\mathcal K}_r &:= \{i \in \ensuremath{\mathcal D} : S_r(\ensuremath{\mathcal D}_{-i}) \neq S_r(\ensuremath{\mathcal D}) \}.
\end{align}
Denote its cardinality by $K_r := \left| \ensuremath{\mathcal K}_r \right|$
and the upper bound by $k_{max} = \sup_r K_r$.
The second quantity is a bound on a "sampling" probability.
Let $\pi(s)$ be the probability that a newly \emph{inserted} item would change a sketch in state $s$,
\begin{equation}
\label{eq:pi-defn}
\pi(s) \coloneqq \Pr_r(S_r(\ensuremath{\mathcal D}) \neq S_r(\ensuremath{\mathcal D}_{-i})\, |\, S_r(\ensuremath{\mathcal D}_{-i}) = s).
\end{equation}
Although a sketch generally does not store explicit samples,
conceptually, it can be helpful to think of $\pi(s)$ as the probability that an as-yet-unseen item $i$ gets ``sampled'' by a sketch in state $s$.
We upper bound $\pi^* \coloneqq \sup_{s \in \Omega} \pi(s)$ to limit the influence of items added to the stream.
The main sub-result in our analysis
(Theorem \ref{thm:main result})
roughly states that the sketch is $\epsilon$-DP so long as
(a) the sampling probability
$\pi^* < 1-e^{-\epsilon}$ is small enough,
and (b) the stream cardinality $n > \frac{k_{max}}{e^{\epsilon}-1} = \Theta(k_{max}/\epsilon)$ is large enough.
We show Property (a) is a \emph{necessary} condition for any $\epsilon$-DP algorithm if the algorithm
works over data universes of unbounded size.
Unfortunately, Property (a) does \emph{not} directly hold for natural
sketching algorithms.
But we show (Section \ref{s:actualdpalgs}) by applying a simple
down-sampling procedure,
any hash-based, order-invariant
algorithm can be modified to satisfy (a).
Furthermore, Section \ref{sec:example-sketches} shows
common sketches satisfy
Property (a) with high probability, thus providing $(\epsilon, \delta)$-DP guarantees for sufficiently large cardinalities.
Compared to \cite{choi2020differentially}, these guarantees are tighter, more precise, and more general as they establish the failure probability $\delta$ decays exponentially with $n$, provide explicit formulas for $\delta$, and apply to a range of sketches rather than just HLL.
\paragraph{Overview of the analysis.}
The definition of $\epsilon$-DP requires bounding the Bayes factor
in equation \ref{eqn:DP inequality}.
The challenge is that the numerator and denominator may not be easy to compute by themselves. However, it is similar to the form of a conditional probability involving only one insertion.
Our main trick re-expresses this Bayes factor as a sum of conditional probabilities involving a single insertion.
Since the denominator $\Pr_r(S_r(\ensuremath{\mathcal D}_{-i})=s)$ involves a specific item $i$ which may change the sketch,
we instead consider the smallest item $J_r$ whose removal does not change the sketch.
This allows us to re-express the numerator in terms of a conditional probability $\Pr_r(S(\ensuremath{\mathcal D}) = s \land J_r=j) = \Pr_r(J_r = j | S(\ensuremath{\mathcal D}_{-j})=s) \Pr_r( S(\ensuremath{\mathcal D}_{-j})=s)$
involving only a single insertion plus a nuisance term $\Pr_r( S(\ensuremath{\mathcal D}_{-j})=s)$.
The symmetry of items gives that the nuisance term is equal to denominator
$\Pr_r( S(\ensuremath{\mathcal D}_{-j})=s) = \Pr_r( S(\ensuremath{\mathcal D}_{-i})=s)$, thus allowing us to eliminate it.
\begin{lemma}
\label{lem:sketch-state}
Suppose $n > \sup_r K_r$. Then
$\Pr_r(K_r = n) = 0$, and
\begin{equation}
\frac{\Pr_r(S_r(\ensuremath{\mathcal D}) = s)}{\Pr_r(S_r(\ensuremath{\mathcal D}_{-i}) = s)} =
\sum_{j \in \ensuremath{\mathcal D}} \Pr_r(J_r = j \,|\, S_r(\ensuremath{\mathcal D}_{-j}) = s).
\label{eq:sketch-state}
\end{equation}
\end{lemma}
By further conditioning on the total number of items that, when removed, can change the sketch,
we obtain conditional probabilities that are simple to calculate.
A combinatorial argument simplifies the resulting expression and gives us two factors in Lemma \ref{lem:sum-sampling-prob}, one involving the sampling probability for new items $\pi(s)$ given a sketch in state $s$ and the other being an expectation involving $K_r$.
This identifies the two quantities that must be controlled in order for a sketch to be $\epsilon$-DP.
\begin{lemma}
\label{lem:sum-sampling-prob}
Under the same assumptions as Lemma \ref{lem:sketch-state}
\begin{equation}
\sum_{j \in \ensuremath{\mathcal D}} \Pr_r(J_r = j \,|\, S_r(\ensuremath{\mathcal D}_{-j}) = s) =
(1-\pi(s)) {\ensuremath{\mathbb E}}_r \left(1 + \frac{ K_r }{n -K_r+1} \bigg| S_r(\ensuremath{\mathcal D}_{-1}) = s \right).
\label{eq:sum-sampling-prob-main}
\end{equation}
\end{lemma}
To show that all hash-based, order invariant sketching algorithms can be made $\epsilon$-DP, we show that $K_r$ can always be bounded by the maximum size of the sketch in bits. Thus, if a sketch is combined with a downsampling procedure to ensure $\pi(s)$ is sufficiently small, one satisfies both of the properties that are sufficient for an $\epsilon$-DP guarantee.
Having established \eqref{eq:sum-sampling-prob-main}, we can derive a result showing that a hash-based, order-invariant sketch is $\epsilon$-DP
so long as the stream cardinality is large enough and $\sup_{s \in \Omega} \pi(s)$ is not too close to $1$.
\begin{corollary}
Let $\Omega$ denote the set of all possible states of a
hash-based order-invariant distinct counting sketching algorithm.
When run on a stream of cardinality $n > \sup_r K_r$,
the sketch output by the algorithm satisfies $\epsilon$-DP if
\begin{align}
&\pi_0 := 1-e^{-\epsilon} > \sup_{s \in \Omega} \pi(s) \quad \text{and}
\label{eq:downsampling probability} \\
&e^{\epsilon} > 1+{\ensuremath{\mathbb E}}_r \left(\frac{ K_r }{n -K_r+1} \bigg| S_r(\ensuremath{\mathcal D}_{-1}) = s \right)
\quad \text{for all sketch states $s \in \Omega$.}
\label{eq:raw cardinality condition}
\end{align}
Furthermore, if the data stream $\ensuremath{\mathcal D}$ consists of items from a universe $U$ of unbounded size, Condition \ref{eq:downsampling probability} is necessarily satisfied by \emph{any} sketching algorithm satisfying $\epsilon$-DP.
\label{cor:raw main result}
\end{corollary}
The above corollary may be difficult to apply directly since the expectation in Condition \eqref{eq:raw cardinality condition} is often difficult to compute and depends on the unknown cardinality $n$. Our main result provides sufficient criteria to ensure that Condition \eqref{eq:raw cardinality condition}
holds. The criteria is expressed in terms of
a minimum cardinality $n_0$ and sketch-dependent constant $k_{max}$.
This constant $k_{max}$ is a bound on the maximum number of items which change the sketch when removed.
That is, for all input streams $\ensuremath{\mathcal D}$ and all $r$, $k_{max} \geq |\ensuremath{\mathcal K}_r|$.
We derive $k_{max}$ for a number of popular sketch algorithms in Section \ref{sec:example-sketches}.
\begin{theorem}
Consider any hash-based, order-invariant distinct counting sketch.
The sketch output by the algorithm satisfies an $\epsilon$-DP guarantee if
\begin{align}
&\sup_{s \in \Omega} \pi(s) < \pi_0 := 1-e^{-\epsilon}
\quad \text{and there are strictly greater than}
\label{eq:downsampling probability2} \\
&n_0 \coloneqq {k_{max}} /{(1-e^{-\epsilon})}
\quad \text{unique items in the stream.}
\label{eq:artificial items bound}
\end{align}
\label{thm:main result}
\end{theorem}
Later, we explain how to modify existing sketching algorithms
in a black-box way to satisfy these conditions.
If left unmodified, most sketching algorithms used in practice allow for some sketch values $s \in \Omega$
which violate Condition \ref{eq:downsampling probability2}, i.e $\pi(s) > 1-e^{-\epsilon}$.
We call such sketch values ``privacy-violating''. Fortunately,
such values turn out to arise with only tiny probability.
The next theorem states that, so long as this probability is smaller than $\delta$,
the sketch satisfies $(\epsilon, \delta)$-DP without modification.
The proof of Theorem \ref{thm:approxdp} follows immediately from Theorem \ref{thm:main result}.
\begin{theorem}
Let $n_0$ be as in Theorem \ref{thm:main result}. Given a hash-based, order-invariant distinct counting sketch with bounded size,
let $\Omega'$ be the set of sketch states such that $\pi(s) \geq \pi_0$.
If the input stream $\ensuremath{\mathcal D}$ has cardinality $n > n_0,$
then the sketch is $(\epsilon, \delta)$ differentially private where $\delta = \Pr_r(S_r(\ensuremath{\mathcal D}) \in \Omega')$.
\label{thm:approxdp}
\end{theorem}
\subsection{Constructing Sketches Satisfying Approximate Differential Privacy: Algorithm \ref{alg:basic}}
\label{sec:approx-dp-results}
Theorem \ref{thm:approxdp} states that, when run
on a stream with $n \geq n_0$ distinct items,
any hash-based order-invariant algorithm
(see Algorithm \ref{alg:basic})
automatically
satisfies $(\epsilon, \delta)$-differential privacy
where $\delta$ denotes the probability that the final
sketch state $s$ is ``privacy-violating'', i.e., $\pi(s) > \pi_0 = 1 - e^{-\epsilon}$.
In Section \ref{sec:example-sketches}, we provide concrete bounds of $\delta$ for specific algorithms. In all cases considered, $\delta$ falls exponentially with respect to the cardinality $n$. Thus, high privacy is achieved with high probability so long as the stream is large.
We now outline how to derive a bound for a specific sketch.
We can prove the desired bound on $\delta$ by analyzing sketches in a manner similar to the coupon collector problem. Assuming a perfect, random hash function, the hash values of a universe of items defines a probability space.
We can identify $v \le k_{max}$ events or coupons, $C_1, \ldots, C_{v}$, such that $\pi(s)$ is guaranteed to be less than $\pi_0$ after all events have occurred. Thus, if all coupons are collected, the sketch satisfies the requirement to be $\epsilon$-DP.
As the cardinality $n$ grows, the probability that a particular coupons remains missing decreases exponentially. A simple union bound shows that the probability $\delta$ that \emph{any} coupon is missing decreases exponentially with $n$.
For more intuition as to
why unmodified sketches satisfy an $(\epsilon, \delta)$-DP guarantee when the cardinality is large, we note that the inclusion probability $\pi(s)$ is closely tied to the cardinality estimate in most sketching algorithms.
For example, the cardinality estimators used in HLL and KMV are inversely proportional to the sampling
probability $\pi(s)$, i.e., $\hat{N}(s) \propto 1/\pi(s)$, while for LPCA and Adaptive Sampling, the cardinality estimators are monotonically decreasing with respect to $\pi(s)$.
Thus, for most sketching algorithms, when run on a stream
of sufficiently large cardinality, the resulting sketch is privacy-violating only when the cardinality estimate is also inaccurate.
Theorem \ref{thm:privacy violation}
is useful when analyzing the privacy of such algorithms,
as it characterizes the probability $\delta$ of a ``privacy
violation'' in terms of the probability the
returned estimate, $\hat{N}(S_r(\ensuremath{\mathcal D}))$, is lower than some threshold
$\tilde{N}(\pi_0)$.
\begin{theorem}
\label{thm:privacy violation}
Let $S_r$ be a sketching algorithm with estimator $\hat{N}(S_r)$.
If $n \geq n_0$ and the estimate returned on sketch $s$ is a strictly decreasing function of $\pi(s)$,
so that $\hat{N}(s) = \tilde{N}(\pi(s))$ for a function $\tilde{N}$.
Then, $S_r$ is $(\epsilon, \delta)$-DP where $\delta = \Pr_r(\hat{N}(S_r(\ensuremath{\mathcal D})) < \tilde{N}(\pi_0))$.
\label{thm:eps-delta using Nhat}
\end{theorem}
\subsection{Constructing Sketches Satisfying Pure Differential Privacy: Algorithm \ref{alg:dp-large-set} - \ref{alg:dp-any-set}}
Theorem \ref{thm:main result} guarantees an $\epsilon$-DP sketch if \eqref{eq:downsampling probability2}, \eqref{eq:artificial items bound} hold.
Condition \eqref{eq:downsampling probability2} requires that
$\sup_{s \in \Omega}\pi(s) < 1-e^{-\epsilon}$,
i.e., the ``sampling probability'' of the sketching algorithm is sufficiently small regardless
of the sketch's state $s$.
Meanwhile, \eqref{eq:artificial items bound} requires that the input cardinality is sufficiently large.
We show that \emph{any} hash-based, order-invariant distinct counting sketching algorithm
can satisfy these two conditions by adding a simple pre-processing step which does two things.
First, it ``downsamples'' the input stream by hashing each input,
interpreting the hash values as numbers in $[0, 1]$, and simply
ignoring numbers whose hashes are larger than $\pi_0$.
The downsampling hash must be independent to that used by the sketching algorithm itself.
This
ensures that Condition \eqref{eq:downsampling probability2} is satisfied,
as each input item has maximum sampling probability $\pi_0$.
If there is an a priori guarantee that the number of distinct items
$n$ is greater than $n_0 = \frac{k_{max}}{1-e^{-\epsilon}}$,
then \eqref{eq:artificial items bound} is trivially satisfied.
Pseudocode for the resulting $\epsilon$-DP algorithm is given in Algorithm \ref{alg:dp-large-set}.
If there is no such guarantee, then the preprocessing step adds $n_0$ items to the input stream to satisfy
\eqref{eq:artificial items bound}.
To ensure unbiasedness, these $n_0$ items must
(i) be distinct from any items in the ``real'' stream, and
(ii) be downsampled as per the first modification.
An unbiased estimate of the cardinality of the unmodified stream can then be easily recovered from the sketch via a post-processing correction.
Pseudocode for the modified algorithm, which is guaranteed to satisfy $\epsilon$-DP,
is given in Algorithm \ref{alg:dp-any-set}.
\label{s:actualdpalgs}
\begin{figure}
\renewcommand\figurename{Algorithms}
\hspace{-0.5cm}
\begin{subfigure}{.29\textwidth}
\begin{algorithmic}
\Function{Base}{items, $\epsilon$}
\State $S \gets InitSketch()$
\State
\For{$x \in items$}
\State
\State $S.add(x)$
\EndFor
\State \Return $\hat{N}(S)$
\EndFunction
\end{algorithmic}
\caption{$(\epsilon, \delta)$-DP for $n \ge n_0$.}
\label{alg:basic}
\end{subfigure
\begin{subfigure}{.36
\textwidth}
\begin{algorithmic}
\Function{DPSketchLargeSet}{items, $\epsilon$}
\State $S \gets InitSketch()$
\State $\pi_0 \gets 1-e^{-\epsilon}$
\For{$x \in items$}
\If{$hash(x) < \pi_0$}
\State $S.add(x)$
\EndIf
\EndFor
\State \Return $\hat{N}(S) / \pi_0$
\EndFunction
\end{algorithmic}
\caption{$(\epsilon, 0)$-DP for $n \ge n_0$.}
\label{alg:dp-large-set}
\end{subfigure}
\begin{subfigure}{.36\textwidth}
\begin{algorithmic}
\Function{DPSketchAnySet}{items, $\epsilon$}
\State $S, n_0 \gets DPInitSketch(\epsilon)$
\State $\pi_0 \gets 1-e^{-\epsilon}$
\For{$x \in items$}
\If{$hash(x) < \pi_0$}
\State $S.add(x)$
\EndIf
\EndFor
\State \Return $\hat{N}(S) / \pi_0 - n_0$
\EndFunction
\end{algorithmic}
\caption{$(\epsilon, 0)$-DP for $n \ge 1$.}
\label{alg:dp-any-set}
\end{subfigure}%
\caption{Differentially private cardinality estimation algorithms from black box sketches.
The function $InitSketch()$ initializes a black-box sketch.
The uniform random hash function $hash(x)$ is chosen independently of any hash in
the black-box sketch and is interpreted as a real in $[0, 1]$.
The cardinality estimate returned by sketch $S$ is denoted $\hat{N}(S)$.
\texttt{DPInitSketch} is given in Algorithm \ref{alg:DPInitSketch}.}
\label{alg:dp sketches}
\addtocounter{algorithm}{1}
\end{figure}
\begin{corollary} \label{maincor}
The functions \texttt{DPSketchLargeSet} (Algorithm \ref{alg:dp-large-set}) and \texttt{DPSketchAnySet}
(Algorithm \ref{alg:dp-any-set}) yield $\epsilon$-DP distinct counting sketches provided that
$n \ge n_0$ and $n \ge 1$, respectively.
\label{cor:algo-1b-1c-DP}
\end{corollary}
\subsection{Constructing $\epsilon$-DP Sketches from Existing Sketches: Algorithm \ref{alg:make dp}, Appendix \ref{app: algos}}
\label{sec:existing sketches post processing}
As regulations change and new ones are added,
existing data may need to be appropriately anonymized. However, if the data has already been sketched, the underlying data may no longer be available, and even if it is retained, it may be too costly to reprocess it all. Our theory allows these sketches to be directly converted into differentially private sketches when the sketch has a merge procedure.
Using the merge procedure to achieve $\epsilon$-differential privacy yields more useful estimates than the naive approach of simply adding Laplace noise to cardinality estimates in proportion to the global sensitivity.
The algorithm
assumes it is possible to take a sketch $S_r(\ensuremath{\mathcal D}_1)$ of
a stream $\ensuremath{\mathcal D}_1$ and a sketch $S_r(\ensuremath{\mathcal D}_2)$ of a stream $\ensuremath{\mathcal D}_2$,
and ``merge'' them to get a sketch of the concatenation of the two streams
$\ensuremath{\mathcal D}_1 \circ \ensuremath{\mathcal D}_2$.
This is the case for most practical hash-based order-invariant distinct count sketches.
Denote the merge of sketches $S_r(\ensuremath{\mathcal D}_1)$ and $S_r(\ensuremath{\mathcal D}_2)$ by $S_r(\ensuremath{\mathcal D}_1) \cup S_r(\ensuremath{\mathcal D}_2)$.
In this setting, we think of the existing non-private sketch $S_r(\ensuremath{\mathcal D}_1)$ being converted to a sketch
that satisfies $\epsilon$-DP by Algorithm \ref{alg:make dp} (see pseudocode
in Appendix \ref{app: algos}).
Since sketch $S_r(\ensuremath{\mathcal D}_1)$ is already constructed, items cannot be first downsampled in the build
phase the way they are in Algorithms \ref{alg:dp-large-set}-\ref{alg:dp-any-set}.
To achieve $\epsilon$-DP, Algorithm \ref{alg:make dp} constructs a noisily initialized sketch,
$S_r(\ensuremath{\mathcal D}_2)$, which satisfies both the downsampling condition (Condition \eqref{eq:downsampling probability2}) and the minimum
stream cardinality requirement (Condition \eqref{eq:artificial items bound}) and returns the merged sketch
$S_r(\ensuremath{\mathcal D}_1) \cup S_r(\ensuremath{\mathcal D}_2)$.
Hence, the sketch will satisfy both conditions for $\epsilon$-DP, as shown in Corollary \ref{cor:makedp}
This merge based procedure typically adds no additional error to the estimates for large cardinalities. In contrast, the naive approach of adding Laplace noise can add significant noise since the sensitivity can be very large. For example, HLL's estimator is of the form $\hat{N}_{HLL}(s) = \alpha / \pi(s)$ where $\alpha$ is a constant and $s$ is the sketch.
One item can update a bin to the maximum value, so that the updated sketch $s'$ has sampling probability $\pi(s') < \pi(s)(1-1/k)$. The sensitivity of cardinality estimate is thus at least
$\hat{N}_{HLL}(s) / k$. Given that the cardinality estimate, and hence sensitivity, can be arbitrarily large when $n \geq k$, the naive approach is unworkable to achieve $\epsilon$-DP.
\floatname{algorithm}{Algorithm}
\section{The Utility of Private Sketches}
\label{sec:utility analysis}
When processing a data set with $n$ unique items,
denote the
expectation and variance of a sketch and its estimator by ${\ensuremath{\mathbb E}}_n(\hat{N})$ and $\mathsf{Var}_n(\hat{N})$ respectively.
We show that our algorithms all yield unbiased estimates. Furthermore, we show that for Algorithms \ref{alg:basic}-\ref{alg:dp-any-set}, if the base sketch satisfies a \emph{relative error guarantee} (defined below), the DP sketches add no additional error asymptotically.
\textbf{Establishing unbiasedness.}
To analyze the expectation and variance of each algorithm's estimator, $\hat{N}(S(\ensuremath{\mathcal D}))$,
note that each estimator
uses a `base estimate' $\hat{N}_{base}$ from the base sketch $S$ and has the form
$\hat{N}(S(\ensuremath{\mathcal D})) = \frac{\hat{N}_{base}}{p} - V$;
$p$ is the downsampling probability and $V$ is the number of artificial items added.
This allows us to express expectations and variance via the variance of the base estimator.
\begin{theorem}
Consider a base sketching algorithm $S \in \ensuremath{\mathcal C}$ with an unbiased estimator $\hat{N}_{base}$ for the cardinality of items added to the base sketch.
Algorithms \ref{alg:dp sketches} (a)-(c) and \ref{alg:make dp} yield unbiased estimators.
\label{thm:unbiased}
\end{theorem}
\paragraph{Bounding the variance.}
Theorem \ref{thm:unbiased} yields a clean expression for the variance of our private algorithms.
Namely,
$\mathsf{Var} [ \hat{N}(S_r(\ensuremath{\mathcal D})) ] = {\ensuremath{\mathbb E}} [ \mathsf{Var} (\frac{\hat{N}_{base}}{p} | V ) ]$
which is shown in Corollary \ref{cor:var}.
The expression is a consequence of the law of total variance and that the estimators are unbiased.
We say that the base sketch satisfies a \textbf{relative-error guarantee} if with high probability, the estimate returned
by the sketching algorithm when run on a stream of cardinality
$n$ is $(1 \pm 1/\sqrt{c}) n$ for some constant $c>0$.
Let $\hat{N}_{base,n}$ denote the cardinality estimate when
the base algorithm is run on a stream of cardinality $n$, as opposed to $\hat{N}_{base}$ denoting the cardinality estimate produced by the base sketch on the sub-sampled stream used in our private sketches \texttt{DPSketchLargeSet} (Algorithm \ref{alg:dp-large-set}) and \texttt{DPSketchAnySet}
(Algorithm \ref{alg:dp-any-set}).
The relative error guarantee is satisfied when $\mathsf{Var}_n(\hat{N}_{base,n}) < n^2 / c$; this is an immediate consequence of Chebyshev's inequality.
When the number of artificially added items $V$ is constant as in Algorithms \ref{alg:dp-large-set} and \ref{alg:dp-any-set},
Corollary \ref{cor:var} provides a precise expression for the variance of the differentially private sketch.
In Theorem \ref{thm:utility given relative error} below, we
use this expression to establish that the modification of the base algorithm to an $\epsilon$-DP
sketch as per
Algorithms \ref{alg:dp-large-set} and \ref{alg:dp-any-set} satisfy the exact same relative error guarantee asymptotically.
In other words, the additional error due to
any pre-processing (down-sampling and possibly adding artificial items) is insignificant for large cardinalities $n$.
\begin{theorem}
Suppose $\hat{N}_{base,n}$ satisfies a relative error guarantee,
$\mathsf{Var}_n(\hat{N}_{base,n}) < n^2 / c$, for all $n$ and for some constant $c$.
Let $v = 0$ for Algorithm \ref{alg:dp-large-set} and $v = n_0$ for Algorithm \ref{alg:dp-any-set}.
Then Algorithms \ref{alg:dp-large-set} and \ref{alg:dp-any-set} satisfy
\begin{align}
&\mathsf{Var}_n(\hat{N}) \leq \frac{(n+v)^2}{c} + \frac{(n+v)(v + \pi_0^{-1})}{k_{max}} = \frac{(n+v)^2}{c} + O(n),
\label{eq: variance result
\end{align}
so that ${\mathsf{Var}_n(\hat{N})}/{\mathsf{Var}_n(\hat{N}_{base,n})} \to 1 \,\,\mbox{ as } n \to \infty.$
\label{thm:utility given relative error}
\end{theorem}
In Corollary \ref{cor: variance-ratios} we prove an analagous result for Algorithm \ref{alg:make dp},
which merges non-private and noisy sketches to produce a private sketch.
Informally, the result is comparable to \eqref{eq: variance result}, albeit with $v \ge n_0$.
This is because, in Algorithm \ref{alg:make dp}, the number of artificial items added $V$ is a random variable.
We ensure that the algorithm satisfies a utility guarantee by bounding $V$ with high probability.
This is equivalent to showing that the base sketching algorithm
satisfies an $(\epsilon, \delta)$-DP guarantee as
for any $n^* \geq n_0$ and dataset $\ensuremath{\mathcal D}^*$ with $|\ensuremath{\mathcal D}^*| = n^*$, $(\epsilon, \delta_{n^*})$-DP ensures
$\delta_{n^*} > \Pr_r(\pi(\ensuremath{S}_r(\ensuremath{\mathcal D}^*)) > \pi_0) = \Pr_r(V > n^*)$
which follows from the definition of $V$ in Algorithm \ref{alg:DPInitSketchForMerge}.
\section{Examples of Hash-based, Order-Invariant Cardinality Estimators}
\label{sec:example-sketches}
We now provide $(\epsilon, \delta)$-DP results for a select group of samples: \acrshort{fm}, LPCA, Bottom-$k$,
Adaptive Sampling, and HLL.
The $(\epsilon, \delta)$-DP results in this section operate in the Algorithm \ref{alg:basic} setting with no
modification to the base sketching algorithm.
Recall that the quantities of interest are the number of bins used in the sketch $k$, the size of the sketch in bits
$b$ and the number of items whose absence changes the sketch $k_{max}$.
From Section \ref{sec:sketches are private} and Lemma \ref{lem:k bound} we know that $k_{max} \le b$
but for several common sketches
we show a stronger bound of $k_{max} = k$.
The relationship between these parameters for various sketching algorithms is summarized in Table \ref{tab:sketch comparison}.
Table \ref{tab: related-work-bounds}, Appendix \ref{app: sketch examples},
details our improvements over \cite{smith2020flajolet,choi2020differentially} in both privacy and utility.
We remind the reader that, per \eqref{eq:downsampling probability},
$\pi_0 = 1-e^{-\epsilon},$
and \eqref{eq:artificial items bound} $n_0 = \frac{k_{max}}{1-e^{-\epsilon}}.$
Furthermore, recall that once we bound the parameter $k_{max}$ for any given
hash-based order-invariant sketching algorithm,
Corollary \ref{maincor} states that the derived algorithms \ref{alg:dp-large-set}-\ref{alg:dp-any-set}
satisfy $\epsilon$-DP provided that $n \ge n_0$ and $n \ge 1$, respectively.
Accordingly, in the rest of this section,
we bound $k_{max}$ for each example sketch of interest,
which has the consequences for pure $\epsilon$-differential
privacy delineated above.
\begin{table}[]
\caption{Properties of each sketch with $k$ ``buckets''
(see each sketch's respective section for details of what this parameter means for the sketch).
Each sketch provides an $(\epsilon, \delta)$-DP guarantee, where the column $\ln \delta$ provides an upper bound on $\ln \delta$ established in the relevant subsection of Section \ref{s:allthesketches}.
}
\label{tab:sketch comparison}
\centering
\begin{tabular}{llllll}
\toprule
Sketch & $b$: size (bits) & Standard Error & $k_{max}$ & $\ln \delta$ & Reference \\ \midrule
FM85 & $32k$ & $0.649n / \sqrt{k}$ & $32k$ & $-\frac{\pi_0}{2k} n + o(1)$ & \cite{lang2017back} \\
LPCA & $k$ & $n/\sqrt{k}$ \tablefootnote{This approximation holds for $n < k$. A better approximation of the error is $\sqrt{k(\exp(n/k)-n/k-1)}$} & $k$ & $-\frac{\pi_0}{\tilde{N}(\pi_0)} n + O(\log n)$ & \cite{whang1990linear} \\
Bottom-$k$ & $64k$ & $n/\sqrt{k}$ & $k$ & $-\frac{1}{2}\frac{\pi_0}{1-\pi_0} n + o(1)$ & \cite{giroire2009order}\\
Adaptive Sampling & $k$ & $1.2 n / \sqrt{k}$ & $k$ & $-\frac{1}{2}\frac{\pi_0}{1-\pi_0} n + o(1)$ & \cite{flajolet1990adaptive} \\
HLL & $5k$ & $1.04\, n / \sqrt{k}$ & $k$ & $-\frac{\pi_0}{k} n + o(1)$ & \cite{flajolet2007hyperloglog} \\
\bottomrule
\end{tabular}
\end{table}
\label{s:allthesketches}
\paragraph{Flajolet-Martin '85}
The FM85 sketch, often called \emph{Probabilistic Counting with Stochastic Averaging (PCSA)},
consists of $k$ bitmaps $B_i$ of length $\ell$.
Each item is hashed into a bitmap and index $(B_i,G_i)$ and sets the indexed bit in the bitmap to 1.
The chosen bitmap is uniform amongst the $k$ bitmaps and the index $G_i \sim Geometric(1/2)$.
If $\ell$ is the length of each bitmap, then the total number of bits used by the sketch is $b = k \ell$
and $k_{max} = k \ell$ for
all seeds $r$.
A typical value for $\ell$ is 32 bits, as used in Table \ref{tab:sketch comparison}.
Past work \cite{von2019rrtxfm} proposed an $\epsilon$-DP version of \acrshort{fm} using a similar subsampling idea combined with random bit flips.
\begin{theorem}
Let $v = \lceil -\log_2 \pi_0 \rceil$ and $\tilde{\pi}_0 := 2^{-v} \in (\sfrac{\pi_0}{2}, \pi_0]$.
If $n \ge n_0$, then the \acrshort{fm} sketch is $(\epsilon, \delta)$-DP with
$\delta \leq kv \exp\left(- \tilde{\pi}_0 \frac{n}{k} \right)$.
\label{thm:fm85-dp}
\end{theorem}
For any $k$, \acrshort{fm} has $k_{max} \in \{32k, 64k\}$.
This is worse than all other sketches we study which have $k_{max} = k$, so
\acrshort{fm} needs a larger number of minimum items $n_0$ to ensure the sketch is
$(\epsilon, \delta)$-DP.
\paragraph{LPCA}
The Linear Probabilistic Counting Algorithm (LPCA) consists of a length-$k$ bitmap.
Each item is hashed to an index and sets its bit to $1$.
If $B$ is the number of $1$ bits,
the LPCA cardinality estimate is $\hat{N}_{\mathtt{LPCA}} = - k \log (1- B/k) = k \log \pi(\ensuremath{S}_r(\ensuremath{\mathcal D}))$.
Trivially, $k_{max} = k$.
Since all bits are expected to be $1$ after processing roughly $k \log k$ distinct items, the capacity of the sketch is bounded.
To estimate larger cardinalities, one first downsamples the distinct items with some sampling probability $p$.
To ensure the sketch satisfies an $\epsilon$-DP guarantee, one simply ensures $p \geq \pi_0$. In this case,
our analysis shows that LPCA is differentially private with no modifications if the cardinality is sufficiently large. Otherwise,
since the estimator $\hat{N}(s)$ is a function of the sampling probability $\pi(s)$, Theorem \ref{thm:eps-delta using Nhat} provides an $(\epsilon, \delta)$ guarantee in terms of $\hat{N}$.
\begin{theorem}
Consider a LPCA sketch with $k$ bits and downsampling probability $p$. If $p < \pi_0$ and $n > \frac{k}{1-e^{-\epsilon}}$ then LPCA is $\epsilon$-DP.
Otherwise, let $b_0 = \lceil k(1-\pi_0/p) \rceil$, $\tilde{\pi}_0 = b_0/k$, and $\mu_0$ be the expected number of items inserted to fill $b_0$ bits in the sketch.
Then, LPCA is $(\epsilon, \delta)$-DP if $n > \mu_0$ with
\begin{align}
\delta &= \Pr_r(B < b_0)
< \frac{\mu_0}{n} \exp\left(-\frac{\tilde{\pi}_0 }{\mu_0}n \right) \exp(- \tilde{\pi}_0)
\end{align}
where $B$ is the number of filled bits in the sketch.
Furthermore,
$\mu_0 < \tilde{N}(\tilde{\pi}_0)$
where $\tilde{N}(\tilde{\pi}) = -\frac{k}{p} \log(1-\tilde{\pi})$ is the cardinality estimate of the sketch when the sampling probability is $\tilde{\pi}$.
\label{thm:lpc-dp}
\end{theorem}
\textbf{Bottom-$k$ (also known as MinCount or KMV)}
sketches store the $k$ smallest hash values.
Removing an item changes the sketch if and only if
1) the item's hash value is one of these $k$ and 2) it does not collide with another item's hash value.
Thus, $k_{max} = k$.
Typically, the output size of the hash function
is large enough to ensure that the collision probability is negligible, so for practical purposes $k_{max}=k$ exactly.
Since the Bottom-$k$ estimator $\hat{N}(s) = \sfrac{(k-1)}{\pi(s)}$ is a function of the update probability $\pi(s)$,
Theorem \ref{thm:eps-delta using Nhat} gives an $(\epsilon, \delta)$-DP guarantee in terms of the cardinality estimate by coupon collecting;
Theorem \ref{thm:kmv-dp} tightens this bound on $\delta$
for a stronger $(\epsilon, \delta)$-DP guarantee.
\begin{theorem}
Consider Bottom-$k$ with $k$ minimum values.
Given $\epsilon > 0$, let $\pi_0, n_0$ be the corresponding subsampling and minimum cardinality to ensure the modified Bottom-$k$ sketch is $(\epsilon, 0)$-DP.
When run on streams of cardinality $n \geq n_0$, then the unmodified sketch is $(\epsilon, \delta)$-DP,
where $\delta = P(X \leq k) < \exp(-n \alpha_n)$ where $X \sim Binomial(n, \pi_0)$
and $\alpha_n = \frac{1}{2} \frac{(\pi_0 - k/n)^2}{\pi_0(1-\pi_0) + \sfrac{1}{3n^2}} \to \frac{1}{2}\frac{\pi_0}{1 - \pi_0}$ as $n \to \infty$.
\label{thm:kmv-dp}
\end{theorem}
The closely related \textbf{Adaptive Sampling} sketch has the same privacy behavior as a bottom-$k$ sketch.
Rather than storing exactly $k$ hashes, the algorithm maintains a threshold $p$ and stores up to $k$ hash
values beneath $p$.
Once the sketch size exceeds $k$, the threshold is halved and only hashes less than $p/2$ are kept.
Since at most $k$ hashes are stored, and the sketch is modified only if one of these hashes is removed
the maximum number of items that can modify the sketch by removal is $k_{max} = k$.
\begin{corollary}
For any size $k$ and cardinality $n$, if a bottom-$k$ sketch is $(\epsilon, \delta)$-DP,
then a maximum size $k$ adaptive sampling sketch is $(\epsilon, \delta)$-DP with the
same $\epsilon$ and $\delta$.
\label{cor:ads-dp}
\end{corollary}
\paragraph{HyperLogLog (HLL)} \label{s:hllparagraph}
hashes each item to a bin and value $(B_i, G_i)$.
Within each bin, it takes the maximum value so each bin
is a form of Bottom-1 sketch.
If there are $k$ bins, then $k_{max} = k$.
Our results uniformly improve upon existing DP results on the HLL sketch and its variants.
One variation of the HLL sketch achieves $\epsilon$-DP but is far slower than HLL, as it
requires every item to be independently hashed once for each of the $k$ bins, rather than just one time
\cite{smith2020flajolet}.
In other words, \cite{smith2020flajolet} needs $O(k)$ update time compared to $O(1)$ for our algorithms.
Another provides an $(\epsilon, \delta)$ guarantee for streams of cardinality $n \geq n_0'$, for an $n_0'$ that is larger than our $n_0$ by a factor
of roughly (at least) $8$, with $\delta$ falling exponentially with $n$ \cite{choi2020differentially}.
In contrast, for streams with cardinality $n \geq n_0$, we provide a \emph{pure} $\epsilon$-DP guarantee using Algorithms \ref{alg:dp-large-set}-\ref{alg:dp-any-set}.
HLL also has the following $(\epsilon, \delta)$ guarantee.
\begin{theorem}
If $n \geq n_0$, then HLL satisfies an $(\epsilon, \delta)$-DP guarantee
where $\delta \leq k \exp(-\sfrac{\pi_0 n}{k})$
\label{thm:hll-dp}
\end{theorem}
HLL's estimator is only a function of
$\pi(s)$ for medium to large cardinalities
as it has the form $\hat{N}(s) = \tilde{N}(\pi(s))$ when $\tilde{N}(\pi(s)) > 5 k / 2$.
Thus, if $\pi_0$ is sufficiently small so that $\tilde{N}(\pi_0(s)) > 5 k / 2$, then Theorem \ref{thm:eps-delta using Nhat} can still be applied, and HLL satisfies $(\epsilon, \delta)$-DP
with $\delta = P(\hat{N}(\ensuremath{S}_r(\ensuremath{\mathcal D})) < \tilde{N}(\pi_0))$.
\label{s:hlls}
\section{Empirical Evaluation}
\setcounter{figure}{0}
\begin{figure*}[b]
\begin{adjustbox}{max width=\linewidth,center}
\centering
\subfloat[Wall-clock update time in seconds vs. $k$.]{{\input{timings.tex}}
\label{fig:timing-comparison}}%
\subfloat
Estimated space increase using QLL \cite{smith2020flajolet} rather than PHLL.]
{{\input{space_vs_error.tex}} \label{fig:space-ratio}}
\end{adjustbox}
\caption{
(\ref{fig:timing-comparison}) QLL's update time is not competitive since it performs $O(k)$ hashes. (\ref{fig:space-ratio}) QLL is less efficient spacewise than PHLL. The relative size of a QLL sketch to a PHLL sketch, the \emph{Space ratio}, is larger for more accurate sketches.
}
\end{figure*}
We provide two experiments highlighting the practical benefits of our approach.
Of past works, only \cite{choi2020differentially, smith2020flajolet} are comparable and both differ from our approach in significant ways.
We empirically compare only to \cite{smith2020flajolet} since \cite{choi2020differentially} is simply an analysis of HLL.
Our improvement over \cite{choi2020differentially} for HLL consists of providing
significantly tighter privacy bounds in Section \ref{s:hllparagraph} and providing a fully $\epsilon$-DP sketch in the secret hash setting. We denote our $\epsilon$-DP version of HLL using Algorithm \ref{alg:dp-large-set} by PHLL (private-HLL) and that of \cite{smith2020flajolet} by QLL.
Details of the experimental setup are in Appendix \ref{app:exptdetails}.
\textbf{Experiment 1: Update Time (Figure \ref{fig:timing-comparison}).}
We implemented regular, non-private HLL,
our PHLL, and QLL
and recorded the time to populate every sketch over $2^{10}$ updates with $k \in \{2^7, 2^8, \dots 2^{12} \}$ buckets. For HLL, these bucket sizes correspond to relative standard errors ranging from $\approx 9\%$ down to $\approx 1.6\%$.
Each marker represents the mean update time over all updates and the curves are the evaluated mean update time over $10$ trials.
As expected from theory, the update time of \cite{smith2020flajolet} grows as $O(k)$.
In contrast, our method PHLL has a constant update time and is similar in magnitude to HLL.
Both are roughly $500\times$ faster than \cite{smith2020flajolet} when $k=2^{12}$.
Thus, figure \ref{fig:timing-comparison}
shows that \cite{smith2020flajolet} is not a scalable solution and the speedup by achieving $O(1)$ updates is substantial.
\textbf{Experiment 2: Space Comparison (Figure \ref{fig:space-ratio}).}
In addition to having a worse update time, we also show that QLL has lower utility in the sense that it requires more space than PHLL to achieve the same error.
Fixing the input cardinality at $n=2^{20}$ and
the privacy budget at $\epsilon = \ln(2)$,
we vary the number of buckets $k \in \{2^7, 2^8, \dots 2^{12} \}$ and
simulate the $\epsilon$-DP methods, PHLL and QLL \cite{smith2020flajolet}.
The number of buckets controls the error and we found that both methods obtained very similar mean relative error for a given number of bins\footnote{
This is shown in Figure \ref{fig:utility-space}, Appendix \ref{app:exptdetails}.}
so we plot the space usage against the expected relative error for a given number of buckets.
For QLL, since the error guarantees tie the parameter $\gamma$ to the number of buckets, we modify $\gamma$ accordingly as well.
We compare the sizes of each sketch as the error varies.
Since the number of bits required for each bin depends on the range of values the bin can take,
we record the simulated
$\textbf{total sketch size} := k \cdot \log_2 \max_i s_i$,
by using the space required for the largest bin value over $k$ buckets.
Although QLL achieves similar utility, it does so using a sketch that is larger:
when $k = 2^7$, we expect an error of roughly $9\%$, QLL is roughly $1.1\times$ larger.
This increases to about $1.6\times$ larger than our PHLL sketch when $k=2^{12}$, achieving error of roughly $1.6\%$.
We see that the average increase in space when using QLL compared to PHLL
\emph{grows exponentially in the desired accuracy of the sketch};
when lower relative error is necessary, we obtain a greater space improvement over QLL than at higher relative errors.
This supports the behavior expected by comparing with space bounds of \cite{smith2020flajolet} with (P)HLL.
\section{Conclusion}
We have studied the (differential) privacy of a class of cardinality estimation sketches that includes most popular algorithms.
Two examples are the \acrshort{hll} and KMV (bottom-$k$) sketches that have been deployed in large systems
\cite{heule2013hyperloglog, datasketches}.
We have shown that the sketches returned by these algorithms
are $\epsilon$-differentially private when run on streams
of cardinality greater than $n_0 = \frac{k_{max}}{1-e^{-\epsilon}}$
and when combined with a simple downsampling procedure.
Moreover, even without downsampling,
these algorithms satisfy $(\epsilon, \delta)$-differential
privacy where $\delta$ falls exponentially with the stream
cardinality $n$
once $n$ is larger than the threshold $n_0$.
Our results are more general and yield better
privacy guarantees than prior work for small space cardinality estimators that preserve
differential privacy.
Our empirical validations show that our approach is practical and scalable, being much faster than previous state-of-the-art while consuming much less space.
\begin{ack}
We are grateful to Graham
Cormode for valuable comments on an earlier version
of this manuscript. Justin Thaler was supported by
NSF SPX award CCF-1918989 and NSF CAREER award CCF-1845125.
\end{ack}
\newpage
| {'timestamp': '2023-02-06T02:15:51', 'yymm': '2203', 'arxiv_id': '2203.15400', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15400'} | arxiv |
\section{Additional details and analysis in the synthetic experiments}\label{app:details_exp}
In this section, we provide additional details on the hyperparameter selection procedure in the synthetic networks of Section \ref{sec:exp_synthetic}, and two supplementary experiments, namely a sensitivity analysis of our method to the window size parameter $L$ and to the choice of pooling layer in the similarity module (see Section \ref{sec:methodology}).
\subsection{Hyperparameter selection}
In each scenario and difficulty level, we train our s-GNN over 100 epochs and and validate using the F1-score. We select one set of hyperparameters of the s-GNN (i.e., learning rate, number of hidden units, dropout rate and size of Sort-$k$ layer) per scenario by searching over a grid of values in one difficulty level, i.e., $p = 0.03$ in Scenario 1, $s=60$ in Scenario 2, $p = 0.06$ in Scenario 3, and $h= 0.1$ in Scenario 4. For choosing the hyperparameters we test every configuration of values with the learning rate in the set $\{0.001, 0.01\}$, the dropout rate in $\{0.01, 0.05, 0.1\}$, the size of the Sort-$k$ layer in $\{20, 40, 100\}$, the number of hidden units in $\{16, 32, 64\}$, and select the one with the highest F1-score on the validation set.
For each graph distance baseline $d$, we use the training and validation sets to choose a classification threshold $\theta$ such that the estimated label $\hat{y}_i = 1$ if $d(G_1^i, G_2^i) < \theta$ and $\hat{y}_i = 0$ otherwise (or reversely for the WL kernel).
\subsection{Sensitivity to the window size}\label{app:sensitivity}
We evaluate the sensitivity of our NCPD method and the baselines to the window size parameter $L$ in the \textbf{``Merge"} scenario from Section \ref{sec:exp_synthetic}. We recall that this hyperparameter corresponds to the amount of past (and future for some baselines) information needed to compute the NCPD statistic. It is therefore also the minimal distance between change-points that a method can detect. In this analysis, we test the performances of the methods using different window sizes in a a synthetic setting from Section \ref{sec:exp_synthetic}. More precisely, we consider Scenario 1 (``Merge") and three difficulty levels ($p = 0.3, 0.4, 0.5$).
We report our findings in Figure \ref{fig:sensitivity_window}. We note that our method is not very sensitive to the window size, in particular our best variant (\textbf{s-GNN-RW}) outperforms the baselines for all window sizes. We also remark that the two methods based on the CUSUM statistic (\textbf{CUSUM} and \textbf{CUSUM 2}) have better performances for larger $L$, and this effect is larger than for the other baselines. In conclusion, the choice of window size in our NCPD statistic \eqref{eq:CP_stat} does not have a big impact on the performance of our method, and therefore does not require to be finely tuned.
\begin{figure}
\centering
\begin{subfigure}[b]{0.8\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/detection_simulation1_bis_2_window_1_boxplot.pdf}
\caption{Difficult level}
\label{fig:diff1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.8\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/detection_simulation1_bis_2_window_2_boxplot.pdf}
\caption{Moderate level}
\label{fig:diff2}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.8\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/detection_simulation1_bis_2_window_3_boxplot.pdf}
\caption{Easy level}
\label{fig:diff3}
\end{subfigure}
\hfill
\caption{Performances on the detection task in the \textbf{``Merge"} scenario for 3 window sizes $L = 6, 12, 24$ in three difficulty levels: difficult ($p = 0.3$) (\subref{fig:diff1}), moderate ($p = 0.4$) (\subref{fig:diff2}), easy ($p = 0.5$) (\subref{fig:diff3}).}
\label{fig:sensitivity_window}
\end{figure}
\subsection{Sensitivity to the pooling layer}
In this section, we test the importance of using a Sort-$k$ pooling layer in our similarity module (Figure \ref{fig:similarity_module}). We consider the \textbf{``Birth 1"} scenario from Section \ref{sec:exp_synthetic} and compare the performance of our method with Sort-$k$ pooling ($k=100$) with the same method with Max or Average pooling. We report our findings in Figure \ref{fig:sens_pooling}. We note that Max pooling does not have good performances in this experiment and Average pooling has a higher variance than Sort-$k$, except in the last (and easiest setting). It may be due to the fact that Max pooling is less robust to the sparsity of the network than Sort-$k$ and Average pooling, and that the latter cannot detect local changes in the graphs since it averages the displacement over the whole set of nodes. Therefore, we can conclude that Sort-$k$ pooling is more adapted to detect small distribution changes, while being robust to the sparsity of edges.
\begin{figure}
\centering
\includegraphics[width=0.7\textwidth]{figures/detection_merge_simulation_pooling_diff_0_baselines_window_1.pdf}
\caption{Localisation error of the s-GNN in the \textbf{``Birth 1"} scenario with different choices of pooling layers in the similarity module, namely Sort-$k$, Max and Average pooling.}
\label{fig:sens_pooling}
\end{figure}
\section{Additional results on the S\&P 500 stock returns data set}\label{app:stocks}
In this section, we first report additional figures illustrating the procedure for pre-estimating change-points in the training and validation sequences of the dynamic correlation network; secondly we analyse the network using the eigen-entropy $H(t)$, as previously done in \cite{chakraborti2020phase} on similar data. This latter analysis also gives an insight on the possible market phases (i.e., the period in-between our estimated change-points).
In Figure \label{fig:aris}, we plot the heatmap of the similarity matrix between the graph snapshots in the training and validation sequences. We recall from Section \ref{sec:exp_financial} that the similarity score between pairs of snapshots is measured in terms of the Adjusted Rand Index values between the stock partitions obtained for each snapshots. We note that this similarity matrix seems to have a cluster structure; in particular, high similarity scores can be found during the period of the financial crisis from 2007 to 2011 and in 2001-2002. The clustering procedure of this matrix with spectral clustering and a post-processing step (see \ref{sec:exp_financial}) leads to the pre-estimated change-points plotted in Figure \ref{fig:preCPS}.
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{figures/fin_nets_ari.pdf}
\caption{Matrix of Adjusted Rand Index values between the partitions obtained for each pair of graph snapshots in the correlation network of S\&P 500 stock returns. \mcc{The first two digits denote the month, followed by the year.} }
\label{fig:aris}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=\textwidth]{figures/fin_pretext_task.pdf}
\caption{Pre-estimated change-points on the training and validation sequences of the S\&P 500 stock returns correlation network.}
\label{fig:preCPS}
\end{figure}
\paragraph{Analysis of the eigen-entropy}
We first analyse the correlation structures of our graphs using the eigen-entropy $H(t)$ \cite{chakraborti2020phase}. The eigen-entropy of a graph is defined as the entropy of the eigen-centrality vector, which is a $L_1$-normalised version of the principal eigenvector of the graph adjacency matrix. This principal eigenvector is related to the relative ranks of the different stocks in the market and its entropy measures the market ``disorder". The correlation matrices $C(t)$'s can be further decomposed into a market mode (principal eigen matrix) $C(t)_M$ and a composite group plus random mode $C(t)_{GR}$ and their corresponding eigen-entropy $(H_M(t), H_{GR}(t)$ can be also computed (see Figure \ref{fig:eigen_entropy}). This allows to define a 3D-phase space where the graphs can be separated into types (e.g. market anomalies, crashes, normal behaviour or highest disorder in \cite{chakraborti2020phase}). A 2D visualisation of our graphs with their corresponding labels is given in Figure \ref{fig:phase_space}. The distribution of the average eigen-centrality vectors in each class of graphs also indicates that the correlation structure changes in the different phases (see Figure \ref{fig:centrality_dist}). \cite{chakraborti2020phase} also observe a scaling behaviour by comparing the absolute entropy difference $|H - H_{GR}|$ and the mean market correlation (see Figure \ref{fig:entropy_mmc}).
\begin{figure}
\centering
\includegraphics[width=0.9\linewidth]{figures/entropy_all.png}
\caption{Eigen-entropy of the correlation graph, the market mode and the group plus random mode over time.}
\label{fig:eigen_entropy}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_0.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_1.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_2.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_3.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_4.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_5.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_6.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_7.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_8.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_9.0.png}
\includegraphics[width=0.32\linewidth]{figures/sns_centrality_distribution_class_10.0.png}
\caption{Histogram of the values in the average eigen-centrality vector of each class (phase) of graphs (the subplots correspond to different classes).}
\label{fig:centrality_dist}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\linewidth]{figures/phase_space.png}
\caption{Entropy differences $|H - H_{GR}|$ versus $|H - H_{M}|$.}
\label{fig:phase_space}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\linewidth]{figures/entropy_vs_mean_market_corr.png}
\caption{Entropy differences $|H - H_{M}|$ versus mean market correlation.}
\label{fig:entropy_mmc}
\end{subfigure}
\hfill
\caption{Entropy differences $|H - H_{GR}|$ versus $|H - H_{M}|$ (in log scale) (\subref{fig:phase_space}) and entropy differences $|H - H_{M}|$ versus mean market correlation (\subref{fig:entropy_mmc}) for the graphs in the financial correlation dynamic network. The colors indicate the class of the graphs in our partition.}
\label{fig:phase_entropy}
\end{figure}
\section{Additional experimental results on the physical activity monitoring data}
\subsection{Similarity between activities and subjects}\label{app:similarity_act}
Additional results on the similarity between activities and subjects are presented in Figure~\ref{fig:av_corr_0}, Figure~\ref{fig:av_dist_sub_0}, Figure~\ref{fig:dist_act}, and Figure~\ref{fig:av_dist_subj}.
\begin{figure}
\centering
\begin{subfigure}[b]{0.29\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_1.0.pdf}
\caption{Activity 1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.29\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_2.0.pdf}
\caption{Activity 2}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.35\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 0cm 0.5cm}, clip]{figures/phyact_avcorr_subject_0_acti_3.0.pdf}
\caption{Activity 3}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_4.0.pdf}
\caption{Activity 4}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_5.0.pdf}
\caption{Activity 5}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_6.0.pdf}
\caption{Activity 6}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_7.0.pdf}
\caption{Activity 7}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_12.0.pdf}
\caption{Activity 12}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_13.0.pdf}
\caption{Activity 13}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_16.png}
\caption{Activity 16}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_17.0.pdf}
\caption{Activity 17}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 3cm 0.8cm}, clip]{figures/phyact_avcorr_subject_0_acti_24.0.pdf}
\caption{Activity 24}
\end{subfigure}
\hfill
\caption{Average adjacency matrices for each of the 12 activities performed by Subject 1. }
\label{fig:av_corr_0}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}[b]{0.49\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 0cm 1cm}, clip]{figures/phyact_subject_0_100_av_acti_distance.png}
\caption{Distance between average adjacency matrices per activity.}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.49\textwidth}
\centering
\includegraphics[width=\linewidth, trim={0cm 0cm 0cm 1cm}, clip]{figures/phyact_subject_0_100_acti_distance.png}
\caption{Average (and standard deviation) distance between graphs grouped by activities.}
\end{subfigure}
\hfill
\caption{Frobenius distance between graphs in the dynamic network corresponding to Subject 1.}
\label{fig:av_dist_sub_0}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_1.png}
\caption{Activity 1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_2.png}
\caption{Activity 2}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.34\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 2cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_3.png}
\caption{Activity 3}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_4.png}
\caption{Activity 4}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_5.png}
\caption{Activity 5}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_6.png}
\caption{Activity 6}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_7.png}
\caption{Activity 7}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_12.png}
\caption{Activity 12}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_13.png}
\caption{Activity 13}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_16.png}
\caption{Activity 16}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_17.png}
\caption{Activity 17}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\linewidth, trim={1cm 0cm 4cm 0.8cm}, clip]{figures/phyact_dist_subjects_acti_24.png}
\caption{Activity 24}
\end{subfigure}
\hfill
\caption{Average (and standard deviation) Frobenius distance between the graphs grouped by subjects for each activity label.}
\label{fig:dist_act}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.4\linewidth, trim={1cm 0cm 1cm 0.9cm}, clip]{figures/phyact_dist_subjects.png}
\caption{Average Frobenius distance between graphs with the same label grouped by subjects.}
\label{fig:av_dist_subj}
\end{figure}
\subsection{ONCPD statistic}
Additional results on ONCPD statistics are presented in Figure~\ref{fig:res_exp1_stat_gnn}, Figure~\ref{fig:res_exp1_stat_cusum}, and Figure~\ref{fig:res_exp1_stat_fro}.
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_sgnn_subject_0_20.pdf}
\caption{Subject 1}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_sgnn_subject_10_20.pdf}
\caption{Subject 2}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_sgnn_subject_30_20.pdf}
\caption{Subject 3}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_sgnn_subject_40_20.pdf}
\caption{Subject 4}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_sgnn_subject_50_20.pdf}
\caption{Subject 5}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_sgnn_subject_60_20.pdf}
\caption{Subject 6}
\label{}
\end{subfigure}
\hfill
\caption{Change point detection statistic of our sGNN method and activity change points (in red) with a tolerance of $\pm 5$ timestamps for Subjects 1-6 a window size $L = 10$.}
\label{fig:res_exp1_stat_gnn}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_cusum_subject_0_20.pdf}
\caption{Subject 1}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_cusum_subject_10_20.pdf}
\caption{Subject 2}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_cusum_subject_30_20.pdf}
\caption{Subject 3}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_cusum_subject_40_20.pdf}
\caption{Subject 4}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_cusum_subject_50_20.pdf}
\caption{Subject 5}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_cusum_subject_60_20.pdf}
\caption{Subject 6}
\label{}
\end{subfigure}
\hfill
\caption{CUSUM 2 statistic and activity change points (in red) with a tolerance of $\pm 5$ timestamps for Subjects 1-6 a window size $L = 20$.}
\label{fig:res_exp1_stat_cusum}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_frobenius_subject_0_20.png}
\caption{Subject 1}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_frobenius_subject_1_20.png}
\caption{Subject 2}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_frobenius_subject_2_20.png}
\caption{Subject 3}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_frobenius_subject_3_20.png}
\caption{Subject 4}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_frobenius_subject_4_20.png}
\caption{Subject 5}
\label{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/phyact_frobenius_subject_5_20.png}
\caption{Subject 6}
\label{}
\end{subfigure}
\hfill
\caption{Change point detection statistic using the Frobenius distance and activity change points (in red) with a tolerance of $\pm 5$ timestamps for Subjects 1-6 a window size $L = 20$.}
\label{fig:res_exp1_stat_fro}
\end{figure}
\subsection{Sensitivity to the tolerance level}
In this section, we investigate the sensitivity of our results presented in Table \ref{tab:res_exp1} to the tolerance level chosen to compute the adjusted F1-score. We consider the \textbf{Random split} experiment in the \textbf{Cross-Individual} task from Section \ref{sec:exp_physical}, and we reproduce this experiment for different levels of tolerance $\text{tol} = \{1,3,5,7\}$. We report the numerical results in Table \ref{tab:res_exp2_tolerance}. We note that our method has the best performance for all considered levels.
\clearpage
\begin{table}
\centering
\begin{tabularx}{\textwidth}{
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X }
\toprule
\multicolumn{6}{c}{\textbf{Cross-individual NCPD}} \\
\midrule
Tolerance & s-GNN-I & Frobenius & SC-NCPD & CUSUM & CUSUM 2 \\
\midrule
1 & \textbf{0.60 (0.30)} & 0.53 (0.22) & 0.43 (0.32) & 0.33 (0.24) & 0.42 (0.30) \\
3 & \textbf{0.87 (0.25)} & 0.68 (0.20) & 0.70 (0.31) & 0.53 (0.24) & 0.76 (0.29) \\
5 & \textbf{0.61 (0.27)} & 0.53 (0.20) & 0.41 (0.32) & 0.27 (0.22) & 0.44 (0.31) \\
7 & \textbf{0.85 (0.28)} & 0.71 (0.21) & 0.71 (0.30) & 0.56 (0.25) & 0.75 (0.29) \\
\bottomrule
\end{tabularx}
\caption{Adjusted F1-score of our method (s-GNN) and baselines in the \textbf{Cross-individual} NCPD task and the random split setting on the physical activity monitoring data. The bold values in each row denote the top performing method. The values in the parentheses denote the standard deviation over 10 repetitions of the random splits train/validation/set.
\mc{We remark that different rows corresponding to different tolerance levels essentially amounts to defining a different set of ground truth change-points, and hence we should not necessarily expect a monotonic relationship between tolerance versus the recovery accuracy of all methods; the main take-away message here is that the s-GNN method attains superior performance when compared to other baselines, for the same tolerance level.}}
\label{tab:res_exp2_tolerance}
\end{table}
\end{appendix}
\section{Introduction}
The study of dynamic - or temporal, evolutionary, time-varying - networks has become very popular in the last decade, with the increasing amount of sequential data collected from structured and evolving systems, e.g. online communication platforms \cite{kumar2019}, co-voting networks \cite{wilson2016modeling} or fMRI data \cite{Cribben2017}. In fact, adding a time component to graph-structured data leads to a richer representation and allows more powerful analysis \cite{skarting2021}. This is particularly important when the network is governed by a non-stationary underlying process, which dynamics undergo abrupt switches or breaks. For instance, interaction patterns in social networks, such as Twitter or Reddit, can be very quickly modified after some event or ``shock`` \cite{rossi2020temporal}, \mc{thus providing strong motivation for incorporating a temporal dimension in the analysis}.
Detecting such structural breaks is a common task in diverse applications, from brain connectivity state segmentation \cite{ondrus2021} to phase discovery in financial correlation networks \cite{Barnett2016}. Moreover, most real-world dynamic networks are structured around functional groups or densely connected communities. Therefore their evolution over time has been often measured by the changes in these substructures - sometimes called \textit{community life-cycle} \cite{Rossetti_2018} - e.g. growth, \mc{decay}, merges, splits, etc.
For multivariate time series, change-point detection is a task that has been widely studied in various settings (e.g., nonparametric \cite{Zou_2014}, high-dimensional \cite{wang2017highdimensional} or online \cite{Chen2020}). The equivalent task for dynamic networks is often denoted network change-point detection (NCPD) and has recently become a popular problem with numerous successful applications in finance \cite{Barnett2016}, neuroscience \cite{OforiBoateng2019NonparametricAD} or transport networks \cite{yu2021optimal}. Depending on the type of problem at hand, dynamic networks have been represented in multiple ways, e.g., with contact sequences, interval graphs, graph snapshots (see \cite{Holme_2012} for a precise review of concepts, models and applications). In this work, we will consider the discrete representation of time-varying networks or \emph{snapshot networks}: we \mc{denote} a dynamic network $\mathcal{N}_I = \{G_t\}_{t \in I}$ \mc{to be} a sequence of graph snapshots, where $I$ is an ordered set, chosen as $\mathbb{N}_{>0}$ for simplicity, and each $G_t, t \in I,$ is a (static) graph. We note that each $G_t$ is a general graph, that can be directed and/or have edge weights or node attributes. We define a change-point for the network $\mathcal{N}$ as a timestamp $t \in \mathbb{N}_{>0}$ such that the generative distribution of the graphs before $t$, $(G_1, \dots, G_{t-2}, G_{t-1})$ is different from the one of graphs observed \hk{from} $t$, $(G_{t}, G_{t+1}, \dots)$. When the generative distribution of the graph snapshots, a change-point for a dynamic network sequence is more broadly defined as a timestamp $t$ where a significant shift or deviation can be observed between $G_t$ and the preceding graph snapshots.
In general, a dynamic network may contain multiple change-points and \mc{the tasks of} detecting and localisating the latter therefore correspond to partitioning an observation window $[1,T], T > 0$ into segments $[1,T] = \bigcup_{i=0}^{K-1} [\tau_i, \tau_{i+1}]$ \hk{where }$\tau_0 = 1$ \hk{and} $\tau_{K} = T$, such that the generative distribution of the graph snapshots is stationary on $[\tau_i, \tau_{i+1}]$ for each $i$. Intuitively, each temporal segment $[\tau_i, \tau_{i+1}]$ can be associated with a state of the underlying process, and each change-point $\tau_i$ can be interpreted as a response of the system to an external event. Therefore, NCPD shares some \mc{similarity with the task of} anomaly detection in temporal graphs \cite{enikeeva2021changepoint}. In an online setting, one aim\hk{s to} detect such change-points while the graph snapshots are collected, and with minimal detection delay, while in a\hk{n} offline setting, such analysis is conducted \emph{a posteriori} on the whole data sequence. For particular graph generative models, the feasibility of the NCPD task and minimax rates of estimation have been analysed in dynamic random graph models, e.g., Bernoulli networks \cite{Padilla2019, enikeeva2021changepoint, yu2021optimal, wang2020optimal}, graphon models \cite{zhao2019changepoint}, stochastic block models \cite{wilson2016modeling, wang2013locality} and generalized hierarchical random graphs \cite{peel2014detecting}. However, most real-world dynamic networks have heterogeneous properties, e.g. sparsity, edge weights, node attributes or nonlinear dynamics \cite{li2017} - and neither their generative distribution nor the type of change that can happen are known in advance.
Many existing methods for NCPD measure the discrepancy between two subsets of graphs, and rely on a graph similarity function, kernel or distance for pairwise graph comparisons \cite{chu2018sequential, Cribben2017, zhao2019changepoint, gretton2008kernel}. However, it is often difficult to choose \emph{a priori} an appropriate measure of similarity (or dissimilarity) that can integrate all the network characteristics, \mc{while being agnostic to the generating mechanism or type of change-point}. Consequently, without any domain knowledge, this choice is often arbitrary, and result in poor performances \cite{chu2018sequential, enikeeva2021changepoint, Kriege_2020}. Moreover, most online NCPD methods require \hk{finely tuning} several hyperparameters, such as detection thresholds \cite{yu2021optimal} and window sizes \cite{Huang2020}. To address these challenges, we propose a change-point agnostic and end-to-end method for online NCPD that in particular includes learning a data-driven
graph similarity function.
Our method is therefore adaptive to the network distribution and different types of change-points; in particular, it can easily incorporate general graph features such as node attributes, edge weights or attributes, and can adapt to sparse settings.
In summary, our contributions are the following:
\begin{itemize}
\item We propose a graph similarity learning model based on a siamese graph neural network \mcc{able to handle any available node attributes,} and demonstrate how it can be \mc{leveraged for the online NCPD problem} with an adequate training procedure. In particular, our learnt similarity function
is sensitive to both local and global displacements in the graph structure, and can effectively be employed in the context of change-point (and anomaly) detection in temporal networks.
\item We use an efficient online NCPD statistic with a short-term history of the graph snapshots that avoids detection delays and requires little additional hyperparameter tuning.
\item We empirically demonstrate the advantages of our method on synthetic networks with diverse types of change-points, as well as on two challenging real-world data sets. We notably design a self-supervised training procedure for data without ground-truth labelling of change-points.
\end{itemize}
\paragraph{Paper outline.} In Section \ref{sec:rel_work}, we succinctly review existing work on NCPD and present our general setup and methodology in Section \ref{sec:methodology}. In Section \ref{sec:experiments}, we evaluate our method on synthetic and real-world data sets and compare to several existing NCPD baseline methods. Finally, we conclude in Section \ref{sec:discussion} with a summary of our results and discuss possible future developments.
\section{Related works}\label{sec:rel_work}
The study of dynamic networks, and in particular NCPD, is a relatively recent area of research that has largely incorporated principles from change-point detection in time series, \mc{especially in high-dimensional settings}. Some NCPD methods estimate the parameters of a network model, e.g., the generalised hierarchical random graph \cite{peel2014detecting}, a stochastic block model \cite{deridder2016} or the preferential attachment model \cite{bhamidi18}, and conduct hypothesis tests to detect changes in the estimated parameters. Other methods maximize a penalized likelihood function, e.g., based on a non-homogeneous Poisson point process model \cite{Corneli2018MultipleCP} or a dynamic stochastic block model \cite{wilson2016modeling, bhattacharjee2020change}. However, for real-world networks, the assumption on a particular model can sometimes be too restrictive.
Several model-agnostic methods for NCPD extract features from the graph snapshots, e.g., the degree distribution \cite{miller2018size} or the joint distribution of a set of edges \cite{wang2017fast}, and use classical discrepancy measures to quantify the amount of change. Other methods relying on pairwise comparison of graphs use a graph similarity or pseudo-distance, such as the DeltaCon metric \cite{Koutra2016DeltaConPM}, the Hamming distance and the Jaccard distances \cite{donnat2018tracking}, the Frobenius and maximum norms \cite{Barnett2016}, spectral distances based on the Laplacian \cite{Huang2020, Cribben2017, hewapathirana2019change}, $\ell_2$ or $\ell_{\infty}$ norms \cite{zhao2019changepoint} or a graph kernel \cite{desobry2005online, gretton2008kernel, harchaoui2009kernel}. Nevertheless, these graph metrics suffer from intrinsic limitations; e.g., the Hamming distance is sensitive to the graph density and the Jaccard distance treats all edges uniformly \cite{donnat2018tracking}. Furthermore, it has been previously underlined that the choice of graph distance can significantly affect a method's results \cite{Barnett2016}, and therefore requires \textit{a-priori} knowledge or assumption on the network distribution.
One widely popular statistic in change-point detection problems is the cumulative sums (CUSUM) statistic, which has been used in different time series contexts, e.g., in the offline and high-dimensional setting (in combination with the network binary segmentation algorithm) \cite{wang2017highdimensional}, and more recently, in the online setting \cite{Chen2020}. Several NCPD methods have adapted this efficient statistic to dynamic networks, e.g., for sparse graphs \cite{wang2020optimal}, graphs with missing links \cite{dubey2021online, enikeeva2021changepoint}, in offline \cite{Padilla2019} and online \cite{yu2021optimal} settings, and proved that minimax rates of estimation can be obtained for the overall false alarm probability and the detection delay.
However, computing the CUSUM statistic necessitates a ``forward'' window to detect a change at a given timestamp, and methods based on this statistic often require to tune several hyperparameters (e.g., one or several detection thresholds).
In addition to the aforementioned limitations, most previously cited methods do not provide a principled way to incorporate node attributes or even edge weights. Interestingly, \mc{to the best of our knowledge, no prior work has ever considered graph neural networks (GNNs) for the NCPD problem,
despite the fact that such architectures can easily handle different types of networks (e.g., signed \cite{derr2018signed} or directed \cite{huang2019signed} ), and in particular, can inherently account for any available node attributes} \cite{kipf2016semi}.
In dynamic network modelling, graph convolutional recurrent networks \cite{gcrn2018} and dynamic graph convolutional networks \cite{dgcn2020} were introduced for predicting graph-structured sequences. In the dynamic link prediction task, methods that learn representations of dynamic networks have been proposed, using deep temporal point processes \cite{trivedi2018dyrep}, joint attention mechanisms on nodes neighborhoods and temporal domain \cite{ sankar2020}, memory feature vectors in message-passing architectures \cite{rossi2020temporal} or recurrent neural networks \cite{zhang2021dynamic, kumar2019}. For anomalous edge detection in dynamic graphs, \cite{cai21} process subgraphs around the target edges through convolution and sort pooling operations, and gated recurrent units.
To our knowledge, only one prior work has incorporated GNN layers in a method for change-point detection, \mc{but has done so} in the context of multivariate time series \cite{zhang2020correlationaware}. However, in this method, the GNN encodes the cross-covariances between the time series' dimensions in the spatial layers, and is one part of a complex neural network architecture (the temporal dependencies being encoded by recurrent neural network layers).
Moreover, while GNNs have proved to effectively learn representations of graphs, they can also be leveraged to learn graph similarity functions in a data-driven way and for particular tasks in a end-to-end fashion. This now popular problem is called \emph{graph similarity learning (GSL)} \cite{ma2020deep}. One common type of \hk{model} for this task is siamese networks \cite{Koch2015SiameseNN}, e.g., siamese graph neural networks \cite{ma2019similarity}) or graph matching networks \cite{Li2019GraphMN, ling2021}. These architectures allow to learn flexible and adaptive similarity functions and have been successfully applied to several tasks and graph domains, e.g. \mc{classification} of brain networks \cite{ma2019similarity, liu2019communitypreserving, ktena2017distance}, image \hk{classification} \cite{mensink2012metric}, and detection of vulnerabilities in software systems \cite{Li2019GraphMN}.
In this work, we will leverage such GSL models for the online NCPD task, which avoids the need for choosing \emph{a-priori} a particular graph distance, kernel or embedding.
\section{General setup and \mcc{framework}}\label{sec:methodology}
In this section, we describe our general set-up and NCPD method based on a graph similarity learning model. We will first present our network change-point statistic in Section \ref{sec:sim_NCPD}, leveraging a similarity function learnt by a GSL model described in Section \ref{sec:sGNN}, through an adequate training and validation procedures (see Section \ref{sec:training}). Before presenting our methodology, we introduce some useful notation.
\paragraph{Notation.}
We denote $G = (\boldsymbol{A}, \boldsymbol{E}) \in \mathbb{G}$ a graph with $n \geq 1$ nodes denoted by $\{u_1, \dots, u_n\}$, adjacency matrix $\boldsymbol{A} \in \mathbb{R}^{n \times n}$ and node attributes (or features) matrix $\boldsymbol{E} \in \mathbb{R}^{n \times d} \cup \{\emptyset\}$, $d\geq 1$. We say that the graph is attributed if $\boldsymbol{E} \neq \emptyset$, and \hk{un}attributed otherwise. If $\boldsymbol{A} \in \mathbb{R}_{\geq 0}^{n \times n}$, we also say that the graph is unsigned.
We denote $\mathcal{N}_T = \{G_t\}_{1 \leq t \leq T}$ a dynamic network with $T \geq 1$ snapshots, where each graph $G_t$ has the same set of nodes with a fixed ordering. Let $\boldsymbol{I}_n$ and $\mathds{1}_n$ be respectively the \hk{$n \times n$} identity matrix and the all-one vector of size $n$. For a matrix $\boldsymbol{M}$, we denote $\boldsymbol{M}_{ij}$ an entry, $\boldsymbol{M}_{i:}$ its $i$-th row and $\boldsymbol{M}_{:j}$ its $j$-th column. We also denote $\|\boldsymbol{M}\|_F$ and $\|\boldsymbol{M}\|$ respectively the Frobenius norm and operator norm (i.e., the largest singular value). For a vector $\vec{v}$, we denote $\|\vec{v}\|$ its Euclidean norm. For any \hk{positive} integer $J$, let $[J]$ denote the set $\{1,2,\dots, J\}$.
\subsection{Graph similarity function for network change point detection}\label{sec:sim_NCPD}
We consider a single dynamic network $\mathcal{N}_T = \{G_i\}_{1\leq t \leq T}$ with an unknown number of change-points $1 < \tau_1 < \dots < \tau_K < T$, $K \geq 1$, such that, for any $k \in [K]$ we have
\begin{align*}
&G_i \overset{i.i.d}{\sim} \mathcal{G}_{k-1}, \quad \tau_{k-1} \leq i < \tau_{k}, \\
&G_i \overset{i.i.d}{\sim} \mathcal{G}_k, \quad \hspace{2ex} \tau_k \leq i < \tau_{k+1},
\end{align*}
with $\tau_0 = 1$ and $(\mathcal{G}_{0}, \dots, \mathcal{G}_{K})$ distinct graph generating distributions. We assume that
$\forall k \geq 1, \tau_k - \tau_{k-1} \hk{\geq} L_0$, with $L_0 > 0$ a known lower bound of the minimal spacing between two consecutive change-points. We recall that in our setting, the set of nodes in each graph snapshot $G_t$ is fixed and its ordering is kept unchanged along the sequence.
Assume for now that we have a graph similarity function $s : \mathds{G} \times \mathds{G} \to [0,1]$ such that for any $G_{t_1} \sim \mathcal{G}_{i_{1}}, G_{t_2} \sim \mathcal{G}_{{i_2}}$, $s(G_{t_1}, G_{t_2}) > 0.5$ if $ \mathcal{G}_{i_1} = \mathcal{G}_{i_2}$ and $s(G_{t_1}, G_{t_2}) \leq 0.5$ otherwise. One can then detect change-points in $\mathcal{N}_T $ by monitoring the following average similarity statistic
\begin{align}\label{eq:CP_stat}
Z_t(s, L) = \frac{1}{L} \sum_{i=1}^L s(G_t, G_{t-i}), \quad t \geq L,
\end{align}
where $L < L_0$ is a hyperparameter that controls the length of the past
window, and declare a change-point at any timestamp $t$ such that
\begin{align}\label{eq:detection_rule}
&Z_{t'}(s, L) > 0.5 , \quad t-L \leq t' < t, \\
&Z_{t}(s, L) \leq 0.5 \nonumber.
\end{align}
This general method can be applied to recover an arbitrary number of change-points in the dynamic network in an online setting and without any detection delay, i.e., as soon as the data is collected. In practice, one can choose a graph similarity function or kernel \mc{$s(\cdot,\cdot)$} and a detection threshold $\theta$, e.g., using a validation criterion \cite{ranshous2015anomaly} or a significance test procedure using stationary bootstrap \cite{Cribben2017}, and declare a change-point (or an anomaly) in the dynamic network whenever $Z_{t}(s, L) > \theta$. Note that the properties of this method heavily depend on the chosen similarity function and its discriminative power.
Our NCPD method consists \hk{of} using the statistic $ Z_t(s, L)$ and the detection rule \eqref{eq:detection_rule}, together with a data-driven graph similarity function $s(\cdot,\cdot)$ learnt by a s-GNN model, which we describe in the next section.
\begin{remark}
Our method can also be employed in an offline setting, where one aims at localising changes in a dynamic network after the whole sequence has been collected, with a slight change of the detection rule. For instance, for a dynamic network with a single change-point, one can localise the latter at $\hat{\tau}$, such that
\begin{align}
&\hat{\tau} = \arg \min_{t \in [L,T]} Z_t(s, L), \nonumber \\
\text{or} \quad &\hat{\tau} = \arg \max_{t \in [L+1,T]} |Z_t(s, L) - Z_{t-1}(s, L)|. \label{eq:loc_single}
\end{align}
Additionally, our method could be adapted to a setting where a small detection delay (e.g., of order $L$) may be tolerated. In this case, we could replace \eqref{eq:CP_stat} by a more robust change-point statistic that also uses a future (or forward) window, e.g., $(G_t, G_{t+1},\dots G_{t+L})$. For instance, we could use a two-sample test statistic on the two sets of graphs $(G_{t-1}, \dots, G_{t-L})$ and $(G_{t}, \dots, G_{t+L})$ such as the maximum kernel Fisher discriminant ratio \cite{harchaoui2009kernel} or the maximum mean discrepancy (MMD) \cite{gretton2008kernel}, for which an unbiased estimate is given by
\begin{align*}
Z_t^{MMD} = \sqrt{\frac{1}{L(L+1)} \sum_{i, j=1}^{L+1} \left(s(G_{t-i},G_{t-j}) + s(G_{t-1+i},G_{t-1+j}) - s(G_{t-i},G_{t-1+j})\right)}.
\end{align*}
Note that this estimate would correspond to the empirical MMD measure between two sets of graphs mapped into a reproducing kernel Hilbert space if the function $s(\cdot,\cdot)$ was a graph kernel function \cite{gretton2008kernel}.
\end{remark}
\subsection{Graph similarity learning via siamese graph neural networks}\label{sec:sGNN}
Siamese graph neural networks (s-GNN) are architectures designed to compare pairs of graphs, e.g., for learning a graph similarity function or distance. They can notably be used in graph classification and graph matching tasks \cite{ma2019similarity, ktena2017distance} in both supervised and unsupervised settings. More precisely, a general s-GNN takes as input a pair $(G_1, G_2)$, embeds $G_1$ and $G_2$ with the same graph encoder (or equivalently, two \emph{siamese} encoders that share the same weights), then combines the embeddings in a \hk{symmetric similarity} module.
The variability of s-GNN architectures mainly lies in the design of these two modules (see for instance \cite{ktena2017distance, ma2019similarity, ling2021}).
In our NCPD method, we propose a s-GNN architecture summarized in Figure \ref{fig:GSN}, for learning a similarity score $s(G_{t_1},G_{t_2})$ in $[0,1]$ on the space of graph snapshots $(G_1, G_2, \dots, G_t, \dots)$ from the dynamic network.
For this purpose, we design a similarity module for comparing the node-level embeddings output by a generic graph encoder (e.g., a graph convolutional network \cite{kipf2016semi}, a graph attention network \cite{velickovic2018graph}, a GraphSage network \cite{hamilton2018inductive} or a graph isomorphism network (GIN) \cite{xu2019powerful}). Our similarity module consists of Euclidean distance, pooling and fully-connected layers, as detailed in Figure \ref{fig:similarity_module}.
The design of this module allows to select local regions of interest of the graph and limits the number of parameters by using Sort-$k$ pooling \cite{zhang2018end} and two fully-connected layers.
\begin{figure}[t]
\begin{subfigure}[b]{0.5\textwidth}
\centering
\includegraphics[width=\textwidth, trim=0.cm 0.cm 0cm 0.cm,clip]{figures/sgnn_arch.png}
\caption{Siamese graph neural network}
\label{fig:siamese}
\end{subfigure}
\hfill\hspace{-0.5cm}
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=\textwidth, trim=0.cm 0.cm 0.3cmv 0.cm,clip]{figures/similarity.png}
\caption{Similarity module}
\label{fig:similarity_module}
\end{subfigure}
\hfill
\caption{Architecture of our graph similarity learning model. The general pipeline (\subref{fig:siamese}) is a siamese GNN where the output module is a similarity module (\subref{fig:similarity_module}). We design the latter with Euclidean distance, Sort-$k$ pooling operations, and fully-connected layers, for measuring the proximity of snapshots in dynamic networks. }
\label{fig:GSN}
\end{figure}
For the sake of simplicity, we use a simple graph convolutional network (GCN) \cite{kipf2016semi} for undirected and unsigned graphs as the graph encoder in our architecture. However, this block can be replaced by any \textit{ad-hoc} graph encoder. With a GCN, the embedding of a graph $\H^{(j)}$ at each layer $j \in [J], J \geq 1$ is computed as follows
\begin{align}\label{eq:gcn}
\H^{(j)} = \sigma\left( \Tilde{\boldsymbol{A}} \H^{(j-1)} \mathbf{W}^{(j)} + \mathbf{B}^{(j)} \right),
\end{align}
where $ \mathbf{W}^{(j)} \in \mathbb{R}^{h_{j-1} \times h_j}$ is a weight matrix, $h_j$ is the number of hidden units of layer $j$, $\mathbf{B}^{(j)} \in \mathbb{R}^{h_{j}}$ is a bias vector, $ \Tilde{\boldsymbol{A}} = \Tilde{\boldsymbol{D}}^{-1/2} (\boldsymbol{A} + \boldsymbol{I}_n) \Tilde{\boldsymbol{D}}^{-1/2}$ is the normalized augmented adjacency matrix with degree matrix $\Tilde{\boldsymbol{D}} = \textrm{diag}((\boldsymbol{A}+\boldsymbol{I}_n) \mathds{1}_n)$, and $\sigma$ is the point-wise ReLU activation function, i.e., $\sigma(x) = \max(x,0)$. The input of the first layer, $\H^{(0)}$, is either the node attributes matrix $\boldsymbol{E} \in \mathbb{R}^{n \times d}$ if the input graph is attributed or a positional encoding matrix (see below). Finally, the output of the GCN is the node-level embedding matrix $\H^J \in \mathbb{R}^{n \times h_J}$ at the last layer. Therefore, for a pair of graphs $(G_{t_1}, G_{t_2})$, this siamese encoder module computes a pairs of graph embeddings, $(\H_1, \H_2) := (\H^J(G_{t_1}), \H^J(G_{t_2}))$, and the vectors $(\H_1)_{i:}$ and $(\H_2)_{i:}$ correspond to the representations of the node $i$ respectively in $G_{t_1}$ and $G_{t_2}$. Intuitively, a large distance between these two embeddings can indicate that node $i$ plays distinct structural roles in $G_{t_1}$ and $G_{t_2}$.
Then, the pair of embeddings $(\H_1, \H_2)$ is processed by a similarity module, which first computes a vector of Euclidean distance between the nodes' embeddings, and secondly, applies a Sort-$k$ pooling operation \cite{zhang2018end} to select its $k$ largest entries, i.e.,
\begin{align*}
\P = (f_{r_1}, \dots, f_{r_k} ), \quad f_{i} = \|(\H_1)_{i:} - (\H_2)_{i:}\|_2 \in \mathbb{R}_{\geq 0}, \quad 1 \leq i \leq n,
\end{align*}
where $r_1, \dots, r_k$ correspond to the indices of the (sorted) $k$ largest elements of $\{f_{i}\}_{i\in [n]}$.
\hk{Next, the pooled vector $P$ is processed by two fully connected layers, each of them containing an affine transformation, batch normalisation and ReLU activation function. Finally, the output of the second fully connected layer is pooled using a sum-pooling layer followed by a} sigmoid activation function, so that the final output of the similarity module (and the s-GNN), $s(G_{t_1}, G_{t_2}) \in [0,1]$, a non-negative similarity score between the two input graphs. This score can be transformed into a similarity label via
\mcc{
\vspace{-3mm}
\[
\hat{y}(G_{t_1}, G_{t_2}) =
\left\{
\begin{array}{lll}
1 & \text{(i.e., $G_{t_1}$ and $G_{t_2}$ are similar or have the same generative distribution)}, & \text{if } s(G_{t_1},G_{t_2}) > 0.5 \\
0 & \text{(i.e., $G_{t_1}$ and $G_{t_2}$ are dissimilar or have different generative distributions)}, & \text{otherwise}. \\
\end{array}
\right. \]
}
Note that using a Sort-$k$ pooling layer in the design of the similarity module has two main advantages in our context.
\textcolor{black}{\textbullet} First, since it follows the (node-wise) Euclidean distance operation, it therefore selects the nodes that have the largest discrepancies between their embeddings in the two graphs. Therefore, if a structural change in the dynamic network affects only a few nodes,
this change can be picked up by this pooling operation, without being diminished by the absence of change in the rest of the network.
\mcc{This component could be further built upon for identifying which \textit{local} part of the network is mainly driving the change-point, thus enhancing the explainability of the proposed pipeline.}
\textcolor{black}{\textbullet} Second, Sort-$k$ pooling reduces the number of parameters while preserving the most important information for measuring potential and local graph changes. More generally, replacing max or sum pooling by sorted pooling have been proven to increase the accuracy and generalization power of neural networks, in particular in settings with limited data availability, such as one-shot learning \cite{horvath2020sorted}, and can also be used for downsampling graphs \cite{lee2019pooling}. In the network change-point-agnostic detection task, we incorporate this pooling layer to mitigate our lack of information on the change-points.
\begin{remark}\label{rem:invariance}
It is often a desirable property of GNN models with graph-level (resp. nodel-level) output to be invariant (resp. equivariant) to nodes' permutations. This is due to the fact that nodes in a graph are generally considered exchangeable, or in other words, the order of node set in the adjacency and node attributes matrix is arbitrary. In our method, the s-GNN model takes as input pairs of graph snapshots from a dynamic network sequence (see Section \ref{sec:sim_NCPD}), where every snapshot contains the same set of nodes with the same ordering. Therefore, in our context, the invariance property of the learned graph similarity function denotes that the latter is invariant to any permutation of the nodes that is applied on both inputs. More precisely, for any permutation of the node set $\sigma: [n] \to [n]$, denoting $\sigma * G$ the resulting transformation of a graph $G$ under $\sigma$ (i.e., permutation of the rows and columns of the adjacency and node attributes matrices), the invariance property writes $s(\sigma(G_1), \sigma(G_2)) = s(G_1, G_2)$. This is indeed the case for our method since the node-wise operations, i.e, the graph encoder and the Euclidean distance, are equivariant. Then, since the Sort-$k$ pooling layer is permutation-invariant, i.e. $\P(\H) = \P(\sigma(\H))$, so is the final similarity score.
\end{remark}
Moreover, when the dynamic network is unattributed, i.e., each graph snapshot contains only structural information $G_i = (\boldsymbol{A}_i, \emptyset)$, one needs to choose an appropriate initialisation of the node features matrix $H^{(0)}$ as input of the s-GNN.
Following existing methodology \cite{you2019positionaware}, we compute Positional Encodings (PE), i.e., synthetic node attributes that capture their relative positions in the graph structure. In fact, it has been previously noted that the choice of PE is critical for the expressivity of GNN models \cite{dwivedi2022graph}. Therefore, in our experiments, we will use and compare four types of encoding, the first three being existing techniques that have been introduced in different graph learning settings, and the last being one that we believe may also be appropriate for certain NCPD tasks.
\begin{enumerate}
\item \textbf{Degree encoding \cite{bruna2017community}:} the attribute of a node is a scalar equal to its degree in the graph, i.e. $H^{(0)} = \hk{\boldsymbol{A} \mathds{1}_n} \in \mathbb{R}^{n \times 1}$.
\item \textbf{Random-Walk encoding \cite{li2020distance, dwivedi2022graph}:} for $k \geq 1$, the vector of attributes of a node $n_i, 1\leq i \leq n$ is defined as
\begin{align*}
\H^{(0)}_{i:} = [\boldsymbol{R}_{ii},\boldsymbol{R}^2_{ii}, \dots \boldsymbol{R}^k_{ii}] \in \mathbb{R}^k,
\end{align*}
where $\boldsymbol{R} = \boldsymbol{A} \boldsymbol{D}^{-1}$ is the random-walk operator and $k\geq 1$ is a hyperparameter.
\item \textbf{Laplacian encoding \cite{dwivedi2021generalization}:} the node attributes are the principal eigenvectors of the symmetric normalised Laplacian matrix $\L = \boldsymbol{I}_n - \boldsymbol{D}^{-1/2} \boldsymbol{A} \boldsymbol{D}^{-1/2}$. We note that this is similar to the first steps of spectral clustering algorithms. More precisely, using the factorisation $\L = U^T \Lambda U$ where $U, \Lambda$ respectively contain the ordered set of eigenvectors and eigenvalues of $L$, the Laplacian encodings are defined as
\begin{align*}
\H^{(0)} = [U^T_{:1}, U^T_{:2}, \dots, U^T_{:k} ] \in \mathbb{R}^{n \times k},
\end{align*}
where $k\geq 1$ is a hyperparameter.
\item \textbf{Identity encoding: } we define the initial feature matrix as $\H^{(0)} = \boldsymbol{I}_n$, which corresponds to learning a unique initial input embedding for each node at the first layer of the s-GNN. We argue that this is an appropriate choice for the graph siamese encoder in our setting. In fact, these encodings in general break the equivariance property of GNN models; however, this is not the case here since this property has a modified definition when the graphs are snapshots of a dynamic network (see Remark \ref{rem:invariance}). We recall that we have assumed that the set of nodes is constant in the dynamic network,
and the global ordering of the nodes, although arbitrary, is common to all graph snapshots. Finally, it has been previously noted in graph learning tasks that taking into account the nodes' identities \cite{donnat2018tracking} can be beneficial. We will in particular use these encodings for the real-world dynamic network with a small number of nodes in Section \ref{sec:exp_physical}.
\end{enumerate}
We note that more complex strategies for computing positional encodings include learning them along the training procedure of the s-GNN \cite{dwivedi2022graph}. However, we do not consider these latter approaches, which significantly increase the model complexity.
Finally, our s-GNN architecture can classically be trained in a supervised way if a data set of labelled pairs of graphs is available, with $\mathcal{D} = \{(G_1^i, G_2^i, y_i)\}_i$ with $y_i \in \{0,1\}$ indicating if the graphs come from the same distribution or not. For example, one can optimise its parameters by minimising the cross-entropy loss function
\begin{align*}
L(G_1, G_2, y) = - y \log s(G_1, G_2) - (1-y) \log (1- s(G_1, G_2)),
\end{align*}
\hk{via gradient descent.} In the NCPD task, designing such a data set requires an adequate sampling scheme of the snapshots in the dynamic network as well as an \textit{ad-hoc} validation procedure. In the next section, we present our supervised learning strategy for the s-GNN.
\subsection{Training and validation procedures for NCPD}\label{sec:training}
In the NCPD task, a supervised setting corresponds to the case where a training subsequence of the dynamic network containing ground-truth change-points is available. In this setting, these change-point labels can then be used to design training and validation sets for our GSL model,
with these sets containing triplets $(G_i^1, G_i^2, y_i)$, where $y_i \in \{0,1\}$ is a similarity label ($y_i = 1$ corresponding to "similar"). In this section, we describe our strategy for sampling such triplets from the dynamic network sequence, for both the training and validation steps.
First, we divide the sequence of graph snapshots into training, validation and test subsequences, e.g., using consecutive windows of respectively x\%, y\% and z\% timestamps. In the training and validation sequences, we sample labelled pairs of graphs according to the two following schemes.
\begin{enumerate}
\item \textbf{Random scheme (training set):} we consider the set of all (non-ordered) pairs of graphs in the training sequence and label each pair $(G_{t_1}, G_{t_2})$ with $y = 1$ if there is no change-point between $t_1$ and $t_2$, and
$y_i = 0$ otherwise. Then we uniformly sample a fixed number of pairs with label 1 ("positive" examples) and the same number of pairs with label 0 ("negative" examples), without replacement. The number of pairs is a hyperparameter of the method, which can be chosen heuristically as $10 \times T$, if $T$ is not too large.
\item \textbf{Windowed scheme (validation set):} we consider the set of all (non-ordered) pairs of graphs in the network sequence that are not distant from each other by more than $L$ timestamps, and label them with the same procedure as in the \textbf{Random scheme}.
\end{enumerate}
We note that the different sampling mechanisms for the pairs in the training and validation sets are designed to satisfy a double objective of our learning procedure: we aim to learn an adequate graph similarity function and to detect change-points in a network sequence using the latter. For the first objective, the \textbf{Random scheme} allows to create pairs of graph snapshots that are far away in the sequence in order to avoid strong correlations between the training pairs and undesired "transition" effects in real networks, e.g., when the change of generative distribution is not abrupt. Moreover, with the scheme, we can avoid label imbalance in the training set by sampling the same number of positive and negative pairs, which we assume is favorable for the s-GNN. For the second objective, the \textbf{Windowed scheme} builds a validation set of pairs that imitates the test setting of our GSL model. In fact, in our online NCPD method (see Section \ref{sec:sim_NCPD}), the evaluation of the graph similarity function $s(.,.)$ in the statistic \eqref{eq:CP_stat} (and detection rule \eqref{eq:detection_rule}) only applies for pairs of graphs within a sliding window of size $L$. In particular, in the test setting, the pairs of graphs that are compared by $s(\cdot,\cdot)$ are highly correlated and the number of positive pairs is much larger than the number of negative examples, since there are generally only few change-points in the dynamic network. We finally note that in both the \textbf{Random} and \textbf{Windowed schemes}, the sampled pairs may have in common (at most) one graph snapshot.
Consequently, in a supervised NCPD setting, we can train our s-GNN model in a supervised way as a binary classifier of pairs (see Section \ref{sec:sGNN}) using the previous sampling strategies. In an unsupervised NCPD setting, i.e., when the dynamic network does not contain any ground-truth label of change-point, we need to resort to a novel \emph{self-supervised learning} technique \cite{liu2021graph}.
In this case, we first pre-estimate a set of change-points in the training and validation sequences and then use the previous sampling schemes to draw training and validation pairs of graphs. This learning procedure is applied on the financial network data set in Section \ref{sec:exp_financial}, where our algorithm for pre-estimating a set of change-points is based on a spectral clustering technique.
\section{Numerical experiments}\label{sec:experiments}
In this section, we test and evaluate the performances of our s-GNN method in the online NCPD task, first in a controlled setting of synthetic dynamic networks (Section \ref{sec:exp_synthetic}), then on real-world correlation networks (Sections \ref{sec:exp_financial} and \ref{sec:exp_physical}).
Moreover, since one of these data sets does not contain ground-truth change-points, we also introduce a self-supervised learning procedure for our method (see Section \ref{sec:exp_financial}).
\subsection{Performance metrics}\label{sec:metrics}
For dynamic network data sets with ground-truth labels of change-points, we evaluate the performance of NCPD methods using the following metrics, in the single or multiple change-point settings:
\begin{itemize}
\item \textbf{Localisation error (single change-point)} defined as $\text{Error}_{\text{CPD}} = |\hat{\tau} - \tau|$, where $\tau, \hat{\tau}$ are respectively the ground-truth and estimated change-points.
\item \textbf{Adjusted F1-score \cite{xu18} (multiple change-points)} on the classification of timestamps as change-point (label 1) or not change-point (label 0). We tolerate an error of $\pm 5$ timestamps on this task, i.e. all the timestamps within a window of length 11 centered at the ground-truth change-point are given a ground-truth label 1, and a valid detection occurs whenever one of these timestamps is classified as change-point.
\end{itemize}
For the the data set without ground-truth labels in Section \ref{sec:exp_financial}, we qualitatively discuss our findings, \mcc{place them in a financial context,} and compare them with previous analysis of similar data. Additionally, in the synthetic data experiments in Section \ref{sec:exp_synthetic}, we also evaluate the ability of our graph similarity function $\hat{s}$ to discriminate between graphs sampled from the same or different distributions, i.e., to classify pairs of graphs generated from either the same or different random graph models. We measure this property in terms of the accuracy score.
\subsection{Baselines}\label{sec:baselines}
We will compare our data-driven graph similarity function to graph distances, similarity function and kernel previously used in the context of NCPD and graph two-sample-test.
\begin{itemize}
\item \textbf{Frobenius distance} \cite{Barnett2016, Nie2021WeightedGraphBasedCP, Bao2018NetworkDB, dubey2021online}, defined as $d_F(\boldsymbol{A},\boldsymbol{B}) = \|\boldsymbol{A} - \boldsymbol{B}\|_F$, for two matrices $\boldsymbol{A},\boldsymbol{B}$ with \hk{equal} dimensions. Here, we will apply this distance to the adjacency matrices of two graphs. Note that one can also apply it on the graph Laplacian matrices \cite{Bao2018NetworkDB}, and that this distance has also been used in a minimax testing perspective between two graph samples \cite{Ghoshdastidar2020}.
\item \textbf{Procrustes distance} between Laplacian principal eigenspaces \cite{hewapathirana2019change}. This distance corresponds to the Frobenius distance between the matrices of eigenvectors corresponding to the $k$ largest eigenvalues of the symmetric graph Laplacian $\L = \boldsymbol{I}_n - \boldsymbol{D}^{1/2}\boldsymbol{A} \boldsymbol{D}^{1/2}$, after performing an alignment step. The number of eigenvectors $k$ can be pre-specified or chosen by finding the optimal low-rank approximation of $\L$.
\item \textbf{DeltaCon similarity \cite{Koutra2016DeltaConPM}}. This graph similarity function is based on the Matusita distance applied to the Fast Belief Propagation graph operators, defined for a graph as $S = [\boldsymbol{I}_n + \epsilon^2 \boldsymbol{D} - \epsilon \boldsymbol{A}]^{-1}$ with $\epsilon > 0$. We use the implementation of this similarity function provided in the python package \textsc{netrd}\footnote{\url{https://netrd.readthedocs.io/en/latest/index.html\#}}.
\item \textbf{Weisfeiler-Lehman (WL) kernel \cite{wlkernel2011}}.
This graph kernel is notably used in the two-sample-test problem for sets of graphs \cite{gretton2008kernel}.
We use the implementation from the GraKel python package \cite{grakel}, and fix the number of iterations of the WL kernel algorithm to 5 in our experiments.
\end{itemize}
We will use the previous baselines in the statistic \eqref{eq:CP_stat} and detect change-points using a threshold chosen on a validation set. We also compare our NCPD pipeline to methods that do not rely on an explicit graph metric for detecting change-points.
\begin{itemize}
\item \textbf{Network change-point detection with spectral clustering (SC-NCPD)} \cite{Cribben2017}. This method first partitions the node set of each snapshot with a spectral clustering algorithm and compute an inner product between averages of spectral features across a backward (or \emph{past}) and a forward (or \emph{future}) windows. In this method, the number of clusters and the lengths of the windows are pre-specified.
\item \textbf{Laplacian anomaly detection (LAD)} \cite{Huang2020}. This method applies both to the anomaly detection and change-point detection tasks for dynamic networks, and is based on the anomaly score
\begin{align*}
Z_t = 1 - |\Tilde{\sigma}_t \sigma_t|,
\end{align*}
where $\sigma_t$ is the vector of top-$k$ singular values of the unormalized Laplacian of the graph $G_t$ and $\Tilde{\sigma}_t$ aggregates (e.g. averages) the top-k singular values of each snapshots in a past window of size $L$, i.e., $(\sigma_{t-L}, \dots, \sigma_{t-1})$.
The number of singular values $k$ and the length of the window are pre-specified hyperparameters.
\item \textbf{Network cumulative sums statistic (CUSUM) \cite{yu2021optimal}.} This method uses a backward and a forward windows of sizes $L'$ to compute a sequence of CUSUM matrices
\begin{align}\label{eq:cusum}
C_t = \frac{1}{\sqrt{2 L'}} \left(\sum_{s=t-L'+1}^t \boldsymbol{A}_s - \sum_{s=t+1}^{t+L'} \boldsymbol{A}_s \right), \quad L' \leq t \leq T - L'.
\end{align}
Following the methodology in \cite{yu2021optimal}, we divide the dynamic network into two samples, $N_A = \{G_{2t}\}_{1 \leq t \leq T/2}$ and $N_B = \{G_{2t-1}\}_{1 \leq t \leq T/2}$, containing the snapshots respectively at even and uneven timestamps. This algorithm monitors two statistics based on the CUSUM matrices \eqref{eq:cusum} of these samples: the Frobenius norm of the Universal Singular Value Threshold (USVT) estimator $\widetilde{B}(t)$ of the CUSUM matrix computed from $N_B$, and the dot product between $\widetilde{B}(t) / \|\widetilde{B}(t)\| $ and the CUSUM matrix computed from $N_A$. To avoid tuning the additional threshold parameters, we do not apply the USVT step (or equivalently choose $\tau_1 = 0$ and $\tau_2 = 1$ in USVT). Moreover, we only use the second statistics since the first one is very close to the next baseline.
\item \textbf{Operator norm of network CUSUM (CUSUM 2) \cite{enikeeva2021changepoint}.} We adapt this offline method to the online problem by computing the CUSUM matrix over a past and future windows of size $L'$.
The NCPD statistics is then $z_t = \|Z_t\|$.
\end{itemize}
For these baselines, we fix the number of clusters or singular values to $k = 6$ and the size of windows to $L'=L/2$ when both the past and future are used in the NCPD statistic. We also note that these methods are applied to non-attributed dynamic networks and therefore only use the sequence of adjacency matrices $(\boldsymbol{A}_t)_t$. However, only one of our network data sets is attributed (see Section \ref{sec:exp_financial}) and in this case, the node attributes are ignored by the baseline methods.
\subsection{Synthetic data}\label{sec:exp_synthetic}
In this section, we generate dynamic networks from a dynamic stochastic block model \cite{zhao2019changepoint, yu2021optimal, Padilla2019, bhattacharjee2020change} with a unique change-point. More precisely, we generate sequences of unattributed graphs $(G_1, \dots, G_T)$ with $T = 100$ such that for each $t \in [T]$, each graph is independently drawn from a Stochastic Block Model (SBM) with $n = 400$ nodes and
\begin{align*}
&G_t \overset{i.i.d}{\sim} \mathcal{G}_1,\quad \text{ if } t < \tau, \\
&G_t \overset{i.i.d}{\sim} \mathcal{G}_2,\quad \text{ if } t \geq \tau,
\end{align*}
where $\mathcal{G}_1, \mathcal{G}_2$ are two SBM distributions. We recall that an SBM with $K \geq 1$ communities can be defined by a connectivity matrix $C = (p - q) I_K + q \mathds{1}_K \mathds{1}_K^T$ with intra- and inter-cluster connectivity parameters $p,q\in [0,1]$, and a membership matrix $\Theta \in \{0,1\}^{n \times K}$. The parameter $p$ (respectively $q$) corresponds to the probability of existence of an edge between two nodes in the same community (respectively in two different communities), while each row $\Theta_i$ of the membership matrix indicates the community a node $n_i$ belongs to.
We consider four different change-point scenarios related to three possible types of events in a community life-cycle \cite{Rossetti_2018}, namely \textbf{``Merge"}, \textbf{``Birth"} and \textbf{``Swaps"}. These community events are illustrated in Figure \ref{fig:adjacencies} by heatmaps of the expected adjacency matrices in $\mathcal{G}_1$ and $\mathcal{G}_2$. We note that in all the following settings, the graph snapshots will be relatively sparse.
\begin{figure}
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth, trim={0cm 0cm 3cm 0cm}, clip]{figures/sbm_sim1_2.png}
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth, trim={0cm 0cm 3cm 0cm}, clip]{figures/sbm_sim2_1.png}
\end{subfigure}
\begin{subfigure}[b]{0.37\textwidth}
\centering
\includegraphics[width=\textwidth, trim={0cm 0cm 0cm 0cm}, clip]{figures/sbm_sim3_2.png}
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth, trim={0cm 0cm 3cm 0cm}, clip]{figures/sbm_sim1_1.png}
\caption{``Merge" scenario.}
\label{fig:b1}
\end{subfigure}
\begin{subfigure}[b]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth, trim={0cm 0cm 3cm 0cm}, clip]{figures/sbm_sim2_2.png}
\caption{``Birth" scenarios.}
\label{fig:b2}
\end{subfigure}
\begin{subfigure}[b]{0.37\textwidth}
\centering
\includegraphics[width=\textwidth, trim={0cm 0cm 0cm 0cm}, clip]{figures/sbm_sim3_1.png}
\caption{``Swap" scenario.}
\label{fig:b3}
\end{subfigure}
\caption{Expectation of the adjacency matrices of the graphs in the SBMs $\mathcal{G}_1$ (first row) and $\mathcal{G}_2$ (second row) , i.e., before and after the change-point, in our three types of synthetic scenarios, ``Merge" (\subref{fig:b1}), ``Birth" (\subref{fig:b2}) and ``Swaps" (\subref{fig:b3}).}
\label{fig:adjacencies}
\end{figure}
\begin{itemize}
\item \textbf{Scenario 1 (``Merge").}
the two SBMs $\mathcal{G}_1$ and $\mathcal{G}_2$ have respectively four and two equal-size clusters with inter-cluster connectivity parameter $q = 0.02$ and intra-cluster connectivity parameter $p > q$ which we vary. We design several difficulty levels of this scenario by changing the value of $p$: the larger $p$ is, the easier the detection problem is.
\item \textbf{Scenario 2 (``Birth 1").}
This scenario mimics the appearance of a community in a dynamic network. In this case, $\mathcal{G}_1$ is the distribution of an Erdos-Renyi model with parameter $q = 0.03$ and $\mathcal{G}_2$ is a SBM with two communities of size $n-s$ and $s$, $1\leq s \leq n/2$, and connectivity matrix
\begin{align*}
C = \begin{pmatrix}
q & q \\
q & p
\end{pmatrix},
\end{align*}
with $p = 0.1$.
We vary the difficulty of this detection scenario by changing the size of the second cluster $s$:
the bigger $s$ is, the easier the detection problem is.
\item \textbf{Scenario 3 (``Birth 2").} This scenario uses the setting of Scenario 2 but in this case, the size of the dense subgraph is fixed to $s = 100$ and the difficulty level is controlled by the connectivity $p$.
\hk{We consider $p > q$ such that the larger} $p$ is, the easier the detection problem.
\item \textbf{Scenario 4 (``Swaps").}
In this scenario, the connectivity parameters of the two SBMs are equal but their membership matrices differ. We simulate a recombination of communities where pairs of nodes exchange their community memberships, i.e., two nodes "swap" their community of attachment. The two SBMs have four equal-size clusters with inter-connectivity parameter $q = 0.05$ and intra-connectivity parameter $p = 0.1$. We test different difficulty levels by varying the proportion $h$ of pairs of nodes swapping their memberships;
the bigger the $h$, the easier the detection problem.
\end{itemize}
Note that Scenario 1 can be considered as a \emph{global} change of the network structure, while the other scenarios correspond to a \emph{local} topological change (i.e., localised on a subset of nodes). For each scenario and each difficulty level, we generate 50 sequences with one change-point uniformly sampled in the interval $[25, 75]$. Moreover, for the pair classification task (see Section \ref{sec:metrics}), in each scenario, we also independently generate 1000 labelled pairs of graphs $\{(G_1^i, G_2^i, y_i)\}_i$, where for each $i$, $G_1^i \sim \mathcal{G}_k, G_2^i \sim \mathcal{G}_l$ with $k,l \in \{1,2\}$ and $y_i = 1$ if $\mathcal{G}_k = \mathcal{G}_l$ and $y_i=0$ otherwise. Each of these data sets of pairs is balanced
and we use respectively 60\%, 20\% and 20\% of the pairs for training, validation and test.
In the NCPD task, we estimate the unique change-point with the detection rule \eqref{eq:loc_single}, and use a window size $L = 6$. Additional details on the experimental setting can be found in Appendix \ref{app:details_exp}.
\begin{figure}
\centering
\begin{subfigure}[b]{0.7\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/classification_merge_simulation1_8_acc.pdf}
\vspace{-5mm}
\caption{Classification accuracy vs the intra-connectivity parameter $p$.}
\label{fig:sc1}
\end{subfigure}
\begin{subfigure}[b]{0.7\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/detection_merge_simulation1_8_diff_0_baselines_window_1.pdf}
\vspace{-5mm}
\caption{Change-point localisation error for different intra-connectivity parameters $p$.}
\label{fig:sc1bis}
\end{subfigure}
\caption{Performances of our s-GNN method and baselines on the classification \label{fig:sc2} and detection \label{fig:sc2bis} tasks in the ``Merge" scenario. The first task consists in classifying pairs of graphs sampled from the same or different SBM distributions using a graph similarity function or a graph distance. The second task consists in localising a single change-point in a dynamic SBM sequence. \mc{We remark that for very large values of $p$, many methods attain zero error.}}
\label{fig:scenario1}
\end{figure}
We test our NCPD method with the four variants of positional encodings (\textbf{Degree}, \textbf{Random Walk}, \textbf{Laplacian} and \textbf{Identity}) defined in Section \ref{sec:sGNN} and report the results of each scenario in Figures \ref{fig:scenario1}, \ref{fig:scenario2}, \ref{fig:scenario2bis} and \ref{fig:scenario3}. In almost all scenarios and difficulty levels, our method outperforms the other baselines, except for the variant with Laplacian attributes. The drop of performance using the latter type of encodings has been previously attributed to the sign ambiguity in Laplacian eigenvectors \cite{dwivedi2022graph}. Moreover, the degree and random walks encodings generally seem to be better than the identity encodings, except for the last scenario. We conjecture that this is due to the fact that in the first three scenarios, nodes in the same cluster are exchangeable in the SBM model, while in the last scenario, this symmetry is broken by the membership exchange mechanism. For networks with a lot of symmetry, the \textbf{Identity} encoding might introduce additional noise.
We also observe that the strongest baselines are CUSUM and CUSUM2, which have better performances if larger window sizes $L$ are used, while our method is not sensitive to this hyperparameter (see Appendix \ref{app:sensitivity}). In particular, our method performs well even for a short history of data and therefore could also detect change-points that are close to each other in a multiple change-point setting. Consequently, these experiments show that using a data-driven graph similarity function leads to better performances in the NCPD task than existing baselines, in various change-point scenarios.
\vspace{-5mm}
\begin{figure}
\centering
\begin{subfigure}[b]{0.7\textwidth}
\centering
\includegraphics[width=\textwidth, trim=0cm 0cm 0cm 0cm , clip]{figures/classification_merge_simulation2_bis_16_acc.pdf}
\vspace{-5mm}
\caption{Classification accuracy of pairs vs the community size $s$.}
\label{fig:sc2}
\end{subfigure}
\begin{subfigure}[b]{0.7\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/detection_merge_simulation2_bis_16_diff_0_baselines_window_1.pdf}
\vspace{-5mm}
\caption{Change point localisation error for different community sizes.}
\label{fig:sc2bis}
\end{subfigure}
\caption{Performances on the classification (\subref{fig:sc2}) and detection (\subref{fig:sc2bis}) tasks in the ``Birth 1" scenario.}
\label{fig:scenario2}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}[b]{0.8\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{figures/classification_merge_simulation2_21_acc.pdf}
\vspace{-3mm}
\caption{Classification accuracy vs the intra-connectivity parameter $p$.}
\label{fig:sc2bis1}
\end{subfigure}
\begin{subfigure}[b]{\textwidth}
\centering
\includegraphics[width=0.75\textwidth]{figures/detection_merge_simulation2_21_diff_0_baselines_window_1.pdf}
\vspace{-3mm}
\caption{Change point localisation error for different intra-connectivity parameters $p$.}
\label{fig:sc2bis2}
\end{subfigure}
\vspace{-3mm}
\caption{Performances on the classification (\subref{fig:sc2bis1}) and detection (\subref{fig:sc2bis2}) tasks in the ``Birth 2" scenario. The first task consists in classifying pairs of graphs sampled from the same or different random graph models using a graph similarity function or a graph distance. The second task consists in localising a single change-point in a dynamic network sequence. \mc{We remark that for very large values of $p$, many methods attain zero error.}}
\label{fig:scenario2bis}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}[b]{0.8\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{figures/classification_merge_simulation3_14_acc.pdf}
\vspace{-3mm}
\caption{Classification accuracy vs the exchange rate $h$.}
\label{fig:sc3}
\end{subfigure}
\hfill
\begin{subfigure}[b]{\textwidth}
\centering
\includegraphics[width=0.75\textwidth]{figures/detection_merge_simulation3_14_diff_0_baselines_window_1.pdf}
\vspace{-3mm}
\caption{Change point localisation error for different exchange rates $h$.}
\label{fig:sc3bis}
\end{subfigure}
\hfill
\vspace{-5mm}
\caption{Performances on the classification (\subref{fig:sc3}) and detection (\subref{fig:sc3bis}) tasks in the ``Swaps" scenario.}
\label{fig:scenario3}
\end{figure}
\FloatBarrier
\subsection{Correlation network from stock returns data} \label{sec:exp_financial}
This data set comprising the cross-correlation networks of daily stock returns, computed over a one-month interval, from the S\&P 500 index in a period of about 20 years (February 2000 - December 2020). Data sets of stock returns have been previously analysed in different contexts. For online NCPD, \cite{yu2021optimal} and \cite{ Barnett2016} consider the covariance matrices of S\&P 500 weekly log-returns respectively on the period between 1950 and 2000, and between 1982 and 2000, while \cite{dubey2021online} analyses the weekly log-returns of 29 stocks from the Dow Jones Industrial Average index, from April 1990 to January 2012. Closely related to our problem, \cite{chakraborti2020phase} and \cite{samal2021network} cluster market behaviours in the USA S\&P 500 and Japan Nikkei 225 stock networks during the period from 1985 to 2016.
In this analysis, we consider 685 stocks (therefore nodes in the dynamic network)
alongside additional information of their economic activity during each month. \mc{The correlation networks are built from the time series of open-to-close (intraday) and close-to-open (overnight) returns. Typically, there are 21 trading days in a calendar month, hence each stock has associated a time series of length 42, since each day of the month contributes with two returns. The resulting stock correlation matrix is the starting point for our network construction. In addition, we employ the following stock properties as node attributes
\begin{itemize}
\item volatility: the standard deviation of the above 42 open-to-close and close-to-open returns, based on which the correlation network was built,
\item volume\_ADV: average daily volume, in shares, over the 21 days of the month,
\item sharesOut\_ADV: average shares outstanding, over the 21 days of the month.
\end{itemize}
}
We then construct an attributed and unweighted dynamic network $\mathcal{G}_{F} = ((\boldsymbol{A}_t, E_t))_{1\leq t \leq 244}$ with 244 snapshots, and for each $t$, $\boldsymbol{A}_t \in \{0,1\}^{685 \times 685}$ and $E_t \in \mathbb{R}^{685 \times 4}$, by truncating the cross-correlation matrices between stocks. More precisely, we set to 1 the matrix entries that are below the 0.1-quantile and above the 0.9-quantile among the entries of all correlation matrices. We note that after this preprocessing step, each graph snapshot is connected and contains self-loops. A similar procedure
has been applied in \cite{yu2021optimal}, while other works transform the correlation matrices into complete weighted graphs, e.g., by squaring the correlation coefficients \cite{chakraborti2020phase} or computing the inverse of the ultra-metric distance \cite{samal2021network}. Here we adopt the sparsifying approach to avoid dealing with a large complete graph.
In Table \ref{tab:stats_tn}, we report some properties of the resulting network. Finally, we standardize the node attributes matrices $\{E_t\}_{1\leq t \leq 244}$ across the timestamps: for each column (i.e. each attribute) and each matrix, we center and scale its values by the mean and standard deviation of all the values of this attribute in the graph snapshots.
Although previous work reported changes in the behaviour of the stock market following different economic or global events \cite{chakraborti2020phase}, there is no ground-truth knowledge of change-points for this dynamic correlation network. However, there is strong evidence that some major events, such as the ones listed in Table \ref{tab:market_events}, have impacted the dynamics of stock returns and their correlation \cite{Barnett2016}.
Therefore, we consider a self-supervised training procedure \cite{liu2021graph} that first pre-estimates a set of change-points in order to train our s-GNN with the procedure described in Section \ref{sec:methodology}.
We first divide our dynamic network into consecutive windows of 50\%, 20\% and 30\% graph snapshots as training, validation and test sequences. Then we pre-estimate change-points in the training and validation sequences using the following methodology.
It is common practice to cluster stocks into market sectors \cite{chakraborti2020phase}, and we conjecture that this cluster structure is reflected in the correlation network and is a proxy for the underlying state of the financial market at a given time. Therefore,
we consider the following three-step procedure:
\begin{enumerate}
\item We estimate a cluster structure for each correlation matrix
using a spectral clustering algorithm based on the Symmetric Signed Laplacian \cite{gallier2016spectral}.
\item We compare the obtained node partitions in each pair of matrices
using the Adjusted Rand Index and use the latter as a pairwise measure of similarity between correlation graphs. Then we apply a spectral clustering algorithm based on the Normalised Symmetric Laplacian on the graph snapshots (i.e., each snapshot is given a label, interpreted as a state or behaviour of the stock market).
\item We estimate change-points by ``smoothing" the snapshots' labels: we compute the centroid timestamp of each cluster of snapshots and relabel the latter with the labels of their closest centroid. These new labels now define a partition of the temporal window into consecutive intervals, and therefore pre-estimate change-points in network training sequence.
\end{enumerate}
In the first step, we cluster each correlation matrix into $k = 13$ clusters; this value is chosen by evaluating the silhouette index of the result clustering for different number of clusters $k \in \{10, \ldots, 20\}$. In the second step, we cluster the similarity matrix between the graph snapshots based on the ARI (see Figure \ref{fig:aris} in Appendix \ref{app:details_exp}) into $C = 9$ clusters. We note that in the first step, the clusters correspond to sets of nodes (i.e., stocks) in each graph, while in the second step, the clusters are sets of graph snapshots. The estimated change-points obtained in the third step are plotted in Figure \ref{fig:preCPS}.
Then for the training set, we sample $N = 3000$ pairs of graphs using the ``Random scheme" (see Section \ref{sec:training}) and for the validation set, we use the ``Windowed scheme" with a window of size 12, which leads to 684 pairs. For choosing the hyperparameters of the s-GNN, we test every configuration of values with the learning rate in the set \hk{$\{ 10^{-5}, 10^{-4}, 10^{-3}, 10^{-2} \},$}
the weight decay in \hk{$\{10^{-6}, 10^{-5}\}$,}
the dropout rate in $\{0.05, 0.2, 0.4\}$, the \hk{output }size of the Sort-$k$ layer in $\{50, 100, 200\}$, the number of hidden units in $\{32, 64, 128\}$\hk{. We} select the \hk{model} with the highest F1-score on the validation set \hk{to make predictions on the test set}.
\begin{table}
\centering
\begin{tabular}{l l l l}
\multicolumn{4}{c}{\textbf{Financial network ($T = 244$, $n = 685$)}} \\
\toprule
& Mean & Median & Standard deviation \\
\toprule
Number of edges per graph & $46.3 \times 10^3$ & $40.3 \times 10^3$ & $23.6 \times 10^3$ \\
Edge density & 0.20 & 0.17 & 0.10 \\
Average degree & 135 & 96 & 111 \\
Average shortest path length & 1.8 & 1.8 & 0.1 \\
Diameter & 2.8 & 3.0 & 0.5 \\
\bottomrule
\end{tabular}
\caption{Mean, median and standard deviation of network statistics for the snapshots in the correlation network of S\&P index stock returns.}
\label{tab:stats_tn}
\end{table}
\begin{table}
\centering
\begin{tabular}{ll} \toprule
Major crashes& Period Date \\ \midrule
9/11 Financial Crisis & 11/09/2001 \\
Stock Market Downturn Of 2002 & 09/10/2002 \\
US Housing Bubble & 2005-2007 \\
Lehman Brothers Crash & 16/09/2008 \\
DJ Flash Crash & 06/05/2010 \\
Tsunami/Fukushima & 11/03/2011 \\
Black Monday / Stock Markets Fall & 08/08/2011 \\
Chinese Black Monday & 24/08/2015 \\
Dow Jones plunge & 02/2018 - 03/2018 \\
WHO public emergency state (COVID-19) & 30/01/2020 \\\bottomrule
\end{tabular}
\caption{Dates of major crashes and bubbles in the USA market.}
\label{tab:market_events}
\end{table}
Finally, we compute our NCPD statistic \eqref{eq:CP_stat} with a window size $L = 6$ over the whole network sequence (i.e., training, validation and test), and qualitatively interpret the time series of its increments $\Delta Z_t(s,L) = |Z_t(s,L) - Z_{t-1}(s,L)|$, plotted in Figure \ref{fig:stats_fin}, alongside the baselines, the SPY and VIX volatility indices and a timeline with the major market events listed in Table \ref{tab:market_events}.
We observe that our detection statistic exhibits some large peaks at several timestamps coinciding or soon after some market events. The biggest peaks appear in August 2007, August 2015, February 2018 and February 2020 and could be associated with the following financial \mcc{events} and world disruptions.
\begin{enumerate}
\item The financial crisis of 2007-2008, which began as early as February 2007 when the stock prices in China and the US dramatically fell.
\item The Chinese Black Monday in August 2015.
\item The Dow Jones index's plunge in February-March 2018.
\item The declaration of \hk{a Public Health Emergency of International Concern} by the World Health Organisation in January 2020 after the emergence of COVID-19.
\end{enumerate}
A secondary peak is also observed in March 2002, which could be a consequence of the 9/11 financial crisis.
In comparison, the baselines are not able to detect as many events. Almost all baselines detect change-points between 2010 and 2012, a period when several financial crashes happened such as the 2010 Dow Jone flash crash,
the Fukushima nuclear incident in March 2011 and the Stock Markets Fall of August 2011. However, most baselines fail to detect anything outside this two-year period. One exception holds for the \textbf{CUSUM 2}, which indicates network disruptions at roughly six periods: during the financial crisis of 2007-2008, Dow Jones Flash Crash in 2010, the Stock Market Fall in 2011, the Chinese Black Monday in 2015, the Dow Jones plunge in 2018 and the consequences of the COVID-19 pandemic in 2020. However, this method delimits some periods of disruptions rather than clear change-points.
\begin{figure}
\centering
\begin{subfigure}[b]{0.95\textwidth}
\centering
\includegraphics[width=\textwidth, trim={0cm 0cm 0cm 0cm}, clip]{figures/fin_data_dsim_comparison.pdf}
\end{subfigure}
\hfill
\caption{Change-point detection statistics obtained with our method and the baselines on the dynamic correlation network of S\&P 500 stock returns from February 2000 to December 2020. This period covers a training period from February 2000 to August 2010, a validation period from September 2010 to October 2014 and a test period from November 2014 to December 2020. Main financial events are indicated with vertical red bars. The different rows correspond, from top to bottom, to a timeline of known market events, our NCPD statistic, the SPY and VIX volatility indices and the baselines' NCPD statistics.}
\label{fig:stats_fin}
\end{figure}
\subsection{Correlation networks from physical activity monitoring}\label{sec:exp_physical}
This public data set\footnote{\url{http://www.pamap.org/demo.html}} was built for benchmarking time series classifiers on physical activity monitoring \cite{reiss2012introducing, reiss2012}. This data contains multivariate time series recorded from eight subjects wearing 3D inertial measurement units (IMUs) and performing a protocol of 12 different physical activities such as sitting, walking, descending and ascending stairs and vacuum cleaning. The time series correspond to measurements from 3 IMUs positioned on the subjects' wrist, chest and ankle and containing 3-axis MEMS sensors (an accelerometer, a gyroscope and a magnetometer) with a sampling period of 0.01s.
Thus, the dimension of the time series is $27$, and there are 8 \hk{time series} in total (one per subject).
Although this data has also been analysed in the change-point detection task for time series \cite{zhang2020correlationaware}, to our knowledge, it has not been used in the context of NCPD. However, previous work noted that the correlations between pairs of axis are particularly useful for differentiating activities based on translations such as walking, running or ascending stairs \cite{reiss2012}. Therefore, similarly to Section \ref{sec:exp_financial}, for each subject (i.e., each multivariate time series), we build a dynamic correlation network from the $27$ time series, where each node therefore corresponds to an IMU sensor's axis and is associated with a body part.
More precisely, we segment the time series into non-overlapping windows of 100 observations (i.e., a window of length one second) and compute the correlation matrices of these time series over these windows. Then, the correlation matrices $\{C_t\}_t$ are transformed into binary adjacency matrices $A_t = \mathds{1}_{|C_t|>\eta}, t \in [T]$ with a chosen threshold $\eta =0.2$. We thus obtain an unweighted, unattributed, dynamic network with 27 nodes for each of the 8 subjects. Moreover, each graph snapshot is labelled with the activity performed by the subject during the corresponding temporal window. Therefore, a change of activity between two consecutive snapshots corresponds to a change-point for the network. Table \ref{tab:act_per_subj} summarises the characteristics of each network.
\begin{table}
\centering
\begin{tabular}{ccccccccccccccc} \toprule
\multirow{2}{*}{Subject} & \multicolumn{12}{c}{Activity performed} & \multirow{2}{*}{\makecell{Number of \\ change points}} & \multirow{2}{*}{\makecell{Number of \\ timestamps}} \\ \cmidrule{2-13}
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 12 & 13 & 16 & 17 & 24 & & \\ \midrule
1 & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & 13 & 2490 \\
2 & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & 13 & 2618 \\
3 & \checkmark & \checkmark & \checkmark & \checkmark & \bf{--} & \bf{--} & \bf{--} & \checkmark & \checkmark & \checkmark & \checkmark & \bf{--} & 10 & 1732 \\
4 & \checkmark & \checkmark & \checkmark & \checkmark & \bf{--} & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \bf{--} & 11 & 2302 \\
5 & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & 13 & 2709 \\
6 & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & 13 & 2487 \\
7 & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \bf{--} & 12 & 2314 \\
8 & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark & 13 & 2606 \\ \bottomrule
\end{tabular}
\caption{Properties of the dynamic networks obtained from the physical activity monitoring data. Some activities are not listed because they have not been performed by any of the subjects in this experiment.}
\label{tab:act_per_subj}
\end{table}
We then define two NCPD tasks to evaluate our method on, defined as follows.
\begin{itemize}
\item \textbf{Individual-level NCPD.} Each dynamic network (subject) is used separately and segmented into train, validation and test set. Then we train and test one s-GNN model per network, therefore the learnt graph similarity function is subject-dependent. We note that in this setting, the test sequence contains graphs with unseen activity labels.
\item \textbf{Cross-individual NCPD.} The eight dynamic networks are combined into a train, validation and test set and we train only one s-GNN model for all sequences. In this case, our method learns only one graph similarity function for all the subjects and its performances evaluated on all of them.
\end{itemize}
More precisely, in the \textbf{Individual-level NCPD} task, we randomly split each dynamic network into 70\% training and validation, and 30\% test, by isolating a test interval and a validation interval. The latter is a window of size 60 centered around a uniformly sampled change-point, while the lower end of the test interval is uniformly sampled in the whole sequence. We then sample 4000 pairs from the training sequence and 1000 pairs from the validation interval, and train and evaluate our method on each subject separately. In the \textbf{Cross-individual NCPD} task, we design the following two evaluation settings.
\begin{enumerate}
\item Random split: we concatenate all the training, validation and test sequences from the previous task, as well as the training and validation sets of pairs. Then we subsample respectively 15000 and 3000 pairs with the \textbf{Random scheme} (see Section \ref{sec:training}). Note that in this case, the s-GNN is trained and tested on sub-sequences from every dynamic network.
\item Leave-one-subject-out (LOSO): in this setting we keep the whole sequence of one subject for testing, and train and validate on the seven remaining sequences. For the latter, we select validation intervals as in the previous task, and sample 3000 training and 1000 validation pairs in each network. Then we subsample 15000 and 3000 pairs from the aggregated training and validation sets.
\end{enumerate}
One can get an insight on the feasibility of these two tasks by looking at (a) the similarity of adjacency matrices within each dynamic network, grouped by activity labels; (b) the similarity of adjacency matrices within the same activity, grouped by network (i.e., subject). We report in Appendix \ref{app:similarity_act} some insights on the dissimilarity between activities and subjects, measured in terms of the Frobenius distance. In Figure \ref{fig:av_corr_0}, we plot the average adjacency matrices in each activity (the average of all matrices corresponding to the same activity) from the first subject. We note that some of these matrices are quite similar, like the ones for activities $\{1,2,3\}$, that correspond respectively to sitting, lying and standing, which are all static activities. In Figure \ref{fig:av_dist_sub_0}, we plot the Frobenius distance between these matrices. We observe that the lowest values of this distance matrix are mostly located on the diagonal, indicating that the graphs that have the same label are more similar to each other than graphs with different labels. In Figure \ref{fig:dist_act}, we represent the Frobenius distances between the graphs of different subjects with the same label, for four activities. We observe that for activities 5 and 7, the distances between matrices of different subjects are bigger than the ones from the same subject, however this difference is not always significant and does not seem to appear for activities 1 and 17. Figure \ref{fig:av_dist_subj} confirms this observation: we note that the average Frobenius distance between the graphs with the same label and from different subjects is smaller than the average distance between graphs with different labels.
For our change-point statistic, we use sliding windows of $L=20$ timestamps. We report the performances of our method and baselines in terms of the adjusted F1-score \cite{xu18} in Table \ref{tab:res_exp1}, with a tolerance window of $\pm 5$ timestamps. Our method has the best performance in most evaluation settings, and largely outperforms the baselines in the LOSO scheme. This latter result seems to indicate that the s-GNN is able to learn a graph similarity function that is generalisable to unseen subjects, while the good performances in the \textbf{Individual-level} task suggests that it can generalise to unseen activities.
\begin{table}
\centering
\begin{tabularx}{\textwidth}{
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X }
\toprule
\multicolumn{6}{c}{\textbf{Individual-level NCPD}} \\
\midrule
Subject & s-GNN-I & Frobenius & SC-NCPD & CUSUM & CUSUM 2 \\
\midrule
1 & 0.76 (0.20) & 0.62 (0.31) & \textbfr{0.82 (0.14)} & 0.54 (0.30) & \textbfb{0.81 (0.20)} \\
2 & \textbfr{0.91 (0.11)} & 0.45 (0.22) & 0.61 (0.08) & 0.45 (0.12) & \textbfb{0.84 (0.11)} \\
3 & \textbfb{0.60 (0.18)} & 0.37 (0.14) & \textbfr{0.67 (0.15)} & 0.21 (0.27) & 0.34 (0.26) \\
4 & \textbfr{0.73 (0.18)} & 0.58 (0.26) & \textbfb{0.70 (0.08)} & 0.60 (0.07) & 0.59 (0.22) \\
5 & \textbfr{0.85 (0.19)} & 0.61 (0.22) & 0.72 (0.16) & 0.36 (0.24) & \textbfb{0.72 (0.13)} \\
6 & \textbfb{0.74 (0.19)} & 0.73 (0.22) & \textbfr{0.75 (0.17)} & 0.56 (0.30) & 0.58 (0.16) \\
7 & \textbfr{0.90 (0.13)} & \textbfb{0.79 (0.19)} & 0.67 (0.35) & 0.57 (0.23) & 0.72 (0.37) \\
8 & 0.72 (0.24) & \textbfr{0.88 (0.13)} & 0.65 (0.14) & 0.57 (0.28) & \textbfb{0.82 (0.13)} \\
\bottomrule
\end{tabularx}
\begin{tabularx}{\textwidth}{
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X
>{\centering\arraybackslash}X }
\toprule
\multicolumn{6}{c}{\textbf{Cross-individual NCPD}} \\
\midrule
Setting & s-GNN-I & Frobenius & SC-NCPD & CUSUM & CUSUM 2 \\
\midrule
Random split & \textbfr{0.81 (0.07)} & 0.75 (0.03) & 0.75 (0.03) & 0.59 (0.12) & \textbfb{0.80 (0.04)} \\
LOSO & \textbfr{0.89 (0.02)} & 0.70 (0.20) & \textbfb{0.77 (0.06)} & 0.62 (0.11) & 0.75 (0.12) \\
\bottomrule
\end{tabularx}
\caption{Adjusted F1-score of our method and baselines in the \textbf{Individual-level} and \textbf{Cross-individual} NCPD tasks on the physical activity monitoring data. \mc{The red, respectively blue, bold values in each row denote the top best, respectively second best, performing methods}. The values in the parentheses denote the standard deviation over 10 repetitions of the random splits train/validation/set, except for the leave-one-subject-out (LOSO) setting for which mean and standard deviation are computed over the 8 folds.}
\label{tab:res_exp1}
\end{table}
\section{Conclusion} \label{sec:discussion}
In this work, we proposed a novel method for detecting change-points in dynamic networks using a data-driven graph similarity function. The latter is learnt by a siamese GNN model, trained and validated on pairs of graphs from the network sequence. This similarity function allows to effectively compare the current graph to its short-term history for detecting potential displacements, with a simple online statistic. We demonstrated the benefits of our method in synthetic experimental settings of dynamic SBMs, and on two real-world data sets of correlation networks, and concluded that our method is more accurate at distinguishing graphs with different generative distributions and detecting change-points, compared to existing baselines.
As previously noted, one main challenge posed by using a deep-learning based model for NCPD is the training and validation procedures, which necessitate either a data set with change-point labels, or an adequate unsupervised or self-supervised learning procedure. Since the former is quite rare, a future direction for this work could to develop the latter approach, for instance using data augmentation strategies \cite{Carmona2021NeuralCA} for introducing artificial change-points in the training set. Another possible extension would be to adapt our framework to more general types of dynamic networks, e.g., snapshots with varying node sets or with missing edges.
\mc{In certain application domains, it may well be the case that change-points phenomena are localized only in certain parts of the network (as considered in some of our synthetic experiments), and are not affecting the global structure}. \mcc{To this end, yet another interesting addition to the current framework is to be able to pinpoint specifically which part of the network is mainly driving the change-point, to enhance explainability.}
\mcc{Finally, extending the methodology to different types of networks, such as directed networks, is an interesting direction to explore, especially in the context of recent work in the literature that encodes various measures of causality or lead-lag associations in multivariate time series as directed graphs \cite{leadLagTS,Runge2017}. The structure of such weighted directed graphs may evolve over time, which motivates the need for techniques for change-point detection, a setting where adapting traditional spectral methods for change-point detection would be challenging, due to the asymmetry of the adjacency matrix.}
| {'timestamp': '2022-03-30T02:31:37', 'yymm': '2203', 'arxiv_id': '2203.15470', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15470'} | arxiv |
\section{Introduction}
\label{sec:intro}
The presence of undesirable biases in computer vision applications is of increasing concern. The evidence shows that large-scale datasets, and the models trained on them, present major imbalances in how different subgroups of the population are represented \cite{excavating,buolamwini2018gender,zhao2017men,burns2018women}. Detecting and addressing these biases, often known as societal biases, has become an active research direction in our community \cite{wang2020revise,yang2020towards,khan2021one,de2019does,stock2018convnets,alvi2018turning,thong2021feature}.
Contrary to popular belief, the presence of bias in datasets is not the only cause of unfairness \cite{d2020data}. Model choices and how the systems are trained also have a large impact on the perpetuation of societal bias. This is supported by evidence: 1) models are not only reproducing the inequalities of the datasets but amplifying them \cite{zhao2017men}, and 2) even when trained on balanced datasets, models may still be biased \cite{wang2019balanced} as the depth of historical discrimination is more profound than what it can be manually annotated, \ie, bias is not always evident to the human annotator eye.
\begin{figure}[t]
\centering
\vspace{-5pt}
\includegraphics[clip, width=0.98\columnwidth]{Copy_of_test_of_First_fig_1.pdf}
\vspace{-5pt}
\caption{Measuring gender bias in MSCOCO captions \cite{chen2015microsoft}. For each caption generated by humans, NIC \cite{vinyals2015show}, or NIC+Equalizer \cite{burns2018women}, we show our proposed bias score for \textit{female} and \textit{male} attributes. This bias score indicates how much a caption is biased toward a certain protected attribute. The contribution of each word to the bias score is shown in gray-scale (bold for the word with the highest contribution). Gender revealing words are masked.}
\label{fig:first}
\end{figure}
The prevalence of accuracy as the single metric to optimize in most popular benchmarks \cite{torralba2011unbiased} has made other aspects of the models, such as fairness, cost, or efficiency, not a priority (and thus, something to not look into). But societal bias is a transversal problem that affects a variety of tasks within computer vision, such as \textit{facial recognition}, with black women having higher error rates than white men \cite{buolamwini2018gender}; \textit{object classification}, with kitchen objects being associated with women with higher probabilities than with men \cite{zhao2017men}; or \textit{pedestrian detection}, with lighter skin individuals showing higher detection rates than darker skin people \cite{wilson2019predictive}. Although the causes of societal bias in different computer vision systems may be simila
, the consequences are particular and require specific solutions for each task.
We examine and quantify societal bias in image captioning (Figure \ref{fig:first}). Image captioning has achieved state-of-the-art accuracy on MSCOCO captions dataset \cite{chen2015microsoft} by means of pre-trained visual and language Transformers \cite{li2020oscar}. By leveraging very large-scale collections of data (\eg, Google Conceptual Captions \cite{sharma2018conceptual} with about 3.3 million image-caption pairs crawled from the Internet), self-attention-based models \cite{vaswani2017attention} have the potential to learn world representations according to the training distribution. However, these large amounts of data, often without (or with minimal) curation, conceal multiple problems, including the normalization of abuse or the encoding of discrimination \cite{excavating,birhane2021multimodal,prabhu2020large}. So, once image captioning models have achieved outstanding performance on evaluation benchmarks, a question arises: are these models safe and fair to everyone?
We are not the first to formulate this question. Image captioning has been shown to reproduce gender \cite{burns2018women} and racial \cite{zhao2021captionbias} bias. By demonstrating the existence of societal bias in image captioning, the pioneering work in \cite{burns2018women} set the indispensable seed to continue to investigate this problem, which we believe is far from being solved. We argue that one of the aspects that remains open is the quantification and evaluation of societal bias in image captioning. So far, a variety of metrics have been applied to assess different aspects of societal bias in human and model-generated captions, such as whether the representation of different subgroups is balanced \cite{burns2018women,zhao2021captionbias} or whether the protected attributes\footnote{\textit{Protected attribute} refers to a demographic variable (age, gender, race, \etc) that a model should not use to produce an output.} values (\eg, \textit{female}, \textit{male}) are correctly predicted \cite{burns2018women,tang2021mitigating}. However, in Section~\ref{sec:analysis}, we show that current metrics may be insufficient, as they only consider the effects of bias perpetuation to a degree.
With the aim to identify and correct bias in image captioning, in Section~\ref{sec:ourmetric}, we propose a simple but effective metric that measures not only how much biased a trained captioning model is, but also how much bias is introduced by the model with respect to the training dataset. This simple metric allows us to conduct a comprehensive analysis of image captioning models in terms of gender and racial bias (Section \ref{sec:evaluation}), with an unexpected revelation: the gender equalizer designed to reduce gender bias in \cite{burns2018women} is actually amplifying gender bias when considering the semantics of the whole caption. This discovery highlights, even more, the necessity of a standard, unified metric to measure bias and bias amplification in image captioning, as the efforts to address societal inequalities will be ineffective without a tool to quantify how much bias a system exhibits and where this bias is coming from. We conclude the paper with an analysis of the limitation of the proposed metric in Section~\ref{sec:limitations} and a summary of the main findings in Section~\ref{sec:conclusion}.
\section{Related work}
\label{sec:relatedwork}
\paragraph{Societal bias in computer vision}
The problem of bias in large-scale computer vision datasets was first raised by Torralba and Efros in \cite{torralba2011unbiased}, where the differences in the image domain between datasets were explored. Each dataset presented different versions of the same object (\eg, cars in Caltech \cite{fei2004learning} tended to appear sidewise, whereas in ImageNet \cite{deng2009imagenet} were predominantly of racing type), impacting cross-dataset generalization. But it was only recently that societal bias in computer vision was formally investigated.
In the seminal work of Buolamwini and Gebru \cite{buolamwini2018gender}, commercial face recognition applications were examined across subgroups, demonstrating that performance was different according to the gender and race of each individual, especially misclassifying women with darker skin tones. Similarly, Zhao \etal \cite{zhao2017men} showed not only that images in MSCOCO \cite{lin2014microsoft} were biased towards a certain gender, but also that action and object recognition models amplified such bias in their predictions. With an increased interest in fairness, multiple methods for mitigating the effects of dataset bias have been proposed \cite{zhao2017men,wang2019balanced,wang2019racial,thong2021feature,jia2020mitigating}.
\vspace{-14pt}
\paragraph{Measuring societal bias}
Societal bias is a problem with multiple layers of complexity. Even on balanced datasets, models still perpetuate bias \cite{wang2019balanced}, indicating that social stereotypes are occurring at the deepest levels of the image. This makes the manual identification and annotation of biases unfeasible. Thus, the first step towards fighting and mitigating bias is to quantify the problem.
Bias quantification metrics have been introduced for image classification. Zhao \etal \cite{zhao2017men} defined bias based on the co-occurrence of objects and protected attributes; Wang \etal \cite{wang2019balanced} relied on the accuracy of a classifier when predicting the protected attributed; and Wang and Russakovsky \cite{wang2021directional} extended the definition of bias by including directionality. In addition, REVISE \cite{wang2020revise} and CIFAR-10S \cite{wang2020towards} ease the task of identifying bias on datasets and models, respectively. These solutions, however, cannot be directly applied to image captioning, so specific methods must be developed.
\vspace{-14pt}
\paragraph{Societal bias in image captioning}
In image captioning \cite{vinyals2015show,xu2015show,you2016image,anderson2018bottom} the input to the model is an image and the output is a natural language sentence. This duality of data modalities makes identifying bias particularly challenging, as it can be encoded in the image and/or in the language. The original work by Burns \etal \cite{burns2018women} showed that captions in MSCOCO \cite{chen2015microsoft} present gender imbalance and proposed an equalizer to force captioning models to produce gender words based on visual evidence. Recently, Zhao \etal \cite{zhao2021captionbias} studied racial bias from several perspectives, including visual representation, sentiment analysis, and semantics.
Each of these studies, however, uses different evaluation protocols and definitions of bias, lacking of a standard metric. To fill this gap, we propose an evaluation metric to measure not only how biased a model is, but how much it is amplified with respect to the original (biased) dataset.
\section{Analysis of fairness metrics}
\label{sec:analysis}
Bias in image captioning has been estimated using different methods: how balanced the prediction of the protected attributed is~\cite{burns2018women}, the overlap of attention maps with segmentation annotations~\cite{burns2018women}, or the difference in accuracy between the different protected attributes~\cite{zhao2021captionbias}. In this section, we thoroughly examine existing fairness evaluation metrics and their shortcomings when applied to image captioning.
\vspace{-14pt}
\paragraph{Notation}
Let $\mathcal{D}$ denote the training split of a certain vision dataset with samples $(I, y, a)$, where $I$ is an image, $y$ is the ground-truth annotation for a certain task, and $a \in \mathcal{A}$ is a protected attribute in set $\mathcal{A}$. The validation/test split is denoted by $\mathcal{D}'$. We assume there is a model $M$ that makes prediction $\hat{y}$ associated with this task from the image, \ie, $\hat{y} = M(I)$. For image captioning, we define a ground-truth caption $y = (y_1, y_2, \dots, y_n)$ as a sequence of $n$ tokens
\subsection{Fairness metrics in image captioning}
\paragraph{Difference in performance} A natural strategy to show bias in image captioning is as the difference in performance between the subgroups of a protected attribute, in terms of accuracy~\cite{burns2018women,tang2021mitigating,zhao2021captionbias}, ratio~\cite{burns2018women}, or sentiment analysis~\cite{zhao2021captionbias}. Quantifying the existence of different behavior according to demographic groups is essential to demonstrate the existence of bias in a model, but it is insufficient for a deeper analysis, as it does not provide information on where the bias comes from, and whether bias is being amplified by the model. Thus, it is good practice to accompany difference in performance with other fairness metrics.
\vspace{-14pt}
\paragraph{Attribute misclassification} Another common metric is to check if the protected attribute has been correctly predicted in the generated caption \cite{burns2018women,tang2021mitigating}. This assumes that the attribute can be clearly identified in a sentence, which may be the case for some attributes, \eg, age (\textit{a young person}, \textit{a child}) or gender (\textit{a woman}, \textit{a man}), but not for others, \eg, skin tone. This is critical for two reasons: 1) even when the attribute is not clearly mentioned in a caption, bias can occur through the use of different language to describe different demographic groups; and 2) it only considers the prediction of the protected attribute, ignoring the rest of the sentence which may also exhibit bias.
\vspace{-14pt}
\paragraph{Right for the right reasons} Introduced in \cite{burns2018women}, it measures whether the attention activation maps when generating a protected attribute word $w$ in the caption, \eg, \textit{woman} or \textit{man}, are located in the image region where the evidence about the protected attribute is found, \ie, the person.
This metric quantifies the important task of whether $w$ is generated based on the person visual evidence or, on the contrary, on the visual context, which has been shown to be one of the sources of bias in image captioning models. However, it has three shortcomings: 1) it needs a shortlist of protected attribute words, and a person segmentation map per image, which may not always be available; 2) it assumes that visual explanations can be generated from the model, which may not always be the case; and 3) it does not consider the potential bias in the rest of the sentence, which (as we show in Section \ref{sec:evaluation}) is another critical source of bias.
\vspace{-14pt}
\paragraph{Sentence classification} Lastly, Zhao \etal \cite{zhao2021captionbias} introduced the use of sentence classifiers for analyzing racial bias. The reasoning is that if a classifier can distinguish between subgroups in the captions, the captions contain bias. Formally, let $f$ denote a classifier that predicts a protected attribute in $\mathcal{A}$ trained over $\mathcal{D}$, \ie, $\hat{a} = f(y)$, from a caption $y$ in an arbitrary set $\mathcal{H}$ of captions. If the accuracy is higher than the chance rate, $y$ is considered to be biased:
\begin{equation}
\text{SC} = {1 \over |\mathcal{H}|} \sum_{y \in \mathcal{H}} \mathbb{1}[ f(y) = a ],
\end{equation}
where $\mathbb{1}[\cdot]$ is a indicator function that gives $1$ when the statement provided as the argument holds true and $0$ otherwise. $\mathcal{H}$ typically is the set of all captions generated from the images in the test/validation split $\mathcal{D}'$ of the dataset, \ie, $\mathcal{H} = \{M(I) \mid I \in \mathcal{D}'\}$.
Unlike the previous methods, this metric considers the full context of the caption. However, a major shortcoming is that, when bias exists on the generated data, the contributing source is not identified. Whether the bias comes from the model or from the training data and whether bias is being amplified or not, cannot be concluded.
\subsection{Bias amplification metrics}
There is a family of metrics designed to measure bias amplification on visual recognition tasks. We describe them and analyze the challenges when applied to captioning.
\vspace{-14pt}
\paragraph{Bias amplification}
Proposed in \cite{zhao2017men}, it quantifies the implicit correlations between model prediction $\hat{y} = M(I)$ and the protected attribute $a \in \mathcal{A}$ by means of co-occurrence, and whether these correlations are more prominent in the model predictions or in the training data. Let $\mathcal{L}$ denote the set of possible annotations $l$ in the given task, \ie, $y$ and $\hat{y}$ are in $\mathcal{L}$; $c_{a}$ and $\hat{c}_{a}$ denote the numbers of co-occurrences of $a$ and $l$, counted over $y$ and $\hat{y}$, respectively. Bias is
\begin{equation}
\tilde{b}_{al} = \frac{\tilde{c}_{al}}{\sum_{a \in \mathcal{A}} \tilde{c}_{al}},
\end{equation}
where $\tilde{c}$ is either $c$ or $\hat{c}$, and $\tilde{b}$ is either $b$ or $\hat{b}$, respectively.
Then, bias amplification is defined by
\begin{equation}
\text{BA} = \frac{1}{|\mathcal{L}|}\sum_{a \in \mathcal{A}, l \in \mathcal{L}} (\hat{b}_{al} - b_{al} ) \times \mathbb{1}\left[b_{al} > \frac{1}{|\mathcal{A}|}\right].
\label{eq:bia}
\end{equation}
$\text{BA} > 0$ means that bias is amplified by the model, and otherwise mitigated. This metric is useful for a classification task, such as action or image recognition, for which the co-occurrence can be easily counted. However, one of the major shortcomings is that it ignores that protected attributes may be imbalanced in the dataset, \eg, in MSCOCO images \cite{lin2014microsoft} there are $2.25$ more men than women, which causes most of objects to be correlated with men. To solve this and other issues, Wang and Russakovsky \cite{wang2021directional} proposed an extension called directional bias amplification.
\vspace{-14pt}
\paragraph{Leakage} Another way to quantify bias amplification is leakage \cite{wang2019balanced}, which relies on the existence of a classifier to predict the protected attribute $a$. For a sample $(I, y, a)$ in $\mathcal{D}$ with a ground-truth annotation $y$, a classifier $f$ predicts the attribute $a \in \mathcal{A}$ from either $y$ or $\hat{y} = M(I)$. Using this, the leakage can be formally defined as,
\begin{equation}
\text{Leakage} = \lambda_M - \lambda_D, \label{eq:leakage}
\end{equation}
where
\begin{align}
\lambda_D &= {1 \over {|\mathcal{D}|} } \sum_{(y, a) \in \mathcal{D}} \mathbb{1} [ f(y) = a ] \label{eq:leakage1}\\
\lambda_M &= {1 \over {|\mathcal{D}|} } \sum_{(I, a) \in \mathcal{D}} \mathbb{1} [ f(\hat{y}) = a ] \label{eq:leakage2}
\end{align}
A positive leakage indicates that $M$ amplifies the bias with respect to the training data, and mitigates it otherwise.
\vspace{-14pt}
\paragraph{Challenges} The direct application of the above metrics to image captioning presents two major challenges. Let us first assume that, for image captioning, the set of words in the vocabulary
corresponds to the set $\mathcal{L}$ of annotations in Eq.~(\ref{eq:bia}) under a multi-label setting. The first challenge is that these metrics do not consider the semantics of the words: \eg, in the sentences \textit{a woman is cooking} and \textit{a woman is making dinner}, the tokens \textit{cooking} and \textit{making dinner} would be considered as different annotation $l$. The second challenge is they do not consider the context of each word/task: \eg, the token \textit{cooking} will be seen as the same task in the sentence \textit{a man is cooking} and in \textit{a man is not cooking}.
\section{Bias amplification for image captioning}
\label{sec:ourmetric}
We propose a metric
to specifically measure bias amplification in image captioning models, borrowing some ideas from sentence classification \cite{zhao2021captionbias} and leakage \cite{wang2019balanced}. Our metric, named LIC, is built on top of the following hypothesis:
\begin{quote}
\textbf{\textit{Hypothesis 1}.} In an unbiased set of captions, there should not exist differences between how demographic groups are represented.
\end{quote}
\paragraph{Caption masking} As discussed in Section \ref{sec:analysis}, for some protected attributes (\eg, age and gender), specific vocabulary may be explicitly used in the captions. For example, consider \textit{gender} as a binary\footnote{Due to the availability of annotations in previous work, in this paper we use the binary simplification of gender, acknowledging that it is not inclusive and should be addressed in future work.} protected attribute $a$ with possible values $\{\textit{female}, \textit{male}\}$. The sentence
\begin{quote}
\centering
A girl is playing piano,
\end{quote}
directly reveals the protected attribute value of the caption, \ie, \textit{female}. To avoid explicit mentions to the protected attribute value, we preprocess captions by masking the words related to that attribute.\footnote{A list of attribute-related words is needed for each protected attribute.} The original sentence is then transformed to the masked sentence
\begin{quote}
\centering
A \colorbox{black}{girl} is playing piano.
\end{quote}
Note that this step is not always necessary, as some protected attributes are not explicitly revealed in the captions.
\vspace{-14pt}
\paragraph{Caption classification}
We rely on a sentence classifier $f_s$ to estimate societal bias in captions. Specifically, we encode each masked caption $y'$ \footnote{If caption masking is not applied, $y' = y$.} with a natural language encoder $E$ to obtain a sentence embedding $e$, as $e = E(y')$. Then, we input $e$ into the sentence classifier $f_s$, whose aim is to predict the protected attribute $a$ from $y'$ as
\begin{equation}
\hat{a} = f_s(E(y'))
\end{equation}
$E$ and $f_s$ are learned on a training split $\mathcal{D}$. According to \textit{Hypothesis 1}, in an unbiased dataset, the classifier $f_s$ should not find enough clues in $y'$ to predict the correct attribute $a$. Thus, $\mathcal{D}$ is considered to be biased if the empirical probability $p(\hat{a} = a)$ over $\mathcal{D}$ is greater than the chance rate.
\vspace{-14pt}
\paragraph{Bias amplification}
Bias amplification is defined as the bias introduced by a model with respect to the existing bias in the training set. To measure bias amplification, we quantify the difference between the bias in the generated captions set $\hat{\mathcal{D}} = \{\hat{y} = M(I) \mid I \in \mathcal{D}\}$ with respect to the bias in the original captions in the training split $\mathcal{D}$.
One concern with this definition, particular to image captioning, is the difference in the vocabularies used in the annotations and in the predictions, due to 1) the human generated captions typically come with a richer vocabulary, 2) a model's vocabulary is rather limited, and 3) the vocabulary itself can be biased. Thus, naively applying Eq.~(\ref{eq:leakage}) to image captioning can underestimate bias amplification. To mitigate this problem, we introduce noise into the original human captions until the vocabularies in the two sets (model generated and human generated) are aligned. Formally, let $\mathcal{V}_\text{ann}$ and $\mathcal{V}_\text{pre}$ denote the vocabularies identified for all annotations and predictions in the training set, respectively. For the annotation $y = (y_1, \dots, y_N)$, where $y_n$ is the $n$-th word in $y$, we replace all $y_n$ in $\mathcal{V}_\text{ann}$ but not in $\mathcal{V}_\text{pre}$ with a special out-of-vocabulary token to obtain perturbed annotations $y^\star$, and we train the classifier $f_s^\star$ over $\{y^\star\}$.
\vspace{-14pt}
\paragraph{The LIC metric} The confidence score $s_a^\star$ is an intermediate result of classifier $f_s^\star$, \ie,
\begin{equation}
\hat{a} = f_s^\star(y^\star) = \text{argmax}_a s^\star_a(y^\star),
\end{equation}
and it can be interpreted as a posterior probability $p(\hat{a} = a \mid y^\star)$ of the protected attribute $a$ and can give an extra hint on how much $y^\star$ is biased toward $a$. In order words, not only the successful prediction rate is important to determine the bias, but also how confident the predictions are. The same applies to $\hat{s}_a$ and $\hat{f}_s$ trained with $\{\hat{y}\}$. We incorporate this information into the Leakage for Image Captioning metric (LIC), through
\begin{align}
\text{LIC}_D &= {1 \over {|\mathcal{D}|} } \sum_{(y^\star, a) \in \mathcal{D}} s^\star_a(y^\star) \mathbb{1} [ f^\star(y^\star) = a ] \label{eq:lic_leakage1}\\
\text{LIC}_M &= {1 \over {|\hat{\mathcal{D}}|} } \sum_{(\hat{y}, a) \in \hat{\mathcal{D}}} \hat{s}_a(\hat{y}) \mathbb{1} [ \hat{f}(\hat{y}) = a ], \label{eq:lic_leakage2}
\end{align}
so that LIC is finally computed as
\begin{equation}
\text{LIC} = \text{LIC}_M - \text{LIC}_D.
\end{equation}
where a model is considered to amplify bias if $\text{LIC} > 0$. We refer to $\hat{s}_a$ as the \textit{bias score}.
\section{Experiments}
\label{sec:evaluation}
\paragraph{Data} Experiments are conducted on a subset of the MSCOCO captions dataset \cite{chen2015microsoft}. Specifically, we use the images with binary gender and race annotations from \cite{zhao2021captionbias}: \textit{female} and \textit{male} for gender, \textit{darker} and \textit{lighter} skin tone for race.\footnote{Similarly, due to the availability of annotations in previous work, we use a binary simplification for race and skin tone. We acknowledge that these attributes are much more complex in reality.} Annotations are available for images in the validation set with person instances, with a total of $10,780$ images for gender and $10,969$ for race. To train the classifiers, we use a balanced split with equal number of images per protected attribute value, resulting in $5,966$ for training and $662$ for test in gender, and $1,972$ for training and $220$ for test in race. Other metrics are reported on the MSCOCO val set.
\vspace{-14pt}
\paragraph{Metrics} We report bias using LIC, together with LIC$_D$ in Eq.~(\ref{eq:lic_leakage1}) and LIC$_M$ in Eq.~(\ref{eq:lic_leakage2}). For gender bias, we also use Ratio~\cite{burns2018women}, Error~\cite{burns2018women}, Bias Amplification (BA)~\cite{zhao2017men}, and Directional Bias Amplification~\cite{wang2021directional}. Directional bias amplification is computed for object $\rightarrow$ gender direction (DBA$_G$) and for gender $\rightarrow$ object direction (DBA$_O$) using MSCOCO objects \cite{lin2014microsoft}. For skin tone, we only use LIC, LIC$_D$, and LIC$_M$, as there are no words we can directly associated with race in the captions to calculate the other metrics. Accuracy is reported in terms of standard metrics BLEU-4~\cite{papineni2002bleu}, CIDEr~\cite{vedantam2015cider}, METEOR~\cite{denkowski2014meteor}, and ROUGE-L~\cite{lin2004rouge}.
\vspace{-14pt}
\paragraph{Models} We study bias on captions generated by the following models: NIC~\cite{vinyals2015show}, SAT~\cite{xu2015show}, FC~\cite{rennie2017self}, Att2in~\cite{rennie2017self}, UpDn~\cite{anderson2018bottom}, Transformer~\cite{vaswani2017attention}, OSCAR~\cite{li2020oscar}, NIC+~\cite{burns2018women}, and NIC+Equalizer~\cite{burns2018women}. NIC, SAT, FC, Att2in, and UpDn are classical CNN~\cite{lecun2015deep} encoder-LSTM~\cite{hochreiter1997long} decoder models. Transformer and OSCAR are Transformer-based~\cite{vaswani2017attention} models, which are the current state-of-the-art in image captioning. NIC+ is a re-implementation of NIC in \cite{burns2018women} trained on the whole MSCOCO and additionally trained on MSCOCO-Bias set consisting of images of male/female. NIC+Equalizer is NIC+ with a gender bias mitigation loss, that forces the model to predict gender words only based on the region of the person. Note that most of the pre-trained captioning models provided by the authors are trained on the Karpathy split \cite{karpathy2015deep}, which uses both train and validation splits for training. As the val set is part of our evaluation, we retrain all the models on the MSCOCO train split only.
\begin{figure}[t]
\centering
\vspace{-5pt}
\includegraphics[clip, width=0.98\columnwidth]{score_dist_1.pdf}
\vspace{-5pt}
\caption{Gender bias score for captions generated with OSCAR. Masked captions are encoded with a LSTM and fed into a gender classifier. Bias score correlates with typical gender stereotypes.}
\label{fig:score_dist}
\end{figure}
\vspace{-14pt}
\paragraph{LIC metric details}
For masking, we replace pre-defined gender-related words\footnote{The list of gender-related words can be found in the appendix.} with a special token \texttt{$<$gender$>$}. We do not mask any words for race prediction because race is not commonly explicitly mentioned in the captions.
The LIC classifier is based on several fully-connected layers on top of a natural language encoder. For the encoder, we use a LSTM \cite{hochreiter1997long} for our main results. We do not initialize the LSTM with pre-computed word embeddings, as they contain bias \cite{bolukbasi2016man,dev2019attenuating}. For completeness, we also report LIC when using BERT \cite{evlin2018bert}, although it has also been shown to exhibit bias \cite{bhardwaj2021investigating,bender2021dangers} and it can affect our metric. BERT is fine-tuned (BERT-ft) or used as is (BERT-pre). The classifier is trained $10$ times with random initializations, and the results are reported by the average and standard deviation.
\definecolor{colbest}{rgb}{0.1, 0.6, 0.1}\
\definecolor{colworst}{rgb}{0.75, 0, 0}
\begin{table*}[t]
\renewcommand{\arraystretch}{1.1}
\setlength{\tabcolsep}{5pt}
\small
\centering
\caption{Gender bias and accuracy for several image captioning models. \textcolor{colworst}{Red}/\textcolor{colbest}{green} denotes the worst/best score for each metric. For bias, lower is better. For accuracy, higher is better. BA, DBA$_G$, and DBA$_O$ are scaled by $100$. Unbiased model is LIC$_M = 25$ and $\text{LIC} = 0$.}
\begin{tabularx}{0.93\textwidth}{@{}l r r r r r r r c r r r r@{}}
\toprule
& \multicolumn{7}{c}{Gender bias $\downarrow$} & & \multicolumn{4}{c}{Accuracy $\uparrow$} \\ \cline{2-8} \cline{10-13}
Model & LIC & LIC$_M$ & Ratio & Error & BA & DBA$_G$ & DBA$_O$ & & BLEU-4 & CIDEr & METEOR & ROUGE-L \\
\midrule
NIC \cite{vinyals2015show} & \textcolor{colbest}{\textbf{3.7}} & \textcolor{colbest}{\textbf{43.2}} & 2.47 & \textcolor{colworst}{\textbf{14.3}} & 4.25 & 3.05 & \textcolor{colbest}{\textbf{0.09}} & & \textcolor{colworst}{\textbf{21.3}} & \textcolor{colworst}{\textbf{64.8}} & \textcolor{colworst}{\textbf{20.7}} & \textcolor{colworst}{\textbf{46.6}}\\
SAT \cite{xu2015show} & 5.1 & 44.4 & 2.06 & 7.3 & 1.14 & 3.53 & 0.15 & & 32.6 & 98.3 & 25.8 & 54.1\\
FC \cite{rennie2017self} & 8.6 & 46.4 & 2.07 & 10.1 & 4.01 & \textcolor{colworst}{\textbf{3.85}} & 0.28 & & 30.5 & 98.0 & 24.7 & 53.5\\
Att2in \cite{rennie2017self} & 7.6 & 45.9 & 2.06 & 4.1 & \textcolor{colbest}{\textbf{0.32}} & 3.60 & \textcolor{colworst}{\textbf{0.29}} & & 33.2 & 105.0 & 26.1 & 55.6\\
UpDn \cite{anderson2018bottom} & 9.0 & 48.0 & 2.15 & 3.7 & 2.78 & 3.61 & 0.28 & & 36.5 & 117.0 & 27.7 & 57.5\\
Transformer \cite{vaswani2017attention} & 8.7 & 48.4 & 2.18 & 3.6 & 1.22 & 3.25 & 0.12 & & 32.3 & 105.3 & 27.0 & 55.1\\
OSCAR \cite{li2020oscar} & 9.2 & 48.5 & 2.06 & \textcolor{colbest}{\textbf{1.4}} & 1.52 & 3.18 & 0.19 & & \textcolor{colbest}{\textbf{40.4}} & \textcolor{colbest}{\textbf{134.0}} & \textcolor{colbest}{\textbf{29.5}} & \textcolor{colbest}{\textbf{59.5}}\\
NIC+ \cite{burns2018women} & 7.2 & 46.7 & \textcolor{colworst}{\textbf{2.89}} & 12.9 & \textcolor{colworst}{\textbf{6.07}} & \textcolor{colbest}{\textbf{2.08}} & 0.17 & & 27.4 & 84.4 & 23.6 & 50.3\\
NIC+Equalizer \cite{burns2018women} & \textcolor{colworst}{\textbf{11.8}} & \textcolor{colworst}{\textbf{51.3}} & \textcolor{colbest}{\textbf{1.91}} & 7.7 & 5.08 & 3.05 & 0.20 & & 27.4 & 83.0 & 23.4 & 50.2\\
\bottomrule
\end{tabularx}
\label{tab:genderbias}
\end{table*}
\begin{figure*}[h!]
\centering
\includegraphics[width = 0.88\textwidth]{gender_bubbles.pdf}
\vspace{-10pt}
\caption{LIC vs. Vocabulary size (left) and BLEU-4 score (right). The size of each bubble indicates the BLEU-4 score (left) or the vocabulary size (right). Score tends to decrease with largest vocabularies, but increase with more accurate BLEU-4 models, whereas NIC+Equalizer \cite{burns2018women} is presented as an outlier. The dotted lines indicate the tendency, $R^2=0.153$ (left) and $R^2=0.156$ (right).}
\label{fig:bubble}
\end{figure*}
\begin{table*}[t]
\renewcommand{\arraystretch}{1.1}
\setlength{\tabcolsep}{5pt}
\small
\centering
\caption{Gender bias scores according to LIC, LIC$_M$, and LIC$_D$ for several image captioning models. Captions are encoder with LSTM, BERT-ft, or BERT-pre. Unbiased model is LIC$_M = 25$ and $\text{LIC} = 0$. It shows that LIC is consistent across different language models.}
\begin{tabularx}{0.92\textwidth}{@{}l c c r c c c r c c c r@{}}
\toprule
& \multicolumn{3}{c}{LSTM} & & \multicolumn{3}{c}{BERT-ft} & & \multicolumn{3}{c}{BERT-pre} \\ \cline{2-4} \cline{6-8} \cline{10-12}
Model & $\text{LIC}_M$ & $\text{LIC}_D$ & LIC & & $\text{LIC}_M$ & $\text{LIC}_D$ & LIC & & $\text{LIC}_M$ & $\text{LIC}_D$ & LIC \\
\midrule
NIC \cite{vinyals2015show} & 43.2 $\pm$ 1.5 & 39.5 $\pm$ 0.9 & \textcolor{colbest}{\textbf{3.7}} & & 47.2 $\pm$ 2.3 & 48.0 $\pm$ 1.2 & \textcolor{colbest}{\textbf{-0.8}} & & 43.2 $\pm$ 1.3 & 41.3 $\pm$ 0.9 & \textcolor{colbest}{\textbf{1.9}}\\
SAT \cite{xu2015show} & 44.4 $\pm$ 1.4 & 39.3 $\pm$ 1.0 & 5.1 & & 48.0 $\pm$ 1.1 & 47.7 $\pm$ 1.4 & 0.3 & & 44.4 $\pm$ 1.5 & 41.5 $\pm$ 0.8 & 2.9 \\
FC \cite{rennie2017self} & 46.4 $\pm$ 1.2 & 37.8 $\pm$ 0.9 & 8.6 & & 48.7 $\pm$ 1.9 & 45.8 $\pm$ 1.3 & 2.9 & & 46.8 $\pm$ 1.4 & 40.4 $\pm$ 0.8 & 6.4\\
Att2in \cite{rennie2017self} & 45.9 $\pm$ 1.1 & 38.3 $\pm$ 1.0 & 7.6 & & 47.8 $\pm$ 2.0 & 46.7 $\pm$ 1.4 & 1.1 & & 45.9 $\pm$ 1.2 & 40.9 $\pm$ 0.9 & 5.0\\
UpDn \cite{anderson2018bottom} & 48.0 $\pm$ 1.3 & 39.0 $\pm$ 0.9 & 9.0 & & 52.0 $\pm$ 1.0 & 47.3 $\pm$ 1.4 & 4.7 & & 48.5 $\pm$ 1.0 & 41.5 $\pm$ 0.9 & 7.0\\
Transformer \cite{vaswani2017attention} & 48.4 $\pm$ 0.8 & 39.7 $\pm$ 0.9 & 8.7 & & 54.1 $\pm$ 1.2 & 48.2 $\pm$ 1.1 & 5.9 & & 47.7 $\pm$ 1.2 & 42.2 $\pm$ 0.9 & 5.5\\
OSCAR \cite{li2020oscar} & 48.5 $\pm$ 1.5 & 39.3 $\pm$ 0.8 & 9.2 & & 52.5 $\pm$ 1.8 & 47.6 $\pm$ 1.2 & 4.9 & & 48.1 $\pm$ 1.1 &41.1 $\pm$ 0.9 & 7.0\\
NIC+ \cite{burns2018women} & 46.7 $\pm$ 1.2 & 39.5 $\pm$ 0.6 & 7.2 & & 49.5 $\pm$ 1.4 &47.7 $\pm$ 1.5 & 1.8 & & 46.4 $\pm$ 1.2 & 41.0 $\pm$ 0.9 & 5.4 \\
NIC+Equalizer \cite{burns2018women} & 51.3 $\pm$ 0.7 & 39.5 $\pm$ 0.9 & \textcolor{colworst}{\textbf{11.8}} & & 54.8 $\pm$ 1.1 & 47.5 $\pm$ 1.4 & \textcolor{colworst}{\textbf{7.3}} & & 49.5 $\pm$ 0.7 & 40.9 $\pm$ 0.9 & \textcolor{colworst}{\textbf{8.6}}\\
\bottomrule
\end{tabularx}
\label{tab:lstm-bert}
\end{table*}
\subsection{LIC analysis}
\label{sec:score_exp}
We qualitatively analyze the LIC metric to verify whether it is consistent with human intuition. We generate captions in the test set with OSCAR, mask the gender-related words, and encode the masked captions with a LSTM classifier to compute LIC bias score, $\hat{s}_a$, for the gender attribute, as formulated in Section~\ref{sec:ourmetric}. Then, we manually inspect the captions and their associated bias score.
Figure~\ref{fig:score_dist} shows generated captions with higher, middle, and lower bias scores. The bias score assigned to each caption matches typical gender stereotypes. For example, the third caption from the top, ``a \colorbox{black}{aa} in a white dress holding an umbrella'', yields a very high bias score for \textit{female}, probably due to the stereotype that the people who wear dresses and holds umbrellas tend to be women. On the contrary, the bottom caption, ``a baseball player throwing a ball on a field'', with one of the lowest scores assigned to \textit{female}, perpetuates the stereotype that baseball players are mostly men.
Additionally, when inspecting the captions with a bias score around 0.5, we see that the descriptions tend to be more neutral and without strong gender stereotypes. This support the importance of including $s_a^\star$ and $\hat{s}_a$ in the LIC computation, as in Eqs.~(\ref{eq:lic_leakage1}) and (\ref{eq:lic_leakage2}).
\subsection{Quantification of gender bias}
\label{sec:gender_exp}
We evaluate the gender bias of different captioning models in terms of LIC together with adaptations of existing bias metrics. For BA, we use the top $1,000$ common words in the captions as $\mathcal{L}$, whereas for $\text{DBA}_G$ and $\text{DBA}_O$, we use MSCOCO objects \cite{lin2014microsoft}. More details can be found in the appendix. Results are shown in Table~\ref{tab:genderbias}. We also show the relationship between the quality of a caption, in terms of vocabulary and BLEU-4 score, with LIC in Figure~\ref{fig:bubble}. Finally, we compare LIC when using different language encoders in Table~\ref{tab:lstm-bert}. The main observations are summarized below.
\textbf{\emph{Observation 1.1.} All the models amplify gender bias.} In Table~\ref{tab:genderbias}, all the models have a LIC$_M$ score well over the unbiased model (LIC$_M = 25$), with the lowest score being $43.2$ for NIC. When looking at LIC, which indicates how much bias is introduced by the model with respect to the human captions, also all the models exhibit bias amplification, again with NIC having the lowest score. NIC is also the model that performs the worst in terms of accuracy, which provides some hints about the relationship between accuracy and bias amplification (\textit{Observation 1.4}).
\textbf{\emph{Observation 1.2.} Bias metrics are not consistent.} As analyzed in Section~\ref{sec:analysis}, different metrics measure different aspects of the bias, so it is expected to produce different results, which may lead to different conclusions. Nevertheless, all the models show bias in all the metrics except Ratio (Table~\ref{tab:genderbias}). However, the relationship between the bias and the models presents different tendencies. For instance, NIC+Equalizer shows the largest bias in LIC (\textit{Observation 1.3}) while Att2in has the largest bias in $\text{DBA}_O$.
\textbf{\emph{Observation 1.3.} NIC+Equalizer increases gender bias with respect to the baseline.}
One of the most surprising findings is that even though NIC+Equalizer successfully mitigates gender misclassification when compared to the baseline NIC+ (Error: $12.9 \rightarrow 7.7$ in Table~\ref{tab:genderbias}), it actually increases gender amplification bias by $+4.6$ in LIC. This unwanted side-effect may be produced by the efforts of predicting gender correctly according to the image. As shown in Figure~\ref{fig:first}, NIC+Equalizer tends to produce words that, conversely, are strongly associated with that gender, even if they are not in the image. Results on $\text{DBA}_O$ support this reasoning, revealing that given a gender, NIC+Equalizer rather produces words correlated with that gender.
\textbf{\emph{Observation 1.4.} LIC tends to increase with BLEU-4, and decrease with vocabulary size.}
Figure~\ref{fig:bubble} shows that larger the vocabulary, the lower the LIC score. This implies that the variety of the words used in the captions is important to suppress gender bias.
As per accuracy, we find that the higher the BLEU-4, the larger the bias tends to be. In other words, even though better models produce better captions, they rely on encoded clues that can identify gender.
\textbf{\emph{Observation 1.5.} LIC is robust against encoders.}
In Table~\ref{tab:lstm-bert}, we explore how the selection of language models affects the results of LIC, LIC$_M$, and LIC$_D$ when using LSTM, BERT-ft, and BERT-pre encoders. Although BERT is known to contain gender bias itself, the tendency is maintained within the three language models: NIC shows the least bias, whereas NIC+Equalizer shows the most.
\subsection{Quantification of racial bias}
\label{sec:race_exp}
Results for racial bias when using LSTM as encoder are reported in Table~\ref{tab:race}, leading to the following observations.
\textbf{\emph{Observation 2.1.} All the models amplify racial bias.}
As with gender, all models exhibits $\text{LIC}>0$. The magnitude difference of racial bias between the models is smaller than in the case of gender (the standard deviation of LIC among the models is $2.4$ for gender and $1.3$ for race). This indicates that racial bias is amplified without much regard to the structure or performance of the model. In other words, as all the models exhibit similar tendencies of bias amplification, the problem may not only be on the model structure itself but on how image captioning models are trained.
\textbf{\emph{Observation 2.2.} Racial bias is not as apparent as gender bias.}
$\text{LIC}_M$ scores in Table~\ref{tab:race} are consistently smaller than in Table~\ref{tab:lstm-bert}. The mean of the $\text{LIC}_M$ score of all the models is $47.0$ for gender and $33.7$ for race, which is closer to the random chance.
\textbf{\emph{Observation 2.3.} NIC+Equalizer does not increase racial bias with respect to the baseline.}
Unlike for gender bias, NIC+Equalizer does not present more racial bias amplification than NIC+. This indicates that forcing the model to focus on the human area to predict the correct gender does not negatively affect other protected attributes.
\begin{table}[t]
\renewcommand{\arraystretch}{1.1}
\setlength{\tabcolsep}{7pt}
\small
\centering
\caption{Racial bias scores according to LIC, LIC$_M$, and LIC$_D$. Captions are not masked and are encoder with LSTM.}
\begin{tabularx}{0.42\textwidth}{@{}l c c r@{}}
\toprule
Model & LIC$_M$ & LIC$_D$ & LIC \\
\midrule
NIC \cite{vinyals2015show} & 33.3 $\pm$ 1.9 & 27.6 $\pm$ 1.0 & 5.7\\
SAT \cite{xu2015show} & 31.3 $\pm$ 2.3 & 26.8 $\pm$ 0.9 & \textcolor{colbest}{\textbf{4.5}} \\
FC \cite{rennie2017self} & 33.6 $\pm$ 1.0 & 26.0 $\pm$ 0.8 & 7.6 \\
Att2in \cite{rennie2017self} & 35.2 $\pm$ 2.3 & 26.6 $\pm$ 0.9 & \textcolor{colworst}{\textbf{8.6}} \\
UpDn \cite{anderson2018bottom} & 34.4 $\pm$ 2.1 & 26.6 $\pm$ 0.9 & 7.8 \\
Transformer \cite{vaswani2017attention} & 33.3 $\pm$ 2.3 & 27.2 $\pm$ 0.8 & 6.1 \\
OSCAR \cite{li2020oscar} & 32.9 $\pm$ 1.8 & 27.0 $\pm$ 1.0 & 5.9 \\
NIC+ \cite{burns2018women} & 34.9 $\pm$ 1.5 & 27.3 $\pm$ 1.2 & 7.6 \\
NIC+Equalizer \cite{burns2018women} & 34.5 $\pm$ 2.8 & 27.3 $\pm$ 0.8 & 7.2 \\
\bottomrule
\end{tabularx}
\label{tab:race}
\end{table}
\subsection{Visual and language contribution to the bias}
\label{sec:where_exp}
As image captioning is a multimodal task involving visual and language information, bias can be introduced by the image, the language, or both. Next, we investigate which modality contributes the most to gender bias by analyzing the behavior when using partially masked images.
We define three potential sources of bias: 1) the objects being correlated with the gender \cite{zhao2017men,wang2019balanced,wang2021directional}, 2) the gender of the person in the image \cite{burns2018women}, and 3) the language model itself \cite{bender2021dangers,bolukbasi2016man}. To examine them, we mask different parts of the image accordingly: 1) the object that exhibits the highest correlation with gender according to the BA metric, 2) the person, 3) both of the correlated objects and the person. We analyze SAT \cite{xu2015show} and OSCAR \cite{li2020oscar} as representative models of classical and state-of-the-art captioning, respectively. The details of the experiments can be found in the appendix.
$\text{LIC}_M$ scores are shown in Table~\ref{tab:source}.
\textbf{\emph{Observation 3.1.} The contribution of objects to gender bias is minimal.}
Results \textit{w/o object} show that masking objects do not considerably mitigate gender bias in the generated captions. Compared to the original $\text{LIC}_M$, the score decreases only $-1.5$ for SAT, and $-2.3$ for OSCAR, concluding that objects in the image have little impact to the gender bias in the final caption.
\textbf{\emph{Observation 3.2.} The contribution of people to gender bias is higher than objects.}
Results \textit{w/o person} show that by masking people in the images, we can reduce bias significantly compared to when hiding objects, indicating that regions associated with humans are the primary source of gender bias among the contents in the image.
\textbf{\emph{Observation 3.3.} Language models are a major source of gender bias.}
Results \textit{w/o both} show that even when the gender-correlated objects and people are removed from the images, the generated captions have a large bias ($\Delta_\text{Unbias}$ is $+12.2$ for SAT, $+14.0$ for OSCAR). This indicates that the language model itself is producing a large portion of the bias. To reduce it, it may not be enough to only focus on the visual content, but efforts should also be focused on the language model. Figure~\ref{fig:masks} shows the generated captions and their bias score when images are partly masked.
\begin{table}[t]
\renewcommand{\arraystretch}{1.1}
\setlength{\tabcolsep}{6pt}
\small
\centering
\caption{Gender bias results with partially masked images. $\Delta_\text{Unbias}$ shows the difference with respect to a non-biased model (LIC$_M = 25.0$), and $\Delta_\text{Original}$ with respect to the non-masked case.}
\begin{tabularx}{0.98\columnwidth}{@{}l l c r r @{}}
\toprule
Model & Image & $\text{LIC}_M$ & $\Delta_\text{Unbias}$ & $\Delta_\text{Original}$\\
\midrule
SAT \cite{xu2015show} & Original & $44.4 \pm 1.4$ & $+19.4$ & $0.0$\\
& w/o object & $42.9 \pm 1.6$ & $+17.9$ & $-1.5$ \\
& w/o person & $39.1 \pm 1.4$ & $+14.1$ & $-5.3$\\
& w/o both & $37.2 \pm 0.8$ & $+12.2$ & $-7.2$\\
\midrule
OSCAR \cite{li2020oscar} & Original & $48.5 \pm 1.5$ & $+23.2$ & $0.0$\\
& w/o object & $46.2 \pm 1.3$ & $+21.2$ & $-2.3$\\
& w/o person & $39.7 \pm 1.3$ & $+14.7$ & $-8.8$\\
& w/o both & $39.0 \pm 1.5$ & $+14.0$ & $-9.5$\\
\bottomrule
\end{tabularx}
\label{tab:source}
\end{table}
\begin{figure}[h]
\centering
\includegraphics[width = 0.98\columnwidth]{Copy_of_Copy_of_mask_ex_3.pdf}
\vspace{-3pt}
\caption{Generated captions and bias scores when images are partly masked. The bias score does not decrease when the object (bicycle) and the person (man) are masked.}
\label{fig:masks}
\end{figure}
\section{Limitations}
\label{sec:limitations}
In Section~\ref{sec:analysis}, we analyzed multiple fairness metrics and their limitations when applied to image captioning. We proposed LIC with the aim to overcome these limitations and unify the evaluation of societal bias in image captioning. However, LIC also presents several limitations.
\vspace{-14pt}
\paragraph{Annotations} LIC needs images to be annotated with their protected attribute. Annotations are not only costly, but may also be problematic. For example, the classification of race is controversial and strongly associated with the cultural values of each annotator~\cite{khan2021one}, whereas gender is commonly classified as a binary $\{\textit{female}, \textit{male}\}$ attribute, lacking inclusiveness with non-binary and other-gender realities.
\vspace{-14pt}
\paragraph{Training} A classifier needs to be trained to make predictions about the protected attributes. The initialization of the model and the amount of training data may impact on the final results. To mitigate this stochastic effect, we recommended to report results conducted on multiple runs.
\vspace{-14pt}
\paragraph{Pre-existing bias} The language encoder may propagate extra bias into the metric if using pretrained biased models, \eg, word embeddings or BERT. To avoid this, we recommend as much random weight initialization as possible.
\section{Conclusion}
\label{sec:conclusion}
This paper proposed LIC, a metric to quantify societal bias amplification in image captioning. LIC is built on top of the idea that there should not be differences between how demographic subgroups are described in captions. The existence of a classifier that predicts gender and skin tone from generated captions more accurately than from human captions, indicated that image captioning models amplify gender and racial bias. Surprisingly, the gender equalizer designed for bias mitigation presented the highest gender bias amplification, highlighting the need of a bias amplification metric for image captioning.
\vspace{-14pt}
\paragraph{Acknowledgements}
Work partly supported by JST CREST Grant No.~JPMJCR20D3, JST FOREST Grant No.~JPMJFR216O, and JSPS KAKENHI, Japan.
{\small
\bibliographystyle{ieee_fullname}
\section{Experimental details}
\label{sec:details}
In this section, we provide the details for the experiments.
\subsection{LIC metric training details}
We evaluate three classifiers for LIC (LSTM, BERT-ft, and BERT-pre). Their details and hyperparameters can be found below.
All the classifiers are trained with Adam~\cite{kingma2014adam}.
\begin{itemize}
\item \textbf{LSTM. } A two-layer bi-directional LSTM~\cite{hochreiter1997long} with a fully-connected layer on top. Weights are initialized randomly and training is conducted on the training set for $20$ epochs, with learning rate $5 \times10^{-5}$.
\item \textbf{BERT-ft. } BERT-base \cite{evlin2018bert} Transformer with two fully-connected layers with Leaky ReLU activation on top. All the weights are fine-tuned while training. Training is conducted for $5$ epochs with learning rate $1 \times 10^{-5}$.
\item \textbf{BERT-pre. } Same architecture as BERT-ft. Only the last fully-connected layers are fine-tuned, whereas BERT weights are frozen. Training is conducted for $20$ epochs with learning rate $5 \times 10^{-5}$.
\end{itemize}
\subsection{Other metrics details}
Details for computing BA, $\text{DBA}_G$, and $\text{DBA}_O$ metrics.
\begin{itemize}
\item \textbf{BA. } We use nouns, verbs, adjectives, and adverbs of the top $1,000$ common words in the captions as $\mathcal{L}$ and calculate the co-occurrence of the gender words and the common words in the captions. As \cite{zhao2017men}, we filter the words that are not strongly associated with humans by removing words that do not occur with each gender at least $100$ times in the ground-truth captions, leaving a total of $290$ words.
\item \textbf{$\text{DBA}_G$ and $\text{DBA}_O$. }
Let $p$ denote the probability calculated by the (co-)occurrence. The definition of $\text{DBA}_G$ and $\text{DBA}_O$ \cite{wang2021directional} is:
\begin{equation}
\text{DBA} = \frac{1}{|\mathcal{L}| |\mathcal{A}|}\sum_{a \in \mathcal{A}, l \in \mathcal{L}} y_{al} \Delta_{al} + (1 - y_{al}) (-\Delta_{al})
\end{equation}
\begin{equation}
y_{al} = \mathbb{1}\left[p(a,l) > p(a) p(l)\right]
\end{equation}
\begin{equation}
\Delta_{al} = \left\{
\begin{array}{ll}
\hat{p}(a|l) - p(a|l) & \text{for} \ \text{DBA}_G \\
\hat{p}(l|a) - p(l|a) & \text{for} \ \text{DBA}_O
\end{array}
\right.
\end{equation}
For $\text{DBA}_G$, we use the MSCOCO objects \cite{lin2014microsoft} annotated on the images as $\mathcal{L}$ and gender words in the captions as $\mathcal{A}$.
For $\text{DBA}_O$, we use the MSCOCO objects \cite{lin2014microsoft} in the captions as $\mathcal{L}$ and gender annotations \cite{zhao2021captionbias} as $\mathcal{A}$.
\end{itemize}
\definecolor{colbest}{rgb}{0.1, 0.6, 0.1}\
\definecolor{colworst}{rgb}{0.75, 0, 0}
\begin{table*}[t]
\renewcommand{\arraystretch}{1.1}
\setlength{\tabcolsep}{4pt}
\small
\centering
\caption{Racial bias scores according to LIC, LIC$_M$, and LIC$_D$ for several image captioning models. Captions are encoder with LSTM, BERT-ft, or BERT-pre. Unbiased model is LIC$_M = 25$ and $\text{LIC} = 0$.}
\begin{tabularx}{0.87\textwidth}{@{}l c c r c c c r c c c r@{}}
\toprule
& \multicolumn{3}{c}{LSTM} & & \multicolumn{3}{c}{BERT-ft} & & \multicolumn{3}{c}{BERT-pre} \\ \cline{2-4} \cline{6-8} \cline{10-12}
Model & LIC$_M$ & LIC$_D$ & LIC & & LIC$_M$ & LIC$_D$ & LIC & & LIC$_M$ & LIC$_D$ & LIC \\
\midrule
NIC \cite{vinyals2015show} & 33.3 $\pm$ 1.9 & 27.6 $\pm$ 1.0 & 5.7 & & 37.0 $\pm$ 3.0 & 36.7 $\pm$ 1.1 & \textcolor{colbest}{\textbf{0.3}} & & 34.7 $\pm$ 2.1 & 33.6 $\pm$ 1.2 & 1.1\\
SAT \cite{xu2015show} & 31.3 $\pm$ 2.3 & 26.8 $\pm$ 0.9 & \textcolor{colbest}{\textbf{4.5}} & & 38.1 $\pm$ 2.7 & 36.5 $\pm$ 1.4 & 1.6 & & 33.9 $\pm$ 1.5 & 33.3 $\pm$ 1.3 & \textcolor{colbest}{\textbf{0.6}}\\
FC \cite{rennie2017self} & 33.6 $\pm$ 1.0 & 26.0 $\pm$ 0.8 & 7.6 & & 40.4 $\pm$ 2.4 & 36.4 $\pm$ 1.6 & 4.0 & & 36.9 $\pm$ 2.2 & 32.6 $\pm$ 1.2 & \textcolor{colworst}{\textbf{4.3}}\\
Att2in \cite{rennie2017self} & 35.2 $\pm$ 2.3 & 26.6 $\pm$ 0.9 & \textcolor{colworst}{\textbf{8.6}} & & 40.4 $\pm$ 2.0 & 36.1 $\pm$ 1.2 & \textcolor{colworst}{\textbf{4.3}} & & 36.8 $\pm$ 1.9 & 32.7 $\pm$ 1.1 & 4.1\\
UpDn \cite{anderson2018bottom} & 34.4 $\pm$ 2.1 & 26.6 $\pm$ 0.9 & 7.8 & & 40.2 $\pm$ 1.7 & 36.9 $\pm$ 1.2 & 3.3 & & 36.5 $\pm$ 2.5 & 33.2 $\pm$ 1.2 & 3.3 \\
Transformer \cite{vaswani2017attention} & 33.3 $\pm$ 2.3 & 27.2 $\pm$ 0.8 & 6.1 & & 39.4 $\pm$ 1.7 & 37.4 $\pm$ 1.3 & 2.0 & & 36.2 $\pm$ 2.2 & 34.1 $\pm$ 1.2 & 2.1 \\
OSCAR \cite{li2020oscar} & 32.9 $\pm$ 1.8 & 27.0 $\pm$ 1.0 & 5.9 & & 39.4 $\pm$ 2.3 & 36.9 $\pm$ 0.9 & 2.5 & & 35.5 $\pm$ 2.5 & 32.9 $\pm$ 1.1 & 2.6 \\
NIC+ \cite{burns2018women} & 34.9 $\pm$ 1.5 & 27.3 $\pm$ 1.2 & 7.6 & & 39.5 $\pm$ 2.6 & 37.1 $\pm$ 1.3 & 2.4 & & 36.8 $\pm$ 2.4 & 33.6 $\pm$ 1.3 & 3.2\\
NIC+Equalizer \cite{burns2018women} & 34.5 $\pm$ 2.8 & 27.3 $\pm$ 0.8 & 7.2 & & 38.7 $\pm$ 3.1 & 36.6 $\pm$ 1.3 & 2.1 & & 36.0 $\pm$ 2.2 & 33.4 $\pm$ 1.4 & 2.6 \\
\bottomrule
\end{tabularx}
\label{tab:race}
\end{table*}
\subsection{Image masking}
Here, we explain how we masked objects and people in the images to estimate the contribution of each modality to the bias.
\begin{itemize}
\item \textbf{SAT}~\cite{xu2015show} uses grid-based deep visual features \cite{jiang2020defense} extracted by ResNet \cite{he2016deep}. Thus, we directly mask the objects, people, or both in the images using segmentation mask annotations, and feed the images into the captioning model to generate captions.
\item \textbf{OSCAR}~\cite{li2020oscar} leverages region-based deep visual features \cite{anderson2018bottom} extracted by a Faster-RCNN \cite{ren2016faster}. Therefore, instead of masking the objects, people, or both in the images, we remove the region-based features whose bounding box overlaps with the ground truth bounding by more than $50$ percent.
\end{itemize}
\section{List of gender-related words}
\label{sec:list-words}
We list the gender-related words that are replaced with the special token when inputting to gender classifiers:
\textcolor{orange}{woman}, \textcolor{orange}{female}, \textcolor{orange}{lady}, \textcolor{orange}{mother}, \textcolor{orange}{girl}, \textcolor{orange}{aunt},
\textcolor{orange}{wife}, \textcolor{orange}{actress}, \textcolor{orange}{princess}, \textcolor{orange}{waitress}, \textcolor{orange}{sister}, \textcolor{orange}{queen}, \textcolor{orange}{pregnant}, \textcolor{orange}{daughter}, \textcolor{orange}{she}, \textcolor{orange}{her},
\textcolor{orange}{hers}, \textcolor{orange}{herself}, \textcolor{olive}{\textit{man}}, \textcolor{olive}{\textit{male}}, \textcolor{olive}{\textit{father}}, \textcolor{olive}{\textit{gentleman}}, \textcolor{olive}{\textit{boy}}, \textcolor{olive}{\textit{uncle}}, \textcolor{olive}{\textit{husband}}, \textcolor{olive}{\textit{actor}}, \textcolor{olive}{\textit{prince}}, \textcolor{olive}{\textit{waiter}}, \textcolor{olive}{\textit{son}}, \textcolor{olive}{\textit{brother}}, \textcolor{olive}{\textit{guy}}, \textcolor{olive}{\textit{emperor}}, \textcolor{olive}{\textit{dude}}, \textcolor{olive}{\textit{cowboy}}, \textcolor{olive}{\textit{he}}, \textcolor{olive}{\textit{his}}, \textcolor{olive}{\textit{him}}, \textcolor{olive}{\textit{himself}} and their plurals. \textcolor{orange}{Orange}/\textcolor{olive}{\textit{Olive}} denotes feminine/masculine words used to calculate Ratio, Error, BA, and $\text{DBA}_G$.
\section{Visual examples}
\label{sec:examples}
\begin{figure*}[t]
\centering
\vspace{10pt}
\includegraphics[clip, width=0.92\textwidth]{Copy_of_appendix_of_First_fig_2.pdf}
\vspace{10pt}
\caption{For each caption generated by humans or the models evaluated in the paper, we show our proposed bias score for \textit{female} and \textit{male} attributes. The contribution of each word to the bias score is shown in gray-scale (bold for the word with the highest contribution). Gender related words are masked during training and testing.}
\label{fig:all}
\vspace{10pt}
\end{figure*}
\begin{figure*}[t]
\centering
\vspace{10pt}
\includegraphics[width = 0.65\textwidth]{appendix_of_First_fig_1.pdf}
\vspace{10pt}
\caption{Measuring gender bias in MSCOCO captions \cite{chen2015microsoft}. For each caption generated by humans, NIC \cite{vinyals2015show}, or NIC+Equalizer \cite{burns2018women}, we show our proposed bias score for \textit{female} and \textit{male} attributes. The contribution of each word to the bias score is shown in gray-scale (bold for the word with the highest contribution). Gender related words are masked during training and testing.}
\label{fig:malebias}
\end{figure*}
\begin{figure*}[t]
\centering
\vspace{10pt}
\includegraphics[width = 0.65\textwidth]{mask_ex_4.pdf}
\vspace{10pt}
\caption{Generated captions and bias scores when images are partly masked.}
\label{fig:mask}
\end{figure*}
Here, we show more visual examples that could not be included in the main paper due to space limitations. Figure~\ref{fig:all} shows generated captions and their bias score for all the models evaluated in the main paper. Additionally, Figure~\ref{fig:malebias} shows more examples where NIC+Equalizer produces words strongly associated with gender stereotypes even when the evidence is not contained in the image. Whereas in the main paper we showed samples for women, here we show samples for men. It can be seen that NIC+Equalizer generates male-related words (\eg, \textit{suit}, \textit{tie}), and thus, obtain a higher bias score. We also show additional examples when images are partly masked in Figure~\ref{fig:mask}. The generated caption when the person (man) and the most correlated object (bicycle) are masked still contains a large bias score towards male.
\section{Additional results}
\label{sec:moreresults}
We compare LIC for race when using different language encoders in Table~\ref{tab:race}. As with gender bias, the results show that LIC is consistent across different language models.
\section{Potential negative impact}
\label{sec:impact}
A potential negative impact of the use of the LIC metric to evaluate societal bias in image captioning is that researchers and computer vision practitioners may underestimate the bias and their impact in their models. Although it is important to have a tool to measure societal bias in computer vision models, we need to note that none metric can ensure the actual amount of bias. In other words, even if LIC (or any other metric) is small, or even zero, the model may still be biased. Therefore, relying on a single metric may overlook the problem.
Additionally, whereas we use the value of LIC as the amount of bias amplification on a model, the definition of bias is different among existing work. As there is no standard definition of bias for image captioning, we should notice that our method is, perhaps, not the most appropriate one for all the contexts, and researchers should carefully consider which metric to use according to each application.
{\small
\bibliographystyle{ieee_fullname}
| {'timestamp': '2022-03-30T02:28:10', 'yymm': '2203', 'arxiv_id': '2203.15395', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15395'} | arxiv |
\section{Introduction}
In network topology inference, the goal is to identify the network structure from the collected signals, which plays a vital role in many applications \cite{dong2019learning,yang2020network,mateos2019connecting}. In most existing research \cite{vosoughi2020large,zhang2014topology,sharma2019communication}, the network topology was inferred based on a complete set of observed data for all the entities of interest.
However, many real-world applications suffer from
the partial observability problem. For example, when investigating a social network with millions of members, only a limited number of observed nodes are available \cite{matta2020graph,wai2019community}. Thus, it is necessary to study the network topology inference based on partial observations, (see Fig. \ref{fig1}). Since the inference performance is affected by the missing observations \cite{omidshafiei2017deep,segarra2017network,santos2018consistent,santos2020local}, network topology
inference is challenging when the signals of the hidden nodes are not observed.
Several works formulated partially observed network topology inference as sparse or convex optimization problems \cite{chandrasekaran2010latent,buciulea2019network}. Recently, the problem of general network topology inference using Erd\H{o}s-R\'{e}nyi
(ER) models \cite{erdHos1959random} under partial observability was considered in \cite{matta2018consistent}. Moreover, some attractive estimators, such as the Granger, one-lag, and residual estimators, were proposed in \cite{matta2018consistent,matta2019graph}. Furthermore, it was proven that these estimators can be used to recover the subgraph of observed network nodes when the network size grows.
Inspired by the estimators proposed in \cite{matta2019graph},
we propose an efficient unbiased symmetric matrix estimator to infer the network topology under partial observability.
Compared with the work in \cite{matta2019graph}, we focus on the case in which the network is undirected and therefore the associated adjacency matrix is symmetric, and the network has a fixed size.
The major technical contributions of this work are summarized as follows.
\begin{itemize}
\item An unbiased matrix estimator for symmetric combination matrices is proposed when incomplete graph signals are produced by the vector autoregression (VAR) model. Moreover, under the settings of Gaussian noise and Laplacian combination rule, we prove that the unbiased estimator converges to the network combination matrix in probability as the number of samples increases.
\item Experiments show the entries of
the unbiased matrix estimator follow a Gaussian mixture distribution. Thus, by exploiting this discovery, a node pair clustering based on the Gaussian mixture model (GMM) algorithm rather than the K-means algorithm \cite{hartigan1979algorithm} is used.
\item The proposed unbiased estimator is effective in obtaining a better initialization for the GMM. Combining the unbiased estimator with the node pair clustering, we propose an efficient network inference method called the network inference Gauss (NIG) algorithm. Simulations show that the NIG algorithm performs better than the current methods in the case of small sample sizes.
\end{itemize}
\begin{figure}[h]
\centering
\includegraphics[width=0.6\linewidth]{figure/AQ-illu-eps-converted-to}
\caption{Illustration of the network inference under partial observability.}
\label{fig1}
\end{figure}
\textbf{Notations:} The total number of network nodes is denoted by $N$, and the number of samples on each node is $n$.
For an $N\times N$ matrix ${\bf Z}$, the submatrix spanning the rows and columns of ${\bf Z}$ indexed by set $S\subset\{1,\dots,N\}$ is denoted by ${\bf Z}_{S}.$ The fraction of the observed nodes is denoted as $\xi = \frac{|S|}{N},$ where $|S|$ represents the cardinality of the set $S$. Finally, ${\bf I}$ denotes the identity matrix.
\section{Problem Formulation}
We consider an undirected
random network, such as ER and Barabási–Albert (BA) random graphs, with $N$ nodes.
At time $t$, each node $k$ collects the output signal ${\bf y}_t(k)$ according to the following network diffusion process (i.e., running a VAR model) \cite{matta2020graph}
\begin{align}\label{va1}
y_{t+1}(k)=\sum_{j=1}^{N}A_{kj}y_{t}(j)+\mu x_{t+1}(k),
\end{align}
where $x_{t}(k)$ is the input signal, $\mu\in(0,1)$ is the corresponding weighting coefficient and is assumed to be known.
Here, $x_{t}(k)$ for $t=1,\dots,n$ are assumed to be independent and identically distributed (i.i.d.) standard normal random variables, i.e., $x_{t}(k)\sim \mathcal N (0,1).$ The $N\times N$ matrix with entries $A_{kj}$ is denoted as the network combination matrix ${\bf A}$ that satisfies the following assumption.
\begin{assumption}\label{Assu1}
The network combination matrix ${\bf A}$ is symmetric and obtained by applying the Laplacian
combination rule \cite{matta2018consistent}: $$
A_{k j}= \begin{cases}G_{kj}(1-\mu) \frac{\lambda}{d_{\max }}, & k \neq j, \\ (1-\mu)-\sum_{z \neq k} A_{k z}, & k=j,\end{cases}
$$
where $\lambda$ is a parameter with $\lambda\leq1$, $G_{kj}$ is the entry of matrix ${\bf G}$, which is the adjacency matrix of the undirected random network, the degree of the $k$-th node is defined as $d_k=1+\sum_{z\neq k}G_{kz}$, and $d_{\max }$ is the maximum degree of matrix ${\bf G}$.
\end{assumption}
Since the network combination matrix ${\bf A}$ depends on the adjacency matrix ${\bf G}$, it also represents the network topology structure. Specifically, $A_{kj}$ equals 0 if the $k$-th node disconnects from the $j$-th node, and $A_{kj}$ is a positive number $(1-\mu)\frac{\lambda} {d_{\max }}$, if the $k$-th node connects with the $j$-th node.
By stacking the input and output signals across the network at time $t$, equation \eqref{va1} is rewritten as
\begin{equation}\label{stack}
{\bf y}_{t+1} = {\bf A}{\bf y}_{t} + \mu{\bf x}_{t+1},
\end{equation}
where ${\bf y}_{t}\triangleq[y_{t}(1),\dots,y_{t}(N)]$, ${\bf x}_{t}\triangleq[x_{t}(1),\dots,x_{t}(N)]\in \mathbb{R}^N$.
Assume that only a subset of the network nodes can be monitored. The monitored set is denoted as $S\subset\{1,\dots,N\}$. We only receive a partial output signal $[{\bf y}_t]_S\triangleq \{y_{t}(k)|k\in S\}$. However, according to \eqref{stack}, the observed signals are influenced by the hidden nodes.
In network topology inference, the goal is to estimate the partial combination matrix ${\bf A}_{S}$ and recover the partial adjacency matrix ${\bf G}_S$ by the data monitored $[{\bf y}_t]_S$.
\section{Main Results}
This section derives an unbiased estimator for ${\bf A}_S$ and a new node pair clustering based on the GMM method. Finally, we present the NIG algorithm to infer the network topology.
\subsection{An Unbiased Estimator of Matrix ${\bf A}_S$}
First, by summing up ${\bf x}_t$ in \eqref{stack} from 0 to $t$ with the assumption ${\bf y}_0=\mu{\bf x}_0$, $x_{0}(k)\sim \mathcal N (0,1)$ for any $k$, we obtain
\begin{equation}\label{sum}
{\bf y}_{t} = \mu\sum_{j=0}^t {\bf A}^{t-j}{\bf x}_{j}.
\end{equation}
Multiplying both sides of equation \eqref{stack} by
${\bf y}_{t}^{T}$ and taking the expectations, we obtain
\begin{equation}\label{VAR_change}
\mathbb{E}[{\bf y}_{t+1}{\bf y}_{t}^T] = {\bf A}\mathbb{E}[{\bf y}_{t}{\bf y}_{t}^T]+\mu\mathbb{E}[{\bf x}_{t+1}{\bf y}_{t}^T].
\end{equation}
Since ${\bf x}_j$, $j=0,\ldots,t+1,$ are i.i.d., according to \eqref{sum}, we obtain $\mathbb{E}[{\bf x}_{t+1}{\bf y}_{t}^T]=0.$
Then equation \eqref{VAR_change} is equivalent to
\begin{equation}\label{AR}
{\bf R}_1(t)={\bf A}{\bf R}_0(t),
\end{equation}
where ${\bf R}_1(t)=\mathbb{E}[{\bf y}_{t+1}{\bf y}_{t}^T]$ and ${\bf R}_0(t)=\mathbb{E}[{\bf y}_{t}{\bf y}_{t}^T].$
Substituting (\ref{sum}) into ${\bf R}_0(t)$ yields
\begin{align}
\nonumber{\bf R}_0(t)&=\mu^2\mathbb{E}\Big[\Big(\sum_{j=0}^{t} {\bf A}^{t-j}{\bf x}_{j}\Big)\Big(\sum_{j=0}^{t} {\bf A}^{t-j}{\bf x}_{j}\Big)^T\Big]\\
\label{eqn: R_0}&=\mu^2({\bf I}+{\bf A}^{2}+\dots+{\bf A}^{2t}),
\end{align}
where the last equality comes from the i.i.d. property and unit variance of the random variables ${\bf x}_{t}$.
Using (\ref{AR}), we obtain
\begin{align}
\label{eqn: R_1}{\bf R}_1(t) = \mu^2({\bf A}+{\bf A}^{3}+\dots+{\bf A}^{2t+1}).
\end{align}
\begin{remark}
Inspired by the residual estimator in \cite{matta2019graph} and using \eqref{eqn: R_0}-\eqref{eqn: R_1}, we can nullify
the error arising from higher-order powers to obtain the combination matrix ${\bf A}$ by subtraction between ${\bf R}_1(t)$ and ${\bf A}^3{\bf R}_0(t-1)$, which helps us to design an unbiased estimator for the partial combination matrix ${\bf A}_S$.
\end{remark}
Since ${\bf y}_{t}$ is an $N\times1$ vector for any $t$, we propose an $N\times N$ estimator of the matrix ${\bf A}$ at time $t$:
\begin{equation}\label{un}
{\bf A}^u(t) = \frac{1}{\mu^2}({\bf y}_{t+1}{\bf y}_{t}^T-{\bf y}_{t+2}{\bf y}_{t-1}^T),
\end{equation}
and denote
$[{\bf A}^{u}(t)]_S$ as the submatrix of ${\bf A}^{u}(t)$, which is
\begin{align}
\nonumber[{\bf A}^u(t)]_S &= \frac{1}{\mu^2}\Big([{\bf y}_{t+1}{\bf y}_{t}^T]_S-[{\bf y}_{t+2}{\bf y}_{t-1}^T]_S\Big)\\
\label{uns}&= \frac{1}{\mu^2}\Big([{\bf y}_{t+1}]_S[{\bf y}_{t}^T]_S-[{\bf y}_{t+2}]_S[{\bf y}_{t-1}^T]_S\Big),
\end{align}
where the last equality uses the property of the block matrix product.
Equation \eqref{uns} reveals that the estimator $[{\bf A}^u(t)]_S$ can be obtained by the observed signals.
It is worth noting that the performance of the proposed estimator also depends on the
hidden nodes, see Remark 2.
Next, we show that the proposed estimator benefits from the following property.
\begin{proposition}\label{pro}
The proposed matrix estimator ${\bf A}^u(t)$ denoted in \eqref{un} is an unbiased estimator of matrix ${\bf A}$. Moreover, $[{\bf A}^u(t)]_S$ is an unbiased estimator of matrix ${\bf A}_S.$
\end{proposition}
\begin{proof}
We set ${\bf R}_3(t)=\mathbb{E}[{\bf y}_{t+3}{\bf y}_{t}^T]$. Using the definition of ${\bf R}_1(t)$ in \eqref{VAR_change}, we obtain
\begin{align}\label{eqn: EA}
\mathbb{E}[{\bf A}^u(t)] = \frac{1}{\mu^2}\big({\bf R}_1(t)-{\bf R}_3(t-1)\big).
\end{align}
Additionally, using the recursion of \eqref{stack}, we obtain
\begin{align*}
{\bf y}_{t+3} = {\bf A}^3{\bf y}_{t}+\mu {\bf A}^2{\bf x}_{t+1}+\mu {\bf A}{\bf x}_{t+2}+\mu{\bf x}_{t+3}.
\end{align*}
Thus,
${\bf R}_3(t) = {\bf A}^3\mathbb{E}[{\bf y}_{t}{\bf y}_{t}^T]={\bf A}^3{\bf R}_0(t),$
where the first equality uses the i.i.d. property. Using \eqref{eqn: R_0}, we obtain
\begin{align}
\label{eqn: R3_i_1}{\bf R}_3(t-1)= \mu^2({\bf A}^{3}+{\bf A}^{5}+\dots+{\bf A}^{2t+1}).
\end{align}
Substituting \eqref{eqn: R_1} and \eqref{eqn: R3_i_1} into \eqref{eqn: EA}, we obtain
$
\mathbb{E}[{\bf A}^u(t)] = {\bf A}.
$
This proves that the estimator ${\bf A}^u(t)$ is an unbiased estimator of ${\bf A}$. Considering the partial observation with \eqref{uns}, we have
\begin{equation}\label{unbiased_S}
\mathbb{E}\big[[{\bf A}^{u}(t)]_S\big]=\frac{1}{\mu^2}\Big([{\bf R}_1(t)]_{S}-[{\bf R}_3(t-1)]_S\Big)={\bf A}_S.
\end{equation} Thus, $[{\bf A}^u(t)]_S$ is an unbiased matrix estimator of ${\bf A}_S.$
\end{proof}
\begin{remark}\label{remark2}
The performance of the proposed estimator $[{\bf A}^u(t)]_S$ not only depends on the observed signals but also on the hidden nodes since the hidden nodes influence the observed signals. Moreover, we also showed the hidden nodes do impact the variance of the proposed unbiased estimator in the supplementary material section.
\end{remark}
Proposition \ref{pro} shows that we obtain an unbiased estimator for ${\bf A}_S$ at each time $t$. However, this estimator may have a large variance. To overcome this problem, we propose another unbiased matrix estimator that converges in probability to ${\bf A}_S$. Based on the unbiased estimator and the cumulative samples, we denote
$
[\widehat{{\bf R}}_1(n)]_S\triangleq\frac{1}{n}\sum_{t=1}^{n}[{\bf y}_{t+1}]_S[{\bf y}_t]_S^T,$ $[\widehat{{\bf R}}_3(n-1)]_S\triangleq\frac{1}{n}\sum_{t=1}^{n}[{\bf y}_{t+2}]_S[{\bf y}_{t-1}]_S^T.
$
Then, an \emph{efficient matrix estimator} using cumulative samples is proposed as
\begin{align}\label{eqn: hat_A_s}
[\widehat{{\bf A}}_n^{u}]_S =\frac{1}{\mu^2}\Big([\widehat{{\bf R}}_1(n)]_S-[\widehat{{\bf R}}_3(n-1)]_S\Big).
\end{align}
Thus, $[\widehat{{\bf A}}_n^{u}]_S $ is the average of $[{\bf A}^u(t)]_S$ from time $1$ to $n$.
Since $[{\bf A}^u(t)]_S$ is an unbiased estimator of ${\bf A}_S$ from Proposition \ref{pro}, $[\widehat{{\bf A}}_n^{u}]_S $ is also unbiased. Besides, it has the following property.
\begin{theorem}\label{theorem
Under Assumption \ref{Assu1}, if the observed signals are collected by the VAR model with Gaussian noise in \eqref{va1}, then the unbiased estimator $[\widehat{{\bf A}}_n^{u}]_S$ for the matrix ${\bf A}_S$ satisfies
$[\widehat{{\bf A}}_n^{u}]_S\stackrel{P}{\rightarrow} {\bf A}_S,$ when $n\rightarrow\infty.$
\end{theorem}
\begin{proof}
For brevity, the detailed proof is available in the supplementary material.
\end{proof}
Theorem \ref{theorem} demonstrates that the unbiased estimator $[\widehat{{\bf A}}_n^{u}]_S$ converges to ${\bf A}_S$ in probability.
However, for a fixed network size $N$, the estimators proposed in \cite{matta2019graph} cannot guarantee convergence to ${\bf A}_S$ as the number of samples grows.
In comparison, the advantage of the Granger estimator is that it does not rely on the symmetry assumption. Therefore, it can be used in non-symmetric scenarios.
The detailed comparisons are shown in Table \ref{table:esti}.
\begin{table}[h]
\caption{Comparison of different estimators}
\label{table:esti}
\centering
\setlength\tabcolsep{5pt}
\begin{tabular}[1]{cccccccc}
\hline
Estimator& Expression& Bias&Convergence ({*})\\
\hline
Granger \cite{matta2019graph}& $[\widehat{{\bf R}}_1(n)]_S([\widehat{{\bf R}}_0(n)]_S)^{-1}$& biased&\ding{53}\\
One-lag \cite{matta2019graph}& $[\widehat{{\bf R}}_1(n)]_S$& biased&\ding{53}\\
Residual \cite{matta2019graph}& $[\widehat{{\bf R}}_1(n)]_S-[\widehat{{\bf R}}_0(n)]_S$& biased&\ding{53}\\
\textbf{Proposed}& $[\widehat{{\bf R}}_1(n)]_S-[\widehat{{\bf R}}_3(n-1)]_S$& unbiased&\ding{52}\\
\hline
\end{tabular}
\begin{flushleft}
where $[\widehat{{\bf R}}_0(n)]_S\triangleq\frac{1}{n}\sum_{t=1}^{n}[{\bf y}_{t}]_S[{\bf y}_t]_S^T$. $(*)$ means that for a fixed network size $N,$ the estimator converges in probability to ${\bf A}_S$ when $n\rightarrow\infty$.
\end{flushleft}
\end{table}
\subsection{Node Pair Clustering}
We have developed an unbiased estimator $[\widehat{{\bf A}}_n^{u}]_S $, as denoted in \eqref{eqn: hat_A_s}, that
quantifies the strength of the connections among the network nodes. Considering the binary property of the adjacency matrix, we require the standard clustering algorithms, which allow grouping the entries of the unbiased estimator into two clusters, indicating the ‘disconnection’ and ‘connection’ pairs of the observed network.
To select a suitable clustering method, we complete experiments on ER models to visualize the distribution of the entries of the unbiased matrix estimator $[\widehat{{\bf A}}_n^{u}]_S$ in Fig. \ref{sca}.
For convenience, the `disconnection' and `connection' clusters are denoted as `0' and `1', respectively. $\footnote{In this experiment, we set the network size $N=200$, the connection probability of ER model $p=0.1$, the fraction of the observed nodes $\xi=0.2$ ($S=40$), the parameter of the Laplacian $\lambda = 0.99$ and the weight $\mu=0.1$.}$
\begin{figure}[t]
\centering
\subfigure[$N=200,\ \xi=0.2,\ n=10^4$.]{
\begin{minipage}[t]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ-scatterA-eps-converted-to}
\end{minipage}%
}%
\subfigure[$N=200,\ \xi=0.2,\ n=10^5$.]{
\begin{minipage}[t]{0.3\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ-scatterB-eps-converted-to}
\end{minipage}%
}%
\centering
\caption
Scatter plots and histograms of the entries of
the unbiased matrix estimator.}
\label{sca}
\end{figure}
Fig. \ref{sca} (a) shows that entries are largely mixed under the small size situation. In addition, their distributions also partly overlap. Thus, it is difficult to infer the network topology when the sample size is small. However, when the sample size $n$ is large, as shown in Fig. \ref{sca} (b), the entries are perfectly separated into two clusters, which is consistent with Theorem 1. The histograms in Fig. \ref{sca} reveal that their distribution seems to be a Gaussian mixture distribution.
Thus, we adopt the GMM algorithm \cite{najar2017comparison}
to group the entries into two clusters. It is known that the GMM algorithm is implemented by the expectation-maximum algorithm, which is sensitive to the initial conditions \cite{biernacki2003choosing}.
Since the value for the disconnected pairs under the Laplacian rule
is 0, the expectation of the unbiased estimator for the disconnected pairs is also 0 (see Fig. \ref{sca}).
Thus, we set 0 as the initial mean for the disconnected pairs when using the GMM algorithm.
\subsection{Proposed Method}
The proposed NIG method is summarized in Algorithm \ref{algorithm}, which is used to infer network topology under partial observability.
\begin{algorithm}[h]\label{algorithm}
\caption{NIG algorithm}
\KwIn{Streaming data $[{\bf y}_0]_S,\dots,[{\bf y}_{n+2}]_S$; Weight $\mu$;}
\KwOut{Prediction matrix ${\bf G}_S$}
$[\widehat{{\bf R}}_1(n)]_S\leftarrow\frac{1}{n}\sum_{t=1}^{n}[{\bf y}_{t+1}]_S[{\bf y}_t]_S^T$
$[\widehat{{\bf R}}_3(n-1)]_S\leftarrow\frac{1}{n}\sum_{t=1}^{n}[{\bf y}_{t+2}]_S[{\bf y}_{t-1}]_S^T$
$[\widehat{{\bf A}}_n^{u}]_S\leftarrow\frac{1}{\mu^2}([\widehat{{\bf R}}_1(n)]_S-[\widehat{{\bf R}}_3(n-1)]_S)$
${\bf G}_S\leftarrow$ GMM$([\widehat{{\bf A}}_n^{u}]_S)$~~~\# $\textmd{initial mean: 0.}$
\end{algorithm}
Steps 1-3 are completed to generate the unbiased estimator $[\widehat{{\bf A}}_n^{u}]_S$. Step 4 is completed using the GMM clustering method for the entries of the unbiased matrix estimator.
\section{Numerical Experiments}
\begin{figure*}[htbp]
\centering
\subfigure[Error rates]{
\begin{minipage}[t]{0.24\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ-error-PLUS-eps-converted-to}
\end{minipage}%
}%
\subfigure[Bias.]{
\begin{minipage}[t]{0.24\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ-bias-eps-converted-to}
\end{minipage}%
}%
\subfigure[Variance.]{
\begin{minipage}[t]{0.24\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ-variance-eps-converted-to}
\end{minipage}%
}%
\subfigure[Ablation study.]{
\begin{minipage}[t]{0.24\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ-ablation-eps-converted-to}
\end{minipage}%
}
\centering
\caption{Comparison of the proposed NIG algorithm with other methods.}
\label{bvar}
\end{figure*}
\begin{figure*}[htbp]
\centering
\subfigure[$N=800, p=0.1, \xi=0.2.$]{
\begin{minipage}[t]{0.24\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ-error8-plus-eps-converted-to}
\end{minipage}%
}%
\subfigure[$N=400, p=0.2, \xi=0.2.$]{
\begin{minipage}[t]{0.24\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ-error2-eps-converted-to}
\end{minipage}%
}%
\subfigure[$N=400, p=0.1.$]{
\begin{minipage}[t]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ_zhixin_gauss1_mu1-eps-converted-to}
\end{minipage}%
}
\subfigure[False-negative score.]{
\begin{minipage}[t]{0.24\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/AQ-FN-PLUS-eps-converted-to}
\end{minipage}%
}
\centering
\caption{Comparison of the proposed NIG algorithm under different settings.}
\label{error}
\end{figure*}
In this section, we examine the numerical performance of
the proposed NIG algorithm and present comparison
results with three existing methods, namely, one-lag (One), residual (Res), and Granger (Gra) estimators followed by the K-means clustering algorithm in \cite{matta2019graph}. If not otherwise specified, the NIG algorithm uses the GMM clustering algorithm. The error rates are adopted for performance evaluation, which are the fractions of network node pairs that are incorrectly recovered.
Consider a network with $N$ nodes, where, according to the ER model, edges are determined by independent Bernoulli distributions with link probability $p$.
If not otherwise specified, we set $N=400, \xi = 0.2, \mu = 0.1, p=0.1.$
The parameter $\lambda$ of the Laplacian rule is set as 0.99. To assess the performance of the proposed unbiased estimator in the NIG algorithm,
we consider the following scenarios, where the results are averaged over 50 experiments.
\begin{itemize}
\item
The proposed algorithm is compared with other methods in terms of error rate, bias, and variance in Fig. \ref{bvar}.
\item
An ablation study is provided to clarify where the gain of the proposed algorithm arises. Specifically, in Fig. \ref{bvar} (d),
we show the results from the K-means and GMM algorithms
for the proposed unbiased estimator and Granger estimator, respectively.
\item We examine the error rates and 95$\%$ confidence intervals of the NIG algorithm when varying $N$, $p$, and $\xi$ in Fig. \ref{error}. Moreover, in Fig. \ref{error} (d), we compare these algorithms in terms of a popular metric, the false-negative score \cite{sokolova2006beyond}, which is defined as the fraction of disconnected node pairs declared as connected.
\end{itemize}
Fig. \ref{bvar} (a) shows that the proposed estimator has the lowest error rate compared to the other estimators in the case of small sample sizes. However, when the sample size becomes larger than $0.8*10^5$, the proposed algorithm has higher error rates than the Granger and one-lag estimators. The reason may be that
the proposed estimator has the smallest bias, which mainly affects the performance and makes the proposed unbiased estimator perform best in the small sample size situation. However, with the gradual increase in sample sizes, the variance becomes the main factor affecting the performance. Thus, the larger variance leads to the higher error rates of the proposed NIG algorithm than baselines (see Fig. \ref{bvar} (b)-(c)). In addition, one can observe that its variance converges to 0 as $n$ increases, which is consistent with Theorem \ref{theorem}.
Fig. \ref{bvar} (d) shows that both the proposed and Granger estimators with the GMM algorithm outperform those with the K-means algorithm. Thus, the GMM algorithm provides some gains for both estimators. When the sample size is small, one can also observe that the proposed estimator has a better performance than the Granger estimator with the same GMM algorithm. The reason is that the unbiased estimator provides a better initialization for the GMM clustering algorithm.
Thus, the gains of the proposed method arise from both the new estimator and the GMM algorithm.
Comparing the proposed method with the baselines in Fig. \ref{error} (a) and Fig. \ref{bvar} (a), we see that the performance gap grows with larger network sizes. Fig. \ref{error} (b) shows that all the estimators have higher error rates when the graph becomes denser, but the proposed estimator still performs best
with small sample sizes.
Fig.\ref{error} (c) shows that, with a higher fraction of observed nodes, the proposed NIG algorithm has a narrower confidence interval and a lower average error rate.
The reason may be that the impact of the hidden nodes on the observed signals decreases when the fraction of the observed nodes increases since there are fewer hidden nodes. In addition, Fig. \ref{error} (d) shows the false-negative score. A satisfactory estimator should have small false-negative scores. Fig. \ref{error} (d) shows that the proposed method has the lowest false-negative score and demonstrates that the proposed method has the highest probability of recovering the disconnected pairs correctly. On the other hand, the proposed NIG algorithm has contrary performance under the false-positive score \cite{sokolova2006beyond}.
\section{Conclusion}
In this letter, the novel NIG algorithm, including an unbiased estimator and a GMM algorithm for network topology inference under partial observability, is proposed. Theoretically, we have proven that the unbiased estimator converges to the network combination matrix in probability and helps us obtain a better initialization for the GMM algorithm. The simulations have shown that the proposed NIG algorithm obtains a better performance with small sample sizes, sparse networks, and high fractions of observed nodes. Future work aims to improve the algorithms by combining the advantages of the biased estimators and the proposed method.
\bibliographystyle{ieeetr}
| {'timestamp': '2022-05-17T02:33:47', 'yymm': '2203', 'arxiv_id': '2203.15500', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15500'} | arxiv |
\section{1. Introduction}
Hand pose estimation plays a key role in many applications to support human computer interaction, such as autonomous driving, AR/VR, and robotics \cite{Erolsurvey}.
Given an input image, the goal of hand pose estimation is to estimate the location of hand skeleton joints.
While many works take color images as input, methods built upon depth images usually exhibit superior performance \cite{sun2015cascaded}.
Prior arts often use depth image and 2D CNN networks to regress 3D hand joints, or apply point-net based models \cite{qi2017pointnet,ge2018_Point} on point clouds converted from the depth using camera intrinsic parameters.
Although great progress on hand pose estimation from depth has been made in the past decade, the existing methods still can not achieve satisfactory hand pose estimation results due to the severe viewpoint variations and occlusions caused by articulated hand pose.
\begin{figure}[h]
\centering
\includegraphics[width=\linewidth]{./fig/visualize_view_selected.pdf}
\caption{Illustration of view selection for 3D hand pose estimation. The view of the original depth image may not be suitable for pose estimation. We select suitable views for pose estimation from the uniformly sampled virtual views. $\theta$ and $\beta$ represent the azimuth angle and the elevation angle of candidate virtual views, respectively.}
\label{fig:view_selected}
\end{figure}
\begin{figure*}[t]
\centering
\includegraphics[width=\linewidth]{./fig/pipeline.pdf}
\caption{Illustration of our virtual view selection and fusion pipeline for 3D hand pose estimation.}
\label{fig:pipeline}
\end{figure*}
To address the occlusion and viewpoint variation challenges, existing methods often rely on data alignment that transforms the input depth input into a canonical space.
However, this process is either done in 2D space \cite{sun2015cascaded,ye2016spatial} that do not fully respect the 3D nature of the depth image, or in hand-crafted canonical space, e.g. via PCA \cite{ge2018_Point} or axis-aligned bounding box \cite{ge2016robust}, that are not engaged in a joint optimization with the full model and thus the performance may not be at its best.
In contrast, learning based data alignment is more optimal as demonstrated in many previous work \cite{jaderberg2015spatial}, and back to the domain of pose estimation, this is mostly achieved in automated best viewpoint selection in multiple camera system \cite{sminchisescu2019domes,gartner2020deep} via reinforcement learning.
However, in the scenario when only one single depth is available, reinforcement learning does not typically perform well due to the limited inputs, and there is limited research study if viewpoint selection is necessary and possible with a single input depth.
We claim that viewpoint selection is very important for 3D hand pose estimation even from just a single depth.
As a perspective projection of the 3D geometry, a depth image can be projected into the 3D space as a point cloud and rendered into depth maps from another viewpoints for 3D hand pose estimation.
On one hand, the same amount of error on 2D perspective views may correspond to dramatically different errors in 3D space.
One the other hand, machine learning models may favor some typical viewpoints than the others (See Fig.~\ref{fig:view_selected} for an example).
Therefore, finding the proper virtual viewpoint to re-project the given single input depth could be critical to further improve hand pose estimation, which has been well-studied in terms of architecture.
In this paper, we propose a novel virtual view selection and fusion module for 3D hand pose estimation methods from single depth,
which can be easily integrated into the existing hand pose estimation models to enhance the performance.
Instead of selecting just one best viewpoint, we propose to automatically select virtual viewpoints for pose estimation and fuse the results of all views, and find this empirically delivers accurate and robust pose estimation.
To achieve this, we re-render the input depth into all candidate viewpoints, and train a viewpoint selection network to evaluate the confidence of each virtual viewpoint for pose estimation.
We find this empirically works well but slows down the run-time speed when the viewpoint candidate pool is large.
To alleviate the computation issue, we adopt network distillation and show that it is possible to predict the view confidence without explicitly re-project the input depth.
The contributions of our method can be summarized as follows: We propose a novel deep learning network to predict 3D hand pose estimation from single depth, which renders the point cloud of the input depth to virtual multi-view, and get 3D hand pose by fusing the 3D pose of each view.
We then show that the view selection can be done efficiently without sacrificing run-time via network distillation.
Extensive experiments on hand pose benchmarks demonstrate that our method achieves the state-of-the-art performance.
The code is available in project webpage \textcolor{blue}{\url{https://github.com/iscas3dv/handpose-virtualview}}.
\section{2. Related Work}
The 3D hand pose estimation methods take depth images as input and estimate the locations of hand skeleton joints. Prior arts include \cite{moon2018v2v, ge2018point, rad2018feature, wan2018dense, xiong2019a2j}. \cite{ge2018point}, \cite{deng2020weakly} and \cite{moon2018v2v} use 3D representation of depth to estimate the hand pose, and \cite{wan2018dense}, \cite{rad2018feature} and \cite{xiong2019a2j} use 2D representation of depth to get the hand pose.
Anchor-to-Joint Regression Network (A2J) \cite{xiong2019a2j} can
predict accurate pose with efficiency, which sets up dense anchor points on the image and obtains the final joint locations by weighted joint voting of all anchor points.
Although impressive results are obtained with these prior arts, these networks perform worse under occlusion or severe viewpoint variation.
The most related work to us is Ge et al. \cite{ge2016robust}, which shares the same thoughts with us that the input viewpoint may not be ideal and projects the input depth into the front, side and top view for pose estimation.
However, the number of the selected virtual views is fixed (i.e. 3), and the view selection strategy is hand-crafted but not trained in an end-to-end manner.
Different to them, we proposed a learnable virtual view selection and fusion module for 3D hand pose estimation, which can adaptively select informative virtual viewpoints
for point cloud rendering, and fuse the estimated 3D poses of these views.
In the realm of pose estimation, viewpoint selection is also achieved in multiple camera system using reinforcement learning \cite{sminchisescu2019domes, gartner2020deep}. These works use reinforcement learning methods to select a view sequence suitable for 3D pose estimation. However, they all require a multi-view capture setup, and cannot be used for a single input depth image. Moreover, these methods are time-consuming, because views are selected in sequence, and thus reduce the inference efficiency.
\section{3. Approach}
\subsection{3.1 Overview}
In this section, we introduce our virtual view selection and fusion approach for 3D hand pose estimation from a single depth image (Fig.~\ref{fig:pipeline}).
We first convert a depth image into 3D point clouds, and uniformly set up candidate virtual views on the spherical surface centered in the hand point clouds.
The point cloud is then rendered into candidate views as depth maps, which are then fed into a network to predict the confidence.
A 3D pose estimation network then predicts the 3D hand pose from view with top-$N$ confidence \footnote{N is a hyper-parameter that controls the run-time efficiency and pose accuracy.}, and finally fuses the pose with regard to the confidence to achieve accurate 3D hand pose results.
To reduce the computational cost, we also design an efficient lightweight network by model distillation to predict the view confidence from the input depth itself, which saves the computation cost of point cloud rendering if the pool of candidate view is large.
\subsection{3.2 Virtual Multi-View Hand Pose Estimation}
We first explain the idea of virtual multi-view hand pose estimation.
Inspired by Ge et al. \cite{ge2016robust} that the original camera view may not be optimal for hand pose estimation, we hypothesize that denser virtual view sampling should be more beneficial and propose to exploit rendered depth on multiple virtual views to estimate 3D hand pose (Fig.~\ref{fig:baseline}).
\begin{figure}[h]
\centering
\includegraphics[width=\linewidth]{./fig/baseline.pdf}
\caption{Our virtual multi-view hand pose estimation baseline.}
\label{fig:baseline}
\end{figure}
\subsubsection{Candidate Virtual Views}
We first define a set of virtual camera views to re-render the input depth map.
Specifically, we first convert the depth map of the hand into point clouds, and uniformly sample a series of virtual cameras on the spherical surface centered in the hand point clouds.
Note that large camera rotation may cause severe occlusion issue for depth rendering, and thus we only keep the cameras close to the input camera view.
In practice, we keep 25 virtual cameras uniformly sampled from
the zenith angle in $[-\pi/3,\pi/3]$ and the azimuth angle in $[-\pi/3,\pi/3]$ on the sphere. Refer to Fig.~\ref{fig:uniformly_sample} in Sec.~4.3 for illustration.
\subsubsection{Virtual View Depth Map Rendering}
The point cloud from the input depth image can now be re-projected to each of the virtual cameras.
Note that since the depth images does not provide a complete hand shape, the rendered depth may be partially incomplete or contain wrong occlusion.
However, we found empirically that these does not confuse the pose estimation network when the virtual camera is not too far from the input. Therefore, we did not complete the rendered image as the face rendering methods \cite{zhou2020rotate, fu2021high}.
We also implemented a parallel rendering process using CUDA to speed up the rendering process.
\subsubsection{3D Hand Pose Estimation from Single Depth}
For each rendered depth image, we use the Anchor-to-Joint regression network (A2J) \cite{xiong2019a2j} as the backbone for 3D hand pose estimation for its great run-time efficiency and competitive accuracy.
In practice, any other 3D hand pose estimation models from depth can be taken as the backbone.
We use the loss function from A2J and briefly explain here for self-contain. The loss function $L_{\textit{A2J}}$ of A2J consists of the objective loss $L_{\textit{obj}}$ and the informative anchor point surrounding loss $L_{\textit{info}}$. The objective loss $L_{\textit{obj}}$ aims to minimizing the error between the predicted hand joints with the anchor points and the ground truth hand joints, and the informative anchor point surrounding loss $L_{\textit{info}}$ aims to selecting informative anchor points located around the joints to enhance the generalization ability. The loss function $L_{\textit{A2J}}$ can be formulated as follows
\begin{equation}
\label{eq:a2j_loss}
L_{\textit{A2J}}=\lambda L_{\textit{obj}} + L_{\textit{info}}
\end{equation}
where $\lambda$ is the loss weight to balance $L_{\textit{obj}}$ and $L_{\textit{info}}$, and it is set to $\lambda=3$.
\subsubsection{Multi-View Pose Fusion}
In the end, we run a fusion stage to combine the predicted 3D hand poses from virtual camera views.
In the very basic version,
we transform the 3D joints of each view to the original camera coordinate system with the camera extrinsic parameters, and get the final hand pose prediction by averaging the transformed hand poses.
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth]{./fig/confidence.pdf}
\caption{Confidence network. The network uses CNN to extract features from the intermediate features of pose estimation net, and then uses multi-head attention to fuse the multi-views visual features. We use FC and Softmax to map the fused multi-view features to confidence of each view.
}
\label{fig:confidence}
\end{figure}
\begin{figure*}[ht]
\centering
\includegraphics[width=0.89\linewidth]{./fig/view_select.pdf}
\caption{View selection with confidence. We use multi-view depth map data to train a ``teacher'' confidence network for view selection based on confidence (top), and we train a ``student'' lightweight confidence network for efficient view selection through network distillation (bottom).}
\label{fig:multi-view_fusion}
\end{figure*}
\subsection{3.3 Virtual View Selection}
\label{sec3.3}
The method proposed in the previous section indeed significantly improves the hand pose estimation accuracy, however suffers from run-time efficiency issue.
Essentially, the virtual multi-view baseline runs single view pose estimation network multiple times, thus needs linearly proportional computation power w.r.t the size of virtual camera pool size (e.g. 25 in our case).
In another perspective, the pose prediction on some virtual views may not be great, e.g. due to sparsity or wrong occlusion, and may further hurt the overall performance when fused with an average.
Therefore, we propose a view selection algorithm that can choose a small number of high impacting camera views without the necessity of running all of them into the pose estimation network.
\subsubsection{Confidence Prediction}
The key of our view selection algorithm is a confidence network that evaluates the importance of each candidate virtual view (Fig.~\ref{fig:confidence}).
To save the computation cost, the confidence network takes the high-level feature from A2J as input.
It then extracts features using convolutional neural network, and then uses the multi-head attention in \cite{vaswani2017attention} to fuse multi-view features.
The multi-head attention mechanism can direct the network to focus on the views which play more important role, e.g. provide more accurate pose or complementary information for fusion. Finally, we use a fully connected layer to map the feature of each view to a scalar, i.e. the confidence of each view.
\subsubsection{Virtual View Selection and Fusion}
With the predicted confidence for each virtual camera viewpoint, we can perform view selection by picking the views with top-$N$
confidence from all $M$ candidate views ($N<M$).
Empirically, larger $N$ tends to produce more accurate pose (See Sec.~4.3) but needs more computation.
In practice, we found that picking $N=3$ in $M=25$ virtual views can already beat most of the SoTA methods.
With the pose estimated from selected views,
we can fuse hand poses and get final output $\hat{\mathbf{J}}$ as:
\begin{equation}
\label{eq:weight_average}
\hat{\mathbf{J}} = \sum_{i=1}^{N} c_i (\mathbf{R}_i\hat{\mathbf{J}}_i+\mathbf{t}_i)
\end{equation}
where $\hat{\mathbf{J}}_i$ is the predicted hand joints of the $i$-th selected view, $c_i$ is the confidence of the $i$-th selected view after softmax, and $[\mathbf{R}_i,\mathbf{t}_i]$ is the known camera extrinsic parameters of the $i$-th selected view.
\subsubsection{Joint Training}
During the training stage, we do not give direct supervision to the confidence of each view since they are simply unknown.
Instead, we jointly train confidence network with the pose estimation network, which is supervised only on the final pose accuracy.
The joint loss $L_{J}$ is formulated as:
\begin{equation}
\label{eq:conf_loss}
L_{J}=\sum_{i=1}^K L_{\tau}( \Vert \mathbf{J}_i-\hat{\mathbf{J}}_i \Vert)
\end{equation}
where $\hat{\mathbf{J}}_i$ is the estimated $i$-th joint by multi-view pose fusion (See Eq.~(\ref{eq:weight_average})), $\mathbf{J}_i$ is the ground truth location of the $i$-th joint, $K$ is the number of hand joint, and $L_{\tau}(\cdot)$ is the smooth$_{L1}$ loss function.
Note that the behavior of confidence network might be different with varying $N$ since the predicted confidences have been used at both selection and fusion stage.
For the selection stage, only the ranking of the confidence matters; and for the fusion stage, the precise value of confidences of the chosen views also matters.
Therefore, for ideal performance, the confidence network should be trained for each specific $N$.
In practice, however, a single model trained with $N=M$ can still work for most of the varying $N$, with slightly worse but still reasonable performance.
\subsubsection{Distillation for Efficient Confidence Prediction}
With view selection, we are able to reduce the number of forward pass of the pose estimation network from the total number of virtual views $M$ to a much smaller number of selected views $N$.
This reduces enormous computation, but we still observe noticeable frame per second (FPS) drops mostly due to two reasons: 1) The input depth still needs to be rendered to all candidate camera views for confidence estimation. 2) The confidence network still needs to process all the rendered depth, though designed to be light-weighted but still costly to run the multi-head attention.
We resort to network distillation to alleviate this run-time issue.
Specifically, we take our confidence network as the teacher network, and train an even more light-weighted student network (a ResNet-18 followed by a fully connected layer).
More importantly, the student network takes only the original depth as the input and directly outputs confidence for all $M=25$ views.
This effectively removes the necessity of re-rendering the input depth to all virtual cameras.
To train the student network, we directly take the confidence predicted by teacher network as the ground truth.
The loss is defined as
\begin{equation}
\label{eq:light_loss}
L_{\textit{light}} = \sum_{i = 1}^M L_{\tau}(\beta (c_{i} - {\hat{c}}_{i} ) )
\end{equation}
where $\beta$ is the scaling factor set to $100$, ${\hat{c}}_{i} $ is the confidence ground truth from teacher network, i.e. the multi-head attention network from $M$ views, and $c_{i}$ is the student network output.
Once the training is done, the teacher network is no longer needed during the inference, and student network can support the view selection and fusion in an efficient way.
\subsection{3.4 Implementation Details}
We train and evaluate our models on a workstation with two Intel Xeon Silver 4210R, 512GB of RAM and an Nvidia RTX3090 GPU. Our models are implemented within PyTorch. Adam optimizer is used; the initial learning rate is set to 0.001 and is decayed by 0.9 per epoch. In order to conduct data augmentation, we randomly scale the cropped depth map, jitter the centroid of the point cloud, and randomly rotate the camera when rendering multi-view depth. For all smooth$_{L1}$ loss, the switch point between quadratic and linear is set to 1.0.
Our network consists of the 3D pose estimation network (i.e. A2J), the teacher confidence network and the lightweight student confidence network.
The network input is $176 \times 176$ hand region cropped from the input depth, and we use ResNet-50 as the backbone of A2J.
We first train the 3D pose estimation network and the teacher confidence network together, the loss can be formulated as:
\begin{equation}
\label{eq:final_loss}
L_{\textit{viewsel}} = L_{\textit{A2J}} + \gamma L_J
\end{equation}
where $\gamma = 0.1$ is the factor to balance the loss terms.
Then we fix the parameters of the two networks and train the lightweight student confidence network with $L_{light}$.
\section{4. Experiments}
\subsection{4.1 Datasets and Evaluation Metric}
\paragraph{NYU Hand Pose Dataset (NYU)} \cite{tompson2014real} contains 72,757 frames for training and 8,252 frames for testing. 36 hand joints are annotated, but we use only a subset of 14 hand joints for evaluations following the same evaluation protocol in \cite{tompson2014real}.
\paragraph{ICVL Hand Pose Dataset (ICVL)} \cite{tang2014latent} contains 331,006 frames for training and 1,596 frames for testing. 16 hand joints are annotated.
\paragraph{Task 1 of Hands19 Challenge Dataset (Hands19-Task1)} \cite{armagan2020measuring} contains 175,951 training depth images from 5 subjects and 124,999 testing depth images from 10 subjects, in which 5 subjects overlap with the training set. This dataset is very challenging because of its exhaustive coverage of viewpoints and articulations.
\paragraph{Evaluation Metric} We evaluate the hand pose estimation performance using standard metrics proposed in \cite{tang2014latent}, i.e. mean joint error and the percentage of test examples that have all predicted joints within a given maximum distance from the ground truth.
\subsection{4.2 Comparison with State-of-the-art Methods}
\begin{table}[h]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{ccc}
\toprule[1pt]
Methods & NYU & ICVL \\
\midrule
HandPointNet \cite{ge2018_Point} & 10.54 & 6.93 \\
DenseReg \cite{wan2018dense} & 10.21 & 7.24 \\
P2P \cite{ge2018point} & 9.05 & 6.33 \\
A2J \cite{xiong2019a2j} & 8.61 & 6.46 \\
V2V \cite{moon2018v2v} & 8.42 & 6.28 \\
AWR \cite{huang2020awr} & 7.37 & 5.98 \\
\hline
Ours-1view & 7.34 & 5.16 \\
Ours-3views & 6.82 & 4.86 \\
Ours-9views & 6.53 & 4.77 \\
Ours-15views & 6.41 & \textbf{4.76}\\
Ours-25views & \textbf{6.40} & 4.79\\
\bottomrule[1pt]
\end{tabular}
}
\caption{Comparison mean joint 3D error (mm) and ranking result with state-of-art methods on NYU dataset and ICVL dataset. ``Ours-1view'', ``Ours-3views'', ``Ours-9views'' and ``Ours-15views'' are the results of our method with selected 1, 3, 9 and 15 views from 25 uniformly sampled views, respectively.
``Outs-25views'' denotes the results of our method with 25 uniformly sampled views.}
\label{NYU}
\end{table}
\begin{figure}[ht]
\centering
\includegraphics[width=\linewidth]{./fig/nyu_error.png}
\caption{Comparison of our proposed method with state-of-the-art methods on NYU dataset. Left: mean joint error per hand joint. Right: the percentage of success frames over different error thresholds.}
\label{fig:nyu_error}
\end{figure}
\begin{table}[h]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{cc}
\toprule[1pt]
Methods & Mean error (mm) \\
\midrule
{V2V} \cite{moon2018v2v} & 15.57 \\
{AWR} \cite{huang2020awr} & 13.76 \\
{A2J} \cite{xiong2019a2j} & 13.74 \\
{Rokid} \cite{zhang2020handaugment} & 13.66 \\
\hline
Ours-1view & 14.14 \\
Ours-3views & 13.24 \\
Ours-9views & 12.67 \\
Ours-15views & \textbf{12.51} \\
Ours-25views & 12.55 \\
\bottomrule[1pt]
\end{tabular}
}
\caption{Comparison with state-of-art methods on Hands19-Task1. We show the mean joint error on the test dataset split “Extrapolation”, which aims to evaluating the model generalization performance and is the main evaluation metric on Hands19-Task1. ``Ours-1view'', ``Ours-3views'', ``Ours-9views'', ``Ours-15views'' and ``Ours-25views'' have the same meaning as shown in Table~\ref{NYU}}
\label{HANDS2019}
\end{table}
\begin{figure*}[ht]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{ccccccccc}
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/P2P/3855.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/V2V/3855.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/A2J/3855.png} &
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/1view/3855.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/3views/3855.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/9views/3855.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/15views/3855.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/25views/3855.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/label/3855.png} \\
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/P2P/3911.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/V2V/3911.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/A2J/3911.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/1view/3911.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/3views/3911.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/9views/3911.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/15views/3911.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/25views/3911.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/label/3911.png} \\
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/P2P/4611.png} &\includegraphics[width=0.09\linewidth]{fig/comp_STOA/V2V/4611.png}
&\includegraphics[width=0.09\linewidth]{fig/comp_STOA/A2J/4611.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/1view/4611.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/3views/4611.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/9views/4611.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/15views/4611.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/25views/4611.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/label/4611.png} \\
P2P & V2V & A2J & 1 view & 3 views & 9 views& 15 views & 25 views & Ground truth
\end{tabular}
}
\caption{Comparison visualization results with state-of-art methods on NYU dataset.
``1 view'', ``3 views'', ``9 views'' and ``15 views'' are the results of our method with selected 1, 3, 9 and 15 views from 25 uniformly sampled views, respectively.
``25 views'' denotes the results of our method with 25 uniformly sampled views.
}
\label{fig:comp_STOA}
\end{figure*}
In this experiment, we use our ``student'' lightweight confidence network for view selection and pose fusion.
We first compare our method with the state-of-the-art methods
on NYU dataset and ICVL dataset.
DenseReg \cite{wan2018dense}, A2J \cite{xiong2019a2j} and AWR \cite{huang2020awr} directly use the depth map for pose estimation. HandPointNet \cite{ge2018_Point}, P2P \cite{ge2018point} and V2V \cite{moon2018v2v}\cite{hruz2021hand} use the 3D representation of the depth map for pose estimation.
Table~\ref{NYU} shows the mean joint error. Fig.~\ref{fig:nyu_error} shows the percentage of success frames over different error thresholds and the error of each joint. We do not show AWR in Fig.~\ref{fig:nyu_error} because the best prediction results on NYU dataset are not released by AWR.
Note that with just 1 view selected, we already outperform all the other methods. And when more view selected, the performance keeps improving.
This clearly indicates that our view selection is effective in finding a better virtual view for pose estimation, and more views are benefical through the confidence based fusion.
Fig.~\ref{fig:comp_STOA} shows the qualitative comparison to other methods on a few testing examples of NYU dataset.
Our method performs especially better on views with heavy occlusion and missing depth, e.g. the 3rd row.
It is as expected since the re-render in a perpendicular virtual camera looking at the palm might be better to interpret the input depth.
We also compare our method with the state-of-the-art 3D hand pose estimation methods
on Hands19-Task1. The details and results of state-of-the-art methods are cited from \cite{armagan2020measuring}. {Rokid} \cite{zhang2020handaugment} trains 2D CNN to regress joints with additional synthetic data.
Compared to the used A2J backbone in our method,
{A2J} \cite{xiong2019a2j} reports results using higher resolution depth as input ($384 \times 384$), deeper backbone (ResNet-152), and 10 backbone model ensemble. {AWR} \cite{huang2020awr} also provides results with model ensemble.
Table~\ref{HANDS2019} shows the performance comparison. we can observe that our method with 3 selected views outperform other methods.
Our method with 1 selected view performs slightly worse than {AWR}, {A2J} and {Rokid}, which can be due to
using model ensemble in {AWR} and {A2J} and using additional synthetic training data in {Rokid} \cite{zhang2020handaugment}.
More experimental results can be found in the supplementary document.
\subsection{4.3 Ablation Study}
\begin{figure}[ht]
\centering
\includegraphics[width=\linewidth]{./fig/uniformly_sample.pdf}
\caption{Uniform sampling schemes. 25 virtual cameras are set uniformly. Red cameras are candidate virtual views. The figures from left to right show how 3, 9, 15, and 25 candidate virtual views are uniformly sampled.}
\label{fig:uniformly_sample}
\end{figure}
\begin{figure}[ht]
\centering
\includegraphics[width=\linewidth]{fig/comp_views.pdf}
\caption{Comparison the visualization results of our method using different numbers of views on NYU dataset.}
\label{fig:comp_views}
\end{figure}
\paragraph{Effect of View Number}
In order to investigate the effect of the number of virtual views with our method, we compare the hand pose performance on NYU dataset, ICVL dataset and Hands19-Task1 dataset by generating 3, 9, 15, 25 uniformly sampled virtual views (``UNIFOMR" column of Table~\ref{error_view_select}).
We also visualize the results of our method using different numbers of views on NYU dataset in Fig.~\ref{fig:comp_views}
We observe that the hand pose estimation error decreases as the number of virtual views increases. Therefore, the virtual multi-view can boost the hand pose performance. The visualization results show that when using 25 views, the estimated wrist joints and joints in the missing depth value area are more accurate than using 3 views.
\begin{table*}[ht]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{c|ccc|ccc|ccc}
\toprule[1pt]
~ & \multicolumn{3}{c|}{NYU} & \multicolumn{3}{c|}{ICVL} & \multicolumn{3}{c}{Hands2019-Task1} \\
\midrule
Number of views & UNIFORM & SELECT & LIGHT & UNIFORM & SELECT & LIGHT & UNIFORM & SELECT & LIGHT \\
\midrule
1 view & 7.93 & 7.23 & 7.34 & 5.56 & 5.18 & 5.16 & 14.39 & 14.03 & 14.14 \\
3 views & 7.14 & 6.73 & 6.82 & 5.27 & 4.85 & 4.86 & 13.67 & 13.07 & 13.24 \\
9 views & 6.77 & 6.43 & 6.53 & 4.96 & 4.77 & 4.77 & 12.81 & 12.60 & 12.67\\
15 views & 6.55 & 6.38 & 6.41 & 4.85 & 4.76 & 4.76 & 12.61 & 12.51 & 12.51 \\
25 views & 6.40 & - & - & 4.79 & - & - & 12.55 & - & - \\
\bottomrule[1pt]
\end{tabular}
}
\caption{Comparison of mean joint error using uniform sampling and view selection on NYU, ICVL and Hands2019-Task1. ``UNIFORM" denotes using uniformly sampled views. ``SELECT" denotes selecting views from 25 uniformly sampled views with the ``teacher'' confidence network. ``LIGHT" denotes selecting views from 25 uniformly sampled views with the ``student'' lightweight confidence network.}
\label{error_view_select}
\end{table*}
\paragraph{Effect of View Selection}
In this section, we investigate if the confidences are effective for view selection.
We use our method to select 3, 9, 15 views from 25 candidate views and compare to uniform sampling as illustrated in Fig.~\ref{fig:uniformly_sample}.
Though simple, the uniform sampling is actually a very strong strategy since it roughly guarantee at least 1 views close to some good candidate.
The results on NYU dataset, ICVL dataset and Hands19-Task1 dataset are shown in Table~\ref{error_view_select}.
For each experiment, we show the performance using teacher and student confidence network (``SELECT'': teacher network, ``LIGHT'': student network).
Our view selection consistently outperforms uniform selection in all the settings, which indicates that the predicted confidence is effective for view selection.
Though using student network results in slightly worse performance than the teacher network, the overall computation cost is significantly reduced.
As shown in Table~\ref{fps_view_select}, using student network almost doubles FPS.
On ICVL dataset, the student network performs better than the teacher network, which may be due to low annotation quality and small scale of ICVL.
More comparisons to random sampled views can be found in the supplementary document.
\begin{table}[t]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{cccc}
\toprule[1pt]
Number of views & UNIFORM & SELECT & LIGHT \\
\midrule
1 view & 61.57 & 27.92 & 47.43 \\
3 views & 56.71 & 28.19 & 46.42 \\
9 views & 41.56 & 27.61 & 39.48 \\
15 views & 36.50 & 27.95 & 34.57 \\
25 views & 26.71 & - & - \\
\bottomrule[1pt]
\end{tabular}
}
\caption{FPS comparison of uniform sampling and view selection on NYU dataset. ``UNIFORM", ``SELECT", ``LIGHT" have the same meaning as shown in Table~\ref{error_view_select}.}
\label{fps_view_select}
\end{table}
\paragraph{Comparison of Different Multi-View Fusion}
We now evaluate the confidence based fusion.
In Table~\ref{confidence}, we compare to direct average without the confidence on NYU dataset, ICVL dataset and Hands2019-Task1 dataset.
The confidence based fusion achieves better performance on 3 datasets than direct average, which shows that the confidence is also beneficial to guide the fusion stage.
\begin{table}[t]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{cccc}
\toprule[1pt]
Component & NYU & ICVL & Hands2019-Task1 \\
\midrule
w confidence & 6.40 & 4.79 & 12.55 \\
w/o confidence & 6.58 & 4.88 & 12.75 \\
\bottomrule[1pt]
\end{tabular}}
\caption{Comparison of mean 3D joint error using different multi-view fusions on 25 uniformly sampled views.}
\label{confidence}
\end{table}
\section{5. Conclusion}
In this paper, we propose a deep learning network to learn 3D hand pose estimation from single depth, which renders the point cloud to virtual multi-view, and get more accuracy 3D hand pose by fusing the 3D pose of each view. Meanwhile, the confidence network we built uses multi-head attention to calculate the confidence of each virtual view. The confidence is used to improve the accuracy of 3D reconstruction during fusion and view selection. In order to obtain the confidence of each view efficiently, we obtain a lightweight confidence network using network distillation. Experiments on the main benchmark datasets demonstrate the effectiveness of our proposed method.
Our method can also inspire several related researches such as scene parsing and reconstruction from depth, etc.
\vspace{5mm}
\noindent \textbf{Acknowledgments} This work was supported by National Natural Science Foundation of China (No.~61473276), Beijing Natural Science Foundation (L182052), and Distinguished Young Researcher Program, ISCAS.
\section{1. Network Details of Confidence Network}
In this section, we elaborate on the network architecture of the ``teacher'' confidence network in Section~3.3 and Fig.~4 of our main submission.
In order to obtain the confidence of each view, our method first uses a convolutional neural network to extract features, then uses multi-head attention \cite{vaswani2017attention} to fuse multi-view features, and finally converts the fused multi-view visual features into the confidence of each view using a fully connected layer.
Fig.~\ref{fig:cnn} shows the details of network architecture of convolutional neural network for feature extraction. The network takes the low-level feature from A2J as input, and adopts 3 convolutional layers for feature encoder.
The network extracts a 256-dimensional feature for each view, and then feeds the extracted features of multiple views to a multi-head attention module \cite{vaswani2017attention} for feature fusion.
In the multi-head attention module, we
set the number of heads $n_{\textit{head}}$ to 1, $d_q, d_k, d_v$ are the dimensions of $Q$, $K$ and $V$ (defined as \cite{vaswani2017attention}), and they are all set to 64.
\begin{figure}[hb]
\centering
\includegraphics[width=\linewidth]{./fig/A2J_Conf.pdf}
\caption{Network details of the convolutional neural network for feature extraction. `K' stands for `kernel size', `S' stands for `stride', and `P' stands for `padding'.}
\label{fig:cnn}
\end{figure}
\begin{table*}[ht]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{c|cc|cc|cc}
\toprule[1pt]
~ & \multicolumn{2}{c|}{NYU} & \multicolumn{2}{c|}{ICVL} & \multicolumn{2}{c}{Hands2019-Task1} \\
\midrule
Number of views & UNIFORM & RANDOM & UNIFORM & RANDOM& UNIFORM & RANDOM \\
\midrule
1 view & 7.93 & 8.81 & 5.56 & 5.96 & 14.39 & 16.18 \\
3 views & 7.14 & 7.33 & 5.27 & 5.28 & 13.67 & 13.97 \\
9 views & 6.77 & 6.68 & 4.96 & 4.93 & 12.81 & 13.07 \\
15 views & 6.55 & 6.52 & 4.85 & 4.88 & 12.61 & 12.92 \\
25 views & 6.40 & 6.41 & 4.79 & 4.83 & 12.55 & 12.83 \\
\bottomrule[1pt]
\end{tabular}
}
\caption{Comparison of mean joint error using uniform sampling and random sampling on NYU, ICVL and Hands2019-Task1. "UNIFORM" denotes using uniformly sampled views. "RANDOM" denotes using randomly sampled views.}
\label{error_uniform_random}
\end{table*}
\section{2. More Experiments}
\subsection{2.1 Comparison between Uniform Sampled Views and Random Sampled Views}
In our paper, we use uniform sampling on a sphere to obtain the candidate virtual views.
In order to investigate the effect of random sampled views on hand pose estimation, we compare the hand pose estimation performance with randomly sampled virtual views and uniformly sampled views on a sphere.
For the experiments of randomly sampled views, the views are randomly sampled from the zenith angle in $[-\pi/3,\pi/3]$ and the azimuth angle in $[-\pi/3,\pi/3]$ on the sphere, and we adopt the same number of virtual cameras as uniformly sampled views.
Table~\ref{error_uniform_random} compares the mean joint error of uniform sampling and random sampling on NYU, ICVL and Hands2019-Task1. We can observe that the performance with random sampled views is inferior to the performance with uniform sampled views.
Conceptually, the patterns of random sampled views are more complex than those of uniform sampling, and make the confidence prediction of random sampled views very hard. Therefore, we choose to use uniform sampling to obtain the candidate virtual views.
\subsection{2.2 Detailed Results on the ICVL Dataset }
\subsubsection{More Comparisons with State-of-the-art Methods}
Fig.~\ref{fig:icvl_error} shows the error of each joint and the percentage of success frames over different error thresholds. Since the best prediction results by AWR on ICVL dataset are not released, we do not show AWR \cite{huang2020awr} in Fig.~\ref{fig:icvl_error}. We can observe that our proposed method outperforms the other methods by a large margin on the ICVL dataset.
Fig.~\ref{fig:comp_STOA} shows the qualitative comparison to the SoTA methods on the ICVL dataset.
Especially, our method performs better at the fingertips than the other methods, e.g. the 1st row, and also performs well under severe occlusions, e.g. the 2nd row.
\begin{figure*}
\centering
\includegraphics[width=\linewidth]{./fig/icvl_error.png}
\caption{Comparison of our proposed method with state-of-the-art methods on the ICVL dataset. Left: 3D distance errors per hand joints. Right: the percentage of success frames over different error thresholds.}
\label{fig:icvl_error}
\end{figure*}
\begin{figure*}[ht]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{ccccccccc}
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/P2P/258.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/V2V/258.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/A2J/258.png} &
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/1view/258.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/3views/258.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/9views/258.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/15views/258.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/25views/258.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/label/258.png} \\
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/P2P/646.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/V2V/646.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/A2J/646.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/1view/646.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/3views/646.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/9views/646.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/15views/646.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/25views/646.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/label/646.png} \\
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/P2P/1262.png} &\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/V2V/1262.png}
&\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/A2J/1262.png} & \includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/1view/1262.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/3views/1262.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/9views/1262.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/15views/1262.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/25views/1262.png}&
\includegraphics[width=0.09\linewidth]{fig/comp_STOA/icvl/label/1262.png} \\
P2P & V2V & A2J & 1 view & 3 views & 9 views& 15 views & 25 views & Ground truth
\end{tabular}
}
\caption{Comparison visualization results with state-of-art methods on ICVL dataset.
``1 view'', ``3 views'', ``9 views'' and ``15 views'' are the results of our method with selected 1, 3, 9 and 15 views from 25 uniformly sampled views, respectively.
``25 views'' denotes the results of our method with 25 uniformly sampled views.
}
\label{fig:comp_STOA}
\end{figure*}
\subsubsection{Effect of View Number}
Fig.~\ref{fig:comp_views} shows the results of our method using different numbers of views on the ICVL dataset.
We can observe that using 25 uniformly sampled views can achieve better hand pose estimation performance than using 3 uniformly sampled views. Especially, the estimated fingertip joints using 25 uniformly sampled views are better.
\begin{figure}[ht]
\centering
\includegraphics[width=\linewidth]{./fig/comp_views_icvl.pdf}
\caption{Qualitative comparison of our method using different numbers of views on the ICVL dataset.}
\vspace{45em}
\label{fig:comp_views}
\end{figure}
| {'timestamp': '2022-03-30T02:30:58', 'yymm': '2203', 'arxiv_id': '2203.15458', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15458'} | arxiv |
\section{Introduction}\label{sec:introduction}}
\IEEEPARstart{A}{nomalous} events are defined as an occurrence of odd incidents. The detection of these events is crucial for providing security. In general, anomalous events can be broadly grouped into three categories namely: spatial anomalies, temporal anomalies and appearance anomalies \cite{ramachandra2020survey}, \cite{chalapathy2019deep}. Spatial anomalies are related to the location of the object with respect to the scene. Temporal and appearance anomalies are based on the trajectories and appearance of the object respectively. The definition of anomaly is mostly subjective and depends on the context of the scene \cite{chalapathy2019deep}. An event that is an anomaly in one scene may be normal in another scene. For instance, a truck on road is normal, while on sidewalk is anomaly. Hence, defining anomaly is challenging. But, accurate and early detection of these events can reduce the risk to human life and thus is an essential aspect of security \cite{santhosh2020anomaly}, \cite{liu2018future}.
\par The current technology available for providing security, analyzes the videos acquired from monitoring systems such as CCTVs installed at fixed locations. These surveillance videos are manually analysed by security personal for detecting anomalies which is time-consuming and tedious process. Therefore, the past few years have seen several works on designing algorithms for detecting anomalous activities in videos \cite{Ionescu_2019_CVPR}, \cite{xu2015learning}, \cite{ma2015anomaly}. However, a majority of existing methods analyse videos from static surveillance cameras installed at fixed locations such as pedestrian walkaway (CUHK Avenue \cite{lu2013abnormal}, Ped1, Ped2 \cite{mahadevan2010anomaly}) Subway entrance/exit \cite{adam2008robust}. In the recent past, a few studies have focused on analysing videos from multiple scenes \cite{liu2018future}. However, the videos analysed in these works contain either minor or no camera motion.
There is hardly any study on detecting anomalous activity in a video acquired by a moving camera. Also, there are very few standard datasets available for the development of multi-scene anomaly detection algorithms.
Last few years have seen an increased interest in using Unmanned Aerial Vehicles (UAVs) for surveillance \cite{teng2021viewpoint}. Compared to a static CCTVs with a fixed coverage area, videos acquired from UAV based surveillance systems can cover larger area with varying perspectives. Besides, UAVs have the advantage of mobility and can be rapidly deployed. Despite the better flexibility and mobility offered by UAV based surveillance system, there are limited works on anomaly detection in videos acquired using UAVs \cite{chriki2021deep},\cite{9219585}, \cite{9341790}. However, the videos for these studies are acquired at a single location (car parking) and the variations in the background scene information are limited. The present study focuses on detecting anomalous activities by analysing videos from UAVs. These videos are acquired at multiple locations (multi-scene) and consist of significant camera motion (Figure \ref{overall}) with varying viewpoints. No published reports are available on this kind of multi-scene anomalous activity detection from UAV aerial videos with significant variations in background scene information.
\begin{figure*}[t]
\includegraphics[width=7.2in,height=2.7in]{Figures/overview_1.png}
\caption{Overview of proposed model: Multi-scene UAV aerial video dataset creation. Object-centric contextual, appearance and temporal features are first extracted from each frame of the aerial video. The inference algorithm is formulated as a multi-class classification algorithm on these extracted features to identify anomalous events. }
\label{overall}
\end{figure*}
In general, an anomaly detection algorithm comprises of two steps namely training and detection \cite{Ramachandra2020}, \cite{Ionescu_2019_CVPR}\cite{doshi2020any}. The training phase consists of developing a model for normal activities using the features extracted from the training videos containing only normal activities. In the detection phase, an anomaly score is assigned to the test video by feeding the same types of extracted features to the developed model.
However, these models are only trained on normal patterns and hence the decision boundary may not accurately discriminate anomalous patterns.
There exist other methods which address the problem of anomaly detection as an outlier detection where all the outliers are considered anomalous \cite{xu2017detecting}, \cite{zhao2011online}, \cite{cheng2015video}. However, these methods fail to detect local anomalies which can be defined as those patterns that are closer to normal patterns but are anomalous in nature. For example, consider a situation of a stationary vehicle present in a parking zone vs a stationary vehicle present on road. Here, the appearance and temporal characteristics of both vehicles are similar. However, the vehicle present on road is an example of a local anomaly since its characteristics are similar to normal patterns. Recently, few studies focuses on features extracted from object of interest (pedestrian). This object centric approach allows to accurately locate the anomalous object in the frame \cite{Ionescu_2019_CVPR}.
The majority of the anomalous activity detection algorithms are developed for single-scene scenarios where the background is constant. Hence, these models cannot be adopted to detect anomalies in multi-scene scenarios such as UAVs where the background changes and hence the context of the scene. In these situations, realizing the context of the scene is important as it facilitates accurate detection of anomalies. For instance, a pedestrian on the road is an anomalous event while a person walking on sidewalk is a normal event. Therefore, the background scene information (road/sidewalk) would be useful in detecting an anomalous event. This work proposes to integrate the background scene information along with appearance and motion information for anomalous activity detection. To the best of our knowledge, there is no existing work on incorporating background scene information for anomalous activity detection.
\par In the present study, an object-centric approach is presented which extracts contextual (background scene), appearance and motion features with a focus on object of interest (vehicles and human). A four class semantic segmentation algorithm is utilized to extract the background scene information, while autoencoder based reconstruction error is utilized for extracting appearance and motion features. Subsequently, an inference algorithm which constitutes a set of one class SVM classifiers, are trained on these features to detect anomalies. This study proposes a new inference algorithm to handle local anomalies. We argue that incorporating features extracted from few anomalous videos can improve the performance of the inference model. The contributions of the research are as follows:
\begin{enumerate}
\item A new multi-scene UAV anomaly detection dataset (MUAAD: Manipal UAV Anomalous Activity Dataset) is presented. This provides a common platform for researchers to compare the developed models for UAV-based anomaly detection.
\item A new object-centric method for anomaly detection is proposed which captures contextual, temporal and appearance-based features. This allows the model to process multi-scene scenarios and detect spatial, temporal and appearance based anomalies.
\item A new inference algorithm is introduced to detect anomalous patterns. This algorithm is trained such that it is capable of detecting local anomalies efficiently which in-turn improves the accuracy of detection.
\end{enumerate}
The structure of the paper is as follows: Section \ref{lite} presents the recent literature regarding the anomaly detection in videos. The details of the proposed dataset is presented in Section \ref{dataseta}. Section \ref{met} describes the methodology for detecting anomalies from UAV aerial videos. Section \ref{res} presents the various results of the proposed system. Finally, conclusion of the paper is given in section \ref{con}.
\section{Related works}
\label{lite}
\par Various approaches have been put forward to solve the issue of anomaly detection in surveillance videos. Also, several datasets are available for the development and evaluation of anomaly detection models. A detailed discussion of these can be found in \cite{ramachandra2020survey}, \cite{santhosh2020anomaly}, \cite{chalapathy2019deep}. In this section, initially, A summary of various datasets available for anomaly detection followed by a brief discussion on various methods proposed for video anomaly detection has been presented.
\subsection{Video anomaly detection datasets}
\par The development of anomaly detection system for videos is dependent on the availability of annotated datasets. Furthermore, they provide a common platform for the researcher to evaluate the developed algorithm. In literature, several popular benchmark datasets are available for anomaly detection \cite{adam2008robust}, \cite{raghavendra2006unusual}, \cite{mahadevan2010anomaly}, \cite{lu2013abnormal}. The Subway dataset proposed in \cite{adam2008robust}, provides videos collected at a subway entrance and exit. The UMN \cite{raghavendra2006unusual} dataset has 11 outdoor video scenes with staged anomalies. In \cite{lu2013abnormal}, the authors proposed CUHK Avenue dataset which has 37 videos collected from a single camera which contains 47 anomalous events. UCSD ped1 and ped2 \cite{mahadevan2010anomaly} are another popular dataset used for anomaly detection. Ped 1 and Ped 2 dataset contains video acquired from two stationary camera overlooking pedestrian walkaways. The videos of UCSD ped1 and ped2 are collected at a low resolution. All these datasets are developed for single-scene video anomaly detection. A few multi-scene video anomaly detection datasets developed are available in literature such as ShangaiTech \cite{liu2018future} and UCF crime \cite{sultani2018real}. ShangaiTech dataset contains videos collected from 13 different scenes with 130 abnormal events. However, all these datasets have videos collected from static CCTV cameras with a limited coverage area and fixed background. In the present study, a new anomaly detection dataset containing the videos acquired from the camera on-board a moving Unmanned Aerial Vehicle (UAV) is proposed. Unlike existing datasets, the proposed dataset contains background scene information in the form of pixel level mask for four classes (greenery, road, construction and water bodies). The contextual scene information can be inferred from these masks which would aid in identifying anomalous activities in multi-scene videos with significant variation in the background information.
\subsection{Video anomaly detection}
\par Video anomaly detection algorithms can be broadly grouped into three categories namely: distance-based methods, probabilistic methods and reconstruction based methods. The distance-based methods construct a model of normal patterns \cite{Ramachandra_2020_WACV}, \cite{Ionescu_2019_CVPR}, \cite{Sabokrou_2018_CVPR}, \cite{ionescu2019detecting}, \cite{ravanbakhsh2018plug}. The distance of test patterns from the model is utilized to estimate the anomaly score. In these methods, handcrafted features \cite{dalal2006human}, \cite{dalal2005histograms}, as well as deep features \cite{ravanbakhsh2018plug}, \cite{sabokrou2018deep}, \cite{xu2015learning}, are widely used to represent the appearance and temporal domain of the object. Subsequently, one class SVMs are popularly used in these methods to identify the decision boundaries of normal patterns required for estimating distances \cite{Ionescu_2019_CVPR}, \cite{xu2015learning}, \cite{ma2015anomaly}. Also, distance metrics such as Mahalanobis is used to measure the distance from normal patterns \cite{sabokrou2018deep}, \cite{sabokrou2017deep}. The probabilistic methods measure anomaly scores in probability space \cite{antic2015spatio}, \cite{kim2009observe}, \cite{benezeth2009abnormal}, \cite{kratz2009anomaly}, \cite{feng2017learning}, \cite{cheng2015video}. Gaussian Mixture Models and Markov Random Fields are popularly used traditional methods \cite{kratz2009anomaly}, \cite{kim2009observe}. In the reconstruction based method, the given input data is converted to a high-level representation or a latent space \cite{Ionescu_2019_CVPR}, \cite{vu2019robust}, \cite{chong2017abnormal}, \cite{hasan2016learning}. Further, these inputs are reconstructed from this high-level representation. Since these models are trained only on normal patterns, any anomalies would produce higher reconstruction errors which are used for determination of anomalies. To this end, auto-encoders are extensively used to transform input to latent space. Recently, GAN based methods are gaining popularity for anomaly detection. However, these methods do not consider the contextual knowledge required for detecting multi-scene video anomalies.
The anomalous activities occur rarely and developing a robust model for detection of anomalous activities is a challenging task. Hence, popular methods proposed in literature are semi-supervised where the model is trained on normal patterns. However, these models fails to detect local anomalies. In this context, this work formulates the inference algorithm such that it utilizes a few samples of anomalous events to identify better decision boundaries. Note that a recent work \cite{doshi2020any} formulated the few shot anomaly detection task as identifying the anomalous activity with few sequential frames of a video. However, our proposed approach utilizes the features from few anomalous videos to learn a more robust model. To the best of our knowledge, very limited work exists that considers minor supervision to anomalous samples to improve the performance of anomaly detection in UAV videos.
\par The scarcity and ambiguous definition of anomalies make it challenging to develop anomaly detection datasets. Also, lack of standard UAV based anomaly detection datasets, make it difficult to develop Computer Aided Decision (CAD) support systems. Hence, it urges to develop a new dataset for detecting anomalous activities in UAV aerial videos. Besides, the existing methods for anomalous activity detection are designed for single-scene videos with a fixed or constant background. Therefore, these approach would have limited success when there is a significant change in the background scene information, such as the video from the camera on-board a moving UAV. The UAV videos contain a different perspective view (topdown) of the scene as compared to the videos acquired from CCTVs. In this regard, the present work aims at the development of CAD systems to detect anomalies from UAV aerial videos. Furthermore, this study presents a novel feature extractor that holistically extracts contextual, temporal and appearance features required for multi-scene video anomaly detection. Also, the present work proposes a new inference algorithm to efficiently determine the decision boundaries needed for the accurate detection of anomalies.
\begin{table*}[t]
\centering
\caption{Comparison of MUAAD with other datasets. }
\label{datasetc}
\begin{tabular}{|c||c|c|c|c|c|c|}
\hline
\textbf{Dataset} & \textbf{Total No. Of Videos}& \textbf{Annotated frames}&\textbf{Anomalous events}& \textbf{Multi-scene}& \textbf{Camera motion}&\textbf{Modality} \\
\hline
CHUK Avenue & 37 &30,652&47& No &Limited camera shake&CCTV\\
\hline
ShanghaiTech &437 &317,398 & 130&\checkmark&-&CCTV\\
\hline
UCSD Ped1 &70&14,000&40&-&-&CCTV\\
\hline
UCSD Ped2 &28&4,560&12&-&-&CCTV\\
\hline
MUAAD (Ours) &60&68,687&92&\checkmark&\checkmark&UAV\\
\hline
\end{tabular}
\end{table*}
\begin{table}[t]
\centering
\caption{Details of the proposed dataset.}
\label{dataset}
\begin{tabular}{|c||c|}
\hline
\textbf{Training videos} & 8 \\
\hline
\textbf{Testing videos} &52 \\
\hline
\textbf{Number of scenes} & 9 \\
\hline
\textbf{Objects considered} & Vehicle, Humans \\
\hline
\textbf{Number of annotated frames} & 68,687 \\
\hline
\textbf{Types of anomalous events} & 7 \\
\hline
\textbf{Occurrence of anomalous events} & 92 \\
\hline
\textbf{Altitude} & 25-30 mts\\
\hline
\textbf{Resolution} & 1280x720p\\
\hline
\textbf{Frame rate} &29.97 frames/second \\
\hline
\textbf{Minimum duration} & 7 seconds \\
\hline
\textbf{Maximum duration} & 1 min 30 seconds\\
\hline
\textbf{Camera motion} & Present\\
\hline
\textbf{Illumination variation} & Present\\
\hline
\end{tabular}
\end{table}
\begin{figure}[t]
\begin{tabular}{cc}
\begin{minipage}{32pt}
\includegraphics[width=1.6in, height=1.2in]{Figures/c1.jpg}
\centering{(a)}
\end{minipage}
&
\hspace{2.7cm}
\begin{minipage}{32pt}
\includegraphics[width=1.6in, height=1.2in]{Figures/p1.PNG}
\centering{(b) }
\end{minipage}
\\
\\
\begin{minipage}{32pt}
\includegraphics[width=1.6in, height=1.2in]{Figures/t1.PNG}
\centering{(c)}
\end{minipage}
&
\hspace{2.7cm}
\begin{minipage}{32pt}
\includegraphics[width=1.6in, height=1.2in]{Figures/pg1.PNG}
\centering{(d)}
\end{minipage}
\\
\\
\end{tabular}
\caption{Few frames from the dataset which contain anomalous event. The anomalous object is shown as a red bounding box. An example of contextual anomaly is shown in (a), while an example of vehicle parked on road is shown in (b). Figure (c) shows an example of vehicle with random trajectories, and (d) shows an example of vehicle parked in no-parking zone. }
\label{dataset_images}
\end{figure}
\begin{figure}[t]
\begin{tabular}{cccc}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=0.8in]{Figures/s1.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=0.8in]{Figures/s2.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=0.8in]{Figures/s3.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=0.8in]{Figures/s7.png}
\end{minipage}
\\
\\
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=0.8in]{Figures/s4.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=0.8in]{Figures/s5.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=0.8in]{Figures/s6.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=0.8in]{Figures/s8.png}
\end{minipage}
\\
\\
\end{tabular}
\caption{Shows a few sample variations in scene of the proposed UAV anomaly detection dataset.}
\label{dataset_images1}
\end{figure}
\section{UAV anomaly detection dataset generation}
\label{dataseta}
\par The present study proposes a new UAV aerial video dataset for anomaly detection. The videos are acquired from the camera on-board a UAV (DJI Phantom 3 drone) at the campus of Manipal Institute of Technology, Manipal, India. We refer to this dataset as Manipal UAV Anomalous Activity Dataset (MUAAD). These videos are acquired at 29 fps and are of resolution 1024x720 pixels. The videos are collected during different time of the day at which maximum vehicular traffic is expected (morning 9am, afternoon 12 noon and evening 4pm). The minimum and maximum duration of the videos are 7 seconds and 1 minute 30 seconds respectively. The videos are collected at an altitude of 25-30 metres. In total, the dataset contains 60 videos collected from nine different locations within the campus.
In the present study, seven general anomalous patterns are considered for annotations, viz. : vehicles parked in a no-parking zone, over-speeding vehicles, frantic trajectories of vehicles, vehicles found on non-pavement areas, pedestrians walking on the road, pedestrians gathering on-road and frantic movements of pedestrians. A few examples of these patterns are highlighted and shown in Figure \ref{dataset_images}. A frame level annotation (normal/anomalous) for each frame in the video is provided for a total of 68,687 frames. All the anomalous frames are labeled as $1$ and normal frames are labeled as $0$. The dataset contains a total of 92 anomalous events distributed in the $60$ videos. A summary of the proposed dataset is given in Table \ref{dataset}. The training and the testing set consists of 8 and 52 videos respectively. The dataset is available at \emph{https://github.com/uverma/MUAAD}
\par The existing anomaly detection datasets contains videos acquired from static CCTV camera at fixed locations \cite{adam2008robust}, \cite{raghavendra2006unusual}, \cite{mahadevan2010anomaly}, \cite{lu2013abnormal}. The videos present in these dataset contain very little or no camera motion. Beside, there is no variation in the background scene information in these videos. As discussed in \cite{ramachandra2020survey}, there is a need to develop anomalous activity detection algorithms in multi-scene videos with significant camera motion. The present study attempts to address this research gap by proposing a new multi-scene moving camera dataset. This dataset (MUAAD) contains videos acquired from the camera on-board a moving UAV and collected at 9 distinct \textit{locations} (multi-scene). A few frames from this dataset is shown in Figure \ref{dataset_images1}. It can be observed that there is significant variation in the background information along with the camera motion. Moreover, the videos acquired from UAV contains a different perspective (topdown) view of the object (vehicles/human) as compared to the front view captured by the CCTVs.
\section{Methodology}
\label{met}
\subsection{Proposed model}
\par This study proposes an object-centric multi-scene video anomaly detection algorithm for UAV surveillance videos. Figure \ref{overall} shows the overview of the proposed UAV based anomaly detection system. In this work, an object-centric approach is adopted, since anomalies are related to the objects (human, vehicles) in the scene.
\par The workflow of the proposed system is as follows: The input to the proposed model is a UAV aerial video frame. Initially, an object detector is used to detect all the objects in the given video frame. Further, temporal and appearance features are extracted for every instance of the object of interest (vehicles/humans) detected in the frame. Also, the given input frame is semantically segmented to capture the contextual information around the detected objects. Finally, the contextual features along with the temporal and appearance features are given as input to the inference algorithm. The inference algorithm assigns an anomaly score for every instance of the object of interest (human/vehicle) present in the scene. The object level score is assigned as the frame level anomaly score if a single object of interest is present in the frame. In case of multiple objects present in the frame, the frame-level anomaly score is thus estimated as the maximum of the anomaly score assigned to these objects.
\subsubsection{Object detection}
\par Normally, anomalous events are associated with the objects in the scene \cite{Ionescu_2019_CVPR}, \cite{doshi2020any}. Therefore, recent work have focused on object of interest in the scene to identify the presence/absence of anomalous events. Moreover, the detection of an anomalous event linked to an object in the scene allows us to identify the location of the anomalous event in the scene \cite{Ionescu_2019_CVPR}.
\par In this work, two classes of objects namely vehicles and humans are considered for anomaly detection. In this study, YoloV3 \cite{redmon2018yolov3} is used to detect these objects in the given scene. YoloV3 is trained from scratch on MUAAD dataset to detect humans and vehicles in each frame of the video.
\subsubsection{Feature extraction}
An anomalous event is generally categorized into three groups namely contextual, temporal and appearance anomaly. Hence, for an accurate prediction of anomalous patterns, it is important to extract contextual, temporal and appearance features. Moreover, in a multi-scene scenario such as videos acquired from a moving UAV, the definition of anomaly depends on the context of the scene. Despite this fact, methods proposed in the literature ignores contextual features. This limits the application of developed methods to multi-scene scenarios. Hence, in the present study, a novel feature extractor is proposed which considers contextual, temporal and appearance features. It is observed that so far these features have not been considered holistically for detecting anomalies in video sequences. However, in the present analysis, for each of the detected object of interest $q$ (vehicle, humans), the contextual ($f^c_q$), temporal ($f^t_q$) and appearance ($f^a_q$) features are extracted. The final feature descriptor $F_q$ for the object of interest $q$ is the combination of $f^c_q$, $f^t_q$ and $f^a_q$ and is of dimension $22$.
\begin{equation}
F_q=\{f^c_q,f^t_q,f^a_q\}
\end{equation}The process for extraction of these features for a particular object of interest $q$ is explained below. Note that for the sake for simpler notation, $f^c$, $f^t$ and $f^a$ refers to the contextual, temporal and appearance features respectively for a particular object of interest $q$ unless otherwise specified.
\begin{figure*}[!ht]
\begin{tabular}{cccccccc}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/2.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/6.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/10.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/12.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/18.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/30.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/17.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/11.png}
\end{minipage}
\\
\\
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/2r.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/6r.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/10r.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/12r.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/18r.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/30r.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/17r.png}
\end{minipage}
&
\hspace{0.5cm}
\begin{minipage}{32pt}
\includegraphics[width=0.8in, height=1in]{Figures/11r.png}
\end{minipage}
\\
\\
\end{tabular}
\caption{Appearance Feature Extraction: A few sample input images (top row) and its corresponding reconstructed images (bottom row). Note that a large reconstruction error is observed in few images representing abnormal event. }
\label{recon}
\end{figure*}
\begin{figure}[!t]
\centering
\includegraphics[width=2.8in,height=4in]{Figures/temp.png}
\caption{Temporal Feature Extraction: Reconstruction of dense optical flow for temporal feature extraction. Note that a large reconstruction error is observed for objects associated with anomalous event.}
\label{temp}
\end{figure}
\par \textbf{Temporal features ($f^t$): }The proposed temporal feature extractor relies on the auto-encoder based reconstruction error computed from the optical flow.
Initially, the dense optical flow \cite{farneback2003two} of the bounding box corresponding to the object of interest is estimated from the two consecutive image frames. These dense motion vectors are represented as RGB color image patches. Further, these RGB image patches are given as input to the auto-encoders. The auto-encoders converts the input image to latent space and back to the image domain using an unsupervised learning method. A few sample images of dense optical flow and the corresponding reconstructed flow is shown in Figure \ref{temp}. Here, the auto-encoders are trained on normal motion patterns. Hence, these auto-encoders fails to reconstruct those motion patterns which deviates from normal patterns thus resulting in a higher reconstruction error. The reconstruction error is computed as the absolute difference between the original input RGB image and the reconstructed image (output of auto-encoder) for each individual color channel ($E^{t}_r, E^{t}_g, E^{t}_b$). The proposed auto-encoder for temporal feature extraction has 4 encoding layers and 3 decoding layers. The overview of the proposed auto-encoder is shown in Figure \ref{autoencoder}. Each layer has a convolution layer followed by a batch normalization layer and an activation layer. In the present study, a filter size of 3x3 is utilized. ReLU activation function is used. In the end, softmax layer is applied to reconstruct the input image. Further, first-order statistical features such as mean ($S^{t}_1$), variance ($S^{t}_2$), kurtosis ($S^{t}_3$), energy ($S^{t}_4$), skewness ($S^{t}_5$) and entropy ($S^{t}_6$) \cite{sainju2014automated}of the reconstructed image patch along with the reconstruction error ($E^{t}_r, E^{t}_g, E^{t}_b$) produced by the model are considered as the temporal feature vector for the object and is given by:
\begin{equation}
f^t=\{E^{t}_r,E^{t}_g,E^{t}_b,S^{t}_1,S^{t}_2,S^{t}_3,S^{t}_4,S^{t}_5,S^{t}_6\}
\end{equation}
\par \textbf{Appearance features ($f^a$): } An appearance feature extractor is defined similar to the temporal feature extractor. In particular, the appearance feature extractor consists of an auto-encoder whose input is the image patch corresponding to object of interest. The model is trained to reconstruct the normal objects. Hence, any new/anomalous objects will produce a higher reconstruction error. A few samples of detected objects and their reconstructed image is shown in Figure \ref{recon}. The reconstruction error in the RGB ($E^{a}_r, E^{a}_g, E^{a}_b$) color plane along with first-order statistical features mean ($S^{a}_1$), variance ($S^{a}_2$), kurtosis ($S^{a}_3$), energy ($S^{a}_4$), skewness ($S^{a}_5$) and entropy ($S^{a}_6$) is considered as appearance feature vector which is given as follows:
\begin{equation}
f^a=\{E^{a}_r,E^{a}_g,E^{a}_b,S^{a}_1,S^{a}_2,S^{a}_3,S^{a}_4,S^{a}_5,S^{a}_6\}
\end{equation}
\par \textbf{Contextual features ($f^c$): } Semantic segmentation algorithms assigns pixel level labels to each individual pixels in the image and are widely used to realize the context of the scene \cite{cordts2016cityscapes}, \cite{girisha2021uvid}. A similar approach is considered to extract contextual information required for anomaly detection. UVid-Net proposed in \cite{girisha2021uvid}, is used to semantically segment the given UAV aerial video frame. UVid-Net is the state-of-the-art algorithm for semantic segmentation of UAV aerial videos. A brief overview of UVid-Net is provided below: UVid-Net is an encoder-decoder based architecture which incorporates temporal information for semantic segmentation for aerial videos. The two consecutive keyframes as the input to the encoder ensures that the segmentation output contains temporally consistent labels without the need for any additional sequential module. Besides, a modified decoder module consisting of multiplication operation instead of concatenation produces a much finer segmentation result. More details about this architecture can be found in \cite{girisha2021uvid}.
In this work, UVid-Net is trained to segment the given frame into four classes namely greenery, construction, roads and water bodies. These four broad semantic classes help in modeling the background scene information which can be utilized to learn context of the scene.
\par Generally, the bounding box produced by the object detectors are small and tight around the object. Also, context of the object is determined by its surrounding pixels. Hence, in this work, a small region $R_{q}$ (4 pixel width) around and within the bounding box of the detected object is considered for extracting contextual information. Further, the total number of occurrence of the four class labels (greenery, construction, roads and water bodies) is computed in the identified small region $R_{q}$. This histogram of class labels defines the context around the object and is considered as the contextual feature. For instance, in case of object situated on the road, pixels belonging to the road class will have a maximum count in the histogram (Figure \ref{contextual}). Let us represent the four bins of the histogram as $H_{1}, H_{2}, H_{3}, H_{4}$ corresponding to the total number of the occurrence of the pixels belonging to greenery, road, construction and water classes respectively in the small region $R_{q}$. The contextual feature vector is then defined as:
\begin{equation}
f^c=\{H_1,H_2,H_3,H_4\}
\end{equation}
\begin{figure*}[t]
\centering
\includegraphics[width=5.8in,height=1.8in]{Figures/autoencoder.png}
\caption{Architecture of the auto-encoder.}
\label{autoencoder}
\end{figure*}
\begin{figure}[t]
\centering
\includegraphics[width=3.5in,height=1.5in]{Figures/con_1.png}
\caption{Contextual Feature Extraction: The distribution of pixels belonging to four background classes is utilized for representing contextual information around the object of interest. }
\label{contextual}
\end{figure}
\subsubsection{Model Training}
This section describes the training procedure adopted for training the object detector, auto-encoders and UVid-Net for object detection and feature extraction. It may be noted that object detector, temporal, appearance and contextual feature extractor modules are trained independently of each other as described below. In the present study, two generic classes of objects (vehicles, humans) are considered for detecting anomalies.
\par \textbf{Object detector:}The YoloV3 \cite{redmon2018yolov3} model is trained on UAV aerial images to detect vehicles and humans. To this end, 300 UAV aerial images are selected from MUAAD dataset and annotations are provided for objects vehicles and humans. These images and annotations are further utilized for training the YoloV3 model. The K-Means algorithm is used to determine the sizes of 9 anchor boxes. The model is trained for 250 epochs with Adam optimizer and learning rate set to 0.01.
\par \textbf{Feature extractor:} From the training data, objects representing normal patterns are manually cropped to create a training set for appearance auto-encoder. In addition, dense optical flow for these cropped images is estimated to create a training set for temporal auto-encoders. The two auto-encoders are trained separately using Binary cross-entropy loss function and Adam optimizer. Also, data augmentation is employed to increase the training dataset size and prevent the model from overfitting. Various image transformations such as flipping, rotation, translation and shearing are utilized to augment data. Subsequently, these augmented data is utilized for training the auto-encoders. For contextual feature extractor, the UVid-Net model is trained on ManipalUAVid dataset \cite{girisha2021uvid} to semantically segment the given aerial image into four classes. The categorical-cross-entropy loss is used with Adam optimizer to train the UVid-Net.
\subsubsection{Inference}
\par In the present study, a new inference algorithm is proposed for detecting anomalies. In the literature, it is observed that the anomaly detection models are solely trained on normal patterns due to the rarity of abnormal events. However, these algorithms may fail to detect local anomalies since the decision boundaries are determined based on normal patterns exclusively. The local anomaly is referred to as the anomalous events which closely resembles a normal event. Hence, in the present study, a learning strategy is proposed to address the issue of local anomalies. In this strategy, the inference algorithm is trained on a larger set of normal patterns and a limited set of anomalous patterns. The inclusion of a smaller set of anomalous patterns allows the model to identify better decision boundaries and aids in improved accuracy.
\par The proposed method is inspired by the inference algorithm presented in \cite{Ionescu_2019_CVPR}. In \cite{Ionescu_2019_CVPR}, the authors proposed to train $K$ SVM classifiers on $K$ clusters of normal patterns to create a model for $K$ normal events. Subsequently, the score from binary classifiers in one-vs-rest scheme is utilized to determine the anomalous events. The use of one-vs-rest scheme creates artificial dummy abnormal events (one normal vs others dummy abnormal events). However, this approach considers only normal patterns to identify decision boundaries. In this work, we propose incorporating a limited set of anomalous event in multi-class classification for anomalous activity detection to learn better discriminative decision boundaries. This work first train two disjoint sets of SVM classifiers, one trained only on normal events and other trained only on abnormal events. During inference, the maximum classification scores from these two sets of classifiers for the test sample are compared to identify the anomalous events.
\par The $22$ dimension feature vector extracted by the proposed feature extractor is used to train the inference algorithm. Let the given training set $T$ consists of $M$ normal samples and $N$ anomalous samples, where $N<<M$. Further, the K-Means algorithm is employed to cluster the $M$ normal samples and $N$ anomalous samples into $K^1$ and $K^2$ groups respectively. Subsequently, we initialize an SVM classifier for each of the $K^1+K^2$ clusters which results in $K=K^1+K^2$ SVM classifiers. The SVM classifier initialized for normal patterns is trained to classify normal patterns while SVM classifiers trained on anomalous patterns are trained to classify anomalous patterns. While training $i^{th}$ SVM classifier, the samples belonging to other clusters $K-1$ clusters are considered anomalous patterns. Hence, each SVM classifier is trained as a binary classifier. Since these classifiers are trained on the training set $T$ which consists of both normal and anomalous patterns, the decision boundaries identified will be tuned to separate local anomalies. Note that the sample here refers to the feature vector corresponding to a particular object.
During the test time, for every detected object in the given frame, we extract the feature vector $F$. This feature vector is classified by $K$ SVM classifiers. Further, we calculate the scores as follows:
\begin{eqnarray}
\alpha=max(m_1,m_2,...m_{k^1})\\
\beta = max(n_1,n_2,...n_{k^2})
\end{eqnarray}
here, $\alpha$ represents the maximum score of $K^1$ SVM classifiers of normal patterns, while $\beta$ represents the maximum score of $K^2$ SVM classifiers of anomalous patterns. A value of $\alpha$ significantly higher than $\beta$ indicates that the object represents an normal event, while $\alpha < \beta$ indicates an abnormal event corresponding to the object. Therefore, the samples satisfying the following criterion is regarded as normal objects:
\begin{equation}
\label{Eqn:CondNorm}
\alpha > \beta ~~AND ~~\alpha > \mu
\end{equation}
where $\mu$ is a parameter determined experimentally and $AND$ is a logical AND operator. Similarly, the samples satisfying the following condition is considered as abnormal objects:
\begin{equation}
\label{Eqn:CondAbNorm}
\alpha < \beta~~ AND~~ \beta > \nu
\end{equation}
where $\nu$ is a parameter determined experimentally and $AND$ is a logical AND operator. Moreover, if any samples does not satisfy any of the above two conditions (Eqn \ref{Eqn:CondNorm} and \ref{Eqn:CondAbNorm} ), it is regarded as anomalous object. The above conditions ensure that the object which has been classified by one of the $K^1$ classifiers with a high confidence (high $\alpha$) is regarded as an object associated with normal event. Similarly, the object for an abnormal event would be classified by one of the $K^2$ classifiers with high confidence (high $\beta$). Moreover, it is not possible to model all the possible anomalous activities. Therefore, an object classified as anomalous with less confidence (low $\beta$) is also considered as anomalous event.
The final frame level anomaly score is computed as the maximum of all the score obtained by the object present in the frame.
\par In general, a new test sample may belong to one of the three groups namely \emph{normal pattern}, \emph{anomalous pattern} and \emph{unknown pattern}. Unknown patterns are those patterns that are new to the model and may be anomalous. Hence, these patterns should also raise an alarm. Moreover, the sensitivity of anomaly detectors to normal and anomalous patterns plays an important role in providing security. In this regard, this paper presents a simple logic to control the sensitivity of the model to normal and anomalous patterns. Here, the threshold value $\mu$ and $\eta$ are used to regulate the model sensitivity to normal and anomalous patterns respectively. A given test sample is considered as a normal pattern if $\alpha > \beta$ and $\alpha>\mu$. Further, the given test sample is considered anomalous if $\alpha < \beta$ and $\beta>\eta$ . Else, the test sample is considered as an unknown pattern. By increasing the value of $\mu$ and $\eta$, the model's responsiveness to the normal and abnormal patterns reduces. Hence, these parameters can be used to control the effectiveness of the anomaly detector depending on the application. The selection of these parameters are discussed in section \ref{parameters}.
\section{Results and discussion}
\label{res}
The proposed algorithm is evaluated on the MUAAD dataset containing the videos acquired from a moving UAV at multiple locations. As discussed earlier, the existing datasets (Ped1, Ped2, ShanghaiTech) focuses on single scene videos acquired from static cameras with little or no camera motion. Since, the proposed algorithm is designed for a multi-scene scenario, it wont be prudent to evaluate the performance of the proposed algorithm on existing single scene datasets. Moreover, the existing datasets does not provide pixel level labels required for extracting contextual information.
This section first presents the performance metrics (Section \ref{SubSec:metrics}), and the approach utilized to select the parameters of the proposed approach (Section \ref{parameters}). Subsequently, the performance of the proposed contextual feature extractor is studied in Section \ref{SubSec:EvaluationOfContextual}, while the performance of the proposed inference algorithm is discussed in Section \ref{SubSec:EvaluationOfInference}. Finally, the proposed approach is compared with the existing methods in Section \ref{SubSec:ComparisonWithOtherMethods}.
\begin{figure*}[t]
\begin{tabular}{cc}
\begin{minipage}{32pt}
\includegraphics[width=3in, height=1.8in]{Figures/Line_plotN0N20N40.png}
\centering{(a)}
\end{minipage}
&
\hspace{7cm}
\begin{minipage}{32pt}
\includegraphics[width=3in, height=1.8in]{Figures/Line_plot_N60.png}
\centering{(b)}
\end{minipage}
\\
\begin{minipage}{32pt}
\includegraphics[width=3in, height=1.8in]{Figures/Line_plot_n80.png}
\centering{(c)}
\end{minipage}
&
\hspace{7cm}
\begin{minipage}{32pt}
\includegraphics[width=3in, height=1.8in]{Figures/Line_plot_N100.png}
\centering{(d)}
\end{minipage}
\\
\\
\end{tabular}
\caption{AUC comparison of proposed method with different values of $N$, $K_1$ and $K_2$. (a) shows the AUC comparison with $N=\{0,20,40\}$. (b), (c) and (d) shows the AUC comparison at $N=60$, $N=80$ and $N=100$ respectively. }
\label{NK1K2}
\end{figure*}
\subsection{Performance metric}
\label{SubSec:metrics}
\par Several recent works of literature used Area under the ROC Curve (AUC) metric to evaluate the performance of anomaly detector \cite{Ionescu_2019_CVPR},\cite{doshi2020any},\cite{cong2011sparse},\cite{liu2018classifier}. Following their procedure, in the present study, the AUC metric is used for evaluating the performance of the proposed method. In this method, the frame-level anomaly score is compared against the ground truth frame level annotation, to compute the AUC. Specifically, the frame level AUC is computed from the frame level total positive rate and false positive rate. As discussed earlier, a frame is considered anomalous if it contains at least one object with abnormal activity.
\subsection{Parameter selection}
\label{parameters}
\par This section discusses the selection of parameters used in the proposed model such as the number of normal $K^1$ and abnormal $K^2$ clusters and the thresholds $\mu$ and $\eta$. It may be noted that a normal/anomalous sample for the inference model refers to the feature vector associated with normal/anomalous object of interest.
\par \textbf{Selection of $K^1$ and $K^2$:} The parameters $K^1$ and $K^2$ represent the number of clusters in normal and anomalous training sample and has an influence on the performance of the model . The values for these two parameters are determined experimentally. The AUC metric is studied for different pair of values of $K^1$ and $K^2$. The $K^1$ value is selected from the set $\{2,4,6,8\}$ while $K^2$ value is selected from the set $\{2,3,4\}$and a grid search like method is employed to find the optimal value. It may be noted that a lower values of the number of anomalous cluster $K^2$ was considered due to limited number of anomalous samples present in the dataset. The maximum AUC of 0.712 was observed for $K^1 = 4$ and $K^2 = 3$ (Figure \ref{NK1K2} (b)).
Given the limited number of anomalous samples ($N$) available in the dataset, we also studied the effect on $K^1$ and $K^2$ due to variation in the number of anomalous samples $N$. Figures \ref{NK1K2} shows the AUC obtained by varying $N$, $K^1$ and $K^2$. It can be observed that a maximum AUC of $0.712$ is obtained for $N=60$, $K^1=4$ and $K^2=3$. This AUC is slightly higher than $N=100$, $K^1=4$ and $K^2=2$. Also, it is observed that the AUC obtained for $K^2=\{2,3,4\}$ are closer by at $N=60$ and $k^1=4$. Therefore, in the present study, $K^1$ and $K^2$ value is determined to be $4$ and $3$ respectively.
\par \textbf{Selection of $\mu$ and $\eta$:} The parameters $\mu$ and $\eta$ (Equations \ref{Eqn:CondNorm}, \ref{Eqn:CondAbNorm} ) determines the sensitivity of the proposed inference model. A given pattern is considered normal if the the maximum score of normal SVM classifiers ($\alpha$) is greater than the maximum score of abnormal SVM classifiers ( $\beta$) and the threshold $\mu$. Consequently, regulating the $\mu$ value allows us to control the sensitiveness of the model to normal patterns. For example, a higher value of $\mu$, determines the given pattern as normal if the confidence score ($\alpha$) is greater than $\mu$. This allows the model to identify normal patterns with more confidence. On the contrary, reducing the $\mu$ value allows the model to determine normal patterns with a lower degree of confidence. Similarly, threshold $\eta$ controls the model's sensitivity to anomalous patterns. Hence, $\mu$ and $\eta$ values should be selected carefully.
\par In the present study, $\mu$ value is selected from set $\{0.4, 0.5, 0.6, 0.7, 0.8\}$. Concerning anomaly detection, it is always desirable to have a model with high sensitivity to anomalous patterns. Hence, in the present study, $\eta$ is selected from a lower set of threshold values $\{0.5, 0.6, 0.7, 0.8\}$.
The grid search method is used to determine the optimal value of $\mu$ and $\eta$. This experiment is conducted by setting the values of $N$, $K^1$ and $K^2$ to 60, 4 and 3. The AUC of the proposed model with different values of $\mu$ and $\eta$ is estimated and is plotted in Figure \ref{thresh}. It was found that the AUC of the model reaches $0.0.712$ when $\mu$ is set of $0.5$ and $\eta$ set to $0.5$. Since the model is trained on a smaller set of anomalous patterns, reducing the sensitivity of the model to anomalous patterns (increasing the $\eta$) reduces the AUC of the model. Hence, for a higher value of $\eta$, the AUC of the model reduces. In the present study, $\mu$ and $\eta$ values are determined to be $0.5$ and $0.5$ respectively.
\begin{figure}[t]
\centering
\includegraphics[width=3in,height=1.7in]{Figures/Threshold_line_plot.png}
\caption{AUC comparison of proposed method with different values of $\mu$ and $\eta$.}
\label{thresh}
\end{figure}
\subsection{Evaluation of contextual knowledge}
\label{SubSec:EvaluationOfContextual}
The performance of anomaly detection algorithms in a multi-scene scenario depends on contextual knowledge about the scene. The proposed work uses appearance features to realize the appearance change of the object while contextual feature builds a summary of the background scene information around the object. To this end, in the present study, a given UAV aerial scene is semantically segmented to realize the layout of the scene. Subsequently, a histogram of class labels is calculated around the object. Finally, this histogram is considered as a feature vector along with the appearance and temporal features to describe the object. This feature vector is further given to the inference algorithm to decide on the anomaly. In the present study, an experiment is executed to evaluate the influence of contextual knowledge on the performance of anomaly detection. In this experiment, the performance of the proposed model is compared \textit{with} contextual information and \textit{without} contextual information. Initially, the performance of the model is evaluated using appearance and temporal features. Subsequently, the performance of the model is evaluated using contextual, appearance and temporal features. In this experiment, the proposed inference algorithm is utilized to infer the anomalies. The AUC of the proposed model with and without contextual information is shown in Table \ref{ct}. It was found that there was a significant improvement in AUC (0.712 vs 0.675) of the proposed model with contextual knowledge. This result is significant as it demonstrates the importance of contextual knowledge in a multi-scene scenario.
\par To qualitatively evaluate the importance of contextual knowledge, we visualized the feature vector with and without contextual knowledge. A total of random $400$ sample patterns are considered among which $200$ belongs to normal patterns and $200$ belongs to anomalous patterns. Let the feature vector with contextual knowledge be represented as $F_{1}$ and without contextual knowledge be represented as $F_{2}$. The dimension of the considered feature vectors $F_{1}$ and $F_{2}$ are $22$ and $18$ respectively. Dimensionality reduction is essential to visualize these feature vectors. To this end, Principal Component Analysis (PCA) is employed to reduce the feature dimensions of $F_{1}$ and $F_{2}$ to two Subsequently, we plotted the features in 2D space. This is shown in Figure \ref{WOSS} and Figure \ref{WSS}. From these figures, it is observed that the feature vector $F_{2}$ discriminates normal and anomalous patterns efficiently. Hence, the inclusion of contextual knowledge aids one-class SVMs to determine better decision boundaries. This further substantiates the improvement in AUC of the model with contextual information. This experiment demonstrates that importance of contextual knowledge in the detection of anomalous patterns from the multi-scene scenario.
\par Further, we compared the anomaly score at the frame level of the proposed model with and without contextual knowledge. Figure \ref{anomaly_score}, shows the frame-level AUC comparison of the proposed model on few multi-scene aerial video samples. These video samples constitute contextual anomalies such as stationary vehicles on the greenery, road. It is observed that the proposed model with contextual knowledge produces a higher anomaly score for anomalous frames. However, the proposed model without contextual knowledge produces a lower anomaly score. This result is anticipated since appearance and temporal features alone are not adequate enough to detect contextual anomalies. However, the proposed feature extractor which encapsulates contextual, appearance and temporal features holistically, can effectively detect these anomalies. Besides, the inclusion of contextual information helps in better identification of anomalous frames as compared to the model without any contextual information. It can be observed in Figure \ref{anomaly_score} that a higher number of anomalous frame are correctly classified as anomalous by incorporating contextual information. This experiment demonstrates the importance of contextual knowledge in multi-scene anomaly detection.
\begin{figure}[t]
\centering
\includegraphics[width=3in,height=2in]{Figures/wos.png}
\caption{Plot of normal and anomalous feature vectors without contextual knowledge. }
\label{WOSS}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[width=3in,height=2in]{Figures/ws.png}
\caption{Plot of normal and anomalous feature vectors with contextual knowledge. }
\label{WSS}
\end{figure}
\begin{table}[t]
\centering
\caption{AUC comparison of proposed method with and without contextual knowledge.}
\label{ct}
\begin{tabular}{|c||c|}
\hline
\textbf{Proposed method} & \textbf{AUC}\\
\hline
\hline
With contextual knowledge &\textbf{0.712}\\
\hline
Without contextual knowledge& 0.6753\\
\hline
\end{tabular}
\end{table}
\begin{figure*}[t]
\centering
\includegraphics[width=7in,height=3.4in]{Figures/cont_exp2.png}
\caption{Anomaly score comparison of proposed model with and without contextual knowledge. The red region in the plot indicates the anomalous frames. The first row show the frame-level anomaly score of the proposed model with contextual knowledge. Second row shows the frame-level anomaly score of the proposed model without contextual knowledge. The bottom row shows a sample frame from the video with the anomalous object. }
\label{anomaly_score}
\end{figure*}
\subsection{Evaluation of inference algorithm}
\label{SubSec:EvaluationOfInference}
A majority of existing woks utilizes only normal pattern to model the normal events. Hence, the decision boundaries are tuned to identify normal patterns and may fail to detect local anomalies. For example, in the case of UAV aerial videos, a car parked in the parking area and on the road may have similar appearance characteristics. However, a car parked on road is an example of local anomalies since its attributes are closer to normal patterns. Hence, an inference algorithm trained only on normal patterns may not be sufficient to distinguish these local anomalies. In the present study, we argue that training the model on few samples of known anomalous patterns can significantly improve the performance of the model. In this context, we visualized the decision boundaries of $K^1$ and $K^2$ SVM classifiers. To this end, we considered $300$ normal samples and $100$ anomalous samples. Figure \ref{decision_boundaries} (a) shows the scatter plot of considered samples. Few examples of local anomalies are highlighted in RED. An inference algorithm trained only on normal patterns may not distinguish these samples. However, we can observe that the decision boundaries identified by $K^1$ SVM classifiers are effectively separating local anomalies since they are trained using both normal and few anomalous samples. Hence, the proposed model can classify local anomalies more accurately. This result validates the assumption of considering few anomalous samples in identifying the decision boundaries.
\subsubsection{Evaluating the influence of number of anomalous events} The rarity of anomalous samples poses a significant challenge for the development of anomaly detection algorithms. The proposed work utilizes few samples of anomalous patterns along with normal patterns to determine the decision boundaries. The inclusion of few anomalous samples allows the SVM classifiers to determine accurate decision boundaries thereby improving anomaly detection. In this context, an experiment is performed to learn the influence of anomalous samples on anomaly detection. In this experiment, the proposed inference algorithm is evaluated with different values of number of anomalous events ($N$). The N value is selected from the set $\{0, 20, 40, 60, 80, 100\}$. The M value (number of normal training samples) is set to $300$. In every iteration of the experiment, $N$ anomalous training samples are selected randomly. The grid search approach is utilized to determine the parameters of SVM classifiers. Grid search is a hyperparameter tuning method that implements exhaustive searching to determine the hyperparameters. Figure \ref{fig_N}, shows the AUC of the proposed method with different values of $N$. At $N=0$, the model is trained only on normal samples. Hence, the decision boundaries may fail to accurately classify anomalous samples. Consequently, it is seen that the proposed method achieves an AUC of $0.665$ at $N=0$. However, as the N value increases, the AUC of the algorithm increases and reaches an AUC of $0.712$ at $N=60$. An important observation here is that at $N=20$, the model achieved an AUC of $0.697$ which is notably greater than the AUC ($0.665$) obtained at $N=0$. This is a significant result since it demonstrates the importance of a \emph{few anomalous samples} in identifying the decision boundaries for accurate anomaly detection.
\begin{figure}[t]
\centering
\includegraphics[width=3in,height=1.7in]{Figures/plotN.png}
\caption{AUC comparison of proposed model with different values of N. The best $K_1$ and $K_2$ values are considered for the comparison of the performance.}
\label{fig_N}
\end{figure}
\begin{figure*}[!ht]
\begin{tabular}{cc}
\begin{minipage}{32pt}
\includegraphics[width=3in, height=1.8in]{Figures/local_1.png}
\centering{(a)}
\end{minipage}
&
\hspace{7cm}
\begin{minipage}{32pt}
\includegraphics[width=3in, height=1.8in]{Figures/nor_clf_wa.png}
\centering{(b)}
\end{minipage}
\\
\begin{minipage}{32pt}
\includegraphics[width=3in, height=1.8in]{Figures/ano_clf.png}
\centering{(c)}
\end{minipage}
&
\hspace{7cm}
\begin{minipage}{32pt}
\includegraphics[width=3in, height=1.8in]{Figures/nor_clf.png}
\centering{(d)}
\end{minipage}
\\
\\
\end{tabular}
\caption{Visualization of decision boundaries of SVM classifiers. (a) shows the scatter plot of normal and anomalous samples. (b) shows the decision boundaries of SVM classifiers trained on normal and few samples of anomalous patterns. (c) shows the decision boundaries of SVM classifiers trained on anomalous samples. (d) show the decision boundaries of SVM classifiers trained on normal samples only.}
\label{decision_boundaries}
\end{figure*}
\par As discussed earlier, the proposed inference algorithm is inspired by the work of \cite {Ionescu_2019_CVPR} which formulated abnormal event detection as multi-class classification problem. Therefore, we also evaluate the proposed inference algorithm by comparing it with the inference algorithm proposed in \cite{Ionescu_2019_CVPR}. In this experiment, we utilized the proposed feature extractor to extract contextual, temporal and appearance features. Subsequently, the performance of proposed and existing \cite{Ionescu_2019_CVPR} inference algorithms are studied for inferring the anomaly. Note that the existing inference algorithm is only trained on normal patterns with the number of clusters set to $5$. The proposed inference algorithm is trained on normal and known anomalous patterns with $K^1$ set to $4$ and $K^2$ set to $3$. Table \ref{it} shows the AUC results of the two inference algorithm on the proposed UAV anomaly detection dataset with different feature extractors. It is found that the temporal features produced higher AUC as compared to contextual and appearance features on the existing and proposed inference algorithms. This result is justified by the fact that the MUAAD dataset has higher temporal anomalies due to object motion. Further, it is seen that contextual features alone are not sufficient to detect anomalies in UAV aerial videos. However, by considering the appearance, temporal and contextual features holistically, the performance of the existing and the proposed inference algorithm improved significantly. Specifically, the proposed and the baseline inference algorithm achieved an AUC of 0.712 and 0.648 respectively. It was found that the proposed inference algorithm produced a significant improvement in AUC ($7\%$) as compared to \cite{Ionescu_2019_CVPR}. This finding confirms that the decision boundaries identified by the proposed inference algorithm are tuned to separate both normal and anomalous patterns.
Furthermore, the proposed feature extractor has improved the performance of both proposed and baseline inference algorithm. This improvement is consistent and hence validates the proposed feature extractor for UAV anomaly detection.
\begin{table}[!t]
\centering
\caption{AUC comparison of proposed model with different inference algorithm feature extractor.}
\label{it}
\begin{tabular}{|c||c|}
\hline
\textbf{Inference method} & \textbf{AUC}\\
\hline
\hline
Ionescu et al.(Appearance features) &0.587\\
\hline
Ionescu et al.(Temporal features) &0.6028\\
\hline
Ionescu et al.(Contextual features) &0.566\\
\hline
Ionescu et al.(Proposed feature extractor) &0.648\\
\hline
Ours (Appearance features) &0.5973 \\
\hline
Ours (Temporal features) &0.6332 \\
\hline
Ours (Contextual features) &0.5513 \\
\hline
Ours (Proposed feature extractor) &\textbf{0.712} \\
\hline
\end{tabular}
\end{table}
\subsection{Comparative study}
\label{SubSec:ComparisonWithOtherMethods}
\par In the present study, two semi-supervised anomaly detection algorithms are considered as baseline models. In the first method \cite{Ionescu_2019_CVPR}, the authors proposed to use auto-encoders to extract features. Subsequently, SVM based inference algorithm is utilized to infer the anomalies. In \cite{doshi2020any}, the authors proposed a continual learning approach using the KNN algorithm to detect anomalies in videos. In addition, the proposed method is also compared with the approaches proposed in \cite{astrid2021synthetic} and \cite{li2021two}. Both these methods are based on auto-encoders and are non-object centric. All these methods are designed for CCTV videos. Here it is important to note that, the feature extractor of the proposed model is improved upon the feature extractor proposed in \cite{Ionescu_2019_CVPR} and \cite{doshi2020any}. Furthermore, the inference algorithm is designed based on the idea proposed in \cite{Ionescu_2019_CVPR}.
\par The AUC results of the proposed and compared methods on UAV anomaly detection dataset is given in Table \ref{compt}. It was found that the methods proposed in \cite{Ionescu_2019_CVPR} and \cite{doshi2020any} achieved an AUC of $0.568$ and $0.641$ respectively on UAV anomaly detection dataset. The methods proposed in \cite{astrid2021synthetic} and \cite{li2021two} achieved an AUC of $0.487$ and $0.359$ respectively on MUAAD dataset. These methods \cite{astrid2021synthetic}, \cite{li2021two} are designed for CCTV videos where the background is constant with little or no camera motion. However, UAV aerial videos contains significant camera motion. Hence, the temporal features extracted by these methods may produce false positives in the presence of camera motion. In addition, the methods proposed in \cite{astrid2021synthetic} and \cite{li2021two} are non-object centric. Hence, a higher reconstruction error will be observed in a multi-scene scenario such as UAV aerial video. These high reconstruction error would be due to variation in background information and need not represent an actual anomalous event. This contributes in higher false positives and lower AUC. This result is significant as it highlights the effectiveness of object centric methods in a multi-scene scenario. The proposed \textbf{object-centric method} uses auto-encoders and optical flow to extract temporal features. Since the auto-encoder is trained on normal motion patterns, it produces in higher reconstruction error for anomalous patterns. Also, the proposed method calculates temporal features concerning the object bounding box which further reduces the influence of camera motion on temporal features. It can be observe that the proposed method achieved an AUC of $0.712$ which is significantly greater than baseline models.
\par Furthermore, the UAV anomaly detection dataset has videos taken from various locations (multi-scene scenarios). Also, each video constitutes camera motion. Hence, the context of the scene differs within a video. In these situations, realizing the context of the scene aids in improving the performance of anomaly detection. Despite this interest, the baseline models ignore contextual features. However, the proposed method captures the contextual knowledge required for context-aware anomaly detection. This result is significant since the definition of anomaly is dependent on the context of the scene which is generally ignored in the literature. The proposed method highlights the importance of contextual information required for the accurate detection of anomalies in multi-scene scenarios such as UAV.
\begin{table}[!t]
\caption{AUC comparison of proposed and other methods.}
\label{compt}
\centering
\begin{tabular}{|c||c|}
\hline
\textbf{Algorithm} & \textbf{AUC}\\
\hline
\hline
Ionescu et al.\cite{Ionescu_2019_CVPR} & 0.568\\
\hline
Doshi et al. \cite{doshi2020any}& 0.641 \\
\hline
Li T et al. \cite{li2021two}&0.359\\
\hline
Astrid et al.\cite{astrid2021synthetic}& 0.487\\
\hline
Ours & \textbf{0.712} \\
\hline
\end{tabular}
\end{table}
\section{Conclusion}
\label{con}
This work is intended to develop a video anomaly detection algorithm for UAV aerial videos. A new multi-scene UAV anomaly detection dataset is proposed to address the lack of standard datasets for anomaly detection in UAV surveillance videos. The proposed dataset has scene variations and camera motion that provides a standard challenging platform for researchers to develop and evaluate their algorithms. Frame-level annotations are provided for 52 UAV aerial videos. Further, two baseline models are implemented and evaluated for validating the dataset.
\par This study also introduces a new UAV video anomaly detection algorithm that holistically uses contextual, temporal and appearance features to detect the anomalies. Furthermore, a novel inference algorithm is presented that uses a few-shot learning strategy to infer the anomalies. The proposed algorithm achieved an AUC of 0.712 which is significantly greater than the compared baseline models. The extensive evaluation of the proposed model revealed that contextual knowledge plays a significant role in multi-scene video anomaly detection. The inclusion of contextual knowledge leverages the performance of video anomaly detection algorithms. Furthermore, this study demonstrated that the incorporation of few known anomalous samples in the training process can prominently improve the performance of anomaly detection. This study highlights the importance of contextual knowledge and learning strategy for video anomaly detection.
\section{Acknowledgement}
\par This research was supported by Manipal Academy of Higher Education for the dataset generation inside the campus using drones (MUAAD, ManipalUAVid). A provisional Indian patent has been filed for the developed system. Patent application number: 202241010616. Date of filing: 28/02/2022.
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-03-30T02:30:22', 'yymm': '2203', 'arxiv_id': '2203.15437', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15437'} | arxiv |
\section{Introduction}
End-to-end (E2E) methods, such as connectionist temporal classification (CTC)~\cite{graves2006connectionist}, recurrent neural network transducer (RNN-T)~\cite{graves2012sequence,wang2021cascade,wang2019exploring}, and attention based encoder-decoder (AED)~\cite{chorowski2014end,chan2015listen,luo2021simplified,miao2020transformer}, have drawn immense interest in the last few years in automatic speech recognition (ASR). Recent works~\cite{prabhavalkar2017comparison,sainath2019two,kim2017joint,sainath2020streaming,hu2020deliberation} show the E2E systems not only extremely simplify the speech recognition pipeline, but also surpass the conventional hybrid ASR systems in accuracy.
Considering the advantages~\cite{li2021recent} of E2E models, deploying the emerging E2E ASR framework into real-world productions with stable
and highly efficient characteristics becomes necessary. However, almost all of the well-known E2E speech recognition toolkits, such as ESPnet~\cite{watanabe2018espnet} and SpeechBrain~\cite{ravanelli2021speechbrain}, are research-oriented rather than production-oriented.
In \cite{2021WeNet}, we present a production first and production ready E2E speech recognition toolkit, WeNet\footnote{\url{https://github.com/wenet-e2e/wenet}}, which focuses on addressing the production problems of transformer~\cite{vaswani2017attention} and conformer~\cite{gulati2020conformer} based E2E models.
Specifically, WeNet adopts a joint CTC/AED structure as the basic model structure. And then, a unified two-pass (U2) framework is proposed to solve the streaming problem, where a dynamic chunk masking strategy is applied in the training procedure to unify the streaming and non-streaming modes in a unified neural model. A built-in runtime is provided in which developers can run x86 and android E2E system for speech recognition out of the box.
WeNet dramatically reduces the workload of deploying an E2E model in real applications, so it is widely adopted by researchers and developers.
In this paper, we present \textbf{WeNet 2.0}, which introduces the recent developments and solutions updated in WeNet for production-oriented speech recognition. The key updates of WeNet 2.0 are as follows.
\textbf{(1) U2++}: we upgrade the original U2 framework to U2++, which simultaneously utilizes the left-to-right and right-to-left bidirectional contextual information of the labeled sequences to learn richer context information during the training stage, and combines the forward and backward predictions to achieve more accurate results during the decoding stage. The experiments show that U2++ achieves up to 10\% relative reduction over the original U2 framework in error rate.
\textbf{(2) Production language model solution}: we support an optional n-gram LM, which is composed with the E2E modeling unit in a weighted finite state transducer (WFST)~\cite{mohri1997finite} based decoding graph, during the streaming CTC decoding stage. The n-gram LM can be trained rapidly on rich production-accumulated text data. Experiments show that the n-gram language model can provide up to 8\% relative performance improvement.
\textbf{(3) Contextual biasing}: we design a unified contextual biasing framework which provides the opportunity to leverage the user-specific contextual information with or without LM during the streaming decoding stage. Utilizing user-specific contextual information (e.g., contact lists, particular dialog state, conversation topic, location, etc) plays a great role in both improving the ASR accuracy and providing rapid adaptation ability. Experiments show that our contextual biasing solution can bring clear dramatic improvement for both with-LM and without-LM cases.
\textbf{(4) Unified IO (UIO)}: we design a unified IO system to support the large-scale dataset for effective model training. The UIO system provides a unified interface for different storage media (i.e., local disk or cloud) and datasets for different scale (i.e., small or large datasets). For small datasets, UIO keeps the sample-level random access ability. While, for large datasets, UIO aggregates the data samples to shards (refer to Figure \ref{fig:uio} for more details) and provides the shard-level random access ability. Thanks to UIO, WeNet 2.0 can elastically support training with a few hours to millions of hours of data.
In summary, our brand-new WeNet 2.0 makes available several important production-oriented features, which achieves substantial ASR improvement over the original WeNet and makes itself a more productive E2E speech recognition toolkit.
\vspace{-5pt}
\section{WeNet 2.0}
In this section, we will describe the production-oriented key updates: U2++ framework, production language model solution, contextual biasing, and unified IO in detail, respectively.
\vspace{-2pt}
\subsection{U2++}
U2++, a unified two-pass joint CTC/AED framework with bidirectional attention decoders, provides an ideal solution to unify streaming and non-streaming modes. As shown in Figure~\ref{fig:ctc_attention_joint}, U2++ consists of four parts.
1) A \textit{Shared Encoder} that models the information of acoustic features. The \textit{Shared Encoder} consists of multiple Transformer~\cite{vaswani2017attention} or Conformer~\cite{gulati2020conformer} layers which only takes limited right contexts into account to keep a balanced latency.
2) A \textit{CTC Decoder} that models the frame-level alignment information between acoustic features and token units. The \textit{CTC Decoder} consists of a linear layer, which transforms the \textit{Shared Encoder} output to the CTC activation.
3) A \textit{Left-to-Right Attention Decoder (L2R)} that models the ordered token sequence from left to right to represent the past contextual information.
4) A \textit{Right-to-Left Attention Decoder (R2L)} that models the reversed token sequence from right to left to represent the future contextual information.
The \textit{L2R and R2L Attention Decoders} consist of multiple Transformer decoder layers.
During the decoding stage, the \textit{CTC Decoder} runs in the streaming mode in the first pass and the \textit{L2R and R2L Attention Decoders} do rescore in the non-streaming mode to improve the performance in the second pass.
\begin{figure}[ht]
\centering
\includegraphics[width=\linewidth]{images/u2++.jpg}
\caption{U2++ framework. The dotted line denotes the second pass rescoring during the decoding stage.}
\label{fig:ctc_attention_joint}.
\vspace{-2em}
\end{figure}
Compared with U2~\cite{2021WeNet}, we add an extra right-to-left attention decoder to enhance the context modeling ability of our model, so that the context information comes not only from the past (left-to-right decoder) but also from the future (right-to-left decoder). This improves the representative ability of the shared encoder, the generalization ability of the whole system, and the performance during the rescoring stage.
The combined CTC and AED loss is used to train U2++:
\begin{equation}
\setlength\abovedisplayskip{2pt}
\setlength\belowdisplayskip{2pt}
\label{eq:combined_loss}
\mathbf{L}_{\text {combined}}\left(\mathbf{x}, \mathbf{y}\right)=\lambda \mathbf{L}_{\text{CTC}}\left(\mathbf{x}, \mathbf{y}\right)+(1-\lambda) (\mathbf{L}_{\text{AED }}\left(\mathbf{x}, \mathbf{y}\right)),
\end{equation}
where $\mathbf{x}$ denotes the acoustic features, and $\mathbf{y}$ denotes the corresponding labels, $\lambda$ is a hyper parameter which balances the importance of the CTC loss $\mathbf{L}_{\text{CTC}}\left(\mathbf{x}, \mathbf{y}\right)$ and AED loss $\mathbf{L}_{\text {AED}}\left(\mathbf{x}, \mathbf{y}\right)$.
To incorporate an extra R2L attention decoder into our model, we introduce a hyper parameter $\alpha$ inside $\mathbf{L}_{\text {AED}}\left(\mathbf{x}, \mathbf{y}\right)$ to adjust the contributions of two unidirectional decoders:
\begin{equation}
\setlength\abovedisplayskip{2pt}
\setlength\belowdisplayskip{2pt}
\label{eq:AED_loss}
\mathbf{L}_{\text {AED}}\left(\mathbf{x}, \mathbf{y}\right)=(1 - \alpha) \mathbf{L}_{\text{L2R}}\left(\mathbf{x}, \mathbf{y}\right) + \alpha (\mathbf{L}_{\text{R2L}}\left(\mathbf{x}, \mathbf{y}\right) ).
\end{equation}
Similar to U2, the dynamic chunk masking strategy is used to unify the streaming and non-streaming modes. During the training stage, we firstly sample a random chunk size $C$ from a uniform distribution, $C \sim U(1, max \, batch \, length \, T)$. And then, the input is split into several chunks with the chosen chunk size. At last, the current chunk does bidirectional chunk-level attention to itself and previous/following chunks in L2R/R2L attention decoder respectively in training. During the decoding stage, the n-best results achieved from the first-pass CTC decoder are rescored by the L2R and R2L attention decoder with its corresponding acoustic information generated by the \textit{Shared Encoder}. The final results are obtained by fusing the scores of the two attention decoders and the CTC decoder.
Empirically, a larger chunk size results in better results with higher latency. Thanks to the dynamic strategy, U2++ learns to predict with arbitrary chunk size so that balancing the accuracy and latency is simplified by tuning the chunk size in decoding.
\vspace{-2pt}
\subsection{Language Model}
\begin{figure*}[ht]
\centering
\includegraphics[width=\linewidth]{images/lm.pdf}
\vspace{-2em}
\caption{Language model solution in WeNet 2.0}
\label{fig:lm}
\vspace{-2.0em}
\end{figure*}
To promote the use of rich text data in production scenarios, we provide a unified LM integration framework in WeNet 2.0, which is shown in Figure~\ref{fig:lm}.
As a unified LM and LM-free system, CTC is employed to generate the first-pass n-best results.
When LM is not provided, \textit{CTC prefix beam search} is applied to get n-best candidates.
When LM is supplied, WeNet 2.0 compiles the n-gram LM ($G$), lexicon ($L$), and end-to-end modeling CTC topology ($T$) into a WFST-based decoding graph ($TLG$)
\begin{equation}
\setlength\abovedisplayskip{2pt}
\setlength\belowdisplayskip{2pt}
TLG = T \circ \min(det(L \circ G)),
\end{equation}
and then \textit{CTC WFST beam search} is applied to get n-best candidates. Finally, the n-best candidates are rescored by the \textit{Attenion Rescoring} module to find the best candidate.
We reuse the algorithm and code in Kaldi\cite{povey2011kaldi} for decoding, which is denoted as \textit{CTC WFST beam search} in the WeNet 2.0 framework. To speedup decoding, blank frame skipping~\cite{chen2016phone} technique is adopted.
\vspace{-2pt}
\subsection{Contextual Biasing}
Utilizing user-specific contextual information (e.g., contact lists, driver's navigation) plays a vital role in speech production, which always improves the accuracy significantly and provides the rapid adaptation ability. Contextual biasing technique is investigated in \cite{aleksic2015bringing, he2019streaming, jain2020contextual} for both traditional and E2E systems.
In WeNet 2.0, for leveraging the user-specific contextual information in both LM and LM-free cases during the streaming decoding stage, inspired by \cite{he2019streaming}, we construct a contextual WFST graph on the fly when a set of biasing phrases are known in advance.
Firstly, the biasing phrases are split into biasing units according to the E2E modeling units in the LM-free case or the vocabulary words in the with-LM case.
And then, the contextual WFST graph is built on the fly as follows: (1) Each biasing unit with a boosted score is placed on a corresponding arc sequentially to generate an acceptable chain. (2) For each intermediate state of the acceptable chain, a special failure arc with a negative accumulated boosted score is added. The failure arcs are used to remove the boosted scores when only partial biasing units are matched rather than the entire phrase. In Figure~\ref{fig:context}, a char (E2E modeling unit) level context graph in the LM-free case and a word-level context graph in the with-LM case are shown, respectively. Finally, during the streaming decoding stage, a boosted score is added immediately when the beam search result matches with a biasing unit through the contextual WFST graph, as shown in
\begin{equation}
\setlength\abovedisplayskip{2pt}
\setlength\belowdisplayskip{2pt}
\label{equ:context}
\textbf{y}^{*} = \mathop{\arg\max}_{\textbf{y}} logP(\mathbf{y}|\mathbf{x}) + \lambda logP_{C}(\mathbf{y}),
\end{equation}
where $P_{C}(\mathbf{y})$ is the biasing score, $\lambda$ is a tunable hyper-parameter to control how much the contextual LM influences the overall model score. Especially, when some biasing phrases share the same prefix, we do a greedy match to simplify the implementation.
\vspace{-10pt}
\begin{CJK*}{UTF8}{gbsn}
\begin{figure}[ht]
\centering
\subfigure[Char level context graph without LM]{
\includegraphics[width=1.0\linewidth]{images/char_context.pdf}
}
\quad
\subfigure[Word level context graph with LM]{
\includegraphics[width=0.7\linewidth]{images/word_context.pdf}
}
\vspace{-2pt}
\caption{Context graph for Chinese phrase "不忘初心". The failure arcs are highlighted in red lines.}
\label{fig:context}
\end{figure}
\end{CJK*}
\vspace{-10pt}
\subsection{UIO}
Typically, the production-scale speech dataset is over tens of thousands of hours labeled speech, which always comprises massive small size files. The massive small files will cause the following problems:
\vspace{-3pt}
\begin{itemize}
\item \textbf{Out of memory (OOM)}: we have to keep the index information for all of the small files, which is very memory-consuming for large datasets.
\vspace{-3pt}
\item \textbf{Lower training speed}: reading data becomes the bottleneck of the training due to the intolerable time-consuming during random access to massive small files.
\end{itemize}
\vspace{-3pt}
To address the aforementioned problems for large-scale production datasets and keep the high efficiency for small datasets at the same time, we design a unified IO system, which provides a unified interface for different storage (i.e., local disk or cloud) and different scale datasets (i.e., small or large datasets). The whole framework is shown in Figure~\ref{fig:uio}.
\begin{figure}[h]
\centering
\includegraphics[width=\linewidth]{images/uio.pdf}
\caption{Unified IO in WeNet 2.0}
\label{fig:uio}
\vspace{-1.0em}
\end{figure}
For large datasets, inspired by TFReord (Tensorflow)~\cite{abadi2016tensorflow} and AIStore~\cite{aizman2019high}, we pack each set of samples (e.g., 1000 samples) with their associated metadata information into a corresponding bigger shard, which is done by GNU tar, an open-source, open-format, ubiquitous and widely-supported archival tool. Tar files significantly save memory and overcome the OOM problem effectively. During the training stage, on-the-fly decompression is performed in the memory, and the data in the same compressed shard is read sequentially, which solves the time-consuming random data access problem and speeds up the training process. At the same time, different shards can be read randomly to ensure the global randomness of data. For small datasets, we can also load the training samples directly.
Especially, when using shards for big datasets, we support loading the shards from both the local disk and the distributed storage (e.g., S3, OSS, HDFS, etc). Similar to TFRecord, chain operations for processing data on-the-fly is designed, so that the unified IO is extensible and easy to debug\footnote{\url{https://wenet.org.cn/wenet/UIO.html}}.
\section{Experiments}
In this section we describe our experimental setup, test sets, and analyze the experimental results. Most of the experimental setups are available in the WeNet recipes.
The experiments are carried on all of or some of the following corpora: AISHELL-1~\cite{bu2017aishell}, AISHELL-2~\cite{du2018aishell}, LibriSpeech~\cite{panayotov2015librispeech}, GigaSpeech~\cite{chen2021gigaspeech}, and recent released WenetSpeech~\cite{zhang2021wenetspeech}. The five corpora include different languages (English and Mandarin), recording environments (clean and noisy), and sizes (100 - 10000 hours).
\vspace{-3pt}
\subsection{U2++}
\label{sec:u2++exp}
\vspace{-1pt}
\begin{table*}[htbp]
\centering
\caption{U2++/U2 comparison on various open-source ASR corpora. * denotes the model is trained with dynamic mask, and it could be decoded with different chunk size (full/16 in the table). † denotes the model is trained with full attention.}
\vspace{-7pt}
\setlength{\tabcolsep}{3.5mm}
\label{tab:u2pp}
\begin{tabular}{@{}lllllccccc@{}}
\toprule
Dataset & Language & Hours & Unit & Metric & Test Sets & U2 & U2++ \\ \midrule
AISHELL-1 * & Mandarin & 170 & Char & CER & test(full)/test(16) & 4.97/5.45 & \textbf{4.63/5.05} \\
AISHELL-2 * & Mandarin & 1000 & Char & CER & test ios(full)/test ios(16) & 6.08/6.46 & \textbf{5.39/5.78} \\
LibriSpeech † & English & 960 & BPE & WER & test clean/test other & 2.85/7.24 & \textbf{2.66/6.53} \\
WenetSpeech † & Mandarin & 10000 & Char & MER & Test Net/Test Meeting & 9.70/\textbf{15.59} & \textbf{9.25}/16.18 \\
GigaSpeech † & English & 10000 & BPE & WER & dev/test & 11.30/11.20 & \textbf{10.70/10.60} \\ \bottomrule
\end{tabular}
\vspace{-2em}
\end{table*}
To evaluate the effectiveness of our U2++ model, we conduct experiments on all of the 5 ASR corpora listed above. For most experiments, 80-dimensional log Mel-filter banks (FBANK) with a 25ms window and a 10ms shift are used as acoustic features.
SpecAugment~\cite{park2019specaugment} is applied on-the-fly for data augmentation.
Two convolution subsampling layers with kernel size 3*3 and stride 2 are used in the front of the encoder.
We use 12 conformer layers for the encoder.
To keep comparable parameters for U2/U2++, we use 6 transformer decoder layers for U2, 3 left-to-right and 3 righ-to-left decoder layers for U2++.
Moreover, we obtain our final model by model averaging.
In AISHELL-1 and AISHELL-2, the attention layer uses attention dimension 256, feed-forward 2048, and 4-head attention.
In LibriSpeech, GigaSpeech and WenetSpeech, the attention layer uses attention dimension 512, feed-forward 2048, and 8-head attention.
The kernel size of the convolution module is 8/8/31/31/15 for the five corpora, respectively.
Accumulating gradient is used to stabilize training.
In Table~\ref{tab:u2pp}, we report the character error rate (CER), word error rate (WER) or mixed error rate (MER) for each corpus. It shows that U2++ outperforms U2 on most of the corpora, and achieves up to 10\% relative improvement over U2. From the results, we approve that U2++ shows superior performance in various types and sizes of ASR corpora consistently.
\vspace{-3pt}
\subsection{N-gram Language Model}
\vspace{-1pt}
The language model solution is evaluated on AISHELL-1, AISHELL-2, and LibriSpeech on the models listed in Section~\ref{sec:u2++exp}.
For AISHELL-1 and AISHELL-2, a tri-gram trained on its own training corpus is used.
For LibriSpeech, the official pre-trained four-gram large language model (fglarge) is used.
To speed up the decoding, when the probability of the ``blank'' symbol of a frame is greater than 0.98, the frame will be skipped.
\vspace{-1em}
\begin{table}[ht]
\caption{N-gram LM evaluation}
\vspace{-5pt}
\label{tab:lm}
\begin{tabular}{@{}lccc@{}}
\toprule
Dataset & Test Sets & without LM & with LM \\ \midrule
AISHELL-1 & test & 4.63 & \textbf{4.40} \\
AISHELL-2 & test\_ios & 5.39 & \textbf{5.35} \\
LibriSpeech & test\_clean/test\_other & 2.66/6.53 & \textbf{2.65}/\textbf{5.98} \\ \bottomrule
\end{tabular}
\end{table}
\vspace{-10pt}
Table \ref{tab:lm} exhibits the comparison results on the three corpora in with-LM and without-LM scenarios. The with-LM solution shows 5\% gain on AISHELL-1, comparable result on AISHELL-2, comparable result in test\_clean on LibriSpeech, and superior improvement (8.42\%) in test\_other on LibriSpeech.
In conclusion, our production LM solution shows consistent gain on the three corpora, which illustrates n-gram language model works well when integrated to an E2E speech recognition system.
Benefitting from this solution, the production system can enjoy the rich production-accumulated text data.
\vspace{-3pt}
\subsection{Contextual Biasing}
We evaluate contextual biasing in a contact scenario, and we design two test sets selected from AISHELL-2 test sets.
\vspace{-5pt}
\begin{itemize}
\item \textbf{test\_p}: positive test set with its relevant context. We select 107 utterances with person names, and all the names are attached as contextual biasing phrases in decoding.
\vspace{-5pt}
\item \textbf{test\_n}: negative test set without any contextual biasing phrases (i.e., names) in the positive testset. We randomly select 107 eligible utterances as the negative test set.
\end{itemize}
\vspace{-5pt}
We carry on the test on the AISHELL-1 U2++ model with and without LM.
We show that the strength of contextual biasing can be controlled by switching the boosted score. In our experiments, the boosted score is varied from 0 to 10, where 0 means context biasing is not applied.
As shown in Table~\ref{tab:context}, our solution reduces the error rate on the positive test set and a bigger boosted score usually gives better improvement. Furthermore, when a proper boosted score is set, we can improve the performance on the positive testset and avoid the performance degradation on negative test set at the same time.
\vspace{-8pt}
\begin{table}[ht]
\caption{Context Biasing evaluation}
\vspace{-6pt}
\centering
\label{tab:context}
\setlength{\tabcolsep}{2.5mm}
\begin{tabular}{@{}ccccccc@{}}
\toprule
\multirow{2}{*}{LM} & \multirow{2}{*}{test set} & \multicolumn{5}{c}{boosted score} \\ \cmidrule(l){3-7}
& & 0 & 3 & 5 & 7 & 10 \\ \midrule
\multirow{2}{*}{NO} & test\_p & 14.94 & 11.11 & 7.65 & \textbf{6.17} & 6.54 \\
& test\_n & 7.45 & 7.45 & 7.45 & 7.57 & 8.06 \\ \midrule
\multirow{2}{*}{YES} & test\_p & 13.95 & 11.23 & 11.11 & 10.12 & \textbf{9.14} \\
& test\_n & 7.20 & 7.20 & 7.20 & 7.20 & 7.33 \\ \bottomrule
\end{tabular}
\end{table}
\vspace{-15pt}
\subsection{UIO}
We evaluate the performance of UIO on AISHELL-1~\cite{bu2017aishell} testset and WenetSpeech~\cite{zhang2021wenetspeech} testsets (i.e., test\_net/test\_meeting), including the accuracy, scalability and training speed.
Specifically, we use 8 GPUs on one machine for AISHELL-1, and 24 GPUs on three machines for WenetSpeech.
As shown in Table~\ref{tab:uio}, the UIO shows close accuracy in raw and shard modes on AISHELL-1, while the shard mode gets about 9.27\% speedup in terms of the training speed.
For WenetSpeech, since it is too slow to only use raw mode for training, the training speed is not shown. We adopt the result of ESPnet (marked with $\dagger$) as our baseline, which has the same configuration as our model.
The result of the model trained on WenetSpeech by shard mode is comparable to ESPnet, which further illustrates the effectiveness of UIO.
\vspace{-5pt}
\begin{table}[ht]
\caption{Unified IO evaluation}
\vspace{-5pt}
\label{tab:uio}
\begin{tabular}{llll}
\toprule
Dataset & metric & raw & shard \\ \midrule
\multirow{2}{*}{AISHELL-1} & speed(per epoch) & 593 sec & \textbf{538 sec} \\
& WER & 4.63 & 4.67 \\ \midrule
\multirow{2}{*}{WenetSpeech} & speed(per epoch) & NA & 75 min \\
& WER & 8.90/15.90($\dagger$) & 9.70/15.59 \\ \bottomrule
\end{tabular}
\end{table}
\vspace{-15pt}
\section{Conclusion and Future Work}
In this paper, we proposed our more productive E2E speech recognition toolkit, WeNet 2.0, which introduces several important production-oriented features and achieves substantial ASR performance improvement.
We are working on WeNet 3.0, which mainly focuses on unsupervised self-learning, on-device model exploration and optimization, and other characteristics for production-level ASR.
\newpage
\scriptsize
\bibliographystyle{IEEEbib}
\newlength{\bibitemsep}\setlength{\bibitemsep}{.14\baselineskip plus .05\baselineskip minus .05\baselineskip}
\newlength{\bibparskip}\setlength{\bibparskip}{-1pt}
\let\oldthebibliography\thebibliography
\renewcommand\thebibliography[1]{%
\oldthebibliography{#1}%
\setlength{\parskip}{\bibitemsep}%
\setlength{\itemsep}{\bibparskip}%
}
| {'timestamp': '2022-07-06T02:09:19', 'yymm': '2203', 'arxiv_id': '2203.15455', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15455'} | arxiv |
\section{Introduction}
The ability to deploy AI models, especially Deep Neural Networks (DNNs) on resource-constrained devices (smart phones/tabs/TVs and edge sensors) has transformed the way these devices are used. While increasingly sophisticated deep models empower intelligent features and apps, revolutionary hardware and/or neural acceleration platforms \cite{snpe,snap,coreml} allow us to enable such features on even smaller devices.
However, extensive manual effort by AI experts/professionals is needed for model architecture design and hyperparameter control in order to be effective and efficient for a given hardware and task scenario \cite{bergstra2012random}. This is even more critical in context of embedded AI. \textit{For instance}, large transformer models (GPT-3 etc.) are indispensable for text prediction, but needs sparse parameters, shorter embedding lengths or limited attention heads to work on low-resource devices. \textit{Similarly MobileNet-V2}, a breakthrough in device-efficient vision model via `separable convolutions', may be hard to deploy on lower-end devices unless several architectural parameters are adjusted.
Manual design of DNN architectures of every new case is not sustainable in an evolving landscape of device hardware and AI-driven scenarios.
Neural Architecture Search (NAS) or AutoM
\cite{liu2018progressive,elsken2019neural,xie2018snas}
allows for automatic learning (fine-tuning) suitable architectures from data (and/or additional information) and has shown a lot of promise \cite{tan2019mnasnet,cai2018proxylessnas}.
But, NAS is largely \textit{not 'smart'} enough to adapt to evolving hardware configurations and increasingly complex task and optimality requirements (jointly termed as context here). There are major challenges.
(1) Powerful NAS-designed device-efficient models (ex: EfficientNet\cite{tan2019efficientnet}), may be highly optimized for certain h/w (ex: Google TPUs) but may struggle on other chipsets or acceleration platforms. DNNs learned by NAS for high-end smart devices may either be fully/partially incompatible or inefficient in older/newer or low-tier devices. (2) Improper design of objectives can lead NAS to compress models so aggressively that they suffer in predictive performance or other factors. (3) Again, models designed for one task (such as object detection) may not generalize well to other related tasks (such as caption detection). (4) Most importantly, even robust NAS frameworks that arguably try to address these, have a major bottleneck - prohibitive search time that makes industrial adaptation of NAS extremely challenging.
To address these challenges we propose our smart context-adaptive generalized NAS framework, \textbf{\underline{Auto}}ML via \textbf{\underline{Co}}-Regulated \textbf{\underline{Met}}a-behavior (\textsc{AutoCoMet}), that can automatically generate / customize and learn most suitable DNN architecture as per the context. `Context' jointly signifies varied levels of hardware configurations and task/quality requirements. Not only does our framework provide a generalized formalism of the multi-criteria objective but also proposes a novel way to solve the same via Reinforcement Learning with \underline{co-regulated reward shaping} resulting in rapid search.
We make the following contributions: \textbf{(1)} We propose a context-adaptive NAS/AutoML framework, \textbf{(2)} To that end we propose a high fidelity hybrid ensemble meta-behavior predictor that can effectively handle mixed feature space producing accurate hardware behaviour prediction, \textbf{(3)} We propose a novel co-regulated reward shaping Reinforcement Learning (RL) NAS controller that that leads generalization in a principled manner as well as extremely rapid search and \textbf{(4)} Finally, we demonstrate empirically in several important scenarios how our framework is effective in generating suitable neural architectures for varied contexts.
\section{Background \& Related Work}
\subsection{Neural Architecture Search / AutoML}
Although the spirit remains same, there are several classes of NAS methodologies depending on multiple dimensions.
\paragraph{Search strategy}Approaches may differ in their search strategies - \textbf{(1)} Reinforcement Learning (zero-order optimization) based methods \cite{zoph2016neural, tan2019mnasnet, jaafra2019reinforcement}; \textbf{(2)} First-order optimization or gradient-based search including UNAS, DARTS etc., \cite{unas,liu2018darts} or Bayesian approaches like BayesNAS~\cite{zhou2019bayesnas}; \textbf{(3)} Evolutionary algorithms, known to be powerful in combinatorial multi-objective search in the discrete space (eg. LEMONADE \cite{elsken2018efficient} etc). \textit{We choose to adopt a zero-order Reinforcement Learning formalism since we mostly operate in a discrete design space with potentially piece-wise metrics, and hence differentiability is not trivial.}
\paragraph{Design space and search latency}Several approaches try to address the concerns of intractable {search space} and search latency. Ex: ENAS \cite{pmlr-v80-pham18a} leverages parameter sharing among all tunable intermediate neural architectures. LEMONADE \cite{elsken2018efficient} proposes Lamarckian based inheritance to handle the resource expensive nature of the NAS controller. Liu et al., \cite{liu2018progressive} progressively searches complex architectures to keep the design space controlled. Recently, HourNAS \cite{hournas} mitigates search complexity by identification and added attention on vital blocks in a deep model.
\textit{Our work proposes a novel way to navigate/explore the combinatorial search space instead and consequently helps control search latency.}
\paragraph{On-device models}Inference efficiency of learned architectures is critical for on-device execution of DNNs, as inference entails complex tensor computations and affects user experience. MNASNet \cite{tan2019mnasnet} was one of the first ones to optimize architectures for mobile devices using a factored hierarchical search space
and used a simple multi-criteria RL controller. Many other approaches also focus on hardware-adaptive search to find latency-optimal architectures for resource-limited devices \cite{fbnet,cai2018proxylessnas,xie2018snas,unas,chamnet}. Several state-of-the-art vision models for embedded AI were learned with NAS \cite{howard2019searching,tan2019efficientnet}. Our focus, as well, is to design a NAS framework for on-device deep models. However, we aim to make it smart, context-adaptive, generalized and fast.
ProxylessNAS \cite{cai2018proxylessnas} is probably the closest in spirit to our work. Like MNASNet, they adopt a weighted product formulation of the multi-objective problem and try to use direct hardware level execution statistic (ex: latency) instead of complexity proxies. They use 2 parallel search strategies - Gradient-based and REINFORCE \cite{williams1992simple}. But, ProxylessNAS (and MNASNet) has some major limitations including - (1) limited latency estimator for mobiles; (2) naive (weighted-combination) strategy for multi-criteria RL and (3) stateless RL formulation which leads to predecessor-successor dependencies not being captured faithfully. \textsc{AutoCoMet} addresses such limitations with high-fidelity meta-behavior predictor, novel generalized multi-criteria optimizer using co-regulated reward-shaping RL.
\subsection{Augmented Reinforcement Learning}
As hinted earlier, \textsc{AutoCoMet} adopts an RL-based search, since representing DNN architecture design space as a sequence of state transitions restricts the complexity and a zero-order optimization scheme is useful in such a hybrid space. However a critical problem with RL, especially in our problem context, is `credit assignment'/feedback sparsity \cite{sutton1985temporal,fu2008solving,agogino2004unifying}.Architecture design space is potentially infinitely large and most architecture altering actions may not fetch any significant reward/feedback. Also this is a multi-criteria problem \cite{gabor1998multi,van2014multi,liu2014multiobjective} and most existing approaches resort to scalarization/combination of reward vector which does not work in our scenario.
Augmented RL, such as Reward-shaping \cite{grzes2017reward,grzes2008plan,ng1999policy}, is one of the ways to address feedback sparsity where extra inputs (knowledge) augments the original sprase reward space while ensuring policy invariance. Our formulation uses reward shaping to address feback sparsity in a complex multi-criteria space.
\section{The \textsc{AutoCoMet} framework}
\subsection{Problem Setting}
Most NAS approaches have limited generalizability across different classes of hardware/task. This problem is more critical in mobile devices where variations in hardware configuration affects user experience of AI-driven features.
This is due to certain limitations in existing AutoML approaches --
\textbf{(1)} {Adapting the search space} in an evolving mobile hardware and task landscape is non-trivial;
\textbf{(2)} {Naive combination} of the dimensions of a multi-criteria objective (scalarization) and/or {expensive combinatorial search} leading to prohibitive search latency;
\textbf{(3)} {Formalism is not general}. Some NAS approaches optimize latency too aggressively making accuracy suffer or vice versa. Manually designing this trade-off is difficult. Also the dimensions in a multi-criteria objective cannot be easily extended.
Hence our strategy enables suitable generalization across hardware/task and quality requirements (`Context').
\noindent \fbox{
\parbox{0.97\columnwidth}{
\textbf{GIVEN:} Context information (hardware configuration details + task/quality requirements).\\
\textbf{TO DO:} Develop a smart fast context-adaptive generalized NAS framework to learn the most suitable DNN arch.}}
\subsection{Framework Architecture}
\textit{``Smart'', in cognitive intelligence, is usually associated with fast learning, adapting to contexts and situations, and the ability to reason along multiple dimensions without losing sight of what is important. }
Our proposed framework, \textbf{\underline{Auto}}ML via \textbf{\underline{Co}}-regulated \textbf{\underline{Met}}a-behavior (\textsc{AutoCoMet}) can hence be considered ``smart''. It has 2 major components,
\textbf{[I]} High-Fidelity Context meta-behavior prediction model that is trained from DNN execution stats from a wide range of devices. This results in a piece-wise differentiable behavior function that feeds one or more of the reward components;
\textbf{[II]} Novel multi-criteria Reinforcement Learning (RL) NAS controller that leverages a reward-shaping based `co-regulated' update strategy which leads to faster convergence.
\begin{figure*}[h]
\begin{minipage}{0.6\textwidth}
\centering
\includegraphics[height=4cm]{img/MetaNAS.png}
\caption{Schematic of \textsc{AutoCoMet} framework}
\label{fig:architecture}
\end{minipage}
\begin{minipage}{0.4\textwidth}
\centering
\includegraphics[height=4cm]{img/co-constrainedV2.png}
\caption{Co-regulated shaping controller}
\label{fig:shape}
\end{minipage}
\end{figure*}
Before diving deeper into our proposed framework we define a few terms,
\begin{definition}[Context]
\label{def:context}
Joint feature space qualifying hardware configuration and task in in factored form is termed as ``Context''. If a hardware configuration $H$ is described by k-tuple $\langle x_H^1, \ldots, x_H^k \rangle$ with features such as processor type, clock frequency, on-chip mem etc. and task/quality requirements $T$ is described by n-tuple $\langle x_T^1, \ldots, x_T^n \rangle$ with features such as text?, multi-entity?, ROI? etc., then Context is a union/concatenation of the 2 tuples $\langle x_C^i \rangle = \langle x_H^1, \ldots, x_H^k \rangle \cup \langle x_T^1, \ldots, x_T^n \rangle$.
\end{definition}
\begin{definition}[Co-regulated]
\label{def:coreg}
Adapted from the field of social psychology, Co-regulation \cite{fogel2017two} is defined as `continuous unfolding of individual action that is susceptible to being continuously modified by the continuously changing actions of the partner'. In our formalism it refers to how different dimensions of a multi-criteria objective regulate each other's progressive contribution, with the provision for setting \textbf{relative dominance}. [not same as co-learning]
\end{definition}
Figure~\ref{fig:architecture} illustrates the overall architecture of the framework. The RL controller now has a reward vector with multiple distinct dimensions (factored). For resource constrained devices major components of factored reward are (1) the predictive performance of candidates and (2) the context meta-behavior scores (latency/memory/power/throughput etc.).
Unlike predictive performance, measuring context is not straightforward.
Ex., measuring latency requires deployment/execution of candidate models on actual devices. This is expensive in case of repetitive measurements in NAS controllers. But high fidelity measurements of behavior of candidate architectures is important for learning device ready models. BRP-NAS \cite{dudziak2020brp}, tries to address this by learning complex GCNs to predict measurements but the complexity of this secondary deep model compromise search speed. So, \textsc{AutoCoMet} leverages a high-fidelity shallow predictor model for context.
Our co-regulated shaping reinforcement can essentially incorporate arbitrary number of meta-behavior components in a smart and generalized way. Meta-Behavior predictor emulates varied pseudo-device/task contexts and output are feeds into the reward vector. Accuracy is the predictive performance component.
Most existing multi-criteria RL approaches `scalarize' the factored reward vector via weighted combination, which may lead to sub-optimal solutions or slow convergence due to reward sparsity. Also aggressive optimization of hardware metrics may cause deviation from accurate models. \textsc{AutoCoMet} jointly optimizes all the components by allowing them to ``regulate'' one another via a reward-shaping.
\subsection{Context Meta-Behavior Predictor}
Meta-behavior model is a key factor in context-awareness. \textit{The term "meta" indicates that its purpose is to facilitate learning of the target model via context-aware estimates and it itself is not our target.} Note context is a hybrid feature space; some features are numerical, some categorical (or ordinal) while one or more are response variables (behavior scores - latency/memory etc.) which are continuous/real making this a multi-target hybrid regression problem.
\subsubsection{Feature Design:}
$X=\langle x_A^1,…,x_A^m,x_C^1,\ldots,x_C^{n+k}\rangle$ is the feature space where, $x_A^i$ are the features that describe candidate DNN architecture, $x_C^j$ signify context features and $\langle y_1,\ldots, y_w \rangle$ are the response variables. Response variables include estimates of latency, memory, power usage, throughput and so on.
Meta-Behavior function, $y_f=F(X): f\in\{1,\ldots,w\}$ is a function operating on a hybrid feature space,
which is represented by the piece-wise form more faithfully,
\begin{equation}
\label{eq:yf}
y_f =
\begin{cases}
\infty & x_C^i = B\\
F(X) & \text{otherwise}
\end{cases}
\end{equation}
where $B$ is the set of known values of context for which a given candidate could not be executed at all.
Being a piece-wise function this is not differentiable over the whole space and trivial closed form solution does not exist.
Note that the response variables are assumed independent of each other $y_f \perp y_g| X: f \neq g$ in our multi-target prediction problem. For instance memory heavy models are not always high latency. However, in some scenarios one may imagine some level of dependence such as power consumption may increase in a device that tries to reduce latency. But they are still independent conditioned on the context variables.
\subsubsection{Predictor Design:}
We choose ensemble regression models as our predictor to deal with the hybrid feature space and piece-wise meta-behavior function. Key idea is that, an ensemble model can faithfully model different parts of the function in different sub-spaces via multiple weak models.
More specifically, we learn a \textit{bag-of-boosted (B-o-B) regression models} where the outer bag is a Random Regression Forest and each inner weak regression model is built via TreeBoost or Boosted Multi-Layer Perceptron (MLP). Multi-output is handled by constructing one model per target when using boosted trees or having a multi-output MLP otherwise.
Our empirical evaluations show the validity of our choice and also highlights the difference in performance of the predictor choices. Note that, while MLP is an easier choice because of its ability to directly handle multi-target response, TreeBoost is more interpretable without additional overhead. Note, context values $B$ (Eqn~\ref{eq:yf}) help with informed data sample selection for the `bagging' part of our model.
Such a predictor generalizes well to wide ranges of hardware/task parameters without evaluating on device during search.
\subsection{Multi-criteria RL Controller with Co-regulated Shaping}
The controller architecture (Figure \ref{fig:shape}), although may seem similar to ProxylessNAS \cite{cai2018proxylessnas}, leverages high-fidelity context meta-behavior predictor as opposed to the naive lookup based latency estimator in ProxylessNAS which is neither generalizable nor nor does it extend to other meta-behavior parameters. Above that we adapt an Q-learning \cite{rummery1994line} based RL update with co-regulated reward-shaping.
\subsubsection{Decision Process Formulation}We formulate the MDP $\mathfrak{M} = \langle S,A,R,T,\gamma \rangle$ for our problem, where the state space $S$, is naturally factored and same as the predictor feature set $\langle x_A^1,…,x_A^m,x_C^1,…,x_C^{n+k} \rangle$. Action space $A$ is the NAS search space, i.e. the set of possible neural choices. This is customizable and can either be based on some backbone DNN or standardized space such as NAS-Bench \cite{dong2019bench}. Reward vector, $R=\langle r_P,\{r_S\} \rangle$ where $r_P$ is the primary reward signal and $\{r_S\}$ is the set of secondary reward signal.
This formalism allows our multi-criteria reward to be generalized and extensible. As we will explain later the primary reward component will be the dominant signal in relation to the secondary ones. For proof of concept, we assume $r_P=Accuracy$ and $\{r_S\}=y_f$ (meta-behavior values \textit{Eg: latency}).
$T$ is the transition function $P(s'|s,a)$ (which is 1 in our case).
Since we have an infinite horizon problem (DNN can grow infinitely) we assume discount factor $\gamma < 1$.
Reward-shaping formulation regulates the relative contributions of primary and secondary signals seamlessly in an adaptive dynamic fashion, unlike weighted combination approaches
\subsubsection{Co-regulated reward shaping updates}
{Scalarization} of the reward vector via some weighted additive/multiplicative combination have some major limitations -
{(1)} Assumption of common euclidean space for all the components of the multi-criteria reward vector \textit{which is not the case for NAS}
{(2)} Scalarization essentially computes a mixture distribution, which incorrectly assume all the reward components have same distributional shape.
{(3)} The weights attached to the components in the reward vector are {not adaptive to how the learning evolves causing deviation from desired target}. Even simulated annealing cannot mitigate this since the temperature hyperparameter is based on number of iterations.
Co-regulated reward shaping does not combine/scalarize the components in the reward vector. Instead it allows the secondary reward signal(s) to \textbf{shape} the learning from the primary and leverages the primary to influence the contribution of secondary. We extend \textbf{\textit{PIES (Policy Invariant Explicit Shaping)}} \cite{behboudian2020useful} to achieve the same.
For brevity we assume here that primary reward is {accuracy} $r_P = Accuracy$ and secondary signal is a meta-behavior quantity such as {latency} $r_S = y_f= \{latency\}$, since these are two of the most important quantities that are optimized to obtain device efficient architectures. \ul{It can be easily extended to any arbitrary number of secondary signals (generalized formulation).}
\begin{algorithm}[t!]
\begin{small}
\caption{\textsc{AutoCoMet}}
\label{alg:autometalalgo}
\begin{algorithmic}[1]
\State Pre-process: Context predictor $\mathcal{M} \gets$ \Call{LearnMeta}{$\mathbb{M}$,$\mathbb{E}$}
\Procedure{AutoCoMet}{Dataset $\mathbf{D}$, Predictor $\mathcal{M}$}
\State Initialize: Design space $A \gets \{a_1,\ldots, a_n\}$
\State Initialize: Candidate Neural Architecture $\mathcal{N}$
\While{$\Delta \geq$ Threshold $\tau$}
\State $a* \gets \underset{a \in A}{\arg\max}~ \pi_{t-1}^*$ \Comment{Choose neural block by policy}
\State $\mathcal{N}_t \gets \mathcal{N}_{t-1} \Cup a*$ \Comment{$\Cup$ indicates layer addition}
\State $r_P^t \gets Accuracy = \Call{Inference}{\mathcal{N}_t(\theta), d\subseteq \mathbf{X}}$
\State $r_S^t \gets Metabehavior = \mathcal{M}(\Call{ParseNetwork}{\mathcal{N}_t})$
\State $\Delta = r_P^{(t)} - r_P^{(t-1)}$
\State $\delta^\Phi=r_S (s,a)+\gamma \Phi_{(t-1)}(s' , a')-\Phi_{(t-1)}(s,a)$
\State $\Phi_{t} (s,a)\gets \Phi_{(t-1)} (s,a)+\beta \delta_{(t-1)}^{\Phi}$
\State Update Function Approximator for $\Phi$: $f(\Theta_S)$
\State Update $\epsilon$ as per \textbf{Equation~\ref{eq:epsilon}}
\State $Q'(s,a) \gets Q_t(s,a) + r_P^t + [\gamma^{a} \max_a Q_t(s',a') - Q_t(s,a)]+\epsilon_t \Phi_t (s,a)$
\State Update Function Approximator for $Q$: $f(\Theta_P)$
\State Policy $\pi_t \gets softmax(Q_t)$
\EndWhile
\EndProcedure
\algrule
\Procedure{LearnMeta}{DNNset $\mathbb{M}$, Contexts $\mathbb{C}$}
\State Init: Meta-behavior data $\mathbf{Z} = \emptyset$; $Bag(\mathbf{Z}) \gets \emptyset$
\For{Model $\mathfrak{M} \in \mathbb{M}$}
\State $\langle x_A^1,…,x_A^m \rangle_{\mathfrak{M}} \gets$ \Call{ParseNetwork}{$\mathfrak{M}$}
\State $y_f \gets$ Execution stats $\forall C \in \mathbb{C}$
\State $\mathbf{Z}\gets \mathbf{Z}\cup\{\langle x_A^1,…,x_A^m,x_C^1,…,x_C^{n+k}, y_f \rangle\}_{C\in \mathbb{C}}$
\EndFor
\While{NOT Converged}
\State Sample $S \subseteq \mathbf{Z}|B$ \Comment{leveraging $B$ (Eqn~\ref{eq:yf})}
\State BoostRegressor $=$ $XGBoost(S) \text{or} BoostMLP(S)$
\State Add to $Bag(\mathbf{Z}) \gets Bag(\mathbf{Z})~\cup BoostRegressor(S)$
\EndWhile
\State \Return{$Bag(\mathbf{Z})$}
\EndProcedure
\end{algorithmic}
\end{small}
\end{algorithm}
State-space here is intractably large, so we naturally use function approximators to model the value functions. Clearly $r_P$ feeds into the the primary function approximator (FA) $\Theta_P$ and $r_S$ is used to estimate the shaping potential $\Phi$ (via secondary function approximator $\Theta_S$),
$\Phi_{(t+1)} (s,a)=\Phi_t (s,a)+\beta \delta_t^{\Phi}$,
where $\Phi_t$ is the shaping potential, $\delta^\Phi=r_S (s,a)+\gamma \Phi(s' , a')-\Phi(s,a)$ and $\beta$ is learning rate for potential.
We use shaping potential $\Phi$ to augment the $Q$ updates which uses the primary reward $r_P$,
\begin{align}
\label{eq:QUpdate}
\nonumber Q'(s,a) = Q(s,a) + r_P + [\gamma & \max_a Q(s',a') - Q(s,a)]\\
& +\epsilon \Phi(s,a)
\end{align}
$\gamma = 0.9$ and $\epsilon$ is a decaying trade-off parameter. Till now we have only discussed uni-directional shaping. The formulationof $\epsilon$ is what brings in the co-regulation aspect.
\begin{equation}
\label{eq:epsilon}
\epsilon_t=
\begin{cases}
\epsilon_{(t-1)}\times e^{\Delta} & \epsilon>\text{threshold}\\
0 & \text{otherwise}
\end{cases}
\end{equation}
where $\Delta$ is the growth in primary reward ($\Delta=Acc_t -Acc_{(t-1)}$).
Both FAs are Multi-Layer Perceptrons.
In original PIES, $\epsilon$ decays at constant rate unlike ours, where its regulated by the primary reward and hence the notion of \textit{\textbf{`co-regulated'}} (Figure~\ref{fig:shape}), ensuring approximate pareto-optimality. Optimal policy for choice of neural blocks is thus, $\pi_i^*=softmax_{(a\in A)} (Q_i^* (s,a)+\epsilon \Phi* (s,a))$. \ul{As is clear, the co-regulated trade-off now makes the contribution of the reward components dynamic and adaptive as opposed to the case of scalarization.}
Finally in case of arbitrary number of meta-behavior quantities like $r_S = \{latency,memory,power,\ldots\} = \{r_S^1,r_S^2,r_S^3,\ldots\}$, we learn multiple potentials $\Phi_1, \Phi_2, \ldots$ and Eqn~\ref{eq:QUpdate} is modified as $Q'(s,a) = Q(s,a) + r_P + [\gamma \max_a Q(s',a') - Q(s,a)]
+\epsilon^1 \Phi_1(s,a) +\epsilon^2 \Phi_2(s,a) + \ldots$ Also Eqn~\ref{eq:epsilon} is now indexed,
$$\epsilon_t^i=
\begin{cases}
\epsilon_{(t-1)}^i\times e^{\Delta^i} & \epsilon>\text{threshold}\\
0 & \text{otherwise}
\end{cases}$$
where $\Delta^i=r_P^{(t)}-r_P^{(t-1)}$ is computed similarly.
\ul{Finally also note the we can choose the relative dominance}, and assign some meta-behavior quantity as the primary reward such as $r_P=memory; r_S = \{accuracy, latency, \ldots\}$. Thus \textsc{AutoCoMet} is truly \textbf{generalized} both in terms of choice of relative dominance as well as the set of context meta-behavior variables. It is also \textbf{fast}, as shown in the evaluations, since \ul{co-regulated shaping solves the problem of reward sparsity preventing wastage of search time on irrelevant exploration.}
\subsubsection{\textsc{AutoCoMet} Algorithm}
Algorithm~\ref{alg:autometalalgo} outlines how \textsc{AutoCoMet} leverages predictor and co-regulated shaping. Two different Function Approximators ($\Theta_P$ \& $\Theta_S$) are learned for $Q$ function and shaping potential $\Phi$ respectively are updated distinctly [Lines 13 \& 16]. Shaping potential is learnable from secondary reward signal (meta-behavior) instead of a constant. All updates to the related variables proceeds as outlined earlier. For brevity, we do not explicitly describe helper functions [Lines 8, 9 \& 23]; eg. \textsc{ParseNetwork}() builds the architectural feature set from a candidate network and \textsc{Inference}() executes a candidate network with test data. \textsc{LearnMeta}() is called only once before search begins and meta-behavior predictor is learned.
\begin{table*}[t!]
\centering
\caption{Comparison of predictive performance, inference latency, architecture size \& learning efficiency of neural architectures learned by \textsc{AutoCoMet} against baselines (Top-1 Accuracy in Appendix). We report IOU for segmentation}
\scalebox{0.80}{
\begin{tabular}{p{0.10\linewidth}|l|c|c|c|c|c|c|c|c|c|c|c|c}
\hline
\multirow{2}{0.0pt}{\textbf{Task}} & \multirow{2}{0.0pt}{\textbf{Model}} & \multicolumn{3}{c|}{\textbf{Top-5 Acc / IOU \%}} & \multicolumn{3}{c|}{\textbf{Inf Latency (milliseconds)}} & \multicolumn{3}{c|}{\textbf{Size\%}} & \multicolumn{3}{c}{\textbf{Search Time (GPU hrs)}}\\
\cline{3-14}
& & 1 & 2 & 3 & 1 & 2 & 3 & 1 & 2 & 3 & 1 & 2 & 3\\
\hline
\hline
\multirow{8}{0.10\linewidth}{{Classification (ImageNet)}} & MobileNetV2 \textit{[Manual]} & 91.2 & 91.2 & 91.2 & 113.2 & 256.2 & 300.5 & 100 & 100 & 100 & -- & -- & --\\
& ProxylessNAS (MNAS-Net) & 88.5 & 88.5 & 85.8 & 76.8 & 193.5 & 235.6 & 70 & 70 & 70 & 5.8 & 6 & 7.6\\%29 & 30 & 38\\
& NAS+Predictor & 90.24 & 90.24 & 89.9 & \textbf{50.28} & \textbf{129.25} & \textbf{130.8} & 70 & 70 & 60 & 10.8 & 10.8 & 13\\%54 & 54 & 65\\
& \textit{\textsc{AutoCoMet}} & 90.48 & 90.48 & 90.2 & \textbf{50.28} & \textbf{129.56} & \textbf{130.8} & 70 & 70 & 60 & \textbf{3} & \textbf{3} & \textbf{3.6}\\%\textbf{5} & \textbf{5} & \textbf{12}\\
\cline{2-14}
& InceptionV3 \textit{[Manual]} & 94.49 & 94.3 & 94.39 & 346.2 & 445.8 & 505.5 & 100 & 100 & 100 & -- & -- & --\\
& ProxylessNAS (MNAS-Net) & 90.5 & 90.5 & 89.0 & 234.8 & 278.4 & 280.5 & 80 & 80 & 65 & 11.4 & 12 & 15.8\\%57 & 60 & 79\\
& NAS+Predictor & 92.6 & 92.6 & 92.6 & 111.81 & 154.54 & 176.8 & 80 & 75 & 62 & 25 & 22.5 & 26.3\\%100 & 90 & 105\\
& \textsc{AutoCoMet} & 92.6 & 93.2 & 92.9 & 111.67 & 156.2 & 178.5 & 80 & 75 & 62 & \textbf{11} & \textbf{8.8} & \textbf{13.6}\\%34 & 25 & 20\\
\hline
\multirow{4}{0.10\linewidth}{Segmentation (COCO)} & MobileNetV2+Decoder & 89.9 & 89.9 & 89.9 & 45.2 & 57.6 & 76.5 & 100 & 100 & 100 & -- & -- & --\\
& ProxylessNAS (MNAS-Net) & 83.5 & 83.5 & 83.8 & 30.8 & 32.9 & 35.1 & 64.5 & 60.5 & 60 & 9.6 & 11.2 & 11.2\\%24 & 28 & 28\\
& NAS+Predictor & 85.8 & 85.78 & 85.4 & 26.8 & 39.5 & 35.8 & 70 & 65.5 & 68.2 & 15.6 & 13.8 & 14\\%39 & 30 & 35\\
& \textsc{AutoCoMet} & 88.4 & 86.8 & 87.1 & $\approx$\textbf{13} & \textbf{15.3} & \textbf{30.8} & 70 & 62.5 & 62.5 & \textbf{3.5} & \textbf{3.5} & \textbf{4}\\%\textbf{7} & \textbf{7} & \textbf{6}\\
\hline
\end{tabular}}
\label{tab:globalComp}
\end{table*}
\section{Experimental Evaluation}
Empirical validation of automated architecture learning is not straightforward. Hence, our evaluation aims to answer the following –
\textbf{[Q1.]} Is \textsc{AutoCoMet} able to generate architectures having better predictive performance or higher efficiency?
\textbf{[Q2.]} Is the meta-behavior predictor effective?
and
\textbf{[Q3.]} How fast is our novel co-regulated controller?
\begin{table}[h!]
\centering
\caption{Comparison of meta-behavior predictors}
\scalebox{0.82}{
\begin{tabular}{c|c|c|c}
\hline
\textbf{Model} & \textbf{R2} & \textbf{RMSE} & \textbf{Time}\\
\hline
\hline
B-o-B & \textbf{0.9417} & \textbf{1.32} & 31ms\\
XGBoost & {0.91} & {1.354}& 29.9ms\\
MLP & 0.8748 & 1.36 & 28.8ms\\
SVR & 0.8253 & 1.5142 & \textbf{199.5$\mu$s}\\
\hline
B-o-B & \multicolumn{2}{c|}{Acc. = $97.2\pm0.6$}& 31ms\\
GCN (BRPNas) & \multicolumn{2}{c|}{Acc. = $96.9\pm0.78$}& 93ms\\
\hline
\end{tabular}}
\label{tab:metaPerf}
\end{table}
\subsection{Experimental setting}
We are primarily interested in the computer vision domain and thus we evaluate on such tasks. Baselines are, 1) ProxylessNAS (related MNASNet) itself and 2) Vanilla expert designed state-of-the-art networks such as MobileNetV2 \cite{sandler2018mobilenetv2}, InceptionV3.
We implement execution stats collection pipeline and co-regulated RL controller in python 3.5 with pyTorch v1.4. All architecture search experiments are run on 2 core Nvidia 1080Ti GPU system (both our approach and baselines).
\noindent\textbf{Domains: }We evaluate on 2 distinct tasks (data sets), namely \textit{ImageNet} \cite{imagenet_cvpr09} for object classification and \textit{COCO dataset} \cite{lin2014microsoft} for `segmentation'. In COCO dataset we change contrast and brightness and then find the object mask to create the segmentation labels.
The displayed results are averaged over 10 training runs.
Meta-predictor is trained with the execution stats dataset that we collect from various mobile devices with varying hardware configurations super-sampled with SMOTE technique \cite{chawla2002smote}. Layerwise inference latency, memory/power usage data was collected for multiple DNN models including VGG, Squeezenet, RCNN, MobilenetV1/V2, GoogleNet, AlexNet etc. using
publicly available Samsung Neural SDK \cite{samsungneural}. We capture the following attributes - `Type, Kernel Size, Stride, Padding, Expansion Ratio, Idskip, Channels, Height, Width, Input Volume, Output Volume, Execution time, Cores, Compute Units, Memory, Clock Freq. and Memory B/w
\subsection{Experimental Results}
We conducted 3 types of experiments. To show that \textsc{AutoCoMet} can design DNN architectures that are both accurate as well as optimally efficient on an ecosystem of mobile devices we compare the vanilla manually designed state-of-the-art architectures to the ones that were generated by \textsc{AutoCoMet}. Also, we compare architectures generated by related methods, ProxylessNAS (which itself is based on MNASNet search space and optimization) as well as NAS+Predictor (which is \textsc{AutoCoMet} w/ meta-behavior predictor but w/o co-constrained shaping). We execute the learned models on 3 types of mobile hardwares - `Type 1' (flagship devices w/ high memory b/w + CPU/GPU/Neural-Processors.), `Type 2' (Mid-tier device w/ reasonable memory b/w + CPU/GPU) and `Type 3' (low-tier devices w/ low memory and CPU).
To analyse the fidelity of our meta-behavior predictor we perform ablation studies with different predictors and show that our B-o-B predictor is most effective.
Finally, to show that our novel co-constrained RL controller results in faster convergence of the architecture search, we present as learning curves of the cumulative returns in \textsc{AutoCoMet} against ProxylessNAS (which subsumes other related approaches such as MNASNet).
\subsubsection{Quality of generated architecture \textbf{[Q1]}}
Table~\ref{tab:globalComp} shows the performance/efficiency on classification and segmentation tasks. As described earlier we repeat the same experiments on different device types (Types 1, 2 \& 3). We show results against 2 popular classification models (MobilenetV2 and Inception V3) and an expert designed segmentation model MobilenetV2+Decoder with Deconv layers stacked after MobilenetV2 base (similar to UNet).
We report Top-5 Accuracy (classification) and Intersection-Over-Union/IOU (segmentation), average inference latency, ratio of size of the learned architectures and search-time (Top1 reported in Appendix\footnote{For Appendix refer to supplementary file}
Across all device types \textsc{AutoCoMet} learns architectures with predictive performance equal or close to state-of-the-art, while the inference latency as well as the size of the learned architecture is almost always significantly lower. Results for Type 3 are even more significant -- \textsc{AutoCoMet} learns smaller and more efficient architectures. On segmentation task we achieve $~13ms$ latency on flagship device which is the most ambitious till date. Note that ProxylessNAS (related MNASNet) although does produce reasonably efficient architectures (closer to ours), suffers in accuracy unlike \textsc{AutoCoMet}. This supports our conjecture that our approach tries to achieve the ideal level of relative dominance in the joint optimization.
Additionally we see that `NAS+predictor', though produces effective and efficient architectures, yet has higher search time. After analysing the intermediate outputs we did find that simple combination-based approach of multi-criteria RL suffers due to reward sparsity. \textsc{AutoCoMet} on the other hand handles it really well due to the shaping-based strategy.
\subsubsection{Fidelity of meta-behavior predictor \textbf{[Q2]}}
\label{sec:metaresult}
Accurate prediction of context-sensitive execution meta-behavior is important for the shaping potential. To understand the relative effectiveness we compare our \textit{B-o-B} against both ensemble and traditional regression model, such as XGBoost, Support Vector Regression (SVR) and Multi-Layer Perceptron (MLP). Table~\ref{tab:metaPerf} shows our ensemble model \textit{B-o-B} outperforming the others (as expected given the hybrid feature space). It is even marginally than GCN predictor in BRP-NAS, while being much faster. Note that GCN predictor is very limited since it has boolean response (good/bad).
Response plots (Appendix) also show marginal `unexplained variance' resulting in high $R^2$ scores
\begin{figure}[t!]
\centering
\includegraphics[width=0.60\columnwidth]{img/RwdPlotV4.png}
\caption{Learning curve on Imagenet classification task}
\label{fig:LC1}
\end{figure}
\subsubsection{Rapid Search / Sample efficiency \textbf{[Q3]}}
Figure~\ref{fig:LC1} shows the learning curves with respect to $[0,1]$ normalized cumulative returns (averaged) of the RL controllers of \textsc{AutoCoMet} against ProxylessNAS (MNAS), for Type-1 hardware configuration. We observe that \textsc{AutoCoMet} plateaus out by 4-5 epochs while ProxylessNAS gradually climbs to similar cumulative returns by $\approx 40$ epochs. This ablation study aims to show the difference in the core RL strategies (beyond the the final performance shown in Table~\ref{tab:globalComp}). These learning curves provide insight into the convergence dynamics of the core RL controllers in the different NAS methods. This supports our claim the our co-regulated mechanism implicitly takes care of of reward sparsity, hence converging early.
Note that each epoch takes consumes 0.2 GPU hours on an average.
The learning curve with respect to the Segmentation task is provided in the Appendix.
\section{Conclusion}
We propose our NAS/AutoML framework \textsc{AutoCoMet} that leverages high fidelity meta-predictor of device behavior for a wide range of devices/tasks (contexts) and uses a novel co-regulated shaping RL controller to generate optimal DNN architectures for an ecosystem of contexts. We also show how our controller leads to faster convergence which is a very important feature for application developers interested in using the proposed framework to learn suitable DNN architectures for their AI-driven mobile applications even without access to cloud or high-powered computational resources. The context-awareness and co-regulated shaping formulation of the multi-criteria feedback
provides a generalized and extremely fast architecture learning framework irrespective of context and quality requirements. It also implicitly adaptive and allows for customizing the relative conservativeness in the multi-objective optimization.
One caveat however, is that careful training of the mete-behavior predictor is important for robustness.
Capturing more exhaustive device behavior data is am important exercise that we aim to focus on next. Though, as outlined earlier, our formalism allows for learning over arbitrary combination of quality metrics in a principled manner, yet experimentation with other device behavior metrics (memory, power etc.) and adaptation to IoT (Internet of Things) ecosystem of connected devices are open challenges.
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-03-30T02:29:19', 'yymm': '2203', 'arxiv_id': '2203.15408', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15408'} | arxiv |
\section{\textbf{INTRODUCTION}}\label{sec:intro}
In the global competitive economy nowadays, an extremely important task for manufacturing companies is to not only offer high-quality products but also reduce waste and increase efficiency in the production processes. The development of advanced technologies in Artificial Intelligence and Data Science fields makes this task more possible, but also more challenging when competing with other companies. Therefore, making a smart decision in manufacturing becomes a crucial task in any production company. In this context, early detection of abnormal products as well as assignable causes to fix the production system as soon as possible is an indispensable part, and Statistical Control Process (SPC) is one of the most effective methods to accomplish this task. Through control charts, SPC helps manufacturing companies monitor product qualities and discover the defects in the production lines. In SPC literature, many studies have been done to design a variety of control charts for monitoring different types of process data, see \cite{Montgomery2013}. Among these different data, compositional data (CoDa) are vectors whose components are strictly positive and they often present the proportions, percentages, or frequencies of some whole. Their applications can be found in many domains such as chemical research, econometrics, and the food industry, see \cite{Aitchison1986}. Due to the constraint on the sum of components of the CoDa vector, it can not be treated as normal data.
In SPC literature, the studies in the control charts for monitoring CoDa data are still limited. In \cite{Boyles1997}, a chi-squared type control chart for monitoring CoDa data was proposed. Recently, the authors in \cite{Vives2014a} investigated a $T^2$ control chart for monitoring CoDa with $p =3$ and then \cite{Vives2014b} extended the work in \cite{Vives2014a} for individual observations case. Two methods for interpretations of out-of-control signal of individual $T_C^2$ control chart in case $p >3$ was proposed in \cite{Vives2016}. In \cite{Tran-coda2017}, the authors proposed a MEWMA-CoDa chart for monitoring CoDa with arbitrary components. This type of control chart was shown to be effective in detecting small to moderate process shift sizes and outperforming its competitor ($T^2$-CoDa chart). The influence of measurement errors on the performance of $T^2$, MEWMA chart for monitoring CoDa were investigated in \cite{Zaidi2019} and \cite{Zaidi2020}, respectively.
In these control charts, the authors suggested using an isometric log-ration (ilr) transformation to transform CoDa to vector in $\mathbb{R}^{p-1}$ space to handle the constraint of CoDa and the average run length (ARL) to evaluate the performance of proposed control charts.
In the control charts mentioned above, the fixed sampling interval (FSI) was supposed to use. Recently, the design of control charts tends to use variable sampling intervals (VSI). In these charts, the sampling interval between two consecutive samples is allowed to vary due to the value of the current control statistic. Many studies on the VSI control chart have been published so far, see, for example, \cite{Castagliola2013}, and \cite{Nguyen2018VSI}, among many others. As we know, the VSI MEWMA control chart for monitoring CoDa has not been used. Consequently, in this study, we propose a VSI MEWMA type control chart for monitoring CoDa, namely VSI MEWMA-CoDa, with arbitrary components based on ilr transformation. The modification of the Markov chain approach proposed by \cite{Lee2009} will be used to compute average time to signal (ATS), criteria to access the performance of VSI control charts.
The rest of this paper is organized as follows: In Section
\ref{sec:modeling}, the modeling of CoDa and the suggested isometric log-ratio transformation are introduced; the VSI MEWMA-CoDa control chart together with the Markov chain approach and optimization procedure to find the optimal parameters are given in Section
\ref{sec:VSIMEWMA}; in Section
\ref{sec:performance}, the performance of the VSI MEWMA-CoDa chart with different scenarios are provided; conclusions and
some recommendations for further researches are given in Section
\ref{Sec:Conclusion}.
\section{\textbf{Modeling of Compositional Data}}
\label{sec:modeling}
By definition, a row vector, $\textbf{x} = (x_1, x_2, \ldots , x_p)$, is a p-part composition when its components are strictly positive and they carry only relative information, see \cite{Aitchison1986}, \cite{Pawlowsky2015}. The relative information here refers only to the proportions between components of the composition, regardless of their numerical values. The sum of the components of $\textbf{x}$, $\sum_{i=1}^{p}x_{i}$, is a constant $\kappa$. For instance, $\kappa = 100$ refers to measurements in percentage while $\kappa = 1$ means that the measurements are proportions. Each composition can be considered as an equivalent class made of proportional factors since the ratios between its components do not change when multiplying it by a positive constant. In this case, if $\textbf{x}, \textbf{y}$ are compositions and $\textbf{x} = \lambda \textbf{y}$ for some constants $\lambda$, we say that $\textbf{x}, \textbf{y}$ are compositionally equivalent. To check the equivalency of the two compositions, we can use the closure function $\mathcal{C}(\textbf{x})$, defined as
\begin{equation*}
\mathcal{C}(\textbf{x}) = \left( \frac{\kappa \cdot x_{1}}{\sum_{i=1}^{p}x_{i}}, \ \frac{\kappa \cdot x_{2}}{\sum_{i=1}^{p}x_{i}}, \ldots, \frac{\kappa \cdot x_{p}}{\sum_{i=1}^{p}x_{i}} \right)
\end{equation*}
where $\kappa > 0$ is a fixed constant; in this definition, two p-part compositions $\textbf{x}, \textbf{y}$ are compositionally equivalent if $\mathcal{C}(\textbf{x}) = \mathcal{C}(\textbf{y})$.
The sample space of CoDa is the simplex,
\begin{equation*}
\begin{split}
\mathcal{S}^p = \Big\{ \textbf{x} =(x_1, x_2, \ldots , x_p) \enskip | \enskip x_{i} > 0, i = 1, \ldots, D; \\
\sum_{i=1}^{p}x_{i} = \kappa \Big\}
\end{split}
\end{equation*}
In $\mathbb{R}^p$ space, we can use Euclidean geometry to add vectors or multiply vectors by scalar to obtain their properties or compute their distance. But, due to special structure of CoDa vectors in $\mathcal{S}^p$, this geometry can not be applied directly. The authors of \cite{Aitchison1986} introduced the Aitchison geometry, with two operations required for a vector space structure on $\mathcal{S}^p$: \textit{Perturbation} and \textit{powering} operators. The perturbation $\oplus$ of $\textbf{x} \in \mathcal{S}^p$ by $\textbf{y} \in \mathcal{S}^p$ (equivalent to the addition in $\mathbb{R}^p$) is defined by
$$\textbf{x} \oplus \textbf{y} = \mathcal{C}(x_{1}y_{1}, \ldots, x_{p}y_{p}) \in \mathcal{S}^p$$
and the powering $\odot$ of $\textbf{x} \in \mathcal{S}^p$ by a constant $\alpha \in \mathbb{R}$ (equivalent to the multiplication by a scalar operation in the $\mathbb{R}^p$) is defined by
$$\alpha \odot \textbf{x} = \mathcal{C}(x_{1}^{\alpha}, \ldots, x_{p}^{\alpha}) \in \mathcal{S}^p$$
In practice, CoDa are often transformed to vectors in the Euclidean space to remove its constraints. The center
log-ratio (clr) transformation of vector $\textbf{x} \in \mathcal{S}^p$, $\operatorname{clr}(\textbf{x})$, is an isometry from $\mathcal{S}^p$ to a subspace $U \subset \mathbb{R}^p$, defined by
\begin{align*}
\operatorname{clr}(\textbf{x}) &= \left(\ln \frac{x_1}{g_{m}(\textbf{x})}, \ln \frac{x_2}{g_{m}(\textbf{x})}, \ldots, \ln \frac{x_p}{g_{m}(\textbf{x})} \right) \\
& = (\xi_1, \xi_2, \ldots, \xi_p)
\end{align*}
where
\begin{equation*}
g_{m}(\textbf{x}) = \left(\prod_{i=1}^p x_i \right)^{\frac{1}{p}} = \exp \left(\frac{1}{p}\sum_{i=1}^p x_i \right)
\end{equation*}
is the geometric mean of the composition and $\sum_{i=1}^p \xi_i = 0$. The inverse center
log-ratio $\operatorname{clr}^{-1}(\bm{\xi})$ recovering $\textbf{x}$ from $\bm{\xi} = (\xi_1, \ldots, \xi_{p})$ is
\begin{equation*}
\operatorname{clr}^{-1}(\bm{\xi}) = \mathcal{C}(\exp(\bm{\xi})) = \mathcal{C}(\exp(\xi_1),\exp(\xi_2), \ldots, \exp(\xi_{p})).
\end{equation*}
Egozcue et al. \cite{Egozcue2003} showed that the constraint in the component of $\operatorname{clr}(\textbf{x})$ makes singular the $\operatorname{clr}(\textbf{x})$ variance-covariance matrix for random composition. To overcome this drawback, the authors of \cite{Egozcue2003} proposed a new transformation which is associated with an orthogonal basis in $\mathcal{S}^p$, named isometric log-ratio (irl) transformation. Let ${\textbf{e}_1, \textbf{e}_2, \ldots , \textbf{e}_{p-1}}$ be an orthonormal basis of $\mathcal{S}^p$. Any composition $\textbf{x} \in \mathcal{S}^p$ can be expressed as
\begin{equation*}
\textbf{x} = \bigoplus_{i = 1}^{p-1}x_{i}^* \odot \textbf{e}_i, \enskip x_{i}^* = \langle \textbf{x},\textbf{e}_i \rangle_a = \langle \operatorname{clr}(\textbf{x}), \operatorname{clr}(\textbf{e}_i) \rangle
\end{equation*}
where $\langle , \rangle_a$ denotes the Aitchison inner product. Thus, the ilr transformation of $\textbf{x} \in \mathcal{S}^p$ is $\operatorname{ilr}(\textbf{x}) = \textbf{x}^* = (x_{1}^*, x_{2}^*, \ldots, x_{p-1}^*)$.
Let $\textbf{B}$ be a $(p-1, p)$
matrix whose $i^{th}$ row is $\operatorname{clr}(\textbf{e}_i), i = 1, \ldots, p-1$. This matrix is known as a contrast matrix associated with the orthonormal basis ${\textbf{e}_1, \textbf{e}_2, \ldots , \textbf{e}_{p-1}}$. The ilr transformation $\textbf{x}^*$ of composition $\textbf{x}$ can be computed by
$$\textbf{x}^* = \operatorname{ilr}(\textbf{x}) =(x_1^*, \ldots, x_{p-1}^*) = \operatorname{clr}(\textbf{x}) \cdot \textbf{B}^{\intercal}$$
There are many candidates for an orthonormal basis in $\mathcal{S}^p$. The authors of \cite{Egozcue2005} proposed a sequential binary partition to define an orthonormal basis. In this basis, $\textbf{e}_i$ is defined to be $\mathcal{C}(e_{i,1},\ldots,e_{i,j},\ldots,e_{i,p})$ where
\[
e_{i,j}=\left\{
\begin{array}{ll}
\exp{\left(\sqrt{\frac{1}{i(i+1)}}\right)} & \text{\quad if \quad} j\leq i \\
\exp{\left(-\sqrt{\frac{i}{i+1}}\right)} & \text{\quad if \quad} j=i+1 \\
1 & \text{\quad otherwise \quad}
\end{array}
\right.
\]
The elements $e_{i,j}$ are called the \emph{balancing elements} of this basis. Thus, if this type of orthonormal basis is chosen to transform $\textbf{x}$, i.e., $\operatorname{ilr}(\textbf{x}) = \operatorname{clr}(\textbf{x}) \cdot \textbf{B}^{\intercal}$, the coordinates $x^*_i$ are called \emph{balances} and can be obtained by
\[
x^*_i=\sqrt{\frac{i}{i+1}}\ln\left(\frac{\left(\prod_{j=1}^ix_j\right)^{\frac{1}{i}}}{x_{i+1}}\right).
\]
From its ilr coordinate $\textbf{x}^*$, $\textbf{x}$ can be recovered by using the inverse of ilr transformation:
\[
\operatorname{ilr}^{-1}(\mathbf{x}^*)=\operatorname{clr}^{-1}(\mathbf{x}^*\mathbf{B})
=\mathcal{C}(\exp(\mathbf{x}^*\mathbf{B})).
\]
\tab{tab:example1} illustrates the application of ilr transformation in practice for the case $p=4$. The first 4 columns present the components of 6 compositions in $\mathcal{S}^4$ and the remaining 3 columns present their corresponding ilr coordinates in $\mathbb{R}^3$. As can be seen, these $\operatorname{ilr}$ coordinates $x_i^*$ are not constrained any longer.
For more detail on CoDa and its properties, see \cite{Pawlowsky2015}.
\begin{table}
\caption{An example of ilr transformation in $\mathcal{S}^4$}
\begin{center}
\begin{tabular}{ccccccc}
\hline
$x_1$ & $x_2$ & $x_3$ & $x_4$ & $x^*_1$ & $x^*_2$ & $x^*_3$ \\
\hline
0.10 & 0.30 & 0.50 & 0.10 & -0.78 & -0.87 & 0.78\\
0.20 & 0.25 & 0.20 & 0.35 & -0.16 & 0.09 & -0.42\\
0.50 & 0.10 & 0.20 & 0.20 & 1.14 & 0.09 & 0.06\\
0.60 & 0.05 & 0.05 & 0.30 & 1.76 & 1.01 & -0.83\\
0.35 & 0.15 & 0.10 & 0.40 & 0.60 & 0.68 & -0.72\\
0.20 & 0.45 & 0.05 & 0.30 & -0.57 & 1.46 & -0.52\\
\hline
\end{tabular}
\end{center}
\label{tab:example1}
\end{table}
\section{\textbf{VSI Multivariate EWMA control chart for Compositional Data}}
\label{sec:VSIMEWMA}
\subsection{\textbf{VSI MEWMA-CoDa control chart}}
Let us suppose that, at each sampling period $i=1,2,\ldots$, a sample of size $n$ independent $p$-part composition observations
$\{\mathbf{X}_{i,1},\ldots,\mathbf{X}_{i,n}\}$,
$\mathbf{X}_{i,j}\in\mathcal{S}^p$, $j=1,\ldots,n$ is collected, and suppose also that each $\mathbf{X}_{i,j}$, $j=1,\ldots,n$, follows a multivariate normal distribution $N_{\mathcal{S}^p}(\bm{\mu},\bm{\Sigma})$
on the simplex $\mathcal{S}^p$, where $\bm{\mu} \in \mathcal{S}^p$ is the center of compositions and $\bm{\Sigma}$ is their variance-covariance matrix.
Assume that, when the process is in-control, the composition center is $\bm{\mu}_0$ and when the process is out-of-control, the composition center is $\bm{\mu}_1$.
The aim of this paper is to design a variable sampling interval MEWMA control chart (denoted by VSI-MEWMA-CoDa) to monitor the \emph{center} $\bm{\mu}$ of a $p$-part compositional process. Since CoDa data has a constant constraint on its components, the traditional VSI-MEWMA control chart may not perform well on monitoring this type of data. In \cite{Tran-coda2017}, instead of directly monitoring the composition center $\bm{\mu}$, the authors proposed to monitor the mean vector $\bm{\mu}^* = \operatorname{ilr}(\bm{\mu})$ using a FSI MEWMA control chart for the sample mean coordinates vector $\bar{\mathbf{X}}^*_i$. In this study, we will apply the idea in \cite{Tran-coda2017} to investigate a VSI-MEWMA control chart for monitoring a compositional process.
Let $\{\mathbf{X}^*_{i,1},\ldots,\mathbf{X}^*_{i,n}\}$ be the
corresponding $\operatorname{ilr}$ coordinates of $\{\mathbf{X}_{i,1},\ldots,\mathbf{X}_{i,n}\}$,
i.e. $\mathbf{X}^*_{i,j}=\operatorname{ilr}(\mathbf{X}_{i,j})\in\mathbb{R}^{p-1}$. Since $\mathbf{X}_{i,j}$ follows a multivariate normal distribution $N_{\mathcal{S}^p}(\bm{\mu},\bm{\Sigma})$ on $\mathcal{S}^p$, its corresponding $\operatorname{ilr}$ coordinate $\mathbf{X}^*_{i,j}$
follows a multivariate normal distribution
$N_{\mathbb{R}^{p-1}}(\bm{\mu}^*,\bm{\Sigma}^*)$ on $\mathbb{R}^{p-1}$, where $\bm{\mu}^*=\operatorname{ilr}(\bm{\mu}) \in \mathbb{R}^{p-1}$ is the
mean vector, $\bm{\Sigma}^*$ is the $(p-1,p-1)$ variance-covariance matrix of the ilr transformed data. The values of parameters
$\bm{\mu}^*$ and $\bm{\Sigma}^*$ depend on the particular choice of matrix $\mathbf{B}$ chosen in ilr transformation (see \cite{Pawlowsky2015} and section \ref{sec:modeling}).
Denote the ilr coordinates of in-control composition center $\bm{\mu}_0$ and out-of-control composition center $\bm{\mu}_1$ are $\bm{\mu}_0^*$ and $\bm{\mu}_1^*$, respectively. The average of $n$ independent $p$-part compositional observations is defined by
\[
\bar{\mathbf{X}}_i=\frac{1}{n}\odot(\mathbf{X}_{i,1}\oplus\cdots
\oplus\mathbf{X}_{i,n})
\]
then its ilr coordinate $\bar{\mathbf{X}}^*_i$ is
$\bar{\mathbf{X}}^*_i=\operatorname{ilr}(\bar{\mathbf{X}}_i)=\frac{1}{n}(\operatorname{ilr}(\mathbf{X}_{i,1})+\cdots+\operatorname{ilr}(\mathbf{X}_{i,n}))=\frac{1}{n}(\mathbf{X}^*_{i,1}+\cdots+
\mathbf{X}^*_{i,n}) \in \mathbb{R}^{p-1}$. \\
We first recall the FSI MEWMA-CoDa control chart proposed by the authors in \cite{Tran-coda2017} as follows. Let the MEWMA vector $\mathbf{W}_i$ be
\[
\mathbf{W}_i=r(\bar{\mathbf{X}}^*_i-\bm{\mu}_0^*)+(1-r)\mathbf{W}_{i-1},
\,i=1,2,\ldots
\]
where $\mathbf{Y}_0=\mathbf{0}$, $r\in(0,1]$ is a fixed smoothing parameter. In FSI MEWMA-CoDa control chart, Tran et al. \cite{Tran-coda2017} suggested to monitor the statistic
\begin{equation}
\label{equ:Qi}
Q_i=\mathbf{W}_i^{\intercal}\bm{\Sigma}^{-1}_{W_i}\mathbf{W}_i,\,i=1,2,\ldots
\end{equation}
where $\bm{\Sigma}_{W_i}$ is the variance-covariance matrix of $\mathbf{W}_i$. In this work, the asymptotic form of
the variance-covariance matrix $\bm{\Sigma}_{W_i}$
\[
\bm{\Sigma}_{W_i}=\frac{r}{n(2-r)}\bm{\Sigma}^*
\]
was used to compute the plotted statistic (and it is also used in our work). An out-of-control signal is issued when
$Q_i>UCL=H$, where $H>0$ is chosen to achieve a specific value of in-control $ATS$.
In the FSI MEWMA-CoDa control chart, the sampling interval is a fixed constant $h_F$. As for the VSI MEWMA-CoDa control chart, based on the current value of $Q_i$, the time between two successive samples $\bar{\mathbf{X}}_i, \bar{\mathbf{X}}_{i+1}$ is allowed to varied. In this chart, the control limit UCL is held the same as in the FSI chart, and an additional warning limit $w = UWL$ $(0< UWL <UCL)$ is introduced to determine the switch between the long and short sampling intervals: The long sampling intervals $h_L$ is used when the control statistic $Q_i^2 \leq UWL^2$ (safe region) and the short sampling intervals $h_S$ is used when $UWL < Q_i^2 \leq UCL^2$ (warning region). An out-of-control signal is issued when $Q_i^2 > UCL^2$.
\subsection{\textbf{Markov chain model}}
Suppose that the occurrence of an assignable cause makes the in-control composition center $\bm{\mu}_0$ is shifted to $\bm{\mu}_1$, or equivalently $\bm{\mu}_0^*$ is shifted to $\bm{\mu}_1^*$. In this subsection, we will discuss a method based on the Markov chain model to compute the average of the zero-state time to signal (ATS) for the VSI MEWMA-CoDa control chart. Let $ATS_0, ATS_1$ denote the ATS when the process runs in-control, and out-of-control, respectively. In comparison with other control charts, it is desirable to design a chart with smaller $ATS_1$ while their $ATS_0$ are the same. In the FSI chart, since the sampling interval $h_F$ is fixed, we have
\begin{equation*}
ATS^{\mathrm{FSI}} = h_F \times ARL^{\mathrm{FSI}}.
\end{equation*}
In the VSI chart, since the sampling interval is allowed to vary, the relation between $ATS$ and $ARL$ would be:
\begin{equation*} \label{equ:tinh Eh}
ATS^{\mathrm{VSI}} = E(h) \times ARL^{\mathrm{VSI}}.
\end{equation*}
where $E(h)$ denote the average sampling interval.
The authors of \cite{Lowry1992} showed that the performance of a MEWMA-$\bar{X}$ chart is a function of the $n$, $\bm{\mu}_0^*$,
$\bm{\mu}_1^*$ and $\bm{\Sigma}^*$ only
through the non-centrality parameter $\delta$ where
\[
\delta=\sqrt{n(\bm{\mu}_1^*-\bm{\mu}_0^*)^{\intercal}(\bm{\Sigma}^*)^{-1}
(\bm{\mu}_1^*-\bm{\mu}_0^*)}.
\]
Without loss of generality, we can assume $n=1$,
$\bm{\mu}_0^*=\mathbf{0}$ (i.e. the in-control composition center is
$\bm{\mu}_0=(\frac{1}{p},\frac{1}{p},\ldots,\frac{1}{p})$) and
$\bm{\Sigma}^*=\mathbf{I}_{p-1}$ (the identity matrix in
$\mathbb{R}^{p-1}$). In this case, the statistic $Q_i$ in
\equ{equ:Qi} is modified to $Q_i=b\norm{W_i}_2^2$ with $b=\frac{2-r}{r}$. Consequently, the control limits UCL and UWL of VSI MEWMA-CoDa are modified to be
\[
UCL = \sqrt{H/b}, \quad UWL = \sqrt{w/b}
\]
To calculate the in- and out-of-control ATS of the
VSI MEWMA-$\bar{X}$ chart, the author of \cite{Lee2009} modified the Markov chain approach proposed in \cite{Runger1996} to approximate its calculation based on the statistic $q_i=\norm{W_i}_2$.
Concerning the \emph{in-control} case, the one dimensional Markov chain can be used to approximate ATS.
In this case, the interval $[0,UCL']$, where $UCL'=\sqrt{H/b}$, is divided into $m+1$
sub-intervals (states): the first sub-interval has length
$\frac{g}{2}$ and the others have length $g$, where
$g=\frac{2UCL'}{2m+1}$. The probability of transition from state $i$ to state $j$, denoted by $p(i,j)$, is given by
\begin{itemize}
\item for $i=0,1,\ldots,m$ and $j=1,2,\ldots,m$,
\begin{equation*}
\begin{split}
p(i,j)=P\bigg(\Big(\frac{(j-0.5)g}{r}\Big)^2<
\chi^2(p-1,c) \\
< \Big(\frac{(j+0.5)g}{r}\Big)^2\bigg)
\end{split}
\end{equation*}
where $\chi^2(p-1,c)$ denotes a non central chi-square random variable with $p-1$ degrees of freedom and non-centrality parameter $c=\left(\frac{(1-r)ig}{r}\right)^2$,
\item for $j=0$,
\[
p(i,0)=P\left(\chi^2(p-1,c)<\left(\frac{g}{2r}\right)^2\right).
\]
\end{itemize}
Let $\textbf{P}_1$ denote the $(m+1,m+1)$ transition probability matrix corresponding to the transient states with the elements $p(i,j)$ then the zero-state in-control $ATS$ of the VSI MEWMA-CoDa control chart is obtained by
\[
ATS=\mathbf{s}^{\intercal}(\mathbf{I}_{m+1}-\mathbf{P}_1)^{-1}\mathbf{h},
\]
where $\mathbf{s}$ is the $(m+1)$-starting probability vector,
i.e. $\mathbf{s}=(1,0,0,\ldots,0)^{\intercal}$, $\mathbf{h}$ is the $(m+1)$-vector of sampling interval with the $i^{th}$ component $h_i$ is defined by
\begin{align*}
h_i= \begin{cases}
h_L ~~\text{if}~~ ig \leq UWL\\
h_S ~~\text{if}~~ ig > UWL
\end{cases}.
\end{align*}
The expected sampling interval $E(h)$ is calculated by
\begin{equation*}
E(h)=\frac{\mathbf{s}^{\intercal}(\mathbf{I}_{m+1}-\mathbf{P}_1)^{-1}\mathbf{h}}{\mathbf{s}^{\intercal}(\mathbf{I}_{m+1}-\mathbf{P}_1)^{-1}\mathbf{1}_{m+1}},
\end{equation*}
where $\mathbf{1}_{m+1}=(1,1,\ldots,1)^{\intercal}$ is the $m+1$ column vector of 1's.
To calculate the zero-state ATS of VSI MEWMA-CoDa chart in the \emph{out-of-control} case, The author of \cite{Lee2009} modified the two
dimensional Markov chain approach which is originally proposed in \cite{Runger1996}. In this approach, $\mathbf{W}_i\in\mathbb{R}^{p-1}$ is partitioned into $W_{i1}\in\mathbb{R}$ with mean $\delta \neq 0$ and
$\mathbf{W}_{i2}\in\mathbb{R}^{p-2}$ with zero mean. Then,
$q_i=\norm{\mathbf{W}_i}_2=\sqrt{W^2_{i1}
+\mathbf{W}^{\intercal}_{i2}\mathbf{W}_{i2}}$.
The transition probability $h(i,j)$ of $W_{i1}$ from state $i$ to state $j$ is used to analyze the out-of-control component. Applying the Markov chain-based approach with the number of states of the Markov chain is $2m_1+1$, for $i, j = 1, 2,\ldots, 2m_1+1$, we have
\begin{align*}
h(i,j)= &\Phi\left(\frac{-UCL'+jg_1-(1-r)c_i}{r}-\delta\right) \\
& -\Phi\left(\frac{-UCL'+(j-1)g_1-(1-r)c_i}{r}-\delta\right)
\end{align*}
where $\Phi$ denotes the cumulative standard normal distribution function, $c_i=-UCL'+(i-0.5)g_1$ is the center point of state $i$ with the width of each state $g_1=\frac{2UCL'}{2m_1+1}$.
Concerning $\mathbf{W}_{i2}$ component, the transition probability $v(i,j)$ from state $i$ to state $j$ is used to analyze the in-control component. In this case, the Markov chain approach as in in-control case will be applied
with $p-2$ replacing $p-1$. The control region is partitioned into $m_2+1$ sub-intervals (states) with the width of each states is $g_2=\frac{2UCL'}{2m_2+1}$. The transition probability $v(i,j)$ is given as follows
\begin{itemize}
\item for $i=0,1,2,\ldots,m_2$ and $j=1,2,\ldots,m_2$
\begin{equation*}
\begin{split}
v(i,j)=P\bigg(\Big(\frac{(j-0.5)g_2}{r}\Big)^2<
\chi^2(p-2,c) \\
< \Big(\frac{(j+0.5)g_2}{r}\Big)^2\bigg),
\end{split}
\end{equation*}
\noindent
where $c=\left(\frac{(1-r)ig_2}{r}\right)^2$,
\item for $j=0$,
\[
v(i,0)=P\left(\chi^2(p-2,c)<\left(\frac{g_2}{2r}\right)^2\right)
\]
\end{itemize}
Let $\mathbf{H}$ denote the $(2m_1+1,2m_1+1)$ transition probability matrix of $W_{i1}$ with elements $h(i,j)$, $\mathbf{V}$ denote the
$(m_2+1,m_2+1)$ transition probability matrix of
$\norm{\mathbf{Y}_{i2}}_2$ with elements $v(i,j)$, and
$\mathbf{P}_2$ denote the transition probability matrix of two dimensional Markov chain. Since $W_{i1}$ and
$\mathbf{Y}_{i2}$ are independent, we have $\mathbf{P}_2=\mathbf{H}\otimes\mathbf{V}$,
where $\otimes$ is the Kronecker's matrices product. Matrix
$\mathbf{P}_2$ will consist of the transition probabilities of all transient and some absorbing states of the Markov chain.
Let $\mathbf{T}$ be the $(2m_1+1,m_2+1)$- matrix with element $T(\alpha, \beta)$ given by
\[
\mathbf{T}(\alpha, \beta)=\left\{
\begin{array}{ll}
1& \mbox{if state ($\alpha, \beta$) is transient} \\
0& \mbox{otherwise}
\end{array}
\right.
\]
and $\mathbf{P}$ be the transition probability matrix containing only transient states of the Markov chain. Then, we have
$\mathbf{P}=\mathbf{T}(\alpha,\beta)\circledast\mathbf{P}_2$ where symbol $\circledast$ indicates the element-wise multiplication of matrices.
Let $\mathbf{h}$ be the $(2m_1+1) \cdot (m_2+1)$ vector of sampling intervals for the bivariate chain. M.H. Lee \cite{Lee2009} defined $\mathbf{h}$ to be
\begin{equation*}
\begin{split}
\mathbf{h}^{\intercal} = \big((1,0), \ldots, (1,m_2), (2,0), \ldots, (2,m_2), \ldots, \\
\ldots, (2m_1+1,0), \ldots, (2m_1+1,m_2)\big)
\end{split}
\end{equation*}
with the element $\mathbf{h}(i,j)$ defined by
\[
\mathbf{h}(i,j)=\left\{
\begin{array}{ll}
h_L& \mbox{if} \enskip a_{i,j} \leq UWL^2 \\
h_S& \mbox{if} \enskip UWL^2 < a_{i,j} \leq UCL^2 \\
0 & \mbox{otherwise}
\end{array}
\right.
\]
where $a_{i,j} = (i-(m_1+1))^2g_1^2 +j^2g_2^2.$
Thus, the zero-sate out-of-control $ATS$ of VSI MEWMA-CoDa control chart is
defined by $ATS=\mathbf{s}^{\intercal}(\mathbf{I}-\mathbf{P})^{-1}
\mathbf{h}$ where $\mathbf{s}$ is the initial probability vector with the component corresponding to
state $(\alpha,\beta)=(m_1+1,0)$ is equal to one and all other components are equal to zero. In case $m_1=m_2=m$, M.H. Lee \cite{Lee2006} showed that the entry corresponding to the component with value equal to 1 of $\mathbf{s}$ is the $(m(m+1)+1)$th entry. Concerning the performance of
the program used for the computation of the $ATS$, we follow the recommendation in \cite{Tran-coda2017} and decide to use $m_1=m_2=30$.
\subsection{\textbf{Optimization procedure}}
Assume that the fixed sampling interval in FSI control charts is to be a time unit, i.e. $h_F=1$. Hence, $ATS_0^{FSI} = ARL_0$. In order to evaluate the performances of VSI MEWMA-CoDa with its FSI version, we can compare their out-of-control $ATS_1$ while constraining the same in-control values of both $ATS_0$ and $E_0(h)$ (average sampling interval). Thus, the VSI MEWMA-CoDa control chart can be designed by finding the optimal combination of parameters that minimize the out-of-control $ATS_1$ subject to the predefined constraint of $ATS_0$ and $E_0(h)$.
In general, a fixed couple $(h_S, h_L)$ is typically used, which can be chosen from the suggested list as in \cite{Castagliola2013}. However, as discussed in the study \cite{Nguyen2018VSI}, while $h_S$ is quite reasonable to fix, it seems not practical to fix $h_L$ due to the fact that when the control statistic falls into the central region, the process is still in safe and the next sampling interval can be flexible to choose if it does not influence the performance of the chart. Based on this reason, we follow the suggestion in \cite{Nguyen2018VSI} to fix the proportion between the UCL and UWL values. Let $R$ be the number such that $ UWL = R \cdot UCL$. When the control limit UCL is determined, the warning limit UWL can be computed based on the value of $R$.
Thus, the optimal design of the VSI MEWMA-CoDa control chart will consist of searching the optimal parameters $(r, H, h_L)$ which minimize the out-of-control $ATS_1$ for given shift $\delta$ subject to constraints in the in-control $ATS_0$ and $E_0(h) = 1$, i.e,
\begin{equation*}
(r^{*}, H^{*},h_L^{*})=\underset{(r,H,h_L)}\operatornamewithlimits{argmin} \enskip \operatorname{ATS}(n, r, H, R, p-1, \delta, h_L, h_S)
\end{equation*}
subject to the constraint
\begin{align*} \label{equ:optim up 2}
\begin{cases}
\operatorname{ATS}(n, r^*, H^*, R, p-1, \delta = 0, h_L^*, h_S) = \operatorname{ATS}_0\\
\operatorname{E}_0(h)=1
\end{cases}
\end{align*}
By fixing the in-control predefined $ATS_0$ value, these optimal parameters can be obtained by using the two-steps optimization procedure as follows
\begin{enumerate}
\item Find the set of triples $(r,H, h_L)$ such that the in-control $ATS = ATS_0$
and $E_0(h)=1$.
\item Among these feasible triples $(r,H, h_L)$, choose $(r^*,H^*)$ which provides the smallest out-of-control $ATS$ value for a particular shift $\delta$ in vector $\bm{\mu}_0^*$.
\end{enumerate}
As noted in \cite{Tran-coda2017}, the value of
$r$ must not be too small to avoid unreliable results and the diverging ability in the Markov Chain approach. In this paper, we fix the minimal bound to search for the smoothing parameter $r$ to be $0.05$, as recommended in many studies, including \cite{Tran-coda2017}.
\section{\textbf{PERFORMANCE OF THE VSI MEWMA-CoDa CONTROL CHART}} \label{sec:performance}
In this section, we will compare the performance of the VSI MEWMA-CoDa chart with the FSI MEWMA-CoDa chart proposed by \cite{Tran-coda2017}. The comparison will be based on the values of out-of-control $\operatorname{ATS}_1$ while constraining on the same in-control values of both $\operatorname{ATS}_0$ and $\operatorname{E}_0(h)$. To take advantage of the results from the study of \cite{Tran-coda2017}, save the calculation costs, and simplify the application in practice, we propose to find the near-optimal values to the VSI MEWMA-CoDa control chart as follows:
\begin{itemize}
\item For each optimal couple $(r^*, H^*)$ in Table 2 in study of \cite{Tran-coda2017}, the value of UWL and $h_L$ are chosen to achieve predefined $\operatorname{ATS}_0$ and $\operatorname{E}_0(h)$,
\item After obtaining UWL and $h_L$, together with the corresponding $(r^*, H^*)$, we compute the $\operatorname{ATS}_1$ of VSI MEWMA-CoDa for specific shift sizes $\delta$ and compare them with $\operatorname{ARL}_1$ of FSI MEWMA-CoDa chart (Table 3 in \cite{Tran-coda2017}).
\end{itemize}
The procedure to find the near-optimal values is implemented based on following scenarios:
\begin{itemize}
\item $n = 1, p = 3$, $\operatorname{ATS}_0 = 200$, and $\operatorname{E}_0(h) =1$;
\item $\delta \in \{0.25, 0.50, 0.75, 1.00, 1.25, 1.50, 1.75, 2.00\}$;
\item $h_S\in \{0.1, 0.5\}$.
\end{itemize}
The values $\operatorname{ARL}_1$ (FSI column) of MEWMA-CoDa and $\operatorname{ATS}_1$ (VSI columns) for some different scenarios are shown in Table \ref{tab:compare}. The values of $w$ such that $UWL = \sqrt{w/b}$ and $h_L$ to obtain the near-optimal value are also provided for each scenario. Some remarks can be drawn from this results as follows
\begin{itemize}
\item The VSI MEWMA-CoDa control chart always outperforms the FSI MEWMA-CoDa control chart in detecting the process shifts. For example, when $\delta = 0.25, h_S = 0.1$, we have $\operatorname{ARL}_1 = 64.6$ for FSI MEWMA-CoDa chart and $\operatorname{ATS}_1 = 56.8$ for VSI MEWMA-CoDa chart,
\item The VSI MEWMA-CoDa charts with smaller $h_S$ $(h_S = 0.1)$ perform better than the ones with larger $h_S$ $(h_S = 0.5)$. For example, when $\delta = 0.5$, we have $\operatorname{ATS}_1 = 19.9$ in case $h_S = 0.1$ and $\operatorname{ATS}_1 = 23.5$ in case $h_S = 0.5$,
\item When the shift sizes $\delta$ are large $(\delta \geq 1.75)$, the performance of VSI MEWMA-CoDa chart are still better than FSI MEWMA-CoDa chart, but not much.
\end{itemize}
\begin{table}
\caption{Comparison between VSI MEWMA-CoDa and FSI MEWMA-CoDa charts}
\centering
\begin{tabular}{|c|c|c|c|c|c|}
\multirow{2}{*}{$\delta$} & \multirow{2}{*}{FSI} & \multicolumn{2}{c|}{$h_S=0.1$} & \multicolumn{2}{c|}{$h_S=0.5$} \\
\cline{3-6}
& & $(w, h_L)$ & VSI& $(w, h_L)$ & VSI \\
\hline
0.25 & 64.6 & $(1.7, 1.6)$ & 56.8 & $( 0.7, 2.1)$ & 63.5 \\
0.50 & 26.4 & $(1.7, 1.6)$ &19.9 & $(0.9, 1.8)$ & 23.5 \\
0.75 & 15.1 &$(1.6, 1.7)$ &10.4 & $(1.0, 1.8)$ & 12.9\\
1.00 & 9.9 &$(2.9, 1.3)$ & 6.9 & $(0.9, 1.8)$ & 8.4 \\
1.25 & 7.1 & $(1.6, 1.8)$ & 4.9 & $(0.9, 2.0)$ & 6.3\\
1.50 &5.4 & $(3.5, 1.2)$ & 3.7 & $(0.9, 1.9)$ & 4.8\\
1.75 & 4.3 & $(3.7, 1.2)$ & 3.0 & $(0.8, 2.1)$ & 4.2\\
2.00 & 3.5 & $(3.6, 1.2)$ & 2.4 & $(1.1, 1.8)$ & 3.3\\
\end{tabular}
\label{tab:compare}
\end{table}
\section{\textbf{Conclusion}}
\label{Sec:Conclusion}
In this paper, we proposed a VSI MEWMA-CoDa control chart to
monitor a normal multivariate random vector defined as the inverse isometric log-ratio of a $p$-part composition. The optimal procedure to compute the optimal triple $(r^*,H^*, h_L^*)$ and the $\operatorname{ATS}$ values of the proposed
chart for different shift sizes were presented. We also proposed a method to find the near-optimal values for the VSI MEWMA-CoDa chart to utilize the results in the study of \cite{Tran-coda2017} and reduce the computation costs. The numerical performance comparison between the VSI MEWMA-CoDa chart and standard (FSI) MEWMA-CoDa control chart in terms of $\operatorname{ATS}_1$ (based on the near-optimal values method) showed that the VSI MEWMA-CoDa chart always outperforms the standard chart. Future research on monitoring CoDa could be concentrated on
the extension of the VSI MEWMA-CoDa chart to the VSI MCUSUM-CoDa chart, or investigating the effect of measurement
error on these charts. The methods to transform CoDa into normal data before designing these controls charts are also worthy to focus. Due to the wide applications of CoDa in the real-life, the online monitoring of CoDa should be worthy of consideration by researchers in the SPC field.
| {'timestamp': '2022-03-30T02:30:24', 'yymm': '2203', 'arxiv_id': '2203.15438', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15438'} | arxiv |
\section{Acknowledgement}
We would like to thank Valeo for encouraging advanced research. Many thanks to Ciar{\'a}n Eising (University of Limerick, Ireland), Tuan-Hung Vu (valeo.ai, France), Saikat Roy (DKFZ, Germany) and Aniruddha Saha (University of Maryland, Baltimore County) for providing a detailed review prior to submission.
\section{Proposed Method}
\begin{figure*}
\captionsetup{singlelinecheck=false, font=small, belowskip=-6pt}
\centering
\includegraphics[width=\textwidth]{images/unshadownet_shadow_arch.pdf}\\
\caption{ \textbf{\textit{UnShadowNet}} is the \textbf{proposed end-to-end weakly-supervised shadow removal architecture}. It has three main sub-networks: DeShadower Network ($\mathcal{D}$), Illumination Network ($\mathcal{I}$) and Refinement Network ($\mathcal{R}$). The pixelwise product operation $\bigotimes$ between shadow image ($\mathcal{S}$) and its shadow mask ($\mathcal{S}_{M}$) extracts the shadow region ($\mathcal{S}_{s}$), which is then fed to $\mathcal{D}$ and $\mathcal{I}$ simultaneously. The generator of the adversarially trained Illumination network generates illuminated version ($\mathcal{B}$) of $\mathcal{S}_{s}$ which is subjected for validation by a discriminator, called Illumination Critic ($\mathcal{I}_{c}$) trained on augmented shadow-free regions ($\mathcal{B}_{aug}$). DeShadower is trained to produce shadow-removed region ($\mathcal{S}_{r}$) of $\mathcal{S}_{s}$. To create a more realistic illumination region $\mathcal{S}_{r}$, a contrastive approach is employed between $\mathcal{B}$ and $\mathcal{S}_{r}$. Finally, shadow-removed image ($\hat{S}_r$) is obtained by applying embedding operation $\bigoplus$ to become input to the Refinement network. $\mathcal{R}$ is trained to efficiently blend the areas between shadow-removed and non-shadow region so that it is robust to noise, blur etc. Here contrastive learning approach was followed where \textit{positive} samples ($\hat{S}_{aug}$) were generated as per the method in\cite{chen2020simple}.}
\label{fig:self_sup_shadow_arch}
\end{figure*}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\definecolor{LightGreen}{rgb}{0.35,0.8,0}
\definecolor{LightGreen2}{rgb}{0.5,0.9,0}
\definecolor{Gray}{gray}{0.85}
In this work, we define the problem of shadow removal as the translation of images from the shadow domain $\mathcal{S} \subset {\mathbb{R}^{H \times W \times C}}$
to shadow-free domain $\mathcal{F} \subset {\mathbb{R}^{H \times W \times C}}$ by utilising only the shadow image and its mask and alleviating the use of its shadow-free counterpart. The proposed architecture \textit{UnShadowNet} is illustrated in Figure \ref{fig:self_sup_shadow_arch}. We briefly summarize the high level characteristics here and discuss each part in more detail in the following subsections. In this section, we present the overall architecture of our proposed end-to-end shadow removal network, namely \textit{UnShadowNet}. The architecture can be divided into $three$ parts: DeShadower Network ($\mathcal{D}$), Illumination Network ($\mathcal{I}$) and Refinement Network ($\mathcal{R}$). These three networks are jointly trained in a weakly-supervised manner. Let us consider a shadow image $S\in\mathcal{S}$ and its corresponding shadow mask $S_M$. We obtain the shadow region $S_s$ by cropping the masked area from $S_M$ in the shadow image $S$. The DeShadower Network learns to remove the shadow from the region using a contrastive learning setup. It is aided by the Illumination Network which generates bright samples for $\mathcal{D}$ to learn from. The Refinement Network finally combines the shadow-free region $S_f$ with the real image and refines it to form the shadow-free image $\hat{S}$.
\subsection{DeShadower Network ($\mathcal{D}$)}
The DeShadower Network is designed as an encoder-decoder based architecture
to generate shadow-removed region ($S_r$) from the shadow region ($S_s$). The shadow-removed regions generated by this network $S_r$ should \textit{associate} more with the bright samples and
\textit{dissociate} itself from the shadow samples. We employ a contrastive learning approach to help the DeShadower network achieve this and learn to generate shadow-free regions. In a contrastive learning framework, a \textit{``query"} maximizes the mutual information with a \textit{``positive"} sample in contrast to other samples that are referred to as \textit{``negatives"}.
In this work, we use a ``noise contrastive estimation" framework \cite{oord2018representation} to maximise mutual information between $S_f$ and the bright sample $B$. We treat the bright samples generated by the Illumination Network as the ``positive" and the shadow regions as the ``negatives" in this contrastive learning setup. Thus, the objective function for maximising (and minimising) the mutual information can be formulated with the InfoNCELoss~\cite{oord2018representation}, a criterion derived from both statistics~\cite{gutmann2010noise, oord2018representation} and metric learning~\cite{chopra2005learning, hadsell2006dimensionality, sohn2016improved}. Its formulation bears similarities with the cross-entropy loss:
\begin{multline}
\ell(x, x^+, x^-) = \\ - log \left[ \frac{exp(x\cdot x^+/ \tau)}{exp(x\cdot x^+ / \tau) + \sum_{i=1}^N exp(x\cdot x^-_i/ \tau)} \right]
\end{multline}
where $x, x^+, x^-$ are the \textit{query}, \textit{positive} and \textit{negatives} respectively.
$\tau$ is the temperature parameter that controls the sharpness of the similarity distribution. We set it to the default value from prior work~\cite{he2020momentum, wu2018unsupervised}: $\tau {=} 0.07$.
The feature stack in the encoder of the DeShadower Network, represented as $\mathcal{D}_{enc}$, already contains latent information about the input shadow region $S_s$. From $\mathcal{D}_{enc}$, $L$ layers are selected,
and following practices from prior works~\cite{chen2020simple}, we pass these features through a projection head, an MLP ($M_l$) with two hidden layers.
Subsequently, we obtain features:
\begin{equation}
s_l = M_l(\mathcal{D}^l_{enc}(S_s)); \quad l \in \{1,2,...,L\}
\end{equation}
where $\mathcal{D}^l_{enc}$ is the $l$-th chosen layer in $\mathcal{D}^l_{enc}$. Similarly the output or the `unshadowed' region $S_f$ and the bright region $B$ are encoded respectively as:
\begin{equation}
f_l = M_l(\mathcal{D}^l_{enc}(S_f)); b_l = M_l(\mathcal{D}^l_{enc}(B))
\end{equation}
We
adjust the InfoNCE loss \cite{oord2018representation} into a layer-wise NCE loss:
\begin{equation}
\mathcal{L}_{NCE}(f_l, b_l, s_l) = \mathbb{E}_{S_f \sim \mathcal{F}, S_s \sim \mathcal{S}, B \sim \mathcal{B}} \quad \ell(f_l, b_l, s_l)
\end{equation}
The generator should not change the contents of an image when there is no need to. In other words, given a shadow free sample as input, it is expected to generate the same as output without any change. To enforce such a regularization, we employ an identity loss \cite{zhu2017unpaired, taigman2016unsupervised}.
It is formulated using an $L1$ loss as:
\begin{equation}
\mathcal{L}_{iden} = \mathbb{E}_{S_f \sim \mathcal{F}} ||\mathcal{D}(S_f), S_f||_1
\end{equation}
Additionally, as described further in following sections, the Illumination Critic $\mathcal{I}_\mathcal{C}$ is trained on real non-shadow samples and augmented bright samples. Therefore, we can additionally use the cues provided by the Illumination Critic to distill its knowledge of illumination to the DeShadower Network. This is achieved by the computing the loss:
\begin{equation}
\label{eqn:critic}
\mathcal{L}_{\textit{critic}} =
\left[ 1 - \mathcal{I}_\mathcal{C}(\mathcal{D}(S_s)) \right]^2
\end{equation}
\subsection{Illumination Network ($\mathcal{I}$)}
Shadow regions have a lower level illumination compared to its surroundings and the exact illumination level can vary according to scene lighting conditions as illustrated in Fig. \ref{fig:varying_shadow}. To show that a real shadow image and an image with a region where brightness is reduced are similar even semantically, we designed a small experimental setup. We fine-tune a ResNet \cite{he2016deep} with samples containing real shadows and no shadows for a Shadow/Non-shadow classification task and then test the images where we reduce the brightness in the shadow region. In the majority of the cases, the network classifies it to be `Shadow' image.
\begin{figure}
\centering
\includegraphics[width=0.11\textwidth]{images/shadow_obs/93-4.png}
\includegraphics[width=0.11\textwidth]{images/shadow_obs/15_s_93-4.png}
\includegraphics[width=0.11\textwidth]{images/shadow_obs/15_93-4.png}
\includegraphics[width=0.11\textwidth]{images/shadow_obs/25_93-4.png}
\hspace{3cm}{Original} \hspace{1cm}{Shadow with varying illumination level}
\caption{
Illustration of different illumination control levels of shadow region.
}
\vspace{-9 mm}
\label{fig:varying_shadow}
\end{figure}
Using this heuristic, the Illumination Network ($\mathcal{I}$) is designed as a Generative Adversarial Network \cite{goodfellow2014generative} to serve as a complementary augmentation setup to generate synthetic images where the illumination level is increased in a shadow region. The shadow region $S_s$ is passed through the generator $\mathcal{I}_\mathcal{G}$ to produce brighter samples $B$ of the shadow region. The illumination critic ($\mathcal{I}_\mathcal{C}$) learns to classify these samples generated by $\mathcal{I}_\mathcal{G}$ as `fake'. The motivation of this discriminator is detailed in the following section. The generator $\mathcal{I}_\mathcal{G}$ and the discriminator $\mathcal{I}_\mathcal{C}$ thus learns from the adversarial loss as:
\begin{equation}
\label{eqn:adversarial}
\begin{aligned}
\mathcal{L}_{\textit{adv}} = {} & \mathbb{E}_{S_s \sim \mathcal{S}} \left[ (1 - \mathcal{I}_\mathcal{C}(\mathcal{I}_\mathcal{G}(S_s)))^2 \right] + \\
& \mathbb{E}_{S_s \sim \mathcal{S}} \left[ \mathcal{I}_\mathcal{C}(\mathcal{I}_\mathcal{G}(S_s))^2 \right] + \\
& \mathbb{E}_{B' \sim \mathcal{B}} \left[ (1 - \mathcal{I}_\mathcal{D}(B'))^2 \right]
\end{aligned}
\end{equation}
We observe that the more optimal samples Illumination Network generates leads to aid $\mathcal{D}$ to create more realistic shadow-removed samples. Therefore, to improve $\mathcal{I}$ to create well-illuminated samples we employ the illumination loss as an $L1$ loss between the $\mathcal{I}_\mathcal{G}$ generated bright sample $B$ and the shadow-removed sample $S_f$ as:
\begin{equation}
\mathcal{L}_{illum} = \frac{1}{N}\sum_{i=0}^{N}||S_f - B||_1
\end{equation}
The adversarial loss with the help of the discriminator and the illumination loss together play a role in generating well-illuminated samples, which in turn helps $\mathcal{D}$ to create better shadow-removed samples. In this regard, both $\mathcal{D}$ and $\mathcal{I}$ complement each other for the task. The Illumination Network supervises $\mathcal{D}$ to generate shadow-removed regions and likewise, $\mathcal{D}$ encourages $\mathcal{I}$ to create well-illuminated samples by learning from it.
The choice of using $\mathcal{I}$ is experimentally justified in the ablation study section, as it helps to generate better results rather than relying solely on a pre-determined illumination level increase.
\subsection{Illumination Critic ($\mathcal{I}_\mathcal{C}$)}
\label{critic}
The role of the the Illumination Critic ($\mathcal{I}_\mathcal{C}$) is two-fold.
Firstly, in the Illumination Network which generates well-illuminated variations of the shadow region $S_s$, the $\mathcal{I}_\mathcal{C}$ is designed as a discriminator to the $\mathcal{I}_\mathcal{G}$. The knowledge $\mathcal{I}_\mathcal{C}$ learns from representations of shadow-free regions allows it to encourage $\mathcal{I}_\mathcal{G}$ to create well-illuminated variations of the shadow region $S_s$ which is later used as \textit{positive} pair to contrastively train $\mathcal{D}$.
Additionally, the DeShadower Network utilizes the knowledge of the $\mathcal{I}_\mathcal{C}$ to create realistic shadow-removed regions from the $S_s$. Having learnt the representations of shadow-free regions and augmented samples with varying illumination, $\mathcal{I}_\mathcal{C}$ is able to influence $\mathcal{D}$ to ``remove" shadows from shadow regions using the $\mathcal{L}_{critic}$ in Eqn. \ref{eqn:critic}. This two-fold characteristic of $\mathcal{I}_\mathcal{C}$ facilitates the complimentary nature of $\mathcal{D}$ and $\mathcal{I}$ where they mutually improve each other.
To train $\mathcal{I}_\mathcal{C}$, we crop randomly masked non-shadow areas from $S$ as well as other samples in the dataset similar to \cite{liu2021shadow}. Additionally, $\mathcal{I}_\mathcal{C}$ is trained by augmented samples where each shadow region $S_s$ is converted to $3$ different samples by varying the illumination levels. The illumination levels are increased by a factor $\mu-5, \mu, \mu+5$ where $\mu$ is fixed empirically as presented in Table \ref{tab:mu_table}. It is trained using the same adversarial loss as the Illumination Network.
\vspace{-3mm}
\subsection{Refinement Network ($\mathcal{R}$)}
After obtaining the shadow-removed region $S_r$, it is embedded with the original shadow image $S$.
The embedding operation can be defined as:
\begin{equation}
\hat{S}_r = S - S * S_M + S_r * S_M
\end{equation}
Following the embedding operation, there remains additional artifacts around the inpainted area due to improper blending. The Refinement Network $\mathcal{R}$ is designed to get rid of such artifacts by making use of the global context in the image. The absence of explicit ground truths in this setting motivated us to design a contrastive setup to train $\mathcal{R}$.
To generate the \textit{positive} samples, we follow \cite{chen2020simple} to augment the generated shadow-removed image ($\hat{S}_r$) by using random cropping of non-shadow regions. It is followed by additional transformations like resizing the cropped region back to the original size, random cutout, Gaussian blur and Gaussian noise, represented as $\hat{S}_{aug}$. The objective is to maximise the information between the \textit{query} image and the \textit{positive} image pairs and reduce the same with the \textit{negative} ones. In this phase, we reuse the existing encoder of $\mathcal{R}$ represented as $\mathcal{R}_{enc}$ as a feature extractor. We extract the layer-wise features of the \textit{query} ${F}_{l}$, \textit{positive} $F^+_l$ and \textit{negative} $F^-_l$ images and pass them through an MLP with two-hidden layers, similar to $\mathcal{D}$. Thus, we obtain the feature representations of ${F}_{l}$, $F^+_l$ and $F^-_l$ respectively as follows:
\begin{equation}
\begin{split}
{F}_{l} = \hat{M}_l(\mathcal{R}^l_{enc}(\hat{S}));
F^+_l = \hat{M}_l(\mathcal{R}^l_{enc}(\hat{S}_{aug})); \\
F^-_l = \hat{M}_l(\mathcal{R}^l_{enc}(S))
\end{split}
\end{equation}
Therefore the objective function for the contrastive learning setup can be represented as:
\begin{equation}
\mathcal{L}_{NCE}(F_l, F^+_l, F^-_l) = \mathbb{E}_{\hat{S} \sim \mathcal{F}, S \sim \mathcal{S}} \quad \ell(F_l, F^+_l, F^-_l)
\end{equation}
Additionally we find that following \cite{xu2021learning, johnson2016perceptual}, using a ``layer-selective" perceptual loss along with the contrastive loss helps to preserve the integrity of the overall spatial details present in the input and output images. It is computed based on the features extracted by {\fontfamily{qcr}\selectfont
relu\_5\_1
}and
{\fontfamily{qcr}\selectfont
relu\_5\_3
}of a
VGG-16 \cite{simonyan2014very} feature extractor as:
\begin{equation}
\mathcal{L}_{ref} = \frac{1}{2}\sum_{i=0}^{2}||VGG_i(\hat{S}) - VGG_i(S)||^2_2
\end{equation}
\subsection{Supervised setup}
Paired data is difficult to obtain for large scale real-world datasets, however it can be collected for a controlled smaller dataset. Here we demonstrate that \textit{UnShadowNet} can easily extend to exploit when paired shadow-free ground-truths ($G$) are available. Since the optimal level of illumination in the regions are available from $G$ itself, we remove $\mathcal{I}$ in the fully-supervised setup and use different augmented versions of the $G$ directly. Additionally, we make use of different losses that help to generate more realistic shadow-free images. To avoid loss of details in terms of content \cite{ledig2017photo}, we employ the pixel-wise \textit{L1}-norm:
\begin{equation}
\mathcal{L}_{p} = \frac{1}{N} \sum_{i=0}^{N} ||\hat{S}_i - G_i||
\end{equation}
\begin{table*}[!h]
\centering
\scalebox{1}{
\begin{tabular}{l|c|c|c|c|c|c|c|c|c}
\bottomrule
& \multicolumn{3}{c|} {\textbf{Shadow Region}} & \multicolumn{3}{c|}{\textbf{Non-Shadow Region}} & \multicolumn{3}{c}{\textbf{All}}\\
\cline{1-10}
\cellcolor{blue!25} $\textbf{Methods}$ & \cellcolor{red!25}$\textbf{RMSE}$$\downarrow$ & \cellcolor{red!25}$\textbf{PSNR}$$\uparrow$ & \cellcolor{red!25}$\textbf{SSIM}$$\uparrow$ & \cellcolor{red!25}$\textbf{RMSE}$$\downarrow$ & \cellcolor{red!25}$\textbf{PSNR}$$\uparrow$ & \cellcolor{red!25}$\textbf{SSIM}$$\uparrow$ & \cellcolor{red!25}$\textbf{RMSE}$$\downarrow$ & \cellcolor{red!25}$\textbf{PSNR}$$\uparrow$ & \cellcolor{red!25}$\textbf{SSIM}$$\uparrow$ \\
\cline{1-10}
\midrule
\rowcolor{LightCyan}
\multicolumn{10}{c}{\textbf{Weakly-Supervised Framework}}
\\
\midrule
D-Net & 11.8 & 32.46 & 0.978 & 4.6 & 34.85 & 0.972 & 6.1 & 30.26 & 0.947\\
D+I-Net & 9.2 & 33.68 & 0.981 & 3.2 & 35.03 & 0.974 & 4.7 & 30.28 & 0.949 \\
D+R-Net & 9.9 & 33.43 & 0.980 & 3.4 & 35.47 & 0.974 & 5.0 & 30.17 & 0.950 \\
D+I+R-Net & 8.9 & 34.01 & 0.982 & 2.9 & 35.48 & 0.976 & 4.4 & 30.41 & 0.951 \\
\textbf{UnShadowNet} & \textbf{8.3} & \textbf{34.47} & \textbf{0.983} & \textbf{2.9} & \textbf{35.51} & \textbf{0.977} & \textbf{3.8} & \textbf{30.63} & \textbf{0.951} \\
\midrule
\midrule
\rowcolor{LightCyan}
\multicolumn{10}{c}{\textbf{Fully-Supervised Framework}}
\\
\midrule
D-Net & 7.7 & 35.57 & 0.984 & 4.6 & 35.24 & 0.972 & 5.2 & 31.24 & 0.952\\
D+R-Net & 6.3 & 36.13 & 0.989 & 2.8 & 36.03 & 0.978 & 3.8 & 31.76 & 0.958 \\
\textbf{UnShadowNet \textit{Sup.}} & \textbf{5.9} & \textbf{36.19} & \textbf{0.989} & \textbf{2.7} & \textbf{36.44} & \textbf{0.978} & \textbf{3.3} & \textbf{31.98} & \textbf{0.959} \\
\cline{1-10}
\toprule
\end{tabular}
}
\caption{\textbf{Ablation study of the various components of UnShadowNet} in both weakly-supervised and fully-supervised setup on ISTD \cite{wang2018stacked} dataset using RMSE, PSNR and SSIM metrics.}
\label{tab:shadow_network_ablation}
\vspace{-5mm}
\end{table*}
Colour plays an important role in preserving the realism of the generated image and maintaining the consistency with the real image. To this end, we follow a recent study in the literature \cite{wang2019underexposed} to formulate the colour loss as:
\begin{equation}
\mathcal{L}_{c} = \frac{1}{N} \sum_{i=0}^{N}\sum_{j=0}^{P} \angle (\hat{S}_i, G_i)
\end{equation}
where $\angle(,)$ computes an angle between two colors regarding the RGB color as a $3$D vector \cite{wang2019underexposed}, and $P$ represents the number of pixel-pairs.
In addition, style plays an important role in an image that corresponds to the texture information \cite{gatys2015texture}. We follow \cite{gatys2016image} to define a Gram matrix as the inner product between
the vectorised feature maps $i$ and $j$ in layer $l$:
\begin{equation}
\gamma_{i,j}^l = \sum_k V_{i,k}^l \cdot V_{j,k}^l
\end{equation}
The Gram matrix is the style for the feature set extracted by the $l$-th layer of VGG-$16$ net for an input image. Subsequently, the style loss can be defined as:
\begin{equation}
\mathcal{L}_{s} = \frac{1}{N_l} \sum_{i = 0}^{N_l} ||\hat{S}_i - \gamma_i||^2
\end{equation}
where $S_i$ and $\gamma_i$ are the gram matrices for the generated shadow-free image and ground truth image respectively using VGG-$16$.
Therefore, the complete supervised loss can be formulated as a weighted sum ($\mathcal{L}_{sup}$) of the pixel ($\mathcal{L}_{p}$), colour ($\mathcal{L}_{c}$) and style ($\mathcal{L}_{s}$) losses:
\begin{equation}
\mathcal{L}_{sup} = \lambda_1 \cdot \mathcal{L}_{p} + \lambda_2 \cdot \mathcal{L}_{c} + \lambda_3 \cdot \mathcal{L}_{s}
\end{equation}
where $\lambda_1,\lambda_2$ and $\lambda_3$ are the weights corresponding to the pixel, colour and style losses respectively and are set empirically to $1.0$, $1.0$ and $1.0 \times 10^{4}$ following \cite{li2018single}, \cite{wang2019underexposed} and \cite{gatys2016image} respectively in our experiments.
\section{Conclusion} \label{sec:conc}
In this work, we have developed a novel end-to-end framework consisting of a deep learning architecture for image shadow removal in unconstrained settings. The proposed model can be trained with full or weak supervision. We achieve state-of-the-art results in all the major shadow removal datasets. Although weak supervision has slightly lesser performance, it eliminates the need for shadowless ground truth which is difficult to obtain. To enable the weakly supervised training, we have introduced a novel illumination network which comprises of a generative model used to brighten the shadow region and a discriminator trained using shadow-free patches of the image. It acts as a guide (called illumination critic) for producing illuminated samples by the generator. DeShadower, another component of the proposed framework is trained in a contrastive way with the help of illuminated samples which are generated by the preceding part of the network. Finally, we propose a refinement network which is trained in a contrastive way and it is used for fine tuning of the shadow removed image obtained as an output of the DeShadower. We perform ablation studies to show that the three components of our proposed framework, namely illuminator, Deshadower and refinement network work effectively together. To evaluate the generalization capacity of the proposed approach, we tested a few novel samples of shadow affected images from a generic automotive dataset and obtained promising results of shadow removal. Shadow removal continues to be a challenging problem in dynamic automotive scenes and we hope this work encourages further dataset creation and research in this area
\section{Introduction}
Shadows are a common phenomenon that exist in most natural scenes. It occurs due to the inadequate illumination that makes part of the image darker than the other region of the same image. It causes a significant negative impact to performance of various computer vision tasks as object detection, semantic segmentation and object tracking. Image editing \cite{chuang2003shadow} using shadow matting is one of the common ways to remove shadows. Shadow detection and correction can improve the efficiency of the machine learning model for a broad spectrum of vision based problems such as image restoration \cite{drew2003recovery}, satellite image analysis \cite{dare2005shadow}, information recovery in urban high-resolution panchromatic
satellite images \cite{su2016shadow}, face recognition \cite{zhang2018improving}, and object detection \cite{le2018a+}.
Shadows are prevalent in almost all images in automotive scenes. The complex interaction of shadow segments with the objects of interest such as pedestrians, roads, lanes, vehicles and riders makes the scene understanding challenging. Additionally, it does not have any distinct geometrical shape or size similar to soiling \cite{das2019soildnet, das2020tiledsoilingnet}. Thus, they commonly lead to poor performance in road segmentation \cite{dahal2021roadedgenet, chennupati2019auxnet} and pedestrian segmentation \cite{rashedfisheyeyolo, segdasvisapp19}. Moving shadows can be incorrectly detected as a dynamic object in background subtraction \cite{kiran2019rejection}, motion segmentation \cite{siam2018modnet}, depth estimation \cite{kumar2021syndistnet, ravi2021fisheyedistancenet++} and SLAM algorithms \cite{gallagher2021hybrid, dahal2021online}. The difficulty of shadows is further exacerbated in strong sun glare scenes where the dynamic range is very high across shadow and glare regions \cite{yahiaoui2020let}.
These issues lead to incomplete or partial understanding of $360\degree$ surrounding region of the vehicle and bring major safety concerns for the passengers and Vulnerable Road Users (VRU) while performing automated driving \cite{eising2021near}. Alternate sensor technologies like thermal camera \cite{dasgupta2022spatio} are resistant to shadow issues and can be used to augment cameras.
\begin{figure}
\centering
\includegraphics[width=0.488\textwidth]{images/shadow_abstract.pdf}\\
\caption{ \textbf{The proposed shadow removal framework.} The shadow image and its shadow mask are subjected to pixelwise product operation $\bigotimes$ to obtain the shadow extracted which is fed as input to the DeShadower ($\mathcal{D}$) and Illumination network ($\mathcal{I}$) simultaneously. $\mathcal{D}$ learns contrastively from $\mathcal{I}$ and the resultant shadow-removed region is embedded via $\bigoplus$ in the input image before feeding it to the Refinement network which produces the final Shadow-free image. The end-to-end network is trained in a weakly supervised manner.
}
\vspace{-5mm}
\label{fig:high_level_shadow}
\end{figure}
In recent times, convolutional neural networks (CNNs) based approaches have significantly surpassed classical computer vision based shadow removal techniques \cite{finlayson2005removal, guo2012paired, khan2015automatic, zhang2015shadow, wang2018stacked, le2019shadow}. Majority of the recent deep-learning based shadow removal approaches are fully-supervised in nature. However, such an end-to-end training setup requires \textit{paired data}, namely shadow images and their shadow-free versions of the same images. These paired data are used to train CNNs \cite{qu2017deshadownet, ding2019argan, hu2019direction}. Practically, the paired data is difficult to obtain particularly when the vehicle is moving fast. Some of the challenges include highly controlled lighting sources, object interactions, occlusions and static scene. Data acquisition through such controlled setting suffers from diversity and often reports color inconsistencies \cite{wang2018stacked} between shadow and shadow-free reference of the same image. Additionally, it is very difficult to capture any High Dynamic Range (HDR) natural scene without any presence of shadow for a shadow-free reference sample.
Some of the recent studies \cite{hu2019mask, le2020shadow, chen2021canet, liu2021shadow_lg, cun2020towards, liu2021shadow, fu2021auto, le2021physics} address the above mentioned challenges and solve the shadow removal problem using \textit{unpaired} data. They studied the physical properties of shadows such as illumination, color and texture extensively. Motivated by these recent works, we propose an end-to-end trained weakly-supervised architecture for shadow removal as illustrated in Figure \ref{fig:high_level_shadow}.
In brief, we pass the shadow region of an input image to the DeShadower network that is aided by the Illumination network to contrastively learn to ``remove" shadow from the region by exploiting the illumination properties. It is followed by the Refinement network that helps to remove any artifacts and maintain the overall spatial consistency with the input image and finally generate the shadow-free image. We summarize our contributions below:
\iffalse
\begin{figure}
\includegraphics[width=0.20\textwidth]{images/real_shadow.png}
\label{fig:exp1}
\hspace{5mm}
\includegraphics[width=0.20\textwidth]{images/reduce_bright.png}
\label{fig:exp2}
\vspace{-0.4em}
\caption{Observation - Shadow images are similar to images with region where brightness is reduced.}
\label{fig:red_bright_shadow}
\end{figure}
\fi
\begin{enumerate}
\item We develop a novel weakly-supervised training scheme namely \textit{UnShadowNet} using contrastive learning to build a shadow remover in unconstrained settings where the network can be trained even without any shadow-free samples.
\item We propose a contrastive loss guided DeShadower network to remove the shadow effects and a refinement network for efficient blending of the artifacts from shadow removed area.
\item We achieved state-of-the-art results on three public datasets namely ISTD, adjusted ISTD and SRD in both constrained and unconstrained setup.
\item We perform extensive ablation studies with different proposed network components, diverse augmentation techniques, shadow inpainting and tuning of several hyper-parameters.
\end{enumerate}
\section{Related Work}
Removing shadow from images has received a significant thrust due to the availability of large-scale datasets. In this section, first we briefly discuss the classical computer vision methods reported in the literature. Then we discuss the more recent deep learning based approaches. Finally, we summarize the details of contrastive learning and its applications since it is a key component in our framework.
\subsection{Classical approaches}
\textbf{Illumination based shadow removal: }
Initial work \cite{finlayson20014, finlayson2005removal, finlayson2002removing, drew2003recovery} on removing shadows were primarily motivated by the illumination and color properties of shadow region. In one of the earliest research, Barrow \textit{et al.} \cite{barrow1978recovering} proposed an image based algorithm that decomposes the image into a few predefined intrinsic parts based on shape, texture, illumination and shading. Later Guo \textit{et al.} \cite{guo2012paired} reported the simplified version of the same intrinsic parts by establishing a relation between the shadow pixels and the shadow-free region using a linear system. Likewise, Shor \textit{et al.} \cite{shor2008shadow} designed a model based on illumination properties of shadows that makes hard association between shadow and shadow-free pixels. In another study, Finlayson \textit{et al.} \cite{finlayson2009entropy} proposed a model that generates illumination invariant image for shadow detection followed by removal. The main idea of this work is that the pixels with similar chromaticity tend to have similar albedo. Further, histogram equalization based models performed quite well for shadow removal, where color of the shadow-free area was transferred to the shadowed area as reported by Vicente \textit{et al.} \cite{vicente2014single, vicente2017leave}.
\textbf{Shadow matting: }
Porter \& Duff \cite{porter1984compositing} introduced matting based technique that became effective while handling shadows that are less distinct and fuzzy around the edges. Matting was only helpful to some extent as computing shadow matte from a single image is difficult. To overcome this problem, Chuang \textit{et al.} \cite{chuang2003shadow} applied matting for shadow editing and then transferred the shadow regions to the different scenes. Later shadow matte was computed from a sequence of video frames captured using a static camera. Shadow matte was adopted by Guo \textit{et al.} \cite{guo2012paired} and Zhang \textit{et al.} \cite{zhang2015shadow} in their framework for shadow removal.
\subsection{Deep learning based approaches}
\textbf{Shadow removal using paired data: }
Deep neural networks have been able to learn the properties of a shadow region efficiently when the network is trained in a fully supervised manner. Such setup requires paired data that means the shadow and shadow-free version of the same image are fed as input to the network. Qu \textit{et al.} \cite{qu2017deshadownet} proposed an end-to-end learning framework called Deshadownet for removing shadow where they extract multi-scale contextual information from different layers. This information containing density and color offset of the shadows finally helped to predict the shadow matte. The method ST-CGAN, a two-stage approach was proposed by Wang \textit{et al.} \cite{wang2018stacked}, presents an end-to-end network that jointly learns to detect and remove shadow. This framework was designed based on conditional GAN \cite{isola2017image}. In SP+M-Net \cite{le2019shadow}, physics based priors were used as inductive bias. The networks were trained to obtain the shadow parameters and matte information to remove shadows. However, these parameters and matte details were pre-computed using the paired samples and the same were regressed in the network. Further Hu \textit{et al.} \cite{hu2019direction} designed a shadow detection and removal technique by analyzing the contextual information in image space in a direction aware manner. These features were then aggregated and fed into an RNN model. In ARGAN \cite{ding2019argan}, an attentive recurrent generative adversarial network was reported. The generator contained multiple steps where shadow regions were progressively detected. A negative residual based encoder was employed to recover the shadow-free area and then a discriminator was setup to classify the final output as real or fake. In another recent framework RIS-GAN \cite{zhang2020ris}, using adversarial learning shadow removal was performed using three distinct discriminators negative residual images. Subsequently shadow removed images and the inverse illumination maps were jointly validated.
\textbf{Shadow removal using unpaired data: }
Mask-ShadowGAN \cite{hu2019mask} is the first deep learning based method that learn to remove shadow from unpaired training samples. Their approach was conceptualized on CycleGAN \cite{zhu2017unpaired} where a mapping was learnt from a source (shadow area) to target (shadow-free area) domain. Le and Samaras \cite{le2020shadow} presented a learning strategy that crops the shadow area from an input image to learn the physical properties of shadow in an unpaired setting. CANet \cite{chen2021canet} handles the shadow removal problem in two stages. First, contextual information were extracted from non-shadow area and then transferred the same to shadow region in the feature space. Finally, an encoder-decoder setup was used to fine tune the final results. LG-ShadowNet \cite{liu2021shadow_lg} explored the lightness and color properties of shadow images and put them through multiplicative connections in a deep neural network using unpaired data. Cun \textit{et al.} \cite{cun2020towards} handled the issues of color inconsistency and artifacts at the boundaries of the shadow removed area using Dual Hierarchically Aggregation Network (DHAN) and Shadow Matting Generative Adversarial Network (SMGAN). Weakly-supervised method G2R-ShadowNet \cite{liu2021shadow} designed three sub-networks dedicated for shadow generation, shadow removal and image refinement. Fu \textit{et al.} \cite{fu2021auto} modelled the shadow removal problem from a different perspective that is auto-exposure fusion. They proposed shadow-aware FusionNet and boundary-aware RefineNet to obtain final shadow removed image. Further in \cite{le2021physics} a weakly-supervised approach was proposed that can be trained even without any shadow-free samples.
\textbf{Miscellaneous: }
Apart from shadow removal, shadow detection is also a well-studied area, some of the recent works include
\cite{le2018a+, wang2020instance, chen2020multi}. Inoue \textit{et al.}
\cite{inoue2020learning} highlighted the problem of preparing a large scale shadow dataset. They proposed a pipeline to synthetically generate shadow/shadow-free/matte
image triplets.
\subsection{Contrastive learning}
Learning the underlying representations by contrasting the positive and the negative pairs have been studied earlier in the community \cite{chopra2005learning, hadsell2006dimensionality}. This line of thought has inspired several works that attempt to learn visual representations without human supervision. While one family of works uses the concept of memory bank to store the class representations \cite{wu2018unsupervised, he2020momentum, laskin2020curl}, another set of works develop on the idea of maximization of mutual information \cite{oord2018representation, bachman2019learning, chen2020simple}. Recently, Park \textit{et al.} \cite{park2020contrastive} presented an approach for unsupervised image-to-image translation by maximizing the mutual information between the two domains using contrastive learning. In our work, we adopt the problem of shadow removal to solve it without using shadow-free ground truth samples with the help of contrastive learning.
\section{Experimentation Details} \label{sec:performance}
\definecolor{LightCyan}{rgb}{0.88,1,1}
\definecolor{LightGreen}{rgb}{0.35,0.8,0}
\definecolor{LightGreen2}{rgb}{0.5,0.9,0}
\definecolor{Gray}{gray}{0.85}
\begin{table*}[!h]
\centering
\scalebox{1}{
\begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|c}
\bottomrule
& & & \multicolumn{3}{c|} {\textbf{Shadow Region}} & \multicolumn{3}{c|}{\textbf{Non-Shadow Region}} & \multicolumn{3}{c}{\textbf{All}}\\
\multirow{2}{*}{\cellcolor{blue!25}} & \multirow{2}{*}{\cellcolor{blue!25}} & \multirow{2}{*}{\cellcolor{blue!25}} & \multirow{2}{*}{\cellcolor{red!25}} & \multirow{2}{*}{\cellcolor{red!25}} & \multirow{2}{*}{\cellcolor{red!25}} & \multirow{2}{*}{\cellcolor{red!25}} & \multirow{2}{*}{\cellcolor{red!25}} & \multirow{2}{*}{\cellcolor{red!25}} & \multirow{2}{*}{\cellcolor{red!25}} & \multirow{2}{*}{\cellcolor{red!25}} & \multirow{2}{*}{\cellcolor{red!25}}\\
\cline{2-3}
\multirow{-2}{*}{\cellcolor{blue!25}$\textbf{\makecell{Curriculum\\Learning}}$}&
\multirow{-2}{*}{\cellcolor{blue!25}$\textbf{\makecell{Shadow\\Inpainting}}$} & \multirow{-2}{*}{\cellcolor{blue!25}$\textbf{\makecell{Data\\Augmentation}}$} & \multirow{-2}{*}{\cellcolor{red!25}$\textbf{RMSE}$$\downarrow$} & \multirow{-2}{*}{\cellcolor{red!25}$\textbf{PSNR}$$\uparrow$} & \multirow{-2}{*}{\cellcolor{red!25}$\textbf{SSIM}$$\uparrow$} & \multirow{-2}{*}{\cellcolor{red!25}$\textbf{RMSE}$$\downarrow$} & \multirow{-2}{*}{\cellcolor{red!25}$\textbf{PSNR}$$\uparrow$} & \multirow{-2}{*}{\cellcolor{red!25}$\textbf{SSIM}$$\uparrow$} & \multirow{-2}{*}{\cellcolor{red!25}$\textbf{RMSE}$$\downarrow$} & \multirow{-2}{*}{\cellcolor{red!25}$\textbf{PSNR}$$\uparrow$} & \multirow{-2}{*}{\cellcolor{red!25}$\textbf{SSIM}$$\uparrow$} \\
\midrule
\rowcolor{LightCyan}
\multicolumn{12}{c}{\textbf{Weakly-Supervised Framework}}
\\
\midrule
\color{green}\Checkmark & \color{red}\ding{55} & \color{red}\ding{55} & 9.08 & 33.88 & 0.983 & 3.65 & 35.34 & 0.977 & 3.99 & 30.08 & 0.949\\
\color{green}\Checkmark & \color{green}\Checkmark & \color{red}\ding{55} & 8.65 & 34.12 & 0.984 & 3.11 & 35.47 & 0.977 & 3.87 & 30.41 & 0.951\\
\color{green}\Checkmark & \color{red}\ding{55} & \color{green}\Checkmark & 9.01 & 33.91 & 0.983 & 3.54 & 35.36 & 0.977 & 3.96 & 30.15 & 0.950\\
\color{red}\ding{55} & \color{green}\Checkmark & \color{red}\ding{55} & 8.97 & 34.01 & 0.983 & 3.42 & 35.40 & 0.977 & 3.96 & 30.23 & 0.950\\
\color{red}\ding{55} & \color{red}\ding{55} & \color{green}\Checkmark & 9.23 & 33.59 & 0.981 & 3.74 & 35.22 & 0.976 & 4.08 & 29.88 & 0.947\\
\color{red}\ding{55} & \color{green}\Checkmark & \color{green}\Checkmark & 8.89 & 34.03 & 0.983 & 3.38 & 35.43 & 0.977 & 3.94 & 30.32 & 0.950\\
\color{green}\Checkmark & \color{green}\Checkmark & \color{green}\Checkmark & \textbf{8.31} & \textbf{34.47} & \textbf{0.984} & \textbf{2.92} & \textbf{35.51} & \textbf{0.977} & \textbf{3.80} & \textbf{30.63} & \textbf{0.951}\\
\midrule
\midrule
\rowcolor{LightCyan}
\multicolumn{12}{c}{\textbf{Fully-Supervised Framework}}
\\
\midrule
\color{green}\Checkmark & \color{red}\ding{55} & \color{red}\ding{55} & 6.90 & 35.75 & 0.986 & 3.03 & 36.20 & 0.977 & 3.76 & 31.08 & 0.958\\
\color{green}\Checkmark & \color{green}\Checkmark & \color{red}\ding{55} & 6.23 & 36.12 & 0.989 & 2.82 & 36.38 & 0.978 & 3.58 & 31.17 & 0.959\\
\color{green}\Checkmark & \color{red}\ding{55} & \color{green}\Checkmark & 6.86 & 35.92 & 0.986 & 2.99 & 36.12 & 0.977 & 3.74 & 31.01 & 0.958\\
\color{red}\ding{55} & \color{green}\Checkmark & \color{red}\ding{55} & 6.81 & 36.07 & 0.987 & 3.01 & 36.21 & 0.977 & 3.67 & 31.27 & 0.959\\
\color{red}\ding{55} & \color{red}\ding{55} & \color{green}\Checkmark & 7.13 & 34.82 & 0.982 & 3.28 & 36.02 & 0.976 & 3.93 & 31.46 & 0.956\\
\color{red}\ding{55} & \color{green}\Checkmark & \color{green}\Checkmark & 6.47 & 36.09 & 0.987 & 2.96 & 36.26 & 0.978 & 3.63 & 31.85 & 0.959\\
\color{green}\Checkmark & \color{green}\Checkmark & \color{green}\Checkmark & \textbf{5.92} & \textbf{36.20} & \textbf{0.989} & \textbf{2.71} & \textbf{36.44} & \textbf{0.978} & \textbf{3.33} & \textbf{31.98} & \textbf{0.959}\\
\bottomrule
\end{tabular}
}
\caption{\textbf{Ablation study of UnShadowNet using different training strategies on adjusted ISTD dataset.}
}
\label{tab:ablation_data_aug}
\vspace{-7mm}
\end{table*}
\subsection{Dataset and evaluation metrics}
\textbf{Datasets:} In this work, we train and evaluate our proposed method on three publicly available datasets discussed below.
\textbf{ISTD:} ISTD \cite{wang2018stacked} contains image triplets: shadow image, shadow-mask and shadow-free image captured at different lightning condition that makes the dataset significantly diverse. A total of $1,870$ image triplets were generated from $135$ scenes for the training set, whereas testing set contains $540$ triplets obtained from $45$ scenes.
\textbf{ISTD+:} The samples of ISTD \cite{wang2018stacked} dataset were found to have color inconsistency issue between the shadow and shadow-free images as mentioned in the original work \cite{wang2018stacked}. The reason being, shadow and shadow-free image pairs were collected at different times of the day that led to the effect of different lightning appearance in the images. This color irregularity issue was fixed by Le \textit{et al.} \cite{le2019shadow} and an adjusted ISTD (ISTD+) dataset was published.
\textbf{SRD:} There are total $408$ pairs of shadow and shadow-free images in SRD \cite{qu2017deshadownet} dataset without the shadow-mask. For the training and evaluation of our both constrained and unconstrained setup, we use the shadow masks publicly provided by Cun \textit{et al.} \cite{cun2020towards}.\\
\textbf{Evaluation metrics:} For all the experiments conducted in this work, we use Root Mean-Square Error (RMSE), Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity (SSIM) respectively as metrics to evaluate and compare the proposed approach with other state-of-the-art methods. Following the prior-art \cite{guo2012paired, qu2017deshadownet, wang2018stacked, le2019shadow, hu2019mask, le2020shadow, liu2021shadow_lg}, we compute the RMSE on the recovered shadow-free area, non-shadow area and the entire image in LAB color space.
In addition to RMSE, we also compute PSNR and SSIM scores in RGB color-space. RMSE is interpreted as better when it is lower, while PSNR and SSIM are better when they are higher.
\begin{figure*}[]
\centering
\includegraphics[width=0.18\textwidth]{images/ablation/104-3.png}
\includegraphics[width=0.18\textwidth]{images/ablation/abl_2_104-3.jpg}
\includegraphics[width=0.18\textwidth]{images/ablation/abl_104-3.jpg}
\includegraphics[width=0.18\textwidth]{images/ablation/n_bright_104-3.jpg}
\includegraphics[width=0.18\textwidth]{images/ablation/104-3_gt.png} \\
\vspace{0.4 mm}
\includegraphics[width=0.18\textwidth]{images/ablation/103-1.png}
\includegraphics[width=0.18\textwidth]{images/ablation/bright_abl_103-1.jpg}
\includegraphics[width=0.18\textwidth]{images/ablation/bright_abl_2_103-1.jpg}
\includegraphics[width=0.18\textwidth]{images/ablation/bright_abl_3_103-1.jpg}
\includegraphics[width=0.18\textwidth]{images/ablation/103-1-gt.png} \\
\hspace{0.3cm}{Input} \hspace{2.5cm}{D-Net} \hspace{2.8cm}{D+I-Net} \hspace{1.7cm}{UnShadowNet} \hspace{2cm}{GT}
\vspace{0.25 mm}
\caption{
\textbf{Qualitative results of progressive addition of various components in UnShadowNet.} DeShadower network (D-Net) alone is capable to remove shadow but it fails to match up the illumination level of the shadow-removed area with shadow-free region. The DeShadower network accurately handles the illumination level when it is trained contrastively with the Illumination network (D+I Net). There remains some visible artifacts due to improper blending that is taken care by the Refinement network.
}
\label{fig:shadow_removal_ablation}
\vspace{-7mm}
\end{figure*}
\subsection{Implementation Details}
The configuration of the generator is adopted from the DenseUNet architecture \cite{li2018single}. Unlike the conventional UNet architecture \cite{ronneberger2015u}, it uses skip connections to facilitate better information sharing among the symmetric layers. For the discriminator, we employ the architecture of the PatchGAN \cite{isola2017image} discriminator that penalizes generated image structure at the scale of patches instead of at the image level. We develop and train all our models using PyTorch framework. The proposals are trained using Momentum Optimizer with $1\times10^{-4}$ as base learning rate for the first $75$ epochs, then we apply linear decay for the rest epochs and train the whole model for total $200$ epochs. Momentum was set to $0.9$. All the models were trained on a system comprising one NVIDIA GeForce GTX $2080$Ti GPU and the batch size was set to $1$ for all experiments. In the testing phase, shadow removed outputs are re-sized to $256\times256$ to compare with the ground truth images, as followed in \cite{le2020shadow, le2021physics}.
We used the shadow detector by Ding \textit{et al.} \cite{ding2019argan} to extract the shadow-masks during the testing phase.
\subsection{Ablation study}
We considered adjusted ISTD \cite{wang2018stacked} dataset to perform our ablation studies due to its large volume and common usage in most of the recent shadow removal literature. We design an extensive range of experiments on this dataset in both \textit{weakly-supervised} and \textit{fully-supervised} settings to evaluate the efficacy of the proposed several network components of \textit{UnShadowNet} and find out the best configuration of our model.
\textbf{Network components:}
DeShadower network ($\mathcal{D}$) is the basic unit that acts as the overall shadow remover in the proposal. In the weakly-supervised setup, first, we experiment with only $\mathcal{D}$ for shadow removal (D-Net). We then add Illumination network ($\mathcal{I}$) to include diverse illumination level on the non-shadow regions in the image. We couple $\mathcal{I}$ with $\mathcal{D}$ in contrastive learning setup (D+I-Net). After shadow removal, the shadow-free region needs refinement for efficient blending with the non-shadow area. Hence we add a Refinement network ($\mathcal{R}$) with $\mathcal{D}$ where L1 loss guides to preserve the structural details (D+R-Net). Next we consider illumination guided contrastive learned refinement (D+R-Net) network where we add $\mathcal{I}$ and that becomes D+I+R-Net. Further improvement is achieved when we add contrastive loss in $\mathcal{R}$ which completes the UnShadowNet framework. In the fully-supervised setup, as described earlier, $\mathcal{I}$ is not used. As a result, we present the study of D-Net, D+R-Net and UnShadowNet respectively.
Table \ref{tab:shadow_network_ablation} summarizes the ablation study of various proposed network components. Improvement on accuracy is observed due to the addition of $\mathcal{I}$ in contrastive learning setup. $\mathcal{R}$ adds further significant benefit when L1 loss is replaced with contrastive loss. The improvements of the proposed components are consistent in both self-supervised and fully-supervised learning as reported in the same table. All further experiments are performed based on the configuration marked as UnShadowNet.
\textbf{Curriculum learning:}
Curriculum Learning \cite{bengio2009curriculum} is a type of a learning strategy that allows to feed easy examples to the neural network first and then gradually increases the complexity of the data. This helps to achieve stable convergence of the global optimum. As per Table \ref{tab:ablation_data_aug}, it is observed that curriculum learning technique provides considerable improvement while applying along with shadow inpainting and data augmentation.
\begin{figure}
\centering
\includegraphics[width=0.15\textwidth]{images/augmented/12-8.png}
\includegraphics[width=0.15\textwidth]{images/augmented/12-8_aug.png}
\includegraphics[width=0.15\textwidth]{images/augmented/12-8_aug_2.png}
\vspace{0.25 mm}
\includegraphics[width=0.15\textwidth]{images/augmented/24-7.png}
\includegraphics[width=0.15\textwidth]{images/augmented/24-7_aug.png}
\includegraphics[width=0.15\textwidth]{images/augmented/24-7_aug_2.png}
\hspace{-1.5cm}{Input} \hspace{1.8cm}{Inpainted Shadow Images}
\caption{
\textbf{Augmented samples with inpainted shadow regions. }
}
\label{fig:shadow_inpainting}
\vspace{-10mm}
\end{figure}
\begin{table}[t]
\centering
\scalebox{0.95}{
\begin{tabular}{l|c|c|c|c|c|c}
\bottomrule
& \multicolumn{3}{c|} {\textbf{Shadow Region}} & \multicolumn{3}{c}{\textbf{All}}\\
\cline{1-7}
\cellcolor{blue!25} $\bm{\mu}$ & \cellcolor{red!25}$\textbf{RMSE}$$\downarrow$ & \cellcolor{red!25}$\textbf{PSNR}$$\uparrow$ & \cellcolor{red!25}$\textbf{SSIM}$$\uparrow$ & \cellcolor{red!25}$\textbf{RMSE}$$\downarrow$ & \cellcolor{red!25}$\textbf{PSNR}$$\uparrow$ & \cellcolor{red!25}$\textbf{SSIM}$$\uparrow$ \\
\cline{1-7}
\midrule
\rowcolor{LightCyan}
\multicolumn{7}{c}{\textbf{Weakly-Supervised Framework}}
\\
\midrule
5 & 24.2 & 27.57 & 0.959 & 19.1 & 24.76 & 0.936\\
25 & 17.1 & 30.13 & 0.974 & 12.4 & 27.30 & 0.942 \\
50 & 10.3 & 33.71 & 0.982 & 6.2 & 30.01 & 0.951\\
\textbf{75} & \textbf{8.3} & \textbf{34.47} & \textbf{0.983} & \textbf{3.8} & \textbf{30.63} & \textbf{0.951} \\
100 & 9.8 & 31.56 & 0.980 & 5.6 & 28.52 & 0.946 \\
\midrule
\midrule
\rowcolor{LightCyan}
\multicolumn{7}{c}{\textbf{Fully-Supervised Framework}}
\\
\midrule
-15 & 13.2 & 31.57 & 0.979 & 9.7 & 29.26 & 0.949\\
0 & 5.9 & 36.19 & 0.989 & 3.3 & 31.98 & 0.959 \\
15 & 6.8 & 35.53 & 0.988 & 4.1 & 31.07 & 0.959 \\
30 & 11.6 & 33.87 & 0.983 & 6.3 & 30.56 & 0.952 \\
\cline{1-7}
\toprule
\end{tabular}
}
\caption{\textbf{Ablation study on illuminance factor ($\mu$)} of the proposed UnShadowNet in both weakly-supervised and fully-supervised setup on ISTD \cite{wang2018stacked} dataset using RMSE, PSNR and SSIM metrics.}
\label{tab:mu_table}
\vspace{-7mm}
\end{table}
\begin{table*}[!h]
\centering
\scalebox{0.95}{
\begin{tabular}{l|c|c|c|c|c|c|c|c|c|c}
\bottomrule
& & \multicolumn{3}{c|} {\textbf{Shadow Region}} & \multicolumn{3}{c|}{\textbf{Non-Shadow Region}} & \multicolumn{3}{c}{\textbf{All}}\\
\cline{1-11}
\cellcolor{blue!25} $\textbf{Methods}$ & \cellcolor{blue!25} $\textbf{Training Data}$ & \cellcolor{red!25}$\textbf{RMSE}$$\downarrow$ & \cellcolor{red!25}$\textbf{PSNR}$$\uparrow$ & \cellcolor{red!25}$\textbf{SSIM}$$\uparrow$ & \cellcolor{red!25}$\textbf{RMSE}$$\downarrow$ & \cellcolor{red!25}$\textbf{PSNR}$$\uparrow$ & \cellcolor{red!25}$\textbf{SSIM}$$\uparrow$ & \cellcolor{red!25}$\textbf{RMSE}$$\downarrow$ & \cellcolor{red!25}$\textbf{PSNR}$$\uparrow$ & \cellcolor{red!25}$\textbf{SSIM}$$\uparrow$ \\
\cline{1-11}
Yang \textit{et al.} \cite{yang2012shadow} & -- & 23.2 & 21.57 & 0.878 & 14.2 & 22.25 & 0.782 & 15.9 & 20.26 & 0.706\\
Gong and Cosker \cite{gong2014interactive} & -- & 13.0 & 30.53 & 0.972 & 2.6 & 36.63 & 0.982 & 4.3 & 28.96 & 0.943 \\
\cline{1-11}
Guo \textit{et al.} \cite{guo2012paired} & Non.Shd.+Shd (Paired) & 20.1 & 26.89 & 0.960 & 3.1 & 35.48 & 0.975 & 6.1 & 25.51 & 0.924 \\
ST-CGAN \cite{wang2018stacked} & Non.Shd.+Shd (Paired) & 12.0 & 31.70 & 0.979 & 7.9 & 26.39 & 0.956 & 8.6 & 24.75 & 0.927 \\
SP+M-Net* \cite{le2019shadow} & Non.Shd.+Shd (Paired) & 8.1 & 35.08 & 0.984 & 2.8 & 36.38 & 0.979 & 3.6 & 31.89 & 0.953 \\
G2R-ShadowNet \textit{Sup.*} \cite{liu2021shadow} & Non.Shd.+Shd (Paired) & 7.9 & 36.12 & 0.988 & 2.9 & 35.21 & 0.977 & 3.6 & 31.93 & 0.957 \\
\rowcolor{YellowGreen}
\textbf{UnShadowNet \textit{Sup.*}} & \textbf{Non.Shd.+Shd (Paired)} & \textbf{5.9} & \textbf{36.19} & \textbf{0.989} & \textbf{2.7} & \textbf{36.44} & \textbf{0.978} & \textbf{3.3} & \textbf{31.98} & \textbf{0.959} \\
\cline{1-11}
Mask-ShadowGAN* \cite{hu2019mask} & Shd.Free(Unpaired) & 10.8 & 32.19 & 0.984 & 3.8 & 33.44 & 0.974 & 4.8 & 28.81 & 0.946 \\
LG-ShadowNet* \cite{liu2021shadow_lg} & Shd.Free(Unpaired) & 9.9 & 32.44 & 0.982 & 3.4 & 33.68 & 0.971 & 4.4 & 29.20 & 0.945 \\
\cline{1-11}
Le \textit{et al.}* \cite{le2020shadow} & Shd.Mask & 10.4 & 33.09 & 0.983 & 2.9 & 35.26 & 0.977 & 4.0 & 30.12 & 0.950 \\
G2R-ShadowNet* \cite{liu2021shadow} & Shd.Mask & 8.9 & 33.58 & 0.979 & 2.9 & 35.52 & 0.976 & 3.9 & 30.52 & 0.944 \\
\rowcolor{YellowGreen}
\textbf{UnShadowNet} & \textbf{Shd.Mask} & \textbf{8.3} & \textbf{34.47} & \textbf{0.984} & \textbf{2.9} & \textbf{35.51} & \textbf{0.977} & \textbf{3.8} & \textbf{30.63} & \textbf{0.951}\\
\toprule
\end{tabular}
}
\caption{\textbf{Quantitative comparison of two variants of \textit{UnShadowNet} with other state-of-the-art shadow removal methods} using RMSE, PSNR and SSIM metrics. Methods marked with `*' were evaluated on the adjusted ISTD \cite{wang2018stacked} dataset. Scores of the other methods are computed on the ISTD dataset and obtained from their respective publications.}
\label{tab:shadow_main_table}
\vspace{-3mm}
\end{table*}
\begin{table}[t]
\centering
\scalebox{0.98}{
\begin{tabular}{c|c|c|c}
\bottomrule
\cellcolor{blue!25} $\textbf{Methods}$ & \cellcolor{red!25}$\textbf{Shadow}$$\downarrow$ & \cellcolor{red!25}$\textbf{Non-Shadow}$$\downarrow$ & \cellcolor{red!25}$\textbf{All}$$\downarrow$ \\
\midrule
Guo \textit{et al.} \cite{guo2011single} & 18.95 & 7.46 & 9.30\\
Zhang \textit{et al.} \cite{zhang2015shadow} & 9.77 & 7.12 & 8.16\\
Iizuka \textit{et al.} \cite{iizuka2017globally} & 13.46 & 7.67 & 8.82 \\
Wang \textit{et al.} \cite{wang2018high} & 10.63 & 6.73 & 7.37 \\
DeshadowNet \cite{qu2017deshadownet} & 12.76 & 7.19 & 7.83\\
MaskShadow-GAN* \cite{hu2019mask} & 12.67 & 6.68 & 7.41 \\
ST-CGAN \cite{wang2018stacked} & 10.31 & 6.92 & 7.46\\
Cun \textit{et al.} \cite{cun2020towards} & 11.4 & 7.2 & 7.9 \\
AngularGAN \cite{sidorov2019conditional} & 9.78 & 7.67 & 8.16 \\
RIS-GAN \cite{zhang2020ris} & 8.99 & 6.33 & 6.95 \\
CANet \cite{chen2021canet} & 8.86 & 6.07 & 6.15 \\
Hu \textit{et al.} \cite{hu2019direction} & 7.6 & 3.2 & 3.9 \\
Fu \textit{et al.} \cite{fu2021auto} & 7.77 & 5.56 & 5.92 \\
\cline{1-4}
\rowcolor{YellowGreen}
\textbf{UnShadowNet \textit{Sup.}} & \textbf{7.01} & \textbf{4.58} & \textbf{5.17} \\
\rowcolor{YellowGreen}
\textbf{UnShadowNet} & \textbf{9.18} & \textbf{5.16} & \textbf{6.08} \\
\bottomrule
\end{tabular}
}
\caption{\textbf{Comparative study of fully and weakly-supervised UnShadowNet with other fully supervised state-of-the-art shadow removal methods on ISTD \cite{wang2018stacked} dataset using RMSE metric}. (*) marked method was trained using unpaired data.
}
\label{tab:istd_full_sup}
\vspace{-2.5mm}
\end{table}
\begin{table}[t]
\centering
\scalebox{1}{
\begin{tabular}{c|c|c|c}
\bottomrule
\cellcolor{blue!25} $\textbf{Methods}$ & \cellcolor{red!25}$\textbf{Shadow}$$\downarrow$ & \cellcolor{red!25}$\textbf{Non-Shadow}$$\downarrow$ & \cellcolor{red!25}$\textbf{All}$$\downarrow$ \\
\midrule
Guo \textit{et al.} \cite{guo2011single} & 22.0 & 3.1 & 6.1\\
Gong \textit{et al.} \cite{gong2016interactive} & 13.3 & -- & --\\
ST-CGAN \cite{wang2018stacked} & 13.4 & 7.7 & 8.7\\
DeshadowNet \cite{qu2017deshadownet} & 15.9 & 6.0 & 7.6\\
MaskShadow-GAN* \cite{hu2019mask} & 12.4 & 4.0 & 5.3 \\
SP+M-Net \cite{le2021physics} & 7.9 & 3.1 & 3.9 \\
Fu \textit{et al.} \cite{fu2021auto} & 6.5 & 3.8 & 4.2 \\
SP+M+I-Net \cite{le2021physics} & 6.0 & 3.1 & 3.6 \\
\cline{1-4}
\rowcolor{YellowGreen}
\textbf{UnShadowNet \textit{Sup.}} & \textbf{5.9} & \textbf{2.7} & \textbf{3.3} \\
\rowcolor{YellowGreen}
\textbf{UnShadowNet} & \textbf{8.3} & \textbf{2.9} & \textbf{3.8} \\
\bottomrule
\end{tabular}
}
\caption{\textbf{Comparative study of fully and weakly supervised UnShadowNet with other state-of-the-art shadow removal methods on adjusted ISTD \cite{le2019shadow} dataset using RMSE metric}. (*) marked method was trained using unpaired data.
}
\label{tab:istdp_full_sup}
\vspace{-6mm}
\end{table}
\textbf{Shadow inpainting:} Appearance of shadow is a natural phenomena and yet it is not an easy task to define the strong properties of shadow. This is because it does not have distinguishable shape, size, texture etc. Hence it becomes important to augment the available shadow samples extensively so that it can be effectively learnt by the network.
In this work, we estimate the mean intensity values of the existing shadow region of an image (${I_P}$). Then we randomly select shadow mask (${S_M}$) from the existing set of shadow samples. The mask (${S_M}$) is inpainted on the shadow-free region of the image (${I_P}$). The pixels that belong to the ${S_M}$ in ${I_P}$ will have brightness adjusted as the earlier computed mean. We do not apply the same mean every time, in order to generate diverse shadow regions, the estimated mean value is adjusted by $\pm 5\%$. The main motivations of this inpainting are two-fold: 1) It is difficult to learn complex shadows when it interacts with diverse light sources and other objects in the scene. The inpainted shadows are standalone and will provide an easier reference sample to another shadow segment in ${I_P}$. 2) It also increases the robustness of the network towards shadow removal by inpainting shadows with more diverse variations. Figure \ref{fig:shadow_inpainting} shows the proposed shadow inpainting with random shadow mask and different shadow intensities. Table \ref{tab:ablation_data_aug} indicates the significant benefits of inpainting complementing the standard data augmentation.
\textbf{Data augmentation:}
Data augmentation is an essential constituent to regularize any deep neural network based model. We make use of some of the standard augmentation techniques such as image flipping with a probability of $0.3$, random scaling of images in range $0.8$ to $1.2$, adding Gaussian noise, blur effect and enhancing contrast.
Table \ref{tab:ablation_data_aug} sums up the role of curriculum learning, shadow inpainting and data augmentation individually and the various combinations. This ablation study is performed on both weakly-supervised and fully-supervised setups indicating that both these training strategies are beneficial to learn shadow removal task.
\textbf{Illuminance factor ($\bm{\mu}$):}
The DeShadower Network maximises the information with ``bright" synthetic augmentations generated by the Illumination Network. The effectiveness of the Illumination Network is verified from the results in Fig. \ref{fig:shadow_removal_ablation}. To train the Illumination Network, we sample shadow regions from the dataset and vary their brightness by $\mu-5, \mu, \mu+5$. The different values experimented for the Illuminance factor ($\mu$) is presented in Table \ref{tab:mu_table}. We find that setting the value of $\mu$ at $50$ gives the most optimal results in shadow removal performance. For the fully-supervised setup, since the ground-truth images are available, the optimal level of brightness is obtained from those samples itself, consequently, $\mu = 0$ gives the best performance.
\begin{table}[t]
\centering
\scalebox{1}{
\begin{tabular}{c|c|c|c}
\bottomrule
\cellcolor{blue!25} $\textbf{Methods}$ &
\cellcolor{red!25}$\textbf{Shadow}$$\downarrow$ & \cellcolor{red!25}$\textbf{Non-Shadow}$$\downarrow$ & \cellcolor{red!25}$\textbf{All}$$\downarrow$ \\
\midrule
Guo \textit{et al.} \cite{guo2011single} & 31.06 & 6.47 & 12.60\\
Zhang \textit{et al.} \cite{zhang2015shadow} & 9.50 & 6.90 & 7.24\\
Iizuka \textit{et al.} \cite{iizuka2017globally} & 19.56 & 8.17 & 16.33 \\
Wang \textit{et al.} \cite{wang2018high} & 17.33 & 7.79 & 12.58 \\
DeshadowNet \cite{qu2017deshadownet} & 17.96 & 6.53 & 8.47\\
ST-CGAN \cite{wang2018stacked} & 18.64 & 6.37 & 8.23\\
Hu \textit{et al.} \cite{hu2019direction} & 11.31 & 6.72 & 7.83 \\
AngularGAN \cite{sidorov2019conditional} & 17.63 & 7.83 & 15.97 \\
Cun \textit{et al.} \cite{cun2020towards} & 8.94 & 4.80 & 5.67 \\
Fu \textit{et al.} \cite{fu2021auto} & 8.56 & 5.75 & 6.51 \\
RIS-GAN \cite{zhang2020ris} & 8.22 & 6.05 & 6.78 \\
CANet \cite{chen2021canet} & 7.82 & 5.88 & 5.98 \\
\cline{1-4}
\rowcolor{YellowGreen}
\textbf{UnShadowNet \textit{Sup.}} & \textbf{7.78} & \textbf{5.31} & \textbf{5.74} \\
\rowcolor{YellowGreen}
\textbf{UnShadowNet} & \textbf{8.92} & \textbf{5.96} & \textbf{6.61} \\
\bottomrule
\end{tabular}
}
\caption{\textbf{Comparative study of fully and weakly-supervised UnShadowNet with other fully-supervised state-of-the-art shadow removal methods on SRD \cite{qu2017deshadownet} dataset using RMSE metric}. No other prior-arts were found to remove shadow in weakly supervised fashion on the same dataset.
}
\label{tab:srtd_full_sup}
\vspace{-4mm}
\end{table}
\subsection{Quantitative study}
We evaluate our proposals and compare quantitatively with the state-of-the-art shadow removal techniques on ISTD \cite{wang2018stacked}, Adjusted ISTD \cite{le2019shadow} and SRD \cite{qu2017deshadownet} benchmark datasets.
\begin{figure*}[t]
\centering
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/103-1_in.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/103-1_le_sam.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/103-1_g2r.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/103-1.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/103-1_gt.png}
\vspace{0.25 mm}\\
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/114-10_in.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/114-10_le_sam.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/114-10_g2r.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/114-10.jpg}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/114-10_gt.png}
\vspace{0.25 mm}\\
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/115-3_in.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/115-3_le_sam.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/115-3_g2r.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/115-3.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/115-3_gt.png}
\vspace{0.25 mm}\\
\hspace{-0.25cm}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/117-11_in.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/117-11_le_sam.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/117-11_g2r.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/117-11.png}
\includegraphics[width=0.161\textwidth]{images/visual_comp_sota/117-11_gt.png} \\
\hspace{-0.8cm}{Input} \hspace{1.4cm}{Le \textit{et al.} \cite{le2020shadow}} \hspace{0.6cm}{G2R-ShadowNet \cite{liu2021shadow}} \hspace{0.8cm}{Ours} \hspace{2cm}{GT}
\caption{
\textbf{Qualitative comparison of our proposed method} with other state-of-the-art shadow removal methods that use shadow mask and shadow image as input,
on four challenging samples from ISTD \cite{wang2018stacked} dataset.
}
\label{fig:globfig}
\vspace{-7mm}
\end{figure*}
\textbf{ISTD:} Table \ref{tab:shadow_main_table} compares the proposed method with the state-of-the-art shadow removal approaches using RMSE, PSNR and SSIM metrics for shadow, shadow-free and all region. We achieve state-of-the-art results and the improvement with respect to all metrics for shadow area in both training setup namely weakly-supervised (UnshadowNet) and fully-supervised (UnshadowNet \textit{Sup.}) are quite significant. There are few other fully-supervised shadow removal methods evaluated on ISTD \cite{wang2018stacked} dataset and we compared with our proposed fully-supervised setup. In this setup as well, as per Table \ref{tab:istd_full_sup}, our proposed method outperforms other state-of-the-art approaches.
\textbf{ISTD+:} Table \ref{tab:istdp_full_sup} shows the performance of our proposed shadow remover on the adjusted ISTD \cite{le2019shadow} dataset using RMSE metric. The comparison of our method in fully-supervised setup with other techniques trained in same fashion demonstrates the robustness of our framework as it shows incremental improvement over the most recent state-of-the-art methods. In addition, we have performed experiment using weakly-supervised setup where the metrics are comparable and only slightly behind the fully-supervised model.
\textbf{SRD:} We report and compare our shadow removal results in both - constrained and unconstrained setup with existing fully-supervised methods on SRD \cite{qu2017deshadownet} using RMSE metric. Table \ref{tab:srtd_full_sup} indicates that our proposal trained in fully-supervised fashion obtains the lowest RMSE in all regions and outperforms the most recent state-of-the-art methods \cite{fu2021auto, zhang2020ris}.
\subsection{Qualitative study}
Figure \ref{fig:globfig} shows qualitative results of the proposed model trained in weakly-supervised format on total three challenging samples from ISTD \cite{wang2018stacked} dataset. We also visually compare with two existing and most recently published weakly-supervised shadow removal methods by Le \textit{et al.} \cite{le2020shadow} and G2R-ShadowNet \cite{liu2021shadow} respectively. It is clearly observed that UnShadowNet performs accurately to remove shadow in complex background. In addition to the unconstrained setup, Figure \ref{fig:results_fully_supervised} shows the results of our UnshadowNet \textit{Sup.} model on ISTD \cite{wang2018stacked} dataset. It is to be noted that the visual results are not shown on adjusted ISTD \cite{le2019shadow} dataset because the test samples are same as in ISTD dataset, the only difference is in the color in ground truth. In addition, we consider SRD \cite{qu2017deshadownet} dataset and this is the first work where visual results are presented on the samples from same dataset. Figure \ref{fig:results_srd_self_supervised} and \ref{fig:results_srd_fully_supervised} demonstrate the results of UnShadowNet in weakly-supervised and fully-supervised setup.
\iffalse
\begin{figure*}[t]
\centering
\includegraphics[width=0.161\textwidth]{images/ablation/121-3.png}
\includegraphics[width=0.161\textwidth]{images/ablation/121-3.png}
\includegraphics[width=0.161\textwidth]{images/ablation/121-3.png}
\includegraphics[width=0.161\textwidth]{images/ablation/121-3.png}
\includegraphics[width=0.161\textwidth]{images/ablation/121-3.png}
\includegraphics[width=0.161\textwidth]{images/ablation/121-3.png}
\vspace{0.25 mm}
Input\\
\includegraphics[width=0.161\textwidth]{images/ablation/122-10.png}
\includegraphics[width=0.161\textwidth]{images/ablation/122-10.png}
\includegraphics[width=0.161\textwidth]{images/ablation/122-10.png}
\includegraphics[width=0.161\textwidth]{images/ablation/122-10.png}
\includegraphics[width=0.161\textwidth]{images/ablation/122-10.png}
\includegraphics[width=0.161\textwidth]{images/ablation/122-10.png}
\vspace{0.25 mm}
Le \textit{et al.} \cite{le2020shadow}\\
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\vspace{0.25 mm}
Liu \textit{et al.} \cite{liu2021shadow}\\
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\vspace{0.25 mm}
Ours\\
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\includegraphics[width=0.161\textwidth]{images/ablation/125-13.png}
\vspace{0.25 mm}
Ground truth\\
\caption{
\textbf{Qualitative comparison of our proposed method with other only two state-of-the-art self-supervised shadow removal methods by Le \textit{et al.} \cite{le2020shadow} and Liu \textit{et al.} \cite{liu2021shadow} respectively on six challenging samples from ISTD \cite{wang2018stacked} dataset.}
}
\label{fig:globfig}
\vspace{-7mm}
\end{figure*}
\fi
\begin{figure}
\centering
\includegraphics[width=0.15\textwidth]{images/ablation/122-7.png}
\includegraphics[width=0.15\textwidth]{images/ablation/bright_122-7.png}
\includegraphics[width=0.15\textwidth]{images/ablation/gt_122-7.png}
\vspace{0.4 mm}
\includegraphics[width=0.15\textwidth]{images/ablation/124-3.png}
\includegraphics[width=0.15\textwidth]{images/ablation/bright_124-3.png}
\includegraphics[width=0.15\textwidth]{images/ablation/gt_124-3.png}
\hspace{0.6cm}{Input} \hspace{1.4cm}{UnShadowNet} \hspace{0.8cm}{Ground Truth}
\caption{
\textbf{Qualitative results on the ISTD \cite{wang2018stacked} dataset using \textit{fully-supervised} UnShadowNet setup.}
}
\vspace{-6 mm}
\label{fig:results_fully_supervised}
\end{figure}
\begin{figure}[!t]
\centering
\includegraphics[width=0.15\textwidth]{images/ablation/IMG_2432.jpg}
\includegraphics[width=0.15\textwidth]{images/ablation/bright_abl_2_IMG_2432.jpg}
\includegraphics[width=0.15\textwidth]{images/ablation/IMG_2432_free.jpg}
\vspace{0.25 mm}
\includegraphics[width=0.15\textwidth]{images/ablation/IMG_5690.jpg}
\includegraphics[width=0.15\textwidth]{images/ablation/bright_abl_2_IMG_5690.jpg}
\includegraphics[width=0.15\textwidth]{images/ablation/IMG_5690_free.jpg}
\hspace{1.6cm}{Input} \hspace{1.5cm}{UnShadowNet}
\hspace{0.4cm} {Ground Truth}
\caption{
\textbf{Qualitative results on the SRD \cite{qu2017deshadownet} dataset using \textit{weakly-supervised} UnShadowNet setup.}
}
\vspace{-4 mm}
\label{fig:results_srd_self_supervised}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.15\textwidth]{images/ablation/IMG_6160.jpg}
\includegraphics[width=0.15\textwidth]{images/ablation/bright_IMG_6160.jpg}
\includegraphics[width=0.15\textwidth]{images/ablation/gt_IMG_6160_free.jpg}
\vspace{0.25 mm}
\includegraphics[width=0.15\textwidth]{images/ablation/_MG_3104.jpg}
\includegraphics[width=0.15\textwidth]{images/ablation/bright__MG_3104.jpg}
\includegraphics[width=0.15\textwidth]{images/ablation/gt__MG_3104_free.jpg}
\hspace{1.6cm}{Input} \hspace{1.5cm}{UnShadowNet}
\hspace{0.4cm} {Ground Truth}
\caption{
\textbf{Qualitative results on the SRD \cite{qu2017deshadownet} dataset using \textit{fully-supervised} UnShadowNet setup.} }
\vspace{-5 mm}
\label{fig:results_srd_fully_supervised}
\end{figure}
\begin{figure}[!t]
\centering
\includegraphics[width=0.15\textwidth]{images/automotive/frame0608_image.jpg}
\includegraphics[width=0.15\textwidth]{images/automotive/frame13922_image.jpg}
\includegraphics[width=0.15\textwidth]{images/automotive/frame2516_image.jpg}
\vspace{0.25 mm}
\includegraphics[width=0.15\textwidth]{images/automotive/fframe0608_image.jpg}
\includegraphics[width=0.15\textwidth]{images/automotive/fframe13922_image.jpg}
\includegraphics[width=0.15\textwidth]{images/automotive/fframe2516_image.jpg}
\caption{
\textbf{Qualitative results (\textit{bottom}) on a few input samples (\textit{top}) from IDD dataset \cite{varma2019idd}.} \textit{UnShadowNet} trained on ISTD \cite{wang2018stacked} dataset enables to remove shadow reasonably in automotive scenes. }
\vspace{-5 mm}
\label{fig:results_automotive}
\end{figure}
\subsection{Evaluation of generalization in an unconstrained automotive dataset}
Automotive object detection and segmentation datasets do not provide shadow labels and thus it is not possible to quantitatively evaluate extensively on these datasets. We sampled a few shadow scenes from the challenging IDD dataset \cite{varma2019idd} which contains varied lighting condition scenes on Indian roads. It was not possible to train our model as shadow masks were not available. Thus we used this dataset to evaluate the robustness and generalization of our pre-trained model on novel scenes. The qualitative results are illustrated in Figure \ref{fig:results_automotive}.
Although the performance of the proposed shadow removal framework is either comparable to the state-of-the-art or superior but it is still not robust to be used in real-world autonomous driving systems. We feel that more extensive datasets have to be built for shadow to perform more detailed studies and we hope this work encourages creation of these datasets or annotations of shadows in existing datasets.
| {'timestamp': '2022-03-30T02:30:33', 'yymm': '2203', 'arxiv_id': '2203.15441', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15441'} | arxiv |
\section{Introduction}
The sequential recommendation~\citep{fan2021continuous,liu2021augmenting,chen2018sequential,tang2018personalized,zheng2019gated} aims at predicting future items in sequences, where the crucial part is to characterize item relationships in sequences. Recent developments in sequence modeling~\citep{fan2021continuous,liu2021augmenting} verify the superiority of Transform~\citep{vaswani2017attention}, i.e. the self-attention mechanism, in revealing item correlations in sequences.
A Transformer~\citep{kang2018self} is able to infer the sequence embedding at specified positions by weighted aggregation of item embeddings, where the weights are learned via self-attention.
Existing works~\citep{fan2021continuous,ssept20wu} further improve Transformer by incorporating additional complex signals.
However, the \text{data sparsity issue}~\citep{liu2021augmenting} and \text{noise in sequences} undermine the performance of a model in sequential recommendation.
The former hinders performance due to insufficient training since the complex structure of a sequential model requires a dense corpus to be adequately trained.
The latter also impedes the recommendation ability of a model because noisy item sequences are unable to reveal actual item correlations.
To overcome both, a new contrastive self-supervised learning (SSL) paradigm~\citep{liu2021contrastive,xie2020contrastive,zhou2020s3} is proposed recently.
This paradigm enhances the capacity of encoders by leveraging additional self-supervised signals. Specifically,
the SSL paradigm constructs positive view pairs as two data augmentations from the same sequences~\citep{xie2020contrastive}, while negative pairs are augmentations from distinct sequences.
Incorporating augmentations during training increases the amount of training data, thus alleviating the sparsity issue. And the contrastive loss~\citep{chen2020simple} improves the robustness of the model, which endows a model with the ability to against noise.
Though being effective in enhancing sequential modeling,
the data augmentation methods adopted in the existing SSL paradigm suffer from the following weaknesses:
\begin{itemize}[leftmargin=*]
\item Optimal data augmentation methods are hard to devise. Current sequence augmentation methods adopts random sequence perturbations~\citep{liu2021contrastive,xie2020contrastive},
which includes \text{crop}, \text{mask}, \text{reorder}, \text{substitute} and \text{insert} operations.
Though a random combination of those augmenting operations improves the performance, it is rather time-consuming to search the optimal augmentation methods from a large number of potential combinations for different datasets~\citep{liu2021contrastive}.
\item Data augmentation methods destroy sequential correlations, leading to less confident positive pairs.
The existing SSL paradigm requires injecting perturbations into the augmented views of sequences for contrastive learning.
However, because the view construction process is not optimized to characterize sequential correlations,
two views of one sequence may reveal distinct item relationships, which should not be recognized as positive pairs.
\item Data augmentation fails to incorporate comprehensive self-supervised signals. Current data augmentation methods are designed based on heuristics, which already requires additional prior knowledge. Moreover, since the view construction process is not optimized with the encoder, data augmentation may only reveal partial self-supervised signals from data perspectives. Hence, we should consider other types of views besides data augmentation.
\end{itemize}
Therefore, we investigate the possibility of \textit{model augmentation} to construct view pairs for contrastive learning, which functions as a complement to the data augmentation methods.
We hypothesis that injecting perturbations into the encoder should enhance the self-supervised learning ability to existing paradigms.
The reasons are threefold: Firstly, model augmentation is jointly trained with the optimization process, thus endows the end-to-end training fashion. As such, it is easy to discover the optimal view pairs for contrastive learning.
Secondly, model augmentation constructs views without manipulation to the original data, which leads to high confidence of positive pairs.
Last but not least, injecting perturbation into the encoder has distinct characteristics to data augmentation, which should be an important complement in constructing view pairs for existing self-supervised learning scheme~\citep{liu2021contrastive,zhou2020s3}.
This work studies the model augmentation for a self-supervised sequential recommendation from three levels: 1) neuron masking (dropout), which adopts the dropout layer to randomly mask partial neurons in a layer. By operating the dropout twice to one sequence, we can perturb the output of the embedding from this layer, which thus constructs two views from model augmentation perspective~\citep{gao2021simcse}. 2) layer dropping. Compared with neuron masks, we randomly drop a complete layer in the encoder to inject more perturbations. By randomly dropping layers in an encoder twice, we construct two distinct views. Intuitively, layer-drop augmentation enforces the contrast between deep features and shallows features of the encoder.
3) encoder complementing, which leverages other encoders to generate sequence embeddings. Encoder complementing augmentation is able to fuse distinct sequential correlations revealed by different types of encoders. For example, RNN-based sequence encoder~\citep{hidasi2015session} can better characterize direct item transition relationships, while Transformer-based sequence encoder models position-wise sequential correlations.
Though only investigating SSL for a sequential recommendation, we remark that model augmentation methods can also be applied in other SSL scenarios. The contributions are as follows:
\begin{itemize}[leftmargin=*]
\item We propose a new contrastive SSL paradigm for sequential recommendation by constructing views from model augmentation, which is named as \textsc{SRMA}\xspace.
\item We introduce three levels of model augmentation methods for constructing view pairs.
\item We discuss the effectiveness and conduct a comprehensive study of model augmentations for the sequential recommendation.
\item We investigate the efficacy of different variants of model augmentation.
\end{itemize}
\section{Related Work}
\subsection{Sequential Recommendation}
Sequential recommendation predicts future items in user
sequences by encoding sequences while modeling item transition correlations~\citep{rendle2010factorizing,hidasi2015session}. Previously, Recurrent Neural Network~(RNN) have been adapted to sequential recommendation~\citep{hidasi2015session,wu2017recurrent},
ostensibly modeling sequence-level item transitions.
Hierarchical RNNs~\citep{quadrana2017personalizing} incorporate
personalization
information.
Moreover, both
long-term and short-term item transition correlations are modelled in LSTM~\citep{wu2017recurrent} .
Recently, the success of self-attention models~\citep{vaswani2017attention,devlin2018bert} promotes the prosperity of Transformer-based sequential recommendation models. SASRec~\citep{kang2018self} is a pioneering work adapting Transformer to
characterize complex item transition correlations.
BERT4Rec~\citep{sun2019bert4rec} adopts the bidirectional Transformer layer to encode sequence.
ASReP~\citep{liu2021augmenting} reversely pre-training a Transformer to augment short sequences and fine-tune it to predict the next-item in sequences. TGSRec~\citep{fan2021continuous} models temporal collaborative signals in sequences to recognize item relationships.
\subsection{Self-supervised Learning}
Self-supervised learning~(SSL) is proposed recently to describe ``the machine predicts any parts of its input for
any observed part''\citep{Bengio2021deep}, which stays within the narrow scope of unsupervised learning.
To achieve the self-prediction, endeavors from various domains have developed different SSL schemes from either generative or contrastive perspectives~\citep{liu2021self}. For generative SSL, the masked language model is adopted in BERT~\citep{devlin2018bert} to generate masked words in sentences. GPT-GNN~\citep{hu2020gpt} also generates masked edges to realize SSL. Other generative SSL paradigms in computer vision~\citep{oord2016conditional} are proposed.
Compared with generative SSL, contrastive SSL schemes have demonstrated more promising performance.
SimCLR~\citep{chen2020simple} proposes simple contrastive learning between augmented views for images, which is rather effective in achieving SSL.
GCC~\citep{qiu2020gcc} and GraphCL~\citep{you2020graph} adopts contrastive learning between views from corrupted graph structures.
CL4SRec~\citep{xie2020contrastive} and CoSeRec~\citep{liu2021contrastive} devise the sequence augmentation methods for SSL on sequential recommendation.
This paper also investigates the contrastive SSL for a sequential recommendation. Instead of adopting the data augmentation for constructing views to contrast, we propose the model augmentation to generate contrastive views.
\section{Preliminary}
\subsection{Problem Formulation}
We denote
user and item sets as $\mathcal{U}$ and $\mathcal{V}$ respectively. Each user $u\in \mathcal{U}$ is associated with a sequence of items in chronological order
$s_{u}= [v_{1}, \dots, v_{t}, \dots, v_{|s_{u}|}]$, where $v_{t}\in \mathcal{V}$ denotes the item that $u$
has interacted with at time $t$ and $|s_{u}|$ is the total number of items.
Sequential recommendation is formulated as follows:
\begin{equation}
\underset{v_{i}\in \mathcal{V}}{\mathrm{arg\,max}}~P(v_{|s_{u}|+1}=v_{i}\left| s_{u}\right.),
\end{equation}
where $v_{|s_{u}|+1}$ denotes
the next item in sequence.
Intuitively, we calculate the probability of all candidate items and recommend items with high probability scores.
\subsection{Sequential Recommendation Framework}
The core of a generic sequential recommendation framework is a sequence encoder $\mathsf{SeqEnc}(\cdot)$, which transforms item sequences to embeddings for scoring. We formulate the encoding step as:
\begin{equation}\label{eq:seq_encoder}
\mathbf{h}_{u} = \mathsf{SeqEnc}(s_{u}),
\end{equation}
where $\mathbf{h}_{u}$ denotes the sequence embedding of $s_{u}$. To be specific, if we adopt a Transformer~\citep{kang2018self,vaswani2017attention} as the encoder, $\mathbf{h}_{u}$ is a bag of embeddings, where
at each position $t$,
$\mathbf{h}_{u}^{t}$, represents a predicted next-item.
We adopt the log-likelihood loss function to optimize the encoder for next-item prediction as follows:
\begin{equation}
\mathcal{L}_{\text{rec}}(u,t) = -\log(\sigma(\mathbf{h}_{u}^{t}\cdot \mathbf{e}_{v_{t+1}}))- \sum_{v_{j}\not\in s_{u}}\log(1-\sigma (\mathbf{h}_{u}^{t} \cdot \mathbf{e}_{v_{j}})),
\end{equation}
where $\mathcal{L}_{\text{rec}}(u,t)$ denotes the loss score for the prediction at position $t$ in sequence $s_{u}$, $\sigma$ is the non-linear activation function, $\mathbf{e}_{v_{t+1}}$ denotes the embedding for item $v_{t+1}$, and $v_{j}$ is the sampled negative item for $s_u$.
The embeddings of items are retrieved from the embedding layer in $\mathsf{SeqEnc}(\cdot)$, which is jointly optimized with other layers.
\subsection{Contrastive Self-supervised Learning Paradigm}
Other than the next-item prediction, we can leverage other pretext tasks~\citep{sun2019bert4rec,liu2021self,liu2021contrastive} over the sequence to optimize the encoder, which harnesses the self-supervised signals within the sequence.
This paper investigate the widely adopted contrastive SSL scheme~\citep{liu2021contrastive,xie2020contrastive}. This scheme constructs positive and negative view pairs from sequences, and employs the contrastive loss~\citep{oord2018representation} to optimize the encoder. We formulate the SSL step as follows:
\begin{equation}
\mathcal{L}_{\mathrm{ssl}}(\mathbf{\Tilde{h}}_{2u-1},
\mathbf{\tilde{h}}_{2u}) =
- \log \frac{\exp(\text{sim}(\mathbf{\tilde{h}}_{2u-1}, \mathbf{\tilde{h}}_{2u}))}
{\sum_{m=1}^{2N}\mathbbm{1}_{m\neq 2u-1}\exp(\text{sim}(\mathbf{\tilde{h}}_{2u-1}, \mathbf{\tilde{h}}_{m}))},
\end{equation}
where $\mathbf{\tilde{h}}_{2u}$ and $\mathbf{\tilde{h}}_{2u-1}$ denotes two views constructed for sequence $s_{u}$. $\mathbbm{1}$ is an indication function. $\text{sim}(\cdot,\cdot)$ is the similarity function, \textit{e.g.} dot-product. Since each sequence has two view, we have $2N$ samples in a batch with $N$ sequences for training. The nominator indicates the agreement maximization between a positive pair, while the denominator is interpreted as push away those negative pairs.
Existing works apply data augmentation for sequences to construct views, \textit{e.g.} \cite{xie2020contrastive} propose \textit{crop}, \textit{mask}, and \textit{reorder} a sequence and \citep{liu2021contrastive} devises \textit{insert} and \textit{substitute} sequence augmentations. For sequential recommendation, since both SSL and the next-item prediction charaterize the item relationships in sequences, we add them together to optimize the encoder. Therefore, the final loss $\mathcal{L} = \mathcal{L}_{\mathrm{rec}} + \lambda \mathcal{L}_{\mathrm{ssl}}.$
Compared with them, we adopt both the data augmentation and model augmentation to generate views for contrast.
We demonstrate the contrastive SSL step in Figure~\ref{fig:framework}(a).
\begin{figure}
\centering
\includegraphics[width=0.99\linewidth]{./figures/framework.pdf}
\caption{(a) The contrastive SSL framework with model augmentation. We apply the model augmentation to the encoder, which constructs two views for contrastive learning. (b) the neuron masking augmentation. We demonstrate the neuron masking for the Feed-Forward network. (c) the layer dropping augmentation. We add $K$ FFN layers after the encoder and randomly drop $M$ layers (dash blocks) during each batch of training. And (d) the encoder complementing augmentation. We pre-train another encoder for generating the embedding of sequences. The embedding from the pre-trained encoder is combined with the model encoder for contrastive learning.
}
\label{fig:framework}
\end{figure}
\section{Model Augmentation}
In this section, we introduce the model augmentation to construct views for sequences. We discuss three type of model augmentation methods, which are neuron mask, layer drop and encoder complement. We illustrate these augmentation methods in Figure~\ref{fig:framework}(b), \ref{fig:framework}(c) and \ref{fig:framework}(d), respectively.
\subsection{Neuron Masking}
This work adopts the Transformer as the sequence encoder, which passes the hidden embeddings to the next layer through a feed-forward network (FFN). During training, we randomly mask partial neurons in each FFN layer, which involves a masking probability $p$. The large value of $p$ leads to intensive embedding perturbations. As such, we generate a pair of views from one sequence from model perspectives.
Besides, during each batch of training, the masked neurons are randomly selected, which results in comprehensive contrastive learning on model augmentation.
Note that, though we can utilize different probability values for distinct FFN layers, we enforce their neuron masking probability to be the same for simplicity.
The neuron masking augmentation on FFN is shown in Figure~\ref{fig:framework}(b).
Additionally, we remark that the neuron mask can be applied to any neural layers in a model to inject more perturbations.
\subsection{Layer Dropping}
Dropping partial layers of a model decreases the depth and reduces complexity. Previous research argues that most recommender systems require only shallow embeddings for users and items~\citep{dacrema2019we}.
Therefore, it is reasonable to randomly drop a fraction of layers during training, which functions as a way of regularization.
Additionally, existing works~\citep{liu2020towards,he2016deep} claim that embeddings at shallow layers and deep layers are both important to reflect the comprehensive information of the data.
Dropping layers enable contrastive learning between shallow embeddings and deep embeddings, thus being an enhancement of existing works that only contrasting between deep features.
On the other hand, dropping layers, especially those necessary layers in a model, may destroy original sequential correlations. Thus, views generating by dropping layers may not be a positive pair.
To this end, instead of manipulating the original encoder, we stack $K$ FFN layers after the encoder and randomly drop $M$ of them during each batch of training, where $M < K$.
We illustrate the layer dropping as in Figure~\ref{fig:framework}(c), where we append $K$ additional FFN layers after the encoder and use dash blocks to denote the dropped layers.
\subsection{Encoder Complementing}
During self-supervised learning, we employ one encoder to generate embeddings of two views of one sequence.
Though this encoder can be effective in revealing complex sequential correlations, contrasting on one single encoder may result in embedding collapse problems for self-supervised learning~\citep{hua2021feature}.
Moreover, one single encoder is only able to reflect the item relationships from a unitary perspective. For example, the Transformer encoder adopts the attentive aggregation of item embeddings to infer sequence embedding, while an RNN structure~\citep{hidasi2015session} is more suitable in encoding direct item transitions. Therefore,
contrasting between views from distinct encoders enables the model to learn comprehensive sequential relationships of items.
However, embeddings from two views of a sequence with distinct encoders lead to a non-Siamese paradigm for self-supervised learning, which is hard to train and suffers the embedding collapse problem~\citep{koch2015siamese,chen2021exploring}. Additionally, if two distinct encoders reveal significantly diverse sequential correlations, the embeddings are far away from each other, thus being bad views for contrastive learning~\citep{tian2020makes}. Moreover, though we can optimize two encoders during a training phase, it is still problematic to combine them for the inference of sequence embeddings to conduct recommendations.
As a result, instead of contrastive learning with distinct encoders, we harness another pre-trained encoder as an encoder complementing model augmentation for the original encoder. To be more specific, we first pre-train another encoder with the next-item prediction target. Then, in the self-supervised training stage, we utilize this pre-trained encoder to generate another embedding for a view. After that, we add the view embeddings from a model encoder and the pre-trained encoder.
We illustrate the encoder complementing augmentation in Figure~\ref{fig:framework}(d).
Note that we only apply this model augmentation in one branch of the SSL paradigm. And the embedding from the pre-trained encoder is re-scaled by a hyper-parameter $\gamma$ before adding to the embedding from the framework's encoder. The smaller value of $\gamma$ implies injecting fewer perturbations from a distinct encoder.
The pre-trained encoder are not trainable during training.
Hence, there is no optimization for this pre-trained encoder and it is no longer required to take account of both encoders during the inference stage.
\section{Experiments}
\subsection{Experimental Settings}
\textbf{Dataset}~ We conduct experiments on three public datasets. Amazon Sports, Amazon Toys and Games~\citep{mcauley2015image} and Yelp\footnote{https://www.yelp.com/dataset}, which
are Amazon review data in Sport and Toys categories, and
a dataset for the business recommendation, respectively.
We follow common
practice
in~\citep{liu2021augmenting,xie2020contrastive} to only keep the `5-core' sequences.
In total, Sports dataset has 35,598 users, 18,357 items and 296,337 interactions. Toys dataset contains 19,412 users, 11,924 items, and 167,597interactions. Yelp dataset consists 30,431 users, 20,033 items and 316,354 interactions.
\textbf{Evaluation Metrics}~
We follow existing works~\citep{wang2019neural,krichene2020sampled,liu2021augmenting}
to evaluate models' performances based on
the whole item set without negative sampling
and report standard
\textit{Hit Ratio}$@k$ ($\mathrm{HR}@k$) and \textit{Normalized Discounted
Cumulative Gain}$@k$ ($\mathrm{NDCG}@k$)
on
all datasets, where $k\in\{5, 10, 20\}$.
\textbf{Baselines}~
We include two groups of sequential models as
baselines
for comprehensive comparisons.
The first group baselines are sequential models that
use different
deep neural architectures to encode sequences with
a supervised objective. These include
\textbf{GRU4Rec}~\citep{hidasi2015session} as an RNN-based method,
\textbf{Caser}~\citep{tang2018personalized} as a
CNN-based approach, and \textbf{SASRec}~\citep{kang2018self}
as one of the state-of-the-art Transformer based
solution.
The second group baselines additionally
leverage SSL objective.
\textbf{BERT4Rec}~\citep{sun2019bert4rec} employs
a \emph{Cloze} task~\citep{taylor1953cloze} as a generative self-supervised learning sigal.
\textbf{S$^3\text{Rec}$}~\citep{zhou2020s3}
uses contrastive SSL with `mask' data augmentation to fuse correlation-ships
among item, sub-sequence, and correspondinng
attributes into the networks.
We remove the components for
fusing attributes for fair comparison.
\textbf{CL4SRec}~\citep{xie2020contrastive} maximize the agreements
between two sequences augmentation, where the data augmentation are randomly selected from
'crop', `reorder', and `mask' data augmentations. \textbf{CoSeRec}~\citep{liu2021contrastive}
improves the robustness of
data augmentation under
contrastive SSL framework by leveraging
item-correlations.
\textbf{Implementation Details}
The model encoder in \textsc{SRMA}\xspace is the basic Transformer-based encoder. We adopt the widely used SASRec encoder. The neuron masking probability is searched from $\{0.0,0.1,0.2,\dots,0.9\}$. For layer dropping, the $K$ is searched from $\{1,2,3,4\}$, and $M$ is searched accordingly. As for encoder complementing, we search the re-scale hyper-parameter $\gamma$
from $\{0.005, 0.01, 0.05, 0.1, 0.5, 1.0\}$ and the pre-trained encoder is selected from a $1$-layer Transformer and a GRU encoder.
\subsection{Overall Performance}
\begin{table*
\caption{Performance comparisons of different methods.
The best score is in bold in each row, and the second best is underlined.}
\vspace{2mm}
\label{tab:main-results}
\setlength{\tabcolsep}{0.65mm}{
\begin{tabular}{l|l|cccccccr}
\toprule
Dataset & Metric & GRU4Rec & Caser & SASRec & BERT4Rec & S$^3$-Rec & CL4SRec & CoSeRec & \textsc{SRMA}\xspace \\
\hline
\hline
\multirow{6}{*}{Sports} & HR@5 & 0.0162 & 0.0154 & 0.0206 & 0.0217 & 0.0121 & 0.0231 & {\ul 0.0287} & \textbf{0.0299} \\
& HR@10 & 0.0258 & 0.0261 & 0.0320 & 0.0359 & 0.0205 & 0.0369 & {\ul 0.0437} & \textbf{0.0447} \\
& HR@20 & 0.0421 & 0.0399 & 0.0497 & 0.0604 & 0.0344 & 0.0557 & {\ul 0.0635} & \textbf{0.0649} \\
& NDCG@5 & 0.0103 & 0.0114 & 0.0135 & 0.0143 & 0.0084 & 0.0146 & {\ul 0.0196} & \textbf{0.0199} \\
& NDCG@10 & 0.0142 & 0.0135 & 0.0172 & 0.019 & 0.0111 & 0.0191 & {\ul 0.0242} & \textbf{0.0246} \\
& NDCG@20 & 0.0186 & 0.0178 & 0.0216 & 0.0251 & 0.0146 & 0.0238 & {\ul 0.0292} & \textbf{0.0297} \\
\midrule
\multirow{6}{*}{Yelp} & HR@5 & 0.0152 & 0.0142 & 0.0160 & 0.0196 & 0.0101 & 0.0227 & {\ul 0.0241} & \textbf{0.0243} \\
& HR@10 & 0.0248 & 0.0254 & 0.0260 & 0.0339 & 0.0176 & 0.0384 & {\ul 0.0395} & \textbf{0.0395} \\
& HR@20 & 0.0371 & 0.0406 & 0.0443 & 0.0564 & 0.0314 & 0.0623 & \textbf{0.0649} & {\ul 0.0646} \\
& NDCG@5 & 0.0091 & 0.008 & 0.0101 & 0.0121 & 0.0068 & 0.0143 & {\ul 0.0151} & \textbf{0.0154} \\
& NDCG@10 & 0.0124 & 0.0113 & 0.0133 & 0.0167 & 0.0092 & 0.0194 & {\ul 0.0205} & \textbf{0.0207} \\
& NDCG@20 & 0.0145 & 0.0156 & 0.0179 & 0.0223 & 0.0127 & 0.0254 & {\ul 0.0263} & \textbf{0.0266} \\
\midrule
\multirow{6}{*}{Toys} & HR@5 & 0.0097 & 0.0166 & 0.0463 & 0.0274 & 0.0143 & 0.0525 & {\ul 0.0583} & \textbf{0.0598} \\
& HR@10 & 0.0176 & 0.0270 & 0.0675 & 0.0450 & 0.0094 & 0.0776 & {\ul 0.0812} & \textbf{0.0834} \\
& HR@20 & 0.0301 & 0.0420 & 0.0941 & 0.0688 & 0.0235 & 0.1084 & {\ul 0.1103} & \textbf{0.1132} \\
& NDCG@5 & 0.0059 & 0.0107 & 0.0306 & 0.0174 & 0.0123 & 0.0346 & {\ul 0.0399} & \textbf{0.0407} \\
& NDCG@10 & 0.0084 & 0.0141 & 0.0374 & 0.0231 & 0.0391 & 0.0428
& {\ul 0.0473} & \textbf{0.0484} \\
& NDCG@20 & 0.0116 & 0.0179 & 0.0441 & 0.0291 & 0.0162 & 0.0505
& {\ul 0.0547} & \textbf{0.0559} \\
\bottomrule
\end{tabular}
}
\end{table*}
We compare the proposed paradigm \textsc{SRMA}\xspace to existing methods with respect to the performance on the sequential recommendation. Results are demonstrated in Table~\ref{tab:main-results}. We can observe that Transformer-based sequence encoders, such SASRec and BERT4Rec are better than GRU4Rec or Caser sequence encoders. Because of this, our proposed model \textsc{SRMA}\xspace also adopts the Transformer as sequence encoder. Moreover, the SSL paradigm can significantly improve performance. For example, the CL4SRec model, which adopts the random data augmentation, improves the performance of SASRec on HR and NDCG by $13.2\%$ and $9.8\%$ on average regarding the Sports dataset, respectively.
Also, since \textsc{SRMA}\xspace enhances the SSL with both data augmentation and model augmentation, \textsc{SRMA}\xspace thus outperforms all other SSL sequential recommendation models. \textsc{SRMA}\xspace adopts the same data augmentation methods as CL4SRec. Nevertheless, \textsc{SRMA}\xspace significantly outperforms CL4SRec. On the sports dataset, we achieve $18.9\%$ and $27.9\%$ relative improvements on HR and NDCG, respectively. On the Yelp dataset, we achieve $4.5\%$ and $6.4\%$ relative improvements on HR and NDCG, respectively. And on Toys data, we achieve $8.6\%$ and $13.8\%$ relative improvements on HR and NDCG, respectively.
In addition, \textsc{SRMA}\xspace also performs better than CoSeRec which leverages item correlations for data augmentation. Those results all verify the effectiveness of model augmentation in improving the SSL paradigm.
\subsection{Comparison between Model and Data Augmentation }
Because \textsc{SRMA}\xspace adopts the random sequence augmentation, we mainly focus on comparing with CL4SRec to justify the impacts of model augmentation and data augmentation. In fact, CL4SRec also implicitly uses the neuron masking model augmentation, where dropout layers are stacked within its original sequence encoder.
To separate the joint effects of model and data augmentation, we create its variants `CL4S. $p=0$', which sets all the dropout ratios to be $0$, thus disables the neuron masking augmentation.
Also, another variant `CL4S. w/o D', which has no data augmentation are also compared.
Additionally, we create two other variants of \textsc{SRMA}\xspace as `\textsc{SRMA}\xspace w/o M' and `\textsc{SRMA}\xspace w/o D' by disabling the model augmentation and data augmentation respectively. `\textsc{SRMA}\xspace w/o M' has additional FFN layers compared with `CL4S. $p=0$'.
The recommendation performance on the Sports and Toys dataset is presented in Table~\ref{tab:variants-study}.
We have the following observations.
Firstly, we notice a significant performance drop of the variant `CL4S. $p=0$', which suggests that the neuron masking augmentation is rather crucial. It benefits both the regularization of the training encoder and model augmentation of SSL.
Secondly, `\textsc{SRMA}\xspace w/o D' outperforms other baselines on the Sports dataset and has comparable performance to `CL4S.', which indicates the model augmentation is of more impact in the SSL paradigm compared with data augmentation.
Thirdly, \textsc{SRMA}\xspace performs the best against all the variants. This result suggests that we should jointly employ the data augmentation and model augmentation in an SSL paradigm, which contributes to comprehensive contrastive self-supervised signals.
\begin{table*}
\caption{Performance comparison w.r.t. the variants of CL4SRec (CL4S.) and \textsc{SRMA}\xspace. M and D denote the model augmentation and data augmentation, respectively. $p=0$ indicates no neuron masking. The best score in each column are in bold, where the second-best are underlined.}
\vspace{2mm}
\label{tab:variants-study}
\resizebox{\columnwidth}{!}{
\begin{tabular}{l|cc|cc|cc|cc}
\toprule
\multirow{3}{*}{Model} & \multicolumn{4}{c|}{Sports}
& \multicolumn{4}{c}{Toys}\\
\cline{2-9}
& \multicolumn{2}{c|}{HR} &
\multicolumn{2}{c|}{NDCG} &
\multicolumn{2}{c|}{HR} &
\multicolumn{2}{c}{NDCG} \\
& @5 & @10 & @5 & @10
& @5 & @10 & @5 & @10 \\
\hline
CL4S. w/o D & 0.0162 & 0.0268 & 0.0108 & 0.0142 & 0.0444 & 0.0619 & 0.0306 & 0.0363\\
CL4S. $p=0$ & 0.0177 & 0.0292 & 0.0119 & 0.0156 & 0.0451 & 0.0654 & 0.0305 & 0.037\\
CL4S. & 0.0231 & 0.0369 & 0.0146 & 0.0191 & {\ul 0.0525} & {\ul 0.0776} & {\ul 0.0346} & {\ul 0.0428} \\
SRMA w/o D & {\ul 0.0285} & {\ul 0.0432} & {\ul 0.0187} & {\ul 0.0234} & 0.0504 & 0.0724 & 0.0331 & 0.0402 \\
SRMA w/o M & 0.0165 & 0.0272 & 0.0104 & 0.0138 & 0.0412 & 0.0590 & 0.0279 & 0.0336 \\
SRMA & \textbf{0.0299} & \textbf{0.0447} & \textbf{0.0199} & \textbf{0.0246} & \textbf{0.0598} & \textbf{0.0834} & \textbf{0.0407} & \textbf{0.0484}
\\
\bottomrule
\end{tabular}}
\end{table*}
\subsection{Hyper-parameter Sensitivity}
In this section, we vary the hyper-parameters in neuron masking and layer dropping to draw a detailed investigation of model augmentation.
\textbf{Effect of Neuron Masking.}
Though all neural layers can apply the neuron masking augmentation, for simplicity, we only endow the FFN layer with the neuron masking augmentation and set the masking probability as $p$ for all FFN layers in the framework.
We fix the settings of layer dropping and the encoder complementing model augmentation and select $p$ from $\{0.0, 0.1, 0.2, \dots, 0.9\}$, where $0.0$ is equivalent to no neuron masking. Also, we compare \textsc{SRMA}\xspace with SASRec to justify the effectiveness of the SSL paradigm. The performance curves of HR$@5$ and NDCG$@5$ on the Sports and Toys dataset are demonstrated in Figure~\ref{fig:neuron_masking_sensitity}.
We can observe that the performance improves first and then drops when increasing $p$ from $0$ to $0.9$.
The rising of the performance score implies that the neuron masking augmentation is effective in improving the ability of the sequence encoder for a recommendation.
And the dropping of the performance indicates the intensity of model augmentation should not be overly aggressive, which may lead to less informative contrastive learning.
As to SASRec, we recognize a higher score of SASRec when $p$ is large, which indicates the optimal model augmentation should be a slightly perturbation rather than a intensive distortion.
Moreover, \textsc{SRMA}\xspace consistently outperforms SASRec when $0.1<p<0.6$. Since the only difference is that SASRec has no SSL module, we can thus concludes that the performance gains result from the contrastive SSL step by using the neuron masking.
\begin{figure}
\centering
\includegraphics[width=0.99\linewidth]{./figures/neural_mask.pdf}
\caption{Performance comparison betweeen SASRec and SRMA in HR@5 and NDCG@5 w.r.t different values of neuron masking probability
$p$ on Sports and Toys dataset.
}
\label{fig:neuron_masking_sensitity}
\end{figure}
\textbf{Effect of Layer Dropping.} The layer dropping model augmentation is controlled by two hyper-parameters, the number of additional FFN layers and the number of layers to drop during training, which is denoted as $K$ and $M$, respectively. Since we can only drop those additional layers, we have $M < K$. We select $K$ from $\{1,2,3,4\}$ while $M$ are searched accordingly. Due to space limitation, we only report the NDCG$@5$ on the Sports and Toys dataset in Figure~\ref{fig:layer_dropping}. We observe that $K=2, M=1$ achieves the best performance on both datasets, which implies the efficacy of layer dropping. Additionally, we also find that the performance on $K=4$ is consistently worse than $K=2$ on both datasets, which suggests that adding too many layers increases the complexity of the model, which is thus unable to enhance the SSL paradigm.
\begin{figure}
\centering
\includegraphics[width=0.99\linewidth]{./figures/layer_drop.pdf}
\caption{The NDCG@5 performance w.r.t. different $K$ and $M$ for layer dropping augmentation on Sports and Toys dataset.
}
\label{fig:layer_dropping}
\end{figure}
\subsection{Analyses on Encoder Complementing}
\begin{table*}[htb]
\caption{Performance comparison among SRMA without encoder complementing (w/o Enc.), with Transformer-based (-Trans) and with GRU-based (-GRU) complementary pre-trained encoder. The best score in each column is in bold.}
\vspace{2mm}
\label{tab:ablation-study-ec}
\resizebox{\linewidth}{!}{
\begin{tabular}{c|cc|cc|cc|cc}
\toprule
\multirow{3}{*}{Encoders} & \multicolumn{4}{c|}{Sports}
& \multicolumn{4}{c}{Toys}\\\cline{2-9}
& \multicolumn{2}{c|}{HR} &
\multicolumn{2}{c|}{NDCG} &
\multicolumn{2}{c|}{HR} &
\multicolumn{2}{c}{NDCG} \\
& @5 & @10 & @5 & @10
& @5 & @10 & @5 & @10 \\
\hline
w/o Enc. & 0.0269 & 0.0401 & 0.0181 & 0.0224 & 0.0567 & 0.0806 & 0.0389 & 0.0466 \\
-Trans & 0.0268 & 0.0408 & 0.0181 & 0.0226 & \textbf{0.0588} & \textbf{0.0811} & \textbf{0.0402} & \textbf{0.0474} \\
-GRU & \textbf{0.0281} & \textbf{0.0411} & \textbf{0.0186} & \textbf{0.0228} & 0.0577 & 0.0811 & 0.0395 & 0.047 \\
\bottomrule
\end{tabular}}
\end{table*}
In this section, we investigate the effects of encoder complementing augmentation for constructing views. Recall that we combine the embedding from the model's encoder and a distinct pre-trained encoder.
For this complementary encoder,
we select from a Transformer-based and a
GRU-based encoder. Since the model's encoder is a 2-layer Transformer, this pre-trained encoder is a 1-layer Transformer to maintain diversity.
We first pre-train the complementary encoder based on the next-item prediction task.
As such, we empower the pre-trained encoder to characterize the sequential correlations of items. The comparison is conducted on both Sports and Toys datasets, which are
shown in Table~\ref{tab:ablation-study-ec}. The observations are as follows: Firstly, on the Sports dataset, pre-training a GRU encoder as a complement performs the best against the other two, which indicates that injecting distinct encoders for contrastive learning can enhance the SSL signals.
Secondly, on the Toys dataset, adopting a 1-layer pre-trained Transformer as the complementary encoder yields the best scores on all metrics.
Besides the effectiveness of encoder complementing, this result also suggests that the complementary encoder may not be overly different from the model's encoder on some datasets,
which otherwise cannot enhance the comprehensive contrastive learning between views.
Lastly, both Transformer-based and GRU-based pre-trained complementary encoders consistently outperform \textsc{SRMA}\xspace without encoder complementing,
which directly indicates the necessity of encoder complementing as a way of model augmentation.
\section{Conclusion}
This work proposes a novel contrastive self-supervised learning paradigm,
which simultaneously employs model augmentation and data augmentation to construct views for contrasting. We propose three-level model augmentation methods for this paradigm, which are neuron masking, layer dropping, and encoder complementing.
We adopt this paradigm to the sequential recommendation problem and propose a new model \textsc{SRMA}\xspace.
This model adopts both the random data augmentation of sequences and the corresponding three-level model augmentation for the sequence encoder.
We conduct comprehensive experiments to verify the effectiveness of \textsc{SRMA}\xspace. The overall performance comparison justifies the advantage of contrastive SSL with model augmentation.
Additionally, detailed investigation regarding the impacts of model augmentation and data augmentation in improving the performance are discussed.
Moreover, ablation studies with respect to three-level model augmentation methods are implemented, which also demonstrate the superiority of the proposed model.
Overall, this work opens up a new direction in constructing views from model augmentation.
We believe our proposed model augmentation can enhance existing contrastive SSL paradigms which only have data augmentation.
\newpage
| {'timestamp': '2022-03-30T02:33:09', 'yymm': '2203', 'arxiv_id': '2203.15508', 'language': 'en', 'url': 'https://arxiv.org/abs/2203.15508'} | arxiv |
\section{Introduction}\label{sec:introduction}
The apparent rise in political incivility has attracted substantial attention
from scholars in recent years. These studies have largely focused on the extent
to which politicians and elected officials are increasingly employing rhetoric
that appears to violate norms of civility \cite{herbst2010rude, mutz2015your}.
For the purposes of our work, we use the incidence of offensive rhetoric as a
stand in for incivility.
The 2016 US presidential election was an especially noteworthy case in this
regard, particularly in terms of Donald Trump's campaign which frequently
violated norms of civility both in how he spoke about broad groups in the public
(such as Muslims, Mexicans, and African Americans) and the attacks he leveled at
his opponents \cite{gross2016twitter}. The consequences of incivility are
thought to be crucial to the functioning of democracy since ``public civility
and interpersonal politeness sustain social harmony and allow people who
disagree with one another to maintain ongoing relationships"
\cite{strachan2012political}.
While political incivility appears to be on the rise among elites, it is less
clear whether this is true among the mass public as well. Is political discourse
particularly lacking in civility compared to discourse more generally? Does the
incivility of mass political discourse respond to the dynamics of political
campaigns? Addressing these questions has been difficult for political
scientists because traditional tools for studying mass behavior, such as public
opinion surveys, are ill-equipped to measure how citizens discuss politics with
one another. Survey data does reveal that the public tends to perceive politics
as becoming increasingly less civil during the course of a political campaign
\cite{wolf2012incivility}. Yet, it is not clear whether these perceptions match
the reality, particularly in terms of the types of discussions that citizens
have with each other.
An additional question is how incivility is received by others. On one hand,
violations of norms regarding offensive discourse may be policed by members of a
community, rendering such speech ineffectual. On the other hand, offensive
speech may be effective as a means for drawing attention to a particular
argument. Indeed, there is evidence that increasing incivility in political
speech results in higher levels of attention from the public
\cite{mutz2015your}. During the 2016 campaign, the use of swearing in comments
posted on Donald Trump's YouTube channel tended to result in additional
responses that mimicked such swearing \cite{kwon2017aggression}. Thus, offensive
speech in online fora may attract more attention from the community and lead to
the spread of even more offensive speech in subsequent posts.
To address these questions regarding political incivility, we examine the use of
offensive speech in political discussions housed on Reddit. Scholars tend to
define uncivil discourse as ``communication that violates the norms of
politeness" \cite{mutz2015your} a definition that clearly includes offensive
remarks. Reddit fora represent a ``most likely" case for the study of offensive
political speech due its strong free speech culture \cite{reddit-freespeech} and
the ability of participants to use pseudonymous identities. That is, if
political incivility in the public did increase during the 2016 campaign, this
should be especially evident on fora such as Reddit. Tracking Reddit discussions
throughout all of 2015 and 2016, we find that online political discussions
became increasingly more offensive as the general election campaign intensified.
By comparison, discussions on non-political subreddits did not become
increasingly offensive during this period. Additionally, we find that the
presence of offensive comments did not subside even three months after the
election.
\section{Datasets}\label{sec:datasets}
Our study makes use of multiple datasets in order to identify and characterize
trends in offensive speech.
\myparab{The CrowdFlower hate speech dataset.} The CrowdFlower hate speech
dataset \cite{CrowdFlower-Hate} contains 14.5K tweets, each receiving labels
from at least three contributors. Contributors were allowed to classify each
tweet into one of three classes: {Not Offensive} (NO), {Offensive but not
hateful} (O), and {Offensive and hateful} (OH). Of the 14.5K tweets, only
37.6\% had a decisive class -- \ie the same class was assigned by all
contributors. For indecisive cases, the majority class was selected and a
class confidence score (fraction of contributors that selected the majority
class) was made available. Using this approach, 50.4\%, 33.1\%, and 16.5\% of
the tweets were categorized as NO, O, and OH, respectively. Since our goal is to
identify any offensive speech (not just hate speech), we consolidate assigned
classes into Offensive and Not Offensive by relabeling OH tweets as Offensive.
We use this modified dataset to train, validate, and test our offensive speech
classifier. To the best of our knowledge, this is the only dataset that provides
\emph{offensive} and \emph{not offensive} annotations to a large dataset.
\myparab{Offensive word lists.} We also use two offensive word lists as
auxiliary input to our classifier: (1) The Hatebase hate speech vocabulary
\cite{Hatebase-API} consisting of 1122 hateful words and (2) 422 offensive
words banned from Google's What Do You Love project \cite{Google-WDYL-data}.
\begin{figure}[htb]
\centering
\includegraphics[trim=0cm 0cm 0cm 0cm, clip=true, width=.49\textwidth, angle=0]
{./figures/offensive-speech-results/comments-per-month.png}
\caption{Number of analyzed political and apolitical comments belonging to each
week between January 2015 and January 2017.}
\label{fig:comment-timeline}
\end{figure}
\myparab{Reddit comments dataset.} Finally, after building our offensive speech
classifier using the above datasets, we use it to classify comments made on
Reddit. While the complete Reddit dataset contains 2B comments made between the
period of January 2015 and January 2017, we only analyze only 168M. We select
comments to be analyzed using the following process: (1) we exclude comments
shorter than 10 characters in length, (2) we exclude comments made by
\texttt{[deleted]} authors, and (3) we randomly sample and include 10\% of all
remaining comments. We categorize comments made in any of 21 popular political
subreddits as \emph{political} and the remainder as \emph{apolitical}. Our final
dataset contains 129M apolitical and 39M political comments.
\Cref{fig:comment-timeline} shows the number of comments in our dataset that
were made during each week included in our study. We see an increasing number of
political comments per week starting in February 2016 -- the start of the 2016
US presidential primaries.
\section{Offensive Speech Classification}\label{sec:classifier}
In order to identify offensive speech, we propose a fully automated technique
that classifies comments into two classes: Offensive and Not Offensive.
\subsection{Classification approach}
At a high-level, our approach works as follows:
\begin{itemize}
\item \textbf{Build a word embedding.} We construct a 100-dimensional word
embedding using all comments from our complete Reddit dataset (2B comments).
\item \textbf{Construct a \emph{hate vector}.} We construct a list of offensive
and hateful words identified from external data and map them into a single
vector within the high-dimensional word embedding.
\item \textbf{Text transformation and classification.} Finally, we transform
text to be classified into scalars representing their distance from the
constructed hate vector and use these as input to a Random Forest classifier.
\end{itemize}
\myparab{Building a word embedding.} At a high-level, a word embedding maps
words into a high-dimensional continuous vector space in such a way that
semantic similarities between words are maintained. This mapping is achieved by
exploiting the distributional properties of words and their occurrences in the
input corpus.
Rather than using an off-the-shelf word embedding (\eg the GloVe embeddings
\cite{Pennington-2014} trained using public domain data sources such as
Wikipedia and news articles), we construct a 100-dimensional embedding using the
complete Reddit dataset (2B comments) as the input corpus. The constructed
embedding consists of over 400M unique words (words occurring less than 25 times
in the entire corpus are excluded) using the Word2Vec \cite{Mikolov-2013}
implementation provided by the Gensim library \cite{Rehurek-2010}. Prior to
constructing the embedding, we perform stop-word removal and lemmatize each word
in the input corpus using the SpaCy NLP framework \cite{Honnibal-2015}. The main
reason for building a custom embedding is to ensure that our embeddings capture
semantics specific to the data being measured (Reddit) -- \eg while the word
``\emph{karma}'' in the non-Reddit context may be associated with spirituality,
it is associated with points (comment and submission scores) on Reddit.
\myparab{Constructing a hate vector.} We use two lists of words associated with
hate \cite{Hatebase-API} and offensive \cite{Google-WDYL-data} speech to
construct a hate vector in our word embedding. This is done by mapping each word
in the list into the 100-dimensional embedding and computing the mean
vector. This vector represents the average of all known offensive words. The
main idea behind creating a hate vector is to capture the point (in our
embedding) to which the most offensive observed comments are likely to be near.
Although clustering our offensive word lists into similar groups and
constructing multiple hate vectors -- one for each cluster -- results in
marginally better accuracy for our classifier, we use this approach due to the
fact that our classification cost grows linearly with the number of hate vectors
-- \ie we need to perform $O(|S|)$ distance computations per hate vector to
classify string $S$.
\begin{figure}[t]
\centering
\includegraphics[trim=0cm 0cm 0cm 0cm, clip=true, width=.49\textwidth, angle=0]
{./figures/classifier-visualization/offensive-classifier-visualization.png}
\caption{Proximity of offensive and non-offensive comments to the hate vector.
Dimension reduction is performed using t-SNE.}
\label{fig:reduced-dimension-classes}
\end{figure}
\myparab{Transforming and classifying text.} We first remove stop-words and
perform lemmatization of each word in the text to be classified. We then obtain
the vector representing each word in the text and compute its similarity to the
constructed hate vector using the cosine similarity metric. A 0-vector is used
to represent words in the text that are not present in the embedding. Finally,
the maximum cosine similarity score is used to represent the comment.
Equation \ref{eq:text-xform} shows the transformation function on a string $S$ =
$\{s_1, \dots, s_n\}$ where $s_i$ is the vector representing the $i^{th}$
lemmatized non-stop-word, $\cos$ is the cosine-similarity function, and $H$ is
the hate vector.
\begin{equation}
T(S) = \max_{1 \leq i \leq n}[\cos(s_i, H)]
\label{eq:text-xform}
\end{equation}
In words, the numerical value assigned to a text is the cosine similarity
between the hate vector and the vector representing the word (in the text)
closest to the hate vector. This approach allows us to transform a string of
text into a single numerical value that captures its semantic similarity to the
most offensive comment. We use these scalars as input to a random forest
classifier to perform classification into Offensive and Not Offensive classes.
\Cref{fig:reduced-dimension-classes} shows the proximity of Offensive and Non
Offensive comments to our constructed hate vector after using t-distributed
Stochastic Neighbor Embedding (t-SNE) \cite{Maaten-2008} to reduce our
100-dimension vector space into 2 dimensions.
\subsection{Classifier evaluation}
We now present results to (1) validate our choice of classifier and (2)
demonstrate the impact of training/validation sample count on our classifiers
performance.
\begin{table}[h]
\centering
\resizebox{\linewidth}{!}{%
\begin{tab}{lll}
\textbf{Classifier} & \textbf{Accuracy (\%)} & \textbf{F1-Score (\%)} \\
\midrule
Stochastic Gradient Descent & 80.7 & 80.0 \\
Naive Bayes & 81.5 & 81.2 \\
Decision Tree & 91.8 & 91.4 \\
\textbf{Random Forest} & \textbf{92.0} & \textbf{91.9} \\
\end{tab}
}
\caption{Average classifier performance during 10-fold cross-validation on
the training/validation set. Results shown are for the best performing
parameters obtained using a grid search.}
\label{tab:classifiers}
\end{table}
\myparab{Classifier selection methodology.}
To identify the most suitable classifier for classifying the scalars associated
with each text, we perform evaluations using the stochastic gradient descent,
naive bayes, decision tree, and random forest classifiers. For each classifier,
we split the CrowdFlower hate speech dataset into a training/validation set
(75\%), and a holdout set (25\%). We perform 10-fold cross-validation on the
training/validation set to identify the best classifier model and parameters
(using a grid search). Based on the results of this evaluation, we select a
100-estimator entropy-based splitting random forest model as our classifier.
\Cref{tab:classifiers} shows the mean accuracy and F1-score for each evaluated
classifier during the 10-fold cross-validation.
\myparab{Real-world classifier performance.}
To evaluate real-world performance of our selected classifier (\ie performance
in the absence of model and parameter bias), we perform classification of the
holdout set. On this set, our classifier had an accuracy and F1-score of 89.6\%
and 89.2\%, respectively. These results show that in addition to superior
accuracy during training and validation, our chosen classifier is also robust
against over-fitting.
\begin{figure}[tbp]
\centering
\begin{minipage}{.49\textwidth}
\begin{subfigure}{\textwidth}
\includegraphics[trim=0cm .5cm 0cm 0cm, clip=true, width=\textwidth, angle=0]
{./figures/classifier-performance/hsv-rf-accuracy.png}
\caption{Classifier accuracy.}
\label{fig:classifier-accuracy}
\end{subfigure}
\begin{subfigure}{\textwidth}
\includegraphics[trim=0cm .5cm 0cm 0cm, clip=true, width=\textwidth, angle=0]
{./figures/classifier-performance/hsv-rf-precision.png}
\caption{Classifier precision.}
\label{fig:classifier-precision}
\end{subfigure}
\begin{subfigure}{\textwidth}
\includegraphics[trim=0cm .5cm 0cm 0cm, clip=true, width=\textwidth, angle=0]
{./figures/classifier-performance/hsv-rf-recall.png}
\caption{Classifier recall.}
\label{fig:classifier-recall}
\end{subfigure}
\end{minipage}
\caption{Classifier performance on holdout sets while varying holdout set sizes
and minimum confidence thresholds.}
\label{fig:classifier-performance}
\end{figure}
\myparab{Impact of dataset quality and size.}
To understand how the performance of our chosen classifier model and parameters
are impacted by: (1) the quality and consistency of manually assigned classes in
the CrowdFlower dataset and (2) the size of the dataset, we re-evaluate the
classifier while only considering tweets having a minimum confidence score and
varying the size of the holdout set. Specifically, our experiments considered
confidence thresholds of 0 (all tweets considered), .35 (only tweets where at
least 35\% of contributors agreed on a class were considered), and .70 (only
tweets where at least 70\% of the contributors agreed on a class were
considered) and varied the holdout set sizes between 5\% and 95\% of all tweets
meeting the confidence threshold set for the experiment.
The results illustrated in \Cref{fig:classifier-performance} show the
performance of the classifier while evaluating the corresponding holdout set. We
make several conclusions from these results:
\begin{itemize}
\item Beyond a (fairly low) threshold, the size of the training and validation
set has little impact on classifier performance. We see that the accuracy,
precision, and recall have, at best, marginal improvements with holdout set sizes
smaller than 60\%. This implies that the CrowdFlower dataset is sufficient for
building an offensive speech classifier.
\item Quality of manual labeling has a significant impact on the accuracy and
precision of the classifier. Using only tweets which had at least 70\% of
contributors agreeing on a class resulted in between 5-7\% higher accuracy and
up to 5\% higher precision.
\item Our classifier achieves precision of over 95\% and recall of over 85\%
when considering only high confidence samples. This implies that the classifier
is more likely to underestimate the presence of offensive speech -- \ie our
results likely provide a lower-bound on the quantity of observed offensive
speech.
\end{itemize}
\section{Measurements}\label{sec:measurement}
In this section we quantify and characterize offensiveness in the political and
general contexts using our offensive speech classifier and the Reddit comments
dataset which considers a random sample of comments made between January 2015
and January 2017.
\myparab{Offensiveness over time.}
We find that on average 8.4\% of all political comments are offensive compared
to 7.8\% of all apolitical comments. \Cref{fig:offensive-speech-timeline}
illustrates the fraction of offensive political and apolitical comments made
during each week in our study. We see that while the fraction of apolitical
offensive comments has stayed steady, there has been an increase in the fraction
of offensive political comments starting in July 2016. Notably, this increase is
observed after the conclusion of the US presidential primaries and during the
period of the Democratic and Republican National Conventions and does not reduce
even after the conclusion of the US presidential elections held on November 8.
Participants in political subreddits were 2.6\% more likely to observe offensive
comments prior to July 2016 but 14.9\% more likely to observe offensive comments
from July 2016 onwards.
\begin{figure}[ht]
\centering
\includegraphics[trim=0cm 0cm 0cm 0cm, clip=true, width=.49\textwidth, angle=0]
{./figures/offensive-speech-results/offensive-comments-per-month-fraction.png}
\caption{Fraction of offensive comments identified in political and all
subreddits.}
\label{fig:offensive-speech-timeline}
\end{figure}
\myparab{Reactions to offensive comments.} We use the comment \emph{score},
roughly the difference between up-votes and down-votes received, as a proxy for
understanding how users reacted to offensive comments. We find that comments
that were offensive: (1) on average, had a higher score than non-offensive
comments (average scores: 8.9 \vs 6.7) and (2) were better received when they
were posted in the general context than in the political context (average
scores: 8.6 \vs 9.0). To understand how peoples reactions to offensive comments
evolved over time, \Cref{fig:offensive-scores-timeline} shows the average scores
received by offensive comments over time. Again, we observe an increasing trend
in average scores received by offensive and political comments after July 2016.
\begin{figure}[ht]
\centering
\includegraphics[trim=0cm 0cm 0cm 0cm, clip=true, width=.49\textwidth, angle=0]
{./figures/offensive-speech-results/offensive-comments-per-month-scores.png}
\caption{Average scores of offensive comments identified in political and all
subreddits.}
\label{fig:offensive-scores-timeline}
\end{figure}
\myparab{Characteristics of offensive authors.}
We now focus on understanding characteristics of authors of offensive comments.
Specifically, we are interested in identifying the use of \emph{throwaway} and
\emph{troll} accounts. For the purposes of this study, we characterize
\emph{throwaway} accounts as those with less than five total comments -- \ie
accounts that are used to make a small number of comments. Similarly, we define
\emph{troll} accounts as those with over 15 comments of which over 75\% are
classified as offensive -- \ie accounts that are used to make a larger number of
comments, of which a significant majority are offensive. We find that 93.7\% of
the accounts which have over 75\% of their comments tagged as offensive are
throwaways and 1.3\% are trolls. Complete results are illustrated in
\Cref{fig:offensive-authors-cdf}.
\begin{figure}[ht]
\centering
\includegraphics[trim=0cm 0cm 0cm 0cm, clip=true, width=.49\textwidth, angle=0]
{./figures/offensive-speech-results/offensive-comments-author-cdf.png}
\caption{CDF of the fraction of each authors comments that were identified as
offensive. Green, orange, and red dots are used to represent authors with $<$5,
5-15, and $>$15 total comments, respectively. The legend provides a breakdown
per quartile.}
\label{fig:offensive-authors-cdf}
\end{figure}
\myparab{Characteristics of offensive communities.} We breakdown subreddits
by their category (default, political, and other) and identify the most and
least offensive communities in each. \Cref{fig:subreddit-cdf} shows the
distribution of the fraction of offensive comments in each category and
\Cref{tab:subreddit-breakdown} shows the most and least offensive subreddits in
the political and default categories (we exclude the ``other'' category due to
the inappropriateness of their names). We find that less than 19\% of all
subreddits (that account for over 23\% of all comments) have over 10\%
offensive comments. Further, several default and political subreddits fall in
this category, including {\tt r/the$\_$donald} -- the most offensive political
subreddit and the subreddit dedicated to the US President.
\begin{figure}[ht]
\centering
\includegraphics[trim=0cm 0cm 0cm 0cm, clip=true, width=.49\textwidth, angle=0]
{./figures/offensive-speech-results/offensive-comments-subreddit-cdf.png}
\caption{Distribution of the fraction of offensive comments observed in each
subreddit category. Only subreddits with over 1000 comments are considered.}
\label{fig:subreddit-cdf}
\end{figure}
\begin{table}[th]
\centering
\resizebox{\linewidth}{!}{%
\begin{tab}{lll}
\textbf{Category} & \textbf{Most offensive (\%)} & \textbf{Least offensive (\%)} \\
\midrule
Default & {\tt r/tifu} (15.1\%) & {\tt r/askscience} (2.4\%) \\
& {\tt r/announcements} (13.2\%) & {\tt r/personalfinance} (3.4\%)\\
& {\tt r/askreddit} (11.0\%) & {\tt r/science} (3.8\%)\\\midrule
Political & {\tt r/the$\_$donald} (11.4\%) & {\tt r/republican} (4.4\%)\\
& {\tt r/elections} (10.2\%) & {\tt r/sandersforpresident} (4.9\%)\\
& {\tt r/worldpolitics} (9.8\%) & {\tt r/tedcruz} (5.1\%)\\
\end{tab}
}
\caption{Subreddits in the default and political categories with the highest and
lowest fraction of offensive comments.}
\label{tab:subreddit-breakdown}
\end{table}
\myparab{Flow of offensive authors.} Finally, we uncover patterns in the
movement of offensive authors between communities. In \Cref{fig:offensive-flow}
we show the communities in which large number of authors of offensive content
on the \texttt{r/politics} subreddit had previously made offensive comments (we
refer to these communities as sources). Unsurprisingly, the most popular sources
belonged to the default subreddits (\eg ~{\tt r/worldnews}, {\tt r/wtf}, {\tt
r/videos}, {\tt r/askreddit}, and {\tt r/news}). We find that several other
political subreddits also serve as large sources of offensive authors. In fact,
the subreddits dedicated to the three most popular US presidential candidates
-- {\tt r/the$\_$donald}, {\tt r/sandersforpresident}, and {\tt
r/hillaryclinton} rank in the top three. Finally, outside of the default and
political subreddits, we find that {\tt r/nfl}, {\tt r/conspiracy}, {\tt
r/dota2}, {\tt r/reactiongifs}, {\tt r/blackpeopletwitter}, and {\tt
r/imgoingtohellforthis} were the largest sources of offensive political authors.
\begin{figure}[ht]
\centering
\includegraphics[trim=.5cm 2cm 0cm 0cm, clip=true, width=.5\textwidth, angle=0]
{./figures/offensive-speech-results/network-effect-politics-only.png}
\caption{Flow of offensive authors. An edge between two subreddits indicates
that authors made offensive comments in the source subreddit before the first
time they made offensive comments in the destination subreddit. Darker and
thicker edges indicate larger flow sizes (only flows $\ge 200$ authors are
shown).}
\label{fig:offensive-flow}
\end{figure}
\section{Conclusions and Future Work}\label{sec:conclusions}
We develop and validate an offensive speech classifier to quantify the presence
of offensive online comments from January 2015 through January 2017. We find
that political discussions on Reddit became increasingly less civil -- as
measured by the incidence of offensive comments -- during the 2016 general
election campaign. In fact, during the height of the campaign, nearly one of
every 10 comments posted on a political subreddit were classified as offensive.
Offensive comments also received more positive feedback from the community, even
though most of the accounts responsible for such comments appear to be
throwaway accounts. While offensive posts were increasingly common on political
subreddits as the campaign wore on, there was no such increase in non-political
fora. This contrast provides additional evidence that the increasing use of
offensive speech was directly related to the ramping up of the general election
campaign for president.
Even though our study relies on just a single source of
online political discussions -- Reddit, we believe that our findings generally
present an upper-bound on the incidence of offensiveness in online political
discussions for the following reasons: First, Reddit allows the use of
pseudonymous identities that enables the online disinhibition effect (unlike
social-media platforms such as Facebook). Second, Reddit enables users to engage
in complex discussions that are unrestricted in length (unlike Twitter).
Finally, Reddit is known for enabling a general culture of free speech and
delegating content regulation to moderators of individual subreddits. This
provides users holding fringe views a variety of subreddits in which their
content is welcome.
Our findings provide a unique and important mapping of the increasing incivility
of online political discourse during the 2016 campaign. Such an investigation is
important because scholars have outlined many consequences for incivility in
political discourse. Incivility tends to ``turn off'' political moderates,
leading to increasing polarization among those who are actively engaged in
politics \cite{wolf2012incivility}. More importantly, a lack of civility in
political discussions generally reduces the degree to which people view
opponents as holding legitimate viewpoints. This dynamic makes it difficult for
people to find common ground with those who disagree with them
\cite{mutz2006hearing} and it may ultimately lead citizens to view electoral
victories by opponents as lacking legitimacy \cite{mutz2015your}. Thus, from a
normative standpoint, the fact that the 2016 campaign sparked a marked increase
in the offensiveness of political comments posted to Reddit is of concern in its
own right; that the incidence of offensive political comments has remained high
even three months after the election is all the more troubling.
In future work, we will extend our analysis of Reddit back to 2007 with the aim
of formulating a more complete understanding of the dynamics of political
incivility. For example, we seek to understand whether the high incidence of
offensive speech we find in 2016 is unique to this particular campaign or if
previous presidential campaigns witnessed similar spikes in incivility. We will
also examine whether there is a more general long-term trend toward offensive
online political speech, which would be consistent with what scholars have found
when studying political elites \cite{shea2012rise, jamieson2000continuity}.
\bibliographystyle{plain}
| {'timestamp': '2017-07-20T02:08:33', 'yymm': '1706', 'arxiv_id': '1706.01875', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01875'} | arxiv |
\section{Introduction}
\IEEEPARstart{A}{ccording} to the World Health Organization, breast cancer is one of the most frequent cancer diseases in the world \cite{Stewart2014}. To provide more effective treatment and reduce the death rate, early
detection of breast cancer must be carried out. Despite the fact that different diagnostic tools can be used
to detect breast cancer, there is a growing interest in use of ultrasound imaging. Ultrasound is known
for being non-invasive, relatively non-expensive and broadly accessible. As opposed to mammography
which is not sensitive in the case of women with dense breast. As it was demonstrated in several studies \cite{Kolb2002, Stavros1995, Zhi2007}, ultrasound can be successfully used for breast cancer detection. However, diagnosis conducted by
means of ultrasound imaging requires experienced radiologists who know how to efficiently operate ultrasound
scanner and possess knowledge of breast cancer heterogeneity and its complex characteristic
features appearing on ultrasound images. Therefore, many unnecessary biopsies are performed.
To
standardize the reporting process and diagnosis, American College of Radiology developed a quality
control system called BI-RADS (Breast Imaging – Reporting and Data System) which is now widely
accepted and used by physicians \cite{Bott2014}. After the interpretation of the lesion ultrasound image, a specific BIRADS
category is assigned which reflects the risk of malignancy. However, this assessment still
depends on the ultrasonographer’s experience and his ability to interpret the ultrasound image correctly.
Therefore, computer-aided diagnosis (CAD) systems are investigated to improve the breast lesion
classification and support physicians, especially the inexperienced ones.
The main goal of CAD is to develop a computer program which would be able to differentiate
breast lesions based on ultrasound images analysis \cite{Cheng2010}. The common approach is to extract features
from the image which contains the lesion and then develop a classifier using machine learning methods.
Well-chosen features are the most important part of every CAD system. So far, various sets of features
were proposed in the literature for the breast lesion classification. Those features are primarily divided into two categories, namely the
texture and the morphological features. Nowadays, morphological features are considered to be the most
effective in breast cancer classification \cite{GomezFlores2015}, though good performance was also reported for other features.
Morphological features assess lesion contour. Generally, more irregular contour is expected in the case
of malignant lesions.
Morphological features have some indisputable advantages, especially in comparison with
texture features. They are less affected by image processing algorithms used for B-mode image
reconstruction. Many CAD systems were developed based on B-mode images acquired with a single
ultrasound machine. However, usually little is known of the image reconstruction algorithms
implemented in the scanner. Most of the ultrasound image enhancing algorithms intensively process
texture \cite{ContrerasOrtiz2012} which may have negative impact on the classification performed with texture features. On the
contrary, edge preservation and emphasis is one of the main goals of image processing algorithms what
places morphological features in a far better position than texture features. Texture features depend on
operator and particular machine settings, e.g. focal depth positioning \cite{Garra1993}. Estimation of these features can
be affected additionally by the presence of calcifications or necrosis within the lesion \cite{Byra2016, Larrue2014917}.
The aim of this work is to combine the BI-RADS with morphological features to
improve the classification. CAD papers usually don’t utilize BI-RADS categories which were assigned
by the radiologist. This practice is understandable. While the process of features extraction is well
defined mathematically, the assignation of a specific BI-RADS category depends on radiologist’s
experience. This subjective assessment may affect the CAD system performance and make the
comparison with other CAD systems problematic. On the other hand, it is of great importance to
investigate whether a CAD system can support physicians. The widely used BI-RADS has its
limitations which might be overcome with the CAD. Here, we investigate whether the morphological
features can improve the BI-RADS classification performance or if they are rather redundant. First, the
radiologist assigned the BI-RADS category to each lesion. Next, to improve the classification
morphological features were chosen and combined with the BI-RADS. The performance of the
combined classifier was compared with the BI-RADS and the best performing morphological
feature subset.
This paper is organized in a following way. In the first section, the breast lesion database and
the acquisition procedure are described. Next, we give a list of investigated morphological features
including the papers in which they were originally proposed or later used. We present the scheme for
feature selection. Then, we present the best performing feature subset. The same scheme is used to find
which morphological features may improve the performance of BI-RADS. Finally, we discuss results
and present conclusions.
\section{Materials and Methods}
\subsection{Dataset and preprocessing}
The database consists of 214 images of 107 solid lesions, 75 of which are benign and 32
malignant. For each lesion, two perpendicular scan planes were acquired during routine breast diagnostic
procedures. Ultrasonix scanner (Ultrasonix Inc., Canada) equipped with a linear array probe L14-5/38
was used to collect the data. The focal depth was positioned at the center of each lesion. The imaging
frequency was set to 7.5 MHz. Each lesion was biopsy proven. First, however, a specific BI-RADS
category was assigned by the radiologist with 17 years’ experience in ultrasonic diagnosis of breast
lesions. The BI-RADS has 7 categories which reflect the likelihood of malignancy \cite{Bott2014, W.2012}:
\begin{table}[b]
\centering
\caption{Breast lesions BI-RADS categories.}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
BI-RADS & 3 & 4a & 4b & 4c & 5 \\ \hline
Benign & 41 & 19 & 14 & 0 & 1 \\ \hline
Malignant & 0 & 1 & 5 & 6 & 20 \\ \hline
\end{tabular}
\end{table}
\begin{itemize}
\item 0: incomplete
\item 1: negative
\item 2: benign
\item 3: probably benign
\item 4: suspicious (4a - low suspicious, 4b - intermediate suspictious, 4c - moderate suspicious)
\item 5: probably malignant
\item 6: malignant
\end{itemize}
\begin{table}[b!]
\centering
\caption{Implemented morphological features.}
\begin{tabular}{|c|l|}
\hline
Number & Feature \\ \hline
1 & Angular characteristics \cite{Shen2007} \\ \hline
2 & Area ratio \cite{Alvarenga2012, Alvarenga2010, Chou2001}\\ \hline
3 & Aspect ratio \cite{Chang2005} \\ \hline
4 & Branch pattern \cite{Joo2004} \\ \hline
5 & Circularity \cite{Chang2005, Alvarenga2010, Chou2001, Drukker2004a, Kim2002, Drukker2005}\\ \hline
6 & Contour roughness \cite{Alvarenga2012, Alvarenga2010, Chou2001} \\ \hline
7 & Convexity \cite{Chang2005}\\ \hline
8 & DWR \cite{Drukker2004a, Drukker2002, Drukker2005, Horsch2002a, Chen2003, Chen2004} \\ \hline
9 & Ellipsoidal shape \cite{Joo2004, Su2011}\\ \hline
10 & Elliptic-normalized circumference \cite{Chen2003}\\ \hline
11 & Elliptic-normalized skeleton \cite{Chen2003}\\ \hline
12 & Extent \cite{Chang2005} \\ \hline
13 & Lesion size \cite{Chen2003}\\ \hline
14 & Lobulation index \cite{Chen2003}\\ \hline
15 & Long to short axis ratio \cite{Chen2003}\\ \hline
16 & Morphological closing ratio \cite{Alvarenga2010}\\ \hline
17 & Normalized residual value \cite{Alvarenga2010}\\ \hline
18 & NRL entropy \cite{Chou2001}\\ \hline
19 & NRL mean \cite{Chou2001}\\ \hline
20 & NRL standard deviation \cite{Alvarenga2012, Alvarenga2010, Chou2001}\\ \hline
21 & NRL zero-crossing \cite{Chou2001}\\ \hline
22 & Number of lobulations \cite{Joo2004, Su2011}\\ \hline
23 & Number of substantial protuberances and depressions \cite{Chen2003}\\ \hline
24 & Orientation \cite{Shen2007}\\ \hline
25 & Overlap ratio \cite{Alvarenga2010}\\ \hline
26 & Roundness \cite{Chang2005}\\ \hline
27 & Shape class \cite{Shen2007, Minavathi2012}\\ \hline
28 & Solidity \cite{Chang2005} \\ \hline
29 & Spiculation \cite{Joo2004, Su2011}\\ \hline
30 & Undulation characteristics \cite{Shen2007} \\ \hline
\end{tabular}
\end{table}
\noindent In our study, BI-RADS categories of the lesions varied from 3 to 5 as it is depicted in Table 1.
Initial contour was indicated by the physician and subsequently improved with a computer
algorithm \cite{Chan2001}, see Fig. 1. All calculations were performed in Matlab (The MathWorks Inc.)
\subsection{Features}
\begin{figure*}[t!]
\centering
\includegraphics[width=6in]{fig1.jpg}%
\caption{The contour drawn manually a) and the contour improved with the computer algorithm b).}
\label{fig1}
\hfil
\end{figure*}
We implemented 30 morphological features, which are listed in Table 2. For each feature, papers
in which it was developed or used are mentioned. Here, we describe the most popular features. However,
for an in-depth analysis, reader is referred to the cited works.
Depth to width ratio (DWR) is perhaps the most frequently used morphological feature. It is
easy to calculate and was reported to be effective in many papers. The depth and the width are the
dimensions of the minimal circumscribed rectangle which contains the lesion. Some papers use the
inversion of the DWR \cite{Chang2005}, but here it will not be treated as a separate feature. A feature similar to the
DWR is the long to short axis ratio of the ellipse inscribed in the lesion contour.
The normalized radial length (NRL) is defined by the following equation:
\begin{equation}
d_n(i) = \frac{d(i)}{\text{max}[d(i)]}
\end{equation}
\noindent where $d(i)$ is the distance from the lesion’s center of mass to $i$-th point on its perimeter. The NRL is
used to obtain features which measure various properties of the contour, see positions 2, 6, 18-21 in
Table 2.
Some features, namely 7, 17, 23, 25 and 28, are based on the convex hull of the lesion. These
features were introduced to measure the level of spiculations which is reflected by the protuberance of
the contour.
To take into account that we possess two scans of the same lesion, each feature was calculated
for both scan plane and results were averaged.
\subsection{Classification and evaluation}
We explore the performance of morphological features in multiple ways. As it was shown in
several papers \cite{GomezFlores2015, daoud2016fusion}, there is no single feature which would alone outperform the others, therefore features
must be combined in order to improve the classification. However, for a large number of features it is
problematic to perform an exhaustive search for the best performing subset due to a large number of all
potential combinations. Here, we used a two-step approach to find the best subset for classification. The
goal was to maximize the area under the curve (AUC) of the receiver operating characteristics (ROC).
In the first step, the best performing feature (the highest value of AUC) was chosen. Next, the first feature was combined with the remaining features in order to select the best performing subset of two
features. This forward selection procedure was repeated until the feature pool was empty. We decided
to maximize the AUC because this quantity is after all usually used for classification performance
assessment. To evaluate AUC we applied the leave-one-out cross-validation. Logistic regression was
used to perform classification. Before the training, features were standardized. To address the class
imbalance, during cost function minimization, sampling weights were inversely proportional to class
frequencies in training set. For each test sample the probability of malignancy was calculated. The
AUC standard deviation was calculated with the bootstrap method. Next, we performed the second step
of the feature selection procedure which was the backward selection. Supposedly, different feature
subsets may have similar AUC values. In this case, we selected the best performing subset, the one with
the highest AUC value. Next, the ANOVA analysis along with the Tukey test were used to find a subset
with a smaller number of features and likely the same mean AUC value as the best-performing subset
at 95\% confidence level.
With the above feature selection methodology, first the best morphological feature subset was
selected. Next, the BI-RADS was combined with morphological features. However, to use the
BI-RADS category as a feature, some kind of transformation must be performed. In our case the BI-RADS was
treated as a discrete feature which can be coded with integers. We used the following scheme: integer 1
stands for BI-RADS category 1, 2 for 2, 3 for 3, 4 for 4a, 5 for 4b, 6 for 4c, 7 for 5 and 8 for 6,
respectively.
\section{Results}
\begin{figure*}[]
\centering
\includegraphics[width=5.5in]{fig2.jpg}%
\caption{AUC estimation ($\pm$ standard deviation) for features ranked with the proposed criterion: a) morphological features and b) morphological features with the BI-RADS.}
\label{fig2}
\hfil
\end{figure*}
The feature selection procedure is depicted in Fig. 2. The highest value of AUC in the case of
morphological features, see Fig.2 a), was obtained for a set of seven features, however the ANOVA
analysis showed that there is no significant difference between this set and a subset containing six
features. Therefore, the smaller subset was selected as the best performing. It consisted of six features
which were the DWR, NRL entropy, normalized residual value, overlap ratio, extent and the
morphological closing ratio. Similar analysis was performed to combine the BI-RADS with
morphological features. The highest AUC was obtained for a 13 feature subset (including BI-RADS) which was then reduced to seven. Features which, when added to the BI-RADS, improved the
classification most, were the extent, overlap ratio, NRL entropy, circularity, elliptic-normalized
circumference and the normalized residual value.
Main results are depicted in Table 3. The use of the best performing morphological feature
subset and the BI-RADS resulted in the AUC values of 0.901 and 0.944, respectively. The classification
was improved when the BI-RADS and morphological features were combined. With six features added
to the BI-RADS, the AUC value increased to 0.986. Fig. 3 shows the ROC curves obtained for the
developed classifiers. The optimal sensitivity, specificity and accuracy of each classifier was determined
by means of the ROC curve for the point which was the closest to (0, 1) \cite{Fawcett2006}.
\begin{table*}[]
\centering
\caption{The summary. Numeration of morphological features according to Table 2.}
\begin{tabular}{|c|c|c|c|}
\hline
Features & Sensitivity [\%] & Specificity [\%] & Accuracy [\%] \\ \hline
Morphological, optimal cut-off & 75.0 & 88.0 & 84.1 \\ \hline
Combination, optimal cut-off & 96.8 & 94.7 & 95.3 \\ \hline
Morphological, customized cut-off & 100 & 58.7 & 71.0 \\ \hline
Combination, customized cut-off & 100 & 74.7 & 82.2 \\ \hline
BI-RADS cat. 3 cut-off & 100 & 54.7 & 68.2 \\ \hline
\end{tabular}
\end{table*}
In the case of the breast lesion classification, it is important to have as high sensitivity as possible
to detect all malignant lesions. According to Table 1 in the case of the BI-RADS, 100\%
sensitivity could only be obtained when lesions with the BI-RADS category higher than 3 were classified
as malignant. The corresponding specificity was 54.7\%. Taking this into consideration, the thresholds of
the classifiers were customized based on ROC curves to ensure 100\% sensitivity and the corresponding
accuracies and specificities were calculated. Results are depicted in Table 3. The specificity of the best
performing morphological features subset was 58.7\%, similarly to the BI-RADS. Moreover, with
the combined classifier it was possible to obtain 100\% sensitivity and specificity of 74.7\%. Table 4 shows
how many biopsies could be avoided in the case of benign lesions by using various classifiers with cut-offs
ensuring 100\% sensitivity.
\section{discussion}
With the use of morphological features it was possible to differentiate between malignant and
benign breast lesions. The best performing feature subset achieved AUC value of 0.901. However, this
result was worse than in the case of the BI-RADS for which AUC value was 0.944. The classifier based
on the morphological features could not outperform the radiologist who assigned the BI-RADS categories.
It must be emphasized that the BI-RADS depends on the physician’s experience and for a novice
radiologist the BI-RADS performance could be lower than the performance of the CAD system.
However, both AUC values, obtained for the BI-RADS and for the morphological features, should be
considered satisfactory.
\indent The best morphological subset consisted of six features which were the DWR, NRL entropy, normalized residual value, overlap ratio, extent and the morphological closing ratio. The DWR was
reported as the best feature for breast lesion classification in several papers \cite{Drukker2004a, Drukker2002, Drukker2005, Horsch2002a, Chen2003, Chen2004}. NRL entropy is higher
for lesions which have irregular contour. The normalized residual value was indicated as the best feature
for breast lesion classification in \cite{Alvarenga2010}. This feature is based on the difference between the lesion convex
hull area and the regular area which was normalized by convex hull perimeter. The overlap
ratio is the ratio of the convex hull area and the lesion area. It measures contour irregularity and was reported
as one of the best features in original work \cite{Alvarenga2010}. The extent is the ratio of lesion area to the smallest rectangle
inscribed in it. The morphological closing ration tends to be greater for lesions which have irregular
contour \cite{Alvarenga2010}.
\begin{figure}[]
\centering
\includegraphics[width=.5\textwidth]{fig3.jpg}%
\caption{ROC curves for the BI-RADS, morphological features and the combination.}
\label{fig3}
\hfil
\end{figure}
\begin{table}
\centering
\caption{Number of benign lesions and biopsies that could be possible avoided in the case of each classifier.}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
BI-RADS & 3 & 4a & 4b & 4c & 5 & Sum \\ \hline
Nr of benign lesions & 41 & 19 & 14 & 0 & 1 & 75 \\ \hline
Combined classifier & 0 & 1 & 5 & 6 & 20 & 56 \\ \hline
Best morphological & 41 & 19 & 14 & 0 & 1 & 44 \\ \hline
BI-RADS cat. 3 cut-off & 0 & 1 & 5 & 6 & 20 & 41 \\ \hline
\end{tabular}
\end{table}
According to the survey investigating the performance of various features, the best
morphological features for the breast lesion classification are the elliptic-normalized skeleton, lesion
orientation, the number of substantial protuberances and depressions, DWR and the overlap ratio \cite{GomezFlores2015}. For
this set, the reported AUC value was 0.94. In our case, the use of the proposed features lead to the AUC
value of 0.871. This difference may be due to the dataset. However, this particular performance should
also be perceived as good. The main doubt lies in the choice of the lesion orientation. This feature
measures the angle of major axis of above lesion best-fit ellipse and is extremely operator dependent
since the motion of the imaging probe may easily change it. In our study, the calculated AUC value for
the orientation was 0.532. Similar result was reported in the original study \cite{Shen2007} where this feature had
negligible impact on the classification and was the first one to be removed from the feature pool when
applying backward remove feature selection method.
A great advantage of morphological features is revealed when they are combined with the BIRADS.
It was possible to increase the AUC value to 0.986 by adding six features, namely the extent,
overlap ratio, NRL entropy, circularity, elliptic-normalized circumference and the normalized residual
value. The circularity is the ratio of a lesion squared perimeter and the lesion area \cite{Alvarenga2012}. The elliptic normalized
circumference quantify the anfractuosity of a lesion contour \cite{Chen2003}.
One of the main goals of breast lesion classification is to have 100\% sensitivity and as high
specificity as possible to indicate benign lesions and reduce the number of unnecessary biopsies. In
our study, as all lesions were biopsy proven, therefore their evaluation must be considered problematic
for the radiologist. The first advantage of the combined classifier is that it can be used directly to support
the radiologist in the process of decision making. First, the radiologist assigns a specific BI-RADS
category to the lesion, then the combined classifier containing the morphological features is used to
indicate the level of malignancy. The decision of the radiologist is improved be means of morphological
features. The morphological features are used to separate malignant and benign lesions that were
assigned the same BI-RADS category. As it is shown in Fig. 3, 100\% sensitivity was obtained with high
specificity of 74.7\%, much higher than in the case of the BI-RADS alone. According to Table 4, with
the combined classifier it would be possible to correctly classify all benign lesions with the BI-RADS
category 3 as in the case of the BI-RADS alone. However, in addition few examples of benign lesions
with higher BI-RADS categories would be correctly classified. With the combined classifier, it would
possible to avoid 56 biopsies. However, it must be stressed that there were no malignant lesions in the
dataset with BI-RADS category 3, the classification performed by the radiologist was already at high
level. Moreover, use of the best morphological feature subset provides higher specificity at 100\%
sensitivity than the BI-RADS as it is shown in Table 3, although its AUC value is lower. However in
this case it was not be possible to correctly classify all lesions with the BI-RADS category 3.
The main disadvantage of the combined classifier is that it was developed based on the
experience of a particular physician who assigned the BI-RADS categories. Supposedly, several issues
might occur. First, although the developed CAD system can serve as support for a particular radiologist,
it might, however, not work when used by another radiologist. For example, a less experienced physician
can have a worse performance, which translates to a different BI-RADS ROC curve and therefore affects
the performance of the combined classifier. Next, the choice of morphological features chosen to
improve BI-RADS may depend on the radiologist’s experience. For example, features developed to
assess spiculations can be selected if the radiologist does not evaluate spiculations successfully.
In all these cases, the system would require separate training to support a particular radiologist. It would
be interesting to utilize the combined system in the radiologists' training. Hypothetically, after the
assignation of the BI-RADS categories to an exemplary dataset, the feature selection can be used to
indicate which features improves the diagnosis in this particular case. For example, a “novice”,
inexperienced radiologist (or even an experienced one) can be told to pay more attention to spiculations.
Moreover, radiologists perceive image features differently and the tumor assessment is usually descriptive.
Numerical values reflecting the level of spiculation (or other contour characteristic) quantitatively could
be helpful by themselves, even without a CAD system. It could enable a more objective lesion
description. The majority of morphological features is easy to illustrate on the image which may help
the radiologist to analyze the lesion.
\section{conclusion}
In this work, we investigated the usefulness of morphological features for the breast lesions
differentiation. The main goal was to find features that can improve the BI-RADS. This was successfully
accomplished by incorporating six morphological features. The use of the developed combined classifier
leads to 100\% sensitivity and high specificity of 74.7\%. It can be used to reduce the number of
unnecessary biopsies. The combined classifier depends on the experience of a particular radiologist,
however, the presented in this work approach can be used to train a classifier for a different radiologist.
Besides, other features, for instance texture features can be incorporated in the future to potentially
improve the classification further. The developed CAD system can also be used in the radiologists'
training. After the classifier development phase, the radiologist can be informed which features improve
his diagnosis accuracy. This enables the radiologist to widen his knowledge of lesion appearance in ultrasound image. With the help of artificial intelligence, the radiologist can hypothetically improve his
classification performance.
In our study we obtained good classification performance with
particular morphological features, even without the BI-RADS system. However, in comparison with the
survey paper \cite{GomezFlores2015}, we determined a slightly different best performing feature subset.
\section*{Acknowledgments:}
This work was supported by the National Science Center Grant Number UMO- 2014/13/B/ST7/01271.
\section*{Conflict of interest statement}
None.
\bibliographystyle{ieeetran}
| {'timestamp': '2017-06-07T02:08:46', 'yymm': '1706', 'arxiv_id': '1706.01855', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01855'} | arxiv |
\section{Introduction}
\label{intro}
Hierarchies (Taxonomies) are popular for organizing large volume datasets in various application domains \cite{ashburner2000gene,deng2009imagenet}. Several large-scale online prediction challenges such as LSHTC\footnote{http://lshtc.iit.demokritos.gr/} (webpage classification), BioASQ\footnote{http://bioasq.org/} (PubMed documents classification) and ILSVRC\footnote{http://www.image-net.org/challenges/LSVRC/2016/} (image classification) revolve around the HC problem. Although, substantial amount of data with inter-class dependencies information are beneficial for improving HC, one of the major challenges in dealing with these datasets comprising large-number of categories (classes), high-dimensional features and large-number of training instances (examples) is {scalability}.
Many large-scale HC approaches have been developed in past to deal with the various ``big data" challenges by: (i) training faster models, (ii) quickly predicting class-labels and (iii) minimizing memory usage. For example, Gopal et al. \cite{gopal2013distributed} proposed the log-concavity bound that allows parallel training of model weight vectors across multiple computing units. This achieves significant speed-up along with added flexibility of storing model weight vectors at different units. However, the memory requirements is still large ($\sim$26 GB for DMOZ-2010 dataset, refer to Table \ref{table:paramsize}) which requires complex distributed hardware for storage and implementation. Alternatively, Map-Reduce based formulation of learning model is introduced \cite{naik2015ranking,gopal2013recursive} which is scalable but have software/hardware dependencies that limits the applicability of this approach.
To minimize the memory requirements, one of the popular strategy is to incorporate the feature selection in conjunction with model training \cite{zhou2011hierarchical,heisele2003hierarchical}. The main intuition behind these approaches is to squeeze the high-dimensional features into lower dimensions. This allows the model to be trained on low-dimensional features only; significantly reducing the memory usage while retaining (or improving) the classification accuracy. This is possible because only subset of features are beneficial to discriminate between classes at each node in the hierarchy. For example, to distinguish between sub-class `Chemistry' and `Physics' that belongs to class `Science' features like \emph{chemical}, \emph{reactions} and \emph{acceleration} are important whereas features like \emph{coach}, \emph{memory} and \emph{processor} are irrelevant. HC methods that leverage the structural relationship shows improved classification performance but are computationally expensive \cite{liu2005support,gopal2013recursive,cai2004hierarchical}.
\begin{figure*}
\centering
\includegraphics[width=1\linewidth,height=7.5cm]{FS.png}
\caption{\textbf{Figure demonstrating the importance of feature selection for HC. Green color (sticky note) represents the top five best features selected using gini-index feature selection method at each internal node. Internal nodes are represented by orange color (elliptical shape) and leaf nodes are represented by blue color (rectangular shape).}}
\label{FSfigure}
\end{figure*}
In this paper, we study different filter-based feature selection methods for solving large-scale HC problem. Feature selection serves as the preprocessing step in our learning framework prior to training models. Any developed methods for solving HC problem can be integrated with the selected features, providing flexibility in choosing the HC algorithm of our choice along with computational efficiency and storage benefits. Our proposed ``adaptive feature selection" also shows an improvement of $\sim$2\% in classification accuracy. Experiments on various real world datasets across different domains demonstrates the utility of the feature selection over full set of high-dimensional features. We also investigate the effect of feature selection in classification performance when the number of labeled instances per class is low.
\section{Literature Review}
\label{sec:1}
\subsection{Hierarchical Classification}
Several methods have been developed to address the hierarchical classification problem \cite{naik2015ranking,gopal2013recursive,naik2016inconsistent,dumais2000hierarchical,cesa2006incremental}. These methods can be broadly divided into three major categories. (i) \emph{Flat approach} is one of the simplest and straight forward method to solve the HC problem. In this method, hierarchical structure is completely ignored and an independent one-vs-rest or multi-class classifiers are trained for each of the leaf categories that can discriminate it from remaining leaf categories. For predicting the label of instances, the flat method invokes the classifiers corresponding to all leaf categories and selects the leaf category with highest prediction score. As such, flat approach have expensive training and prediction runtime for datasets with large number of classes. (ii) \emph{Local classification} involves the use of local hierarchical relationships during the model training process. Depending on how the hierarchical relationships are leveraged, various local methods exist \cite{silla2011survey}. In this paper, we have used the most popular ``local classifier per parent node" method as the baseline for evaluations. Specifically, we train a multi-class classifier at each of the parent node to maximize the discrimination between its children nodes. For making predictions a top-down method (discussed in Section \ref{topdown}) is followed. (iii) \emph{Global classification} learns a single complex model where all relevant hierarchical relationships are explored jointly during the optimization process making these approaches expensive for training. Label predictions is done using a similar approach followed for flat or local methods.
\subsection{Top-Down Hierarchical Classification}
\label{topdown}
One of the most efficient approach for solving large-scale HC problem is using the top-down method \cite{liu2005support,koller1997hierarchically}.
In this method, local or global classification method is used for model training and the unlabeled instances are recursively classified in a top-down fashion. At each step, best node is picked based on the computed prediction score of its children nodes. The process repeats until the leaf node representing a certain category (or class-label) is reached, which is the final predicted label (refer to eq. (\ref{eq:TDTest})).
Top-Down (TD) methods are popular for large-scale problems owing to their computational benefits where only the subset of classes in the relevant path are considered during prediction phase. For example, in order to make second level prediction provided the first level prediction is `{Sci}' (shown in Figure \ref{FSfigure}) we only need to consider the children of `{Sci}' class ($i.e.$, {electronics}, {med}, {crypt} and {space}), thereby, avoiding the large number of second level classes such as `{Sys}', `Politics', `Sports', `graphics', `autos'. In the past, top-down methods have been successfully used to solve HC problems \cite{dumais2000hierarchical,holden2005hybrid,li2005music}. Liu et al. \cite{liu2005support} performed classification on large-scale Yahoo! dataset and analyzed the complexity of the top-down approach. In \cite{secker2007experimental}, a selective classifier top-down method is proposed where the classifier to train at particular node is chosen in a data-driven manner.
\subsection{Feature Selection}
There have been several studies focused on feature selection methods for the flat classification problem \cite{tang2014feature,dash1997feature,peng2005feature,zheng2004feature,joachims1998text,kohavi1997wrappers}. However, very few work emphasize on feature selection for HC problem that are limited to small number of categories \cite{ristoski2014feature,wibowo2002simple}. Figure \ref{FSfigure} demonstrates the importance of feature selection for hierarchical settings where only the relevant features are chosen at each of the decision (internal) nodes. More details about the figure will be discussed in Section \ref{resDiscuss} (Case Study).
Feature selection aims to find a subset of highly discriminant features that minimizes the error rate and improve the classifier performance. Based on the approach adapted for selecting features two broad categories of feature selection exist, namely, wrapper and filter-based methods. Wrapper approaches evaluate the fitness of the selected features using the intended classifier. Although many different wrapper-based approaches have been proposed, these methods are not suitable for large-scale problems due to the expensive evaluation needed to select the subset of features \cite{tang2014feature}. On the contrary, filter approaches select the subset of features based on the certain measures or statistical properties that does not require the expensive evaluations. This makes the filter-based approaches a natural choice for large-scale problem. Hence, in this paper we have focused on various filter-based approaches for solving HC problem (discussed in Section \ref{filterFeatSelect}). In literature, third category referred as embedded approaches have also been proposed which are a hybrid of the wrapper and filter methods. However, these approaches have not been shown to be efficient for large-scale classification \cite{tang2014feature} and hence, we do not focus on hybrid methods.
To the best of our knowledge this is the first paper that performs a broad study of filter-based feature selection methods for HC problem.
\section{Methods}
\label{featMethod}
\subsection{Definitions and Notations}
In this paper, we use {\bf{bold}} lower-case and upper-case letters to indicate vector and matrix variables, respectively. Symbol $\mathcal{N}$ denotes the set of internal nodes in the hierarchy where for each node $n \in \mathcal{N}$ we learn the multi-class classifier denoted by ${\bf{W}}_n$ = $\big[{\bf{w}}^n_c\big]_{{c \in \mathcal{C}(n)}}$ to discriminate between its children nodes $\mathcal{C}(n)$. ${\bf{w}}^n_c$ represents the optimal model weight vectors for $c^{th}$ child of node $n$. $\mathcal{L}$ denotes the set of leaf nodes (categories) to which instances are assigned. The total number of training instances are denoted by $N$ and $T(n) \subseteq N$ denotes the total number of training instances considered at node $n$ which corresponds to all instances of descendant categories at node $n$. $\mathcal{F}$ denotes the set of total features (dimensionality) for each instance where $i^{th}$ feature is denoted by $f_i$. ${S}_\mathcal{F} \subseteq \mathcal{F}$ denotes the subset of relevant features selected using feature selection algorithm. $\mathcal{D} = \big\{\big({\bf{x}}(i)$, $y(i)\big)\big\}_{i=1}^{N}$ denotes the training dataset where ${\bf{x}}(i) \in \mathbb{R}^{\mathcal{F}}$ and $y(i) \in \mathcal{L}$. For training optimal model corresponding to $c^{th}$ child at node $n$ we use the binary label ${y_c^n}{(i)} \in \{\pm1\}$ for $i^{th}$ training instance where $y_c^n(i)$ = 1 iff $y(i)$ = $c$ and $y_c^n(i)$ = -1 otherwise. Predicted label for $i^{th}$ test instance $\hat{\bf{x}}(i)$ is denoted by $\hat{y}(i) \in \mathcal{L}$.
\subsection{Hierarchical Classification}
\label{HierClass}
Given a hierarchy $\mathcal{H}$, we train multi-class classifiers for each of the internal nodes $n\in\mathcal{N}$ in the hierarchy--- to discriminate between its children nodes $\mathcal{C}(n)$. In this paper, we have used Logistic Regression (LR) as the underlying base model for training \cite{gopal2013recursive,naik2013classifying}. The LR objective uses logistic loss to minimize the empirical risk and $l_1$-norm (denoted by $\big|\big|\cdot\big|\big|_{1}$) or squared $l_2$-norm term (denoted by $\big|\big|\cdot\big|\big|_{2}^{2}$) to control model complexity and prevent overfitting. Usually, $l_1$-norm encourages sparse solution by randomly choosing single parameter amongst highly correlated parameters whereas $l_2$-norm jointly shrinks the correlated parameters. The objective function $\Psi^{n}_{c}$ for training a model corresponding to ${c^{th}}$ child of node $n$ is provided in eq. (\ref{ARLR}).
\begin{equation}
\scriptsize
\Psi^{n}_{c}=\min_{{\bf{w}}^{n}_{c}}\Bigg[\lambda\sum_{i=1}^{T(n)}\log\left(1+\exp\left(-y_{c}^{n}(i)\big({\bf{w}}^{n}_c\big)^{T}\mathbf{x}(i)\right)\right)+ \mathcal{R}\big({\bf{w}}^{n}_c\big)\Bigg]\label{ARLR}
\end{equation}
where $\lambda > 0$ is a mis-classification penalty parameter and $\mathcal{R}\big(.\big)$ denotes the regularization term given by eq. (\ref{regTerm}).
\begin{align}
\mathcal{R}\big({\bf{w}}^n_c\big)=\left\{ \begin{alignedat}{1} & \big|\big|{\bf{w}}^n_c\big|\big|_1^1, \quad l_1-norm\\
& \quad \quad \quad OR\\
& \big|\big|{\bf{w}}^n_c\big|\big|_2^2, \quad l_2-norm
\end{alignedat}
\right\} \label{regTerm}
\end{align}
For each child $c$ of node $n$ within the hierarchy, we solve eq. (\ref{ARLR}) to obtain the optimal weight vector denoted by ${\bf{w}}^{n}_c$. The complete set of parameters for all the children nodes ${\bf{W}}_n$ = $[{\bf{w}}^{n}_c] _{c\in\mathcal{C}(n)}$ constitutes the learned multi-class classifiers at node $n$ whereas total parameters for all internal nodes ${\bf{W}}$ = $[{\bf{W}}_n]_{n \in \mathcal{N}}$ constitutes the learned model for Top-Down (TD) classifier.
For a test instance ${\hat{\bf{x}}}(i)$, the TD classifier predicts the class label $\hat{y}(i)\in\mathcal{L}$ as shown in eq. (\ref{eq:TDTest}). Essentially, the algorithm starts at the root node and recursively selects the best child nodes until it reaches a terminal node belonging to the set of leaf nodes $\mathcal{L}$.
\begin{align}
\hat{y}(i)=\left\{ \begin{alignedat}{1} & \mathbf{initialize}\quad p:=root\\
& \mathbf{while}\ p\notin\mathcal{L}\\
& \quad p:=\mathbf{argmax}_{q\in\mathcal{C}(p)}\ \big({\bf{w}}^p_{q}\big)^T\hat{{\bf{x}}}(i)\\
& \mathbf{return}\ p
\end{alignedat}
\right\} \label{eq:TDTest}
\end{align}
\subsection{Feature Selection}
\label{filterFeatSelect}
The focus of our study in this paper is on filter-based feature selection methods which are scalable for large-scale datasets. In this section, we present four feature selection approaches that are used for evaluation purposes.\\
\\
{\textbf{Gini-Index}} - It is one of the most widely used method to compute the best split (ordered feature) in the decision tree induction algorithm \cite{ogura2009feature}. Realizing its importance, it was extended for the multi-class classification problem \cite{shang2007novel}. In our case, it measure the feature's ability to distinguish between different leaf categories (classes). Gini-Index of $i^{th}$ feature $f_i$ with $\mathcal{L}$ classes can be computed as shown in eq. (\ref{gi}).
\begin{equation}
{\bf{Gini-Index}}(f_i) = 1 - \sum_{k=1}^{\mathcal{L}}\Big(p(k|f_i)\Big)^2
\label{gi}
\end{equation}
where $p(k|f_i)$ is the conditional probability of class $k$ given feature $f_i$.
Smaller the value of Gini-Index, more relevant and useful is the feature for classification. For HC problem, we compute the Gini-Index corresponding to all feature's independently at each internal node and select the best subset of features (${S}_\mathcal{F}$) using a held-out validation dataset.
\\
\\
{\textbf{Minimal Redundancy Maximal Relevance (MRMR)}} - This method incorporates the following two conditions for feature subset selection that are beneficial for classification.
\begin{enumerate}[(i)]
\item Identify features that are mutually maximally dissimilar to capture better representation of entire dataset and
\item Select features to maximize the discrimination between different classes.
\end{enumerate}
The first criterion referred as ``minimal redundancy" selects features that carry distinct information by eliminating the redundant features. The main intuition behind this criterion is that selecting two similar features contains no new information that can assist in better classification. Redundancy information of feature set $\mathcal{F}$ can be computed using eq. (\ref{minred}).
\begin{equation}
{\mathfrak{R}_D} = \Bigg[ \frac{1}{|S_\mathcal{F}|^2}\sum_{f_i, f_j \in S_\mathcal{F}}I(f_i, f_j)\Bigg]
\label{minred}
\end{equation}
where $I(f_i, f_j)$ is the mutual information that measure the level of similarity between features $f_i$ and $f_j$ \cite{ding2005minimum}.
The second criterion referred as ``maximum relevance'' enforces the selected features to have maximum discriminatory power for classification between different classes. Relevance of feature set $\mathcal{F}$ can be formulated using eq. (\ref{maxrel}).
\begin{equation}
{\mathfrak{R}_L} = \Bigg[ \frac{1}{|S_\mathcal{F}|}\sum_{f_i\in S_\mathcal{F}}I(f_i, \mathcal{L})\Bigg]
\label{maxrel}
\end{equation}
where $I(f_i, \mathcal{L})$ is the mutual information between the feature $f_i$ and leaf categories $\mathcal{L}$ that captures how well the feature $f_i$ can discriminate between different classes \cite{peng2005feature}.
The combined optimization of eq. (\ref{minred}) and eq. (\ref{maxrel}) leads to a feature set with maximum discriminatory power and minimum correlations among features. Depending on strategy adapted for optimization of these two objectives different flavors exist. The first one referred as ``mutual information difference (MRMR-D)" formulates the optimization problem as the difference between two objectives as shown in eq. (\ref{mrmrd}). The second one referred as ``mutual information quotient (MRMR-Q)" formulates the problem as the ratio between two objectives and can be computed using eq. (\ref{mrmrq}).
\begin{equation}
\emph{MRMR-D} = \max_{S_\mathcal{F} \subseteq \mathcal{F}} \; ({{\mathfrak{R}_L - \mathfrak{R}_D}})
\label{mrmrd}
\end{equation}
\begin{equation}
\emph{MRMR-Q} = \max_{S_\mathcal{F} \subseteq \mathcal{F}} \; ({{\mathfrak{R}_L/\mathfrak{R}_D}})
\label{mrmrq}
\end{equation}
For HC problem again we select the best top ${S}_\mathcal{F}$ features (using a validation dataset) for evaluating these methods.
\\
\\
{\textbf{Kruskal-Wallis}} - This is a non-parametric statistical test that ranks the importance of each feature. As a first step this method ranks all instances across all leaf categories $\mathcal{L}$ and computes the feature importance metric as shown in eq. (\ref{kw}):
\begin{equation}
KW=(N-1)\frac{\sum_{i=1}^{\mathcal{L}}{n_i(\bar{r_i}-\bar{r})^2}}{\sum_{i=1}^{\mathcal{L}}\sum_{j=1}^{n_i}n_i({r}_{ij}-\bar{r})^2}
\label{kw}
\end{equation}
where $n_i$ is the number of instances in $i^{th}$ category, $r_{ij}$ is the ranking of $j^{th}$ instances in the $i^{th}$ category and $\bar{r}$ denotes the average rank across all instances.
It should be noted that using different feature results in different ranking and hence feature importance. Lower the value of computed score $KW$, more relevant is the feature for classification.
\begin{algorithm}[t!]
\SetAlgoLined
\KwData{Hierarchy $\mathcal{H}$, input-output pairs \Big(${\bf{x}}(i), y(i)$\Big)}
\KwResult{Learned model weight vectors:
\hspace*{11mm} ${\bf{W}}$ = [${\bf{W}}_1$, ${\bf{W}}_2$, $\cdots$, ${\bf{W}}_n$], $n$ $\in$ $\mathcal{N}$}
${\bf{W}}$ = $\phi$;
/* \textbf{1st subroutine: Feature Selection} */
\For{$f_i \in$ $\mathcal{F}$}{
Compute score (relevance) corresponding to feature $f_i$ using feature selection algorithm mentioned in Section \ref{filterFeatSelect};
}
Select top $k$ features based on score (and correlations) amongst features where best value of $k$ is tuned using a validation dataset
/* \textbf{2nd subroutine: Model Learning using Reduced Feature Set} */
\For{n $\in$ $\mathcal{N}$}{
/* \textbf{learn models for discriminating child at node $n$} */
Train optimal multi-class classifiers ${\bf{W}}_n$ at node $n$ using reduced feature set as shown in eq. (\ref{ARLR});
/* \textbf{update model weight vectors} */
${\bf{W}}$ = [${\bf{W}}$, ${\bf{W}}_n$];
}
\Return{${\bf{W}}$}
\caption{Feature Selection (FS) based Model Learning for Hierarchical Classification (HC)}
\label{featSelectHC}
\end{algorithm}
\begin{table*}[tb]
\centering
\caption{\textbf{Dataset Statistics}} \label{table:finaltabledataset}
\begin{tabular}{|l| c c c c c c c c|}
\hline
\multirow{2}{*}{\bf{Dataset}}& \multirow{2}{*}{\bf{Domain}} & \multirow{2}{*}{\bf{\# Leaf Node}} & \multirow{2}{*}{\bf{\# Internal Node}} & \multirow{2}{*}{\bf{Height}} & \multirow{2}{*}{\bf{\# Training}} & \multirow{2}{*}{\bf{\# Testing}} & \multirow{2}{*}{\bf{\# Features}} & {\bf{Avg. \# children}}\\
\multicolumn{1}{|c|}{} & \multicolumn{7}{c}{} & (per internal node)\\
\hline
{\bf{NG}} & Text & 20 & 8 & 4 & 11,269 & 7,505 & 61,188 & 3.38\\
{\bf{CLEF}} & Image & 63 & 34 & 4 & 10,000 & 1,006 & 80 & 2.56\\
{\bf{IPC}} & Text & 451 & 102 & 4 & 46,324 & 28,926 & 1,123,497 & 5.41\\
{\bf{DMOZ-SMALL}} & Text & 1,139 & 1,249 & 6 & 6,323 & 1,858 & 51,033 & 1.91\\
{\bf{DMOZ-2010}} & Text & 12,294 & 4,928 & 6 & 128,710 & 34,880 & 381,580 & 3.49\\
{\bf{DMOZ-2012}} & Text & 11,947 & 2,016 & 6 & 383,408 & 103,435 & 348,548 & 6.93\\
\hline
\end{tabular}
\end{table*}
\subsection{Proposed Framework}
Algorithm \ref{featSelectHC} presents our proposed method for embedding feature selection into the HC framework. It consist of two independent main subroutines: (i) a feature selection algorithm (discussed in Section \ref{filterFeatSelect}) for deciding the appropriate set of features at each decision (internal) node and (ii) a supervised learning algorithm (discussed in Section \ref{HierClass}) for constructing a TD hierarchical classifier using reduced feature set. Feature selection serves as the preprocessing step in our framework which provides flexibility in choosing any HC algorithm.
We propose two different approaches for choosing relevant number of features at each internal node $n \in \mathcal{N}$. The first approach which we refer as ``global feature selection (Global FS)" selects the same number of features for all internal nodes in the hierarchy where the number of features are determined based on the entire validation dataset performance. The second approach, referred as ``adaptive feature selection (Adaptive FS)" selects different number of features at each internal node to maximize the performance at that node. It should be noted that adaptive method only uses the validation dataset that exclusively belongs to the internal node $n$ ($i.e.$, descendant categories of node $n$). Computationally, both approaches are almost identical because model tuning and optimization requires similar runtime which accounts for the major fraction of computation.
\section{Experimental Evaluations}
\subsection{Dataset Description}
We have performed an extensive evaluation of various feature selection methods on a wide range of hierarchical text and image datasets. Key characteristics about the datasets that we have used in our experiments are shown in Table \ref{table:finaltabledataset}. All these datasets are single-labeled and the instances are assigned to the leaf nodes in the hierarchy. For text datasets, we have used the word-frequency representation and perform the tf-idf transformation with $l_2$-norm to the word-frequency feature vector.\\
\textbf{Text Datasets}\\
\hspace*{4mm}\textbf{NEWSGROUP (NG)}\footnote{http://qwone.com/$\sim$jason/20Newsgroups/} - It is a collection of approximately 20,000 news documents partitioned (nearly) evenly across twenty different topics such as `baseball', `{electronics}' and `{graphics}' (refer to Figure \ref{FSfigure}).\\
\hspace*{4mm}\textbf{IPC}\footnote{http://www.wipo.int/classifications/ipc/en/} - Collection of patent documents organized in International Patent Classification (IPC) hierarchy.\\
\hspace*{4mm}\textbf{DMOZ-SMALL, DMOZ-2010 and DMOZ-2012}\footnote{http://dmoz.org} - Collection of multiple web documents organized in various classes using the hierarchical structure. Dataset has been released as the part of the LSHTC\footnote{http://lshtc.iit.demokritos.gr/} challenge in the year 2010 and 2012. For evaluating the DMOZ-2010 and DMOZ-2012 datasets we have used the provided test split and the results reported for this benchmark is blind prediction obtained from web-portal interface\footnote{http://lshtc.iit.demokritos.gr/node/81}.\\
\textbf{Image Datasets}\\
\hspace*{4mm}\textbf{CLEF} \cite{dimitrovski2011hierarchical} - Dataset contains medical images annotated with Information Retrieval in Medical Applications (IRMA) codes. Each image is represented by the 80 features that are extracted using local distribution of edges method.
\subsection{Evaluation Metrics}
We have used the standard set based performance measures Micro-$F_1$ and Macro-$F_1$ \cite{yang1999evaluation} for evaluating the performance of learned models.\\
\hspace*{4mm}\textbf{Micro-$F_1$ ($\mu$$F_1$)} - To compute $\mu$$F_1$, we sum up the category specific true positives $(TP_l)$, false positives $(FP_l)$ and false negatives $(FN_l)$ for different leaf categories and compute the $\mu$$F_1$ score as follows:
\begin{gather}P = \frac{\sum_{l \in \mathcal{L}}TP_l}{\sum_{l \in \mathcal{L}}(TP_l + FP_l)},
R = \frac{\sum_{l \in \mathcal{L}}TP_l}{\sum_{l \in\mathcal{L}}(TP_l + FN_l)} \nonumber\\
\mu F_1 = \frac{2PR}{P + R}\end{gather}
where, P and R are the overall precision and recall values for all the classes taken together.\\
\hspace*{4mm}\textbf{Macro-$F_1$ ($M$$F_1$)} - Unlike $\mu$$F_1$, M$F_1$ gives equal weight to all the categories so that the average score is not skewed in favor of the larger categories. It is defined as follows:
\begin{gather}P_l = \frac{TP_l}{TP_l + FP_l},
R_l = \frac{TP_l}{TP_l + FN_l} \nonumber\\
MF_1 = \frac{1}{|\mathcal{L}|}\sum_{l \in \mathcal{L}}\frac{2P_lR_l}{P_l + R_l}\end{gather}\\
where $|\mathcal{L}|$ denotes the set of leaf categories, $P_l$ and $R_l$ are the precision and recall values for leaf category $l$ $\in$ $\mathcal{L}$.
\begin{figure*}
\center
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{ng_MicroF1.png}%
\label{fig:ngsub1}}
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{ng_MacroF1.png}%
\label{fig:ngsub2}}
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{clef_MicroF1.png}%
\label{fig:clefsub1}}
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{clef_MacroF1.png}%
\label{fig:clefsub2}}%
\\
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{ipc_MicroF1.png}%
\label{fig:ipcsub1}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{ipc_MacroF1.png}%
\label{fig:ipcsub2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2010_small_MicroF1.png}%
\label{fig:dmozsmallsub1}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2010_small_MacroF1.png}%
\label{fig:dmozsmallsub2}}%
\\
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2010_MicroF1.png}%
\label{fig:dmoz2010sub1}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2010_MacroF1.png}%
\label{fig:dmoz2010sub2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2012_MicroF1.png}%
\label{fig:dmoz2012sub1}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2012_MacroF1.png}%
\label{fig:dmoz2012sub2}}%
\caption{\textbf{Performance comparison of LR + $l_1$-norm models with varying percentage (\%) of features selected using different feature selection (global) methods on text and image datasets.}}
\label{figaccuracyL1}
\end{figure*}
\begin{figure*}
\center
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{ng_MicroF1_L2.png}%
\label{fig:ngsub1L2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{ng_MacroF1_L2.png}%
\label{fig:ngsub2L2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{clef_MicroF1_L2.png}%
\label{fig:clefsub1L2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{clef_MacroF1_L2.png}%
\label{fig:clefsub2L2}}%
\\
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{ipc_MicroF1_L2.png}%
\label{fig:ipcsub1L2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{ipc_MacroF1_L2.png}%
\label{fig:ipcsub2L2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2010_small_MicroF1_L2.png}%
\label{fig:dmozsmallsub1L2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2010_small_MacroF1_L2.png}%
\label{fig:dmozsmallsub2L2}}%
\\
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2010_MicroF1_L2.png}%
\label{fig:dmoz2010sub1L2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2010_MacroF1_L2.png}%
\label{fig:dmoz2010sub2L2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2012_MicroF1_L2.png}%
\label{fig:dmoz2012sub1L2}}%
\hfil
\subfloat[]{
\includegraphics[width=.225\linewidth,height=4cm]{dmoz_2012_MacroF1_L2.png}%
\label{fig:dmoz2012sub2L2}}%
\caption{\textbf{Performance comparison of LR + $l_2$-norm models with varying percentage (\%) of features selected using different feature selection (global) methods on text and image datasets.}}
\label{figaccuracyL2}
\end{figure*}
\subsection{Experimental Details}
For all the experiments, we divide the training dataset into train and small validation dataset in the ratio 90:10. The train dataset is used to train TD classifiers whereas the validation dataset is used to tune the parameter. The model is trained for a range of mis-classification penalty parameter ($\lambda$) values in the set \big\{0.001, 0.01, 0.1, 1, 10, 100, 1000\big\} with best value selected using a validation dataset. Adopting the best parameter, we retrain the models on the entire training dataset and measure the performance on a separate held-out test dataset. For feature selection, we choose the best set of features using the validation dataset by varying the number of features between 1$\%$ and 75$\%$ of all the features. Our preliminary experiments showed no significant improvement after 75$\%$ hence we bound the upper limit to this value. We performed all the experiments on ARGO cluster (http://orc.gmu.edu) with dual Intel Xeon E5-2670 8 core CPUs and 64 GB memory. Source code implementation of the proposed algorithm discussed in this paper is made available at our website\footnote{https://cs.gmu.edu/$\sim$mlbio/featureselection} for repeatability and future use.
\begin{table}[hbt]
\begin{centering}
\caption{\textbf{Performance comparison of adaptive and global approach for feature selection based on Gini-Index with all features. LR + $l_1$-norm model is used for evaluation}}
\label{table:AdaptiveFS}
\begin{tabular}{|@{\hskip 0.02in} l@{\hskip 0.02in}| @{\hskip 0.02in}c@{\hskip 0.02in}| c| c|@{\hskip 0.02in} c@{\hskip 0.02in}|}
\hline
\multirow{1}{*}{\bf{Dataset}} & \multirow{1}{*}{\bf{Metric}} & \multirow{1}{*}{\bf{Adaptive FS}} & \multirow{1}{*}{\bf{Global FS}} & \multirow{1}{*}{\bf{All Features}}\\
\hline
\multirow{2}{*}{{\bf{NG}}} & $\mu F_1$ & 76.16$\vartriangle$ & {\bf{76.39}}$\vartriangle$ & 74.94\\
& $MF_1$ & {\bf{76.10}}$\vartriangle$ & 76.07$\vartriangle$ & 74.56 \\
\multirow{2}{*}{{\bf{CLEF}}} & $\mu F_1$ & {\bf{72.66}} & 72.27 & 72.17\\
& $MF_1$ & {\bf{36.73}}$\blacktriangle$ & 35.07$\vartriangle$ & 33.14\\
\multirow{2}{*}{{\bf{IPC}}} & $\mu F_1$ & {\bf{48.23}}$\blacktriangle$ & 46.35 & 46.14\\
& $MF_1$ & {\bf{41.54}}$\blacktriangle$ & 39.52 & 39.43\\
\multirow{2}{*}{{\bf{DMOZ-SMALL}}} & $\mu F_1$ & {\bf{40.32}}$\vartriangle$ & 39.52 & 38.86\\
& $MF_1$ & {\bf{26.12}}$\blacktriangle$ & 25.07 & 24.77\\
\multirow{2}{*}{{\bf{DMOZ-2010}}} & $\mu F_1$ & {\bf{35.94}} & 35.40 & 34.32 \\
& $MF_1$ & {\bf{23.01}} & 21.32 & 21.26\\
\multirow{2}{*}{{\bf{DMOZ-2012}}} & $\mu F_1$ & {\bf{44.12}}& 43.94 & 43.92 \\
& $MF_1$ & {\bf{23.65}} & 22.18 & 22.13\\
\hline
\end{tabular}
\par\end{centering}
\begin{tablenotes}
\small
\item $\blacktriangle$ (and $\vartriangle$) indicates that improvements are statistically significant with 0.05 (and 0.1) significance level.
\end{tablenotes}
\end{table}
\section{Results Discussion}
\label{resDiscuss}
\subsection{{Case Study}}
To understand the quality of features selected at different internal nodes in the hierarchy we perform case study on NG dataset. We choose this dataset because we have full access to feature information. Figure \ref{FSfigure} demonstrates the results of top five features that is selected using best feature selection method $i.e.$, Gini-Index (refer to Figure \ref{figaccuracyL1} and \ref{figaccuracyL2}). We can see from the figure that selected features corresponds to the distinctive attributes which helps in better discrimination at particular node. For example, the features like \emph{Dod (Day of defeat or Department of defense)}, \emph{Car}, \emph{Bike} and \emph{Team} are important at node `{Rec}' to distinguish between the sub-class `{autos}', `{motorcycles}' and `{Sports}' whereas other features like \emph{Windows}, \emph{God} and \emph{Encryption} are irrelevant. This analysis illustrates the importance of feature selection for TD HC problem.
One important observation that we made in our study is that some of the features like \emph{Windows}, \emph{God} and \emph{Team} are useful for discrimination at multiple nodes in the hierarchy (associated with parent-child relationships). This observation conflicts with the assumption made in the work by Xiao et al. \cite{zhou2011hierarchical}, which attempts to optimize the objective function by necessitating the child node features to be different from the features selected at the parent node.
\begin{table*}[t]
\centering
\caption{\textbf{Comparison of memory requirements for LR + $l_1$-norm model}}
\label{table:paramsize}
\begin{tabular}{|l| r r r r r r r r|}
\hline
\multirow{2}{*}{\bf{Dataset}} & \multicolumn{2}{c|}{{\bf{Adaptive FS}}} & \multicolumn{2}{c|}{{\bf{Global FS}}} & \multicolumn{2}{c|}{{\bf{All Features}}}\\
\cline{2-7}
& {{\bf{\# parameters}}} & \multicolumn{1}{c|}{{\bf{size}}} & {{\bf{\# parameters}}} & \multicolumn{1}{c|}{{\bf{ size}}} & {{\bf{\# parameters}}} & \multicolumn{1}{c|}{{\bf{ size}}}\\
\hline
{\bf{NG}}& 982,805 & \multicolumn{1}{r|}{4.97 MB} & {\bf{908,820}} & \multicolumn{1}{r|}{{\bf{3.64 MB}}} & 1,652,076 & \multicolumn{1}{r|}{6.61 MB}\\
{\bf{CLEF}} & {\bf{4,715}} & \multicolumn{1}{r|}{{\bf{18.86 KB}}} & {{5,220}} & \multicolumn{1}{r|}{{{20.89 KB}}} & 6,960 & \multicolumn{1}{r|}{27.84 KB }\\
{\bf{IPC}} & {\bf{306,628,256}} & \multicolumn{1}{r|}{\bf{1.23 GB}} & {{331,200,000}} & \multicolumn{1}{r|}{{{1.32 GB}}} & 620,170,344 & \multicolumn{1}{r|}{2.48 GB}\\
{\bf{DMOZ-SMALL}} & {\bf{74,582,625}} & \multicolumn{1}{r|}{\bf{0.30 GB}} & {{85,270,801}} & \multicolumn{1}{r|}{{{0.34 GB}}} & 121,815,771 & \multicolumn{1}{r|}{0.49 GB}\\
{\bf{DMOZ-2010}} & {\bf{ 4,035,382,592}} & \multicolumn{1}{r|}{\bf{16.14 GB}} & {{4,271,272,967}} & \multicolumn{1}{r|}{{{17.08 GB}}} & 6,571,189,180 & \multicolumn{1}{r|}{26.28 GB}\\
{\bf{DMOZ-2012}} & {\bf{3,453,646,353}} & \multicolumn{1}{r|}{{\bf{13.81 GB}}} & {{3,649,820,382}} & \multicolumn{1}{r|}{{{14.60 GB}}} & 4,866,427,176 & \multicolumn{1}{r|}{19.47 GB}\\
\hline
\end{tabular}
\end{table*}
\subsection{{Classification Performance Comparison}}
\textbf{Global FS} - Figures \ref{figaccuracyL1} and \ref{figaccuracyL2} shows the $\mu F_1$ and M$F_1$ comparison of LR models with $l_1$-norm and $l_2$-norm regularization combined with various feature selection methods discussed in Section \ref{filterFeatSelect} respectively. We can see that all feature selection method (except Kruskal-Wallis) show competitive performance results in comparison to the full set of features for all the datasets. Overall, Gini-Index feature selection method has slightly better performance over other methods. MRMR methods have a tendency to remove some of the important features as redundant based on the minimization objective obtained from data-sparse leaf categories which may not be optimal and negatively influences the performance. The Kruskal-Wallis method shows poor performance because of the statistical properties that is obtained from data-sparse nodes \cite{2008danger}.
On comparing the $l_1$-norm and $l_2$-norm regularized models of best feature selection method (Gini-Index) with all features, we can see that $l_1$-norm models have more performance improvement (especially for M$F_1$ scores) for all datasets whereas for $l_2$-norm models performance is almost similar without any significant loss. This is because $l_1$-norm assigns higher weight to the important predictor variables which results in more performance gain.
Since, feature selection based on Gini-Index gives the best performance, in the rest of the experiments we have used the Gini-Index as the baseline for comparison purpose. Also, we consider $l_1$-norm model only due to space constraint.
\textbf{Adaptive FS} - Table \ref{table:AdaptiveFS} shows the LR + $l_1$-norm models performance comparison of adaptive and global approaches for feature selection with all features. We can see from the table that adaptive approach based feature selection gives the best performance for all the datasets (except $\mu F_1$ score of NG dataset which has very few categories). For evaluating the performance improvement of models we perform statistical significance test. Specifically, we perform sign-test for $\mu F_1$ \cite{yang1999re} and non-parametric wilcoxon rank test for $M F_1$. Results with 0.05 (0.1) significance level is denoted by $\blacktriangle$ ($\vartriangle$). Tests are between models obtained using feature selection methods and all set of features. We cannot perform test on DMOZ-2010 and DMOZ-2012 datasets because true predictions and class-wise performance score are not available from online web-portal.
Statistical evaluation shows that although global approach is slightly better in comparison to full set of features they are not statistically significant. On contrary, adaptive approach is much better with an improvement of $\sim$2\% in $\mu F_1$ and M$F_1$ scores which are statistically significant.
\subsection{{Memory Requirements}} Table \ref{table:paramsize} shows the information about memory requirements for various models with full set of features and best set of features that are selected using global and adaptive feature selection. Upto 45$\%$ reduction in memory size is observed for all datasets to store the learned models. This is a huge margin in terms of memory requirements considering the models for large-scale datasets (such as DMOZ-2010 and DMOZ-2012) are difficult to fit in memory.
It should be noted that optimal set of features is different for global and adaptive methods for feature selection hence they have different memory requirements. Overall, adaptive FS is slightly better because it selects small set of features that are relevant for distinguishing data-sparse nodes present in CLEF, IPC and the DMOZ datasets. Also, we would like to point out that Table \ref{table:paramsize} represents the memory required to store the learned model parameters only. In practice, 2-4 times more memory is required for temporarily storing the gradient values of model paramaters that is obtained during the optimization process.
\begin{table}
\begin{centering}
\caption{\textbf{Feature selection preprocessing time (in minutes)($\downarrow$)}}
\label{table:preprocessing}
\begin{tabular}{|l| @{\hskip 0.02in}c@{\hskip 0.02in}|@{\hskip 0.02in} c @{\hskip 0.02in}|@{\hskip 0.02in}c@{\hskip 0.02in} |@{\hskip 0.02in} c@{\hskip 0.02in}|}
\hline
\multirow{2}{*}{\bf{Dataset}} & \multicolumn{4}{c|}{\bf{Feature Selection Method}}\\
\cline{2-5}
& \bf{Gini-Index} & \bf{MRMR-D} & \bf{MRMR-Q} & \bf{Kruskal-Wallis}\\
\hline
\multirow{1}{*}{{\bf{NG}}} & {\bf{2.10}} & 5.33 & 5.35 & 5.42\\
\multirow{1}{*}{{\bf{CLEF}}} & {\bf{0.02}} & 0.46 & 0.54 & 0.70\\
\multirow{1}{*}{{\bf{IPC}}} & {\bf{15.24}} & 27.42 & 27.00 & 23.24\\
\multirow{1}{*}{{\bf{DMOZ-SMALL}}} & {\bf{23.65}} & 45.24 & 45.42 & 34.65\\
\multirow{1}{*}{{\bf{DMOZ-2010}}} & {\bf{614}} & 1524 & 1535 & 1314\\
\multirow{1}{*}{{\bf{DMOZ-2012}}} & {\bf{818}}& 1824 & 1848 & 1268\\
\hline
\end{tabular}
\par\end{centering}
\end{table}
\subsection{{Runtime Comparison}}
\textbf{Preprocessing Time} - Table \ref{table:preprocessing} shows
the preprocessing time needed to compute the
feature importance using the
different feature selection methods. The
Gini-index method takes the least amount of time
since it does not require the interactions
between different features to rank the features. The
MRMR methods are computationally
expensive due to the large number of
pairwise comparisons between all the
features to identify the redundancy information. On other hand, the
Kruskal-Wallis method has overhead associated with
determining ranking of each features with different classes.
\textbf{Model Training} - Table \ref{table:RuntimeL1Norm} shows the total training time needed for learning models. As expected, feature selection requires less training time due to the less number of features that needs to be considered during learning. For smaller datasets such as NG and CLEF improvement is not noticeable. However, for larger datasets with high-dimensionality such as IPC, DMOZ-2010 and DMOZ-2012 improvement is much higher (upto 3x order speed-up). For example, DMOZ-2010 dataset training time reduces from 6524 minutes to mere 2258 minutes.
\textbf{Prediction Time} - For the dataset with largest number of test instances, DMOZ-2012 it takes 37 minutes
to make predictions with feature selection as opposed to 48.24 minutes
with all features using the TD HC approach.
In Figure \ref{preComp} we show the training and prediction time comparison of large datasets (DMOZ-2010 and DMOZ-2012) between flat LR and the TD HC approach with (and without) feature selection. The flat method is comparatively more expensive than the TD approach
($\sim$6.5 times for training and $\sim$5 times for prediction).
\begin{table}
\begin{centering}
\caption{\textbf{Total training time (in minutes)($\downarrow$)}}
\label{table:RuntimeL1Norm}
\begin{tabular}{|l| c| c | c|}
\hline
\multirow{2}{*}{\bf{Dataset}} & \multirow{2}{*}{\bf{Model}} & {\bf{Feature Selection}} & \multirow{2}{*}{\bf{All Features}}\\
&& {\bf{(Gini-Index)}} & \\
\hline
\multirow{2}{*}{{\bf{NG}}} & LR + $l_1$ & 0.75 & 0.94\\
& LR + $l_2$ & 0.44 & 0.69 \\
\multirow{2}{*}{{\bf{CLEF}}} & LR + $l_1$ & 0.50 & 0.74\\
& LR + $l_2$ & 0.10 & 0.28\\
\multirow{2}{*}{{\bf{IPC}}} & LR + $l_1$ & 24.38 & 74.10\\
& LR + $l_2$ & 20.92 & 68.58\\
\multirow{2}{*}{{\bf{DMOZ-SMALL}}} & LR + $l_1$ & 3.25 & 4.60\\
& LR + $l_2$ & 2.46 & 3.17\\
\multirow{2}{*}{{\bf{DMOZ-2010}}} & LR + $l_1$ & 2258 & 6524\\
& LR + $l_2$ & 2132 & 6418 \\
\multirow{2}{*}{{\bf{DMOZ-2012}}} & LR + $l_1$ & 8024 & 19374\\
& LR + $l_2$ & 7908 & 19193\\
\hline
\end{tabular}
\par\end{centering}
\end{table}
\begin{figure}
\centering
\includegraphics[width=0.5\linewidth,height=3.0cm]{trainflatFeatComparisonLarge.png}%
\includegraphics[width=0.5\linewidth,height=3.0cm]{flatFeatComparisonLarge.png}
\caption{\textbf{Training and prediction runtime comparison of LR + $l_1$-norm model (in minutes).}}
\label{preComp}
\end{figure}
\begin{table}
\begin{centering}
\caption{\textbf{Performance comparison of LR + $l_1$-norm model with varying training size (\# instances) per class on NG dataset}}
\label{table:PerformanveVaryingTrainSize}
\begin{tabular}{|@{}c@{}|@{}c@{}| c c|c c|}
\hline
{\bf{Dataset}}& {\bf{Train size}} & \multicolumn{2}{c|}{\bf{Feature Selection}} & \multicolumn{2}{c|}{{\bf{All Features}}}\\
{\bf{Distribution}}& {\bf{(per class)}} & \multicolumn{2}{c|}{{\bf{(Gini-Index)}}} &{}&{}\\
\cline{3-6}
& & {\bf{$\mu F_1$}} & {\bf{M$F_1$}} & {\bf{$\mu F_1$}} & {\bf{M$F_1$}}\\
\hline
& \multirow{2}{*}{5} & {\bf{27.44}} $\blacktriangle$ & {\bf{26.45}} $\blacktriangle$ & 25.74 & 24.33\\
& & (0.4723) & (0.4415) & (0.5811) & (0.6868)\\
& \multirow{2}{*}{10} & {\bf{37.69}} $\vartriangle$ & {\bf{37.51}} $\blacktriangle$ & 36.59 & 35.86\\
{\bf{Low}}& & (0.2124) & (0.2772) & (0.5661) & (0.3471)\\
{\bf{Distribution}}& \multirow{2}{*}{15} & {\bf{43.14}} $\vartriangle$ & {\bf{43.80}} $\vartriangle$ & 42.49 & 42.99\\
& & (0.3274) & (0.3301) & (0.1517) & (0.7196)\\
& \multirow{2}{*}{25} & {\bf{52.12}} $\blacktriangle$ & {\bf{52.04}} $\blacktriangle$ & 50.33 & 50.56\\
& & (0.3962) & (0.3011) & (0.4486) & (0.5766)\\
\hline
& \multirow{2}{*}{50} & {\bf{59.55}} & 59.46 & 59.52 & {\bf{59.59}}\\
& & (0.4649) & (0.1953) & (0.3391) & (0.1641)\\
& \multirow{2}{*}{100} & 66.53 & 66.42 & {\bf{66.69}} & {\bf{66.60}}\\
{\bf{High}} & & (0.0346) & (0.0566) & (0.7321) & (0.8412)\\
{\bf{Distribution}}& \multirow{2}{*}{200} & 70.60 & 70.53 & {\bf{70.83}} & {\bf{70.70}}\\
& & (0.6068) & (0.5164) & (0.7123) & (0.6330)\\
& \multirow{2}{*}{250}& 72.37 & 72.24 & {\bf{73.06}} $\vartriangle$ & {\bf{72.86}} \\
& & (0.4285) & (0.4293) & (0.4732) & (0.4898)\\
\hline
\end{tabular}
\par\end{centering}
\begin{tablenotes}
\small
\item Table shows mean and (standard deviation) in bracket across five runs. $\blacktriangle$ (and $\vartriangle$) indicates that improvements are statistically significant with 0.05 (and 0.1) significance level.
\end{tablenotes}
\end{table}
\subsection{{Additional Results}}
{\textbf{Effect of Varying Training Size}} - Table \ref{table:PerformanveVaryingTrainSize} shows the classification performance on NG dataset with varying training dataset distribution. We have tested the models by varying the training size (instances) per class ($t_c$) between 5 and 250. Each experiment is repeated five times by randomly choosing $t_c$ instances per class. Moreover, adaptive method with Gini-Index feature selection is used for experiments. For evaluating the performance improvement of models we perform statistical significance test (sign-test for $\mu F_1$ and wilcoxon rank test for $M F_1$). Results with 0.05 (0.1) significance level is denoted by $\blacktriangle$ ($\vartriangle$).
We can see from Table \ref{table:PerformanveVaryingTrainSize} that for
low distribution datasets,
the
feature selection method performs well
and shows
improvements of upto 2$\%$ (statistically significant) over the baseline method. The reason behind this
improvement is that with low data distribution, feature selection methods
prevents the models from overfitting by selectively
choosing the important features that helps in
discriminating between
the models of various classes.
For datasets with high distribution,
no significant performance gain is observed due to sufficient number of available
training instances for learning models which prevents overfitting when using
all the features.
{\textbf{Levelwise Analysis}} - Figure \ref{LevelwiseCLEFfigure} shows the level-wise error analysis for CLEF, IPC and DMOZ-SMALL datasets with or without feature selection. We can see that at topmost level more error is committed compared to the lower level. This is because at higher levels each of the children nodes that needs to be discriminated is the combination of multiple leaf categories which cannot be modeled accurately using the linear classifiers. Another observation is that adaptive feature selection gives best results at all levels for all datasets which demonstrates its ability to extract relevant number of features at each internal node (that belongs to different levels) in the hierarchy.
\begin{figure}
\centering
\includegraphics[width=0.33\linewidth,height=2.75cm]{levelwiseAnalysisCLEF.png}%
\includegraphics[width=0.33\linewidth,height=2.75cm]{levelwiseAnalysisIPC.png}%
\includegraphics[width=0.33\linewidth,height=2.75cm]{levelwiseAnalysisDMOZSMALL.png}
\caption{\textbf{Level-wise error analysis of LR + $l_1$-norm model for CLEF, IPC and DMOZ-SMALL datasets.}}
\label{LevelwiseCLEFfigure}
\end{figure}
\section{Conclusion and future work}
In this paper we compared various feature
selection methods for solving large-scale HC problem. Experimental evaluation
shows that with feature selection we are able to
achieve significant improvement
in terms of
runtime performance (training and prediction) without
affecting the accuracy of learned classification
models. We also showed
that feature selection can be beneficial, especially
for the larger datasets in terms of memory
requirements. This paper presents the first study of
various information theoretic feature selection
methods for large-scale HC.
In future, we plan to extend our work by learning more
complex models at each of the decision nodes. Specifically, we
plan to use multi-task learning methods where
related tasks can be learned jointly to improve the
performance on each task. Feature selection gives us
the flexibility of
learning complex models due to
reduced dimensionality of the features, which otherwise have longer runtime and larger memory requirements.
\section*{Acknowledgement}
NSF Grant \#1252318 and \#1447489 to Huzefa Rangwala and Summer Research Fellowship from the office of provost, George Mason University to Azad Naik.
\renewcommand{\bibfont}{\footnotesize}
\bibliographystyle{./IEEEtranBST/IEEEtran}
| {'timestamp': '2017-06-07T02:02:50', 'yymm': '1706', 'arxiv_id': '1706.01581', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01581'} | arxiv |
\section{Introduction}
Several websites like Wikipedia, DMOZ and Yahoo archive documents (text data) into hierarchies with
large number of classes. Several classification methods have
been developed to automatically classify text documents into different classes.
In this work we seek to leverage the often implicit
relationships that
exists between multiple archival datasets to classify
documents within them in a combined manner. Further, datasets have
several classes with very few samples which make it harder to learn
good classification models.
Specifically, we develop a Multi-Task Learning (MTL) based approach
to learn the model vectors associated with
several linear classifiers (one per class) in a joint fashion. Using the
nearest-neighbor algorithm we identify the hidden relationships between
the different document datasets and use that within the MTL framework.
MTL approaches are known to achieve superior performance on
unseen test examples, especially
when the number of training examples is small.
MTL has been successfully
applied in varied applications such as
medical informatics \cite{30}, structural
classification \cite{1}, sequence analysis
\cite{12}, web image and video search \cite{48}.
In this paper our
key contributions include development of a document classification method using
MTL that leverages information present across dual hierarchical datasets. We focused on
classifying documents within classes as categorized by
Wikipedia and DMOZ dataset.
In text classification, for
each of the class
labels we define a
binary one-versus-rest
classification task. We then find the related tasks corresponding
to each task using $k$-nearest neighbor, which
is then learned together to find
the best suited model vector (or parameters) corresponding to each task.
Based on how information
from related tasks
was integrated with the original classification task we
developed two class of approaches: (i) Neighborhood Pooling Approach and
(ii) Individual Neighborhood Approach. We evaluated the performance
of our MTL approach for document classification with dual hierarchical datasets
against a transfer learning approach, semi-supervised learning
approach and a single task learning approach.
Our empirical evaluation demonstrated merits of the MTL approach in
terms of the classification performance.
The rest of the paper is
organized as follows. Section II provides background related to MTL and TL. Section III
discusses our developed methods. Section IV provides the experimental protocols. Section V discusses
the experimental results. Finally, Section VI draws conclusion
and provides several future directions.
\section{Background}
\subsection{Multi-Task Learning}
Multi-Task Learning (MTL) \cite{7} is a rapidly growing machine learning
paradigm that involves
the simultaneous training of multiple, related prediction tasks. This
differs from the traditional single-task learning (STL), where for
each task the model is learned independently. MTL-based
models have the following advantages: (i) they leverage the training
signal across related tasks, which leads to better generalization ability
for the different tasks and (ii) empirically they have been shown to outperform
STL models, especially when there are few examples per task and the
tasks are related \cite{7}\cite{8}\cite{9}\cite{10}.
The past few years has seen an tremendous growth in the development
and application of MTL-based approaches. A concise review of all these
approaches can be found in the survey by Zhou et. al. \cite{46}.
For STL, we are given a training set with $n$ examples. Given
an input domain ($\mathcal{X}$) and output domain ($\mathcal{Y}$), the
$i$-th training
example is represented by a pair $(x_i, y_i)$
where $x_i \in \mathcal{X}$ and $y_i \in \mathcal{Y}$.
Within classical machine learning,
we seek to learn a mapping function
$f: \mathcal{X} \in \mathbb{R}^{d} \rightarrow \mathcal{Y}$, where
$d$ denotes the dimensionality of the input space.
Assuming that $f(x)$ is a
linear discriminant function, it is
defined as $f(x) = sign (\langle \theta, x \rangle + c)$,
where $\theta \in \mathbb{R}^{d}$ denotes the weight
vector or model parameters.
$f(x)$ allows us to make predictions
for new and unseen examples within the $\mathcal{X}$ domain.
This model parameter $\theta$ are learned by minimizing a loss
function across all the training examples,
while restricting the model to have
low complexity using a regularization penalty. As such, the
STL objective can be shown as:
\begin{equation} \min_{\theta} \sum_{i=1}^{n} \underbrace { L(\theta, x_i, y_i)}_{Loss} + \lambda \underbrace{R(\theta)}_{Regularization} \end{equation}
where $L(\cdot)$ represents the loss function
being minimized, $R(\cdot)$ represents the
regularizer (e.g., $l_1$-norm)
and $\lambda$ is a parameter that balances
the trade-off between the loss function
and regularization penalty.
The regularization term safeguards against model over-fitting and
allows the model to generalize to the examples not
encountered in the training set.
Within MTL, we are given $T$ tasks with training examples
per task. For the $t$-th task, there are $n_t$ number of training examples that
are represented by $\{(x_{it},y_{it}) ; \forall i=1\ldots n_t \}$.
We seek to learn $T$ linear discriminant functions, each
represented by weight vector $\theta_{t}$. We denote the
combination of all task-related weight vectors as
a matrix that stacks all the weight vectors as columns,
$\Theta = [\theta_1,\ldots,\theta_T]$ of dimensions $d \times T$, where $d$ is the
number of input dimensions.
The MTL objective is given by
\begin{equation} \min_{\Theta} \sum_{t=1}^{T} \sum_{i=1}^{n_t} \underbrace { L(\theta_t, x_{it}, y_{it})}_{loss} + \lambda \underbrace{R(\Theta)}_{Regularization} \end{equation}
The regularization term $R(\Theta)$ captures the relationships between the different tasks. Different MTL approaches vary in the
way the combined regularization is performed but most methods seek to
leverage the ``task relationships'' and enforce the constraint that
the model parameters (weight vectors) for related tasks are similar.
In the work of
Evgeniou et. al \cite{11} the model for each task
is constrained to be close to the average of all the
tasks.
In multi-task feature learning and
feature selection methods \cite{13}\cite{14}\cite{15}\cite{16}, sparse
learning based on lasso \cite{17}, is performed to select or
learn a common set of features across many related tasks. However,
a common assumption made by these approaches \cite{11}\cite{18}\cite{19} is
that all tasks are equally related. This assumption
does not hold in all cases, especially when there is no knowledge
of task relationships.
Kato et. al \cite{20}
and Evgeniou et. al \cite{21} propose formulations
which use an externally provided task network or graph
structure. However, these relationships might
not be available and may need to be determined
from the data. Clustered multi-task learning
approaches assume that tasks exhibit a group-wise
structure, which is not known a-priori and seeks to learn
the clustering of tasks that are then
learned together \cite{22}\cite{23}\cite{24}. Another set
of approaches, mostly based on Gaussian Process models, learn
the task co-variance structure \cite{25}\cite{26} and are
able to take advantage of both positive and negative
correlations between the tasks.
In this paper
we have focused on the use of
MTL based models for the purpose of multi-class
text classification, when the documents are categorized by multiple hierarchical datasets.
We use a non-parametric, lazy approach to find the
related tasks within different domain datasets and use these relationships
within the regularized MTL approach.
\subsection{Transfer Learning}
\label{ref:tl:background}
Related to MTL are approaches developed for Transfer Learning (TL).
Within the TL paradigm, it is assumed that there exists one/more
target (or parent) tasks along with previously learned models for
related tasks (referred to as children/source tasks). While learning
the model parameters for the target task, TL approaches seek to
transfer information from the parameters of the source tasks.
The key
intuition behind using TL
is that the information contained in the source
tasks can help in learning predictive models
for the target task of interest. When
transferred parameters from
the source task assist in better learning the predictive
models of the target task then it is referred to as
positive transfer. However, in some cases if
source task(s) are not related to the target task, then
the
TL approach leads to worse prediction performance. This
type of transfer is known as negative transfer. It
has been shown in the work of Pan et. al \cite{47} that
TL improves the generalization performance of
the predictive models, provided the source tasks are related to the target
tasks.
One of the key differences between TL and MTL
approaches is that within the MTL approaches, all
the task parameters are learned simultaneously, whereas
in TL approaches, first the parameters of the source tasks
are learned and then they are transferred during the learning
of parameters for the target task. In the literature,
TL has also been referred
to as Asymmetric Multi-Task Learning because of the
focus on one/more of the target tasks.
Given a target task with $n_t$ training examples, represented
as $\{(x_{1t},y_{1t}),\ldots,(x_{nt},y_{nt})$ we seek to learn the parameters
for the target task ($\theta_{t}$) using the parameters from
the source tasks given by ($\Theta_{s}$). Using a similar notation
as used before the matrix $\Theta_{s}$ represents all the parameters
from the different source tasks that are learned separately beforehand.
We can write the minimization function for the target task within the TL
framework as:
\begin{equation} \min_{\theta_t} \sum_{i=1}^{n_t} \underbrace { L(\theta_t, x_{it}, y_{it})}_{loss} + \underbrace{\lambda_1 R(\theta_t) + \lambda_2 R(\theta_t, \Theta_s)}_{Regularization}\end{equation}
where the regularization term $R(\theta_t)$ controls model complexity
of the target task $t$ and the term
$R(\theta_t, \Theta_s)$ captures how the
parameters from the source tasks
will be transferred to the target task.
The exact implementation
of the regularization term is discussed
in
Section \ref{sec:methodology}.
\section{Methods}
\label{sec:methodology}
Given two different datasets that categorize/archive text documents
(e.g., Wikipedia and DMOZ), our
primary objective is to classify new documents into classes within
these datasets. We specifically, use regularized MTL approaches to improve
the document classification performance. First, we assume that each of
the classes within the different datasets is associated with a binary
classification task. For each of the tasks within one of the datasets we
want to determine related tasks within the other database, and by performing
the joint learning using MTL, we gain improvement in the classification
performance. We compare the MTL approach against the standard STL approach, the
TL approach that assumes the tasks in one of the datasets to be the
target task and tasks from the second dataset as the source tasks. We also
compare our approach to a semi-supervised learning approach (SSL).
\subsection{Finding Related Tasks}
We first discuss our approach
to
determine task relationships across the two datasets using
the non-parametric, lazy nearest neighbor approach (kNN) \cite{42}.
We use kNN
to find similar classes between the two datasets i.e., Wikipedia and DMOZ.
For determining the
nearest neighbor(s), we represent each of the classes
within the DMOZ and Wikipedia datasets by their centroidal
vectors. The centroidal
vector per class is computed by taking the average across all the examples within
a given class.
We then use Tanimoto Similarity (Jaccard index)
to compute similarities between the different classes across the two datasets.
Tanimoto
similarity is the ratio of the size of intersection divided by the union. The
similarity is known to work well for large dimensions with a lot of zeros (sparsity).
Using kNN, we find for each class of interest a set of
neighboring classes within
the second dataset. Within the MTL approach we constrain the related
classes to learn similar weight vectors when jointly learning the model
parameters. In TL approach we learn the weight vectors for related
classes and transfer the information over to the target task. We also
use the related classes to supplement the number of positive examples
for each of the classes within a baseline
semi-supervised learning approach (SSL).
\subsection{MTL method}
Given the two dataset sources $S_1$ and $S_2$, we
represent the total number of classes (and hence the number of
binary classification tasks) within each of them
by $T^{S_1}$ and $T^{S_2}$, respectively.
The individual parameters per classification task is represented by
$\theta$ with model parameters for $S_1$ denoted by $\theta^{S_1}$ and
parameters for $S_2$ denoted by $\theta^{S_2}$. The combined model parameters
for $S_1$ and $S_2$ are
denoted by $\Theta^{S_1}$ and $\Theta^{S_2}$, respectively.
The MTL minimization objective can then be given by:
\begin{multline} \sum_{t=1}^{T^{S_1}} \sum_{i=1}^{n_t} L(\theta_t^{S_1}, x_{it}, y_{it}) + \sum_{t=1}^{T^{S_2}} \sum_{i=1}^{n_t} L(\theta_t^{S_2}, x_{it}, y_{it}) +\\
\lambda_1 \sum_{t=1}^{T^{S_1}} ||\theta_t^{S_1}||_2^2 + \lambda_2 \sum_{t=1}^{T^{S_2}} ||\theta_t^{S_2}||_2^2 +
\lambda_3 R(\Theta^{S_1}, \Theta^{S_2}) \end{multline}
where the first two terms are loss computed for each of
the two dataset-specific models. To control the model complexity we then
include a $l_2$-norm (denoted by $||\cdot ||_2$),
for each of the different classification tasks within $S_1$ and $S_2$. Finally,
$R(\Theta^{S_1}, \Theta^{S_2})$ controls the relationships between the tasks
found to be related using the kNN approach across the two databases. Parameters
$\lambda_1$, $\lambda_2$ and $\lambda_3$ control the weights associated with
each of the different regularization parameters.
Based on how we constrain the related tasks, we
discuss two approaches:
\begin{itemize}
\item Neighborhood Pooling Approach (NPA). In
this approach, for each of the
tasks within $S_1$ we find the $k$-related
neighbors from the other dataset $S_2$. We repeat this by finding
related neighbors in $S_1$ for each class in $S_2$.
Then we pool all the training examples within the related classes
and assume that there exists one pooled task for each of the original task. We then
constrain the model vectors
for each task to be similar to the pooled model vector. We represent this
as
\begin{small}
\begin{equation}
R(\Theta^{S_1}, \Theta^{S_2}) = \sum_{t=1}^{T^{S_1}} ||\theta_t^{S_1} - \theta_{NPA(t)}^{S_2}||_2^2 + \sum_{t=1}^{T^{S_2}} ||\theta_t^{S_2} - \theta_{NPA(t)}^{S_1}||_2^2 \end{equation}
\end{small}
where $\theta_{NPA}(t)^{S_2}$ represents
the pooled related neighbor model within $S_2$. The
weight vectors for the original tasks and new pooled tasks
are learned simultaneously. We
denote this approach as MTL-NPA.
\item Individual Neighborhood Approach (INA). In this
approach we consider all the
$k$ related
neighbors from the second source
as individual tasks. As such we constrain each task model vector to be similar
to each of the $k$ related task vectors. The regularization term
can then be given by:
\begin{small}
\begin{equation}
R(\Theta^{S_1}, \Theta^{S_2}) = \sum_{t=1}^{T^{S_1}} \sum_{l=1}^{k}||\theta_t^{S_1} -\Theta_{I(l)}^{S_2}||_2^2 +
\sum_{t=1}^{T^{S_2}} \sum_{l=1}^{k} ||\theta_t^{S_2} - \Theta_{I(l)}^{S_1}||_2^2
\end{equation}
\end{small}
where $I(\cdot)$ is an indicator function representing the identified
nearest neighbor task vectors within the second dataset.
We refer to this approach as MTL-INA.
\end{itemize}
\subsection{Transfer Learning Approach.}
The TL
method differs from the MTL method in the
learning process. In MTL
all the related task model parameters are
learned simultaneously whereas
in TL method learned parameters of the related task
are transferred to the main task to improve
model performance. Within our
TL method, we
use the parameters from the
neighboring tasks within the
regularization term for the
main task.
Similar to the MTL models, we implement both the pooling and individual
neighborhood approaches for transfer learning.
\subsubsection{Neighborhood Pooling Approach (TL-NPA)}
This method pools the
$k$ neighbors for each of the tasks considered to be within the primary
dataset.
After pooling, at first using STL the parameters for the pooled model are learned. The pooled
parameters for task $t$ from the secondary source database (S)
are represented as $\theta_{NPA(t)}^{S}$.
Assuming $S_1$ to be the main task dataset we can write the objective function
for each of the $t$ task within $S_1$ as follows:
\begin{equation}
\min_{\theta_t^{S_1}} \sum_{i=1}^{n_t} L(\theta_t^{S_1}, x_{it}, y_{it}) + \lambda_1 ||\theta_t^{S_1}||_2^2 + \lambda_2 || \theta_t - \theta_{NPA(t)}^{S_2}||_2^2
\end{equation}
We can similarly write the objective assuming $S_2$ to be the main/primary dataset.
\subsubsection{Individual Neighborhood Approach (TL-INA)}
In this approach, for
each of the $k$ neighborhood tasks, we learn the parameter vectors individually (using STL). After this, a transfer
of information is performed from each of the related tasks to the main/parent tasks. We can represent this within the
TL objective as follows:
\begin{equation}
\min_{\theta_t^{S_1}} \sum_{i=1}^{n_t} L(\theta_t^{S_1}, x_{it}, y_{it}) + \lambda_1 ||\theta_t^{S_1}||_2^2 + \lambda_2 \sum_{l=1}^{k} || \theta_t - \Theta_{I(l)}^{S_2}||_2^2
\end{equation}
The last regularization term is similar to the MTL-INA approach discussed earlier, where $I(\cdot)$ represents an indicator
function to extract the $k$-related tasks. We can also assume $S_2$ to be the target/parent dataset.
\subsection{Single Task Learning}
Single Task Learning (STL) lies within the standard machine learning
paradigm, where
each classification task is treated
independently of each other during the training phase.
The learning objective of the
regularized STL model is given by Equation 1.
In this paper,
logistic regression is used as the loss function for all the binary
classification tasks.
One advantage of
using this loss function is that it is smooth and convex.
Specifically, the STL objective
can
be rewritten as,
\begin{equation} \min \sb \theta \sum_{i=1}^{n}log\Big({1+exp(-y_i\theta^{T}x_i)}\Big) + \frac{\lambda}{2}{||\theta||}_2^2\end{equation}
where, $y \in {\{\pm1\}}$ is the binary class label
for $x$, $\theta$ is the model vector/parameters.
For preventing the model from over-fitting we have used
the $l_2$-norm over the $\theta$ and
${\lambda}$ is the regularization parameter.
\subsection{Semi-Supervised Learning Approach.}
Semi-Supervised Learning (SSL) involves
use of both labeled and unlabeled data for learning
the parameters of the classification model. SSL
approaches lie between unsupervised (no labeled training data)
and supervised learning (completely
labeled training data) \cite{41}. SSL works
on the principle that more the training examples leads to
better generalization. However, the
performance of SSL is largely dependent on how
we treat the unlabeled data with the
labeled data.
Our SSL approach works the same way as the
STL method with only difference in the increase in
number of labeled examples from the related classes found
using the kNN approach.
Within the SSL approach, for each classification task
we treat training examples from related classes as positive
examples for the class under consideration.
We implemented the SSL approach along with STL approach as baseline
to compare against the developed
MTL and TL approaches.
\section{Experimental Evaluations}
\subsection{Dataset}
To evaluate our methods, we used DMOZ and Wikipedia
datasets from ECML/PKDD 2012 Large Scale Hierarchical
Text Classification Challenge (LSHTC) (Track 2) \footnote{http://lshtc.iit.demokritos.gr/LSHTC3\_DATASETS}. The
challenge is closed for new
submission and the labels of the test set
are not publicly available. We used the original
training set for training, validation and
testing by splitting it into 3:1:1 ratios, respectively and reporting the average of five runs. To
assess the performance of our
method with respect to the class size, in terms of
the number of training examples, we categorized the classes
into Low Distribution (LD), with 25 examples per class
and High Distribution (HD), with 250 examples per class.
This resulted in DMOZ dataset having 75 classes within LD and
53 classes within HD. For the Wikipedia dataset we had
84 classes within LD and 62 classes within HD. More details about the dataset can be found in the Naik et. al. thesis \cite{naik2013using}.
\subsection{Implementation}
For learning the weight vectors across all the models, we implemented
gradient descent algorithm. Implementation was done in MATLAB and all runs
were performed on a server workstation with a dual-core
Intel Xeon CPU 2.40GHz processor and 4GB RAM.
\subsection{Metrics\label{sec:metrics}}
We
used three
metrics for evaluating
the classification performance
that take into account True Positives ($TP$), False
Positives ($FP$), True Negatives ($TN$) and False
Negatives ($FN$) for each of the classes.
\subsubsection{Micro-Averaged $F_1$}
Micro-Averaged $F_1$ ($\mu$A$F_1$) is a conventional metric for evaluating classifiers in category assignment\cite{39}\cite{40}. To compute this metric we sum up the category specific True Positives $(TP_c)$, False Positives $(FP_c)$, True Negatives $(TN_c)$ and False Negatives $(FN_c)$ across all the categories, $c\in C \equiv \{c_1,c_2,\ldots,c_{N_c}\}$ and compute the averaged $F_1$ score. It is defined as follows,
\begin{equation}Global Precision \;P = \frac{\sum_{c=1}^{N_c}TP_c}{\sum_{c=1}^{N_c}(TP_c + FP_c)}\end{equation}
\begin{equation}Global Recall \;R = \frac{\sum_{c=1}^{N_c}TP_c}{\sum_{c=1}^{N_c}(TP_c + FN_c)}\end{equation}
\begin{equation}\mu A F_1 = \frac{2PR}{P + R}\end{equation}
where, $N_c$ is the number of categories/classes.\\
\subsubsection{Macro-Averaged Precision, Recall and $F_1$}
The Macro-Averaged Precision (MAP), Recall (MAR) and $F_1$ (MA$F_1$) are computed by calculating the respective Precision, Recall and $F_1$ scores for each individual category and then averaging them across all the categories\cite{37}. In computing these metrics all the categories are given equal weight so that the score is not skewed in favor of the larger categories,
\begin{equation}Category-specific \;Precision \;P_c = \frac{TP_c}{TP_c + FP_c}\end{equation}
\begin{equation}Category-specific \;Recall \;R_c = \frac{TP_c}{TP_c + FN_c}\end{equation}
\begin{equation}MAP = \frac{1}{N_c}\sum_{c=1}^{N_c}\frac{TP_c}{TP_c + FP_c}\end{equation}
\begin{equation}MAR = \frac{1}{N_c}\sum_{c=1}^{N_c}\frac{TP_c}{TP_c + FN_c}\end{equation}
\begin{equation}M A F_1 = \frac{1}{N_c}\sum_{c=1}^{N_c}\frac{2P_cR_c}{P_c + R_c}\end{equation}\\
\subsubsection{Averaged Matthews Correlation Coefficient score}
Matthews Correlation Coefficient (MCC) score \cite{38} is a balanced measure for binary classification which quantifies the correlation between the actual and predicted values. It returns a value between -1 and +1, where +1 indicates a perfect prediction, a score of 0 signifies no correlation and -1 indicate a perfect negative correlation between the actual and predicted values. The category specific MCC and averaged MCC are defined as,
\begin{multline} MCC_c = \\ \frac{(TP_c*TN_c) - (FP_c*FN_c)}{\sqrt{(TP_c + FP_c)(TP_c + FN_c)(TN_c + FP_c)(TN_c + FN_c)}}\end{multline}
\begin{equation} Avg. \; MCC \; (AMCC) = \frac{1}{N_c}\sum_{c=1}^{N_c} MCC_c \end{equation}
\section{Results}
We have implemented different models described in
Section III using DMOZ and Wikipedia as the two source datasets.
Figure \ref{fig:schema} outlines the different models that were evaluated. We varied
$k$ (number of nearest neighbor) from 2 to 6.
\begin{figure}
\centering
\includegraphics[scale=0.4]{CLFMODEL.jpg}
\caption{Summary of Evaluated Models. Wikipedia/DMOZ are inter-changeable in the protocol.}
\label{fig:schema}
\end{figure}
\begin{table*}
\begin{centering}
\begin{tabular}{|cc||cc|cc|cc|cc|cc|}
\hline \hline
Model & & \multicolumn{2}{c|}{$\mu$A$F_1$} & \multicolumn{2}{c|}{MAP} & \multicolumn{2}{c|}{MAR} & \multicolumn{2}{c|}{MA$F_1$} & \multicolumn{2}{c|}{AMCC}\\ \hline \hline
STL && 0.5758 & (0.0121) & 0.7914 & (0.0267) & 0.6167 & (0.0115) & 0.6486 & (0.0060) & 0.6732 & (0.0074)\\ \hline \hline
\multirow{5}{*}{SSL} & ($k = 2$) & 0.6178 & (0.0160) & 0.8064 & (0.0413) & 0.6649 & (0.0125) & 0.6789 & (0.0231) & 0.7048 & (0.0263) \\
& ($k = 3$) & 0.6316 & (0.0216) & 0.8059 & (0.0218) & 0.6782 & (0.0230) & 0.6808 & (0.0195) & 0.7092 & (0.0185)\\
& ($k = 4$) & 0.6581 & (0.0392) & 0.8090 & (0.0292) & 0.6888 & (0.0329) & 0.6974 & (0.0284) & 0.7208 & (0.0492)\\
& ($k = 5$) & 0.6719 & (0.0540) & \bf0.8091 & \bf(0.0406) & 0.7093 & (0.0314) & 0.7045 & (0.0152) & 0.7359 & (0.0064) \\
& ($k = 6$) & 0.6624 & (0.0356) & 0.8011 & (0.0216) & 0.7089 & (0.0387) & 0.6919 & (0.0284) & 0.7175 & (0.0182)\\ \hline \hline
\multirow{5}{*}{TL-NPA} & ($k = 2$) & 0.5739 & (0.0044) & 0.7987 & (0.0278) & 0.6247 & (0.0091) & 0.6481 & (0.0062) & 0.6732 & (0.0074) \\
& ($k = 3$) & 0.5728 & (0.0103) & 0.7893 & (0.0128) & 0.6250 & (0.0126) & 0.6480 & (0.0081) & 0.6737 & (0.0171)\\
& ($k = 4$) & 0.5732 & (0.0124) & 0.7981 & (0.0221) & 0.6232 & (0.0753) & 0.6483 & (0.0375) & 0.6738 & (0.0128)\\
& ($k = 5$) & 0.5755 & (0.0030) & 0.8027 & (0.0314) & 0.6262 & (0.0077) & 0.6504 & (0.0083) & 0.6757 & (0.0097)\\
& ($k = 6$) & 0.5738 & (0.0462) & 0.7413 & (0.0593) & 0.6096 & (0.0522) & 0.6248 & (0.0563) & 0.6631 & (0.0387)\\ \hline \hline
\multirow{5}{*}{TL-INA} & ($k = 2$) & 0.5736 & (0.0038) & 0.7967 & (0.0262) & 0.6246 & (0.0184) & 0.6478 & (0.0040) & 0.6728 & (0.0054) \\
& ($k = 3$) & 0.5810 & (0.0731) & 0.7918 & (0.0137) & 0.6182 & (0.0126) & 0.6488 & (0.0031) & 0.6794 & (0.0138)\\
& ($k = 4$) & 0.5771 & (0.0192) & 0.7939 & (0.0191) & 0.6173 & (0.0188) & 0.6394 & (0.0113) & 0.6748 & (0.0312)\\
& ($k = 5$) & 0.5712 & (0.0034) & 0.8024 & (0.0226) & 0.6212 & (0.0091) & 0.6467 & (0.0034) & 0.6724 & (0.0047)\\
& ($k = 6$) & 0.5700 & (0.0144) & 0.7853 & (0.0268) & 0.6132 & (0.0164) & 0.6298 & (0.0372) & 0.6489 & (0.0189)\\ \hline \hline
\multirow{5}{*}{MTL-NPA} & ($k = 2$) & \bf0.7442 & \bf(0.0201) & 0.7819 & (0.0356) & \bf0.7840 & \bf(0.0169) & \bf0.7373 & \bf(0.0349) & \bf0.7527 & \bf(0.0335)\\
& ($k = 3$) & 0.7438 & (0.0192) & 0.7901 & (0.0461) & 0.7782 & (0.0329) & 0.7350 & (0.0247) & 0.7515 & (0.0282)\\
& ($k = 4$) & 0.7403 & (0.0431) & 0.7884 & (0.0453) & 0.7891 & (0.0212) & 0.7346 & (0.0221) & 0.7501 & (0.0101)\\
& ($k = 5$) & 0.7394 & (0.0219) & 0.7720 & (0.0421) & 0.7814 & (0.0140) & 0.7293 & (0.0318) & 0.7488 & (0.0298)\\
& ($k = 6$) & 0.7120 & (0.0128) & 0.7104 & (0.0144) & 0.7581 & (0.0213) & 0.6866 & (0.0422) & 0.7061 & (0.0431)\\ \hline \hline
\multirow{5}{*}{MTL-INA} & ($k = 2$) & 0.7208 & (0.0180) & 0.7583 & (0.0503) & 0.7664 & (0.0211) & 0.7052 & (0.0520) & 0.7326 & (0.0367) \\
& ($k = 3$) & 0.7294 & (0.0213) & 0.7592 & (0.0101) & 0.7616 & (0.0473) & 0.7070 & (0.0211) & 0.7313 & (0.0312)\\
& ($k = 4$) & 0.7000 & (0.0431) & 0.7281 & (0.0213) & 0.7502 & (0.0131) & 0.6899 & (0.0432) & 0.7024 & (0.0293)\\
& ($k = 5$) & 0.7079 & (0.0136) & 0.7352 & (0.0306) & 0.7508 & (0.0085) & 0.6949 & (0.0255) & 0.7147 & (0.0243)\\
& ($k = 6$) & 0.6992 & (0.0721) & 0.7271 & (0.0721) & 0.7321 & (0.0632) & 0.6797 & (0.0413) & 0.7024 & (0.0339)\\ \hline \hline
\end{tabular}
\par\end{centering}
\begin{tablenotes}
\tiny
\item \center Table shows mean across five runs and (standard deviation) in bracket, standard error for best model: MTL-NPA ($k$ = 2) = 0.0054
\end{tablenotes}
\caption{Classification Performance for LD Sample shown for DMOZ dataset. \label{tab:low-distribution-DMOZ}}
\end{table*}
\begin{table*}
\begin{centering}
\begin{tabular}{|cc||cc|cc|cc|cc|cc|}
\hline \hline
Model & & \multicolumn{2}{c|}{$\mu$A$F_1$} & \multicolumn{2}{c|}{MAP} & \multicolumn{2}{c|}{MAR} & \multicolumn{2}{c|}{MA$F_1$} & \multicolumn{2}{c|}{AMCC}\\ \hline \hline
STL && 0.5236 & (0.0989) & 0.6415 & (0.0741) & 0.5213 & (0.0998) & 0.5318 & (0.0625) & 0.5837 & (0.0782)\\ \hline \hline
\multirow{5}{*}{SSL} & ($k = 2$) & 0.5182 & (0.0321) & 0.6392 & (0.0932) & 0.5348 & (0.0631) & 0.5264 & (0.0674) & 0.5748 & (0.0183)\\
& ($k = 3$) & 0.5234 & (0.0723) & 0.6334 & (0.0673) & 0.5354 & (0.0300) & 0.5670 & (0.0641) & 0.5739 & (0.0629)\\
& ($k = 4$) & 0.5329 & (0.0631) & 0.6312 & (0.0681) & 0.5360 & (0.0810) & 0.5698 & (0.0524) & 0.5802 & (0.0285)\\
& ($k = 5$) & 0.5102 & (0.0642) & 0.6124 & (0.0773) & 0.5279 & (0.0273) & 0.5490 & (0.0831) & 0.5772 & (0.0641)\\
& ($k = 6$) & 0.5043 & (0.0731) & 0.6042 & (0.0204) & 0.5186 & (0.0942) & 0.5468 & (0.0632) & 0.5547 & (0.0228)\\ \hline \hline
\multirow{5}{*}{TL-NPA} & ($k = 2$) & 0.5418 & (0.0182) & 0.6682 & (0.0136) & 0.5633 & (0.0362) & 0.5823 & (0.0317) & 0.6930 & (0.0831) \\
& ($k = 3$) & 0.5512 & (0.0521) & 0.6620 & (0.0317) & 0.5784 & (0.0674) & 0.5982 & (0.0742) & 0.6894 & (0.0674)\\
& ($k = 4$) & 0.5332 & (0.0153) & 0.6581 & (0.0239) & 0.5616 & (0.0083) & 0.5813 & (0.0873) & 0.6740 & (0.0543)\\
& ($k = 5$) & 0.5295 & (0.0743) & 0.6327 & (0.0854) & 0.5610 & (0.0674) & 0.5704 & (0.0029) & 0.6649 & (0.0895)\\
& ($k = 6$) & 0.5238 & (0.0235) & 0.6136 & (0.0487) & 0.5427 & (0.0500) & 0.5684 & (0.0748) & 0.6386 & (0.0856)\\ \hline \hline
\multirow{5}{*}{TL-INA} & ($k = 2$) & 0.5368 & (0.0573) & 0.6734 & (0.0198) & 0.5464 & (0.0563) & 0.5982 & (0.0130) & 0.6946 & (0.0846) \\
& ($k = 3$) & 0.5408 & (0.0464) & 0.6648 & (0.0895) & 0.5696 & (0.0187) & 0.5928 & (0.0481) & 0.6994 & (0.0101)\\
& ($k = 4$) & 0.5319 & (0.0042) & 0.6598 & (0.0452) & 0.5573 & (0.0526) & 0.5810 & (0.0736) & 0.6848 & (0.0654)\\
& ($k = 5$) & 0.5278 & (0.0674) & 0.6394 & (0.0895) & 0.5210 & (0.0183) & 0.5624 & (0.0901) & 0.6740 & (0.0538)\\
& ($k = 6$) & 0.5101 & (0.0587) & 0.6153 & (0.0519) & 0.5052 & (0.0456) & 0.5248 & (0.0831) & 0.6382 & (0.0873)\\ \hline \hline
\multirow{5}{*}{MTL-NPA} & ($k = 2$) & 0.6389 & (0.0648) & 0.6635 & (0.0782) & 0.6615 & (0.0637) & 0.6626 & (0.0682) & 0.6582 & (0.0738)\\
& ($k = 3$) & \bf0.6390 & \bf(0.0723) & \bf0.6832 & \bf(0.0672) & \bf0.6650 & \bf(0.0421) & \bf0.6724 & \bf(0.0432) & \bf0.6628 & \bf(0.0764)\\
& ($k = 4$) & 0.6283 & (0.0748) & 0.6624 & (0.0613) & 0.6593 & (0.0382) & 0.6602 & (0.0936) & 0.6585 & (0.0631)\\
& ($k = 5$) & 0.6128 & (0.0784) & 0.6626 & (0.0632) & 0.6429 & (0.0823) & 0.6593 & (0.0529) & 0.6497 & (0.0874)\\
& ($k = 6$) & 0.6003 & (0.0524) & 0.6498 & (0.0874) & 0.6193 & (0.0623) & 0.6282 & (0.0817) & 0.6046 & (0.0734)\\ \hline \hline
\multirow{5}{*}{MTL-INA} & ($k = 2$) & 0.6120 & (0.0629) & 0.6448 & (0.0325) & 0.6428 & (0.0618) & 0.6432 & (0.0663) & 0.6420 & (0.0728)\\
& ($k = 3$) & 0.6194 & (0.0437) & 0.6328 & (0.0224) & 0.6480 & (0.0642) & 0.6406 & (0.0910) & 0.6394 & (0.0429)\\
& ($k = 4$) & 0.6036 & (0.0421) & 0.6262 & (0.0639) & 0.6338 & (0.0632) & 0.6324 & (0.0138) & 0.6310 & (0.0309)\\
& ($k = 5$) & 0.6040 & (0.0101) & 0.6160 & (0.0819) & 0.6282 & (0.0192) & 0.6202 & (0.0328) & 0.6290 & (0.0456)\\
& ($k = 6$) & 0.5842 & (0.0457) & 0.5820 & (0.0282) & 0.5926 & (0.0478) & 0.5846 & (0.0885) & 0.6082 & (0.0402)\\ \hline \hline
\end{tabular}
\par\end{centering}
\begin{tablenotes}
\tiny
\item \center Table shows mean across five runs and (standard deviation) in bracket, standard error for best model: MTL-NPA ($k$ = 3) = 0.0087
\end{tablenotes}
\caption{Classification Performance for LD sample shown for Wikipedia dataset. \label{tab:low-distribution-Wikipedia}}
\end{table*}
\subsection{Accuracy Comparison}
\subsubsection{Low distribution sample}
Tables \ref{tab:low-distribution-DMOZ} and \ref{tab:low-distribution-Wikipedia} show the average performance across five runs for DMOZ and Wikipedia Low Distribution (LD) classes. The following observations can be made from the results.
\begin{itemize}
\item {\bf {STL v/s SSL v/s TL v/s MTL}}:
For both the datasets we see that the
MTL methods outperforms all the
other methods across all the metrics, exception being in case of LD DMOZ dataset MAP metric. Reason for such exception is high relatedness between the main task and its corresponding neighboring task(s). We also
note that among the MTL approaches the
Neighborhood Pooling Approach (MTL-NPA) outperformed
the Individual Neighborhood Approach (MTL-INA) (statistically significant). Semi-Supervised Learning (SSL) method
marginally outperformed both Single Task Learning (STL)
as well as Transfer Learning (TL) methods. TL did not seem
to have any benefit over STL.
\item {\bf {$k$ = 2 v/s $k$ = 3 v/s $k$ = 4 v/s $k$ = 5 v/s $k$ = 6}}:
In general, lower value of $k$ gave better models compared to higher values of $k$. We conjecture that as the value of $k$ increases, similarity between the main task and the surrogate tasks decreases, which in turn affects the performance negatively.
\end{itemize}
\begin{table*}
\begin{centering}
\begin{tabular}{|cc||cc|cc|cc|cc|cc|}
\hline \hline
Model & & \multicolumn{2}{c|}{$\mu$A$F_1$} & \multicolumn{2}{c|}{MAP} & \multicolumn{2}{c|}{MAR} & \multicolumn{2}{c|}{MA$F_1$} & \multicolumn{2}{c|}{AMCC}\\ \hline \hline
STL && 0.7592 & (0.0120) & 0.7947 & (0.0068) & 0.7618 & (0.0056) & 0.7567 & (0.0085) & 0.7626 & (0.0075)\\ \hline \hline
\multirow{5}{*}{SSL} & ($k = 2$) & 0.7535 & (0.0040) & 0.7938 & (0.0065) & 0.7601 & (0.0011) & 0.7547 & (0.0052) & 0.7609 & (0.0048)\\
& ($k = 3$) & 0.7542 & (0.0127) & 0.7998 & (0.0032) & 0.7624 & (0.0102) & 0.7657 & (0.0020) & 0.7646 & (0.0091)\\
& ($k = 4$) & 0.7512 & (0.0031) & 0.7972 & (0.0084) & 0.7618 & (0.0090) & 0.7592 & (0.0029) & 0.7628 & (0.0075)\\
& ($k = 5$) & 0.7545 & (0.0027) & 0.7948 & (0.0060) & 0.7610 & (0.0018) & 0.7559 & (0.0039) & 0.7619 & (0.0034)\\
& ($k = 6$) & 0.7491 & (0.0042) & 0.7778 & (0.0143) & 0.7482 & (0.0042) & 0.7437 & (0.0092) & 0.7542 & (0.0086)\\ \hline \hline
\multirow{5}{*}{TL-NPA} & ($k = 2$) & 0.7536 & (0.0042) & 0.7936 & (0.0054) & 0.7588 & (0.0015) & 0.7546 & (0.0048) & 0.7610 & (0.0043)\\
& ($k = 3$) & 0.7538 & (0.0053) & 0.7941 & (0.0027) & 0.7590 & (0.0061) & 0.7551 & (0.0024) & 0.7595 & (0.0063)\\
& ($k = 4$) & 0.7532 & (0.0028) & 0.7940 & (0.0037) & 0.7585 & (0.0072) & 0.7544 & (0.0053) & 0.7623 & (0.0022)\\
& ($k = 5$) & 0.7533 & (0.0038) & 0.7937 & (0.0063) & 0.7584 & (0.0024) & 0.7542 & (0.0052) & 0.7605 & (0.0046)\\
& ($k = 6$) & 0.7406 & (0.0064) & 0.7888 & (0.0022) & 0.7414 & (0.0072) & 0.7389 & (0.0041) & 0.7594 & (0.0027)\\ \hline \hline
\multirow{5}{*}{TL-INA} & ($k = 2$) & 0.7529 & (0.0040) & 0.7958 & (0.0054) & 0.7591 & (0.0011) & 0.7540 & (0.0048) & 0.7603 & (0.0043)\\
& ($k = 3$) & 0.7631 & (0.0074) & 0.7964 & (0.0010) & 0.7612 & (0.0027) & 0.7548 & (0.0029) & 0.7696 & (0.0072)\\
& ($k = 4$) & 0.7530 & (0.0091) & 0.7968 & (0.0020) & 0.7606 & (0.0013) & 0.7542 & (0.0017) & 0.7596 & (0.0062)\\
& ($k = 5$) & 0.7527 & (0.0038) & 0.7957 & (0.0046) & 0.7590 & (0.0010) & 0.7538 & (0.0036) & 0.7602 & (0.0042)\\
& ($k = 6$) & 0.7432 & (0.0015) & 0.7849 & (0.0034) & 0.7442 & (0.0051) & 0.7414 & (0.0053) & 0.7591 & (0.0068)\\ \hline \hline
\multirow{5}{*}{MTL-NPA} & ($k = 2$) & 0.7572 & (0.0080) & 0.7961 & (0.0063) & 0.7637 & (0.0058) & 0.7587 & (0.0087) & 0.7644 & (0.0076)\\
& ($k = 3$) & 0.7598 & (0.0072) & 0.7978 & (0.0089) & 0.7644 & (0.0062) & 0.7649 & (0.0074) & 0.7701 & (0.0086)\\
& ($k = 4$) & 0.7571 & (0.0035) & 0.7964 & (0.0076) & 0.7632 & (0.0093) & 0.7584 & (0.0102) & 0.7640 & (0.0054)\\
& ($k = 5$) & 0.7569 & (0.0043) & 0.7969 & (0.0058) & 0.7627 & (0.0012) & 0.7581 & (0.0053) & 0.7639 & (0.0048)\\
& ($k = 6$) & 0.7482 & (0.0087) & 0.7712 & (0.0081) & 0.7512 & (0.0014) & 0.7392 & (0.0076) & 0.7436 & (0.0030)\\ \hline \hline
\multirow{5}{*}{MTL-INA} & ($k = 2$) & 0.7579 & (0.0103) & 0.7978 & (0.0076) & 0.7644 & (0.0079) & 0.7599 & (0.0111) & 0.7657 & (0.0099)\\
& ($k = 3$) & \bf0.7680 & \bf(0.0097) & \bf0.8020 & \bf(0.0047) & \bf0.7790 & \bf(0.0089) & \bf0.7728 & \bf(0.0092) & \bf0.7728 & \bf(0.0121)\\
& ($k = 4$) & 0.7662 & (0.0087) & 0.8012 & (0.0026) & 0.7742 & (0.0085) & 0.7696 & (0.0129) & 0.7719 & (0.0105)\\
& ($k = 5$) & 0.7657 & (0.0067) & 0.8017 & (0.0073) & 0.7717 & (0.0037) & 0.7678 & (0.0081) & 0.7726 & (0.0072)\\
& ($k = 6$) & 0.7526 & (0.0089) & 0.7818 & (0.0129) & 0.7664 & (0.0051) & 0.7529 & (0.0066) & 0.7648 & (0.0059)\\ \hline \hline
\end{tabular}
\par\end{centering}
\begin{tablenotes}
\tiny
\item \center Table shows mean across five runs and (standard deviation) in bracket, standard error for best model: MTL-INA ($k$ = 3) = 0.0038
\end{tablenotes}
\caption{Classification Performance for HD sample shown for DMOZ dataset. \label{tab:high-distribution-DMOZ}}
\end{table*}
\begin{table*}
\begin{centering}
\begin{tabular}{|cc||cc|cc|cc|cc|cc|}
\hline \hline
Model & & \multicolumn{2}{c|}{$\mu$A$F_1$} & \multicolumn{2}{c|}{MAP} & \multicolumn{2}{c|}{MAR} & \multicolumn{2}{c|}{MA$F_1$} & \multicolumn{2}{c|}{AMCC}\\ \hline \hline
STL && 0.6648 & (0.0628) & 0.6841 & (0.0630) & 0.6429 & (0.0089) & 0.6748 & (0.0172) & 0.6881 & (0.0120)\\ \hline \hline
\multirow{5}{*}{SSL} & ($k = 2$) & 0.6584 & (0.0067) & 0.6848 & (0.0178) & 0.6492 & (0.0238) & 0.6780 & (0.0324) & 0.6782 & (0.0182)\\
& ($k = 3$) & 0.6528 & (0.0262) & 0.6804 & (0.0572) & 0.6498 & (0.0546) & 0.6680 & (0.0821) & 0.6778 & (0.0239)\\
& ($k = 4$) & 0.6530 & (0.0287) & 0.6768 & (0.0231) & 0.6400 & (0.0262) & 0.6612 & (0.0387) & 0.6704 & (0.0263)\\
& ($k = 5$) & 0.6428 & (0.0624) & 0.6706 & (0.0189) & 0.6364 & (0.0423) & 0.6596 & (0.0346) & 0.6686 & (0.0456)\\
& ($k = 6$) & 0.6320 & (0.0822) & 0.6700 & (0.0037) & 0.6342 & (0.0892) & 0.6502 & (0.0521) & 0.6648 & (0.0190)\\ \hline \hline
\multirow{5}{*}{TL-NPA} & ($k = 2$) & 0.6628 & (0.0636) & 0.6820 & (0.0976) & 0.6528 & (0.0174) & 0.6792 & (0.0733) & 0.6840 & (0.0785)\\
& ($k = 3$) & 0.6614 & (0.0463) & 0.6838 & (0.0842) & 0.6510 & (0.0597) & 0.6797 & (0.0471) & 0.6888 & (0.0823)\\
& ($k = 4$) & 0.6528 & (0.0367) & 0.6735 & (0.0963) & 0.6482 & (0.0871) & 0.6626 & (0.0913) & 0.6710 & (0.0731)\\
& ($k = 5$) & 0.6500 & (0.0689) & 0.6629 & (0.0729) & 0.6285 & (0.0463) & 0.6389 & (0.0582) & 0.6618 & (0.0838)\\
& ($k = 6$) & 0.6450 & (0.0893) & 0.6482 & (0.0572) & 0.6021 & (0.0578) & 0.6124 & (0.0527) & 0.6484 & (0.0657)\\ \hline \hline
\multirow{5}{*}{TL-INA} & ($k = 2$) & 0.6531 & (0.0462) & 0.6623 & (0.0572) & 0.6482 & (0.0863) & 0.6504 & (0.0427) & 0.6731 & (0.0865)\\
& ($k = 3$) & 0.6512 & (0.0845) & 0.6547 & (0.0864) & 0.6273 & (0.0974) & 0.6397 & (0.0645) & 0.6682 & (0.0472)\\
& ($k = 4$) & 0.6510 & (0.0467) & 0.6524 & (0.0246) & 0.6244 & (0.0755) & 0.6326 & (0.0624) & 0.6539 & (0.0573)\\
& ($k = 5$) & 0.6427 & (0.0533) & 0.6510 & (0.0217) & 0.6218 & (0.0381) & 0.6304 & (0.0256) & 0.6512 & (0.0972)\\
& ($k = 6$) & 0.6308 & (0.0572) & 0.6404 & (0.0384) & 0.6036 & (0.0330) & 0.6198 & (0.0472) & 0.6380 & (0.0753)\\ \hline \hline
\multirow{5}{*}{MTL-NPA} & ($k = 2$) & 0.6620 & (0.0672) & 0.6824 & (0.0317) & 0.6428 & (0.0871) & 0.6704 & (0.0174) & 0.6868 & (0.0623)\\
& ($k = 3$) & 0.6702 & (0.0053) & 0.6826 & (0.0183) & 0.6440 & (0.0542) & 0.6748 & (0.0831) & 0.6880 & (0.0542)\\
& ($k = 4$) & 0.6634 & (0.0184) & 0.6782 & (0.0172) & 0.6210 & (0.0281) & 0.6529 & (0.0600) & 0.6693 & (0.0622)\\
& ($k = 5$) & 0.6608 & (0.0731) & 0.6616 & (0.0722) & 0.6201 & (0.0193) & 0.6500 & (0.0783) & 0.6524 & (0.0734)\\
& ($k = 6$) & 0.6529 & (0.0620) & 0.6583 & (0.0318) & 0.6183 & (0.0731) & 0.6472 & (0.0561) & 0.6510 & (0.0582)\\ \hline \hline
\multirow{5}{*}{MTL-INA} & ($k = 2$) & \bf0.6720 & \bf(0.0134) & \bf0.6898 & \bf(0.0531) & 0.6548 & (0.0146) & \bf0.6784 & \bf(0.0142) & \bf0.6898 & \bf(0.0712)\\
& ($k = 3$) & 0.6717 & (0.0108) & 0.6864 & (0.0142) & \bf0.6550 & \bf(0.0398) & 0.6772 & (0.0152) & 0.6720 & (0.0256)\\
& ($k = 4$) & 0.6683 & (0.0040) & 0.6747 & (0.0051) & 0.6484 & (0.0193) & 0.6696 & (0.0641) & 0.6704 & (0.0138)\\
& ($k = 5$) & 0.6601 & (0.0839) & 0.6630 & (0.0931) & 0.6418 & (0.0322) & 0.6642 & (0.0412) & 0.6652 & (0.0313)\\
& ($k = 6$) & 0.6539 & (0.0713) & 0.6565 & (0.0172) & 0.6402 & (0.0742) & 0.6598 & (0.0193) & 0.6584 & (0.0105)\\ \hline \hline
\end{tabular}
\par\end{centering}
\begin{tablenotes}
\tiny
\item \center Table shows mean across five runs and (standard deviation) in bracket, standard error for best model: MTL-INA ($k$ = 2) = 0.0068
\end{tablenotes}
\caption{Classification Performance for HD sample shown for Wikipedia dataset. \label{tab:high-distribution-Wikipedia}}
\end{table*}
\subsubsection{High distribution sample}
Table \ref{tab:high-distribution-DMOZ} and \ref{tab:high-distribution-Wikipedia} show the average performance across five runs for DMOZ and Wikipedia High Distribution (HD) classes. We make the following observations based on the results.
\begin{itemize}
\item {\bf {STL v/s SSL v/s TL v/s MTL}}:
In this case we see that the MTL methods perform only slightly better than other models, the differences are not statistically significant. This supports our intuition that with sufficient number of examples for learning the SSL, TL and MTL methods do not provide any distinct advantage and the simple STL model is
competitive.
\item {\bf {$k$ = 2 v/s $k$ = 3 v/s $k$ = 4 v/s $k$ = 5 v/s $k$ = 6}}:
As with the case of Low Distribution classes, we noticed a slight degradation of performance as the number of neighbors is increased.
\end{itemize}
\subsection{Run time Comparison}
Table \ref{tab:runtime-DMOZ} shows the average training
time (in sec.) per class required to
learn the models for the different
LD and HD categories. The STL approach
has the lowest training times because there is
no overhead of incorporating additional
constraints is involved. SSL models takes more time than the
corresponding STL models because of the increased
number of training examples. For TL models as
well, run time increases because it requires learning the
models for the neighbors. Finally, MTL method takes the longest time, since
it requires
the joint learning of the model parameters
that are updated for each class and related neighbors.
\begin{table}
\begin{small}
\begin{centering}
\begin{tabular}{|cc||cc|cc|}
\hline \hline
& & \multicolumn{2}{c}{DMOZ} &\multicolumn{2}{c|}{Wiki}\\\hline
Model & & LD & HD & LD & HD\\ \hline \hline
STL && 2.72 & 44.7 & 2.84 & 46.7\\ \hline \hline
\multirow{3}{*}{SSL} & ($k = 2$) & 4.58 & 62.4 & 8.64 &68.3\\
& ($k = 4$) & 5.57 & 62.7 & 9.73 & 70.5\\
& ($k = 6$) & 6.48 & 64.3 & 10.6 & 73.0 \\ \hline \hline
\multirow{3}{*}{TL-NPA} & ($k = 2$) & 4.65 & 48.6 & 10.2 & 70.7 \\
& ($k = 4$) & 6.3 & 52.6 & 13.6 & 74.6 \\
& ($k = 6$) & 7.5 & 56.1 & 15.5 & 78.8 \\ \hline \hline
\multirow{3}{*}{TL-INA} & ($k = 2$) & 4.54 & 48.4 & 12.6 & 72.6 \\
& ($k = 4$) & 6.40 & 50.3 & 14.6 & 76.8\\
& ($k = 6$) & 7.98 & 54.7 & 15.6 & 80.7\\ \hline \hline
\multirow{3}{*}{MTL-NPA} & ($k = 2$) & 5.51 & 49.5 & 12.6 & 69.6 \\
& ($k = 4$) & 7.53 & 54.2 & 14.5 & 70.3\\
& ($k = 6$) & 8.75 & 58.1 & 15.8 & 72.4\\ \hline \hline
\multirow{3}{*}{MTL-INA} & ($k = 2$) & 9.84 & 56.8 & 17.8 & 78.7\\
& ($k = 4$) & 15.6 & 78.7 & 19.3 & 84.7\\
& ($k = 6$) & 18.8 & 82.8 & 22.3 & 92.4 \\ \hline \hline
\end{tabular}
\par\end{centering}
\caption{Run time (in sec.) comparison (Reported per class across five runs)\label{tab:runtime-DMOZ}}
\end{small}
\end{table}
\begin{comment}
\begin{table}
\begin{centering}
\begin{tabular}{|cc||c|c|}
\hline \hline
Model & & LD & HD\\ \hline \hline
STL && 2.8413 & 46.7321\\ \hline \hline
\multirow{3}{*}{SSL} & ($k = 2$) & 8.6423 & 68.3135\\
& ($k = 4$) & 9.7313 & 70.5643\\
& ($k = 6$) & 10.6422 & 72.9831\\ \hline \hline
\multirow{3}{*}{TL-NPA} & ($k = 2$) & 10.2579 & 70.7575\\
& ($k = 4$) & 13.6574 & 74.6746\\
& ($k = 6$) & 15.5456 & 78.7853\\ \hline \hline
\multirow{3}{*}{TL-INA} & ($k = 2$) & 12.6758 & 72.6757\\
& ($k = 4$) & 14.5757 & 76.7575\\
& ($k = 6$) & 15.6464 & 80.6835\\ \hline \hline
\multirow{3}{*}{MTL-NPA} & ($k = 2$) & 12.6423 & 69.6016\\
& ($k = 4$) & 14.5563 & 70.3671\\
& ($k = 6$) & 15.8242 & 72.4526\\ \hline \hline
\multirow{3}{*}{MTL-INA} & ($k = 2$) & 17.8754 & 78.7204\\
& ($k = 4$) & 19.3910 & 84.6765\\
& ($k = 6$) & 22.3942 & 92.3715\\ \hline \hline
\end{tabular}
\par\end{centering}
\caption{Average run time (in sec.) comparison of all Wikipedia models for low and high distribution\label{tab:runtime-WIKI}}
\end{table}
\end{comment}
\section{Conclusion and Future Work}
In this paper we developed Multi-task Learning models for text document classification. Performance of the MTL methods was compared with Single Task Learning, Semi-supervised Learning and Transfer Learning approaches. We compared the methods in terms of accuracy and run-times. MTL methods outperformed the other methods, especially for the Low Distribution classes, where the number of positive training examples was small. For the High Distribution classes with sufficient number of positive training examples, the performance improvement was not noticeable.
Datasets organize information as hierarchies. We plan to
extract the parent-child relationships existing within the DMOZ and Wikipedia hierarchies
to improve the classification performance.
We also plan to use the accelerated/proximal gradient descent approach to improve the
learning rates. Finally, we also seek to improve run-time performance
by implementing our approaches using data parallelism, seen in GPUs.
\section{Acknowledgement}
This project was funded by NSF career award 1252318.
\bibliographystyle{unsrt}
| {'timestamp': '2017-06-07T02:02:53', 'yymm': '1706', 'arxiv_id': '1706.01583', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01583'} | arxiv |
\section{INTRODUCTION}
\label{sec:intro}
\subsection{Vertebral Fracture}
The annual incidence of osteoporotic fractures in the United States surpasses the cumulative incidence of breast cancer, heart attack and stroke. The most common osteoporotic fractures are those which result in compression of a vertebral body [\citenum{kanis2004family}]. In addition to being a direct source of morbidity, vertebral compression fractures (VCF’s) indicate substantially elevated risk of future osteoporotic hip fractures, which represent the most consequential sequelae of osteoporosis.
Within a year of suffering osteoporotic hip fracture, 30\% of previously independent indiviuals will lose the ability to walk without assistance [\citenum{johnell2006estimate}], 25\% will become totally dependent or require nursing home facilities [\citenum{cite3},\citenum{leibson2002mortality}] and 20\% will not survive [\citenum{schnell20101}].
Prophylactic treatment of at-risk osteoporotic individuals has been shown to reduce the rate of future hip fracture by 40-70\%[\citenum{kanis2008european},\citenum{black2007once},\citenum{national2008alendronate}]. Yet, despite the burden and potential to prevent hip fractures in an ageing population, osteoporosis screening remains profoundly underutilized: less than 20\% of people older than 65 years undergo bone mineral density screening via Dual Energy X-ray Absorptiometry (DXA) evaluation, [\citenum{cite9}] as recommended by the National Osteoporosis Foundation.
VCF detection on CT examination is as predictive for future osteoporotic hip fractures as a DXA diagnosis of osteoporosis: detection of a VCF confers a relative risk ratio of 2.3 for experiencing a hip fracture and a 4.4 fold risk of incurring other additional insufficiency fractures [\citenum{national2008alendronate},\citenum{siris2001identification},\citenum{lindsay2001risk},\citenum{roux2007mild}]. Yet only 13\%-16\% of retrospectively confirmed VCF’s are actually reported at the time of computed tomographic (CT) interpretation [\citenum{carberry2013unreported}, \citenum{bartalena2009prevalence},\citenum{williams2009under}]. The expertise required to diagnose VCF's is far less than that required to make the vast majority of routine radiologic observations on CT imaging. In Carberry et al.’s study of VCF's, examining over 2000 CT examinations, the retrospective detection was accomplished by a medical student with one hour of dedicated compression fracture detection training [\citenum{carberry2013unreported}]. The reason why VCF's are routinely missed is more likely due to the fact that they are considered incidental findings relative to the primary clinical indication which prompted the CT study.
Here we describe a method to increase identification of at-risk individuals via automatic opportunistic detection of VCF’s on CT imaging.
\subsection{Convolutional Neural Networks}
Convolutional Neural Networks (CNN's) have proven immense utility when applied to Computer Vision tasks such as detection, segmentation and classification. Among CNN's advantages is the ability to learn a hierarchical representation from the input images and extract relevant features that generalize well across a large volume of data. This stands in contrast to conventional methods reliant on handcrafted feature design. Among the most successful CNN architectures for 2D image inputs are AlexNet, VGG, ResNet and Inception [\citenum{simonyan2014very},\citenum{krizhevsky2012imagenet}, \citenum{DBLP:journals/corr/HeZRS15}, \citenum{DBLP:journals/corr/SzegedyVISW15}].
\subsection{Recurrent Neural Networks}
Recurrent Neural Networks (RNN's) are a key Deep Learning tool used to model sequences and time series. RNN's are often combined with CNN's, using the CNN as a feature extractor and the RNN to model the sequence. RNN's are commonly utilized in tasks such as video classification [\citenum{DBLP:journals/corr/NgHVVMT15}], language modeling [\citenum{mikolov2010recurrent}], and speech recognition [\citenum{graves2013speech}], among others.
The algorithm proposed here comprises three main steps, once provided a CT of the chest and/or abdomen. First, a segmentation process extracts sagittal patches along the vertebral column. These patches are then binary classified using a CNN. Finally, an RNN is run on the resulting vector of probabilities. The RNN output is a prediction of the probability for the presence of a compression fracture within the input CT scan.
\section{RELATED WORK}
Previous work on spine segmentation and VCF detection focused primarily on achieving an accurate segmentation of each vertebra. Yao et al [\citenum{yao2012detection}] defined a novel method for segmentation of vertebrae, extracting the vertebral cortical circumference and mapping it into 2D for fracture detection. Ghosh et al [\citenum{ghosh2011automatic}] describe a VCF detection method based upon a 2D sagittal reconstruction, with relatively unstable results. Kelm et al [\citenum{kelm2013spine}] describe vertebral segmentation method using a disc-centered approach based on a probabilistic model which requires the full vertebral column to be included in the scan. Yao et al [\citenum{yao2006automated}] accomplishes the segmentation on axial slices – assessing the vertebral body as compared to an axial vertebral model. Discs are detected by low similarity to the model. This method was later used for feature-extraction based classification of vertebral fractures of osteoporotic or neoplastic etiology [\citenum{DBLP:journals/corr/WangYBS16}].
\section{DATA} \label{data}
We assembled an initial dataset from 3701 individuals over the age of 50 years who had undergone CT scans of Chest and/or Abdomen for any clinical indication. Two expert radiologists reviewed each CT and assessed them for the presence of VCF's as defined by Genant criteria for vertebral compression. A third radiologist (EE) served to mediate in instances of non-consensus. Of the 3701 CT studies, 2681 (72\%) were designated as negative for the presence of VCF and 1020 (28\%) were tagged as VCF positive, including a bounding box annotation indicating the fracture position.
The positive class was comprised of 61\% women of an average age of 73 years (std. 12.4), and 39\% men of average age 66.8 years (std. 16.8). The negative class was comprised of 47\% women of average age 56.7 years (std. 17.4) and 53\% men of average age 56.1 years (std. 17.9). These results are not surprising: the prevalence of VCF's is known to be substantially higher in women and elderly individuals. We determined however that such pronounced inter-group differences in demographic characteristics could introduce biases with unintended results. Training a classifier on this dataset might, for example, have resulted in an algorithm which has learned to distinguish between the spines of elderly women and younger men.
Considering the above, a more demographically balanced subset of CT studies was derived including 1673 CT studies, of which 849 were VCF negative and 824 VCF positive. The VCF negative and VCF positive groups were filtered to balance age and sex. The negative class contains 43\% men of average age of 64.7 years (std. 15.9) and 57\% women of average age years 69.4 (std. 11.8). The positive class contains 42\% men of average age 65.7 years (std. 16.0) and 58\% women of average age 70.4 years (std. 11.9). All algorithmic training was performed upon this more balanced data set.
Figure \ref{fig:init_dataset} and Figure \ref{fig:extracted_dataset} illustrate the initial and the extracted datasets properties respectively.
\begin{figure} [t!]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=4.5cm]{init_ds.png}
\end{tabular}
\end{center}
\caption[dataset]
{ \label{fig:init_dataset}
Initial dataset: negative class (left) and positive class (right). The positive class average age and the portion of females is higher. Training on this might result in learning a classifier which heavily relies on age and gender rather than VCF's. }
\end{figure}
\begin{figure} [t!]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=4.6cm]{extracted_ds.png}
\end{tabular}
\end{center}
\caption[dataset]
{ \label{fig:extracted_dataset}
Extracted age and sex balanced data set: negative class (left) and positive class (right). }
\end{figure}
\section{Method}
To automatically detect VCF's from a provided CT Chest or Abdomen, we constructed an algorithmic pipeline of three stages: first, we segment the portion of the spine included in the provided CT and extract sagittal patches. We then classify the patches using a CNN and employ a RNN on the resulting vector of probabilities. The training phase was performed on the patches extracted using the algorithm below.
\subsection{Spine Segmentation and Patch Extraction}
The spine segmentation algorithmic goal is to enable deterministic sagittal section patches extracted along the vertebral column. These patches are used as input samples for training and inference. The use of the patches will be further explained in subsection \ref{cnn_classification}.
Several spine segmentation approaches have been described. Ghosh et al [\citenum{ghosh2011automatic}] achieve spinal segmentation based upon the mid vertebral body in sagittal projection - a technique which has limited precision when applied to individuals with spinal scoliosis. To overcome limitations of variant spinal curvatures, we included a pre-processing step in generating a "virtual sagittal section" which first identifies and aligns the spinal cord in a straight cranial-caudal projection and then adjusts vertebral body location accordingly. We preferred this more relaxed segmentation approach for the task of VCF detection relative to several more accurate segmentation techniques for vertebrae [\citenum{yao2012detection},\citenum{kelm2013spine}] or discs [\citenum{ghosh2011automatic}, \citenum{yao2006automated}].
The “virtual sagittal section” creation is based on localization of the spinal cord in axial view, followed by tracking the back (posterior) of the individual along the spinal cord in coronal projection and bone intensity Hounsfield Unit (HU) threshold. The “virtual sagittal section” is used for segmentation of the vertebral column and extraction of sagittal patches of vertebrae to be learned and classified. The process of the algorithm is described in Figure \ref{fig:seg}.
This method was employed on the dataset described in section \ref{data} and was used to extract both positive and negative samples.
\begin{figure} [t!]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=4cm]{seg1.png}
\includegraphics[height=4cm]{seg2.png}
\includegraphics[height=4cm]{seg3.png}
\includegraphics[height=4cm]{seg4.png}
\end{tabular}
\end{center}
\caption[seg]
{ \label{fig:seg}
The above set of images describes the flow of segmentation and patch extraction. (a) An Axial reconstruction CT Chest DICOM image obtained at the level of the heart with a thoracic vertebra in the lower (posterior) middle location on the image. (b) A coronal reconstruction of the axial skeleton and ribs created by a binarization manifold following the scanned individual's back, where HU values measure bones intensity. The red line is the calculated position of the spinal cord. (c) A virtual sagittal section created by following the spinal cord. On this 2D section the vertebral column is segmented and its average width is measured. (d) Patches extracted along the vertebral column.
}
\end{figure}
\begin{figure} [t!]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=4.5cm]{seg_patches_output1.png}
\end{tabular}
\end{center}
\caption[seg]
{ \label{fig:seg_patches}
This is the output of the segmentation algorithm. Each line corresponds to one CT scan. Note that each line is only a subset of the sequence of patches. }
\end{figure}
\subsection{Patch-based CNN}
We applied the present algorithm to the CT data set to extract patches along the vertebral column. Figure ~ֿֿֿ\ref{fig:vertebras} demonstrates the output of the segmentation algorithm which is an input to the CNN training phase. The patches were re-scaled to 32x32. We found this size ideal - there were no significant improvements in our experiments for larger patch sizes such as 64x64 and 128x128. 15\% of all CT studies were sequestered as an exclusive validation set - patches derived from any individual CT study reside in either the training or validation set but not both. The validation set held a balanced number of samples between the two classes.
\begin{figure} [t!]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=4cm]{vertebras.png}
\end{tabular}
\end{center}
\caption[seg]
{ \label{fig:vertebras}
Patch containing a VCF (left). Right: Normal patch.}
\end{figure}
In contrast to other computer vision tasks where various data augmentation techniques are used in the training process, we opted not to apply any augmentation tools which might misrepresent the anatomic structure of the vertebral column. Instead applied only light rotations of -18 to 18 degrees, as the resulted transformation can naturally match the curvature and variability of the spine.
The CNN architecture employed is a variant based on VGG [\citenum{simonyan2014very}] adapted to 32x32 input. More specifically the network consists of the following layers:
32 3x3 convolutions, ReLU, 3x3 Max Pooling, 64 3x3 convolutions, ReLU, 64 3x3 convolutions, ReLU, 3x3 Max Pooling, 128 3x3 convolutions, ReLU, 128 3x3 convolutions, ReLU, 3x3 Max Pooling, a fully-connected layer of 512 dimensions, ReLU, Drop out, a fully-connected 2D layer, softmax. Figure \ref{fig:cnn} graphically demonstrates this architecture.
\begin{figure} [t!]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=5cm]{CnnArchitecture.png}
\end{tabular}
\end{center}
\caption[seg]
{ \label{fig:cnn}
CNN architecture used on input patches. The network was trained to predict whether a given patch contains a VCF.}
\end{figure}
\subsection{Patch sequence classification} \label{cnn_classification}
RNN's have been a dominant tool in handling sequences for many tasks in fields such as video classification [\citenum{DBLP:journals/corr/NgHVVMT15}], language modeling [\citenum{mikolov2010recurrent}]and speech recognition [\citenum{graves2013speech}]. A popular approach is to use LSTM based RNN's [\citenum{hochreiter1997long}] which are more robust to long sequences as they don't suffer the vanishing and exploding gradient during training, which is a disadvantage for normal RNN's.
Given a CT scan, we extract the sagittal vertebral patches and apply the CNN described to obtain a vector of probabilities. Figure \ref{fig:vertebras} illustrates a subset of a resulting vector of probabilities which represents a CT scan of a patient. The input vector size is not fixed; this is due to variance in physical attributes such as the height and the curvature of the spine. In addition, the vector of probabilities obtained is not a regular vector of features, but rather represents a sequence of predictions for fractures along the spine, therefore justifying an RNN based approach. Specifically, we employed a single layered LSTM with 128 cells, which were connected to a 2D output trained via the cross entropy loss. Figure \ref{fig:rnn} illustrates the RNN model used.
\begin{figure} [t!]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=2.5cm]{probabilities.png}
\end{tabular}
\end{center}
\caption[seg]
{ \label{fig:vertebras}
Employing the trained CNN on a given sequence of patches results in a vector of probabilities. Each probability represents the network prediction for VCF. }
\end{figure}
\begin{figure} [t!]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=6cm]{RNN_Architecture.png}
\end{tabular}
\end{center}
\caption[seg]
{ \label{fig:rnn}
RNN model used. The input is a CT scan represented by a vector of probabilities for VCF. The output is a prediction for whether the CT scan contains a VCF.}
\end{figure}
\section{Results}
The CNN was trained for 15 epochs and reached 92.9\% accuracy over the validation set. Visualizing training samples such in Figure ~\ref{fig:visualization}, demonstrates that the trained CNN learned to focus on VCF's. We then applied the trained CNN to the entire training and validation data sets to generate vectors for the RNN based classifier. The RNN was trained on the training data set and evaluated upon the validation vectors, resulting in 89.1\% accuracy, 83.9\% sensitivity and 93.8 specificity.
\begin{figure} [t!]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=5cm]{visualization.png}
\end{tabular}
\end{center}
\caption[viz]
{ \label{fig:visualization}
Heat map visualization produced using the CNN trained classifier. The CNN focus is on the VCF.}
\end{figure}
\section{Conclusions}
VCF's are clinically important findings which are readily identifiable but routinely overlooked by radiologists. Only 13\%-16\% of retrospectively confirmed VCF’s are actually reported at the time of CT study interpretation. This is likely due to the fact that they are considered incidental findings relative to the primary reason for which a given CT study was performed. In this work we present a robust algorithm to detect VCF's in CT scans of the Chest and/or Abdomen. First, a deterministic segmentation algorithm extracts patches along the patient’s vertebral column. Then these patches are classified using a CNN followed by RNN classifier on the resulting vector of probabilities. To the best of our knowledge this work is the first to address the problem of VCF detection using deep learning methodologies. This application may serve to increase the diagnostic sensitivity for VCF's in routinely acquired CT's, potentially triggering preventative measures to reduce the rate of future hip fracture.
\acknowledgments
This research was supported by Zebra Medical Vision.
| {'timestamp': '2017-06-07T02:04:46', 'yymm': '1706', 'arxiv_id': '1706.01671', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01671'} | arxiv |
\section{Introduction}
Speech signals are mysterious and fascinating: within just one dimensional vibration, very rich information is represented,
including linguistic content, speaker trait, emotion, channel and noise.
Scientists have worked for several decades to
decode speech, with different goals that focus on different informative factors within the signal. This leads to
a multitude of speech information processing tasks, where automatic speech recognition (ASR) and speaker recognition (SRE) are among the
most important~\cite{benesty2007springer}. After decades of research, some tasks have been addressed pretty well, at least with
large amounts of data, e.g., ASR and SRE, while others remain difficult, e.g., automatic emotion recognition (AER)~\cite{el2011survey}.
A major difficulty of speech processing resides in the fact that multiple informative factors are intermingled together,
and therefore whenever we decode for a particular factor, all other factors contribute as uncertainties. A natural idea
to deal with the information blending is to factorize the signal into independent informative factors, so that each task
can take its relevant factors.
Unfortunately, this factorization turns out to be very difficult, in fact more difficult than decoding for individual factors.
The main reason is that how the factors are intermingled to compose the speech signal and how they impact each other is far
from clear to the speech community, which makes designing a simple yet effective factorization formula nearly impossible.
As an example, the two most significant factors, linguistic contents and speaker traits, corresponding
to what has been spoken and who has spoken, hold a rather complex correlation. Here `significant factors'
refer to those factors that cause significant variations within speech signals.
Researchers have put much effort to factorize speech signals based on these two factors,
especially in SRE research. In fact, most of the famous SRE techniques are based on factorization models,
including the Gaussian mixture
model-universal background model (GMM-UBM)~\cite{Reynolds00}, the joint factor analysis (JFA)~\cite{Kenny07}
and the i-vector model~\cite{dehak2011front}. With these models, the variation caused by the linguistic factor is
explained away, which makes the speaker factor easier to identity (infer).
Although significant success has been achieved, all these models assume
a linear Gaussian relation between the linguistic, speaker and other factors, which is certainly over simplified.
Essentially, they all perform shallow and linear factorization,
and the speaker factors inferred are \emph{long-term distributional patterns} rather than \emph{short-time spectral patterns}.
It would be very disappointing if the speaker factor is really a distributional pattern in nature, as it would
mean that speaker traits are too volatile to be identified from a short-time speech segment. If this is true, then it would be
hopeless to factorize speech signals into independent factors at the frame level, and for most speech processing tasks, we have to
resort to complex probabilistic models to collect statistics from long speech segments. This notion has in fact been subconsciously embedded into the thought process of many speech researchers, partly due to the brilliant success of probabilistic models on SRE.
Fortunately, our discovery reported in this paper demonstrated that the speaker trait is essentially a short-time spectral
pattern, the same as the linguistic content. We designed a deep neural network (DNN) that can learn speaker
traits pretty well from raw speech features, and demonstrated that with only a few frames, a very strong speaker factor
can be inferred.
Considering that the linguistic factor can be inferred from
a short segment as well~\cite{hinton2012deep}, our finding indicates that most of the
significant variations of speech signals can be well explained. Based on the explanation,
less significant factors are easier to be inferred. This has motivated a \emph{cascaded deep factorization}
(CDF) approach that factorizes speech signals in a sequential way: factors that are most significant
are inferred firstly, and other less significant factors are inferred subsequently, conditioned on the
factors that have been inferred. By this approach, speech signals can be factorized into
independent informative factors, where all the inferences are based on deep neural models.
In this paper, we apply the CDF approach to factorize emotional speech signals to linguistic contents,
speaker traits and emotion status. Our experiments on an AER task demonstrated that the CDF-based factorization
is highly effective. Furthermore, we show that the original speech signal can be reconstructed from these
three factors pretty well. This factorization and reconstruction has far-reaching implications and
will provide a powerful tool for many speech processing tasks.
\section{Speaker factor learning}
\label{sec:speaker}
In this section, we present a DNN structure that can learn speaker traits
at the frame level, as shown in Figure~\ref{fig:ctdnn}. This structure consists
of a convolutional (CN) component and a time-delay (TD) component,
connected by a bottleneck layer of $512$ units.
The convolutional component comprises two CN layers, each followed by a max-pooling layer.
The TD component comprises two TD layers, each followed by a P-norm layer.
The settings for the two components are shown in Figure~\ref{fig:ctdnn}.
A simple calculation shows that with this configuration, the length of the
effective context window is $20$ frames.
The output of the P-norm layer is projected into a feature layer that consists of $40$ units. The
activations of these units, after length normalization, form a speaker factor that
represents the speaker trait involved in the input speech segment. For
model training, the feature layer is fully connected to the output layer whose units correspond to
the speakers in the training data. The training is performed to optimize the cross-entropy objective
that aims to discriminate the training speakers based on the input frames. In our experiment,
the natural stochastic gradient descent (NSGD)~\cite{povey2014parallel} algorithm was employed for optimization. Once the DNN model has been trained, the $40$-dimensional
frame-level speaker factor can be read from the feature layer.
The speaker factors inferred by the DNN structure, as will be shown in the experiment, are highly
speaker-discriminative. This demonstrates that speaker traits are short-time
spectral patterns and can be identified at the frame level.
\begin{figure*}[htb]
\centering
\includegraphics[width=1\linewidth]{fig/ct-dnn.pdf}
\caption{The DNN structure used for deep speaker factor inference.}
\label{fig:ctdnn}
\end{figure*}
\section{Cascaded deep factorization}
Due to the highly complex intermingling of multiple informative factors, it is nearly impossible to
factorize speech signals by conventional linear factorization methods, e.g., JFA~\cite{Kenny07}.
Fortunately, the ASR research has demonstrated that the linguistic factor can be individually
inferred by a DNN structure, without knowing other factors. The previous section
further provides deep model that can infer the speaker factor.
We denote this single factor inference based on deep neural models by \emph{individual deep factorization} (IDF).
The rationality of the linguistic and speaker IDF is two-fold: firstly the linguistic and speaker factors are
sufficiently significant in speech signals, and secondly a large amount of training data is available.
It is the large-scale supervised learning that picks up the most task-relevant factors from
raw speech features, via the DNN architecture. For factors that are less significant or without sufficient
training data, IDF is simply not applicable. Fortunately, the successful inference of the linguistic
and/or the speaker factors may significantly simplify the inference of other speech factors,
as the largest variations within the speech signal have been explained away.
This has motivated a cascaded deep factorization (CDF) approach: firstly we infer a particular factor
by IDF, and then use this factor as a conditional variable to infer the second factor, and so on.
Finally, the speech signal will be factorized into a set of independent factors, each corresponding to a
particular task. The order of the inference can be arbitrary, but a good practice is that
factors that are more significant and with more training data should be inferred earlier, so that the
variation caused by these factors can be reliably eliminated when inferring the subsequent factors.
In this study, we apply the CDF approach to factorize emotional speech signals into three factors:
linguistic, speaker and emotion. Figure~\ref{fig:cascade} illustrates the architecture. Firstly
an ASR system is trained using word-labelled speech data.
The frame-level linguistic factor, which is in the form of phone posteriors in our study, is produced
from the ASR DNN, and is concatenated with the raw feature to train an SRE system.
This SRE system is used to produce the frame-level speaker factor, as discussed in the previous section.
The linguistic factor and the speaker factor are finally concatenated with the raw
feature to train an AER system, by which the emotion factor is read from the last hidden layer.
\begin{figure}[htb]
\centering
\includegraphics[width=0.5\linewidth]{fig/cascade.pdf}
\caption{The cascaded deep factorization approach applied to factorize emotional speech into
three factors: linguistic, speaker and emotion. }
\label{fig:cascade}
\end{figure}
The CDF approach is fundamentally different from the conventional joint factorization approach,
e.g., JFA~\cite{Kenny07}. Firstly, CDF heavily relies on discriminative learning to discover task-related
factors, while conventional approaches are mostly generative models and the factors inferred are less
task-related. Secondly, CDF infers factors sequentially and can use different data resources for
different factors, while conventional approaches infer factors jointly
using a single multi-labelled database. Thirdly, CDF being a deep approach, can leverage various advantages
associated with deep learning (e.g., invariant feature learning), while most conventional approaches are mostly
based on shallow models.
\section{Spectrum reconstruction}
\label{sec:recovery}
A key difference between CDF and the conventional factor analysis~\cite{christopher2006pattern} is that
in CDF each factor is inferred individually, without any explicit constraint defined among the factors (e.g.,
the linear Gaussian relation as in JFA).
This on one hand is essential for a flexible factorization, but on the other hand, shuns an important
question: How these factors are composed together to produce the speech signal?
To answer this question, we reconstruct the spectrum using the CDF-inferred factors. Define
the linguistic factor $q$, the speaker factor $s$, and the emotion factor $e$.
For each speech frame, we try to use these three factors to
recover the spectrum $x$. Assuming they are convolved, the reconstruction is in the form:
\[
ln (x) = ln \{f(q)\} + ln \{g(s)\} + ln \{h(e)\} + \epsilon
\]
\noindent where $f$, $g$, $h$ are the non-linear recovery function for $q$, $s$ and $e$ respectively,
each implemented as a DNN. $\epsilon$ represents the residual which is assumed to be Gaussian.
This reconstruction is illustrated in Figure~\ref{fig:recovery}, where all the spectra are in the log domain.
\begin{figure}[htb]
\centering
\includegraphics[width=0.85\linewidth]{fig/recovery.pdf}
\caption{The architecture for spectrum reconstruction.}
\label{fig:recovery}
\end{figure}
\section{Related work}
The idea of learning speaker factors was motivated by Ehsan et al~\cite{ehsan14}, who employed a vanilla DNN to
learn frame-level representations of speakers. These representations, however, were rather weak and
did not perform well on SRE tasks. Since then, various DNN structures were investigated,
e.g., RNN by Heigold~\cite{heigold2016end}, CNN by Zhang~\cite{zhang2017end} and NIN by
Snyder~\cite{snyderdeep16} and Li~\cite{li2017}. These diverse investigations demonstrated
reasonable performance, however most of them were based on
an end-to-end training, seeking for better performance on speaker verification, rather than
factor learning.
The CDF approach is also related to the phonetic DNN i-vector approach proposed by
Lei~\cite{lei2014novel} and Kenny~\cite{Kenny14}, where the linguistic factor (phonetic posteriors)
is firstly inferred using an ASR system, which is then used as an auxiliary knowledge to infer the speaker
factor (the i-vector). In CDF, the second stage linear Gaussian inference (i-vector inference)
is replaced by a more complex deep speaker factorization.
Finally, the CDF approach is related to multi-task learning~\cite{caruana1997multitask} and transfer
learning~\cite{pan2010survey,wang2015transfer}. For example, Senior et al.~\cite{senior2014improving}
found that involving the speaker factor in the input feature improved ASR system. Qin~\cite{qian2016neural}
and Li et al.~\cite{li2015modeling} found that ASR and SRE systems can be trained jointly, by borrowing
information from each other. This idea was recently studied more systematically by
Tang et al.~\cite{tang2017collaborative}. All these approaches focus on linguistic and speaker factors that are
mostly significant. The CDF, in contrast, treats these significant factors
as conditional variables and focuses more on less significant factors.
\section{Experiment}
In this section, we first present the data used in the experiments, then report the results of speaker factor
learning. The CDF-based emotional speech factorization and reconstruction will be also presented.
\subsection{Database}
\textbf{ASR database}: The \emph{WSJ} database was used to train the ASR system. The training set
is the official \emph{train\_si284} dataset, composed of $282$ speakers and $37,318$ utterances,
with about $50$-$155$ utterances per speaker. The test set contains three datasets (\emph{devl92, eval92 and eval93}),
including $27$ speakers and $1,049$ utterances in total.
\textbf{SRE database}: The \emph{Fisher} database was used to train the SRE systems. The training set consists of $2,500$ male and $2,500$ female speakers, with $95,167$ utterances randomly selected from the \emph{Fisher} database, and each speaker has about $120$ seconds of speech signals. It was used for training the UBM, T-matrix and LDA/PLDA models of an i-vector baseline system, and the DNN model proposed in Section~\ref{sec:speaker}. The test set consists of $500$ male and $500$ female speakers randomly selected from the \emph{Fisher} database. There is no overlap between the speakers of the training set and the evaluation set. For each speaker, $10$ utterances (about $30$ seconds in total) are used for enrollment and the rest for test. There are $72,989$ utterances for evaluation in total.
\textbf{AER database}: The \emph{CHEAVD} database~\cite{bao2014building} was used to train the AER systems.
This database was selected from Chinese movies and TV programs and used as the standard database for the multimodal emotion recognition challenge (MEC 2016)~\cite{li2016mec}.
There are $8$ emotions in total: Happy, Angry, Surprise, Disgust, Neutral, Worried, Anxious and Sad.
The training set contains $2,224$ utterances and the evaluation set contains $628$ utterances.
Note that WSJ and CHEAVD datasets are in 16kHz sampling rate, while the Fisher corpus is in 8kHz format.
All the 16kHz speech signals were down-sampled to 8kHz to ensure data consistency.
\subsection{ASR baseline}
We first build a DNN-based ASR system using the WSJ database. This system will be used to produce the linguistic factor
in the following CDF experiments. The Kaldi toolkit~\cite{povey2011kaldi} is used to train the DNN model,
following the Kaldi WSJ s5 nnet recipe. The DNN structure consists of $4$ hidden layers, each containing $1,024$ units.
The input feature is Fbanks, and the output layer discriminates $3,383$ GMM pdfs. With the official 3-gram language model,
the word error rate (WER) of this system is $9.16$\%. The linguistic factor is represented by
$42$-dimensional phone posteriors, derived from the output of the ASR DNN.
\subsection{Speaker factor learning}
In this section, we experiment with DNN structure proposed in Section~\ref{sec:speaker} to learn
speaker factors. Two models are investigated: one follows the architecture shown
in Figure~\ref{fig:ctdnn}, where only the raw features (Fbank) comprise the input; the other
model uses both the raw features \emph{and} the linguistic factors produced by the ASR system. Put it in another
way, the first model is trained by IDF, while the second model is trained by CDF. The Fisher database
is used to train the model. The 40-dimensional frame-level speaker factors are read out from the last hidden
layer of the DNN structure.
\textbf{Visualization}
The discriminative capability of the speaker factor can also be examined by projecting the
feature vectors to a 2-dimensional space using t-SNE~\cite{saaten2008}. We select $20$ speakers and draw the frame-level speaker factors of an utterance
for each speaker.
The results are presented in Figure~\ref{fig:tsne} where plot (a) draws the factors generated by the IDF model,
and (b) draws the factors generated by the CDF model.
It can be seen that the learned speaker factors are very discriminative, and involving the linguistic
factor by CDF indeed reduces the within-speaker variation.
\begin{figure}[htb]
\centering
\includegraphics[width=0.8\linewidth]{fig/200-cont.pdf}
\caption{Frame-level speaker factors produced by (a) IDF DNN and (b) CDF DNN and plotted by t-SNE, with each color
representing a speaker.}
\label{fig:tsne}
\end{figure}
\textbf{SRE performance}
The quality of the speaker factors can be also evaluated by various speaker recognition tasks, i.e., speaker
identification task or speaker verification task.
In both tasks, the utterance-level speaker vector is derived
by averaging the frame-level speaker factors. Following the convention of Ehsan et al~\cite{ehsan14},
the utterance-level representations derived from DNN are called \emph{d-vectors}, and accordingly the SRE system
is called a \emph{d-vector system}.
For comparison, an i-vector baseline is also constructed using the same database. The model is a
typical linear Gaussian factorization model and it has been demonstrated to produce state-of-the-art
performance in SRE~\cite{dehak2011front}. In our implementation, the UBM is composed of $2,048$
Gaussian components, and the dimensionality of the i-vector space is set to $400$. The system is trained following the Kaldi SRE08 recipe.
We report the results on the identification task, though similar observations were obtained
on the verification task.
In the identification task, a matched speaker is identified given a
test utterance. With the i-vector (d-vector) system, each enrolled speaker is represented by
the i-vector (d-vector) of their enrolled speech, and the i-vector (d-vector) of the test speech
is derived as well. The identification is then conducted by finding the speaker whose enrolled i-vector (d-vector)
is nearest to that of the test speech.
For the i-vector system, the popular PLDA model~\cite{Ioffe06} is used to measure the similarity between
i-vectors; for the d-vector system, the simple cosine distance is used.
The results in terms of the Top-1 identification rate (IDR) are shown in Table~\ref{tab:id-short}.
In this table, `C(30-20f)' means the test condition where the enrollment speech is $30$ seconds, while the test
speech is $20$ frames. Note that $20$ frames is just the length of the effective context window of the
speaker DNN, so only a single speaker factor is used in this condition. From these results,
it can be observed that the d-vector system performs much better than the i-vector baseline, particularly with
very short speech segments. Comparing the IDF and CDF results, it can be seen that the CDF approach that
involves phone knowledge as the conditional variable greatly improves the d-vector system in the short speech
segment condition.
Most strikingly, with only $20$ frames of speech (0.3 seconds), $47.63$\% speakers
can be correctly identified from the $1,000$ candidates by the simple nearest neighbour search.
This is a strong evidence that speaker traits are short-time spectral patterns and can be
effectively learned at the frame level.
\begin{table}[htb!]
\begin{center}
\caption{The \textbf{\emph{Top-1}} IDR(\%) results on the short-time speaker identification with the i-vector and two d-vector systems.}
\label{tab:id-short}
\begin{tabular}{|c|l|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{} &\multicolumn{3}{c|}{IDR\%}\\
\hline
Systems & Metric & S(30-20f) & S(30-50f) & S(30-100f) \\
\hline
i-vector & PLDA & 5.72 & 27.77 & 55.06 \\
d-vector (IDF) & Cosine & 37.18 & 51.24 & \textbf{65.31} \\
d-vector (CDF) & Cosine & \textbf{47.63} & \textbf{57.72} & 64.45 \\
\hline
\end{tabular}
\end{center}
\end{table}
\subsection{Emotion recognition by CDF}
In the previous experiment we have partially demonstrated the CDF approach with the speaker factor learning task.
This section provides further evidence with an emotion recognition task.
For that purpose, we first build a DNN-based AER baseline. The DNN model consists of $6$ time-delay
hidden layers, each containing $200$ units. After each TD layer, a P-norm layer reduces the dimensionality
from $200$ to $40$. The output layer comprises $8$ units, corresponding to the $8$ emotions
in the database. This DNN model produces frame-level emotion posteriors. The utterance-level posteriors
are obtained by averaging the frame-level posteriors, by which the utterance-level emotion decision is achieved.
Three CDF configurations are investigated, according to which factor is used as the conditional:
the linguistic factor (+ ling.), the speaker factor (+ spk.) and both (+ ling. \& spk.).
The results are evaluated in two metrics:
the identification accuracy (ACC) that is the ratio of the correct identification on all emotion categories;
the macro average precision (MAP) that is the average of the ACC on each of the emotion category.
The results on the training data are shown in Table~\ref{tab:cdf}, where the ACC and MAP values
on both the frame-level (fr.) and the utterance-level (utt.) are reported. It can be seen that with the conditional
factors involved, either the linguistic factor or the speaker factor, the ACC and MAP values are
improved very significantly. The speaker factor seems provide more significant contribution, which
can be attributed to the fact that the emotion style of different speakers could be largely different.
With both the two factors involved, the AER performance is improved even further.
This clearly demonstrates that with the conditional factors considered, the speech signal
can be explained much better.
\begin{table}[thb!]
\caption{\label{tab:cdf}{Accuracy (ACC) and macro average precision (MAP) on the training set.}}
\centerline{
\begin{tabular}{|l|c|c|c|c|c|}
\hline
Dataset & \multicolumn{4}{|c|}{Training set} \\
\hline
& ACC\% (fr.) & MAP\% (fr.) & ACC\% (utt.) & MAP\% (utt.) \\
\hline
Baseline & 74.19 & 61.67 & 92.27 & 83.08 \\
+ling. & 86.34 & 81.47 & 96.94 & 96.63 \\
+spk. & 92.56 & 90.55 & 97.75 & 97.16 \\
+ling. \& spk. & \textbf{94.59} & \textbf{92.98} & \textbf{98.02} & \textbf{97.34} \\
\hline
\end{tabular}
}
\end{table}
The results on the test data are shown in Table~\ref{tab:cdf-test}. Again, we observe a clear advantage
with the CDF training. Note that involving the two factors does not improve the
utterance-level results. This should be attributed to the fact that the DNN models are trained
using frame-level data, so may be not fully consistent with the metric of the utterance-level test.
Nevertheless, the superiority of the multiple conditional factors can be seen clearly from the frame-level
metrics.
\begin{table}[thb!]
\caption{\label{tab:cdf-test}{Accuracy (ACC) and macro average precision (MAP) on the evaluation set.}}
\centerline{
\begin{tabular}{|l|c|c|c|c|c|}
\hline
Dataset & \multicolumn{4}{|c|}{Evaluation set}\\
\hline
& ACC\% (fr.) & MAP\% (fr.) & ACC\% (utt.) & MAP\% (utt.) \\
\hline
Baseline & 23.39 & 21.08 & 28.98 & 24.95 \\
+ling. & 27.25 & 27.68 & \textbf{33.12} & \textbf{33.28} \\
+spk. & 27.18 & 28.99 & 32.01 & 32.62 \\
+ling. \& spk. & \textbf{27.32} & \textbf{29.42} & 32.17 & 32.29 \\
\hline
\end{tabular}
}
\end{table}
\subsection{Spectrum reconstruction}
In the last experiment, we use the linguistic factor, speaker factor and emotion factor to reconstruct
the original speech signal. The reconstruction model has been discussed in Section~\ref{sec:recovery}
and shown in Figure~\ref{fig:recovery}. This model is trained using the CHEAVD database. Figure~\ref{fig:demo}
shows the reconstruction of a test utterance in the CHEAVD database. It can be seen
that these three factors can reconstruct the spectrum patterns extremely well. This re-confirms that
the speech signal has been well factorized, and the convolutional reconstruction formula
is mostly correct. Finally, the three component spectra (linguistic, speaker, and emotion) are
highly interesting and all deserve extensive investigation. For example, the speaker spectrum may be
a new voiceprint analysis tool and could be very useful for forensic applications.
\begin{figure}[htb]
\centering
\includegraphics[width=1\linewidth]{fig/0599.pdf}
\caption{An example of spectrum reconstruction from the linguistic, speaker and emotion factors.}
\label{fig:demo}
\end{figure}
\section{Conclusions}
This paper has presented a DNN model to learn short-time speaker traits and a cascaded deep factorization (CDF)
approach to factorize speech signals into independent informative factors. Two interesting things
were found: firstly speaker traits are indeed short-time spectral patterns and can be
identified by deep learning from a very short speech segment; secondly speech signals can be well factorized
at the frame level by the CDF approach.
We also found that the speech spectrum can be largely reconstructed using deep neural models
from the factors that have been inferred by CDF, confirming the correctness of the factorization.
The successful factorization and reconstruction of speech signals has very important implications
and can find broad applications.
To mention several: it can be used to design very parsimonious speech codes, to change the speaker traits or
emotion in speech synthesis or voice conversion, to remove background noise, to embed audio watermarks.
All are highly interesting and are under investigation.
\subsubsection*{Acknowledgments}
Many thanks to Ravichander Vipperla from Nuance, UK for many valuable suggestions.
\newpage
\bibliographystyle{IEEEtran}
| {'timestamp': '2017-06-27T02:06:45', 'yymm': '1706', 'arxiv_id': '1706.01777', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01777'} | arxiv |
\section{Introduction}
Most real-world networks have power-law degrees, so that the proportion of nodes having $k$ neighbors scales as $k^{-\tau}$ with exponent $\tau$ between 2 and 3 \cite{albert1999,faloutsos1999,jeong2000,vazquez2002}. Power-law degrees imply various intriguing scale-free network properties, such as ultra-small distances~\cite{hofstad2007, newman2001} and the absence of percolation thresholds when $\tau<3$~\cite{janson2009b, pastor2001}. Empirical evidence has been matched by random graph null models that are able to explain mathematically why and how these properties arise. This paper deals with another fundamental property observed in many scale-free networks related to three-point correlations that suppress the creation of triangles and signal the presence of hierarchy. We quantify this property in terms of the {\it clustering spectrum}, the function $k\mapsto \bar c(k)$ with $\bar c(k)$ the probability that two neighbors of a degree-$k$ node are neighbors themselves.
In {\it uncorrelated} networks the clustering spectrum $\bar c (k)$ remains constant and independent of $k$. However, the majority of real-world networks have spectra that decay in $k$, as first observed in technological networks including the Internet~\cite{pastor2001b,ravasz2003}. Figure~\ref{fig:chas} shows the same phenomenon for a social network: YouTube users as vertices, and edges indicating friendships between them~\cite{snap}.
\begin{figure}[h]
\centering
\includegraphics[width=0.8\linewidth]{youtubech.pdf}
\caption{$\bar c(k)$ for the YouTube social network}
\label{fig:chas}
\end{figure}
Close inspection suggests the following properties, not only in Fig.~\ref{fig:chas}, but also in the nine further networks in Fig.~\ref{fig:ch}. The right end of the spectrum appears to be of the power-law form $k^{-\alpha}$; approximate values of $\alpha$ give rise to the dashed lines; (ii) The power law is only approximate and kicks in for rather large values of $k$. In fact, the slope of $\bar c (k)$ decreases with $k$; (iii) There exists a transition point: the minimal degree as of which the slope starts to decline faster and settles on its limiting (large $k$) value.
\begin{figure*}
\subfloat[]{%
\centering
\includegraphics[width=0.33\linewidth]{hudongch.pdf}
\label{fig:chhudong}
}%
\subfloat[]{%
\centering
\includegraphics[width=0.33\linewidth]{baiduch.pdf}
\label{fig:chbaidu}
}
\subfloat[]{
\centering
\includegraphics[width=0.33\linewidth]{wordnetch.pdf}
\label{fig:chwordnet}
}
\subfloat[]{
\centering
\includegraphics[width=0.33\linewidth]{trecch.pdf}
\label{fig:chtrec}
}
\subfloat[]{
\centering
\includegraphics[width=0.33\linewidth]{webgooglech.pdf}
\label{fig:chgoogle}
}
\subfloat[]{
\centering
\includegraphics[width=0.33\linewidth]{asskitch.pdf}
\label{fig:chwiki}
}
\subfloat[]{%
\centering
\includegraphics[width=0.33\linewidth]{catsterch.pdf}
\label{fig:chcatster}
}%
\subfloat[]{
\centering
\includegraphics[width=0.33\linewidth]{gowallach.pdf}
\label{fig:chgowalla}
}
\subfloat[]{
\centering
\includegraphics[width=0.33\linewidth]{wikitalkch.pdf}
\label{fig:chyou}
}
\caption{$\bar c(k)$ for several information (red), technological (green) and social (blue) real-world networks. (a) Hudong encyclopedia~\cite{niu2011}, (b) Baidu encyclopedia~\cite{niu2011}, (c) WordNet~\cite{miller1998}, (d) TREC-WT10g web graph~\cite{bailey2003}, (e) Google web graph~\cite{snap}, (f) Internet on the Autonomous Systems level~\cite{snap}, (g) Catster/Dogster social networks~\cite{konect}, (h) Gowalla social network~\cite{snap}, (i) Wikipedia communication network~\cite{snap}. The different shadings indicate the theoretical boundaries of the regimes as in Fig.~\ref{fig:curve}, with $N$ and $\tau$ as in Table~\ref{tab:data}.
}
\label{fig:ch}
\end{figure*}
For scale-free networks a decaying $\bar c(k)$ is taken as an indicator for the presence of modularity and hierarchy~\cite{ravasz2003}, architectures that can be viewed as collections of subgraphs with dense connections within themselves and sparser ones between them. The existence of clusters of dense interaction signals hierarchical or nearly decomposable structures. When the function $\bar c(k)$ falls off with $k$, low-degree vertices have relatively high clustering coefficients, hence creating small modules that are connected through triangles. In contrast, high-degree vertices have very low clustering coefficients, and therefore act as bridges between the different local modules. This also explains why $\bar c(k)$ is not just a local property, and when viewed as a function of $k$, measures crucial mesoscopic network properties such as modularity, clusters and communities. The behavior of $\bar c(k)$ also turns out to be a good predictor for the macroscopic behavior of the network. Randomizing real-world networks while preserving the shape of the $\bar c(k)$ curve produces networks with very similar component sizes as well as similar hierarchical structures as the original network~\cite{colomer2013}. Furthermore, the shape of $\bar c(k)$ strongly influences the behavior of networks under percolation~\cite{serrano2006}. This places the $\bar c(k)$-curve among the most relevant indicators for structural correlations in network infrastructures.
In this paper, we obtain a precise characterization of clustering in the hidden variable model, a tractable random graph null model. We start from an explicit form of the $\bar c(k)$ curve for the hidden variable model~\cite{boguna2003,serrano2007,dorogovtsev2004}.
We obtain a detailed description of the $\bar c(k)$-curve in the large-network limit that provides rigorous underpinning of the empirical observations (i)-(iii). We find that the decay rate in the hidden variable model is significantly different from the exponent $\bar c(k)\sim k^{-1}$ that has been found in a hierarchical graph model~\cite{ravasz2003} as well as in the preferential attachment model~\cite{krot2015} and a preferential attachment model with enhanced clustering~\cite{szabo2003}. Furthermore, we show that before the power-law decay of $\bar c(k)$ kicks in, $\bar c(k)$ first has a constant regime for small $k$, and a logarithmic decay phase. This characterizes the entire clustering spectrum of the hidden variable model.
This paper is structured as follows. Section \ref{sec:hidden} introduces the random graph model and its local clustering coefficient. Section \ref{sec:three} presents the main results for the clustering spectrum. Section \ref{sec:deep} explains the shape of the clustering spectrum in terms of an energy minimization argument, and Section \ref{sec:deep2} quantifies how fast the limiting clustering spectrum arises as function of the network size. We conclude with a discussion in Section \ref{sec:disc} and present all mathematical derivations of the main results in the appendix.
\section {Hidden variables}\label{sec:hidden}
As null model we employ the hidden variable model~ \cite{boguna2003,park2004,bollobas2007,britton2006,norros2006}.
Given $N$ nodes, hidden variable models are defined as follows. Associate to each node a hidden variable $h$ drawn from a given probability distribution function
\begin{equation}\label{eq:rhoh}
\rho(h)=Ch^{-\tau}
\end{equation}
for some constant $C$. Next join each pair of vertices independently according to a given probability $p(h,h')$ with $h$ and $h'$ the hidden variables associated to the two nodes.
Many networks can be embedded in this hidden-variable framework, but particular attention goes to the case in which the hidden variables have themselves the structure of the degrees of a real-world network. In that case the hidden-variable model puts soft constraints on the degrees, which is typically easier to analyze than hard constraints as in the configuration model~\cite{clauset2009,newman2003book,vazquez2002,dhara2016}.
Chung and Lu \cite{chung2002} introduced the hidden variable model in the form
\begin{equation}\label{c1}
p(h,h')\sim \frac{h h'}{N \mean{h}},
\end{equation}
so that the expected degree of a node equals its hidden variable.
We now discuss the structural and natural cutoff, because both will play a crucial role in the description of the clustering spectrum. The structural cutoff is defined as the largest possible upper bound on the degrees required to guarantee single edges, while the natural cutoff characterizes the maximal degree in a sample of $N$ vertices. For scale-free networks with exponent $\tau\in(2,3]$ the structural cutoff scales as $\sqrt{N}$ while the natural cutoff scales as $N^{1/(\tau-1)}$, which gives rise to structural negative correlations and possibly other finite-size effects. If one wants to avoid such effects, then the maximal value of the product $h h'$ should never exceed $N \mean{h}$, which can be guaranteed by the assumption that the hidden degree $h$ is smaller than the structural cutoff $h_s=\sqrt{N\mean{h}}$.
While this restricts $p(h,h')$ in \eqref{c1} within the interval $[0,1]$, banning degrees larger than the structural cutoff strongly violates the reality of scale-free networks, where degrees all the way up to the
natural cutoff $(N\mean{h})^{1/(\tau-1)}$ need to be considered. We therefore work with (although many asymptotically equivalent choices are possible; see \cite{hofstad2017b} and Appendix \ref{sec:chcomp})
\begin{equation}\label{c11}
p(h,h')= \min\Big(1,\frac{h h'}{N \mean{h}}\Big),
\end{equation}
putting no further restrictions on the range of the hidden variables (and hence degrees).
In this paper, we shall work with $c(h)$, the local clustering coefficient of a randomly chosen vertex with hidden variable $h$. However, when studying local clustering in real-world data sets, we can only observe $\bar c(k)$, the local clustering coefficient of a vertex of degree $k$. In Appendix \ref{sec:hk} we show that the approximation $\bar{c}(h)\approx c(h)$ is highly accurate.
We start from the explicit expression for $c(h)$ \cite{boguna2003}, which measures the probability that two randomly chosen edges from $h$ are neighbors, i.e.,
\begin{equation}\label{int1}
c(h)=\int_{h'}\int_{h''} p(h'|h)p(h',h'')p(h''|h){\rm d} h''{\rm d} h',
\end{equation}
with $p(h'|h)$ the conditional probability that a randomly chosen edge from an $h$-vertex is connected to an $h'$-vertex and $p(h,h')$ as in \eqref{c11}. The goal is now to characterize the $c(h)$-curve (and hence the $\bar c(k)$-curve).
\section{Universal clustering spectrum}\label{sec:three}
The asymptotic evaluation of the double integral \eqref{int1} in the large-$N$ regime reveals three different ranges, defined in terms of the scaling relation between the hidden variable $h$ and the network size $N$. The three ranges together span the entire clustering spectrum as shown in Fig.~\ref{fig:curve}. The detailed calculations are deferred to Appendix \ref{sec:chcomp}.
\begin{figure}[tb]
\centering\includegraphics[width=0.4\textwidth]{curve.pdf}
\caption{Clustering spectrum $h\mapsto c(h)$ with three different ranges for $h$: the flat range, logarithmic decay, and the power-law decay.}
\label{fig:curve}
\end{figure}
The first range pertains to the smallest-degree nodes, i.e., vertices with a hidden variable that does not exceed $N^{\beta(\tau)}$ with $\beta(\tau)= \frac{\tau-2}{\tau-1}$. In this case we show that
\begin{equation}\label{eq:r1}
c(h)\propto N^{2-\tau}\ln N, \quad h\leq N^{\beta(\tau)}.
\end{equation}
In particular, here the local clustering does not depend on the degree and in fact corresponds with the large-$N$ behavior of the global clustering coefficient \cite{hofstad2017b,colomer2012}. Note that the interval $[0,\beta(\tau)]$ diminishes when $\tau$ is close to 2, a possible explanation for why the flat range associated with Range I is hard to recognize in some of the real-world data sets.
Range II considers nodes with hidden variables (degrees) above the threshold $N^{\beta(\tau)}$, but below the structural cutoff $\sqrt{N}$. These nodes start experiencing structural correlations, and close inspection of the integral \eqref{int1} yields
\begin{equation}\label{eq:r2}
c(h)\propto N^{2-\tau}\Big(1+\ln \Big(\frac{\sqrt{N}}{h}\Big)\Big), \quad N^{\beta(\tau)}\leq h \leq \sqrt{N}.
\end{equation}
This range shows relatively slow, logarithmic decay in the clustering spectrum, and is clearly visible in the ten data sets.
Range III considers hidden variables above the structural cutoff, when the restrictive effect of degree-degree correlations becomes more evident. In this range we find that
\begin{equation}\label{eq:r3}
c(h)\propto \frac{1}{N}\Big(\frac{h}{N}\Big)^{-2(3-\tau)}, \quad h\geq \sqrt{N}
\end{equation}
hence power-law decay with a power-law exponent $\alpha=2(3-\tau)$.
Such power-law decay has been observed in many real-world networks
\cite{vazquez2002,ravasz2003,serrano2006b,catanzaro2004, leskovec2008,krioukov2012}, where most networks were found to have the power-law exponent close to one. The asymptotic relation \eqref{eq:r3} shows that the exponent $\alpha$ decreases with $\tau$ and takes values in the entire range $(0,2)$. Table~\ref{tab:data} contains estimated values of $\alpha$ for the ten data sets.
\section{Energy minimization}\label{sec:deep}
\begin{figure}[tb]
\centering
\subfloat[]{
\centering
\includegraphics[width=0.2\textwidth]{triangsmall.pdf}
\label{fig:contsmall}
}
\hspace{0.2cm}
\subfloat[]{
\centering
\includegraphics[width=0.2\textwidth]{trianglarge.pdf}
\label{fig:contlarge}
}
\caption{Orders of magnitude of the major contributions in the different $h$-ranges. The highlighted edges are present with asymptotically positive probability. (a) $h<\sqrt{N}$ (b) $h>\sqrt{N}$.}
\label{fig:major}
\end{figure}
We now explain why the clustering spectrum splits into three ranges, using an argument that minimizes the energy needed to create triangles among nodes with specific hidden variables.
In all three ranges for $h$, there is one type of `most likely' triangle, as shown in Fig.~\ref{fig:major}. This means that most triangles containing a vertex $v$ with hidden variable $h$ are triangles with two other vertices $v'$ and $v''$ with hidden variables $h'$ and $h''$ of specific sizes, depending on $h$. The probability that a triangle is present between $v$, $v'$ and $v''$ can be written as
\begin{equation}\label{eq:probtr}
\min\left(1,\frac{hh'}{N\mean{h}}\right)\min\left(1,\frac{hh''}{N \mean{h} }\right)\min\left(1,\frac{h'h''}{N\mean{h} }\right).
\end{equation}
While the probability that such a triangle exists among the three nodes thus increases with $h'$ and $h''$, the number of such nodes decreases with
$h'$ and $h''$ because vertices with higher $h$-values are rarer. Therefore, the maximum contribution to $c(h)$ results from a trade-off between large enough $h',h''$ for likeliness of occurrence of the triangle, and $h',h''$ small enough to have enough copies. Thus, having $h'> N\mean{h}/h$ is not optimal, since then the probability that an edge exists between $v$ and $v'$ no longer increases with $h'$. This results in the bound
\begin{equation}\label{eq:b1}
h',h''\leq \frac{N\mean{h} }{h}.
\end{equation}
Similarly, $h'h''> N\mean{h}$ is also suboptimal, since then further increasing $h'$ and $h''$ does not increase the probability of an edge between $v'$ and $v''$. This gives as a second bound
\begin{equation}\label{eq:b2}
h'h''\leq N\mean{h}.
\end{equation}
In Ranges I and II, $h<\sqrt{N\mean{h}}$, so that $N\mean{h}/h>\sqrt{N\mean{h}}$. In this situation we reach bound~\eqref{eq:b2} before we reach bound~\eqref{eq:b1}. Therefore, the maximum contribution to $c(h)$ comes from $h'h''\approx N$, where also $h',h''<N\mean{h}/h$ because of the bound~\eqref{eq:b1}. Here the probability that the edge between $v'$ and $v''$ exists is large, while the other two edges have a small probability to be present, as shown in Fig.~\ref{fig:contsmall}. Note that for $h$ in Range I, the bound \eqref{eq:b1} is superfluous, since in this regime $N\mean{h}/h>h_c$, while the network does not contain vertices with hidden variables larger than $h_c$. This bound indicates the minimal values of $h'$ such that an $h$-vertex is guaranteed to be connected to an $h'$-vertex. Thus, vertices in Range I are not even guaranteed to have connections to the highest degree vertices, hence they are not affected by the single-edge constraints. Therefore the value of $c(h)$ in Range I is independent of $h$.
In Range III, $h>\sqrt{N\mean{h}}$, so that $N\mean{h}/h<\sqrt{N\mean{h}}$. Therefore, we reach bound~\eqref{eq:b1} before we reach bound~\eqref{eq:b2}. Thus, we maximize the contribution to the number of triangles by choosing $h',h''\approx N\mean{h}/h$. Then the probability that the edge from $v$ to $v'$ and from $v$ to $v''$ is present is large, while the probability that the edge between $v'$ and $v''$ exists is small, as illustrated in Fig.~\ref{fig:contlarge}.
\section{Convergence rate}\label{sec:deep2}
We next ask how large networks should be, or become, before they reveal the features of the universal clustering spectrum.
In other words, while the results in this paper are shown for the large-$N$ limit, for what finite $N$-values can we expect to see the different ranges and clustering decay?
To bring networks of different sizes $N$ on a comparable footing, we consider
\begin{equation}\label{eq:sigmam}
\sigma_N(t)=\frac{\ln\left(c(h)/c(h_c)\right)}{\ln(N\mean{h})}, \quad h=(N\mean{h})^t,
\end{equation}
for $0\leq t \leq \tfrac{1}{\tau-1}$. The slope of $\sigma_N(t)$ can be interpreted as a measure of the decay of $c(h)$ at $h=(N\mean{h})^t$, and all curves share the same right end of the spectrum; see Appendix~\ref{sec:hcder} for more details.
Figure~\ref{fig:chfinite} shows this rescaled clustering spectrum for synthetic networks generated with the hidden variable model with $\tau=2.25$. Already $10^4$ vertices reveal the essential features of the spectrum: the decay and the three ranges. Increasing the network size further to $10^5$ and $10^6$ nodes shows that the spectrum settles on the limiting curve. Here we note that the real-world networks reported in Figs.~\ref{fig:chas} and~\ref{fig:ch} are also of order $10^5$-$10^6$ nodes, see Table~\ref{tab:data}.
\begin{figure}[ht]
\centering\includegraphics[width=0.4\textwidth]{clustN.pdf}
\caption{$\sigma_N(t)$ for $N=10^4,10^6$ and $10^8$ together with the limiting function, using $\tau=2.25$, for which $\tfrac{1}{\tau-1}=0.8$. }
\label{fig:chfinite}
\end{figure}
\begin{table}[htbp]
\centering
\begin{ruledtabular}
\begin{tabular}{lrrrr}
& $N$ & $\tau$ & g.o.f. &$\alpha$ \\
\textbf{Hudong } & 1.984.484 & 2,30 & 0.00 &0,85 \\
\textbf{Baidu} & 2.141.300 & 2,29 & 0.00 & 0,80 \\
\textbf{Wordnet} & 146.005 & 2,47 & 0.00 &1,01 \\
\textbf{Google web} & 875.713 & 2,73 & 0.00 & 1,03 \\
\textbf{AS-Skitter} & 1.696.415 & 2,35 & 0.06 & 1,12 \\
\textbf{TREC-WT10g} & 1.601.787 & 2,23 & 0.00 & 0,99 \\
\textbf{Wiki-talk} & 2.394.385 & 2,46 & 0.00 &1,54 \\
\textbf{Catster/Dogster} & 623.766 & 2,13 & 0.00 & 1,20 \\
\textbf{Gowalla} & 196.591 & 2,65 & 0.80 &1,24 \\
\textbf{Youtube} & 1.134.890 & 2,22& 0.00 &1,05
\end{tabular}
\end{ruledtabular}%
\caption{Data sets. $N$ denotes the number of vertices, $\tau$ the exponent of the tail of the degree distribution estimated by the method proposed in~\cite{clauset2009} together with the goodness of fit criterion proposed in~\cite{clauset2009} (when the goodness of fit is at least 0.10, a power-law tail cannot be rejected), and $\alpha$ denotes the exponent of $c(k)$.}
\label{tab:data}%
\end{table}%
Figure~\ref{fig:chfinite} also brings to bear a potential pitfall when the goal is to obtain statistically accurate estimates for the slope of $c(h)$. Observe the extremely slow convergence to the limiting curve for $N=\infty$; a well documented property of certain clustering measures~\cite{boguna2009,colomer2012,janssen2015,hofstad2017b}. In Appendix~\ref{sec:hcder}
we again use the integral expression \eqref{int1} to characterize the limiting curve for $N=\infty$ and
the rate of convergence as function of $N$, and indeed extreme $N$-values are required for statistically reliable slope estimates for e.g.~$t$-values of $\tfrac12$ and $\tfrac{1}{\tau-1}$; this is also apparent from visual inspection of Fig.~\ref{fig:chfinite}.
Therefore, the estimates in Table~\ref{tab:data} only serve as indicative values of $\alpha$. Finally, observe that Range II disappears in the limiting curve, due to the rescaling in \eqref{eq:sigmam}, but again only for extreme $N$-values. Because this paper is about structure rather than statistical estimation, the slow convergence in fact provides additional support for the persistence of Range II in Figs.~\ref{fig:chas} and~\ref{fig:ch}.
Table~\ref{tab:data} also shows that the relation $\alpha=-2(3-\tau)$ is inaccurate for the real-world data sets, in turn affecting the theoretical boundaries of the three regimes indicated in Fig.~\ref{fig:ch}. One explanation for this inaccuracy is that the real-world networks might not follow pure power-law distributions, as measured by the goodness of fit criterion in Table~\ref{tab:data}, and visualized in Appendix~\ref{sec:degree}. Furthermore, real-world networks are usually highly clustered and contain community structures, whereas the hidden variable model is locally tree-like. These modular structure may explain, for example, why the power-law decay of the hidden variable model is less pronounced in the three social networks of Fig.~\ref{fig:ch}. It is remarkable that despite these differences between hidden variable models and real-world networks, the global shape of the $c(k)$ curve of the hidden variable model is still visible in these heavy-tailed real-world networks.
\section{Discussion}\label{sec:disc}
The hidden variable model gives rise to {\it single-edge} networks in which pairs of vertices can only be connected once. Hierarchical modularity and the decaying clustering spectrum have been contributed to this restriction that no two vertices have more than one edge connecting them~\cite{pastor2001b, maslov2004,park2003,newman2002assortative,newman2003}. The physical intuition is that the single-edge constraint leads to far fewer connections between high-degree vertices than anticipated based on randomly assigned edges.
We have indeed confirmed this intuition, not only through analytically revealing the universal clustering curve, but also by providing an alternative derivation of the three ranges based on energy minimization and structural correlations.
We now show that the clustering spectrum revealed using the hidden variable model, also appears for a second widely studied null model. This second model cannot be the Configuration Model (CM), which preserves the degree distribution by making connections between vertices in the most random way possible~\cite{bollobas1980, newman2001}. Indeed, because of the random edge assignment, the CM has no degree correlations, leading in the case of scale-free networks with diverging second moment to uncorrelated networks with non-negligible fractions of self-loops (a vertex joined to itself) and multiple connections (two vertices connected by more than one edge). This picture changes dramatically when self-loops and multiple edges are avoided,
a restriction mostly felt by the high-degree nodes, who can no longer establish multiple edges among each other.
We therefore consider the Erased Configuration Model (ECM) that takes a sample from the CM and then erases all the self-loops and multiple edges. While this removes some of the edges in the graph, thus violating the hard constraint, only a small proportion of the edges is removed, so that the degree of vertex $j$ in ECM is still close to $D_j$~\cite[Chapter 7]{hofstad2009}. In the ECM, the probability that a vertex with degree $D_i$ is connected to a vertex with degree $D_j$ can be approximated by $1-{\rm e}^{-D_iD_j/\mean{D}N}$~\cite[Eq.(4.9)]{hofstad2005}. Therefore, we expect the ECM and the hidden variable model to have similar properties (see e.g.~\cite{hofstad2017b}) when we choose
\begin{equation}\label{eq:conecm}
p(h,h')= 1-{\rm e}^{-h h'/N\mean{h}}\approx\frac{h h'}{N\mean{h}}.
\end{equation}
Figure~\ref{fig:ECMhidden} illustrates how both null models generate highly similar spectra, which provides additional support for the claim that the clustering spectrum is a universal property of simple scale-free networks. The ECM is more difficult to deal with compared to hidden variable models, since edges in ECM are not independent. In particular, we expect that these dependencies vanish for the $k\mapsto\bar{c}(k)$ curve. Establishing the universality of the $k\mapsto \bar c(k)$ curve for other random graph null models such as ECM, networks with an underlying geometric space~\cite{serrano2008} or hierarchical configuration models~\cite{stegehuis2015} is a major research direction.
\begin{figure}[t]
\centering
\includegraphics[width=0.4\textwidth]{ECMhidden.pdf}
\caption{$\bar c(k)$ for a hidden variable model with connection probabilities~\eqref{eq:conecm} (solid line) and an erased configuration model (dashed line). The presented values of $\bar c(k)$ are averages over $10^4$ realizations of networks of size $N=10^5$. }
\label{fig:ECMhidden}
\end{figure}
The ECM and the hidden variable model are both null models with soft constraints on the degrees. Putting hard constraints on the degrees with the CM, has the nice property that simple graphs generated using this null model are uniform samples of all simple graphs with the same degree sequence. Dealing with such uniform samples is notoriously hard when the second moment of the degrees is diverging, for example since the CM will yield many edges between high-degree vertices. This makes sampling uniform graphs difficult~\cite{milo2003, viger2005,delgenio2010}. Thus, the joint requirement of hard degree and single-edge constraints, as in the CM, presents formidable technical challenges. Whether our results for the $k\mapsto\bar{c}(k)$ curve for soft-constraint models also carry over to these uniform simple graphs is a challenging open problem.
In this paper we have investigated the presence of triangles in the hidden variable model.
We have shown that by first conditioning on the node degree, there arises a unique
`most likely' triangle with two other vertices of specific degrees. We have not only explained this insight heuristically, but it is also reflected in the elaborate analysis of the double integral for $c(h)$ in Appendix \ref{sec:chcomp}. As such, we have introduced an intuitive and tractable mathematical method for asymptotic triangle counting. It is likely that the method carries over to counting other motifs, such as squares, or complete graphs of larger sizes. For any given motif, and first conditioning on the node degree, we again expect to find specific configuration that are most likely. Further mathematical challenges need to be overcome, though, because we expect that the `most likely' configurations critically depend on the precise motif topologies and the associated energy minimization problems.
\acknowledgements
This work is supported by NWO TOP grant 613.001.451 and by the NWO Gravitation Networks grant 024.002.003.
The work of RvdH is further supported by the NWO VICI grant 639.033.806. The work of JvL is further supported by an NWO TOP-GO grant and by an ERC Starting Grant.
| {'timestamp': '2017-10-06T02:06:38', 'yymm': '1706', 'arxiv_id': '1706.01727', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01727'} | arxiv |
\subsubsection{Reference/Translation Classification}
\label{sec:classification}
We experiment with predicting whether a given sentence is a reference or a back-translation. We train two kinds of binary classifiers,
one using an LSTM and the other using word averaging, followed by a softmax layer.
We select 40,000 reference/translation pairs for training and 5,000 for each of validation and testing. A single example is a sentence with label 1 if it is a reference translation and 0 if it is a translation.
In training, we consider the entire $k$-best list as examples of translations, selecting one translation to be the 0-labeled example. We either do this randomly or
we score each sentence in the $k$-best list using our model and select the one with the highest probability of being a reference as the 0-labeled example. We tune this choice as well as an $L_2$ regularizer on the word embeddings (tuned over $\{10^{-5},10^{-6},10^{-7},10^{-8},0\}$). We use \textsc{paragram-sl999}\xspace embeddings~\cite{wieting2015ppdb-short} to initialize the word embeddings for both models.
Models were trained by minimizing cross entropy for 10 epochs using Adam
with learning rate 0.001. We performed this procedure separately for each of the 10 language/data pairs.
\begin{table}
\setlength{\tabcolsep}{4pt}
\small
\centering
\begin{tabular} { | l | l | l || c | c | c |}
\hline
Model & Lang. & Data & Test Acc. & + Acc. & - Acc. \\
\hline
& & CC & 72.2 & 72.2 & 72.3 \\
& CS & EP & 72.3 & 64.3 & 80.3 \\
& & News & 79.7 & 73.2 & 86.3 \\
\cline{2-6}
& & CC & 80.7 & 82.1 & 79.3 \\
\multirow{2}{*}{LSTM} & \multirow{2}{*}{FR} & EP & 79.3 & 75.2 & 83.4 \\
& & Giga & \bf 93.1 & \bf 92.3 & 93.8 \\
& & News & 84.2 & 81.2 & 87.3 \\
\cline{2-6}
& & CC & 79.3 & 71.7 & 86.9 \\
& DE & EP & 85.1 & 78.0 & 92.2 \\
& & News & 89.8 & 82.3 & \bf 97.4 \\
\hline
& & CC & 71.2 & 68.9 & 73.5 \\
& CS & EP & 69.1 & 63.0 & 75.1 \\
& & News & 77.6 & 71.7 & 83.6 \\
\cline{2-6}
& & CC & 78.8 & 80.4 & 77.2 \\
\multirow{2}{*}{\textsc{Avg}\xspace} & \multirow{2}{*}{FR} & EP & 78.9 & 75.5 & 82.3 \\
& & Giga & \bf 92.5 & \bf 91.5 & 93.4 \\
& & News & 82.8 & 81.1 & 84.5 \\
\cline{2-6}
& & CC & 77.3 & 70.4 & 84.1 \\
& DE & EP & 82.7 & 73.4 & 91.9 \\
& & News & 87.6 & 80.0 & \bf 95.3 \\
\hline
\end{tabular}
\caption{\label{table:classificationresults}
Results of reference/translation classification (accuracy$\times 100$). The highest score in each column is in boldface. Final two columns show accuracies of positive (reference) and negative classes, respectively.
}
\end{table}
The results are shown in Table~\ref{table:classificationresults}. While performance varies greatly across data sources, the LSTM always outperforms the word averaging model.
For our translation-reference classification, we note that our results can be further improved. We also trained models on 90,000 examples, essentially doubling the amount of data, and the results improved by about 2\% absolute on each dataset on both the validation and testing data.
\paragraph{Analyzing Reference Classification.}
We inspected the output of our reference classifier and noted a few qualitative trends which we then verified empirically. First, neural MT systems tend to use a smaller vocabulary and exhibit more restricted use of phrases.
They correspondingly tend to show more repetition in terms of both words and longer $n$-grams. This hypothesis can be verified empirically in several ways. We do so by calculating the entropy of the unigrams and trigrams for both the references and the translations from our 150,000 reference-translation pairs.\footnote{We randomly selected translations from the beam search.} We also calculate the repetition percentage of unigrams and trigrams in both the references and translations. This is defined as the percentage of words that are repetitions (i.e., have already appeared in the sentence). For unigrams, we only consider words consisting of at least 3 characters.
The results are shown in Table~\ref{table:repetitionentropy}, in which we
subtract the translation value from the reference value for each measure. The translated text has lower $n$-gram entropies and higher rates of repetition.
This appears for all datasets, but is strongest for common crawl and French-English $10^9$.
\begin{table}
\setlength{\tabcolsep}{4pt}
\small
\centering
\begin{tabular} { | l | l || c | c | c | c |}
\hline
Lang. & Data & Ent. (uni) & Ent. (tri) & Rep. (uni) & Rep. (tri) \\
\hline
& CC & 0.50 & 1.13 & -7.57\% & -5.58\% \\
CS & EP & 0.14 & 0.31 & -0.88\% & -0.11\% \\
& News & 0.16 & 0.31 & -0.96\% & -0.16\% \\
\hline
& CC & 0.97 & 1.40 & -8.50\% & -7.53\% \\
\multirow{2}{*}{FR} & EP & 0.51 & 0.69 & -1.85\% & -0.58\% \\
& Giga & 0.97 & 1.21 & -5.30\% & -7.74\% \\
& News & 0.67 & 0.75 & -2.98\% & -0.85\% \\
\hline
& CC & 0.29 & 0.57 & -1.09\% & -0.73\% \\
DE & EP & 0.32 & 0.53 & -0.14\% & -0.11\% \\
& News & 0.40 & 0.37 & -1.02\% & -0.24\% \\
\hline
\multicolumn{2}{|c||}{All} & 0.46 & 0.74 & -2.80\% & -2.26\% \\
\hline
\end{tabular}
\caption{\label{table:repetitionentropy}
Differences in entropy and repetition of unigrams/trigrams in references and translations. Negative values indicate translations have a higher value, so references show consistently higher entropies and
lower repetition rates.
}
\end{table}
We also noticed that translations are less likely to use rare words, instead willing to use a larger sequence of short words to convey the same meaning.
We found that translations were sometimes more vague and, unsurprisingly, were more likely to be ungrammatical.
We check whether our classifier is learning these patterns by computing the reference probabilities $P(\text{R})$ of 100,000 randomly sampled translation-reference pairs from each dataset (the same used to train models). We then compute the correlation between our classification score and different metrics: the repetition rate of the sentence, the average inverse-document frequency (IDF) of the sentence,\footnote{Wikipedia was used to calculate the frequencies of the tokens. All tokens were lowercased.} and the length of the translation.
\begin{table}
\setlength{\tabcolsep}{4pt}
\small
\centering
\begin{tabular} { | l | c |}
\hline
Metric & Spearman's $\rho$ \\
\hline
Unigram repetition rate & -35.1 \\
Trigram repetition rate & -18.4 \\
Average IDF & \phantom{-}27.8 \\
Length & -34.0 \\
\hline
\end{tabular}
\caption{\label{table:correlations}
Spearman's $\rho$ between our reference classifier probability and various measures.
}
\end{table}
\begin{table}[t]
\setlength{\tabcolsep}{3pt}
\small
\centering
\begin{tabular} { | c p{0.76\columnwidth} c| } \hline
& Sentence & $P(\text{R})$ \\
\hline
R: & Room was comfortable and the staff at the front desk were very helpful. & 1.0 \\
T: & The staff were very nice and the room was very nice and the staff were very nice. & $<\!0.01$ \\
\hline
R: & The enchantment of your wedding day, captured in images by Flore-Ael Surun. & 0.98 \\
T: & The wedding of the wedding, put into images by Flore-Ael A. & $<\!0.01$ \\
\hline
R: & Mexico and Sweden are longstanding supporters of the CTBT. & 1.0 \\
T: & Mexico and Sweden have been supporters of CTBT for a long time now. & 0.06 \\
\hline
R: & We thought Mr Haider ' s Austria was endangering our freedom. & 1.0 \\
T: & We thought that our freedom was put at risk by Austria by Mr Haider. & 0.09 \\
\hline
\end{tabular}
\caption{
Illustrative examples of references (R) and back-translations (T),
along with probabilities from the reference classifier. See text for details.
}
\label{table:classifyanalysis}
\end{table}
The results are shown in Table~\ref{table:correlations}.
Negative correlations with repetitions indicates that fewer repetitions lead to higher $P(\text{R})$. A positive correlation with average IDF indicates that $P(\text{R})$ rewards the use of rare words. Interestingly, negative correlation with length suggests that the classifier prefers
more concise sentences.\footnote{This is noteworthy because the average sentence length of translations and references is not significantly different.}
We show examples of these phenomena
in Table~\ref{table:classifyanalysis}.
The first two examples show the tendency of NMT to repeat words and phrases. The second two show how they tend to use sequences of common words (``put at risk'') rather than rare words (``endangering'').
\section{Introduction}
\input{introduction}
\section{Related Work}
\input{relwork}
\section{Neural Machine Translation}
\input{nmt}
\section{Models and Training}
\input{models}
\section{Experiments} \label{sec:exp}
\input{experiments}
\section{Conclusion}
\input{conclusion}
\section*{Acknowledgments}
This research used resources of the Argonne Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC02-06CH11357. We thank the developers of Theano~\cite{2016arXiv160502688short} and NVIDIA Corporation for donating GPUs used in this research.
\subsection{Evaluation}
We evaluate the quality of a paraphrase dataset
by using the experimental setting of \newcite{wieting-16-full}. We use the paraphrases as training data to create paraphrastic sentence embeddings, then evaluate the embeddings on the
SemEval semantic textual similarity (STS) tasks from 2012 to 2015~\cite{agirre2012semeval,diab2013eneko,agirre2014semeval,agirre2015semeval}, the SemEval 2015 Twitter task \cite{xu2015semeval}, and the SemEval 2014 SICK Semantic Relatedness task \cite{marelli2014semeval}.
Given two sentences, the aim of the STS tasks is to predict their similarity on a 0-5 scale, where 0 indicates the sentences are on different topics and 5 indicates that they are completely equivalent.
As our test set, we report the average Pearson's $r$ over these 22 sentence similarity tasks.
As development data, we use the 2016 STS tasks~\cite{agirre2016semeval},
where the tuning criterion is the average Pearson's $r$ over its 5 datasets.
\subsection{Experimental Setup}
For fair comparison among different datasets and dataset filtering methods described below, we use only 24,000 training examples for nearly all experiments. Different filtering methods
produce different amounts of training data, and using 24,000 examples allows us to keep the amount of training data constant across filtering methods. It also allows us to complete these several thousand experiments in a reasonable amount of time. In Section~\ref{sec:scaling} below, we discuss experiments that scale up to larger amounts of training data.
We use \textsc{paragram-sl999}\xspace embeddings~\cite{wieting2015ppdb-short} to initialize the word embedding matrix ($W_w$) for both models. For all experiments, we fix the mini-batch size to 100, $\lambda_{w}$ to 0, $\lambda_{c}$ to 0, and the margin $\delta$ to 0.4. We train \textsc{Avg}\xspace for 20 epochs, and the \textsc{GRAN}\xspace for 3, since it converges much faster. For optimization we use Adam~\cite{kingma2014adam} with a learning rate of 0.001.
We compare to two data resources used in previous work to learn paraphrastic sentence embeddings.
The first is phrase pairs from PPDB, used by \newcite{wieting-16-full} and \newcite{wieting2016charagram}. PPDB comes in different sizes (S, M, L, XL, XXL, and XXXL), where each larger size subsumes all smaller ones. The pairs in PPDB are sorted by a confidence measure and so the smaller sets contain higher precision paraphrases. We use PPDB XL in this paper, which consists of fairly high precision paraphrases.
The other data source is the aligned Simple English / standard English Wikipedia data developed by \newcite{coster2011simple} and used for learning paraphrastic sentence embeddings by \newcite{wieting-17-full}. We refer to this data source as ``SimpWiki\xspace''. We refer to our back-translated data as ``NMT''.
\subsection{Dataset Comparison}
We first compare datasets, randomly sampling 24,000 sentence pairs from each of PPDB, SimpWiki\xspace, and each of our NMT datasets. The only hyperparameter to tune for this experiment is the stopping epoch, which we tune based on our development set. The results are shown in Table~\ref{table:randomresults}.
\begin{table}
\setlength{\tabcolsep}{4pt}
\small
\centering
\begin{tabular} { | l | l || c | c |}
\hline
Lang. & Data & \textsc{GRAN}\xspace & \textsc{Avg}\xspace \\
\hline
\multicolumn{2}{|c||}{SimpWiki\xspace} & 67.2 & 65.8 \\
\multicolumn{2}{|c||}{PPDB} & 64.5 & 65.8 \\
\hline
& CC & 65.5 & 65.4 \\
CS & EP & 66.5 & 65.1 \\
& News & 67.2 & 65.1 \\
\hline
& CC & 67.3 & 66.1 \\
\multirow{2}{*}{FR} & EP & \bf 67.8 & 65.7 \\
& Giga & 67.4 & 65.9 \\
& News & 67.0 & 65.2 \\
\hline
& CC & 66.5 & \bf 66.2 \\
DE & EP & 67.2 & 65.6 \\
& News & 66.5 & 64.7 \\
\hline
\end{tabular}
\caption{\label{table:randomresults}
Test results (average Pearson's $r\times 100$ over 22 STS datasets) using a random selection of 24,000 examples from each data source considered in this paper.
}
\end{table}
We find that the NMT datasets are all effective as training data, outperforming PPDB in all cases when using the \textsc{GRAN}\xspace. There are exceptions when using \textsc{Avg}\xspace, for which PPDB is quite strong. This is sensible because \textsc{Avg}\xspace is not sensitive to word order, so the fragments in PPDB do not cause problems. However, when using the \textsc{GRAN}\xspace, which is sensitive to word order, the NMT data is consistently better than PPDB. It often exceeds the performance of training on the SimpWiki\xspace data, which consists entirely of human-written sentences.
\subsection{Filtering Methods}
Above we showed that the NMT data is better than PPDB when using a \textsc{GRAN}\xspace and often as good as SimpWiki\xspace. Since we have access to so much more NMT data than SimpWiki (which is limited to fewer than 200k sentence pairs), we next experiment with several approaches for filtering the NMT data.
We first consider filtering based on length, described in Section~\ref{sec:length}.
We then consider filtering based on several quality measures designed to find more natural and higher-quality translations, described in Section~\ref{sec:quality}.
Finally, we consider several measures of diversity. By diversity we mean here a measure of the lexical and syntactic difference between the reference and its paraphrase.
We describe these experiments in Section~\ref{sec:diversity}.
We note that these filtering methods are not all mutually exclusive and could be combined, though in this paper we experiment with each individually and leave combination to future work.
\subsection{Length Filtering}
\label{sec:length}
We first consider filtering candidate sentence pairs by length, i.e., the number of tokens in the translation. The tunable parameters are the upper and lower bounds of the translation lengths.
We experiment with a partition of length ranges, showing the results in Table~\ref{table:length-bins}. These results are averages across all language pairs and data sources of training data for each length range shown. We find it best to select NMT data where the translations have between 0 and 10 tokens, with performance dropping as sentence length increases. This is true for both the \textsc{GRAN}\xspace and \textsc{Avg}\xspace models. We do the same filtering for the SimpWiki\xspace data, though the trend is not nearly as strong. This may be because machine translation quality drops as sentence length increases. This trend appears even though the datasets with higher ranges have more tokens of training data, since only the number of training sentence pairs is kept constant across configurations.
We then tune the length range using our development data, considering the following length ranges: [0,10], [0,15], [0,20], [0,30], [0,100], [10,20], [10,30], [10,100], [15,25], [15,30], [15,100], [20,30], [20,100], [30,100].
We tune over ranges as well as language, data source, and stopping epoch, each time training on 24,000 sentence pairs.
We report the average test results over all languages and datasets in Table~\ref{table:length-results-gan-wa}. We compare to a baseline that draws a random set of data, showing that length-based filtering leads to gains of nearly half a point on average across our test sets. The tuned length ranges are short for both NMT and SimpWiki\xspace.
The distribution of lengths in the NMT and SimpWiki\xspace data is fairly similar. The 10 NMT datasets all have mean translation lengths between 22 and 28 tokens, with common crawl on the lower end
and Europarl on the higher end.
The data has fairly large standard deviations (11-25 tokens) indicating that there are some very long translations in the data. SimpWiki\xspace has a mean length of 24.2 and a standard deviation of 13.1 tokens.
\begin{table}[t]
\small
\centering
\begin{tabular} { | l | l | c | c | c | c |}
\cline{3-6}
\multicolumn{2}{c|}{} & \multicolumn{4}{c|}{Length Range} \\
\hline
Data & Model & 0-10 & 10-20 & 20-30 & 30-100 \\
\hline
\multirow{2}{*}{SimpWiki\xspace} & \textsc{GRAN}\xspace & 67.4 & 67.7 & 67.1 & 67.3 \\
& \textsc{Avg}\xspace & 65.9 & 65.7 & 65.6 & 65.9 \\
\hline
\multirow{2}{*}{NMT} & \textsc{GRAN}\xspace & 66.6 & 66.5 & 66.0 & 64.8 \\
& \textsc{Avg}\xspace & 65.7 & 65.6 & 65.3 & 65.0 \\
\hline
\end{tabular}
\caption{\label{table:length-bins}
Test correlations for our models when trained on sentences with particular length ranges (averaged over languages and data sources for the NMT rows). Results are on STS datasets (Pearson's $r \times 100$).
}
\end{table}
\begin{table}
\small
\centering
\begin{tabular} { | l | c | c | c | c |}
\cline{2-5}
\multicolumn{1}{c|}{} & \multicolumn{2}{c|}{NMT} & \multicolumn{2}{c|}{SimpWiki\xspace} \\
\hline
Filtering Method & \textsc{GRAN}\xspace & \textsc{Avg}\xspace & \textsc{GRAN}\xspace & \textsc{Avg}\xspace \\
\hline
None (Random) & 66.9 & 65.5 & 67.2 & 65.8\\
\hline
Length & 67.3 & 66.0 & 67.4 & 66.2 \\
Tuned Len. Range & [0,10] & [0,10] & [0,10] & [0,15]\\
\hline
\end{tabular}
\caption{\label{table:length-results-gan-wa}
Length filtering test results after tuning length ranges on development data (averaged over languages and data sources for the NMT rows). Results are on STS datasets (Pearson's $r \times 100$).
}
\end{table}
\subsection{Quality Filtering}
\label{sec:quality}
We also consider filtering based on several measures of the ``quality'' of the back-translation:
\begin{itemizesquish}
\item {\bf Translation Cost}: We use the cost (negative log likelihood) of the translation from the NMT system, divided by the number of tokens in the translation.
\item {\bf Language Model}: We train a separate language model for each language/data pair on 40,000 references that are separate from the 100,000 used for mining data. Due to the small data size, we train a 3-gram language model and use the KenLM toolkit~\cite{heafield2011kenlm}.
\item {\bf Reference/Translation Classification}: We train binary classifiers to predict whether a given sentence is a reference or translation (described in Section~\ref{sec:classification}).
We use the probability of being a reference as the score for filtering.
\end{itemizesquish}
For translation cost, we tune the upper bound of the cost
over the range $[0.2, 1]$ using increments of 0.1.
For the language model, we tune an upper bound on the perplexity of the translations among the set $\{25,50,75,100,150,200,\infty\}$. For the classifier, we tune the minimum probability of being a reference over the range $[0, 0.9]$ using increments of 0.1.
\begin{table}
\small
\centering
\begin{tabular} { | l || c | c |}
\hline
Filtering Method & \textsc{GRAN}\xspace & \textsc{Avg}\xspace \\
\hline
None (Random) & 66.9 & 65.5 \\
\hline
Translation Cost & 66.6 & 65.4\\
Language Model & 66.7 & 65.5\\
Reference Classification & 67.0 & 65.5\\
\hline
\end{tabular}
\caption{\label{table:qua-results-gan-wa}
Quality filtering test results after tuning quality hyperparameters on development data (averaged over languages and data sources for the NMT rows). Results are on STS datasets (Pearson's $r \times 100$).
}
\end{table}
Table~\ref{table:qua-results-gan-wa} shows average test results over all languages and datasets after tuning hyperparameters on our development data for each. The translation cost and language model are not helpful for filtering, as random selection outperforms them. Both methods are outperformed by the reference classifier, which slightly outperforms random selection when using the stronger \textsc{GRAN}\xspace model.
We now discuss further how we trained the reference classifier and the data characteristics that it reveals.
We did not experiment with quality filtering for SimpWiki\xspace since it is human-written text.
\input{classification}
\subsection{Diversity Filtering}
\label{sec:diversity}
\begin{table}
\setlength{\tabcolsep}{4pt}
\small
\centering
\begin{tabular} { | l | c | c | c | c |}
\cline{2-5}
\multicolumn{1}{c|}{} & \multicolumn{2}{c|}{NMT} & \multicolumn{2}{c|}{SimpWiki\xspace} \\
\hline
Filtering Method & \textsc{GRAN}\xspace & \textsc{Avg}\xspace & \textsc{GRAN}\xspace & \textsc{Avg}\xspace \\
\hline
Random & 66.9 & 65.5 & 67.2 & 65.8\\
\hline
Unigram Overlap & 66.6 & 66.1 & 67.8 & 67.4 \\
Bigram Overlap & 67.0 & 65.5 & 68.0 & 67.2 \\
Trigram Overlap & 66.9 & 65.4 & 67.8 & 66.6 \\
BLEU Score & 67.1 & 65.3 & 67.5 & 66.5 \\
\hline
\end{tabular}
\caption{\label{table:diversity-results}
Diversity filtering test results after tuning filtering hyperparameters on development data (averaged over languages and data sources for the NMT rows). Results are on STS datasets (Pearson's $r \times 100$).
}
\end{table}
We consider several filtering criteria based on measures that encourage particular amounts of disparity between the reference and its back-translation:
\begin{itemizesquish}
\item {\bf $n$-gram Overlap}: Our $n$-gram overlap measures are calculated by counting $n$-grams of a given order in both the reference and translation, then dividing the number of shared $n$-grams by the total number of $n$-grams in the reference or translation, whichever has fewer. We use three $n$-gram overlap scores ($n\in\{1,2,3\}$).
\item {\bf BLEU Score}: We use a smoothed sentence-level BLEU variant from \newcite{nakov-guzman-vogel:2012:PAPERS} that uses smoothing for all $n$-gram lengths and also smooths the brevity penalty.
\end{itemizesquish}
For both methods, the tunable hyperparameters are the upper and lower bounds for the above scores.
We tune over the cross product of lower bounds $\{0,0.1,0.2,0.3\}$ and upper bounds $\{0.6,0.7,0.8,0.9,1.0\}$.
Our intuition is that the best data will have some amount of $n$-gram overlap, but not too much. Too much $n$-gram overlap will lead to pairs that are not useful for learning.
The results are shown in Table~\ref{table:diversity-results}, for both models and for both NMT and SimpWiki\xspace. We find that the diversity filtering methods lead to consistent improvements when training on SimpWiki\xspace. We believe this is because many of the sentence pairs in SimpWiki\xspace are near-duplicates and these filtering methods favor data
with more differences.
Diversity filtering can also help when selecting NMT data, though the differences are smaller. We do note that unigram overlap is the strongest filtering strategy for \textsc{Avg}\xspace. When looking at the threshold tuning, the best lower bounds are often 0 or 0.1 and the best upper bounds are typically 0.6-0.7, indicating that sentence pairs with a high degree of word overlap are not useful for training. We also find that the \textsc{GRAN}\xspace benefits more from filtering based on higher-order $n$-gram overlap than \textsc{Avg}\xspace.
\subsection{Scaling Up}
\label{sec:scaling}
Unlike the SimpWiki\xspace data, which is naturally limited and only available for English, we can scale our approach. Since we use data on which the NMT systems were trained and perform back-translation, we can easily produce large training sets of paraphrastic sentence pairs for many languages and data domains, limited only by the availability of bitext.
\begin{table}
\small
\centering
\begin{tabular} { | l || c | c |}
\hline
Data & \textsc{GRAN}\xspace & \textsc{Avg}\xspace \\
\hline
PPDB & 64.6 & 66.3\\
SimpWiki\xspace (100k/168k) & 67.4 & \bf 67.7 \\
\hline
CC-CS (24k) & 66.8 & - \\
CC-DE (24k) & - & 66.6 \\
\hline
CC-CS (100k) & \bf 68.5 & - \\
CC-DE (168k) & - & 67.6\\
\hline
\end{tabular}
\caption{\label{table:scalingup}
Test results when using more training data. More data helps both \textsc{Avg}\xspace and \textsc{GRAN}\xspace, where both models get close to or surpass training on SimpWiki\xspace and comfortably surpass the PPDB baseline. The amount of training examples used is in parentheses.
}
\end{table}
To test this, we took the tuned filtering approaches and language/data pairs (according to our development dataset only
), and trained them on more data. These were the CC-CS for \textsc{GRAN}\xspace and CC-DE for \textsc{Avg}\xspace models. We trained them with the same amount of sentence pairs from SimpWiki\xspace.\footnote{Since the CC-CS data was the smallest dataset used to train the CS NMT system (See Table~\ref{tbl:corp}) and limited, we only used 100,000 pairs for the \textsc{GRAN}\xspace experiment. For \textsc{Avg}\xspace, we used the full 167,689.} We also compare to PPDB XL, and since PPDB has fewer tokens per example, we use enough PPDB data so that it has at least as many tokens as the SimpWiki\xspace data used in the experiment.\footnote{This was 800,011 and 1,341,188 pairs in the \textsc{GRAN}\xspace and \textsc{Avg}\xspace respectively.}
The results are shown in Table~\ref{table:scalingup}, where the NMT data surpasses SimpWiki\xspace, while both SimpWiki\xspace and the NMT data perform similarly for \textsc{Avg}\xspace. PPDB is soundly beaten by both data sources. Moreover, the CC-CS and CC-DE data have greatly improved their performance from training on just 24,000 examples from 66.77 and 66.61 respectively, providing more evidence that this approach does indeed scale.
\subsection{Models}
We wish to embed a word sequence $s$ into a fixed-length vector.
We denote the $t$th word in $s$ as $s_t$, and we denote its word embedding by $x_t$.
We focus on two models in this paper.
The first model, which we call \textsc{Avg}\xspace, simply averages the embeddings $x_t$ of all words in $s$. The only parameters learned in this model are those in the word embeddings themselves, which are stored in the word embedding matrix $W_w$.
This model was found by \newcite{wieting-16-full} to perform very strongly for semantic similarity tasks.
The second model, the \textsc{gated recurrent averaging network}\xspace (\textsc{GRAN}\xspace)~\cite{wieting-17-full}, combines the benefits of \textsc{Avg}\xspace and long short-term memory (LSTM) recurrent neural networks~\cite{hochreiter1997long}. It first uses an LSTM to generate a hidden vector, $h_t$, for each word $s_t$ in $s$. Then $h_t$ is used to compute a gate that is elementwise-multiplied with $x_t$, resulting in a new hidden vector $a_t$ for each step $t$:
\begin{equation}
a_t = x_t\odot\sigma(W_xx_t + W_hh_t + b) \label{eq:gan}
\end{equation}
\noindent
where $W_x$ and $W_h$ are parameter matrices, $b$ is a parameter vector, and $\sigma$ is the elementwise logistic sigmoid function. After all $a_t$ have been generated for a sentence, they are averaged to produce the embedding for that sentence. The \textsc{GRAN}\xspace reduces to \textsc{Avg}\xspace if the output of the gate is always 1. This model includes as learnable parameters those of the LSTM, the word embeddings, and the additional parameters in Eq.~\eqref{eq:gan}. We use $W_c$ to denote the ``compositional'' parameters, i.e., all parameters other than the word embeddings.
\subsection{Training}
We follow the training procedure of \newcite{wieting2015ppdb-short} and \newcite{wieting-16-full}.
The training data is a set $S$ of paraphrastic
pairs $\langle s_1, s_2\rangle$ and
we optimize a margin-based loss:
\begin{small}
\begin{align}
&\underset{W_c,W_w}{\text{min}} \frac{1}{|S|}\Bigg(\sum_{\langle s_1,s_2\rangle \in S}
\max(0,\delta - \cos(g(s_1), g(s_2))\\
&+ \cos(g(s_1), g(t_1))) + \max(0,\delta - \cos(g(s_1),g(s_2))\\
&+ \cos(g(s_2), g(t_2)))\bigg) + \lambda_c\norm{W_c}^2 + \lambda_{w}\norm{W_{w_{\mathit{initial}}} - W_w}^2
\label{eq:obj}
\end{align}
\end{small}
\noindent where $g$ is the model (\textsc{Avg}\xspace or \textsc{GRAN}\xspace), $\delta$ is the margin, $\lambda_{c}$ and $\lambda_{w}$ are regularization parameters, $W_{w_{\mathit{initial}}}$ is the initial word embedding matrix, and $t_1$ and $t_2$ are ``negative examples'' taken from a mini-batch during optimization.
The intuition is that we want the two texts to be more similar to each other ($\cos(g(s_1), g(s_2))$) than either is to their respective negative examples $t_1$ and $t_2$, by a margin of at least $\delta$.
To select $t_1$ and $t_2$,
we choose the most similar sentence in some set (other than those in the given pair).
For simplicity
we use the mini-batch for this set, i.e.,
we choose $t_1$ for a given $\langle s_1, s_2\rangle$ as follows:
\begin{equation}
t_1 = \argmax_{t : \langle t, \cdot\rangle \in S_b \setminus \{\langle s_1, s_2\rangle\}} \cos(g(s_1), g(t))
\end{equation}
\noindent where $S_b\subseteq S$ is the current mini-batch.
That is, we want to choose a negative example $t_i$ that is similar to $s_i$ according to the current model.
The downside is that we may occasionally choose a phrase $t_i$ that is actually a true paraphrase of $s_i$.
| {'timestamp': '2017-06-07T02:08:34', 'yymm': '1706', 'arxiv_id': '1706.01847', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01847'} | arxiv |
\section{Introduction}
Wireless multicast media streaming is anticipated to be a significant component of the forthcoming 5G systems, motivated by the consumers' desire to take advantage of high quality multimedia wireless devices (e.g., 4k hand-held devices, 3D augmented reality)\cite{Tom_Luo_Multicasting_TSP_2006,Zhengzheng_Xiang_TWC_Multicasting_2013,Zhengzheng_Xiang_JSAC_Multicasting_2014}. Energy efficiency and security are major critical issues that must be addressed in the design of such systems.
Radio frequency (RF) energy harvesting and transfer techniques have recently been considered as a promising solution to the energy-constrained wireless networks \cite{Varshney_08,Shannon_Tesla_10,Zhang_Rui_SWIPT_TWC13}.
As a recent application of RF energy harvesting and transfer techniques, wireless powered communication networks (WPCNs) have become a novel technology in wireless networking and attracted more and more attention \cite{Rui_Zhang_WPCN_CM_2016}. A ``\emph{harvest-then-transmit}'' protocol was proposed for WPCNs in \cite{Rui_Zhang_WPCN_TWC_2014}, where the wireless users harvest power from the RF signals broadcast by an access point in the downlink (DL), and then send information to the AP in the uplink (UL) by employing the harvested energy. Cooperative protocols for WPCNs were developed based on different models \cite{Rui_Zhang_GLOBECOM_2014_UC_WPCN,He_Chen_ITW_WPCN_Relay_2014,He_Chen_TSP_HTC_WPCN_2016}.
A different approach consists of deploying a dedicated wireless energy transfer (WET) network with multiple power beacons (PBs) to provide wireless charging services to the wireless terminals via the RF energy transfer technique \cite{Kaibin_Huang_CM_2015,Kaibin_Huang_TWC_2014_WPT}.
Since the PBs do not require any \emph{backhaul link}, the associated cost of PBs deployment is much lower, hence, it is feasible to deploy the PBs densely to guarantee network coverage for a wide range of mobile devices \cite{Caijun_Zhong_SPL_2015_WPR}.
Security in data transmission can be addressed either by traditional crypto methods, or more fundamentally, in terms of information theoretic secure rates. The latter approach, commonly referred to as ``physical-layer security,'' was initially developed for the wiretap channel \cite{Wyner_J75,Korner_Info_Theory_J78}, i.e., a broadcast channel with one transmitter and two sets of receivers: legitimate users and eavesdroppers.
Multiantenna wiretap channels have been widely investigated in terms of secure rate region \cite{Shamai_Multiantenna_Wiretap_TIT_2009,Wornell_Info_Theory_J10,Wornell_Info_Theory1_J10,
Petropulu_Gaussian_MISO_Wiretap_TWC_2011,Swindlehurst_FR_MIMO_Wiretap_TSP_2013}. Some state-of-art techniques, such as artificial noise (AN) and cooperative jammer (CJ), have been designed for multiantenna transceivers, in order to introduce more interference at the eavesdroppers \cite{Ma_Sig_Process_J11,Ma_TSP_J13,Zheng_Secrecy_J15,Zheng_Stackelberg_game_EUSIPCO_2014,Zheng_WCL_2015,Zheng_Sec_TWC_2016}. In \cite{Ma_Sig_Process_J11},
rank-one solution properties were exploited with semidefinite programming (SDP) relaxation for secure transmit beamforming. AN-assisted transmit optimization has been presented in \cite{Ma_TSP_J13}, where the spatially selective AN embedded with secure transmit beamforming was designed to obtain the optimal power allocation. In \cite{Zheng_Secrecy_J15}, CJ from an external node is exploited in order to create interference at the eavesdroppers and achieve the desired target secure rate. However, it is not always possible to have an own CJ to improve the secrecy rates. Another option could be to employ a private CJ by paying a price for the jamming services. This strategy was investigated in \cite{Zheng_Secrecy_J15,Zheng_Stackelberg_game_EUSIPCO_2014}, where a
CJ releases its jamming service depending interference caused to the eavesdropper, while the transmitter pays a certain amount to guarantee its secure communication. In this strategy, a \emph{Stackelberg} game can be formulated to obtain the optimal power allocation. In addition, cooperative cognitive radio (CR) combined with secure communications could also be modelled as a \emph{Stackelberg} game to determine the optimal resource allocations \cite{Nallan_TCOM_2015_CCR_Sec_Game}. In \cite{Zheng_WCL_2015,Zheng_Sec_TWC_2016}, the secrecy rate optimization problem was posed in terms of outage secrecy rates, due to the fact that the channels are not perfectly known and are subject to random fading with known statistics.
Physical-layer security techniques have also been recently developed in radio frequency identification (RFID). The design of RFID systems is a challenge due to the broadcast nature of backscatter communication, which is vulnerable to eavesdropping \cite{Huiming_Wang_RFID_Backscatter_PLS_TWC_2016}. Simultaneous wireless information and power transfer (SWIPT) has emerged as one of most promising approaches to provide power for communication devices. SWIPT has been considered in combination with physical-layer security in a number of recent works (e.g., \cite{Zhang_Rui_TSP_Sec_SWIPT_J14,Derrick_SWIPT_TWC_2014,Khandaker_TIFS_J15,Zheng_TVT_SWIPT_2015}). It is worth pointing out that the transmit power is constant in the above secure communication systems. However, the use of WET effectively makes the available transmit power a system variable in order to achieve secure communications. Thus, this research gap motivates the work in this paper.
We investigate a WPCN-assisted multiantenna secure multicasting system in which a multicast service provider (i.e., the transmitter) guarantees secure communication with legitimate users in the presence of multiple eavesdroppers by utilizing the harvested energy from the PBs. In particular, we consider two different but complementary scenarios. In the first scenario, the transmitter and the PBs are considered to belong to the same service provider. In the second, they belong to different service providers with different objectives. Accordingly, we formulate and solve the two different problems as follows:
\begin{enumerate}
\item \emph{Power minimization for WPCN-aided multiantenna secure multicasting system}: This problem is formulated for the first scenario, where there is no energy trading between the transmitter and the PBs. They cooperate to minimize the transmit power for a given target secure multicast rate. The optimization problem is not jointly convex in terms of PBs' transmit power, the fraction of time dedicated to WET, and the transmit beamforming vector. To circumvent this non-convexity issue, we consider a two-level approach. The outer level can be recast as a single-variable optimization problem with respect to the energy time allocation, in which the optimal solution can be achieved via numerical search, while the inner level remains a non-convex power minimization problem. There are different approaches for the inner level problem. In \cite{Ma_Sig_Process_J11}, semidefinite programming (SDP) relaxation was employed to solve the power minimization for the case of single legitimate user only. However, this approach will not guarantee a rank-1 solution when extending to the case of multiple users. Therefore, a rank-1 feasible solution for the original beamforming problem must be obtained from the solution of the relaxed problem, with no optimality guarantee (see, e.g., \cite{Qiang_Li_ICC_Sec_Multicasting_2011,Cumanan_JSTSP_2016_Game})
Differently, we first propose a novel reformulation based on matrix transformations and convex conic optimization techniques, yielding a second-order cone programming (SOCP) solution which is optimal when the SDP relaxed solution satisfies the rank-one condition. Then, we propose a successive convex approximation (SCA) based SOCP scheme, which is performed iteratively to obtain the optimal transmit beamformer directly for any general case. Numerical results confirm that our proposed SCA based SOCP scheme outperforms the SDP relaxed scheme, and the proposed SOCP scheme has more computationally efficient than the SDP relaxed scheme that uses Guided Randomization method.
\item \emph{Game theory based WPCN-aided multiantenna secure multicasting system}: In this problem, we investigate the case where the transmitter and the PBs belong to different service operators, both of which want to maximize their own benefit. Thus, an energy price must be paid by the transmitter in order to induce the PBs to provide enough WET to guarantee secure communications.
In particular, we develop an energy trading framework for wireless powered secure multiantenna multicasting systems, where the strategic behavior of the transmitter and the PBs is modeled as a \emph{Stackelberg} game. The transmitter acts a leader that buys energy from the PBs to achieve a desired secure multicast rate to the users. The transmitter optimizes the energy price and energy transfer time to maximize its utility function, defined as the weighted difference between revenues (proportional to the achieved secure rate) and costs of the purchased energy. The PBs are the followers, that determine their optimal transmit powers based on the energy price released from the transmitter to
maximize their own profits, defined as the difference between the payment received from the transmitter and its energy cost. We obtain a closed-form solution for the Stackelberg equilibrium, in which both the PBs and the transmitter come to an agreement on the energy price, transmit power and energy time allocation.
\end{enumerate}
\textbf{\textit{Related works:}}
Considering the first scenario, unlike [28] where an intermediate self-sustainable relay was employed to enable cooperation between a WET network and a wireless information transfer (WIT) network to guarantee secure communications subject to outage probability constraints, our work is to exploit direct energy interactions between the multicasting service provider and the PBs to facilitate secure communications of the legitimate users. Moreover, we also consider a special case with a single legitimate user and a single eavesdropper. In \cite{Ulukus_ISIT_2007_MISO_Sec}, the authors aimed to maximize the secrecy rate subject to the transmit power budget, and the optimal beamforming vector was designed based on Rayleigh quotient approach; whereas our work for this special case presents the closed-form solution of the joint design of the optimal time allocation and the optimal transmit beamforming vector to achieve the target of minimizing the transmitter's transmit power, via the dual problem and the Karush-Kuhn-Tucker (KKT) condition.
The rest of the paper is organized as follows. Section \ref{section System model} presents our system model. Section \ref{section Power Efficient for WPCN MISO Secure System} solves the power minimization problem for the secure WPCN multiantenna multicasting system, whereas the game theory based secure WPCN multiantenna multicasting system is investigated in Section \ref{section Game_theory_based_secure_WPCN_MISO_multicasting_system}. Section \ref{section numerical_results} provides simulation results to validate the theoretical derivations. Finally, Section \ref{section Conclusion} concludes the paper.
\subsection{Notations}
\indent We use the upper case boldface letters for matrices and lower case boldface letters for vectors. $(\cdot)^{T}$ and $(\cdot)^{H}$ denote the transpose and conjugate transpose respectively. Tr$(\cdot)$ and $\mathbb{E}\{\cdot\}$ stand for trace of a matrix and the statistical expectation for random variables. $ \varrho_{max}(*) $ represents the maximum eigenvalue, whereas $ v_{\max}(*) $ denotes the eigenvector associated with the maximum eigenvalue. $\mathbf{A}\succeq 0$ indicates that $\mathbf{A}$ is a positive semidefinite matrix. $ \|*\| $ denotes the Euclidean norm of a vector. $\mathbf{I}$ and $(\cdot)^{-1}$ denote the identity matrix with appropriate size and the inverse of a matrix respectively.
$[x]^{+}$ represents $\max\{x,0\}$. The notation $ \succeq_{K_{n}} $ denotes the following generalized inequality:
\begin{align}
\left[\begin{array}{cc}
a \\ \mathbf{b}
\end{array}
\right] \succeq_{K_{n}} \mathbf{0} \Leftrightarrow \|\mathbf{b}\| \leq a, \nonumber
\end{align}
where $ \mathbf{b} \in \mathbb{C}^{n-1} $ and $ K_{n} \subseteq \mathbb{R}^{n} $ is called a \emph{proper cone}.
\section{System Model}\label{section System model}
In this section, we consider the secure wireless powered multiantenna multicasting system as shown in Fig. \ref{fig:WPCN_MISO_Secrecy}, where a transmitter broadcasts the same information to all legitimate users in the presence of multiple eavesdroppers. Due to energy limitation at the transmitter, it is assumed that there is not enough power supply for information transfer, and thus the transmitter must harvest energy from the PBs. This system consists $ M $ single antenna PBs, one multiantenna transmitter equipped with $ N_{T} $ transmit antennas, $ K $ single antenna legitimate users and $ L $ single antenna eavesdroppers. This secrecy model has some potential applications, such as on-demand video broadcasting, wireless sensor networks and device to device (D2D) communication systems.
In our paper, a \emph{harvest-then-transmit} protocol is considered. Specifically, time is divided in periods of duration $T$. Each period is split into a WET phase of duration $\theta T,$ and a WIT phase of duration $(1 - \theta) T,$ where $\theta \in (0,1)$ is a system parameter that must be optimized.
Let $ \mathbf{h}_{s,k} \in \mathbb{C}^{N_{T}\times 1} $ denote the channel coefficients between the transmitter and the $ k $-th legitimate user, while $ \mathbf{h}_{e,l} \in \mathbb{C}^{N_{T} \times 1} $ denotes the channel coefficients between the transmitter and the $ l $-th eavesdropper.
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 1]{Results_EPS/WPCN_MISO_Secrecy.eps}
\caption{WPCN for multiantenna secure multicasting system.}
\label{fig:WPCN_MISO_Secrecy}
\end{figure}
Also, $ \mathbf{g}_{m} \in \mathbb{C}^{1\times N_{T}} $ denotes the channel coefficients between the $ m $-th PB and the transmitter.
First, each PB transfers the energy to the transmitter, the harvested energy during the WET phase of $ \theta T $ at the transmitter can be written as
\begin{align}\label{eq:E_BS}
E_{B} = \xi \sum_{m=1}^{M}p_{m}\|\mathbf{g}_{m}\|^{2} \theta T,
\end{align}
where $ p_{m} $ denotes the transmit power of the $ m $-th PB, and $ 0 < \xi \leq 1 $ is the efficiency for converting the harvested energy to the electrical energy to be stored, which is assumed to be $ \xi = 1 $ in this paper.
During the WIT phase of $ (1-\theta)T $, the received signal at the $ k $-th legitimate user and the $ l $-th eavesdropper are given by
\begin{align}
\mathbf{y}_{s,k} & = \sqrt{\frac{E_{B}}{(1-\theta)T}}\mathbf{h}_{s,k}^{H}\mathbf{v}s + n_{s,k}, ~k = 1, ..., K,\nonumber\\
\mathbf{y}_{e,l} & = \sqrt{\frac{E_{B}}{(1-\theta)T}}\mathbf{h}_{e,l}^{H}\mathbf{v}s + n_{e,l}, ~l = 1,...,L,\nonumber
\end{align}
where $s$ denotes the Gaussian distributed transmit signal with unit norm, $ \mathbf{v} \in \mathbb{C}^{N_{T} \times 1} $ is the normalized transmit beamformer with $ \mathbb{E}\{\|\mathbf{v}\|^{2}\} = 1 $, $ n_{s,k} $ and $ n_{e,l} $ are additive white Gaussian noises (AWGNs) at the $ k $-th legitimate user and the $ l $-th eavesdropper with variance $ \sigma_{s}^{2} $ and $ \sigma_{e}^{2} $.
Hence, the channel capacity of the $ k $-th legitimate user and the $ l $-th eavesdropper can be expressed as \cite{Xiaoming_Chen_CL_2016_Sec_WPCN}
\begin{align}
R_{s,k} = (1-\theta)\log \left( 1+ \frac{\theta \sum_{m=1}^{M}p_{m}\|\mathbf{g}_{m}\|^{2} |\mathbf{h}_{s,k}^{H}\mathbf{v}|^{2}}{(1-\theta)\sigma_{s}^{2}} \right), ~\forall k,
\end{align}
and
\begin{align}
R_{e,l} = (1-\theta)\log \left( 1+ \frac{\theta \sum_{m=1}^{M}p_{m}\|\mathbf{g}_{m}\|^{2} |\mathbf{h}_{e,l}^{H}\mathbf{v}|^{2}}{(1-\theta)\sigma_{e}^{2}} \right),~\forall l,
\end{align}
respectively.
For this secure multicasting system, we have the following definition:
\begin{definition}
Multicast secrecy rate of a multicasting system with $ K $ users is defined as \cite{Cumanan_JSTSP_2016_Game}
\begin{align}
R_{K} = \min_{k \in [1,K]} [R_{s,k} - \max_{l \in [1,L]} R_{e,l}]^{+}.
\end{align}
\end{definition}
In the following, we develop two resource allocation schemes depending on whether the transmitter and the PBs belong to the same service supplier.
\section{Power Minimization for WPCN Multiantenna Secure Multicasting System}\label{section Power Efficient for WPCN MISO Secure System}
In this section, we consider the scenario that the transmitter and the PBs belong to the same service provider in a multicasting network.
We will formulate a power minimization problem where the total transmit power at the transmitter is minimized to satisfy the target secrecy rate for all the legitimate users in the presence of multiple eavesdroppers by using the harvested energy from the PBs. We assume that the channel state information (CSI) between the transmitter and $ k $-th user as well as $ l $-th eavesdropper (i.e., $ \mathbf{h}_{s,k},~\forall k $ and $ \mathbf{h}_{e,l},~\forall l $) is available at the transmitter. This can be achieved through different methods such as the local oscillator power leakage from the eavesdropper receivers' RF frontend \cite{Mukherjee_ICASSP_2012} or even the CSI feedback method \cite{Geraci_TCOM_2012}. For example, in a video broadcasting system there may be legitimate users that are entitled to receive the content and other users who have not subscribed to this content, but are still part of the system. These users obey the basic physical-layer protocol rules, which includes feeding back CSI to enable beamforming. Hence, in this case, it is practical to assume that the CSI of the eavesdroppers is known at the transmitter.
\subsection{Power Minimization}
The minimization of the total transmit power\footnote{The objective function in \eqref{eq:Power_efficient_ori} consists of three variables: the transmit power of the PBs (i.e., $ p_{m} $, $ \forall m $), energy transfer time allocation (i.e., $ \theta $) and normalized transmit beamforming vector (i.e., $ \mathbf{v} $).} subject to a given secure multicast rate constraint can be written as:
\begin{align}\label{eq:Power_efficient_ori}
\min_{p_{m},\mathbf{v},\theta}&~ \frac{\sum_{m=1}^{M}p_{m}\|\mathbf{g}_{m}\|^{2} \theta }{(1-\theta)} \|\mathbf{v}\|^{2}, \nonumber\\
s.t. &~ R_{K} \geq \bar{R},
~0 \leq p_{m} \leq P,
~ 0 < \theta < 1
\end{align}
where
$P$ is the maximum power constraint at each PB, and
$ \bar{R} $ denotes the target secure multicast rate. The problem \eqref{eq:Power_efficient_ori} is not convex in terms of $ \mathbf{v} $ and $ \theta $, and cannot be solved directly. It is obvious that from problem \eqref{eq:Power_efficient_ori}, the optimal solution of $p_m$ is $p_m = P,$ which
is the maximum transmit power at each PB.
Thus, the problem \eqref{eq:Power_efficient_ori} reduces to
\begin{align}\label{eq:Power_efficient_ori_rewritten}
\min_{\mathbf{w},\theta}&~ \frac{\sum_{m=1}^{M}\|\mathbf{g}_{m}\|^{2} \theta }{(1-\theta)} \|\mathbf{w}\|^{2}, \nonumber\\
s.t. &~ R_{K}(\theta,\mathbf{w}) \geq \bar{R}, ~ 0 < \theta < 1,
\end{align}
where $ R_{K}(\theta,\mathbf{w}) $ can be written as
\begin{align}
R_{K}(\theta, \mathbf{w}) = \min_{k \in [1,K]} (1-\theta)\bigg[ \log \bigg( 1+ \frac{\theta \sum_{m=1}^{M}\|\mathbf{g}_{m}\|^{2} |\mathbf{h}_{s,k}^{H}\mathbf{w}|^{2}}{(1-\theta)\sigma_{s}^{2}} \bigg) - \max_{l \in [1,L]}\log \bigg( 1+ \frac{\theta \sum_{m=1}^{M}\|\mathbf{g}_{m}\|^{2} |\mathbf{h}_{e,l}^{H}\mathbf{w}|^{2}}{(1-\theta)\sigma_{e}^{2}} \bigg) \bigg]^{+},\nonumber
\end{align}
and $ \mathbf{w} = \sqrt{P}\mathbf{v} $.
\begin{remark}\label{remark Feasiblility_of_power_efficiency}
Problem \eqref{eq:Power_efficient_ori_rewritten} may be infeasible, depending on the value of $\bar{R}$ and on the channel vectors $h_{s,k}$ and $h_{e,l}.$ However, the feasibility can be ensured with probability of 1 for the case where the users' and eavesdroppers' channels are drawn randomly and independently from a continuous distribution with full-rank covariance matrix (e.g., a proper Gaussian non-degenerate $N_T$-variate distribution) and the number of antennas $N_T$ is not smaller than $K + L$ (e.g., in the massive multiantenna systems)\footnote{In this case, it is always possible to use zero-forcing beamforming to all eavesdroppers, such that for sufficiently large $P$ any target secrecy rate $\bar{R}$ can be achieved. The condition of sufficient transmit power $P$ can be guaranteed because of the fact that the PBs and the transmitter belong to the same service provider and they can work together on an adaptive power transfer policy (i.e., $P$ is adjusted according to the required solution $\mathbf{w}$ such that $P = \|\mathbf{w}\|^2$).}.
\end{remark}
It can be observed that even when problem \eqref{eq:Power_efficient_ori_rewritten} is feasible, it still still nonconvex.
In order to solve this problem, we considered a two-level approach, where the inner level can be handled by employing the convex conic reformulation for a given energy transfer time allocation factor $ \theta $, whereas the outer level consists of a line search over the parameter $\theta$ in (0,1).
Now, we rewrite the problem \eqref{eq:Power_efficient_ori_rewritten} into the following two levels:
\begin{enumerate}
\item Inner level:
\begin{align}\label{eq:Power_efficient_ori_inner}
f(\theta) = \min_{\mathbf{w}} &~ \frac{\theta(\sum_{m=1}^{M} \|\mathbf{g}_{m}\|^{2})}{1-\theta} \|\mathbf{w}\|^{2},~
s.t. ~ R_{K}(\mathbf{w}) \geq \bar{R},
\end{align}
\item Outer level:
\begin{align}\label{eq:Power_efficient_ori_outer}
\min_{\theta} ~ f(\theta),~
s.t. ~ 0 < \theta < 1.
\end{align}
\end{enumerate}
We first solve the inner problem \eqref{eq:Power_efficient_ori_inner} for a given $ \theta $, which can be equivalently modified as
\begin{align}\label{eq:Power_efficient_for_w}
\min_{\mathbf{w}} &~ \|\mathbf{w}\|^{2} \nonumber\\
s.t. &~ \log\left(1+\frac{ |\mathbf{h}_{s,k}^{H}\mathbf{w}|^{2}}{\bar{\sigma}_{s}^{2}}\right) - \log\left(1+\frac{ |\mathbf{h}_{e,l}^{H}\mathbf{w}|^{2}}{\bar{\sigma}_{e}^{2}}\right) \geq \bar{\bar{R}}, ~~\forall \;\;(k,l)
\end{align}
where $ \bar{\sigma}_{s}^{2} = \frac{(1-\theta)\sigma_{s}^{2}}{\theta\sum_{m=1}^{M}\|\mathbf{g}_{m}\|^{2}} $, $ \bar{\sigma}_{e}^{2} = \frac{(1-\theta)\sigma_{e}^{2}}{\theta\sum_{m=1}^{M}\|\mathbf{g}_{m}\|^{2}} $, and $ \bar{\bar{R}} = \frac{\bar{R}}{1-\theta} $.
The problem \eqref{eq:Power_efficient_for_w} is not convex in terms of $ \mathbf{w} $, and still cannot be solved efficiently. In order to circumvent this non-convex issue, we can introduce a new semi-definite matrix $ \mathbf{Q}_{s} = \mathbf{w}\mathbf{w}^{H} $, and the problem \eqref{eq:Power_efficient_for_w} can be relaxed as
\begin{align}\label{eq:SDP_relaxation_results}
\min_{\mathbf{Q}_{s} \succeq \mathbf{0}} &~\textrm{Tr}(\mathbf{Q}_{s}), \nonumber\\
s.t. &~ \frac{1}{\sigma_{s}^{2}}\textrm{Tr}(\mathbf{h}_{s,k}\mathbf{h}_{s,k}^{H}\mathbf{Q}_{s}) - \frac{2^{\bar{\bar{R}}}}{\sigma_{e}^{2}} \textrm{Tr}(\mathbf{h}_{e,l}\mathbf{h}_{e,l}^{H}\mathbf{Q}_{s}) \geq 2^{\bar{\bar{R}}} - 1, ~\forall (k,l).
\end{align}
The above problem is a convex optimization framework, which can be solved by using interior-point methods \cite{boyd_B04}. It is not always possible to expect that the
optimal solution of \eqref{eq:SDP_relaxation_results} attains the optimum of the original problem \eqref{eq:Power_efficient_for_w}. However, the SDP relaxation will be tight if the optimal solution of \eqref{eq:SDP_relaxation_results} is of rank-one. Therefore, we characterize the rank property of the SDP relaxed solution via the following proposition:
\begin{proposition}\label{proposition:SDP_Rank_Proof}
\cite[Theorem 1]{Qiang_Li_ICC_Sec_Multicasting_2011} Provided the problem \eqref{eq:SDP_relaxation_results} is feasible, the optimal solution of \eqref{eq:SDP_relaxation_results} must satisfy the following rank inequality:
\begin{align}\label{eq:Rank_inequality}
\textrm{rank}(\mathbf{Q}_{s}) \leq \min (K, \sqrt{K L})
\end{align}
\end{proposition}
With \emph{Proposition} \ref{proposition:SDP_Rank_Proof}, we are able to identify the tightness of SDP relaxed solution via the following \emph{lemma}
\begin{lemma}\label{lemma:Rank_one_lemma}
\cite[Corollary 1]{Qiang_Li_ICC_Sec_Multicasting_2011} Provided the problem \eqref{eq:SDP_relaxation_results} feasible, it is guaranteed that \eqref{eq:SDP_relaxation_results} can yield a rank-one solution which exactly solves the problem \eqref{eq:Power_efficient_for_w} when either of the following conditions is satisfied:
\begin{enumerate}
\item $ K = 1 $ and $ L \geq 1 $.
\item $ 1<K \leq 3 $, and $ L = 1.$
\end{enumerate}
\end{lemma}
By exploiting \emph{Proposition} \ref{proposition:SDP_Rank_Proof} and \emph{Lemma} \ref{lemma:Rank_one_lemma}, if $ \textrm{rank}(\mathbf{Q}_{s}) $ satisfies the rank-one condition in \emph{Lemma} \ref{lemma:Rank_one_lemma}, we can employ the eigen-decomposition for $ \mathbf{Q}_{s} $ to obtain the optimal transmit beamformer $ \mathbf{w} $. Otherwise, we need to use a rank
reduction algorithm to tackle this problem \cite{Yongwei_Huang_Rank_Reduction_TSP_2010}.
However, when rank-one condition in \emph{Lemma} \ref{lemma:Rank_one_lemma} is satisfied, we can also consider the following \emph{theorem} to directly solve the problem \eqref{eq:Power_efficient_for_w}.
\begin{theorem}\label{theorem power efficient schur complement}
The problem \eqref{eq:Power_efficient_for_w} can be reformulated into the following convex optimization framework when the rank-one condition in \emph{Lemma} \ref{lemma:Rank_one_lemma} is satisfied.
\begin{align}\label{eq:Power_efficient_for_results}
\min_{t \geq 0,\mathbf{w}} &~~ t, \nonumber\\
s.t. &~ \left[\begin{array}{cc}
t \\ \mathbf{w}
\end{array}
\right] \succeq_{K_{(N_{T}+1)}} \mathbf{0}, ~ \left[\begin{array}{cc}
\frac{1}{\bar{\sigma}_{s}} \mathbf{w}^{H}\mathbf{h}_{s,k}
\\\frac{2^{\bar{\bar{R}}}}{\bar{\sigma}_{e}}\mathbf{w}^{H}\mathbf{h}_{e,l} \\
(2^{\bar{\bar{R}}} - 1)^{\frac{1}{2}}
\end{array}
\right] \succeq_{K_{3}} \mathbf{0}, ~~~\forall \;\;(k,l).
\end{align}
\end{theorem}
\begin{IEEEproof}
Please refer to Appendix \ref{appendix therorem schur complement}.
\end{IEEEproof}
By exploiting \emph{Theorem} \ref{theorem power efficient schur complement}, it is easily verified that \eqref{eq:Power_efficient_for_results} is a convex optimization problem, which can be solved by using interior-point methods \cite{boyd_B04}. Thus, the optimal transmit power of each PB can be adaptively updated as $ P^{\textrm{opt}} = \|\mathbf{w}\|^2 $, and the optimal transmit beamforming vector $ \mathbf{v}^{\textrm{opt}} $ can also be easily achieved. Now, we consider the computation complexity of solving problem \eqref{eq:Power_efficient_for_results}. According to the analysis of the basic complexity elements in \cite{Kunyu_Wang_TSP_2014_Outage}, problem \eqref{eq:Power_efficient_for_results} includes one second-order cone (SOC) constraint with dimension $ N_T + 1,$ $ KL $ SOC constraints with dimension $ N_T $, and one linear constraint. Thus, its computation complexity can be given by
$
\mathcal{O}\bigg( \sqrt{2 KL+3} n [ KL N_{T}^2 + (N_T+1)^2 + 1 + n^2] \bigg) \ln(\frac{1}{\epsilon}),
$
where $ n = \mathcal{O}(N_T + 1) $, and $ \epsilon > 0 $ denotes the accuracy requirement.\\
\textit{A special case}: Consider the case with a single legitimate user and a single eavesdropper only. The closed-form solution can be derived by exploiting Lagrange dual problem and KKT conditions.
For notational convenience, we replace the channel notations $ \mathbf{h}_{s,k} $ and $ \mathbf{h}_{e,l} $ by $ \mathbf{h}_{s} $ and $ \mathbf{h}_{e} $, respectively. The following \emph{lemma} is introduced:
\begin{lemma}\label{lemma Special_case_power_efficient}
The optimal solution to \eqref{eq:Power_efficient_ori_inner} with only single legitimate user and single eavesdropper is given by
\begin{align}\label{eq:Closed_form_solution_for_special_case}
&~ \mathbf{w}^{\textrm{opt}} = \sqrt{P^{\textrm{opt}}} \mathbf{v}^{\textrm{opt}}, ~\mathbf{v}^{\textrm{opt}} = \frac{\bar{\mathbf{w}}}{\|\bar{\mathbf{w}}\|_{2}},~ \bar{\mathbf{w}} = v_{\textrm{max}} (\frac{1}{\bar{\sigma}_{s}^{2}}\mathbf{h}_{s}\mathbf{h}_{s}^{H}-\frac{2^{\bar{\bar{R}}}}{\bar{\sigma}_{e}^{2}}\mathbf{h}_{e}\mathbf{h}_{e}^{H}), \nonumber\\
&~ P^{\textrm{opt}} = \alpha^{\textrm{opt}}(2^{\bar{\bar{R}}} - 1),~ \alpha^{\textrm{opt}} = \frac{1}{\varrho_{\textrm{max}} (\frac{1}{\bar{\sigma}_{s}^{2}}\mathbf{h}_{s}\mathbf{h}_{s}^{H}-\frac{2^{\bar{\bar{R}}}}{\bar{\sigma}_{e}^{2}}\mathbf{h}_{e}\mathbf{h}_{e}^{H})}.
\end{align}
\end{lemma}
\begin{IEEEproof}
See Appendix \ref{appendix Special_case_power_efficient}.
\end{IEEEproof}
Now, it is natural that a question may arise with regard how to tackle with the problem \eqref{eq:Power_efficient_for_w} when the rank-one condition in \emph{Lemma} \ref{lemma:Rank_one_lemma} is not satisfied. Hence, we consider a SCA based scheme to reformulate the problem \eqref{eq:Power_efficient_for_w} for any general case, yielding an SOCP. We equivalently rewrite the problem \eqref{eq:Power_efficient_for_w} by introducing a new set of variables $(x_{s,k},y_{s,k},b_{s,k}), ~\forall k$ as
\begin{subequations}
\begin{align}
\min_{\mathbf{w}, b_{s,k}} &~ \|\mathbf{w}\|^{2}, \nonumber\\
s.t. &~ x_{s,k}^{2} + y_{s,k}^{2} \geq b_{s,k}, \label{eq:Sec_constraint_general1}\\ &~ (2^{\bar{\bar{R}}} - 1)\sigma_{s}^{2} + \frac{2^{\bar{\bar{R}}}\sigma_{s}^{2}}{\sigma_{e}^{2}} |\mathbf{w}^{H}\mathbf{h}_{e,l}|^{2} \leq b_{s,k}, \label{eq:Sec_constraint_general2}\\
&~ x_{s,k} = \Re\left\{ \mathbf{w}^{H}\mathbf{h}_{s,k} \right \},~ y_{s,k} = \Im \left\{ \mathbf{w}^{H}\mathbf{h}_{s,k} \right\}, \label{eq:Sec_constraint_general3}
\end{align}
\end{subequations}
where $ (x_{s,k}, y_{s,k}, b_{s,k}) \in \mathbb{R} $, $ \forall k $ In the above reformulation, it is observed that both constraint \eqref{eq:Sec_constraint_general1} and \eqref{eq:Sec_constraint_general2} are still not convex while \eqref{eq:Sec_constraint_general3} are linear constraints. In order to further process these non-convex constraints, we first introduce iterative successive approximation methods to tackle with \eqref{eq:Sec_constraint_general1}. Specifically, set $ \mathbf{q}_{s,k} = [x_{s,k}~ y_{s,k}]^{T} $, and denote the value of this vector at the $ n $-th iteration as $ \mathbf{q}_{s,k}^{(n)} $, we consider the first-order Taylor series to approximate the left hand side of \eqref{eq:Sec_constraint_general1} as
\begin{align}\label{eq:Approximated_for_general1}
x_{s,k}^{2} + y_{s,k}^{2} = \mathbf{q}_{s,k}^{T} \mathbf{q}_{s,k} \approx \|\mathbf{u}_{s,k}^{(n)}\|^{2} + 2 \sum_{i = 1}^{2} \mathbf{u}_{s,k}^{(n)} [\mathbf{q}_{s,k}(i) - \mathbf{u}_{s,k}^{(n)} (i)],
\end{align}
where the parameter vector $ \mathbf{u}_{s,k}^{(n)} (i) $ can be updated $ \mathbf{u}_{s,k}^{(n+1)} = \mathbf{q}_{s,k}^{(n)},~\forall k $ at the $ (n+1) $-th iteration. From this update, it is easily verified that $ \mathbf{u}_{s,k}^{(n)} $ can be determined by $ \mathbf{q}_{s,k}^{(n-1)} $.
Thus, \eqref{eq:Approximated_for_general1} can be given by
\begin{align}\label{eq:Approximated_sec_constraint_general1}
\|\mathbf{u}_{s,k}^{(n)}\|^{2} + 2 \sum_{i = 1}^{2} \mathbf{u}_{s,k}^{(n)} [\mathbf{q}_{s,k}(i) - \mathbf{u}_{s,k}^{(n)} (i)] \geq b_{s,k}.
\end{align}
To proceed, the constraint \eqref{eq:Sec_constraint_general2} can be equivalently reformulated into the following SOC
\begin{align}\label{eq:SOC_sec_constraint_general2}
\left\| \left[\begin{array}{cc}
(2^{\bar{\bar{R}}} - 1)^{\frac{1}{2}}\sigma_{s} \\ \frac{2^{\frac{\bar{\bar{R}}}{2}}\sigma_{s}}{\sigma_{e}} \mathbf{w}^{H}\mathbf{h}_{e,l}
\end{array}\right] \right\|^{2} \leq b_{s,k} \Rightarrow \left\| \left[ \begin{array}{ccc}
(2^{\bar{\bar{R}}} - 1)^{\frac{1}{2}}\sigma_{s} \\ \frac{2^{\frac{\bar{\bar{R}}}{2}}\sigma_{s}}{\sigma_{e}} \mathbf{w}^{H}\mathbf{h}_{e,l} \\ \frac{(b_{s,k} - 1)}{2}
\end{array} \right] \right\| \leq \frac{(b_{s,k} + 1)}{2}
\end{align}
\begin{remark}\label{remark:SCA_remark}
The convexity of the term $ \mathbf{q}_{s,k}^{T}\mathbf{q}_{s,k} $ and the first-order Taylor approximation ensures that the right hand side in \eqref{eq:Approximated_for_general1} bounds the left
side in each iterative procedure. In other
words, the optimal solution of the problem with the approximate constraint in \eqref{eq:Approximated_sec_constraint_general1} definitely belongs to the feasible set of the original optimization
problem at each iteration. Also, due to the above update, in the $ (n + 1) $ step, the approximation in \eqref{eq:Approximated_sec_constraint_general1} holds with
equality. In addition, the gradients of both sides with respect
to the optimization variables in \eqref{eq:Approximated_sec_constraint_general1} are also the same at the $ (n+1) $-th iteration, which can prove that the solution
of the iterative procedure satisfies the KKT conditions of the original problem \eqref{eq:Power_efficient_for_w}. This fact has been proved in \cite{Barry_Marks_Approx_Noncvx_Math_Programs_OR_1978}.
\end{remark}
By exploiting \emph{Remark} \ref{remark:SCA_remark}, the problem \eqref{eq:Power_efficient_for_w} takes the following form at the $ n $-th iteration
\begin{align}\label{eq:SCA_SOCP_results}
\min_{\mathbf{w},b_{s,k}} &~ \|\mathbf{w}\|^{2}, \nonumber\\
s.t. &~ \eqref{eq:Approximated_sec_constraint_general1}, \eqref{eq:SOC_sec_constraint_general2}, \eqref{eq:Sec_constraint_general3}, ~\forall (k,l).
\end{align}
Based on the above discussion, an iterative algorithm to approximately solve the problem in \eqref{eq:Power_efficient_for_w} is summarized as in \textbf{Algorithm} \ref{algorithm:SCA_algorithm}.
\vspace{0.5em}
\hrule
\vspace{0.5em}
\begin{algorithm}\label{algorithm:SCA_algorithm}
\vspace{0.5em}
Successive convex approximation to solve \eqref{eq:Power_efficient_for_w}
\hrule
\vspace{0.5em}
\begin{enumerate}
\item \textbf{Initialization}: Randomly generate $ \mathbf{u}_{s,k}^{(0)}, ~\forall k $ to make \eqref{eq:SCA_SOCP_results} feasible
\item \textbf{Repeat}
\begin{enumerate}
\item \textbf{Solve} \eqref{eq:SCA_SOCP_results}.
\item \textbf{Set} $ \mathbf{u}_{s,k}^{(n+1)} = \mathbf{q}_{s,k}^{(n)} $, $ \forall k $.
\item \textbf{Set} $ n := n + 1 $.
\end{enumerate}
\item \textbf{Until} required accuracy is achieved or the maximum
number of iterations is reached.
\end{enumerate}
\end{algorithm}
\hrule
\vspace{0.5em}
From \textbf{Algorithm} \ref{algorithm:SCA_algorithm}, the initialized vector $ \mathbf{u}_{s,k} $ is given by random generation to guarantee the feasibility of \eqref{eq:SCA_SOCP_results}, which can be
updated at each iteration until $ \mathbf{u}_{s,k}^{(n+1)} = \mathbf{q}_{s,k}^{(n)} $ holds when the
algorithm converges. In addition, it is guaranteed that \textbf{Algorithm} \ref{algorithm:SCA_algorithm} converges
to a locally optimal solution (quite close to the globally
optimal solution) \cite{LN_Tran_SPL_Fast_converge_2012,LN_Tran_SPL_Large_Scale_2014}. \\
Next, we focus on the outer level problem in \eqref{eq:Power_efficient_ori_outer}. This is a single-variable optimization problem with respect to $ \theta $, which is rewritten as follows:
\begin{align}\label{eq:Second_step_ori}
\min_{\theta} &~ f(\theta), ~
s.t. ~
0 < \theta < 1.
\end{align}
We can show that $ f(\theta) $ is a convex optimization problem with respect to $ \theta $ via the following \emph{lemma}:
\begin{lemma}\label{lemma Second_step_convex_show}
\eqref{eq:Second_step_ori} is a convex problem with respect to $ \theta $.
\end{lemma}
\begin{IEEEproof}
See Appendix \ref{appendix Second_step_convex_show}.
\end{IEEEproof}
By exploiting \emph{Lemma} \ref{lemma Second_step_convex_show}, the optimal energy transfer time allocation factor (i.e., $ \theta^{\textrm{opt}} $) can be obtained by using one-dimensional (1D) single-variable search (e.g., golden search) in the interval $ \theta \in [0,1].$ Then, the optimal power allocation policy can be achieved.
\section{Game theory based Secure WPCN Multiantenna Multicasting System}\label{section Game_theory_based_secure_WPCN_MISO_multicasting_system}
In the previous section, we considered that the transmitter and the PBs belong to the same service provider, in which they try to work together to achieve their common target. However, this is not always the case so that, in this section, we consider the opposite scenario where the transmitter and the PBs are from two different service providers.
Both parties want to maximize their own benefit. To model this scenario, we assume that the transmitter will have to pay for the energy services from the PBs, whereas the PBs will consider this payment as incentives to provide wireless energy transfer service. Obviously, being able to decide what price to pay for the energy service, the transmitter can take a leading role in dictating the energy trading interaction. This fits very well the model of a \textit{Stackelberg} game, which motivates us to use this game theory to optimize both parties' benefit.
In this game model, the transmitter (leader) first pays for the harvested energy with an energy price to maximize its utility function. Then, the PBs (followers) optimize their transmit powers based on their released energy price to maximize their individual utility function.
\subsection{Stackelberg Game Formulation}\label{section Stackelberg game formulation}
Let $ \lambda $ denote the energy price that the transmitter will pay to the PBs. The total payment of the transmitter to the $M$ PBs, donoted by $Q_M$, is written as
\begin{align}
Q_M = \lambda \theta T \sum_{m=1}^{M} p_{m} \|\mathbf{g}_{m}\|^{2},
\end{align}
where $ p_{m} $ denotes the transmit power of the $ m $th PB. Without loss of generality, we can assume $ T = 1.$ We now define the utility function of the transmitter as follows:
\begin{align}
U_{M} = \mu R_{K} - Q_{M},
\end{align}
where $ \mu > 0 $ is the weight per a unit of secrecy throughput, by which the transmitter uses to convert the achievable secrecy rate $R_{K}$ into the equivalent revenue.
Therefore, the leader game for the transmitter can be formulated as
\begin{align}\label{eq:Stackelberg_leader_level}
\max_{\lambda,\theta,\mathbf{v}}~ U_{M}, ~ s.t. ~ 0 < \theta < 1,~ \lambda \geq 0.
\end{align}
At the same time, each PB can be modelled as a follower that wants to maximize its own revenue function, which is defined as follows:
\begin{align}\label{eq:Utility_PB_m}
U_{PB,m} = \theta (\lambda p_{m} \|\mathbf{g}_{m}\|^{2} - \mathcal{F}_{m}(p_{m})),
\end{align}
where $ \mathcal{F}_{m}(p_{m}) $ is used to model the cost of the $ m $-th PB per unit time for wirelessly charging the transmitter with the transmit power $ p_{m} $. In this paper, we consider the following quadratic model\footnote[1]{The quadratic model has been commonly used in the energy market to model the energy cost \cite{Schober_TSG2010_DSM_GT}.} for the cost function of the PBs:
\begin{align}\label{eq:Quadratic_function_power_market}
\mathcal{F}_{m}(x) = A_{m} x^{2} + B_{m} x
\end{align}
where $ A_{m} > 0 $ and $ B_{m} > 0 $ are the constants that can be different for each PB.
Thus, the follower game of $ m $-th PB is given by
\begin{align}\label{eq:Stackelberg_follow_level}
\max_{p_{m}} ~ U_{PB,m},~ s.t. ~ p_{m} \geq 0.
\end{align}
Both \eqref{eq:Stackelberg_leader_level} and \eqref{eq:Stackelberg_follow_level} form a \emph{Stackelberg} game for this secure WPCN multiantenna multicasting system, where the transmitter (leader) announces an energy price, and then the PBs (followers) optimize the transmit power based on the released energy price to maximize their individual revenue functions. The solution of this \emph{Stackelberg} game can be obtained by investigating the \emph{Stackelberg} equilibrium, where
the transmitter and the PBs come to an agreement on the energy price, the transmit power of each PB and the time fraction of energy transfer duration. Note that the deviation of either the transmitter or the PBs from the \emph{Stackelberg} equilibrium will introduce a loss in their revenue functions.
\subsection{Solution of The Proposed Stackelberg Game}
In order to derive the solution of this game, the well-known \emph{Stackelberg} equilibrium concept can be defined as follows:
\begin{definition}\label{definition Stackelberg_equilibrium}
Let $ (\theta^{\textrm{opt}}, \lambda^{\textrm{opt}}) $ denote the solutions of problem \eqref{eq:Stackelberg_leader_level} while $ \{p_{m}^{\textrm{opt}}\} $ represents the solution of problem \eqref{eq:Stackelberg_follow_level} (here, the brackets $\{ \}$ indicate a vector that include all $p_m$'s with $\forall m$). Then, the triple-variable set ($ \theta^{\textrm{opt}}, \lambda^{\textrm{opt}},p_{m}^{\textrm{opt}} $) is a \emph{Stackelberg} equilibrium of the formulated game provided that the following conditions are satisfied
\begin{align}
&~U_{M}(\theta^{\textrm{opt}}, \lambda^{\textrm{opt}},\{p_{m}^{\textrm{opt}}\}) \geq U_{M}(\theta, \lambda,\{p_{m}^{\textrm{opt}}\}), \\
&~U_{PB,m}(\theta^{\textrm{opt}}, \lambda^{\textrm{opt}},p_{m}^{\textrm{opt}}) \geq U_{PB,m}(\theta^{\textrm{opt}}, \lambda^{\textrm{opt}},p_{m}),~\forall m.
\end{align}
for $ 0<\theta <1 $, $ \lambda \geq 0 $, and $ p_{m} \geq 0 $, $ \forall m $.
\end{definition}
First, it can be observed that problem \eqref{eq:Stackelberg_follow_level} is convex with respect with $ p_{m} $ for given values of $ \lambda $ and $ \theta $.
Thus, the optimal solution is obtained as in the following theorem:
\begin{theorem}\label{theorem Optimal_p_m}
For given $ \lambda $ and $ \theta $, the optimal solution to \eqref{eq:Stackelberg_follow_level} is given by
\begin{align}\label{eq:Optimal_p_m}
p_{m}^{\textrm{opt}} = \begin{cases}
\frac{\lambda\|\mathbf{g}_{m}\|^{2} -B_{m}}{2 A_{m}}, &~ \lambda > \frac{B_{m}}{\|\mathbf{g}_{m}\|^{2}} \\
0,&~\lambda \leq \frac{B_{m}}{\|\mathbf{g}_{m}\|^{2}}.
\end{cases}
\end{align}
\end{theorem}
\begin{IEEEproof}
The proof of this \emph{theorem} is achieved by equating the first derivative of \eqref{eq:Utility_PB_m} to zero.
\end{IEEEproof}
From Theorem \ref{theorem Optimal_p_m}, we can deduce the following remark:
\begin{remark}\label{remark all_PBs_involved}
The optimal power allocation $ p_{m}^{\textrm{opt}} $ can only be obtained under the condition that the energy price $ \lambda $ is greater than threshold $ \frac{B_{m}}{\|\mathbf{g}_{m}\|^{2}} $.
Thus, we divide the PBs into two sets, namely, the active and non-active PBs. The PBs who can transfer the power to the transmitter and help determine the achievable secrecy rate by using the harvested energy are called active PBs. The remaining ones are non-active PBs. Generally, according to \eqref{eq:Optimal_p_m}, we can determine these active PBs and re-index them for the total power computation. In our paper, for convenience, we assume that all PBs are active and considered to be involved in the WET phase of $ \theta T.$
\end{remark}
By exploiting \emph{Theorem} \ref{theorem Optimal_p_m} and \emph{Remark} \ref{remark all_PBs_involved}, we replace $ p_{m} $ in \eqref{eq:Stackelberg_leader_level} with \eqref{eq:Optimal_p_m}, problem \eqref{eq:Stackelberg_leader_level} now becomes
\begin{align}\label{eq:U_L_with_optimal_p_m}
\max_{\lambda,\theta}&~ \mu (1-\theta) \left[ \log\bigg[ 1+ \bigg( \lambda\sum_{m=1}^{M} \frac{\|\mathbf{g}_{m}\|^{4}}{2 A_{m}} - \sum_{m=1}^{M} \frac{B_{m}\|\mathbf{g}_{m}\|^{2}}{2 A_{m}} \bigg) t_{s} \bigg] \right. \nonumber \\
&~~~~~~~~~~~~ \left. - \log\bigg[ 1+ \bigg( \lambda\sum_{m=1}^{M} \frac{\|\mathbf{g}_{m}\|^{4}}{2 A_{m}} - \sum_{m=1}^{M} \frac{B_{m}\|\mathbf{g}_{m}\|^{2}}{2 A_{m}} \bigg) t_{e} \bigg] \right] \nonumber\\
&~~~~~~~~~~~~ - \theta \lambda^{2} \sum_{m=1}^{M} \frac{\|\mathbf{g}_{m}\|^{4}}{2A_{m}} + \theta \lambda \sum_{m=1}^{M}\frac{B_{m}\|\mathbf{g}_{m}\|^{2}}{2A_{m}} \nonumber\\ s.t. &~ 0 < \theta < 1,~ \lambda \geq 0
\end{align}
where
\begin{align}
t_{s} = \min_{k} t_{s,k} = \min_{k} \frac{\theta |\mathbf{h}_{s,k}^{H}\mathbf{v}|^{2}}{(1-\theta)\sigma_{s}^{2}},~\forall k, ~t_{e} = \max_{l} t_{e,l} = \min_{l} \frac{\theta |\mathbf{h}_{e,l}^{H}\mathbf{v}|^{2}}{(1-\theta)\sigma_{e}^{2}},~\forall l. \nonumber
\end{align}
Note that before solving problem \eqref{eq:U_L_with_optimal_p_m}, the normalized transmit beamfoming vector $ \mathbf{v} $ can be obtained by employing a similar approach as in Section \ref{section Power Efficient for WPCN MISO Secure System} Thus, we solve for the optimal solution to the energy price $ \lambda $ and the energy transfer time allocation $ \theta $ only in leader level game \eqref{eq:U_L_with_optimal_p_m}.
The problem \eqref{eq:U_L_with_optimal_p_m} is not jointly convex in terms of $ \theta $ and $ \lambda.$ It is extremely hard to find their optimal solutions simultaneously due to the complexity of the objective function in \eqref{eq:U_L_with_optimal_p_m}. In order to address this issue, we first derive the closed-form solution for the optimal $ \lambda $ with a given value $ \theta $. Then, the optimal value for $ \theta $ can be achieved through numerical analysis.
In order to derive the closed-form solution of $ \lambda $, we set $ C_{M} = \sum_{m=1}^{M} \frac{\|\mathbf{g}_{m}\|^{4}}{2 A_{m}} $, $ D_{M} = \sum_{m=1}^{M} \frac{B_{m}\|\mathbf{g}_{m}\|^{2}}{4A_{m}} $, and the objective function to \eqref{eq:U_L_with_optimal_p_m} can be expressed as
\begin{align}\label{eq:U_L_lambda}
U_{M}(\theta, \lambda) & = \mu (1-\theta) \left[ \log\bigg[ 1+ \bigg( \lambda C_{M} - 2 D_{M} \bigg) t_{s} \bigg] - \log\bigg[ 1+ \bigg( \lambda C_{M} - 2 D_{M} \bigg) t_{e} \bigg] \right] \nonumber\\
&~~~~~~~- \theta \lambda^{2} C_{M} + 2 \theta \lambda D_{M}.
\end{align}
\begin{lemma}\label{lemma lambda_concave_function}
\eqref{eq:U_L_lambda} is a concave function with respect to $ \lambda $.
\end{lemma}
\begin{IEEEproof}
See Appendix \ref{appendix lambda_concave_function}.
\end{IEEEproof}
By exploiting \emph{Lemma} \ref{lemma lambda_concave_function}, we can claim that \eqref{eq:U_L_with_optimal_p_m} is a convex problem. Now, we derive the closed-form solution of $ \lambda $.
In order to obtain the optimal solution to $ \lambda $, let the first order derivative of \eqref{eq:U_L_lambda} equate to zero, we have
\begin{align}
\frac{\mu (1-\theta) t_{s} C_{M} }{1+(\lambda C_{M} - D_{M}) t_{s} - D_{M} t_{s}} - \frac{\mu (1-\theta) t_{e} C_{M} }{1+(\lambda C_{M} - D_{M}) t_{e} - D_{M} t_{e}} - 2 \theta C_{M} \lambda + 2 \theta D_{M} = 0.
\end{align}
Set $ x = \lambda C_{M} - D_{M} $, and after a few of mathematical simplifications, we arrive at
\begin{align}\label{eq:Cubic_equation_with_x}
x^{3} + a x^{2} + b x + c = 0,
\end{align}
where
\begin{align}
a = \frac{(t_{s}+t_{e}) - 2 D_{M} t_{s}t_{e}}{t_{s} t_{e}},~ b = \frac{(D_{M} t_{s} - 1) (D_{M} t_{e} - 1)}{t_{s} t_{e}},~ c = - \mu (1-\theta) C_{M} (t_{s} - t_{e}).\nonumber
\end{align}
It is easily observed that \eqref{eq:Cubic_equation_with_x} is a cubic equation, which can be solved in terms of closed-form solution of $ x $ by using Cardano's formula \cite{Xiaobin_Huang_CL_2014_FD},
\begin{align}\label{eq:Optimal_lambda}
x^{\textrm{opt}} = e^{j \angle x_{1}} \sqrt[3]{|x_{1}|} + e^{j \angle x_{2}} \sqrt[3]{|x_{2}|} - a/3,
\end{align}
where $ \angle $ denotes the phase angle of an complex random
variable, and
\begin{align}
x_{1} & = -\frac{q}{2} + \sqrt{\Delta},~x_{2} = -\frac{q}{2} - \sqrt{\Delta}, \nonumber\\
\Delta & = \frac{p^{3}}{27} + \frac{q^{2}}{4},~
p = -\frac{a^{2}}{3} + b,~ q = \frac{2 a^{3}}{27} - \frac{ab}{3}+c.\nonumber
\end{align}
Thus, we obtain the optimal energy price as
\begin{align}\label{eq:Optimal_energy_transfer_price}
\lambda^{\textrm{opt}} = \frac{x^{\textrm{opt}} + D_{M}}{C_{M}}.
\end{align}
We have already obtained the optimal energy price of the transmitter for a given $ \theta $. Now, the optimal energy transfer time allocation is derived in the following. We substitute the closed-form expression \eqref{eq:Optimal_energy_transfer_price} into \eqref{eq:U_L_lambda}, thus, the following optimization problem can be written with respect to $ \theta $,
\begin{align}\label{eq:U_L_with_theta}
\max_{\theta}~ U_{M}(\theta,\lambda^{\textrm{opt}}), s.t.~ 0<\theta <1.
\end{align}
The problem \eqref{eq:U_L_with_theta} can be efficiently handled by using 1D search to obtain the optimal energy transfer time solution $ \theta^{\textrm{opt}} $ as follows:
\begin{align}\label{eq:Optimal_theta}
\theta^{\textrm{opt}} = \arg\max_{\theta \in (0,1)} U_{M}(\theta,\lambda^{\textrm{opt}}).
\end{align}
We have completed the derivation of the \emph{Stackelberg} equilibrium $(p_{m}^{\textrm{opt}},\lambda^{\textrm{opt}},\theta^{\textrm{opt}})$ for the formulated \emph{Stackelberg} game, which are shown in \eqref{eq:Optimal_p_m}, \eqref{eq:Optimal_lambda} and \eqref{eq:Optimal_theta}.
\section{Numerical Results}\label{section numerical_results}
In this section, we provide the simulation results to validate the proposed schemes. We consider the secure multiantenna multicasting system that consists of three legitimate receivers (i.e., $ K = 3 $) and two eavesdroppers ($ L = 5 $), where the transmitter is wirelessly powered by five PBs ($ M = 5 $). It is assumed that the transmitter is equipped with eight transmit antennas (i.e., $ N_{T} = 8 $), whereas the others consist of single antenna. We employ the path loss channel model $ \sqrt{A d_{x}^{-\alpha}} $, where $ A = 10^{-3}.$ The path loss exponent is set to $ \alpha = 3.$ Distance variable $ d_{x} $ can be replaced with $ d_{s} $, $ d_{e} $, and $ d_{PB} $ according to different channel coefficients, representing the distance between the transmitter and the legitimate users, the eavesdroppers as well as the PBs, respectively. In our simulation, we choose $ d_{s} = d_{e} = 2~\textrm{m} $, and $ d_{PB} = 5~\textrm{m} $ unless specified. The target secrecy rate is set to be $ \bar{R} = 2~\textrm{bps/Hz} $. The noise powers at the legitimate users and the eavesdroppers are set as $ \sigma_{s}^{2} = \sigma_{e}^{2} = 10^{-8}~ \textrm{mW} $.
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.85]{Results_EPS/Power_vs_d_PB_N_T8_general_case.eps}
\caption{Comparison of transmit power between the proposed scheme and SDP scheme versus distance between PBs and transmitter.}
\label{fig:Power_vs_distance_K5L5_general_case}
\end{figure}
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.85]{Results_EPS/Power_vs_d_PB_N_T8_K1L5_new.eps}
\caption{Comparison of transmit power between the SOCP and SDP schemes versus distance between PBs and transmitter.}
\label{fig:Power_vs_distance_K1L5_satisfying_rank_condition}
\end{figure}
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.7]{Results_EPS/Power_vs_distance_general_02.eps}
\caption{Comparison of transmit power between the proposed scheme with optimal $ \theta $ and fixed $ \theta $ versus distance between PBs and transmitter.}
\label{fig:Power_vs_distance_special_02}
\end{figure}
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.7]{Results_EPS/Power_vs_distance_special_01.eps}
\caption{Transmit power versus distance between PBs and transmitter with special case.}
\label{fig:Power_vs_distance_special_01}
\end{figure}
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.8]{Results_EPS/Run_time_comparison.eps}
\caption{Run time versus the number of transmit antenna $ N_{T} $.}
\label{fig:Run_time_comparison}
\end{figure}
First, we evaluate the minimized transmit power obtained from our proposed scheme in Section \ref{section Power Efficient for WPCN MISO Secure System} against the distance between PBs and the transmitter (i.e., $ d_{PB} $). Fig. \ref{fig:Power_vs_distance_K5L5_general_case} shows the result with general case when the rank-one condition in \emph{Lemma} \ref{lemma:Rank_one_lemma} is not satisfied. From this result, one can observe that our proposed SCA scheme outperforms the SDP scheme in \cite{Cumanan_JSTSP_2016_Game}. This is owing to a fact that our proposed scheme can achieve a optimal solution via \textbf{Algorithm} \ref{algorithm:SCA_algorithm}, whereas the SDP scheme cannot satisfy the rank-one condition such that the relaxed solution cannot achieve optimality. Fig. \ref{fig:Power_vs_distance_K1L5_satisfying_rank_condition} evaluates the results of \emph{Theorem} \ref{theorem power efficient schur complement}, where it is observed that the SOCP yields the same performance with the proposed SCA scheme and SDP scheme, which confirms that the correctness and accuracy of \emph{Theorem} \ref{theorem power efficient schur complement}.
Fig. \ref{fig:Power_vs_distance_special_02} shows the impact of the energy time allocation.
From this figure, we observe that the proposed SOCP scheme with the fixed time allocation based scheme (i.e., $ \theta = 0.5 $) that obviously requires more transmit power than the proposed SOCP scheme with optimal energy time allocation, this is owing to a fact that our proposed scheme can achieve a optimal energy time allocation by numerical search (i.e., $ \theta = \theta^{\textrm{opt}} $).
Similar behaviours are observed in Fig. \ref{fig:Power_vs_distance_special_01} which is obtained for the special case of single user and single eavesdropper. This figure shows that the derived closed-form solution in \emph{Lemma} \ref{lemma Special_case_power_efficient} matches well with the numerical results obtained from a convex optimization tool, which validates the accuracy of this closed-form solution.
In Fig. \ref{fig:Run_time_comparison}, we compare the run time of our proposed scheme and the SDP relaxation with \emph{Guided Randomzation}\footnote{\emph{Guided Randomization} is employed to tackle with the scenario that the SDP relaxed solution is not rank-one.} \cite{Jialing_Liao_CL_Robust_PS_SWIPT_2016} versus the number of transmit antenna $ N_{T} $. From this result, one can observe that our proposed scheme consume less time than SDP with \emph{Guided Randomization}, which implies that proposed algorithm has a lower computational complexity.
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.7]{Results_EPS/U_L_vs_lambda.eps}
\caption{The utility function of transmitter $ U_{M} $ versus energy transfer price $\lambda$}
\label{fig:U_L_vs_lambda}
\end{figure}
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.7]{Results_EPS/U_L_vs_theta.eps}
\caption{The utility function of transmitter $ U_{M} $ versus energy transfer time allocation $\theta$}
\label{fig:U_L_vs_theta}
\end{figure}
Next, we validate the equilibrium of the proposed
\emph{Stackelberg} game. In order to support the derived \emph{Stackelberg} equilibrium, we first evaluate the utility function of the transmitter versus the energy transfer price $ \lambda $ with a fixed energy transfer time allocation $ \theta $ in Fig. \ref{fig:U_L_vs_lambda}. From this figure, it is observed that the revenue function is concave, which validates the proof of convexity shown in \emph{Lemma} \ref{lemma lambda_concave_function}. In this figure, it also can be shown that the optimal utility function of the transmitter can be obtained via optimal energy transfer price $ \lambda^{\textrm{opt}} $ in \eqref{eq:Optimal_energy_transfer_price} and it matches the numerical search with different given $ \theta $, which confirms the optimal closed-form solution of the energy transfer price $ \lambda $. Also, as $ \theta $ increases, the utility function of the legitimate transmitter is decreasing, and the optimal value $ \lambda $ shifts to the left
In addition, the revenue function of the transmitter versus energy transfer time allocation (i.e., $ \theta $) with optimal energy price $ \lambda^{\textrm{opt}} $ is shown in Fig. \ref{fig:U_L_vs_theta}. From this figure, it is shown that the revenue function is concave with respect to $ \theta $, which validates \eqref{eq:Optimal_theta}. Moreover, there exists a optimal utility transfer time (i.e., $ \theta^{\textrm{opt}} $) via numerical search with the optimal energy price. As $ \mu $ increases, the optimal value slightly shifts to the left.
Then, we evaluate the transmitter revenue function performance of the proposed \emph{Stackelberg} game.
Fig. \ref{fig:U_L_vs_No_PB} and Fig. \ref{fig:U_L_vs_No_PB_1} show the revenue function of the transmitter versus the number of PBs. From both figures, we can observe that this utility is improved with increasing of the number of PBs and $ \mu $.
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.7]{Results_EPS/U_L_vs_No_PB.eps}
\caption{The utility function of transmitter $ U_{M} $ versus No. of PBs with different number of legitimate users and eavesdroppers}
\label{fig:U_L_vs_No_PB}
\end{figure}
From Fig. \ref{fig:U_L_vs_No_PB}, increasing the number of the eavesdroppers can have more significant impact on the revenue than increasing the number of the legitimate users.
In Fig. \ref{fig:U_L_vs_No_PB_1}, the revenue is decreased when
the distance between the source and PBs is increased from 5m to 6.5m. This is because the nearer the PBs to the transmitter, the higher the transferred energy efficiency between them, which reduces the transmitter's payments to the PBs for their wireless energy services.
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.7]{Results_EPS/U_L_vs_No_PB_1.eps}
\caption{The utility function of transmitter $ U_{M} $ versus No. of PBs with different $ d_{PB} $}
\label{fig:U_L_vs_No_PB_1}
\end{figure}
Fig. \ref{fig:Theta_vs_No_PB} shows the optimal energy transfer time $ \theta $ versus the number of PBs. It is observed that $ \theta $ decreases as either the number of the PBs or $ \mu $ increase. The same behavior is observed when the distance between the source and PBs (i.e., $ d_{PB} $) decreases.
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.7]{Results_EPS/Theta_vs_No_PB.eps}
\caption{Optimal energy transfer time allocation $ \theta $ versus No. of PBs}
\label{fig:Theta_vs_No_PB}
\end{figure}
Fig. \ref{fig:Optimal_price_vs_No_PB} shows the optimal energy price versus the number of PBs. The price decreases as the number of PBs increases. Besides, the larger $ \mu $, the higher optimal energy price needs to be paid. It can also be seen from this figure that the decrease of the distance between the transmitter and PBs can also reduce the optimal energy price. This is because the shorter the distance between the source and PBs, the more energy harvested by the transmitter for the same power transmitted by the PBs, such that a lower energy price can be paid by the transmitter.
\begin{figure}[!htbp]
\centering
\includegraphics[scale = 0.7]{Results_EPS/Optimal_price_vs_No_PB.eps}
\caption{The optimal energy price versus No. of PBs.}
\label{fig:Optimal_price_vs_No_PB}
\end{figure}
\section{Conclusion and Future Work}\label{section Conclusion}
In this paper, we investigated the secure wireless-powered multiantenna multicasting system, which consists of a dedicated wireless powered networks with multiple PBs and a multiantenna secure multicasting system. We first investigated the power minimization problem to obtain the optimal power and energy transfer time allocation when both wireless power and secure information networks belong to the same service supplier. As this problem is not convex, we proposed a two-level approach, where the inner level problem can be relaxed as a convex optimization framework via iterative conic convex reformulation (i.e., SCA based SOCP scheme), while the outer level problem can be handled by using an 1D search. Next, we formulate a \emph{Stackelberg} game for the case when the WET and secure WIT networks belong to different service suppliers. We formulated the \textit{energy trading} process between the transmitter and the PBs as a \emph{Stackelberg} game, in which the transmitter plays a leader role and pays a price for the energy services from the PBs to guarantee the required security, and optimizes the energy price and the energy transfer time to maximize its utility function. Meanwhile, the PBs are modelled as the followers that determine their optimal transmit powers based on the released energy price to maximize their own utility function. The \emph{Stackelberg} equilibrium have been derived in terms of closed-form solution, where both the transmitter and the PBs come to an agreement on the energy price, transmit power and energy transfer time. Simulation results have been provided to validate the proposed schemes. For future works, we can consider
a more challenging scenario such that the PBs will not stay silent during the WIT phase but rather transmit artificial noise to interfere with the eavesdroppers. This would change the dynamic of the optimization problems and may require different design/solutions.
\begin{appendix}
\subsection{Proof of \emph{Theorem} \ref{theorem power efficient schur complement}}\label{appendix therorem schur complement}
When the solution $ \mathbf{Q}_{s} $ satisfies rank-one conditions in \emph{Lemma} \ref{lemma:Rank_one_lemma}, the SDP relaxed problem \eqref{eq:SDP_relaxation_results} can be equivalently modified as
\begin{align}\label{eq:SOCP_power_efficient_problem_rewritten}
\min_{\mathbf{w}}&~ \|\mathbf{w}\|^{2}, \nonumber\\
s.t.&~ \frac{2^{\bar{\bar{R}}}}{\bar{\sigma_{e}^2}} |\mathbf{w}^{H}\mathbf{h}_{e,l}|^2 + (2^{\bar{\bar{R}}} - 1) \leq \frac{1}{\bar{\sigma}_{s}^{2}} |\mathbf{w}^{H}\mathbf{h}_{s,k}|^{2}, ~\forall (k,l).
\end{align}
The problem \eqref{eq:SOCP_power_efficient_problem_rewritten} is still not convex in terms of the beamforming vector $ \mathbf{w} $. Thus, we propose a novel reformulation method by applying the following inequality relations in \eqref{eq:SOCP_power_efficient_problem_rewritten},
\begin{align}\label{eq:SOC_theorem}
\left[\begin{array}{cc}
a \\ \mathbf{b}
\end{array}
\right] \succeq_{K_{n}} \mathbf{0} \Leftrightarrow \|\mathbf{b}\| \leq a,
\end{align}
such that \eqref{eq:SOCP_power_efficient_problem_rewritten} can be reformulated into the following SOCP:
\begin{align}
\min_{t,\mathbf{w}} &~~ t, \nonumber\\
s.t. &~ \left[\begin{array}{cc}
t_{1} \\ \mathbf{w}
\end{array}
\right] \succeq_{K_{N_{T}+1}} \mathbf{0}, ~ \left[\begin{array}{cc}
\frac{1}{\bar{\sigma}_{s}} \mathbf{w}^{H}\mathbf{h}_{s,k}
\\\frac{2^{\bar{\bar{R}}}}{\bar{\sigma}_{e}}\mathbf{w}^{H}\mathbf{h}_{e,l} \\
(2^{\bar{\bar{R}}} - 1)^{\frac{1}{2}}
\end{array}
\right] \succeq_{K_{3}} \mathbf{0}, ~\forall k, \forall l.
\end{align}
Thus, this completes the proof of \emph{Theorem} \ref{theorem power efficient schur complement}.
\subsection{Proof of \emph{Lemma} \ref{lemma Special_case_power_efficient}}\label{appendix Special_case_power_efficient}
The power minimization problem \eqref{eq:Power_efficient_for_w} with only single legitimate user and eavesdropper can be rewritten as
\begin{align}\label{eq:Power_efficient_for_special_case}
\min_{\mathbf{w}} &~ \mathbf{w}^{H}\mathbf{w} \nonumber\\
s.t. &~ \log\left(1+\frac{ |\mathbf{h}_{s}^{H}\mathbf{w}|^{2}}{\bar{\sigma}_{s}^{2}}\right) - \log\left(1+\frac{ |\mathbf{h}_{e}^{H}\mathbf{w}|^{2}}{\bar{\sigma}_{e}^{2}}\right) \geq \bar{\bar{R}}.
\end{align}
Now we equivalently modify \eqref{eq:Power_efficient_for_special_case} as
\begin{align}\label{eq:Power_efficient_for_p}
\min_{\mathbf{v},P} &~ P\mathbf{v}^{H}\mathbf{v} \nonumber\\
s.t. &~ \frac{\mathbf{v}^{H}(\mathbf{I}+\frac{P}{\bar{\sigma}_{s}^{2}} \mathbf{h}_{s}\mathbf{h}_{s}^{H})\mathbf{v}}{\mathbf{v}^{H}(\mathbf{I}+\frac{P}{\bar{\sigma}_{e}^{2}} \mathbf{h}_{e}\mathbf{h}_{e}^{H})\mathbf{v}} \geq 2^{\bar{\bar{R}}},~ \mathbf{v}^{H}\mathbf{v} = 1,~ P \geq 0.
\end{align}
In order to achieve the optimal solution $ (P^{\textrm{opt}},\mathbf{v}^{\textrm{opt}}) $, we consider the Lagrange dual problem to \eqref{eq:Power_efficient_for_special_case}, which can be expressed as
\begin{align}
\mathcal{L}(\mathbf{w},\mu) = \mathbf{w}^{H}\mathbf{w} + \alpha \left[ 2^{\bar{\bar{R}}}\bigg(1+\frac{1}{\bar{\sigma}_{s}^{2}}\mathbf{w}^{H}\mathbf{h}_{e}\mathbf{h}_{e}^{H}\mathbf{w}\bigg) - \bigg(1+ \frac{1}{\bar{\sigma}_{e}^{2}}\mathbf{w}^{H}\mathbf{h}_{s}\mathbf{h}_{s}^{H}\mathbf{w}\bigg) \right],
\end{align}
where $ \alpha \geq 0 $ is the Lagrange multiplier associated with the secrecy rate constraint. The corresponding dual problem can be given by
\begin{align}\label{eq:Dual_problem_power_efficient}
\max_{\alpha \geq 0} ~ \alpha(2^{\bar{\bar{R}}} - 1), ~s.t. ~ \mathbf{Y} = \mathbf{I} - \alpha \bigg(\frac{1}{\bar{\sigma}_{s}^{2}}\mathbf{h}_{s}\mathbf{h}_{s}^{H} - \frac{1}{\bar{\sigma}_{e}^{2}}\mathbf{h}_{e}\mathbf{h}_{e}^{H}\bigg) \succeq \mathbf{0}.
\end{align}
The constraint in \eqref{eq:Dual_problem_power_efficient} implies that the matrix $ \mathbf{Y} $ have at least one zero eigenvalue. On the other hand, the solution of $ \alpha $ can be the maximum value that satisfies the positive semidefinite constraint in \eqref{eq:Dual_problem_power_efficient}, which leads to
\begin{align}
\alpha^{\textrm{opt}} = \frac{1}{\varrho_{\textrm{max}} (\frac{1}{\bar{\sigma}_{s}^{2}}\mathbf{h}_{s}\mathbf{h}_{s}^{H}-\frac{2^{\bar{\bar{R}}}}{\bar{\sigma}_{e}^{2}}\mathbf{h}_{e}\mathbf{h}_{e}^{H})}.
\end{align}
The problem \eqref{eq:Power_efficient_for_special_case} can be formulated as a convex optimization problem. Hence, the strong duality holds between the original problem \eqref{eq:Power_efficient_for_special_case} and the corresponding dual problem \eqref{eq:Dual_problem_power_efficient}. The required minimum power to achieve the secrecy rate constraint is
\begin{align}
P^{\textrm{opt}} = \alpha^{\textrm{opt}}(2^{\bar{\bar{R}}} - 1).
\end{align}
On the other hand, it is easily verified that the optimal $ \mathbf{w} $ lies in the null space of $ \mathbf{Y} $
\begin{align}
\mathbf{\bar{w}} = v_{\textrm{max}}
\bigg(\frac{1}{\bar{\sigma}_{s}^{2}}\mathbf{h}_{s}\mathbf{h}_{s}^{H} -
\frac{2^{\bar{\bar{R}}}}{\bar{\sigma}_{e}^{2}}\mathbf{h}_{e}\mathbf{h}_{e}^{H}\bigg),~ \mathbf{v}^{\textrm{opt}} = \frac{\mathbf{\bar{w}}}{\|\mathbf{\bar{w}}\|_{2}}.
\end{align}
Hence, the optimal solution to \eqref{eq:Power_efficient_for_special_case} can be expressed as
\begin{align}
\mathbf{w}^{\textrm{opt}} = \sqrt{P^{\textrm{opt}}} \mathbf{v}^{\textrm{opt}}.
\end{align}
\subsection{Proof of \emph{Lemma} \ref{lemma Second_step_convex_show}}\label{appendix Second_step_convex_show}
In order to show that $f(\theta)$ is a convex problem, there are two conditions to be satisfied: convex objective function and convex constraints \cite{boyd_B04}. First, we rewrite $f(\theta)$ as follows:
\begin{align}\label{eq:f_theta}
f(\theta) = \min_{\theta} &~ \frac{\theta(\sum_{m=1}^{M} \|\mathbf{g}_{m}\|^{2})}{1-\theta} \|\mathbf{w}\|^{2}, \nonumber\\
s.t. &~ (1-\theta) \log\left(\frac{1-\theta + \theta t_{s,k}}{1-\theta + \theta t_{e,l}}\right) \geq \bar{R},
0 < \theta < 1,~\forall k,\forall l.
\end{align}
It is easily verified that the objective function in \eqref{eq:f_theta} is convex with respect to $ \theta $. Then, we show that the secrecy constraint in \eqref{eq:f_theta} is convex.
Let $ f_{k,l}(\theta) = (1-\theta) \log\left(\frac{1-\theta + \theta t_{s,k}}{1-\theta + \theta t_{e,l}}\right) $, where $ t_{s,k} = \frac{|\mathbf{h}_{s,k}^{H}\mathbf{w}|^{2}}{\sigma_{s}^{2}} $ and $ t_{e,l} = \frac{|\mathbf{h}_{e,l}^{H}\mathbf{w}|^{2}}{\sigma_{e}^{2}} $. Hence, the remaining part we only show that $ f_{k,l}(\theta) $ is a concave function with respect to $ \theta $, which can be equivalently written as
\begin{align}
f_{k,l}(\theta) &~ = (1-\theta) \log\left( \frac{\frac{1-\theta+\theta t_{s,k}}{1-\theta}}{\frac{1-\theta +\theta t_{e,l}}{1-\theta}} \right) = (1-\theta) \log\left( \frac{\frac{\theta(t_{s,k} -1)+(1-t_{s,k}) +t_{s,k}}{1-\theta}}{\frac{\theta(t_{e,l} - 1) + (1-t_{e,l}) + t_{e,l}}{1-\theta}} \right) \nonumber\\
&~ = \log\left( \frac{\frac{(1-t_{s,k})(1-\theta) + t_{s,k}}{1-\theta}}{\frac{(1-t_{e,l})(1-\theta)+t_{e,l}}{1-\theta}} \right).
\end{align}
Let $ z = 1- \theta $, ($ 0\leq \theta \leq 1 $), $ f_{k,l}(z) $ can be rewritten as
\begin{align}
f_{k,l}(z) = z \log \frac{(1-t_{s,k})z +t_{s,k}}{z} - z \log \frac{(1-t_{e,l})z +t_{e,l}}{z}.
\end{align}
Then, we consider the first derivative of $ f_{k,l}(z) $,
\begin{align}
\frac{ \partial f_{k,l}(z)}{z} = \frac{1}{\ln2 } \left[ \bigg( \ln \frac{(1-t_{s,k})z+t_{s,k}}{z} + \frac{-t_{s,k}}{(1-t_{s,k})z + t_{s,k}}\bigg) - \bigg( \ln \frac{(1-t_{e,l})z+t_{e,l}}{z} + \frac{-t_{e,l}}{(1-t_{e,l})z + t_{e,l}}\bigg) \right].
\end{align}
Furthermore, the second derivative of $ f_{k,l}(z) $ is given by
\begin{align}
\frac{\partial^{2} f_{k,l}(z)}{z^{2}} = \frac{1}{\ln2} \left[ \frac{-t_{s,k}^{2}}{[(1-t_{s,k})z+t_{s,k}]^{2} z} - \frac{-t_{e,l}^{2}}{[(1-t_{e,l})z +t_{e,l}]^{2} z} \right].
\end{align}
Let $ g(t) = \frac{-t^{2}}{[(1-t)z+t]^{2}z} $, the first derivative of $ g(t) $ is given by
\begin{align}\label{eq:g(t)_first_order_derivatives}
\frac{\partial g(t)}{t} &~ = \frac{-2t[(1-t)z + t] + 2(1-z)t^{2}}{[(1-t)z + t]^{3}z} = \frac{-2zt}{[(1-t)z+t]^{3}z} < 0.
\end{align}
It is easily verified that \eqref{eq:g(t)_first_order_derivatives} holds since $ z = 1- \theta \in (0,1) $, thus, $ g(t) $ is a monotonically decreasing function of $ t $. Due to $ t_{s,k} > t_{e,l} $, it is easily obtained that $ \frac{\partial^{2} f_{k,l}(z)}{z^{2}} < 0 $. In other words, $ f_{k,l}(\theta) $ is a concave function with respect to $ \theta $.
\subsection{Proof of \emph{Lemma} \ref{lemma lambda_concave_function}}\label{appendix lambda_concave_function}
We first derive the first-order derivatives of \eqref{eq:U_L_lambda}, which is written as
\begin{align}
\frac{\partial U_{M}(\lambda)}{\partial \lambda} = \frac{1}{\ln 2}\bigg[ \frac{\mu (1-\theta) t_{s} C_{M} }{1+(\lambda C_{M} - 2 D_{M}) t_{s}} - \frac{\mu (1-\theta) t_{e} C_{M} }{1+(\lambda C_{M} -2 D_{M}) t_{e}} \bigg] - 2 C_{M} \lambda + 2 D_{M}.
\end{align}
Then, the second-order derivatives of \eqref{eq:U_L_lambda} is given by
\begin{align}
\frac{\partial^{2} U_{M}(\lambda)}{\partial^{2} \lambda} = \frac{1}{\ln 2}\bigg[ \frac{\mu (1-\theta) C_{M}^{2}(t_{e}^{2} - t_{s}^{2})}{[1-(\lambda C_{M} - 2 D_{M})t_{s}]^{2} [1-(\lambda C_{M} - 2 D_{M})t_{e}]^{2}} \bigg] - 2C_{M} < 0.
\end{align}
The above inequality holds since $ t_{s} - t_{e} > 0 $ to guarantee the minimum achievable secrecy rate is greater than zero. Thus, \eqref{eq:U_L_lambda} is a concave function.
\end{appendix}
\bibliographystyle{ieeetr}
| {'timestamp': '2017-06-08T02:01:28', 'yymm': '1706', 'arxiv_id': '1706.01936', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01936'} | arxiv |
\section{\large Introduction}
Nacre-like imbricated (staggered) structures (see Fig.~\ref{fig:nacre}) are commonly seen in both nature and man-made materials, and are of biomimetic interest. The mechanical merits of their characteristic 'brick-and-mortar' structure such as high fracture toughness and insensitivity of flaws have been well established. For exammple, Wang et al. \cite{WangSuo01}
showed that the nano-asperities on the platelets of hydrated nacres are the main cause of high resistance during the sliding of platelets and the robust mechanical behavior on the macro-scale. Gao et al. \cite{Gao03} found that the stress concentrations at flaws and the damage in nacre are significantly mitigated on the nano-scale. Shao et al. \cite{Shao12} demonstrated that the fracture toughness of nacre is greatly enhanced by the crack bridging effects in the staggered microstructure.
\begin{figure}[!h]
\centering
\includegraphics[width=0.3\textwidth]{Nacre_1.jpeg}
~
\includegraphics[width=0.315\textwidth]{Nacre_2.JPEG}
~
\includegraphics[width=0.3\textwidth]{Nacre_3.png}
\caption{a) Picture of nacre inside a nautilus shell; b) Electron microscopy image of a fractured surface of nacre; c) Schematic of the microscopic structure of nacre; All images are from Wikipedia, https://en.wikipedia.org/wiki/Nacre.}
\label{fig:nacre}
\end{figure}
On the other hand, studies on statistical aspects of the 'brick-and-mortar' structures are rare, especially in regard to the type and tail of the probability distribution of strength, and no undisputed theoretical basis has been established so far. For general quasi-brittle structures their failure probabilities are usually formulated by the weakest-link model and its well known limiting Weibull distribution is widely used. When the representative volume elements (RVE) are not negligible compared to the size of the whole structure, the finite weakest-link model \cite{BazPan06, BazPan07, LeBaz09,LeBaz11,BazLe17} is sometimes considered.
Meanwhile, limitations of classical Weibull-type approach have long been realized \cite{BazLe17,Baz05,BazPla98,BazXi91}, and applicability of the weakest-link chain model has bee questioned, e.g., by Bertalan \cite{Ber14}. According to this model, the maximum load (which is, under load control, the failure load) occurs as soon as one representative volume of material (RVE) fails. This neglects the parallel couplings due to lateral interactions and the stress redistribution causing the release of stored energy due to crack growth. Additionally, Monte Carlo simulations show \cite{Ber14} the failure probability, $P_f$, to deviate from the Weibull distribution for small nominal stres
. Yet, in structural design, the lower tail of $P_f$ that is most important.
Unlike the weakest link model, fiber bundle model takes account of the effect of stress redistribution by considering various load sharing rules among fibers. The fiber bundle model with the rule of equal load sharing was studied rigorously by Daniels \cite{Dan45}, who showed that its failure probability converges to the normal (or Gaussian) distribution as the number of fibers tends to infinity.
Later, a chain-of-bundles model was formulated Harlow and Phoenix \cite{Har78I,Har78II} to obtain the failure probability of fibrous composites under uniaxial tension. They assumed that cross sections of the composite with certain finite spacing along the loading direction are statistically independent. So these cross sections are related to each other through series coupling in a chain and the individual cross sections are treated as bundles with some hypothetical local load-sharing rule. A significant deviation of $P_f$ from Weibull distribution is predicted. Due to overwhelming obstacles to large scale simulation at that time (1978), they analyzed only bundles with less than 10 fibers, and no verification through Monte Carlo simulations was given.
The new idea of this paper is to model the essence of failure behavior of the 'brick-and-mortar' structure of nacre under uniaxial tension by a brittle square fishnet pulled along one of the diagonals. Similar to the weakest link model, we obtain the failure probability of fishnet by calculating its counterpart---the survival probability, $1-P_f$. We consider not only the probability that every link would survive, but also the probabilities that of the fishnet remaining safe after some links have failed. These additional probabilities are then identified to be the cause of deviation of $P_f$ from the weakest-link model, producing Weibull distribution at the lower tail of $P_f$.
The results of Monte Carlo simulations offer a concrete verification to the analytical derivation fishnet statistics theory and provide fruitful insights. In previous studies of electrical circuits,
Monte Carlo simulations have mostly followed the random fuse model (RFM) \cite{Ala06,Ber14}, in which the elastic structure is simplified as a lattice of resisters with random burnout thresholds. The RFM simulates the gradual failure of resister networks under increasing voltage, which is similar to the failure process of brittle elastic materials under uniaxial loading. Here, however, the emphasis in on the finite element method (FEM) with random element (or link) strength because it reflects better the mechanical failure of fishnet. To obtain a sufficient number of samples ($>10^5$) within a not too long run time, a simple finite element code is here developed, in Matlab. A unprecedented number, $10^6$, is obtained within a few days of computation. With such a large number ($10^6$) of samples, the resulting histograms become visually identical to the theoretical cumulative probability density function (cdf) of failure probability $P_f$.
\section{\large Statistical Modeling of Fishnet Structure}
In nature, the mechanical responses of hydrated and dry nacres are quite different: Hydrated nacres like those in the shell of pearl oysters and abalones exhibit strong nonlinearity and a yielding plateau under tension, compression and shear \cite{WangSuo01}. However, dry nacres are mostly brittle and the ductility is vanishingly small under uniaxial tension as well as compression. In this paper,
only a dry (and brittle) nacre is considered. Its behavior up to brittle failure may be treated as linearly elastic.
\subsection{Equivalent Embedded Structure of Nacre: Fishnet}
\begin{figure}[!h]
\centering
\includegraphics[width=0.8\textwidth]{Topology.pdf}
\caption{a) Schematic illustration of original nacre micro-structure; b) Equivalent fishnet structure; c) Deforming mechanism of fishnet}
\label{fig:topology equivalence}
\end{figure}
To simplify and capture the essence of load transmission in the staggered imbricated structure of nacreous materials, we ignore the relatively weak tensile bonds providing the longitudinal connections of the adjacent lamellae (or platelets) and assume that most of the strength and stiffness is provided by the shear bonds between parallel lamellae (Fig.~\ref{fig:topology equivalence}(a)). Next, if we focus on the longitudinal strength of nacre under tensile load parallel to the lamellae, the bending stiffness of the thin polymer layers providing transverse connections of the lamellae does not play a significant role. So, for failure under longitudinal tension, we may imagine the lamellae to be replaced by their centroids, shown as the black dots in Fig. \ref{fig:topology equivalence} (a)), with the centroids, or nodes, connected by bars, or links (dashed lines in Fig. \ref{fig:topology equivalence} (a)), that transmit only axial forces.
Thus we obtain a system of nodes and links shown in Fig. (\ref{fig:topology equivalence} (b), equivalent to a truss. Obviously, this truss looks like a fishnet. For example, in Fig.\ref{fig:topology equivalence}(a) the lamellae (or platelet) A,B and C are mapped to nodes A,B and C in Fig. \ref{fig:topology equivalence}(b) and the shear bonds AB and AC in Fig.\ref{fig:topology equivalence}(a) are replaced by truss elements AB and AC in Fig.\ref{fig:topology equivalence}(b), respectively. This is equivalent to pulling an elastic fishnet pulled along the longitudinal diagonals of the parallelogram cells.
The truss is not statically determinate. Each of the parallelograms in the fishnet forms a mechanism which will, under longitudinal tension, shrink immediately at the start of loading into a set of coinciding lines (or fibers) with staggered connections among them (Fig.~\ref{fig:topology equivalence}(c)). Evidently, this is a simplification, which nevertheless retains the essence of transverse interactions between the adjacent rows of lamellae.
For the purpose of illustration, the stress field in the fishnet will always be displayed ini the original (Lagragian) coordinates, i.e., before the collapse of fishnet into coinciding lines.
The stress redistribution captured by the fishnet model plays a key role in the failure probability of fishnet. In this regard, the fishnet is different from each of the other two basic models for the statistics of failure, namely the weakest link chain model and the fiber bundle model.
\subsection{Stress Redistribution Near a Crack in the Fishnet
}
The failure probability of a fishnet obviously depends on the stress redistributions after successive link failures. As an approximation for an analytical model, we calculate such redistributions deterministically, using a continuous approximation of the fishnet.
First we consider the failure of only one link. We assume the strength distributions of all links to be independent and identically distributed (i.i.d.) random variables (this implies that the autocorrelation length of the random strength field is assumed to be equal to the length of the link). The perimeter length of a set of geometrically similar fishnet structures (or domains) is proportional to the structure size, $D$, while the area of the fishnet structures is proportional to $D^2$. Thus the probability of the failed link to be located exactly on the boundary tends to zero as $D \to \infty$. Therefore, for large enough fishnets, the first link to fail lies, with probability almost 1, in the fishnet interior. So we study only the case of link failures in the fishnet interior.
\subsubsection{Stress Redistribution in Equivalent Fishnet Continuum}
\begin{figure}[!h]
\centering
\includegraphics[width=1.05\textwidth]{ThreeFigsContinuum.pdf}
\caption{a) Schematic illustration of two orthogonal coordinate systems $x,y$ and $\xi,\eta$; b) Configuration of fishnet continuum with a pre-existing crack ; c) one quarter (shadowed region) of the fishnet continuum shown in (b)}
\label{fig:discrete to continuum}
\end{figure}
For simplicity, fishnets consisting of many links can be treated as a continuum. To formulate its governing equation, we consider a fishnet whose initial configuration consists of orthogonal lines of links (Fig.~\ref{fig:discrete to continuum}a), and introduce Lagrangian coordinates $(\xi,\eta)$ parallel to link lines. After the collapse of the fishnet into one line, all the four links connecting to one node $(i,j)$ become parallel, aligned in the $x$-direction. Since the initial fishnet state is kinematically indeterminate, a mechanism, the equilibrium condition of a node must be written for the collapsed state of fishnet. Equilibrium requires that the sum of the forces in $x$ direction from the four links acting on node $i,j$ would vanish. This leads to the difference equation:
\begin{equation}
\label{finite difference}
\frac{E A}{a}\left( \frac{u_{i,j+1}-u_{i,j}}{a} + \frac{u_{i,j-1}-u_{i,j}}{a} + \frac{u_{i+1,j}-u_{i,j}}{a} + \frac{u_{i-1,j}-u_{i,j}}{a} \right) = 0
\end{equation}
where $u_{i,j}$ the displacement in the $x$ direction of any joint $(i,j)$, $a$ = length of each link, $E$ = Young's modulus and $A$ = cross section area of the link.
To obtain the continuum limit of $a \to 0$, consider Lagrangian coordinates $\xi, \eta$ in the initial directions of the links before fishnet collapse (Fig.~\ref{fig:discrete to continuum}a). Obviously, the continuum limit is the partial differential equation:
\begin{equation}
\label{Laplace xi}
\frac{\partial^2 u}{\partial \xi^2} + \frac{\partial^2
u}{\partial \eta^2} = 0 \mbox{~~~or~~~} \nabla_{(\xi,\eta)}^2u = 0
\end{equation}
which is the Laplace equation. Since the Laplacian $\nabla^2$ is invariant at coordinate rotations, the differential equation of equilibrium in the $x$ direction in the initial $(x,y)$ coordinates before fishnet collapse reads:
\begin{equation}
\label{Laplace x}
\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2
u}{\partial y^2} = 0 \mbox{~~~or~~~} \nabla_{(x,y)}^2u = 0
\end{equation}
where $x$ is the direction of loading of the fishnet and $y$ is the transverse direction with no load.
Note that if we defined the $(\xi,\eta)$ coordinate system in the deformed configuration (in which all the links become parallel and coincident with one line), the governing equation would become $\mbox{d}^2 u/\mbox{d} x^2=0$, which is independent of transverse direction $y$. Then, in the collapsed configuration, we would have to distinguish the coincident link lines by numbers rather than by $y$. But this description would be inconvenient for graphical representation.
The failure of one link or one group of links causes stress redistribution in the fishnet. Locally, many possibilities exist, which would complicate the calculation of failure probabilities. We assume that the redistributions can be characterized in the overall sense based on the continuum defined by Eq. (\ref{Laplace x}). The simplest case is a failure of a group of links approximated by a circular hole of radius $r_0$. Converting this partially differential equation to polar coordinates $(r, \tht)$, we have $(\partial^2 u / \partial r^2) + (1/r) (\partial u / \partial r) = 0$, and seeking an axisymmetric solution, one can readily find that the link strains $\partial u/\partial r$ as well as the stresses decay from the hole in proportion to $1/r$, according to the continuum approximation.
In the case of a sharp crack of length $2a$ in the continuum, we may seek the displacement near the crack tip to be in the separated form $u = f(\tht) r^\lambda$ where $r$ is the distance from the crack tip. Upon substitution into Eq. (\ref{Laplace x}), it is then found that, like in linear elastic fracture mechanics (LEFM), the strains and stresses near the crack tip (i.e., for $r \to 0$) decay as $r^{-1/2}$ while far away from the crack (i.e., for $r \to infty$) they decay as $r^{-2}$. What is important is that the disturbance due to failed links is localized and decays to a negligible value within a certain finite distance.
Around the crack tip, the regions near the crack surface are shielded from the load an are unloaded to near zero. Later these regions will be seen to complicate the probabilistic analysis, compared to the the classical weakest-link and fiber-bundle models. This is the trade-off that we must accept to obtain a more accurate tail of failure probability of nacreous materials.
\begin{figure}[!h]
\centering
\includegraphics[width=0.7\textwidth]{stressFieldContinuum.pdf}
\caption{Profile of $\eta=\sigma/\sigma_N$ of fishnet continuum for different crack lengths: $a=$ 1, 2, 3 and 4. In this case, $L=10$.}
\label{fig:continuum stress redistribution}
\end{figure}
\subsubsection{Stress redistribution in the
fishnet}
Knowing the asymptotic stress distribution near a crack (i.e., near one or more failed links) but, to calculate the failure probability accurately, it helps to calculate the exact discrete stress field. This is easily done by finite element method; see the results in Fig.~\ref{fig:discrete stress redistribution}.
Fig.\ref{fig:discrete stress redistribution}a shows the stress field in a square fishnet with $64 \times 64$ links under uniform horizontal tension with a single failed link on the inside. The link properties are here assumed uniform and one link is assumed to be failed at the outset.
Except close to this link, the stresses are almost uniform. To render the detail near the damage zone (inside the red square), Fig.\ref{fig:discrete stress redistribution}b presents a schematic showing the stresses in the damage zone only. We see that 8 close neighbors of the failed link endure stress redistributions with stresses greater than 10\% ($\eta_{max}=\sigma_{max}/ \sigma=1.6$ and $\eta_{min}=\sigma_{min} / \sigma = 0.64$. Four links with larger stress changes are highlighted by red and orange, and further four with smaller stress changes by dark blue and blue).
The stress amplification zone is marked in light red, and the stress shielding (unloading) zone in light green.
As an example of how the stress ratio $\eta$ tends to 1 while moving away from the failed link, $\eta=\sigma/\sigma_N$ is plotted against the link number in Fig.\ref{fig:discrete stress redistribution}.c. In the figure, thresholds $|\eta-1|=5\%$ and $|\eta-1|=10\%$ are indicated by thick and dash lines respectively. Among 4095 links, $|\eta-1|>5\% $ occurs only on less than 20 links. The stress disturbance due to a failed link decays to a negligible value (less than 5\%) within the distance of 4 links. Later the exact values of $\eta$ near the crack tip are used to calculate the failure probability of fishnet.
\begin{figure}[!h]
\centering
\includegraphics[width=0.9\textwidth]{DiscreteStress.pdf}
\caption{a) Normalized stress profile of fishnet with one failed link on the inside; b) Schematic showing the stress ratios ($\eta=\sigma/\sigma_N$) in the highlighted region of (a); c) Stress ratios of each link in (a) indexed by the link number in FE simulation.}
\label{fig:discrete stress redistribution}
\end{figure}
\subsection{Two Basic Models of Strength Statistics: Weakest-Link Chain and Fiber-Bundle}
Before embarking on fishnet statistics, we need to review the basics of this classical model for brittle failure. We consider a chain of $n$ identical links under tensile stress $\sigma$ whose strengths represent independent identically distributed (i.i.d.) random variables. For the whole chain to survives, every single link must survive. So, according to the joint probability theorem,
\begin{equation}
\label{intro:chain}
1-P_f(\sigma) = [1-P_1(\sigma)]^n
\end{equation}
where $P_1$ and $P_f$ are the failure probabilities of a single link and of the whole chain, respectively. The limit of this equation for $n \to \infty$ may be written as
\begin{equation} \label{e1}
1-P_f(\sigma) = \lim_{n \to 0} [1-x/n]^n = e^{-x},~~~x = n P_1(\sigma)
\end{equation}
According to the stability postulate of extreme value statistics \cite{Fis28}, the type of the distribution for $\sigma \to \infty$ must be invariant upon linear transformation of the independent variable $\sigma$. One may check that this condition is verified if $P_1$ is a power function, $P_1(\sigma) = \alpha \sigma^{m_0}$, where $m_0$ and $\alpha$ are constants. According to the extreme value theorem \cite{Fis28}, the power function is the only possibility (among three) since the tensile strength $\sigma$ cannot be negative. This leads to
\begin{equation}
P_f(\sigma) = 1 - e^{-\alpha \sigma^{m_0}}
\end{equation}
where $m_0$ is called the Weibull modulus and $\alpha$ is the scale parameter.
For a chain with a finite number of links, only the left portion of $P_f(\sigma)$ is Weibullian, and this portion shortens as $N$ decreases \cite{PangBazLe08}
Fiber composites as well as many other materials can often be treated, especially on a small scale, as bundle of fibers whose strengths are i.i.d. random variables. In contrast to a chain, the maximum load occurs only after the breakage of a certain number of fibers, which is generally larger than 1. After each fiber break, the load redistributes among the surviving fibers. Although the redistribution is different depending on the postpeak behavior of the fibers and stiffness of the loading platens, the total load distribution or on some empirical load-sharing rule. Asymptotically, the total load distribution of all fiber bundle models is Gaussian (or normal).
\subsection{Fishnet Statistics}
\subsubsection{Extension of Weakest Link Model}
Consider a general 2D fishnet structure consisting of $N$ links whose failure probabilities $\sigma_i$ are i.i.d. random variables.
In contract to a chain, more than one link may fail before the fishnet fails.
Therefore, we define the random variable $X(\sigma)$
= number of links that have failed after stress $\sigma$ is imposed at the boundary.
Now consider a fishnet with $N=m \times n$ links, i.e., with $m$ rows and $n$ columns, pulled in the direction of rows. Since events $\{X(\sigma)=k\}$ are mutually exclusive, the whole probability space can be partitioned by these exclusive events into $N+1$ subsets: $\{X(\sigma)=k\}, k=0,1,\cdots, N$. Different from a chain or a fiber bundle, the failure of fishnet, however, cannot be characterized as either $\{X(\sigma)=1\}$, $\{X(\sigma)=m\}$ or $\{X(\sigma)=N\}$ because its failure also depends on the position of failed links, i.e. the whole structure fails when the $n_f$ failed links form section cutting through all the rows (vertically in Fig.~\ref{fig:nacre}(c)). So the condition $n_f \geq m$ is necessary for failure but not sufficient. The failed links may be scattered in the fishnet discontinuously.Based on these considerations, the probability of fishnet survival may be expressed as:
\begin{align}
\label{general sum} \nonumber} \newcommand{\pg}{\paragraph
1-P_f(\sigma) =& P_{S_0}(\sigma) + P_{S_1}(\sigma)
+ P_{S_2}(\sigma) + \cdots + P_{S_{m-1}}(\sigma)\\
&~~~ + \cPr( X(\sigma) \geq m~~
\text{(the whole structure not yet failed )}
\end{align}
where $P_f(\sigma) = (\sigma_{max} \leq \sigma)$, $\sigma_{max}$ = nominal strength of structure; and $P_{S_k}(\sigma) = \cPr(X(\sigma)=k),~k=0,1,2,...,N$. Since the event $\{X(\sigma)=0\}$ means that no link can fail under the load $\sigma$, we have
\begin{equation} \label{PS0}
P_{S_0}(\sigma)=[1 - P_1(\sigma)]^n~~~\text{where}~~
P_1(\sigma) = \cPr(\sigma_i \leq \sigma).
\end{equation}
If we consider only the first term $P_{S_0}$ on the right-hand side of Eq.(\ref{general sum}), the model is equivalent to the classical weakest-link model,i.e.,
\begin{equation} \label{weakest link}
1-P_f(\sigma) = P_{S_0}(\sigma) = [1-P_1(\sigma)]^n
\end{equation}
Physically, this means rearranging all the links into a chain with only 1 row and $N$ columns. Because the other terms in the sum of Eq.~(\ref{general sum}) are excluded, the weakest-link model gives a strict upper bound of failure probability of the fishnet.
\subsubsection
Two-Term Fishnet Statistics}
To get a better approximation, let us now truncate the sum in Eq.~(\ref{general sum}) after the second term $P_{S_1}$.
Let $\sigma_N$ be the nominal stress representing the average stress in the cross section of the fishnet, and $\sigma_i$ be the stress at the $i^{th}$ link when the nominal stress is $\sigma_N=\sigma$. Also denote $\eta_j^{(1)} = \sigma_i /\sigma_N$, which is the ratio of stress change in link $i$ when some links failed. Based on our previous analysis of stress redistribution, we assume $\eta_j^{(1)}$ not to depend on the position of the failed link. For the two-term model, the survival probability is
\begin{equation}
\label{two term expansion}
1-P_f(\sigma) = P_{S_0}(\sigma) + P_{S_1}(\sigma),
\end{equation}
where $P_{S_0}$ is given by Eq.(\ref{PS0}). and$P_{S_1}(\sigma)$ is the probability that, under load $\sigma_N=\sigma$, only one link has failed. This event can be further decomposed as the union of mutually exclusive events:
\begin{equation}
\{X(\sigma)=1\}=\cup_{i=1}^{N}\Omega_i,
\end{equation}
where $\Omega_i$ is the event that the $i^{th}$ link is the only one that has failed under the loading $\sigma_N=\sigma$. Next, we define a family of events for every single link:
\begin{equation}
\omega_i(\sigma) = \text{the $i^{th}$ link survives under
stress} \sigma_i = \sigma
\end{equation}
Then the event $\Omega_i$ that the $i^{th}$ link fails while the others survive is equivalent to
\begin{equation}
\Omega_i=\omega_i^c(\sigma) \cap \left\{ \bigcap_{j \neq i}
\left[ \omega_j(\sigma) \cap \omega_j(\eta_j^{(1)}\sigma)
\right] \right\}
\end{equation}
where $\omega_i^c(\sigma)$ is the event that the $i^{th}$ link fails under the initial stress field $\sigma_i = \sigma$ and the expression $\bigcap_{j \neq i}\left[ \omega_j(\sigma) \cap \omega_j( \eta_j^{(1)} \sigma) \right]$ represents the event that the remaining links survive under both the initial and redistributed stresses. Hence the expression for $P_{S_{k}}$ is:
\begin{align}
\label{partition of PS1}
P_{S_1}(\sigma) &=\cPr\{ X(\sigma)=1 \} =
\cPr\{\cup_{i=1}^{N}\Omega_i\} = \sum_{i=1}^{N} \cPr\{\Omega_i\}
\\ &=N\cdot\cPr\left\{ \omega_i^c(\sigma) \cap \left[ \bigcap_{j
\neq i}\left( \omega_j(\sigma)\cap \omega_j(\eta_j^{(1)}\sigma)
\right) \right] \right\}
\end{align}
Assume the strength of links $P_1(\sigma) = \cPr\{\omega_i (\sigma)\}$ are i.i.d. random variables. Then Eq.~(\ref{partition of PS1}) reduces to
\begin{align}
\label{PS1 if statement}
P_{S_1}(\sigma)
&= N \cdot \cPr\{\omega_i^c(\sigma)\} \cdot \prod_{j\neq
i}\cPr\left\{ \omega_j(\sigma)\cap
\omega_j(\eta_j^{(1)}\sigma) \right\}\\
&= N P_1(\sigma)\cdot \prod_{j\neq i}\cPr\left\{
\omega_j(\sigma)\cap \omega_j(\eta_j^{(1)}\sigma) \right\}
\end{align}
When $\eta_j^{(1)} \geq 1$, the event $\left\{ \omega_j(\sigma)\cap \omega_j(\eta_j^{(1)}\sigma) \right\}$ is equivalent to $\omega_j (\eta_j^{(1)}\sigma)$, and when $\eta_j^{(1)} < 1$, it is equivalent to $\omega_j(\sigma)$. Therefore, the expression for $P_{S_1}$ further reduces to
\begin{equation}
\label{exact expression of PS1}
\boxed{P_{S_1}(\sigma)=NP_1(\sigma)\cdot \prod_{i=1}^{N-1}
\left[ 1 - P_1(\lambda_i \sigma) \right],~~~\lambda_i=
\begin{cases}
\eta_i~,& \eta_i\geq 1\\
1~~,& \eta_i<1
\end{cases}}
\end{equation}
This equation has been derived without using any knowledge of stress redistribution or any assumptions about load sharing rules. To get a simpler estimate of $P_{S_1}$, we can make two reasonable simplifications of stress redistribution:
\begin{enumerate}
\item [1.] The stress redistributes only in the vicinity of a failed link. So we assume that links farther away are undisturbed, with all $\eta_i^{(1)} = 1$, and assume the stress to change only a few links, whose number is denoted as $\nu_1$ (not including the failed link);
\item [2.] To keep $P_f$ either as an upper bound or an optimum prediction, we replace all the $\nu_1$ redistributed stresses $\eta_{i}^{(1)} \sigma$ by the maximum $\eta_{max}^{(1)} \sigma$ (or by some weighted average $\eta_{a}^{(1)} \cdot \sigma$ among them).
\end{enumerate}
Based on these two additional assumptions, $P_{S_1}$ is further simplified to
\begin{equation}
\label{simplified PS1}
\boxed{P_{S_1}(\sigma) = N P_1(\sigma)[1 - P_1(\sigma)]^{N - \nu_1 - 1}[1 - P_1(\eta_a^{(1)}\sigma)]^{\nu_1}}
\end{equation}
As a reasonable estimate (to be checked by Monte Carlo simulations), we choose $\nu_1$ such that all the $\eta_i^{(1)}$'s that are smaller than 1.1 would be replaced by 1, and then determine the value of $\eta_{a}^{(1)}$ by approximating Eq.~(\ref{exact expression of PS1}) by Eq.~(\ref{simplified PS1}), i.e.,
\begin{equation}
\prod_{i=1}^{N-1} \left[ 1 - P_1(\lambda_i \sigma)
\right]\simeq [1-P_1(\sigma)]^{N - \nu_1 - 1}[1 -
P_1(\eta_a^{(1)} \sigma)]^{\nu_1}
\end{equation}
Based on calculation, for the fishnet we are studying right now and various strength distribution $P_1(\sigma)$ of links, $\nu_1=4\sim 8$ and $\eta_{a}^{(1)}=1.34 \sim 1.36$. From this, we can see that $\eta_{a}^{(1)}$ is very close to $\eta_{max}^{(1)}$, meaning that using the maximum redistributed stress can actually give us a pretty good prediction of $P_f$.
To get the failure probability, we plug Eq.~(\ref{simplified PS1}) into Eq.~(\ref{two term expansion}):
\begin{align}
1-P_f(\sigma) &= [1-P_1(\sigma)]^N +
N P_1(\sigma)[1 - P_1(\sigma)]^{N - \nu_1 - 1}[1 -
P_1(\eta_a^{(1)} \sigma)]^{\nu_1} \\
& = [1 - P_1(\sigma)]^N \left\{ 1 + \frac{NP_1(\sigma)}{1 -
P_1(\sigma)} \left[\frac{1 - P_1(\eta_a^{(1)}\sigma)}{1 -
P_1(\sigma)}\right]^{\nu_1} \right\}
\end{align}
Denoting
\begin{equation}
P_{\Delta}
= \frac{1}{1-P_1(\sigma)} \left[\frac{1 -
P_1(\eta_a^{(1)}\sigma)}{1 - P_1(\sigma)}\right]^{\nu_1}
\end{equation}
we finally get
\begin{equation}
\label{extension}
\boxed{1-P_f(\sigma) = [1-P_1(\sigma)]^N \cdot \left\{ 1 + N
P_1(\sigma) P_{\Delta}(\sigma,\eta_a^{(1)},\nu_1) \right\}}
\end{equation}
From Eq.~(\ref{extension}), we can see that the main difference between weakest link model with the two-term fishnet model is the extra term:
\begin{equation}
N P_1(\sigma) \cdot P_{\Delta}
\end{equation}
In the expression for $P_{\Delta}$, $[(1-P_1(\eta_a^{(1)} \sigma))/(1-P_1(\sigma))]^{\nu_1}$ is the conditional probability of survival for the links in the region of stress redistribution with load load $\eta_a^{(1)} \sigma$, given that they have been carrying load $\sigma$ without failing. In other words,
\begin{equation}
1-\left[\frac{1-P_1(\eta_a^{(1)}
\sigma)}{1-P_1(\sigma)}\right]^{\nu_1}
\end{equation}
is a cumulative distribution function (cdf) of structural failure probability. Therefore, its complement has the following properties:
\begin{equation*}
\lim_{\sigma \rightarrow 0}\left[\frac{1-P_1(\eta_a^{(1)}
\sigma)}{1-P_1(\sigma)}\right]^{\nu_1} = 1
~~~\text{and}~~~
\lim_{\sigma \rightarrow \infty}\left[\frac{1-P_1(\eta_a^{(1)} \sigma)}{1-P_1(\sigma)}\right]^{\nu_1} = 0
\end{equation*}
As for the other term in $P_{\Delta}$, i.e. $1/(1-P_1(\sigma))$, it tends to 1 as $\sigma$ tends to zero and blows up as $\sigma$ approaches $\infty$. Therefore as $\sigma$ tends to 0, the term $P_{\Delta}$ tends to 1.
Numerical study of $P_{\Delta}$ shows that for most cases with $P_1$ being Gaussian, Weibull or other typical grafted distributions, $P_{\Delta}$ always tends to 0 as $\sigma$ approaches $\infty$ as long as $\eta_a^{(1)}>\eta_0$, where the constant $\eta_0$ depends on $P_1$ and is greater but very close to 1 (e.g $\eta_0=1.02$).
For structures such as bridges or aircraft, it is generally desired that the structural failure probability be less than $10^{-6}$, and in that case we obviously need to pay attention only to the remote left tail of $P_f(\sigma)$, i.e., for $\sigma \to 1$. In that case we have
\begin{equation}
\label{two term simplification}
1-P_f(\sigma) \simeq [1-P_1(\sigma)]^N
\left[ 1 + N P_1(\sigma) \right]
\end{equation}
To elucidate the difference from the classical weakest link model, it helps to transform the foregoing equation (Eq.~(\ref{two term simplification})) to the Weibull scale, which has the coordinates:
\begin{equation}
X^*=\ln \sigma,~Y^*=\ln[-\ln(1-P_f)]
\end{equation}
For comparison, we plot in this scale also the weakest link model. For $\sigma \to 0$, we have $P_1 \to 0$, and so we think of using the approximation $\ln(1+x) \simeq x$ for small $x$. However, with these approximations, the logarithm of Eq. (\ref{two term simplification}) gives 0.
So we must use the second order approximation $\ln(1+x) \simeq x - x^2/2$. This leads to:
\begin{align}
\label{Taylor expansion}
\ln[1 - P_f(\sigma)]
&\simeq N\ln[1 - P_1(\sigma)] + \ln[1 + N P_1(\sigma)]\\
&\simeq N \left( - P_1 - \frac{P_1^2}{2} \right) + NP_1
- \frac{(N P_1)^2}{2}\\
& = - N(N+1)\frac{P_1^2}{2}
\end{align}
The previous derivation shows that by adding the term $P_{S_1}$, the dominant term of $\ln[1-P_f]$ changed from $P_1(\sigma)$ to $[P_1(\sigma)]^2$, which will be immediately seen to have a huge effect on the tail of $P_f$. To obtain the Weibull scale plot, we multiply both sides by $-1$ and take again the natural logarithm; this yields:
\begin{equation}
\label{fishnet2}
Y^* = \ln[-\ln[1-P_f(\sigma)]] = \ln
\frac{N(N+1)}{2}
+ 2\ln P_1(\sigma)
\end{equation}
For comparison, the Weibull plot for the weakest-link model is
\begin{equation}
\label{Weibull}
Y^*=\ln[-\ln[1-P_f(\sigma)] ] = \ln N + \ln P_1
\end{equation}
Since the independent variable of Weibull plot is $X^*=\ln\sigma$, and $\ln P_1 \simeq \ln(\sigma^{m_0}) = m_0 \ln \sigma $, the slope of the Weibull plot for the Weibull distribution is the Weibull modulus $m_0$. Comparing the expressions of Eq.~(\ref{fishnet2}) and Eq.~(\ref{Weibull}), one can find that the slope of the far left tail of Weibull plot in the two-term fishnet model is changed from $m_0$ into $2m_0$, which is twice as steep as in the weakest link model.
\begin{figure}[!h]
\centering
\includegraphics[width=0.95\textwidth]{analyticalComparison.pdf}
\caption{a) Cumulative distribution function (cdf) of failure for a single truss element; b) Comparison between finite weakest link model and fishnet model with 2 terms in expansion (Weibull scale).}
\label{fig:analytical comparison}
\end{figure}
On the other hand, in the region where $P_{\Delta}$ is close to 0, i.e., for large enough $\sigma$, Eq.~(\ref{extension}) reduces to the weakest link model. Thus the addition of the term $P_{S_1}$ affects only the far left tail of the cdf of structural strength and has no effect on the right tail. Physically, this is because when $\sigma_N$ is very small (far below the mean), the links surrounding the failed link are generally strong enough to bear the redistributed load without breaking. But the weakest-link model characterizes this case as a failure of the whole structure, and this is why it overshoots $P_f(\sigma)$ when the load is small. However, when $\sigma_N$ is large (far above the mean), the survival probability of the links surrounding the failed one is very small, regardless of the failed link. So, on the far right tail, the two-term fishnet model is essentially the same as the weakest-link model.
Fig.~\ref{fig:analytical comparison}(b) shows the difference between the finite weakest-link model and the two-term fishnet model for the case in which $N=512$, $\eta_a^{(1)}=1.36$, $\nu_1=6$, and the cdf $P_1(\sigma)$ of structure strength is given in Fig.~\ref{fig:analytical comparison}(a). Note that $P_1(\sigma)$ is the Gaussian (or normal) distribution with a power law tail grafted at cumulative probability $P_1(\sigma)=0.015$. From Fig.~\ref{fig:analytical comparison}(b), one should note that the two-term fishnet model shows, in the Weibull plot, a smooth transition of slope from $m_0=38$ to $2m_0=76$. Note that, since the two-term fishnet statistics does not consider all the terms in Eq.~(\ref{general sum}), it is still an upper bound for the true $P_f(\sigma)$.
The difference between the weakest-link model and the two-term fishnet model is illustrated by the diagram in Fig.\ref{fig:analytical comparison}(b), in which $\sigma = 6.05$ MPa.
The probability calculated from the two-term fishnet model is $1.19 \cdot 10^{-6}$, whereas the value calculated from the weakest-link model is $2.95\times10^{-5}$. This is 24.8 times higher than the value obtained by the two-term fishnet model. This unexpected observation shows that when $\sigma$ is small, the weakest-link model gives a much too high prediction of failure probability, and the two-term fishnet model yields much higher estimates of failure loads, provided that the fishnet action indeed takes place.
\subsubsection{Location of the Slope Transition for the 2-Term Fishnet Statistics}
It is not enough to know that the left terminal slope in the Weibull plot is doubled. One needs to know also at which $\sigma$ value the slope transition is centered. According to Eq.~\ref{general sum}, this value is controlled by two parameters, $\eta_a^{(1)}$ and $\nu_1$. Here $\eta_a^{(1)}$ is the ratio of the average redistributed stress to the initial uniform stress, and $\nu_1$ is the number of links in the redistribution zone. To study the effects of these parameters, we fix one of them plot $P_{\Delta}$ for various values of the other. We consider $N = 512$ and $\nu_1 = 6$. The calculated plots of $P_{\Delta}$ and $P_f$ for $\eta_a^{(1)}=$ 1.1, 1.3 and 1.6 are given in Fig.~\ref{fig:Various Eta}.
\begin{figure}[!h]
\centering
\includegraphics[width=0.95\textwidth]{locationTransition.pdf}
\caption{a) Approximate position of transition for $\eta_a^{(1)}=$ 1.1, 1.3 and 1.6; b) Cumulative distribution function (cdf) of $P_f(\sigma)$ in Weibull scale with different 5$\eta_a^{(1)}$.}
\label{fig:Various Eta}
\end{figure}
\begin{figure}[!h]
\centering
\includegraphics[width=0.95\textwidth]{alphaTransition.pdf}
\caption{a) Approximate position of transition for $\nu_1=$ 6, 36, 216 and 512; b) Cumulative distribution function (cdf) of $P_f(\sigma)$ in Weibull scale with different $\nu_1$.}
\label{fig:Various alpha1}
\end{figure}
As the value of $P_{\Delta}$ varies from 0 to 1, the slope of cdf in Weibull scale gradually transits from $m_0$ to $2m_0$. Thus the center of the transition is the value $\sigma_T$ of $\sigma$ at which $P_{\Delta}(\sigma_T)=0.5$. So we set $P_{\Delta}=0.5$ for various values of $\eta_a^{(1)}$, and compare the $\sigma_T$ values. Shown in Fig.~\ref{fig:Various Eta}(a), they are seen match well with the kink locations in Fig.~\ref{fig:Various Eta}(b). Also note that the kink location shifts dramatically to the left when $\eta_a^{(1)}$ is increased from 1.1 to 1.6. Finally, as $\eta_a^{(1)} \to \infty$, the kink position approaches $\sigma_T=0$, which means that the fishnet degenerates into the weakest-link model---as long as 1 link fails, the stress in its neighborhood becomes infinitely large, then the structure must fail right after a single link fails.
Next, we fix $\eta_a^{(1)} = 1.2$ and let $\nu_1$ = 6, 36, 216 and 512. Note that, since $N = 512$, the largest $\nu_1$ value cannot exceed $512$. Similarly, as $\nu_1$ increases, the kink location shifts to the left, but the shift is much smaller than the change of $\eta_a^{(1)}$. Thus we conclude that the stress ratio $\eta_a^{(1)}$ has a big effect on the location of slope change from $m_0$ to $2m_0$, while $\nu_1$ has a much smaller effect.
\subsubsection{Three-Term Fishnet Statistics}
After a link fails, the next one to fail will be either a neighboring link or a link located farther away. Since these two events are mutually exclusive, we may write:
\begin{equation}
P_{S_2} = P_{S_{21}} + P_{S_{22}},
\end{equation}
where $P_{S_{21}}$ (or $P_{S_{22}}$) is the probability of $\{X = 2\}$ when the failed link is close to (or far away from) the previously failed link. Furthermore, the probability density function (pdf) characterizing $P_1(\sigma)$ is denoted as $\psi(\sigma) = \mbox{d} P_1(\sigma) /\mbox{d} \sigma$. If the second link failure after the original link failure happens in the neighborhood of the first one, we let $\nu_2$ be the number of links that will endure the redistributed stresses after 2 links (after the original one) fail and let the new stress ratio be $\eta^{(2)}~(note that \eta^{(2)}>\eta_a^{(1)}>0)$. In both foregoing cases, since there are only 2 failed links (after the original one), we still assume that the stress in the links far away from the failed ones remains undisturbed and equals the remotely applied stress $\sigma$ (this ceases to be valid if number of failed inks keeps increasing further). Thus we may write:
\begin{eqnarray}
\label{formulation of PS21}
P_{S_{21}} &=& {N \choose 1}{\nu_1 \choose 1}\int_{0}^{\sigma}\int_{x_1}^{\eta_b^{(1)} \sigma}\psi(x_1)\psi(x_2)dx_2dx_1\
[1-P_1(\sigma)]^{N-\nu_2-2}\ [1-P_1(\eta^{(2)} \sigma)]^{\nu_2}
\\
\label{formulation of PS22}
P_{S_{22}} &=& {N \choose 1}{N-\nu_1-1 \choose 1} \int_{0}^{\sigma}\int_{x_1}^{ \sigma}\psi(x_1)\psi(x_2)dx_2dx_1\
[1-P_1(\sigma)]^{N-2\nu_1-2}\ [1-P_1(\eta^{(2)}\sigma)]^{2\nu_1}~~
\end{eqnarray}
where $x_1$ is .... and
$\eta_b^{(1)}$ is a parameter calculated from $\eta_i^{(1)}$. This parameter is used by another approximate relation which is similar but different from that for $\eta_a^{(1)}$:
\begin{equation}
\label{new approximation}
\nu_1\int_{0}^{\sigma}\int_{x_1}^{\eta_b^{(1)} \sigma}\psi(x_1)\psi(x_2)dx_2dx_1 \simeq \sum_{j=1}^{\nu_1}\int_{0}^{\sigma}\int_{x_1}^{\eta_j^{(1)} \sigma}\psi(x_1)\psi(x_2)dx_2dx_1
\end{equation}
\begin{figure}[!h]
\centering
\includegraphics[width=0.85\textwidth]{integralSchematic.pdf}
\caption{a) Schematic showing the domain of integration when $\eta \geq 1$; b) domain of integration when $\eta<1$.}
\label{fig:integral schematic}
\end{figure}
Further note that
\begin{equation}
\int_{0}^{\sigma}\int_{x_1}^{ \sigma}\psi(x_1)\psi(x_2)dx_2dx_1=\frac{1}{2}[P_1(\sigma)]^2
\end{equation}
and then, according to Fig.~\ref{fig:integral schematic}(a),
\begin{align}
\int_{0}^{\sigma}\int_{x_1}^{\eta_b^{(1)} \sigma}\psi(x_1)\psi(x_2)dx_2dx_1
&= \int_{0}^{\sigma}\int_{x_1}^{ \sigma}\psi(x_1)\psi(x_2)dx_2dx_1
+\int_{0}^{\sigma}\int_{x_1}^{\eta_b^{(1)} \sigma}\psi(x_1)\psi(x_2)dx_2dx_1\\
&=\frac{1}{2}[P_1(\sigma)]^2+P_1(\sigma)[P_1(\eta_b^{(1)} \sigma)-P_1(\sigma)]\\
&=P_1(\sigma)P_1(\eta_b^{(1)} \sigma)-\frac{1}{2}[P_1(\sigma)]^2
\end{align}
Finally, we obtain
\begin{align}
\label{3-term fishnet}
P_{S_{21}} &= N \nu_1 \left\{ P_1(\sigma)P_1(\eta_b^{(1)} \sigma)-\frac{1}{2}[P_1(\sigma)]^2 \right\}\cdot[1-P_1(\sigma)]^{N-\nu_2-2} \cdot [1-P_1(\eta^{(2)} \sigma)]^{\nu_2}\\
P_{S_{22}} &= \frac{1}{2}N (N-\nu_1-1) [P_1(\sigma)]^2\cdot
[1-P_1(\sigma)]^{N-2\nu_1-2} \cdot [1-P_1(\eta^{(2)} \sigma)]^{2\nu_1}
\end{align}
So, considering three terms in Eq.~\ref{general sum}, we find the failure probability of fishnet to be
\begin{align}
1-P_f(\sigma)
&\simeq [1-P_1(\sigma)]^N \cdot \left\{ 1 + P_{S_1}/[1-P_1(\sigma)]^N + P_{S_2}/[1-P_1(\sigma)]^N \right\}\\
&=[1-P_1(\sigma)]^N \cdot \left\{ 1 + NP_1(\sigma)P_{\Delta}
+ N\nu_2\left[P_1(\sigma)P_1(\eta_b^{(1)} \sigma)-\frac{1}{2}[P_1(\sigma)]^2\right] P_{\Delta_{21}}\right.\\
& + \left. \frac{1}{2}N(N-\nu_1-1)[P_1(\sigma)]^2 P_{\Delta_{22}} \right\},
\end{align}
where
\begin{equation}
\label{estimation of PS2}
P_{\Delta} = \frac{[1-P_1(\eta_a^{(1)} \sigma)]^{\nu_1}}{[1-P_1(\sigma)]^{\nu_1+1}},~~~
P_{\Delta_{21}} = \frac{[1-P_1(\eta^{(2)} \sigma)]^{\nu_2}}{[1-P_1(\sigma)]^{\nu_2+2}},~~~
P_{\Delta_{22}} = \frac{[1-P_1(\eta_a^{(1)} \sigma)]^{2\nu_1}}{[1-P_1(\sigma)]^{2\nu_1+2}}
\end{equation}
Similar to $P_{\Delta}$, $\lim_{\sigma \to 0} P_{\Delta_{21}} = 1$ and $\lim_{\sigma \to 0} P_{\Delta_{22}} = 1$.
Note that the foregoing expression for $P_{S_2}$is is not exact expression only an approximate estimate because we simplified, in two steps, the stress redistribution as a uniform scaling of stress by factors $\eta_(b)^{(1)}$ and $\eta^{(2)}$. They are both greater than 1. In reality, however, some regions near the group of failed links get unloaded. These are regions in which the stress is smaller than the remotely applied stress $\sigma$. The failure probability of these regions is the integral of joint density over the domain shown in Fig.~\ref{fig:integral schematic}(b). This integral makes a more accurate solution very complicated, since stronger links could fail prior to the weaker ones if unloading happens in the weak links. Nevertheless, our estimation can still be quite accurate if $\eta_b^{(1)}$ is chosen properly, based on Eq.~(\ref{new approximation}).
Since the probability $P_{S_2}$ consists of two terms, namely $P_{S_{21}}$ and $P_{S_{22}}$, another interesting question arises: which one of these two terms is larger? Eq.~(\ref{formulation of PS21}) and Eq.~(\ref{formulation of PS22}) tell us that $P_{S_{21}}$ is proportional to $N[P_1(\sigma)]^2$, while $P_{S_{22}}$ is proportional to $N(N-\nu_1-1)[P_1(\sigma)]^2$, which approximately equals $N^2 [P_1(\sigma)]^2$. Therefore, $P_{S_{22}}$ is much larger than $P_{S_{21}}$. This means that the second link failure will most likely appear far away from the first one if the left tail of $P_1(\sigma)$ is relatively heavy but such that the effect of $[P_1(\sigma)]^2$ is still recognizable. This tendency to scattered damage will be discussed later.
\subsubsection{Ramifications to Higher-Order Terms in Failure Probability}
Intuitively, $P_{S_k}$ is proportional to $[P_1(\sigma)]^k$ when $\sigma$ is close to 0, and so Eq.~(\ref{general sum})is similar to a Taylor series expansion of some real function in terms of $P_1(\sigma)$. The higher the order, the smaller the contribution to the total sum. If the tail of $P_1(\sigma)$ is very light, $[P_1(\sigma)]^k$ for $k \geq 3$ are usually too small to be seen on the cdf directly. So, in order to see the effect of the higher order terms, we need, once again, to study them in the Weibull scale. This scale exponentially magnifies tiny differences in the tail of a distribution.
What will happen if we include more and more terms on the right-hand side of Eq.\ref{general sum}? Will they cause further slope increases in the Weibull plot? The answer is affirmative: The higher-order terms of survival probability would lead to further slope increase of cdf in the Weibull scale. From the derivation of Eq.~(\ref{Taylor expansion}), we know that the very reason for slope increase by the factor of 2 is that the term $P_1(\sigma)$ canceled out by Taylor expansion, allowing $[P_1(\sigma)]^2$ dominates. So, if there is another slope increase from $2m_0$ to $3m_0$, the square terms $[P_1(\sigma)]^2$ in Eq.~(\ref{Taylor expansion}) must vanish after adding more terms of $P_{S_k}$ in Eq.(\ref{general sum}).
In order to show that the slope of cdf could further increase due to the presence of more terms in the expansion of survival probability we must use the exact law of stress redistribution, otherwise it could lead to false conclusions. However, the exact law of stress redistribution is almost impossible to obtain analytically. Therefore, instead of working on a general fishnet, it is much easier if we consider a special form of it i.e. fiber bundle: by changing the aspect ratio $m:n$ gradually to $N:1$, a fishnet with a fixed number of links reduces to a fiber bundle. Then we can use the law of stress redistribution of a fiber bundle in derivation and study the slope change of cdf and the case for general fishnet is studied numerically by Monte Carlo simulations.
Now, consider a fiber bundle consisting of $N$ fibers and we truncate Eq.(\ref{general sum}) at $P_{S_2}$. Consequently $P_{S_0}$, $P_{S_1}$ and $P_{S_2}$ can be expressed as:
Similarly,
\begin{equation}
\int_{0}^{\sigma}\int_{0}^{N\sigma/(N-1)}\psi(x_1)\psi(x_2)dx_2dx_1=P_1(\sigma)P_1[N \sigma/(N-1)]-\frac{1}{2}[P_1(\sigma)]^2
\end{equation}
Therefore,
\begin{equation}
P_{S_2}=N(N-1)\left\{P_1(\sigma)P_1[N \sigma/(N-1)]-\frac{1}{2}[P_1(\sigma)]^2\right\}\left[ 1-P_1\left(\frac{N \sigma}{N-2}\right) \right]^{N-2}
\end{equation}
The probability of survival of the whole fishnet can then be expressed as:
\begin{equation}
1-P_f(\sigma) \simeq P_{S_0} + P_{S_1} + P_{S_2}
\end{equation}
Then we factor out $[1-P_1(\sigma)]^N$ and let $\sigma$ tends to 0:
\begin{equation}
1-P_f(\sigma) \simeq [1-P_1(\sigma)]^N \cdot \left\{ 1 + NP_1(\sigma) + N(N-1)P_1(\sigma)P_1[N \sigma/(N-1)]-\frac{N(N-1)}{2}[P_1(\sigma)]^2 \right\}
\end{equation}
By the same procedure, we take natural log on both sides and then use Taylor expansion of $\log(1+x)$ and collect all the terms of order smaller than $[P_1(\sigma)]^3$:
We can see that considering the term $P_{S_2}$ in Eq.~(\ref{general sum}) could make all the first and second order terms of $\log[1-P_f(\sigma)]$ vanish, which means $[P_1(\sigma)]^3$ dominates when $\sigma$ is small enough and the slope of cdf of fishnet failure in Weibull scale can increase by a factor of 3.
\subsubsection{Upper and Lower Bounds of Failure Probability of Fishnet}
As is already seen in previous sections, the fishnet possesses two geometrical limits i.e. chain (weakest link) and fiber bundle: the structure reduces to a chain if we set the aspect ratio to $m:n=1:N$ and to a fiber bundle if we set the ratio to $m:n=N:1$ (Loads are applied horizontally). Intuitively, given the same amount of links, a fiber bundle would be much more reliable than a single chain: failure of one link will not necessarily lead to rupture of the whole bundle. Therefore, we conjecture that the upper and low bounds of fishnet's failure probability should be that of a weakest link and fiber bundle consisting of the same number ($N$) of links, respectively (see Fig.~\ref{fig:Geometric Transform}). Furthermore, by assuming that $P_f(\sigma)$ changes continuously as the fishnet gradually transforms from a chain to a bundle, the failure probability decreases when the aspect ratio $m/n$ increases at a fixed value of the product $m\times n = N$ .
\begin{figure}[!h]
\centering
\includegraphics[width=0.6\textwidth]{Geometric_Transform.pdf}
\caption{Schematic showing the change of failure probability of fishnet by changing its aspect ratio $m/n$ gradually from $1:N$ to $N:1$.}
\label{fig:Geometric Transform}
\end{figure}
\section{\large Monte Carlo Simulation of Fishnet Failure}
\subsection{Setup of Finite Element Model}
To verify the theory, numerical Monte Carlo experiments are conducted by finite element simulations (in Matlab). In the finite element model (FEM) model, the size of rectangular fishnet is defined by its number of rows and columns $m \times n$. Each link is treated as an elastic truss element. All the elements (or links) have the same cross section area and Young's modulus, and differ only in their strength, $s_i$, which is a random variable that follows the probability distribution $P_1(\sigma)$. The nodes at the left fishnet boundary are fixed in $x$ direction but allowed to slide freely in the transverse $y$ direction. The fishnet is loaded under displacement control. The tensile load is applied by prescribing increments of a uniform displacement $u_0$ at the right boundary nodes while allowing transverse free sliding.
\subsection{Random Variable Generation}
Random variables $s_i$ are generated by the inverse-transform method. First, we use the random number generator in Matlab to generate random variables $x_i$ in the interval $[0,1]$, and then apply the inverse of $P_1$ to each $x_i$, i.e. $s_i=P_1^{-1}(x_i)$. Based on previous research\cite{BazLeBaz09}, $P_1(s)$ is defined by grafting a power-law left tail onto a Gaussian distribution.
The stiffnesses of links ($EA/l_e$) are not treated here as random variables. This is not a major simplification. To explain why not, consider an $m\times n$ fishnet with i.i.d. random stiffness $K_{i,j}$ for each link. Now, if the $x$-displacement at left boundary is zero and on the right boundary is $n u_0$, then the elongation of each link is $u_0$. So, if we pick any cross-section, the total force and nominal stress are:
\begin{equation}
\label{LLN}
P=u_0\sum_{r=1}^{m}K_r,~~~\sigma_N=\frac{u_0}{A}\left( \frac{1}{m}\sum_{r=1}^{m}K_r \right)
\end{equation}
where $K_r$ are the element stiffnesses along the $r$-th cross-section of fishnet, and $A$ is the cross-section area of each element. This means that the random variable $\sigma_N$ is proportional to the sample mean of $K_r$. According to the weak law of large numbers
the sample mean converges to true mean with probability 1 as $m\rightarrow \infty$. Intuitively, this means that given any form of the distribution of $K_{i,j}$, the nominal stress $\sigma_N$ always follows the law of a degenerate Gaussian distribution, i.e., the Dirac Delta function, centered at $\sigma_N=Ku_0/A$ if the cross-section contains a sufficiently large number of elements, where $K$ is the mean of $K_r$. Therefore, no matter what the distribution is for the stiffness of a single element, its influence on the randomness of nominal strength negligible. This is also true if the fishnet is slightly damaged, because we can always find a cross-section that is sufficiently far away from the zone of failed links. Indeed, the elongation of these elements on the chosen cross-section is still approximately $u_0$, which means that Eq.~(\ref{LLN}) still holds. Therefore, it suffices to randomize strength of each link while considering the element length, elastic modulus and cross-section area as deterministic.
\subsection{Element Deletion and Propagation of Cracks}
The time steps are indexed by the total number ($k$) of failed links. At the beginning of time step $k$, we set $u_0=1$ and calculate the stresses of each element $\sigma_j^{(k)}$. Then the only element, indexed by $i$, that is going to fail in this new time step is the one whose stress satisfies the condition:
\begin{equation}
\lambda^{(k)}=s_i/\sigma_i^{(k)}=\min_j\ \{s_j/\sigma_j^{(k)} \}
\end{equation}
where $s_j$ is the strength of the $j^{th}$ element. Since the constitutive law is linear elastic, $\lambda^{(k)}$ is the load multiplier such that if we reset $u_0 = \lambda^{(k)}$ and recalculate the stress field, we will have $\sigma_i^{(k)} = s_i$ and $\sigma_j^{(k)} < s_j$~for~$i\neq j$. So the final stress state of each element at the current time step is calculated by $\sigma_{j_{\text{new}}}^{(k)} = \lambda \ \sigma_i^{(k)}$. After updating the stresses, the critical $i^{th}$ element is deleted, and its element stiffness matrix $\bm{K}_{e^i}^{(k)}$ will not be assembled into the global stiffness matrix $\bm{K}^{(k)}$ for future loading steps. This process keeps going until the global stiffness matrix becomes singular, which means that a crack has already gone through the cross-section and the fishnet has failed.
Indexing the time steps by the number of failed links allows us to obtain not only the peak load but also the complete load-displacement curve without worrying about stability issues. In fact, the load-displacement curve of elastic fishnet shows a strong snap-back instability, as discussed paper.
\subsection{Results of FE Simulation}
Fig.~\ref{fig:FE Simulation}(a) shows the load-displacement curve of a typical result of FE simulation on $16 \times 32$ fishnets with random strength. The distribution of random strength is a Gaussian distribution $N\sim(10,0.4^2)$ grafted with a power law tail at $P_1(\sigma)=0.015$. Often, peaking of the load and a strong snap-back instability is observed right already before the rupture of the first or second link. This is no surprise because, if there is no randomness in strength, the fishnet will reach the maximum load (and fail) as soon as any one of the links succumbs.
So it is the strength randomness that makes it possible for the whole structure to survive after failure of a few links. On the other hand, in real nacreous materials, in which the shear connections between the lamellae do not act locally as pin nodes and resist bending moments, a few links (or shear connections) will probably have to break before the maximum load is reached. This would be similar type I failure in brittle heterogenous materials, in which several microcracks between grains must form in a representative volume element (RVE) before a macrocrack propagation from the RVE is initiated. Thus it might be necessary to generalize the present theory by stipulating that a certain small number of links forming an RVE must break before the maximum load is reached. This means that the true nacreous behavior would ba a transition from Type I fracture to a fishnet fracture. Such a generalization, however, must be relegated to further work.
\begin{figure}[!h]
\centering
\includegraphics[width=0.98\textwidth]{loadDispFishBlock.pdf}
\caption{a) Load-displacement curve of a $16\times32$ fishnet with random strength together with its crack pattern; (b) Stress evolution as crack propagates through the fishnet (the darker the color, the larger the normalized stress $\sigma/\sigma_{max}$), where $k$ is the number of failed links.}
\label{fig:FE Simulation}
\end{figure}
Fig.~\ref{fig:FE Simulation}(b) illustrates the stress field of 4 typical fishnet frames ($k=1,~2,~8,~15$) in the process of crack propagation. In this particular case, subsequent failures localize immediately after the crack initialization, and no scattered damage is observed. One can see that the crack path in this case has a strong tendency to move vertically and form a cross-section, even though the crack path is random. Another observation is that as crack propagates, sharper contrast of darkness in the figures are seen, meaning that the difference between maximum stress $\sigma_{max}$ and nominal stress $\sigma_N$ becomes larger and larger, making the whole structure even weaker.
\subsection{Verification of Fishnet Theory}
Millions of finite element simulations are run to verify the fishnet statistics. The criterion of convergence is set as follows: First we consider the curve of the estimated distribution obtained from many runs of fishnet sample of size $n_1$ in Weibull scale. Then we increase the sample size $n_1$ by one and consider the curve of the newly estimated distribution. The part of the curve that does not change much upon doubling the sample size is considered as converged.
To obtain an accurate estimate of the distribution, especially in its left tail, at least on million ($10^6$) samples have been computed for each case. Based on this scenario, the distribution estimated from the histogram of the results of all computer runs converges very well to the exact distribution in the region $Y = \ln[-\ln(1-P_f)] > - 10$ in Weibull scale. This corresponds to the interval $4.54\times10^{-5} \leq P_f <1$.
\subsubsection{Two-Term Fishnet Model}
\begin{figure}[!h]
\centering
\includegraphics[width=1\textwidth]{histogramPG.pdf}
\caption{(a) Histogram of Monte Carlo Experiment of $10^6$ samples (frequency is normalized to probability density) on $16 \times 32$ fishnets compared with the density functions of weakest link model and 2-term fishnet model; (b) Same data converted into cumulative probability and plotted in Weibull scale.}
\label{fig:histogramPG}
\end{figure}
When $P_1(\sigma)$ is a Gaussian $N(10,0.8^2)$ grafted with a power law tail at $P_f=0.015$, its tail is relatively light and 2-term fishnet model works very well. The expression of $P_1(\sigma)$ is chosen as
\begin{equation}
\label{P1 PG}
P_1(\sigma) =
\begin{cases}
0.11338\cdot (\sigma/10)^{38}, & \sigma \leq 8.4~MPa\\
0.015 + \left\{0.481 - 0.504\cdot\text{Erf}[0.884 (10 - x)]\right\}, & \sigma>8.4~MPa
\end{cases}
\end{equation}
where
\begin{equation}
\text{Erf}(x)=\frac{2}{\sqrt{\pi}}\int_{x}^{\infty}e^{-t^2}dt.
\end{equation}
Fig.~\ref{fig:histogramPG}(a) shows the estimated probability density function (pdf), $p_f(\sigma) = \mbox{d} P_f(\sigma)/ \mbox{d} \sigma$, obtained from the histogram of Monte Carlo simulations, and compares this pdf with the prediction of the weakest-link model (black dashed line) and of the two-term fishnet model (red continuous line). These two predictions are almost indistinguishable in the range $\sigma>6.7 MPa$ and match very well the Monte Carlo experiments. However the difference shows up in the tail ($\sigma \leq 6.7 MPa$). Indeed, the two-term fishnet model fits the Monte Carlo data much better than the classical weakest-link model. The difference is more obvious when it is plotted in Weibull scale (Fig~\ref{fig:histogramPG}(b)): the results of Monte Carlo simulations match the two-term fishnet model everywhere in the figure, while the weakest link model works well only in the range $\ln\sigma>1.9$.
\subsubsection{Three-Term Fishnet Model}
The effect of $P_{S_2}$ in Eq.~(\ref{general sum}) becomes more significant if the tail of $P_1(\sigma)$ gets heavier. Now consider the case where $P_1(\sigma)$ is a grafted distribution of Gaussian $N(10,0.8^2)$ and a power law tail with the grafting point $P_f(\sigma)=8.955\%$:
\begin{equation}
\label{P1 WG}
P_1(\sigma) =
\begin{cases}
2.551 \cdot \left[ 1-e^{-(\sigma/12)^{10}} \right], &
\sigma \leq 8.6~MPa\\
0.08955 + \left\{ 0.436 - 0.474\cdot \text{Erf}[0.884 (10
- x)] \right\}, & \sigma>8.6~MPa
\end{cases}
\end{equation}
To see the effect on the left tail "thickness", we calculate that, for $\sigma=6.7 MPa$, a change of the grafting point from $P_1(\sigma) = 0.1\%$ to $P_1(\sigma) = 9\%$ increases $P_1$ from $2.79\times10^{-6}$ to $7.5\times10^{-3}$ (note that these grafting point values are much higher than what was identified for particulate composites \cite{BazLe17}). This increase makes the tail much "thicker" than in the previous case. Once again, for this particular strength distribution $P_1(\sigma)$ of a single element, and for the $16 \times 32$ fishnet, one million samples of Monte Carlo simulations have been obtained.
\begin{figure}[!h]
\centering
\includegraphics[width=1\textwidth]{histogramWG.pdf}
\caption{(a) Histogram of Monte Carlo Experiment of $10^6$ samples (frequency is normalized to probability density) compared with the probability density functions of weakest link model, 2-term and 3-term fishnet model; (b) Same data converted into cumulative probability and plotted in Weibull scale.}
\label{fig:histogramWG}
\end{figure}
Fig.~\ref{fig:histogramWG} shows the estimated density function of $P_f$ with $P_1(\sigma)$ as mentioned above and its comparison with the predictions of the weakest link model, 2-term (Eq.~(\ref{extension})) and 3-term (Eq.~(\ref{3-term fishnet})) fishnet model. We can see that the weakest link model gives a poor prediction of failure probability, while the fishnet models are much better. Note that, as more and more terms of $P_{S_k}$ are considered in the fishnet model, the skewness of the corresponding distribution becomes smaller and smaller. From Fig.~\ref{fig:histogramWG}(b), all of the three predictions are upper bounds of the true failure probability. As $\sigma$ decreases, the Monte Carlo results begin to deviate from the two-term fishnet model and a further slope increase is observed. As we see, the three-term fishnet model gives the best prediction. To get a still more accurate prediction, we would need to consider the next term, $P_{S_3}$, or even more terms, in the expansion of Eq.~(\ref{general sum}).
\subsubsection{Scattered Damage vs. Localized Damage}
The previous Monte Carlo simulations show that changing the tail of strength distribution of a single link could have a huge effect on the failure probability of the whole structure. To explain it intuitively, we run finite element simulations for a $32\times32$ square fishnet for two different strength distributions of a single link $P_1(\sigma)$ and $P_1^*(\sigma)$, where $P_1(\sigma)$ is the Gaussian distribution grafted with a light power law tail (Eq.~(\ref{P1 PG})) and $P_1^*(\sigma)$ is the one with a heavy Weibull tail (Eq.~(\ref{P1 WG})).
\begin{figure}[!h]
\centering
\includegraphics[width=0.95\textwidth]{stressEvolutionHeavyPG.pdf}
\caption{Stress evolution of a $32\times32$ square fishnet whose strength distribution of a single link is $P_1$, which has a thin power law tail. In each figure, the stress is normalize by the maximum $\sigma_{max}^k$ of that moment. Pure black corresponds to $\sigma_{max}^k$ and pure white corresponds to zero stress.}
\label{fig:stress evolution heavy PG}
\end{figure}
First, consider the case of $P_1(\sigma)$. A typical simulation result is shown in Fig.~\ref{fig:stress evolution heavy PG}$(a)\sim (e)$. Due to the fact that $P_1(\sigma)$ has a very thin power law tail, the probability that there exists an extremely weak link is vanishingly small. Therefore, in most cases, the peak load is reached right before the first rupture. Then the successive failures localize and form a single crack. This means that, with a very high probability, the failure of structure is the result of rupture of a single link. Then the weakest link model predicts the $P_f$ quie accurately, as long as $\sigma$ is not too small.
\begin{figure}[!h]
\centering
\includegraphics[width=0.95\textwidth]{stressEvolutionHeavy.pdf}
\caption{Stress evolution of a horizontally pulled $32\times32$ square fishnet in which the strength distribution, $P_1^*$, of a single link has a thick Weibull tail. In each figure, the stress is normalized by the maximum $\sigma_{max}^k$ reached at that moment. Perfect black corresponds to $\sigma_{max}^k$ and perfect white corresponds to zero stress.}
\label{fig:stress evolution heavy WG}
\end{figure}
The scenario gets more complicated as the tail of $P_1$ becomes thicker. Very likely, a few fishnet links have a very low strength and their failures will affect the fishnet strength very little. Moreover, these very weak links are scattered through the whole fishnet. As the loading of fishnet begins, these weakest links will fail successively at very small nominal stresses, while the rest of the "normal" links are still sound and safe. As long as the first few damages are scattered, the stress field will keep to be almost uniform except near these failed links. In this case, the failure of one or two links need not lead to the failure of the whole structure, and the weakest-link model two-term fishnet models cannot give good estimates of $P_f$. This is exactly why we need to consider more higher-order terms in the formula (Eq.~(\ref{general sum})) of survival probability.
Fig.~\ref{fig:stress evolution heavy WG} (a)--(e), shows the typical pattern of stress evolution when the strength distribution of links, $P_1^*(\sigma)$, has a thicker Weibull tail. In this particular case, the damage zone does not localize until the fifth rupture, ossurring just after the peak load is reached. Once the damages start to localize, the stress concentration at the crack front will only get higher and higher, making the rest of the links bear smaller and smaller stresses and next failures more likely to localize. Consequently, the nominal stress keeps decreasing. In this process, damage localization offers a positive feedback to the system: the current localization leads to a higher stress concentration, making the next failure more likely to localize. Such a process keeps going until the structure fails. Eventually the stability of fishnet (under load control) is lost and the peak load occurs right at the moment of damage localization, which depends strongly on the "heaviness" of the tail of $P_1(\sigma)$.
\subsubsection{Transition from Chain to Bundle (Shape Effect)}
Based on the fact that the peak load is most likely reached at the onset of damage localization helps to decide how many terms of $P_{S_k}$ are needed to get an accurate enough prediction of $P_f$: For a given $P_1(\sigma)$ of strength distribution of links and a given size and shape of fishnet, the approximate number of terms we need to add in the fishnet model should be greater than the average number of scattered failures before localization, and the more terms get added, the more accurate the estimation will be in the tail of $P_f$.
It thus becomes clear that the fiber bundle must give the lower bound on the strength of all fishnets consisting of the same number of links. The fiber bundle has the largest cross section, and no stress concentration. So the stability limit of a bundle is reached the latest and each term $P_{S_k}$ is the largest among all fishnets. Therefore we have to consider most terms $P_{S_k}$ in the expansion of survival probability Eq.~(\ref{general sum}) so as to get an accurate estimation of $P_f$. Hence, the survival probability, $1-P_f$, of a bundle is the upper bound for those of all fishnets and, accordingly, the failure probability, $P_f$, of a bundle is the lower bound on all the failure probabilities of all fishnets.
\begin{figure}[!h]
\centering
\includegraphics[width=0.95\textwidth]{transitionFishnet.pdf}
\caption{a) Monte Carlo simulations showing the transition of $P_f$ as aspect ratio of fishnet is changed from $1\times N$ to $N \times 1$; b) Same data plotted in Weibull scale.}
\label{fig:transition fishnet}
\end{figure}
Fig.~\ref{fig:transition fishnet} shows the transition of failure probability $P_f$ of fishnets of various aspect ratios, consisting of the same number, $N$, of links. The circles with different colors corresponds to results of Monte Carlo simulations.
Since we want to verify only the qualitative effect of aspect ratio on $P_f$, we reduce the sample size from $10^6$ to $2\times10^5$. Accordingly, we focus only on the range $\ln[-\ln(1-P_f)] \geq -6$, in which the histogram has converged quite close to the true distribution.
As shown in the figure, the
weakest link model (black dashed line) is the strict upper bound of all fishnets with the same number of links, and the fiber bundle (dark blue dashed line)
is the strict lower bound. When the fishnet is long and thin, for example $m \times n = 2 \times 128$ (dark red circles), the corresponding $P_f$ can be described quite well by the two-term Fishnet model, which shows a gradual slope increase by a factor of 2 as $\sigma_N = \sigma$ tends to 0.
This last case might look similar to the real nacre shell, which is much longer than wide. However, in nacre shells and similar structures, the highly stressed zone of often highly localized, as in bending, and then the shell may rather behave as our fishnet with a similar length and width (the statistics of fishnets under flexure, or transverse stress gradient, as well as the statistics of three-dimensional fishnet generalization, would probably be similar, but its study must be relegated to a subsequent article).
Returning to the uniformly stressed long and narrow fishnet, it cannot be described adequately by the two-term fishnet, because this model applies if only one additional link fails before the maximum load.
The higher-order terms in the expansion of $P_f$ matter. Although they are hard to calculate analytically, insight can be gained by Monte Carlo simulations. We run simulations for fishnets of size $64 \times 16$ and $16 \times 64$, and then count the average number $r_p$ of scattered link failures before the peak load is reached (the distribution of $r_p$ should in fact lead to the Poisson distribution with rate parameter $\mu_p$ when total number of links $N\rightarrow \infty$). For fishnets of size $64 \times 16$, $\mu_p \simeq 5.2$, while $\mu_p \simeq 4.4$ for fishnets of size $16 \times 64$. This shows that more terms of $P_{S_k}$ are needed for short and wide fishnets than for the long and narrow ones. Due to the fact that the laws of stress redistribution around scattered failures are almost identical, the common terms of $P_{S_k}, k \leq k_0$ in $P_f$ for both fishnets are almost the same. The only difference is that the next few terms $P_{S_k}, k > k_0$ for the short and wide fishnets are much larger than those for the long and narrow ones. The cause is the delay of damage localization.
\subsection{Comparison with the Chain of Bundles}
Attempts have previously been made \cite[e.g.]{Har78I,Har78II,Wei15} to use a chain of fiber bundles to model the failure probability of fiber composites under uniaxial tension. A long specimen under uniaxial tension is subdivided, by imagined cross sections of an assumed spacing, into fictitious segments, each of which is modeled as a fiber bundle. This is an approach that has physical basis in the microstructure of a fiber composite but not of nacre-like materials.
If a fiber bundle with equal load sharing is represented mechanically by loading through rigid platens, each parallel coupling reduces the reach of a power law tail by about one order of magnitude \cite{BazPan06, BazLe17}. For 10 parallel fibers, the distribution becomes Gaussian except for a power law (or Weibull) tail reaching to the probability of only about $10^{-20}$. The parallel couupling of fibers extends the reach of the Weibull tail \cite{BazPan06, BazLe17}, but about $10^{22}$ bundles in the chain would be needed to approach the Weibull distribution expected for a very long structure. Obviously, such mechanics based equal load-sharing hypothesis gives clearly unreasonable predictions.
The problem with power law (or Weibull) tail shortening is avoided by some convenient, non-mechanical, purely intuitive, load-sharing rules for the transfer of load from a failed fiber to its neighbors. A convenient load-sharing rule can give a very different probability distribution $G_n$ for each bundle, with a realistic reach of power law tail. Like the fishnet, a chain of bundles, each with a suitable $G_n$, can then predict, for low probabilities, a reasonable slope increase in the low-probability range of Weibull plot, as shown by Harlow and Phoenix \cite{Har78I,Har78II}.
In the fishnet model, by contrast, this slope decrease is due to the addition of non-zero probability $P_{S_k}$ of structure survival after a failure of $k$ links. The slope of $P_f$ will increase, at least by a factor of 2, due to adding the first term, $P_{S_1}$. As mentioned before, adding more terms $P_{S_k}$ increases the slope further. Importantly, no separate hypothesis about transverse load sharing or redistribution is needed in the fishnet model to get the above result.
\section{\large Conclusions}
\begin{itemize} \setlength{\itemsep}{-1.5mm}
\item Based on similar mechanical responses, nacre-like imbricated laminar materials under uniaxial tension can be modelled as fishnets with square holes pulled in the diagonal direction.
\item Severe stress redistribution around isolated damages of fishnets are confined in their close neighborhood, but greatly affect the failure probability.
\item Assuming the link strength values in a $m \times n$ fishnet to be i.i.d. random variables characterized by failure probability $P_1(\sigma)$, one can express the fishnet failure probability as a finite series $P_f(\sigma)= 1 - \sum_{k=0}^{m(n-1)} P_{S_k} (\sigma)$ in which $P_{S_k}(\sigma)$ is the probability of the event that total of $k$ links have failed while the structure is still safe, while $P_{S_0}$ corresponds to the classical survival probability of a chain with $m\cdot n$ links. Apart from the first term in the series, the remaining terms tend to 0 as $\sigma$ approaches $\infty$ and tend to $c_k [P_1(\sigma)]^k$ as $\sigma$ approaches to 0. Consequently, in the upper tail $P_f$ is essentially the same as the tail of weakest link model while in the lower tail, $P_f$ exhibits a major deviation from the weakest link model and curves downward in the Weibull scale.
\item As $\sigma$ decreases, the slope of $P_f$ in the Weibull plot gets steeper by a factor of 2 due to the effect of $P_{S_1}$. The center of transition to increased slope depends on the level of stress concentration near the failed link. A higher stress concentration causes the transition to happen at smaller $\sigma$. The further term in the expansion cause smaller and smaller increases of slope of $P_f$ in Weibull plot, and the subsequent slope transitions are centered at smaller $\sigma$ values, due increasing stress concentration.
\item The fishnet probability $P_f$ exhibits strong shape effects. By changing the aspect ratio $m/n$ from $1/N$ to $N/1$, a fishnet gradually transforms from a chain to a fiber bundle, and the corresponding failure probability transits smoothly from the Weibull distribution to the Gaussian (or normal) distribution. When the shape $m\cdot n$ is fixed, a larger value of $m/n$ corresponds to a strictly smaller $P_f$ for all $\sigma$. So, when $m \cdot n$ is fixed, the weakest-link model and fiber bundle model give, respectively, the strict upper and lower bounds of the failure probability, $P_f$.
\item There is a strong size effect, similar to, though different from, the Type 1 quasibrittle size effect characterizing particulate or granular materials and fiber composites.
\end{itemize}
| {'timestamp': '2017-07-11T02:02:51', 'yymm': '1706', 'arxiv_id': '1706.01591', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01591'} | arxiv |
\section{Introduction}
Critical infrastructures such as power grids and transportation systems
are witnessing growing adoption of modern information and communication technologies (ICTs) for autonomous operation. While these advancements have improved their operational efficiency, ICTs may also make them vulnerable to cyber attacks. Vulnerabilities in ICT systems were exploited in recent high-profile cybersecurity incidents such as the BlackEnergy \cite{Ukraine2016} and Dragonfly \cite{dragonfly2014} attacks against power grids and the Stuxnet worm \cite{karnouskos2011} against nuclear plants. These attacks injected false sensor data and/or control commands to the industrial control systems and resulted in widespread damage to the physical infrastructures and service outages. These incidents alert us to a general class of attacks called {\em false data injection} (FDI) against cyber-physical systems (CPS).
Attack detection and mitigation are two basic CPS security research problems, where the {\em attack detection} makes decisions in real time regarding the presence of an attack and {\em attack mitigation} isolates a detected attack and/or reduces its adverse impact on the system performance.
CPSs often have various built-in anomaly detection methods that are effective in detecting simple fault-like FDI attacks, such as injecting surges, ramps, and random noises. However, critical CPSs (e.g., power grids)
are the target of sophisticated attackers (such as hostile national organizations),
whose attacks are often well-crafted using detailed knowledge of the system and its anomaly detection methods. To avoid detection, the attacker can inject a sequence of attacks of small magnitude and gradually mislead the system to a sub-optimal and even unsafe state.
However, due to the stochastic nature of the physical and measurement processes of CPSs, as well as the adoption of stringent, advanced attack detectors, the well-crafted attacks can be detected probabilistically \cite{Mo2015, vu2016}. Upon detecting an attack, mitigation should be activated to isolate the attack or maintain acceptable system performance in coexisting with the attack.
Therefore, attack detection and mitigation are deeply coupled and they jointly define the system resilience against FDI attacks. On the one hand, a conservative detector may miss attacks, causing system performance degradation due to the mis-activation of attack mitigation. On the other hand, an aggressive detector may frequently raise false positives, triggering unnecessary mitigation actions in the absence of attacks, while attack mitigation generally needs to sacrifice the system performance to increase its robustness against attacks. Thus, it is important to understand the joint effect of attack detection and mitigation on the system performance, which serves as a basis for designing satisfactory detection-mitigation mechanisms.
However, prior research on FDI attacks mostly study attack detection and mitigation separately \cite{LiuKwonHwang2012,Kwon2013,Mo2015,BaiGupta2014}, and falls short of capturing their joint effect on the system. The studies on attack detection \cite{LiuKwonHwang2012,Kwon2013,Mo2015} generally ignore the attack mitigation triggered by probabilistic detection of attacks, and its impact on the future system states. On the other hand, the studies on attack mitigation \cite{Barreto2013, Ma2013, ZhuBasar2015} assume that the attack has been detected, and ignore the probabilistic nature of the attack detection and any adverse impact of mis-activation or false activation of mitigation due to misdetections and false alarms.
As an early (but important) effort in closing the gap, we jointly consider attack detection and mitigation in the system defense. In particular, we study their joint effect from an attacker's perspective and investigate the largest system performance degradation that a sophisticated attacker can cause in the presence of such a detection-mitigation defense mechanism. Studying this largest performance degradation helps us quantify the limit of attack impact, and serves as an important basis for designing/comparing detection and mitigation strategies to protect critical infrastructures.
However, the attacker faces a fundamental dilemma in designing his attack -- a large attack magnitude will result in high detection probability, thus nullifying the attack impact on the system (due to mitigation) whereas a small attack magnitude increases stealthiness but may do little damage. To achieve a significant impact, the attacker's injections must strike a balance between magnitude and stealthiness.
In this paper, we consider a general discrete-time linear time invariant (LTI) system with a feedback controller that computes its control decision based on the system state estimated by a Kalman filter (KF). For each time step, the controller uses a $\chi^2$ attack detector \cite{MEHRAChiSquare1971}, and activates mitigation actions upon detecting an attack.
Following the Kerckhoffs's principle, we consider an attacker who accurately knows the system and its attack detection and mitigation methods. The attacker launches FDI attacks on the sensor measurements over an attack time horizon, aiming at misleading the controller into making erroneous control decisions. As the attack detection at each time step is probabilistic, we formulate the attacker's problem as a constrained stochastic optimization problem with an objective of maximizing the state estimation error over the attack time horizon,
subject to a general constraint that the energy of the attack signal is upper-bounded. The solution to this problem naturally leads to an attack sequence that strikes a balance between attack magnitude and stealthiness to achieve the largest system performance degradation.
The main challenge in solving the aforementioned attacker's problem lies in the fact that the system state
at any time depends on all the past attack detection results, due to reactive attack mitigation. Thus, the optimal attack at any time must exhaustively account for all possible sequences of past detection results, which is computationally complex. Moreover, the probabilistic attack detection introduces additional randomness into the system dynamics. Our key observation to overcome these issues is that the system dynamics is Markovian and the attacker's injections at any time can be computed based on knowledge about it, which captures the impact of all the past detection results. To summarize, the main contributions of our work are as follows:
\begin{itemize}
\item We solve the aforementioned attacker's problem using a Markov decision process (MDP) framework. In our formulation, the sequential operations of probabilistic attack detection and mitigation are mapped to the MDP's state transition probabilities. The MDP is solved by state space discretization and using the \emph{value iteration} algorithm \cite{Puterman:1994}.
\item To illustrate our analysis, we use a real-world CPCS -- power grid voltage control -- as our case study. The voltage controller adjusts the pilot bus voltages to predefined setpoints based on voltage measurements by applying feedback control on the generators' reactive power outputs.
In the presence of attack mitigation, the attacker injects false measurements into the system, aiming at deviating the pilot bus voltages.
Extensive simulations using PowerWorld, a high-fidelity power simulator, show that the optimal attack sequence
computed using our proposed approach causes the maximum deviation of the pilot bus voltages from the desired setpoint.
\item Based on the above framework, we also consider the problem of designing the detection threshold
from the defender's perspective. To this end, we quantify the impact of false positives (FP) and misdetections (MD) via an extensive simulation-based study. Based on these costs, the attack detection threshold can be tuned to balance the performance downgrades due to FPs and MDs depending on the accuracy of the mitigation signal.
\end{itemize}
The remainder of the paper is organized as follows. Section~\ref{sec:Related} reviews related work.
Section~\ref{sec:Sys_Model} describes the system model. Section~\ref{sec:Threat_Model} gives the problem formulation.
Section~\ref{sec:Soln_Methods} describes the MDP-based solution methodology.
Section~\ref{sec:MD_FP} analyzes the impact of FPs and MDs on the system performance.
Section~\ref{sec:Sim_Res} presents the simulation results. Section~\ref{sec:Conclusion} concludes.
\begin{figure*}[!t]
\centering
\includegraphics[width=0.62\textwidth]{Figures/system_block_diagram}
\caption{Block diagram of the system model.}
\label{fig:sys_model}
\end{figure*}
\section{Related Work}
\label{sec:Related}
As mentioned earlier, most of the existing studies treat attack detection and mitigation problems separately.
In the category of attack detection,
the performance degradation caused by stealthy attacks in a noiseless LTI system
has been analyzed \cite{Pasqualetti2013, FawziTAC2014}. Any deviation from the expected state trajectory in the deterministic system can be considered a fault or an attack.
However, non-determinism and measurement noises experienced by real-world systems provide an opportunity for the attacker to masquerade his attack as natural noises, thereby rendering attack detection probabilistic.
Research \cite{LiuKwonHwang2012}, \cite{Kwon2013}, and \cite{Mo2015} has studied
the impact of stealthy false data injection (FDI) attacks against stochastic LTI systems, and derived optimal attack sequences that can cause the worst system performance degradation. Bai and Gupta \cite{BaiGupta2014} characterize a fundamental trade-off between the stealthiness level of an attack and the system performance degradation. However, these studies \cite{LiuKwonHwang2012,Kwon2013,Mo2015,BaiGupta2014} generally ignore the attack mitigation triggered by probabilistic detection of attacks and its impact on the future system states and attack detection.
In the category of attack mitigation, preventive and reactive mitigation strategies have been proposed \cite{Combita2015}. Preventive mitigation identifies vulnerabilities in the system design and removes them to prevent exploitation by attackers. For instance, in a power system,
a set of sensors and their data links can be strategically selected and protected such that a bad data detection mechanism cannot be bypassed by FDI attacks against other sensors and their links that are not protected~\cite{Bobba2010, Dan2010}.
However, preventive mitigation provides static solutions only, which do not address the adaptability of strategic and knowledgeable attackers against critical infrastructures. Thus, in addition to preventative mitigation, it is important to develop reactive attack mitigation, i.e., countermeasures that are initiated after detecting an attack and tune the system based on the estimated attack activities. Reactive attack mitigation is mainly studied under game-theoretic settings \cite{Barreto2013, Ma2013}. Specifically, the attacker manipulates a set of sensor/control signals and aims at disrupting the system operation, while the defender responds by tuning the remaining system parameters to negate the attack or minimize its impact. However, most studies on reactive mitigation (e.g., \cite{Barreto2013, Ma2013, ZhuBasar2015}) assume that the attack has been detected, and ignore the impact of uncertain attack detection on the overall attack mitigation.
In contrast, our framework captures the interdependence between the
attack detection and mitigation, and their joint impact on the system's dynamics and performance.
\section{Preliminaries}
\label{sec:Sys_Model}
\subsection{System Model}
A block diagram of the system model is illustrated in Fig.~\ref{fig:sys_model}.
We consider a general discrete-time LTI system that evolves as
\begin{align}
{\bf x}[t+1] &= {\bf A} {\bf x}[t] + {\bf B} {\bf u}[t] + {\bf w}[t], \label{eqn:process}
\end{align}
where ${\bf x}[t] \in \mbox{\bb R}^{n}$ is the system state vector,
${\bf u}[t] \in \mbox{\bb R}^{p}$ is the control input, and ${\bf w}[t] \in \mbox{\bb R}^{n}$ is the process noise at the $t$-th time slot. Matrices ${\bf A}$ and ${\bf B}$ denote the propagation and control matrices, respectively.
The initial system state ${\bf x}[0]$ and process noise ${\bf w}[t]$ are independent Gaussian random variables. Specifically, ${\bf x}[0] \sim \mathcal{N} (\bf{0},{\bf X})$ and ${\bf w}[t] \sim \mathcal{N} (\bf{0},{\bf Q}),$ where $\mathbf{0} = [0, \ldots, 0]^T$ and $\mathbf{X}$ and $\mathbf{Q}$ are the covariance matrices.
The process described in \eqref{eqn:process} is observed through sensors deployed in the system, whose
observation at time $t$, denoted by ${\bf y}[t] \in \mbox{\bb R}^m$, is given by
\begin{align}
{\bf y}[t] &= {\bf C} {\bf x}[t] + {\bf v}[t], \label{eqn:Obs}
\end{align}
where ${\bf C} \in \mbox{\bb R}^{m \times n}$ is the measurement matrix and ${\bf v}[t] \sim \mathcal{N} (\bf{0},{\bf R})$ is the measurement noise at time $t$ and ${\bf R}$ is the covariance. We assume that ${\bf v}[t]$ is
independent of ${\bf x}[0]$ and ${\bf w}[t].$
Moreover, we assume that the system in \eqref{eqn:process} is controllable and the measurement process in \eqref{eqn:Obs} is observable.
The controller uses a Kalman filter (KF) to estimate the system state based on the observations. The KF works as follows \cite{kailath2000linear}:
\begin{align}
\hat{{\bf x}} [t+1] \!=\! {\bf A} \hat{{\bf x}}[t]\! +\! {\bf B} {\bf u}[t] \! +\! {\bf K} ({\bf y} [t+1]\! -\! {\bf C} ({\bf A} \hat{{\bf x}}[t]\! +\! {\bf B} {\bf u}[t])), \label{eqn:KF_est_nomit}
\end{align}
where $\hat{{\bf x}}[t]$ is the estimate of the system state, ${\bf K}$ denotes the steady-state Kalman gain given by ${\bf K} = {\bf P}_\infty {\bf C}^T({\bf C} {\bf P}_\infty{\bf C}^T + {\bf R} )^{-1}$, and
the matrix ${\bf P}_\infty$ is the solution to the algebraic Riccati equation ${\bf P}_\infty = {\bf A}{\bf P}_\infty{\bf A}^T + {\bf Q} - {\bf A}{\bf P}_\infty{\bf C}^T({\bf C}{\bf P}_\infty{\bf C} + {\bf R})^{-1}{\bf C}{\bf P}_\infty{\bf A}^T.$
We denote the KF estimation error at time $t$ by ${\bf e}[t] = {\bf x}[t] - \hat{{\bf x}}[t].$
\subsubsection*{LTI Model in Power Systems}
The analysis in this paper is based on the general discrete-time LTI model described above. As a number of control loops found in a power system can be modeled using the LTI model, our analysis applies to these control loops.
In the following, we provide examples of a discrete-time LTI system, namely a power system's voltage control and generator
swing equations.
A power system consists of a set of buses (nodes) to which generators and loads are connected, and transmission lines that connect these buses. As an example, the IEEE $9$-bus test system is illustrated in Fig.~\ref{fig:9_bus}.
\begin{figure}[!t]
\centering
\includegraphics[width=0.45\textwidth]{Figures/ieee_9_bus}
\caption{IEEE 9-bus power system.}
\label{fig:9_bus}
\end{figure}
\emph{Voltage control}: Power system voltage control refers to maintaining the voltages of selected critical buses (called {\em pilot buses} marked with ``P" in Fig.~\ref{fig:9_bus}) within safe operational limits by adjusting the
output voltage of the generator buses \cite{Ilic1995}. It can be modeled as an LTI system described in Eqs. \eqref{eqn:process} and \eqref{eqn:Obs}. Specifically, the state vector ${\bf x}[t]$ refers
to the voltages of the pilot buses at time $t,$ which should be maintained at a nominal
voltage denoted by ${\bf x}_0.$
The control signal, which is applied at the generator buses, corresponds to the change in the generator bus voltages, i.e., ${\bf u}[t] = {\bf v}_G[t]-{\bf v}_G[t-1],$ where ${\bf v}_G[t]$ is a vector of the generator bus voltages.
Under this model, the voltage control system can be approximated by an LTI system with ${\bf A} = {\bf I}$ \cite{Paul1987}, \cite{Ilic1995}. The control matrix ${\bf B}$ is
an unknown parameter that can be estimated from real data traces (more details on estimating the matrix ${\bf B}$ will be presented in Section \ref{sec:Sim_Res}).
Since the estimation cannot be perfect, the LTI model may be inaccurate, though the inaccuracies are small and can be captured as process noise.
Since the system state
can be directly measured by voltage sensors deployed at the pilot buses, the measurement matrix is an identity matrix, i.e., ${\bf C} = {\bf I}.$
The system is bounded-input bounded-output stable if the control algorithm
satisfies ${\bf B} {\bf u}[t] = \alpha ({\bf x}_0 - {\bf x}[t])$ for $\alpha \in (0,1)$, and this control
is adopted in practical systems \cite{Paul1987}. However, as the sensor measurements are noisy,
the controller cannot have perfect knowledge of the system state ${\bf x}[t].$ Rather, the state is estimated
using the KF-based technique described in \eqref{eqn:KF_est_nomit}.
Based on the estimated state $\hat{{\bf x}}[t],$ the control can be computed as
\begin{align}
{\bf u}[t] = \alpha {\bf B}^{-1} ({\bf x}_0 - \hat{{\bf x}}[t]). \label{eqn:control_vg}
\end{align}
\emph{Generator swing equations:} The swing equations establish a mathematical relationship between the angles of the mechanical motor and
the generated alternating current electricity \cite{Kundur1994}. The swing equations can be linearized and modeled
as an LTI system described by Eqs. \eqref{eqn:process} and \eqref{eqn:Obs} under the assumption of direct current (DC) power flow\cite{FabioPow2011}. For a power network consisting of $n$ generators, the state vector consists of $2n$ entries. The first $n$ entries are the generator's rotor phase angles and
the last $n$ entries are the generator's rotor frequency. The control inputs correspond to
changes in mechanical input power to the
generators, and is responsible for maintaining the generator's rotor angle and frequency within a safe operational range.
The entries of the matrix ${\bf A}$ depend on the power system's topology (including the transmission lines' susceptances)
as well as the generators' mechanical parameters (such as inertia and damping constants).
The structure of the matrix ${\bf B}$ depends on the type of feedback control used to restrict the rotor
angle frequency to within the safety range \cite{Kundur1994}.
The measurement vector ${\bf y}[t]$ under the DC power flow model includes nodal real power
injections at all the buses, all the branch power flows, and the rotor angles. The observation matrix ${\bf C}$ can be constructed based on the power system topology \cite{Liu2009}.
\subsection{Threat Model, Attack Detection \& Mitigation}
Modern-day critical infrastructure systems extensively use ICT for their operation.
For instance, in a power grid, the remote terminal units (RTUs) and many other field
devices are connected by the internet protocol (IP). The sensor and
control data is transmitted over the Internet using virtual private networks (VPNs) for
logical isolation \cite{Hahn2013}.
However it has been demonstrated in the past that software-based protection schemes such as VPNs can be breached by attackers (e.g., see \cite{Heartbleed}).
Additionally, in a power grid, the sensors (such as the voltage and current measurement units) are spread over a large geographical area, making their measurements vulnerable to physical attacks \cite{kune2013ghost, SmartMeterSecurity2009}.
Such vulnerabilities can be exploited to launch attacks and
disrupt the normal power grid operations.
In this paper, we follow Kerckhoffs's principle and consider an
attacker who has accurate knowledge of the targeted CPCS and read access to the system state.
Such knowledge can be obtained in practice by malicious insiders, long-term
data exfiltration \cite{dragonfly2014}, or social engineering against employees,
contractors, or vendors of a critical infrastructure operator \cite{karnouskos2011}.
Specifically, we assume that the attacker knows the matrices ${\bf A}, {\bf B}$ and ${\bf C},$ as well as the operational details of the KF and the system's method of anomaly detection (including the detection threshold). In addition, the attacker also has read and write
accesses to the system sensors.
We consider FDI attacks on the system sensors. Under this attack model, the compromised
observations, denoted by ${\bf y}_a[t]$, are given by
\begin{align}
{\bf y}_a[t] &= {\bf y}[t] + {\bf a}[t] \label{eqn:Obs_Attack},
\end{align}
where ${\bf a}[t] \in \mbox{\bb R}^{m}$ is the attacker's injection.
To model the attacker's energy constraint, we assume that the norm of the injection, $\|\mathbf{a}[t]\|$, is upper-bounded by a constant $a_{\max}$, i.e., $||{\bf a}[t]|| \leq a_{\max}.$
Denote by $\mathcal{A}$ the set of all feasible attack vectors that satisfy the above energy constraint.
We assume that the controller uses the $\chi^2$ detector \cite{MEHRAChiSquare1971} to detect the attack, which
has been widely adopted in security analysis of LTI systems \cite{Kwon2013}, \cite{Mo2015}. We note that our analysis framework can also be extended to address other attack detectors.
The $\chi^2$ detector computes a
quantity
$g[t] = {\bf r}[t]^T {\bf P}^{-1}_r {\bf r}[t],$
where ${\bf r}[t]$ is the residual given by
\begin{align}
{\bf r}[t] &= {\bf y}_a[t+1] - {\bf C} ({\bf A} \hat{{\bf x}}[t] + {\bf B} {\bf u}[t]) \label{eqn:res_defn},
\end{align}
and ${\bf P}_r = {\bf C} {\bf P}_{\infty} {\bf C}+{\bf R}$ is a constant matrix that denotes the covariance of the residual in the steady state. Denoted by $i[t] \in \{0, 1\}$ the detection result of the detector. The detector declares an attack if $g[t]$ is greater than a predefined threshold $\eta.$
Specifically,
\begin{align}
i[t] =
\begin{cases}
0, & \text{if} \ 0 \leq g[t] \leq \eta; \\
1, & \text{else}.
\end{cases} \label{eqn:indicator}
\end{align}
Based on the detection result, the controller applies a reactive mitigation action.
If the $\chi^2$ detector's alarm is triggered, the controller forwards a modified version of the observation ${\bf y}_a[t] - \hbox{\boldmath$\delta$}[t]$
to the KF, where $\hbox{\boldmath$\delta$}[t] \in \mbox{\bb R}^m$ is an attack mitigation signal;
otherwise, the controller directly forwards ${\bf y}_a[t]$ to the KF (ref. Fig.~\ref{fig:sys_model}).
Thus, the controller's operation can be expressed as
\begin{align}
{\bf y}_f[t] = {\bf y}_a[t] - i[t] \hbox{\boldmath$\delta$}[t]. \label{eqn:mitigation}
\end{align}
With the controller's mitigation action, the KF estimate is computed as
\begin{align}
\hat{{\bf x}} [t+1] \!=\! {\bf A} \hat{{\bf x}}[t]\! +\! {\bf B} {\bf u}[t] \! +\! {\bf K} ({\bf y}_f [t+1]\! -\! {\bf C} ({\bf A} \hat{{\bf x}}[t]\! +\! {\bf B} {\bf u}[t])). \label{eqn:KF_est}
\end{align}
The mitigation signal $\hbox{\boldmath$\delta$}[t]$ can be generated using existing mitigation approaches (e.g., \cite{Cardenas2011}, \cite{Sridhar2014}).
The main focus of this paper is not the design of the mitigation strategy, but to understand
the impact of the detection-mitigation loop on the optimal attack strategy.
Thus, in this paper, we do not focus on a specific mitigation approach. Instead, we design a generic framework
that admits any mitigation signal.
In Section~\ref{sec:Sim_Res}, our simulations are based on a perfect mitigation strategy in which the
controller can precisely remove the attack signal, as well as a practical mitigation strategy in which the mitigation signal is a noisy version of the attack signal.
Combining \eqref{eqn:process}, \eqref{eqn:mitigation} and \eqref{eqn:KF_est},
we obtain the dynamics of the KF estimation error with attack mitigation as
\begin{align}
& {\bf e} [t+1] = {\bf A}_K {\bf e}[t] + {\bf W}_K{\bf w} [t] \nonumber \\ & \ - {\bf K} ({\bf a}[t+1]-i[t+1] \hbox{\boldmath$\delta$}[t+1]) - {\bf K} {\bf v}[t+1], \ t \geq 0, \label{eqn:error_evol}
\end{align}
where ${\bf A}_K = {\bf A}- {\bf K} {\bf C} {\bf A}$ and ${\bf W}_K = ({\bf I}- {\bf K} {\bf C}).$
Since the KF
is assumed to be in the steady state at time $0,$ we have $\mathbb{E}[{\bf e}[0]] = \bf{0}$ and $\mathbb{E} [{\bf e}[0] {\bf e}[0]^T] = {\bf P}_e = ({\bf I}- {\bf K} {\bf C}) {\bf P}_\infty.$
\section{Problem Formulation}
\label{sec:Threat_Model}
Under the Kerckhoffs's assumption about the attacker's
knowledge, we analyze attack strategies that can mislead the controller into making erroneous control
decisions. This is accomplished indirectly by
increasing the estimation errors.
For a given attack detection threshold $\eta$ and mitigation strategy $\{ \hbox{\boldmath$\delta$}[t] \}^T_{t = 1}$ over a horizon of $T$ time slots, the optimal attack sequence that maximizes the cumulative sum of KF's expected norm of the estimation error over the horizon is given by the following optimization problem:
\begin{eqnarray}
&\displaystyle \max_{ {\bf a}[1],\dots,{\bf a}[T]} & \sum^T_{t = 1}\mathbb{E} [\| {\bf e}[t] \|^2 ] \label{eqn:attacker_problem} \\
& s.t. & \text{KF error dynamics \eqref{eqn:error_evol}}, \nonumber \\
& & \|\mathbf{a}[t] \| \leq a_{\max}, \forall t \nonumber.
\end{eqnarray}
Maximizing the KF estimation error implies that the controller no longer has
an accurate estimate of the system state.
In systems that use KF for state estimation (such as positioning systems, power systems, etc.), control input computed based on inaccurate/wrong system state estimates can adversely affect their performance and even result in catastrophic safety incidents.
Moreover, the cumulative sum in the objective function implies that the attack has a sustained adverse impact on the system over the entire attack time horizon.
We note that similar cumulative metrics have also been widely adopted in control system design to assess the performance of controllers \cite{abdelzaher2008introduction}. Thus, with an objective of maximizing the cumulative metric, the optimal attack sequence will bring the largest performance degradation to the control systems that are designed in terms of cumulative metrics.
\begin{figure}[!t]
\centering
\includegraphics[width=0.48\textwidth]{Figures/Obj_Fn}
\caption{Attack impact for the voltage control problem.}
\label{fig:obj_fn}
\end{figure}
\subsubsection*{Relevance to Power System}
We illustrate the relevance of the optimization problem
stated in \eqref{eqn:attacker_problem} to power grid's voltage control. Recall that the voltage controller's objective is to adjust the pilot bus voltage to its setpoint ${\bf x}_0$ by applying control.
Fig.~\ref{fig:obj_fn} shows the impact of an attack that is able to bypass the $\chi^2$ detector (and consequently the controller's mitigation steps) on the pilot bus voltage.
In this figure, the dotted line indicates the voltage setpoint, and the solid lines show the evolution of the system state ${\bf x}[t]$ and estimate $\hat{{\bf x}}[t]$. The gap between the two curves measures the KF estimation error ${\bf e}[t].$ As evident from the figure, if the attacker manages to increase the KF's estimation error using a carefully constructed attack sequence, then he can cause a significant deviation of the system state from the desired setpoint. Interestingly, the estimate $\hat{{\bf x}}[t]$ is close to the setpoint ${{\bf x}}_0$ that misleads the controller into believing that the desired setpoint has already been achieved, while the actual pilot bus voltage continues to deviate.
Intuitively, to cause a significant impact, the attack magnitude must be large. But at the same time, it is important that the attack bypasses the controller's detection -- otherwise the attack will be mitigated. Thus the solution of the optimization problem \eqref{eqn:attacker_problem} must strike a balance between the attack magnitude and stealthiness.
In the following section, we solve the optimization problem \eqref{eqn:attacker_problem}
using an MDP-based approach.
\section{MDP Solution}
\label{sec:Soln_Methods}
In this section, we cast the optimization problem \eqref{eqn:attacker_problem} to an MDP problem \cite{Puterman:1994} and solve it using the value iteration method.
Before doing so, we first state the main challenge involved in solving \eqref{eqn:attacker_problem}.
\subsection{Challenge}
\begin{figure}[!t]
\centering
\includegraphics[width=0.45\textwidth]{Figures/probabilistic_evolution_edit}
\caption{Evolution of KF estimation error conditioned on the attack detection results.}
\label{fig:probabilistic_evolution}
\vspace*{-0.5 cm}
\end{figure}
The main challenge in solving \eqref{eqn:attacker_problem} lies in the fact that
the KF error dynamics, and consequently the attack detection results are coupled
across different time slots.
To illustrate this point, we present a pictorial depiction of the KF
error dynamics \eqref{eqn:error_evol} in Fig.~\ref{fig:probabilistic_evolution}.
As evident from this figure, the error dynamics of ${\bf e}[t]$ depend on
the sequential decisions of the $\chi^2$ detector ${\bf i}_{[1:t]} = \{ i[t] \}^T_{t = 1}$
due to reactive attack mitigation, which is triggered based on the the attack detection.
Thus, to compute the expected error at any time $t$, the attacker must consider
all possible combinations of the past attack detection results ${\bf i}_{[1:t]} = \{ i[t] \}^T_{t = 1}$.
The complexity of such an approach grows exponentially in terms of the optimization time horizon $T$ (since at any time $t,$ there can be $2^t$ different combinations of the past attack detection results, see Fig.~\ref{fig:probabilistic_evolution}). In the following subsections, we present an efficient solution methodology to solve the attacker's problem \eqref{eqn:attacker_problem} by modeling it as an MDP, and propose a value iteration based method to compute the optimal attack sequence.
\subsection{Markov Decision Process Model}
\label{sec:MDP_Model}
In this subsection, we develop the MDP modelling of the optimization problem \eqref{eqn:attacker_problem}.
Our key observation is that the dynamics of the KF estimation error in \eqref{eqn:error_evol} is Markovian. Hence, the knowledge of ${\bf e}[t]$ at time $t$ will capture all the past events, and exhaustive search across all the possible past attack detection results is not necessary.
A state in the MDP corresponds to the
KF filter estimation error ${\bf e}[t]$ and the actions correspond
to the attacker's injection ${\bf a}[t].$
Our approach is to map the KF error dynamics \eqref{eqn:error_evol} to the
state transition probabilities of the MDP, and the objective function of \eqref{eqn:attacker_problem} to the MDP's long-term expected reward. The solution to the MDP is a policy which maps
each MDP state to an attacker's action. In particular, the optimal policy maximizes
the long-term expected reward of the MDP, and hence solves the optimization
problem \eqref{eqn:attacker_problem}.
The mathematical details of the MDP is presented next. The structure of
the MDP's solution is illustrated with the help of a numerical example in Section~\ref{sec:Mag_Stl}.
\subsubsection*{MDP Modeling Details}
Formally, the MDP is defined by a tuple $(\mathcal{E},\mathcal{A},\mathcal{T},R)$, where
$\mathcal{E} \subseteq \mbox{\bb R}^n$ is the state space of the problem corresponding
to the set of all possible ${\bf e}[t]$. $\mathcal{A}$ is the action space of the attacker. $\mathcal{T}({\bf e},{\bf a},{\bf e}^{\prime})$ is the probability of transition from state
${\bf e}$ to ${\bf e}^{\prime}$ (where ${\bf e},{\bf e}^{\prime} \in \mathcal{E}$) under an action ${\bf a} \in \mathcal{A}$ of the attacker. Mathematically,
$\mathcal{T}( {\bf e},{\bf a},{\bf e}^{\prime}) {\,\,\stackrel{\scriptscriptstyle \bigtriangleup}{=}\,\,} \mathbb{P} ({\bf e}[t+1] = {\bf e}^{\prime} \big{|} {\bf e}[t] = {\bf e},{\bf a}[t+1] = {\bf a}) .$
$R({\bf e}^{\prime},{\bf a},{\bf e})$ is the immediate expected reward for the attacker when it takes an action
${\bf a} \in \mathcal{A}$ in state ${\bf e} \in \mathcal{E}.$
\emph{MDP state transition probabilities:} We now compute the state transition probability corresponding to the error dynamics \eqref{eqn:error_evol}.
We adopt the following approach. First, we compute the quantity $\mathbb{P} ( {\bf e}_{\text{lb}} \leq {\bf e}[t+1] \leq {\bf e}_{\text{ub}} \big{|} {\bf e}[t] = {\bf e},{\bf a}[t+1] = {\bf a}).$
Then we use the fact that for a random variable $X,$
\begin{align*}
& \mathbb{P} (X = x) \approx \frac{F ( -\infty ,x+\epsilon) - F ( -\infty ,x-\epsilon) }{2 \epsilon},
\end{align*}
where $F ( x_1 ,x_2) = \mathbb{P} ( x_1 \leq X \leq x_2)$ and $\epsilon > 0$ is a small positive quantity.
The result is stated in the following lemma:
\begin{lemma}
\label{lem:trans_prob}
For a given ${\bf e}[t] = {\bf e}$ and ${\bf a}[t+1] = {\bf a}$ the attack detection probability at
any time $t$ can be computed as $\mathbb{P} ( {\bf Y} \geq \eta),$ where ${\bf Y} = {\bf r}_c[t+1]^T {\bf P}^{-1}_r {\bf r}_c[t+1]$ is a generalized chi-square distributed random variable.
Further, the quantity $\mathbb{P} ( {\bf e}_{\text{lb}} \leq {\bf e}[t+1] \leq {\bf e}_{\text{ub}} \big{|} {\bf e}[t] = {\bf e},{\bf a}[t+1] = {\bf a})$ can be computed as the sum of the following terms:
\begin{align}
& \mathbb{P} \LB \begin{bmatrix}
0 \\
{\bf e}_{\text{lb}} - {\bf y}_2
\end{bmatrix} \leq {\bf X} \leq \begin{bmatrix}
\eta \\
{\bf e}_{\text{ub}} - {\bf y}_2
\end{bmatrix} \RB \nonumber \\
& + \mathbb{P} \LB \begin{bmatrix}
\eta \\
{\bf e}_{\text{lb}} - {\bf y}_2 - {\bf K} \hbox{\boldmath$\delta$}
\end{bmatrix} \leq {\bf X} \leq \begin{bmatrix}
\infty \\
{\bf e}_{\text{ub}} - {\bf y}_2 - {\bf K} \hbox{\boldmath$\delta$}
\end{bmatrix} \RB.
\label{eqn:TP_vector}
\end{align}
In \eqref{eqn:TP_vector}, ${\bf X} \in \mbox{\bb R}^{n+1}$ is a concatenated variable given by \\
${\bf X} = \LSB {\bf Y} \ \ ({\bf W}_K {\bf w}[t]- {\bf K} {\bf v}[t+1] )^T \RSB^T,$ ${\bf y}_2 = {\bf A}_K{\bf e} - {\bf K}{\bf a},$
and $\hbox{\boldmath$\delta$}$ is the mitigation signal.
\end{lemma}
Lemma~\ref{lem:trans_prob} is proved in Appendix~A.
For a generic system of dimensions $n, m \geq 2,$ it is hard to obtain analytical expressions for the probability terms involved in Lemma~\ref{lem:trans_prob} (since they involve a generalized chi-square distribution, as well as the correlations between the random variables ${\bf Y}$ and ${\bf W}_K {\bf w}[t]- {\bf K} {\bf v}[t+1],$ which is hard to quantify analytically).
However, for the scalar case i.e. $n = m = 1$, the attack detection and transition probabilities
can be computed using the Gaussian distribution, as stated in the following corollary:
\begin{corollary}
\label{cor:trans_prob}
For $n = m = 1,$ the attack detection probability at
any time $t$ can be computed as
\begin{align}
& \mathbb{P} \big{(}{\bf Y} \in (-\infty, -\sqrt{\eta {\bf P}_r} - {\bf C}{\bf A}{\bf e} - {\bf a}] \nonumber \\ & \qquad \qquad \qquad \qquad \cup [\sqrt{\eta {\bf P}_r} - {\bf C}{\bf A}{\bf e} - {\bf a}, \infty) \big{)}, \label{eqn:Det_Prob}
\end{align}
where ${\bf Y} \sim \mathcal{N} (0,{\bf C} {\bf Q} {\bf W}^T_K + {\bf R}).$
Further, the quantity $\mathbb{P} ( {\bf e}_{\text{lb}} \leq {\bf e}[t+1] \leq {\bf e}_{\text{ub}} \big{|} {\bf e}[t] = {\bf e},{\bf a}[t+1] = {\bf a})$ is equal to the sum of the following terms:
\begin{align}
& \mathbb{P} \LB \begin{bmatrix}
-\sqrt{\eta {\bf P}_r} - {\bf y}_1 \\
{\bf e}_{\text{lb}} - {\bf y}_2
\end{bmatrix} \ \leq {\bf X} \leq
\begin{bmatrix}
\sqrt{\eta {\bf P}_r} - {\bf y}_1 \\
{\bf e}_{\text{ub}} - {\bf y}_2
\end{bmatrix} \RB \nonumber \\
+
& \mathbb{P} \LB \begin{bmatrix}
-\infty \\
{\bf e}_{\text{lb}} - {\bf y}_2 - {\bf K} \hbox{\boldmath$\delta$}
\end{bmatrix} \ \leq {\bf X} \leq
\begin{bmatrix}
-\sqrt{\eta {\bf P}_r} - {\bf y}_1 \\
{\bf e}_{\text{ub}} - {\bf y}_2- {\bf K} \hbox{\boldmath$\delta$}
\end{bmatrix} \RB \nonumber \\
+
& \mathbb{P} \LB \begin{bmatrix}
\sqrt{\eta {\bf P}_r} - {\bf y}_1 \\
{\bf e}_{\text{lb}} - {\bf y}_2- {\bf K} \hbox{\boldmath$\delta$}
\end{bmatrix} \ \leq {\bf X} \leq
\begin{bmatrix}
\infty \\
{\bf e}_{\text{ub}} - {\bf y}_2 - {\bf K} \hbox{\boldmath$\delta$}
\end{bmatrix} \RB \label{eqn:norm_cdf}
\end{align}
where ${\bf y}_1 = {\bf C}{\bf A}{\bf e} + {\bf a}$ and ${\bf y}_2 = {\bf A}_K{\bf e} - {\bf K}{\bf a}$ and ${\bf X} \in \mbox{\bb R}^{2}$ is a zero-mean Gaussian distributed random vector whose covariance matrix is given by
\begin{align}
\text{Cov} & ({\bf X}) = \begin{bmatrix}
{\bf C} {\bf Q} {\bf W}^T_K + {\bf R} & {\bf C} {\bf Q} {\bf W}^T_K - {\bf R} {\bf K}^T \\
{\bf W}^T_K {\bf Q} {\bf C} - {\bf K} {\bf R}^T & {\bf W}_K {\bf Q} {\bf W}^T_K+ {\bf K} {\bf R} {\bf K}^T
\end{bmatrix}.
\end{align}
\end{corollary}
The probabilities in \eqref{eqn:Det_Prob} and \eqref{eqn:norm_cdf} can be computed using the cumulative distribution function (c.d.f.) of Gaussian distribution. Corollary~\ref{cor:trans_prob} is also proved in Appendix~A.
\emph{MDP reward:} We now map the objective function of \eqref{eqn:attacker_problem} to the
MDP reward function. Accordingly, the immediate expected reward of the MDP is given by
\begin{align}
R({\bf e}^{\prime},{\bf a},{\bf e}) = \int_{{\bf e}^{\prime} \in \mathcal{E}}\mathcal{T}( {\bf e},{\bf a},{\bf e}^{\prime}) || {\bf e}^{\prime} ||^2. \label{eqn:imm_rew}
\end{align}
\emph{MDP policy and state value function: }The solution to the MDP corresponds to a policy $\pi,$ which is a mapping from a state to an action.
The state value function of the MDP for a given policy $\pi$ is defined as
\begin{align}
V^{\pi} ({\bf e}) = \mathbb{E}_{\pi} \LSB \sum^T_{t = 1} ||{\bf e}[t]||^2 \big{|} {\bf e}[0] = {\bf e} \RSB.
\end{align}
\emph{Optimal policy: }The optimal policy
$\pi^*$ maximizes the total expected reward, $
\pi^* = \operatornamewithlimits{arg\,max}_{\pi} V^{\pi} ({\bf e}) , \forall {\bf e} \in \mathcal{E},$ and
the optimal value function is defined as $V^*({\bf e}) = V^{\pi^*} ({\bf e}).$
In the next subsection, we present an algorithm to compute the optimal policy of the MDP described above.
\subsection{Solving the MDP}
\label{sec:MDP_Discrete}
MDPs can be solved efficiently by value/policy iteration methods \cite{Puterman:1994}. However,
in this work we are dealing with real-world quantities (for e.g. voltages in a
power grid) which are continuous variables. Hence, the MDP described in Section~\ref{sec:MDP_Model} has continuous state and action spaces\footnote{We note that the MDP problem has continuous state and action spaces, but is not a continuous-time MDP (since we only consider discrete-time LTI systems).}, which makes it impractical to apply a value iteration method directly. In order to address this issue, in what follows, we
define a \emph{discretized MDP} obtained by discretizing the state space of the original continuous MDP.
The optimal policy of the discretized MDP can be used as a near-optimal solution to the continuous MDP.
Existing studies (e.g., \cite{ChowTsitsiklis1991}) adopt similar discretization approaches.
In the following, we provide only a sketch of the discretization procedure. More details of the discretized procedure can be found in Appendix B. This is followed by a value iteration algorithm to compute its optimal policy.
The MDP discretization procedure is based on the following three steps:
\begin{itemize}
\item[1.] Construct a discretized MDP that mimics the continuous MDP closely.
\item[2.] Solve the discretized MDP using value iteration, which gives an optimal
policy for the discretized MDP.
\item[3.] Map the discterized MDP's optimal policy to a near-optimal policy for the continuous MDP.
\end{itemize}
Let $\Xi$ denote the discretized version of the original state space
$\mathcal{E},$ where $\Xi = \{ \xi_1,\dots,\xi_N \},$
where $N$ is the number descritization levels, and $\overline{\mathcal{T}} (\xi_i,{\bf a},\xi_j)$, $\overline{R}(\xi_i,{\bf a},\xi_j)$ and
$\overline{V} (\xi_i)$ denote the state transition probabilities, the reward
and value function of the discretized MDP. The mathematical details of their computation
are provided in Appendix~B.
The discretized MDP can be solved using the value iteration method whose steps
are given by the following algorithm:
\vspace{0.05in} \hrule
\vspace{0.01in}\hrule
\begin{algorithm} [{\bf Value Iteration}]
\label{alg:HeurisitcSingleStorage}
\begin{algorithmic}[1]
\item[]
\State Set $\overline{V}^*_{0} (\xi_i) = 0$ for all $\xi_i \in \Xi.$
\For{ t = 0 to T-1}
\For{ all discretized states $\xi_i \in \Xi$}
\begin{align*}
& \overline{V}^*_{t+1} (\xi_i) \\ & \ \ \leftarrow \max_{{\bf a}} \sum_{\xi_j \in \Xi} \overline{\mathcal{T}} (\xi_i,{\bf a},\xi_j) \LSB \overline{R}(\xi_i,{\bf a},\xi_j) + \overline{V}^*_t (\xi_j) \RSB, \\
& \overline{\pi}^*_{t+1}(\xi_i) \\ & \ \ \leftarrow \operatornamewithlimits{arg\,max}_{{\bf a}} \sum_{\xi_j \in \Xi} \overline{\mathcal{T}}(\xi_i,{\bf a},\xi_j) \LSB \overline{R}(\xi_i,{\bf a},\xi_j) + \overline{V}^*_t (\xi_j) \RSB.
\end{align*}
\EndFor
\EndFor
\end{algorithmic}
\end{algorithm}
\hrule
\vspace{0.01in}\hrule\vspace{0.05in}
\vspace*{0.1 in}
\noindent Algorithm~1 gives the optimal policy of the discretized MDP \cite{Puterman:1994}.
Note that the optimal policy of the discretized MDP computed in Algorithm~1 cannot be
directly applied to the continuous MDP, since we do not know the optimal policy
for a state ${\bf e} \in \mathcal{E}$ that is not in the discretized state space $\Xi.$
To address this issue, we use the nearest neighbour approximation, i.e.,
for a state ${\bf e} \notin \Xi,$ we choose an action based on
the policy of its nearest neighbour,
$\pi({\bf e}) = \bar{\pi}^*(\xi_i), \ \text{where} \ \xi_i = \operatornamewithlimits{arg\,min}_{1 \leq i \leq N} ||{\bf e}-\xi_i||$.
We lastly make some remarks on the MDP formulation in this section.
$\bullet$ Although in this section we cast the optimization problem \eqref{eqn:attacker_problem} as a finite time horizon MDP problem, our framework can be extended to the infinite time horizon MDP problem readily by introducing a discount factor $0 \leq \gamma < 1$ in the reward function.
The discount factor ensures that the cumulative sum of rewards is finite as well as the convergence of the value iteration algorithm.
$\bullet$ The optimal cost of the discretized MDP
is guaranteed to lie within a bounded distance from the optimal cost of the original MDP
\cite{ChowTsitsiklis1991}.
As the discretization is finer, the discretized MDP approaches to the original
MDP more closely.
\subsection{Attack Magnitude and Stealthiness}
\label{sec:Mag_Stl}
We now illustrate the structure of the MDP solution using a numerical example.
In Fig.~\ref{fig:Attack_Mag_Stl}, we plot the attack detection probability (computed as in \eqref{eqn:Det_Prob}) and the attack impact computed
in terms of the MDP's immediate expected reward (using the result of \eqref{eqn:norm_cdf} and \eqref{eqn:imm_rew}) for different values of attack magnitude ${\bf a}$. The system parameters are $n = m = 1,$ ${\bf A}$ = $1$, ${\bf C}$ = $1$, ${\bf Q}$ = $1$, ${\bf R}$ = $10,$ $\eta = 10$ and $\hbox{\boldmath$\delta$} = {\bf a}$. It can be observed that while the probability of detection is low for an attack of small magnitude, it also has little impact. On the other hand, the probability of detection is high for an attack of large magnitude, and consequently the expected attack impact is also low. The optimal attack lies in between these two quantities. In this example, the optimal attack that maximizes the expected immediate reward has a magnitude of $10,$ and
a detection probability of $0.3.$ Thus, the MDP solution strikes a balance
between attack magnitude and stealthiness, resulting in maximum impact\footnote{Strictly speaking, MDP solution maximizes the long term expected reward. For the ease of illustration, in this example we only considered the immediate expected reward.}.
\begin{figure}[!t]
\centering
\begin{subfigure}{0.23\textwidth}
\includegraphics[width=1\textwidth]{Figures/Attack_Det_Prob}
\end{subfigure}
~
\begin{subfigure}{0.23\textwidth}
\includegraphics[width=1\textwidth]{Figures/Attack_Reward}
\end{subfigure}
\caption{Attack detection probability and the expected attack impact (immediate expected reward of MDP) for different attack magnitudes.}
\label{fig:Attack_Mag_Stl}
\end{figure}
\section{Cost of False Positives and Misdetections}
\label{sec:MD_FP}
In this section, we use the framework developed thus far to quantify
the cost of FPs and MDs in a simulation-based approach.
We use the cumulative state estimation error (objective function of \eqref{eqn:attacker_problem})
as the cost metric.
To quantify these costs, we consider an LTI system with an \emph{oracle} attack detector
as the reference system. An oracle detector is one that has a perfect detection capability, and hence no FPs or MDs. The cost of FPs is the additional cost incurred due to wrongly triggered mitigations in the original LTI system, compared with the reference system. The cost of MDs is the additional cost incurred due to unmitigated attacks in the original LTI system, compared with the reference system. In particular, we consider optimal attacks as derived in Section~\ref{sec:MDP_Model} to characterize the worst-case performance degradation due to MDs.
We compute these costs as follows:
{\bf Cost of FPs:} To quantify the cost of FPs, we compute the state estimation error (objective function of \eqref{eqn:attacker_problem}) in the following two systems: (i) the LTI system of \eqref{eqn:process} and \eqref{eqn:Obs} with the $\chi^2$ detector and mitigation modules and no attacks, i.e. ${\bf a}[t] = 0, \ \forall t$ (ii) the reference LTI system with ${\bf a}[t] = 0, \ \forall t$.
Under setting (i), all the alarms of the $\chi^2$ detector correspond to FPs, which will wrongly trigger a mitigation action. Since the mitigation signal is imperfect, it leads to an increase in the estimation error. Note that for the reference system, there are no FPs, and hence no wrongly triggered mitigations. The difference between the state estimation errors of the two systems quantifies the performance degradation due to FP.
{\bf Cost of MDs:}
To quantify the cost of MDs, we compute the state estimation errors in the following two systems:
(i) the LTI system of \eqref{eqn:process} and \eqref{eqn:Obs} with the $\chi^2$ detector and mitigation modules and optimal attacks (computed as in Section~\ref{sec:MDP_Model}) (ii) the reference LTI system with optimal attacks. The difference between the state estimation errors of the two systems quantifies the performance degradation due to MD, which we define as the cost of MD.
In Section~\ref{sec:quant_MD_FP}, we present simulation results to quantify the cost of FP and MD under different attack detection thresholds and mitigation strategies. We also provide
guidelines to tune the attack detection threshold based on this quantification.
\section{Simulation results}
\label{sec:Sim_Res}
In this section, we present simulation results to examine the system performance under
different attack sequences.
Throughout this section, we use different notations to denote the attacker's knowledge of the detection and mitigation parameters ($\eta_a$ and $ \{ \hbox{\boldmath$\delta$}_a[t] \}^T_{t=1}$, respectively), and the actual parameters used by the controller ($\eta_d$ and $\{ \hbox{\boldmath$\delta$}_d[t]\}^T_{t=1}$, respectively). While solving the attacker's problem \eqref{eqn:attacker_problem}, we assume \emph{perfect attack mitigation} in which the attack can be removed precisely, i.e. $\hbox{\boldmath$\delta$}_a[t] = {\bf a}[t], \ \forall t$. From an attacker's perspective, this assumption gives
an underestimate of the performance degradation he can cause (since the value of
the objective function of \eqref{eqn:attacker_problem} will increase if the controller uses a mitigation strategy different from perfect mitigation).
While evaluating the attack impact, we consider two mitigation strategies used by the controller. First, the perfect attack mitigation $\hbox{\boldmath$\delta$}_d[t] = {\bf a}[t], \ \forall t.$
However perfect mitigation requires the controller to estimate the injected attack vector accurately, which may not be practical. Thus we introduce a \emph{practical attack mitigation approach} under which the attack mitigation is imperfect, i.e., $\hbox{\boldmath$\delta$}_d[t] = {\bf a}[t]+{\bf b}[t],$ where ${\bf b}[t] \in \mbox{\bb R}^n$ models the mismatch between the controller's mitigation action and the actual attack vector (possibly due to inaccuracy in estimating the injected attack). In our simulations, we generate a random vector to model ${\bf b}[t]$.
\subsection{Optimality of the Attack Sequence}
First, we verify the optimality of the attack sequence derived using the MDP-based methodology described in Section~\ref{sec:Soln_Methods}. We consider a general LTI model described by \eqref{eqn:process} and \eqref{eqn:Obs} with $n = 1,$ ${\bf A}$ = $1$, ${\bf C}$ = $1$, ${\bf Q}$ = $1$, ${\bf R}$ = $10.$
We compare the cost function of \eqref{eqn:attacker_problem} under three different attack sequences: (i) optimal attack computed using the MDP-based approach of Section~ \ref{sec:Soln_Methods}, (ii) a constant attack sequence of magnitude $10$ units and (iii) a ramp attack of the form $a[t] = t$. The time horizon of attack $T$ is fixed to $10$ units. To implement the discretized MDP, we truncate the state space in the range $[-30,30]$ and discretize it in equal intervals of $0.25$ units. Thus, the state space of the discretized MDP consists of a total of $241$ states, i.e., $\{ -30,-29.75,\dots,0,\dots,29.75,30\}$.
All the optimization problems involved in the implementation of the value iteration algorithm are solved using the \emph{fmincon} function in MATLAB.
For attack impact, we compute an empirical value of the objective function of \eqref{eqn:attacker_problem} by conducting $W$ simulation runs (where $W$ is a large number). Let ${\bf e}_{\omega}[t]$ denote the state estimation error at a time instant $t \in \{ 1,2,\dots,T \}$ during the simulation run $\omega = \{ 1,2,\dots,W\},$ where ${\bf e}_{\omega}[t]$ follows the dynamics given by
\begin{align*}
& {\bf e}_{\omega} [t+1] = {\bf A}_K {\bf e}_{\omega}[t] + {\bf W}_K{\bf w} [t] \nonumber \\ & \ - {\bf K} ({\bf a}^*[t+1]-i[t+1] \hbox{\boldmath$\delta$}_d[t+1]) - {\bf K} {\bf v}[t+1], \ t \geq 0,
\end{align*}
where ${\bf a}^*[t]$ is the attack derived from the MDP policy, i.e., $ {\bf a}^*[t] = \pi^*({\bf e}_{\omega} [t])$. The empirical cost at time $t$ is then computed by
averaging over the $W$ simulations, i.e.,
\begin{align}
\text{Cost}[t] = \frac{1}{W} \sum^W_{\omega = 1} \sum^t_{\tau = 1} \| {\bf e}_{\omega}[t] \|^2. \label{eqn:emp_cost}
\end{align}
In our simulations, we set $W = 10000.$ To evaluate the empirical cost under other attack strategies,
we use a similar approach and replace the optimal attack with the corresponding attacks (i.e., constant and ramp attacks).
Fig.~\ref{fig:general_model_cost} provides a comparison of the cost at different time slots under the different attack sequences assuming the controller implements perfect mitigation $\hbox{\boldmath$\delta$}_d[t] = {\bf a}[t], \ \forall t.$ It can be seen that the cost is greatest for MDP-based attacks, which validates its optimality. To investigate the attack impact under a practical mitigation strategy, we use a similar approach as described above and set $\hbox{\boldmath$\delta$}_d[t] = {\bf a}[t]+{\bf b}[t],$ where we generate ${\bf b}[t]$ as a Gaussian distributed random variable with a standard deviation of $15$ units. From Fig.~\ref{fig:cost_imperfect}, it can be observed that even under the practical mitigation, the cost is greatest for the MDP-based attack sequence. Comparing Fig.~\ref{fig:general_model_cost} and Fig.~\ref{fig:cost_imperfect}, we also observe that the attack impact is greater for the practical mitigation compared with that of perfect mitigation (since perfect mitigation completely nullifies the attack's impact when it is detected).
\begin{figure}[!t]
\centering
\includegraphics[width=0.48\textwidth,trim={0 8cm 0 0}]{Figures/general_model_cost}
\caption{Comparison of cost with perfect attack mitigation and different attack strategies.}
\label{fig:general_model_cost}
\end{figure}
\begin{figure}[!t]
\centering
\includegraphics[width=0.48\textwidth,trim={0 10cm 0 0}]{Figures/general_model_cost_imperfect}
\caption{Comparison of cost with practical attack mitigation and different attack strategies.}
\label{fig:cost_imperfect}
\end{figure}
\subsection{Quantifying the Cost of False Positives and Misdetections}
\label{sec:quant_MD_FP}
Next, we present simulation results to quantify the cost of FPs and MDs following the approach in Section~\ref{sec:MD_FP}. In our simulations, we consider the aforementioned practical attack mitigation. Fig.~\ref{fig:Thold} shows the cost of FPs and MDs for different detection thresholds $\eta$ and standard deviations of the attack mitigation signal $\sigma_{\text{mit}}$. We note that a low value of $\eta$ represents an aggressive detector, where as a high value of $\eta$ represents a conservative detector. For the mitigation signal, a low value of $\sigma_{\text{mit}}$ represents accurate mitigation, where as a high value represents inaccurate mitigation. In particular, $\sigma_{\text{mit}} = 0$ corresponds to perfect mitigation.
\begin{figure*}[!t]
\centering
\begin{subfigure}{0.35\textwidth}
\includegraphics[width=1\textwidth]{Figures/FP_MD_Mit0}
\caption{$\sigma_{\text{mit}} = 0.$}
\end{subfigure}
~
\begin{subfigure}{0.35\textwidth}
\includegraphics[width=1\textwidth]{Figures/FP_MD_Mit5}
\caption{$\sigma_{\text{mit}} = 5.$}
\end{subfigure} \\
~
\begin{subfigure}{0.35\textwidth}
\includegraphics[width=1\textwidth]{Figures/FP_MD_Mit10}
\caption{$\sigma_{\text{mit}} = 10.$}
\end{subfigure}
~
\begin{subfigure}{0.35\textwidth}
\includegraphics[width=1\textwidth]{Figures/FP_MD_Mit15}
\caption{$\sigma_{\text{mit}} = 15.$}
\end{subfigure}
\caption{Cost of FPs and MDs for different attack detection thresholds and standard deviation of the attack mitigation signal.}
\label{fig:Thold}
\end{figure*}
From these plots, we observe that as the attack detection threshold $\eta$ is increased, the cost of FP decreases, while the cost of MD increases. This result is intuitive -- a low detection threshold detects most attacks but also leads to a high number of FPs. Thus, the wrongly triggered mitigations will result in a high FP cost. On the other hand, a high detection threshold yields a low number of FPs, but also increases the number of MDs. The figures show a basic tradeoff between FPs and MDs, quantified in terms of the cost function.
We also observe that these costs depend on the accuracy of the attack mitigation signal. E.g., when the accuracy is high (e.g., $\sigma_{\text{mit}} = 0, 5),$ the cost of FP is very low,
even for a low detection threshold. Thus, in this scenario, the system operator can choose a low detection threshold and obtain good system performance overall. However, when the accuracy of the mitigation signal is low (e.g., $\sigma_{\text{mit}} = 15),$ the cost of FP is very high for a low detection threshold. E.g., in Fig.~\ref{fig:Thold}(d), the cost of FP for $\eta = 0$ is greater than the cost of MD for $\eta = 5.$ In this scenario, the system operator must choose a high detection threshold to obtain an acceptable level of system performance.
Thus, our result helps the system operator select an appropriate threshold that
balances between the costs of FP and MD, depending on the accuracy of the mitigation signal.
Lastly, we note that for $\sigma_{\text{mit}} = 0$ (perfect mitigation), the cost of
FP is zero for all detection thresholds. Under perfect mitigation, even
if an FP event occurs, the controller can accurately estimate that the attack magnitude is zero (i.e., no attack). Thus, in this specific case, wrongly triggered mitigations do not increase the cost of FP.
We also note that for $\eta = 0,$ there are no MDs. Hence, the cost of MD in this case is nearly zero.
\subsection{Simulations for Voltage Control System}
Next, we perform simulations on the voltage control system using PowerWorld, which is a high fidelity power system simulator widely used in the industry \cite{PowerWorld}.
All the simulations are performed on the IEEE 9-bus system shown in Fig.~\ref{fig:9_bus}, in which buses $1$, $2$, and $3$ are the generator buses, whereas buses $5$, $7$, and $9$ are the pilot buses.
The control matrix ${\bf B}$ is estimated using linear regression on the data traces of ${\bf x}[t+1]-{\bf x}[t]$ and ${\bf u}[t]$ obtained in a PowerWorld simulation. We present the simulation results next.
First, we verify the accuracy of the LTI model in approximating the real-world voltage control system by examining the voltage at pilot bus $5$. In our simulations, the voltage controller aims to adjust the voltage of this bus from an initial voltage of $1$~pu to a setpoint (${\bf x}_0$) of $0.835$~pu (base voltage of $230$~kV) by applying the control described in \eqref{eqn:control_vg}.
Fig.~\ref{fig:comaprsion_PW_LTI} plots the bus voltage from $t = 1$ to $t =30$ obtained from the PowerWorld simulations, as well as the voltage values obtained from the LTI model. To average the effect of random measurement noise, we repeat the experiment $100$ times, and take the mean value. The two curves match
well in this figure, thus verifying the accuracy of the proposed LTI model.
\begin{figure}[!t]
\centering
\includegraphics[width=0.45\textwidth,trim={0 7cm 0 0}]{Figures/PowerworldAndLTI}
\caption{Comparison between PowerWorld and LTI model.}
\label{fig:comaprsion_PW_LTI}
\vspace*{-0.4 cm}
\end{figure}
Next, we simulate the impact of the proposed attacks on the voltage control system.
We assume that the attacker has access to the voltage sensor of bus $5,$ and injects false measurements to mislead the controller. We compute the optimal attack sequence
based on the LTI model using the MDP method implemented in MATLAB.
To evaluate the attack impact, we run Monte Carlo simulations using the PowerWorld simulator by injecting the derived optimal attack into the voltage measurements, and implementing the control in \eqref{eqn:control_vg} based on the corresponding state estimate.
Fig.~\ref{fig:voltage_state} shows the pilot bus voltage (bus 5) for different attack sequences
with $\eta = 5$ 's and perfect attack mitigation. It can be observed that the pilot bus voltage deviates from the setpoint of $0.835$~pu, and the largest voltage deviation is seen under the optimal attack. In particular, over an attack duration of $30$ time slots, we observe that bus $5$ voltage deviates to $0.65$~pu under the optimal attack, a difference of about $0.2$~pu from its setpoint.
Fig.~\ref{fig:voltage_probability} shows the attack detection probability under these attacks at different time instants. We also plot the optimal policy computed by the value iteration algorithm (Algorithm~1) in Fig.~\ref{fig:optimal_policy}a, and the optimal attack sequence for three Mote-Carlo instantiations in Fig.~\ref{fig:optimal_policy}b. We observe that the attack detection probability for a naive attack sequence (such as the ramp attack) increases with time, which results in nullifying its impact (due to attack mitigation). However, the optimal attack is crafted in a way such that the detection probability decreases over time. Consequently, the optimal attack causes a significant
deviation of the pilot bus voltage from its setpoint.
\begin{figure}[!t]
\centering
\includegraphics[width=0.45\textwidth,trim={0 5.5cm 0 0}]{Figures/voltage_powerworld_state}
\caption{Pilot bus voltage (Bus 5) under different attack sequences.}
\label{fig:voltage_state}
\vspace{-.5cm}
\end{figure}
\begin{figure}[!t]
\centering
\includegraphics[width=0.45\textwidth,trim={0 7.5cm 0 0}]{Figures/voltage_powerworld_probability}
\caption{Attack Detection probability for different attacks.}
\label{fig:voltage_probability}
\vspace{-.3cm}
\end{figure}
\begin{figure}[!t]
\centering
\begin{subfigure}{0.23\textwidth}
\includegraphics[width=1\textwidth]{Figures/mdp_policy}
\caption{}
\end{subfigure}
~
\begin{subfigure}{0.23\textwidth}
\includegraphics[width=1\textwidth]{Figures/mdp_instantiation}
\caption{}
\end{subfigure}
\caption{(a) Optimal policy for different system states as computed by the value iteration algorithm. (b) Optimal attack sequence for 3 Monte Carlo simulation instantiations.}
\label{fig:optimal_policy}
\end{figure}
\section{Conclusion}
\label{sec:Conclusion}
In this paper, we studied the performance of a CPCS with attack detection and reactive
attack mitigation. We derived the optimal attack sequence that maximizes the state estimation error over the attack
time horizon using an MDP framework. Our results show that an arbitrarily constructed attack sequence will have little impact on the system since it will be detected, hence mitigated. The optimal attack sequence must be crafted to strike a balance between the stealthiness and the attack magnitude. Our results are useful for the system operator to assess the limit of attack impact and compare different attack detection and mitigation strategies. We also quantified the impact of FP and MD on the state estimation error, which
helps select the right attack detection threshold depending on the accuracy of the attack mitigation signal.
We demonstrated the application of our results to the voltage control in a power system.
\bibliographystyle{ACM-Reference-Format}
| {'timestamp': '2017-06-07T02:03:49', 'yymm': '1706', 'arxiv_id': '1706.01628', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01628'} | arxiv |
\section{Introduction}
Computational modeling has long played a significant role within cognitive science, allowing researchers to explore the implications of cognitive theories and to discover what properties are necessary to account for particular phenomena~\cite{mcclelland2009place}. Over time, a variety of modeling traditions have seen their usage rise and fall. While the 1980s saw the rise in popularity of connectionism~\cite{thomas2008connectionist}, more recently symbolic Bayesian models have risen to prominence~\cite{chater2008probabilistic,lee2011cognitive}. While the goals of cognitive modelers have largely remained the same, increases in computational power and architectures have played a role in these shifts~\cite{mcclelland2009place}. Following this pattern, recent advances in the area of deep learning (DL) have led to a rise in interest from the cognitive science community as demonstrated by a number of recent workshops dedicated to DL~\cite{workshopCogSci2014,workshopCogSci2016,workshopNCPW15}.
As with any modeling technique, DL can be thought of as a tool which is best suited to answering particular types of questions. One such question is that of \emph{learnability}, whether an output behavior could ever be learned from the types of input given to a learner. These types of questions play an integral role in the field of language acquisition where researchers have argued over whether particular aspects of language could ever be learned by a child without the use of innate, language-specific mechanisms~\cite{smith1999infants,yang2004universal,chater2010language,pearl2014evaluating}. The success of a domain general learner does not necessarily imply that human learners acquire the phenomenon in a similar fashion, but it does open the possibility that we need not posit innate, domain-specific knowledge.
The crux of these learning problems typically lies in making a particular generalization which goes beyond the input data. One major type of generalization that DL models would need to capture is known as \emph{linguistic productivity}. A grammatical rule is considered productive when it can be applied in novel situations.
For example, as a speaker of English you may never have encountered the phrase \emph{a gavagai} before, but you now know that \emph{gavagai} must be a noun and can therefore combine with other determiners to produce a phrase such as \emph{the gavagai}. Before DL might be applied to larger questions within language acquisition, the issue of productivity must first be addressed. If DL models are not capable of productivity, then they cannot possibly serve to model the cognitive process of language acquisition. On the other hand, if DL models demonstrate basic linguistic productivity, we must explore what aspects of the models allow for this productivity.
\subsection{The Special Case of Determiners}
For decades, debate has raged regarding the status of productive rules among children acquiring their native language. On the one hand, some have argued that children seem hardwired to apply rules productively and demonstrate this in their earliest speech~\cite{valian2009abstract,yang2011statistical}. On the other, researchers have argued that productivity appears to be learned, with children's early speech either lacking productivity entirely or increasing with age~\cite{pine1996syntactic,pine2013young,meylan2017emergence}. Of particular interest to this debate has been the special case of English determiners. In question is whether or not English-learning children have acquired the specific linguistic rule which allows them to create a noun phrase (NP) from a determiner (DET) and noun (N) or if they have simply memorized the combinations that they have previously encountered. This linguistic rule, $\text{NP} \rightarrow \text{DET N}$, is productive in two senses. First, it can be applied to novel nouns, e.g. \emph{a gavagai}. Second, consider the determiners \emph{a} and \emph{the}. If a singular noun can combine with one of these determiners, it may also combine with the other, e.g. \emph{the wug}.
This type of rule seems to be acquired quite early in acquisition, making it appropriate to questions of early productivity, and provides an easy benchmark for a DL model. Yet answering such a simple question first requires addressing how one might measure productivity. Most attempts to measure productivity have relied on what is known as an \emph{overlap score}, intuitively what percentage of nouns occur with both \emph{a} and \emph{the}~\cite{yang2011statistical}. This simple measure has been the source of some controversy. \citeA{yang2011statistical} argues that early attempts failed to take into account the way in which word frequencies affect the chance for a word to ``overlap". Because word frequency follows a Zipfian distribution, with a long tail of many infrequent words, many nouns are unlikely to ever appear with both determiners. He proposes a method to calculate an expected level of overlap which takes into account these facts.
Alternatively, \citeA{meylan2017emergence} propose a Bayesian measure of productivity which they claim takes into account the fact that certain nouns tend to prefer one determiner over another. For instance, while one is more likely to hear \emph{a bath} than the phrase \emph{the bath}, the opposite is true of the noun \emph{bathroom} which shows a preference for the determiner \emph{the}~\cite{meylan2017emergence}.
The literature is quite mixed regarding whether or not children show early productivity. Differences in pre-processing have lead researchers to draw opposite conclusions from similar data, making interpretation quite difficult~\cite{yang2011statistical,pine2013young}. Indeed, most corpora involving individual children are small enough that \citeA{meylan2017emergence} argue it is impossible to make a statistically significant claim as to child productivity.
For analyzing whether or not text generated by a DL model is productive or not, we thankfully do not need to fully address the problem of inferring child productivity. Ideally, the model would demonstrate a similar level of overlap to the data it was exposed to.
We make use of the overlap statistic from Yang because it is more easily comparable to other works and has been better studied than the more recent Bayesian metric of \citeA{meylan2017emergence}.
\subsection{Deep Learning for Language Acquisition}
Deep learning, or deep neural networks, are an extension of traditional artificial neural networks (ANN) used in connectionist architectures. A ``shallow" ANN is one that posits a single hidden layer of neurons between the input and output layers. Deep networks incorporate multiple hidden layers allowing these networks in practice to learn more complex functions. The model parameters can be trained through the use of the backpropogation algorithm. The addition of multiple hidden layers opens up quite a number of possible architectures, not all of which are necessarily applicable to problems in cognitive science or language acquisition more specifically.
While the most common neural networks are discriminative, i.e. categorizing data into specific classes, a variety of techniques have been proposed to allow for truly generative neural networks. These generative networks are able to take in input data and generate complex outputs such as images or text which makes them ideal for modeling human behavior. We focus on one generative architecture in particular known as a deep \emph{autoencoder} (AE)~\cite{hinton2006reducing}.
While AEs have been used for a variety of input data types, most prominently images, we describe their use here primarily for text. The first half, the \emph{encoder}, takes in sentences and transforms them into a condensed representation. This condensed representation is small enough that the neural network cannot simply memorize each sentence and instead is forced to encode only the aspects of the sentence it believes to be most important. The second half, the \emph{decoder}, learns to take this condensed representation and transform it back into the original sentence. Backpropogation is used to train model weights to reduce the loss between the original input and the reconstructed output.
Although backpropagation is more typically applied to supervised learning problems, the process is in fact unsupervised because the model is only given input examples and is given no external feedback.
AEs have been shown to successfully capture text representations in areas such as paragraph generation~\cite{li2015hierarchical}, part-of-speech induction~\cite{vishnubhotla2010autoencoder}, bilingual word representations~\cite{ap2014autoencoder}, and sentiment analysis~\cite{socher2011semi}, but have not been applied to modeling language acquisition. While any number of DL architectures could be used to model language acquisition, the differences between ANNs and actual neurons in the brain make any algorithmic claims difficult. Instead, DL models might be used to address computational-level questions, for instance regarding whether or not a piece of knowledge is learnable from the data encountered by children. Before this can be done, however, it remains to be seen whether DL models are even capable of creating productive representations. If they cannot, then they do not represent useful models of language acquisition.
This work attempts to address this not by creating a model of how children acquire language, but by using methods from the psychological literature on productivity to assess the capability of DL to learn productive rules.
\section{Methods}
\subsection{Corpora}
To train our neural network, we make use of child-directed speech taken from multiple American-English corpora in the CHILDES database~\cite{macwhinney2000childes}. In particular, we make use of the CDS utterances in the Bloom 1970, Brent, Brown, Kuczaj, Providence, Sachs, and Suppes corpora~\cite{bloom70,Brent,Brown,Kuczaj,Providence,Sachs,Suppes}. The combined corpora contain almost 1 million utterances and span a wide age range, including speech directed to children as young as 6 months and as old as 5 years. Relevant information about the used corpora can be found in Table~\ref{tab:corpora}.
Because we are interested in seeing what the AE can learn from data similar to that encountered by children, we train the model only on child-\emph{directed} utterances. These can be produced by any adult in the dataset, including parents and researchers. Although a comparison with child-produced text holds great interest, it is not clear whether child-produced speech is rich enough to support robust language learning on its own. It therefore provides a poor basis upon which to train the AE.
Text from the various corpora is processed as a single document. Child-directed utterances are cleaned from the raw files using the CHILDESCorpusReader function of the Python Natural Language Toolkit (NLTK). Utterances from all non-children speakers are included and not limited just to the primary caregiver. Each utterance is split into words according to the available CHILDES transcription and then made lowercase. The model represents only the most frequent 3000 words, while the remainder are represented as a single \emph{out-of-vocabulary} (OOV) token. This step is taken both to reduce computational complexity but also to mimic the fact that young children are unlikely to store detailed representations of all vocabulary items encountered. Because the neural networks require each input to be of the same length, sentences are padded to a maximum length of 10 words. Sentences that are longer than this are truncated, while short sentences are prepended with a special \emph{PAD} token.
\begin{table}[h]
\centering
\begin{tabular}{l r r}
{\bf Corpora} & {\bf Age Range} & {\bf N. Utterances} \\ \hline
Bloom 1970 & 1;9 - 3;2 & 62,756 \\
Brent & 0;6 - 1;0 & 142,639 \\
Brown & 1;6 - 5;1 & 176,856 \\
Kuczaj &2;4 - 4;1 & 57,719\\
Providence &1;0 - 3;0 & 394,800 \\
Sachs & 1;1 - 5;1& 28,200 \\
Suppes &1;11 - 3;3 & 67,614 \\ \hline
Overall & 0;6 - 5;1 & 930,584 \\ \hline
\end{tabular}
\caption{\label{tab:corpora} Descriptive statistics of CHILDES corpora. Ages are given in (year;month) format and indicate the age of the child during corpus collection.}
\end{table}
\subsection{Neural Network Architecture}
\begin{figure}
\centering
\includegraphics[width=1\linewidth]{autoencoder2.pdf}
\caption{\label{fig:autoencoder} Visual representation of the autoencoder model.}
\end{figure}
Our autoencoder model was implemented using Keras and Tensorflow. The words in each sentence are input to the model as a one-hot vector, a vector of 0s with a single 1 whose placement indicates the presence of a particular word. This is an inefficient representation because it assumes all words are equally similar, e.g. that \emph{dog} is equally similar to \emph{dogs} as it is to \emph{truck}. To deal with this, the model passes the one-hot vector to an embedding layer. Neural word embeddings, as popularized by the word2vec algorithm~\cite{mikolov2013efficient}, are a way to represent words in a low-dimensional space without requiring outside supervision. Words are placed within the space such that words that are predictive of neighboring words are placed closer to one another.
Because our training data is relatively small, we keep the embedding dimensionality low, at only 30. Standard embeddings trained on much larger NLP corpora tend to use 100 or 200 dimensions.
Once each word has been transformed into a 30-dimensional embedding vector, the sequence of words is passed into a gated-recurrent unit (GRU) layer~\cite{cho2014learning}. The GRU is a type of recurrent (RNN) layer which we choose because it can be more easily trained. RNN layers read in their inputs sequentially and make use of hidden ``memory" units that pass information about previous inputs to later inputs, making them ideal for sequence tasks such as language. As such, the model creates a representation of the sentence which it passes from word to word. The final representation is the output of the encoder, a latent representation of the full sentence.
This 20-dimensional latent vector serves as the input to the decoder unit. The first layer of the decoder is a GRU layer of the same shape as in the encoder. For each timestep, we feed into the GRU the latent vector, similar to the model proposed in \citeA{cho2014learning}. Rather than producing a single output, as in the encoder, the decoder's GRU layer outputs a vector at each timestep. Each of these vectors is fed into a shared dense softmax layer which produces a probability distribution over vocabulary items. The model then outputs the most likely word for each timestep.
The model loss is calculated based on the model's ability to reconstruct the original sentence through categorical crossentropy. Model weights are trained using the Adam optimzer over 10 epochs. During each epoch the model sees the entire training corpus, updating its weights after seeing a batch of 64 utterances. While this process does not reflect that used by a child learner, it is a necessary component of training the neural network on such a small amount of data. If the network had access to the full set of speech that a child encounters such a measure likely would not be necessary. Future work might also investigate whether optimizing the dimensionality of the network might lead to better text generation with higher levels of productivity.
\subsection{Baseline Models}
Because the AE is learning to reproduce its input data, one might wonder whether similar results might be achieved by a simpler, distributional model. To assess this, we also measure the performance of an n-gram language model. We train bigram and trigram language models using the modified Kneser-Ney smoothing \cite{heafield2013scalable} implemented in the KenLM model toolkit to estimate the distributional statistics of the training corpus. Sentences are generated from the n-gram language model by picking a seed word and then sampling a new word from the set of possible n-grams. The smoothing process allows for the model to generate previously unseen n-grams. Sampling of new words continues for each utterance until the end-of-sentence token is generated or a maximum of 10 tokens is reached (the same maximum size as for the AE).
Since the AE is able to generate sentences from a latent representation, it would be inappropriate to generate n-gram sentences from random seed words. Instead, for every sentence in the test set we begin the n-gram model with the first word of the utterance. While this allows the model to always generate its first token correctly, this does not directly impact our measure of productivity as it relies on combinations of tokens.
\subsection{Productivity Measures}
We measure the productivity of our autoencoders through the overlap score described in \citeA{yang2011statistical}. Words both in the child-directed corpus and the autoencoder-generated output are tagged using the default part-of-speech tagger from NLTK. The empirical overlap scores are simply calculated as a percentage of unique nouns that appear immediately after both the determiners \emph{a} and \emph{the}. The expected overlap score is calculated based off of three numbers from the corpus under consideration, the number of unique nouns $N$, the number of unique determiners $D$, and the total number of noun/determiner pairs $S$. The expected overlap is defined as in Equation \ref{eq:expOverlap}:
\begin{equation}
\label{eq:expOverlap}
O(N,D,S) = \frac{1}{N} \sum_{r=1}^{N} O(r,N,D,S)
\end{equation}
where $O(r,N,D,S)$ is the expected overlap of the noun at frequency rank $r$:
\begin{equation}
\label{eq:expOverlap2}
O(r, N, D, S) = 1 + (D-1)(1-p_r)^S - \sum_{i=1}^{D}[(d_ip_r+1-p_r)^S]
\end{equation}
$d_i$ represents the probability of encountering determiner $i$, for which we use the relative frequencies of \emph{a} and \emph{the} calculated from the training corpus (39.3\% and 60.7\%, respectively). The probability $p_r$ represents the probability assigned to a particular word rank. The Zipfian distribution takes a shape parameter, $a$ which \citeA{yang2011statistical} set equal to 1 and which we optimize over the training corpus using least squares estimation and set at 1.06:
\begin{equation}
\label{eq:expOverlap3}
p_r = \frac{^{1}/_{r^a}}{\sum_{n=1}^N (\frac{1}{n^a})}
\end{equation}
It should be noted that Zipfian distributions are not perfect models of word frequencies~\cite{piantadosi2014zipf}, but assigning empirically-motivated values to the determiner probabilities and Zipfian parameter $a$ represents an improvement upon the original measure.
\section{Results}
We analyze our overlap measures for the adult-generated (i.e. child-directed) as well as the autoencoder and n-gram model-generated text and present these results in Figure \ref{fig:overlap}. We analyze overlap scores across 10 training epochs with three levels of dropout, 10\%, 20\%, and 30\%. Dropout is typically included in neural models to encourage the model to better generalize. We hypothesized that a certain level of dropout would encourage the model to generate novel combinations of words that might lead to higher overlap scores. We find that with only two training epochs the AEs have already begun to near their maximum overlap performance. The 30\% dropout AE achieves the highest level of performance, matching the empirical overlap score of the original corpus. The 10\% and 20\% dropout models perform somewhat worse suggesting that high levels of dropout may be necessary for good text generation.
In Table \ref{tab:overlap}, we present the results for the final epoch of the AE models as well as for the adult-generated and n-gram generated text. We note that the expected overlap measure consistently overestimates the productivity of all learners, including the adult-generated text. It is unclear why this should be the case, but could be a result of capping the model vocabularies, resulting in lower $N$ values. In particular, the autoencoders tend to produce a relatively limited set of nouns. Looking at empirical overlap measures, the worst-performing models are the bigram and trigram models with overlap scores below 30\%. The AEs fair much better all producing overlap scores over 50\%. The 30\% dropout AE is actually able to match the overlap score of the original adult-generated corpus (59.4\% vs. 59.3\%).
Looking at the number of unique nouns following a determiner ($N$) and the total number of determiner-noun pairs ($S$), it becomes clear there are large differences between the n-gram and AE models. The n-gram models tend to produce very few determiner-noun pairs (low $S$) but are likely to choose from any of the nouns in the corpus, leading to high $N$. This fact accounts for the low overlap scores that they achieve. In contrast, the AEs follow a pattern which mirrors the adult corpus with few unique nouns but a large number of noun-determiner pairs. In all cases, however, the AEs produce both fewer unique nouns and fewer noun-determiner pairs than the original corpus.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{overlap_fig}
\caption{\label{fig:overlap} Empirical overlap scores. Adult-generated speech is marked by the solid black line while autoencoder-generated speech is marked by the dashed colored lines. Results are presented for three levels of dropout, 10\%, 20\%, and 30\%. The x-axis represents the training epoch of the model.}
\end{figure}
\begin{table}[h]
\centering
\begin{tabular}{l r r r r}
& {\bf {\em N}}&{\bf {\em S}} & {\bf Exp. Over.} & {\bf Emp. Over.} \\ \hline
{\bf Adult} & 1,390 & 34,138 & 77.5\% & 59.3\% \\ \hline
{\bf AE 10\%} & 861 & 29,497 & 88.4\% & 53.3\% \\
{\bf AE 20\% }& 870 & 28,817 & 87.6\% & 53.4\% \\
{\bf AE 30\% }& 816 & 31,181 & 90.8\% & 59.4\% \\ \hline
{\bf Bigram }& 1,780 & 5,177 & 17.6\% & 28.6\% \\
{\bf Trigram } & 2,506 & 4,595 & 11.2\% & 22.1\% \\ \hline
\end{tabular}
\caption{\label{tab:overlap} Expected and empirical overlap scores for adult- and autoencoder-generated language with varying levels of dropout. Expected overlap scores were calculated as in Yang (2011). Empirical overlap was calculated as the percent of unique nouns that appeared immediately following both \emph{a} and \emph{the}.}
\end{table}
One possible problem for calculating the expected overlaps comes from the difficulty of part-of-speech tagging text generated by the neural network. Whereas adult-generated speech follows set patterns that machine taggers are built to recognize, the neural network does not necessarily generate well-formed language. Examples of AE-generated text can be found in Table \ref{tab:exampleOutput}. In some cases, the tagger treats items that occur after a determiner as a noun regardless of its typical usage. For example, in the generated sentence \emph{let put put the over over here}, the phrase \emph{the over} is tagged as a DET$+$N pair. These type of errors are further evidenced by the fact that the trigram language model produces a larger set of words tagged as nouns than the original adult-generated corpus (2,506 vs. 1,390).
Another explanation for the difference between expected and empirical overlaps may come from deviation from a true Zipfian distribution of word frequencies. If word frequencies are Zipfian, we should expect a perfect correlation between log ranks and log counts. \citeA{yang2011statistical} report a correlation of 0.97, while our larger corpus deviates from this with $r^2 = 0.86$. Although we attempt to take this into account by fitting the Zipfian distribution's shape parameter, this divergence clearly indicates that further work is needed.
The success of the AE model in generating productive text serves as a confirmation that unsupervised neural models might be used in future work to investigate other cognitive phenomena. This work does not directly address the question of how infants might learn to produce productive speech, it does represent one possible approach. AEs can, for instance, be thought of as information compression algorithms which learn to represent high-dimensional data into a low-dimensional latent space~\cite{hinton2006reducing}. If the brain likewise attempts to find efficient representations of the stimuli it encounters then it may prove fruitful to investigate how these representations compare to one another.
\begin{table}[h]
\centering
\begin{tabular}{l l}
{\bf Adult} & {\bf Autoencoder} \\ \hline
falling down & down down \\ \hline
you're playing with & you're playing with \\
your bus &the head \\ \hline
why did OOV say what's & what what you say say \\
wrong with these apples & say with {\bf the dada} \\
\end{tabular}
\caption{\label{tab:exampleOutput} Example adult and AE-generated language. The AE-generated text is from the final epoch of the AE with 20\% dropout. In bold is a DET$+$N combination that does not appear in the AEs input.}
\end{table}
\section{Conclusion}
While there is great interest regarding the inclusion of deep learning methods into cognitive modeling, a number of major hurdles remain. For the area of language acquisition, deep learning is poised to help answer questions regarding the learnability of complex linguistic phenomena without access to innate, linguistic knowledge. Yet it remains unclear whether unsupervised versions of deep learning models are capable of capturing even simple linguistic phenomena. In this preliminary study, we find that a simple autoencoder with sufficient levels of dropout is able to mirror the productivity of its training data, although it is unclear whether this proves productivity in and of itself.
Future work will need to investigate whether more complex models might be able to generate text with higher productivity as well as further investigating how particular model choices impact performance. It would also be worthwhile to compare AEs against simpler models such as a basic LSTM language model. While additional work needs to be done to motivate the use of deep learning models as representations of how children might learn, this preliminary work shows how one might combine techniques from deep learning and developmental psychology.
\section{Acknowledgments}
The authors thank the reviewers for their thoughtful comments and Lisa Pearl for initial discussion regarding productivity.
\bibliographystyle{apacite}
\setlength{\bibleftmargin}{.125in}
\setlength{\bibindent}{-\bibleftmargin}
| {'timestamp': '2017-06-07T02:08:19', 'yymm': '1706', 'arxiv_id': '1706.01839', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01839'} | arxiv |
\section{Introduction and Motivation}\label{Intro}
The topic of control over a communication link has been extensively
studied in the past decade, with issues such as the minimum data rate for
stabilization \cite{Tak,Nair} and optimal quadratic
closed-loop performance \cite{Sche,Imer} being the main focus. Other
issues of interest concern effects of channel-induced packet
loss and/or time-varying delays on closed-loop performance.
The majority of papers concerned with control over networks regards the
mechanism of information loss in the network as probabilistic but
not strategic. In contrast, in the \emph{adversarial} networked control
problem, the communication link is controlled by a strategic
jammer who actively modifies the link to disrupt the control
goal. We broadly refer to such modifications/disruptions as Denial of
Service attacks; cf.~\cite{PIK-2011}.
A natural way to describe the adversarial networked control problem
is to employ a game-theoretic formulation. While the most immediate purpose
of the game-theoretic analysis may be to devise the best defence against
strategic attacks, it can also be used to predict possible attack
strategies.
Originally proposed in~\cite{Amin}, the game-theoretic formulation of
adversarial networked control has been followed upon in a number of recent
papers including~\cite{Abhi,LaU3a}.
A zero-sum dynamic game between a controller performing a finite horizon
linear-quadratic control task and a jammer, proposed in \cite{Abhi},
specifically accounted for the jammer's strategic intentions and
limited actuation capabilities. A startling conclusion of \cite{Abhi} was that
in order to maximally disrupt the control task, the jammer had to act in a
markedly different way than a legitimate, non-malicious, packet-dropping
channel. More precisely, the jammer's saddle-point strategy was to
deterministically drop packets whenever the plant state was crossing
certain thresholds. Once this deterministic behavior is observed by the
controller, it can establish with certainty that an attack has taken place.
The chief motivation behind the present work is to investigate whether it
is possible in principle for the attacker to be able to conceal its actions
by disguising as a packet dropping link. Naturally, this implies that the
controller has no prior information of the attack taking place.
In~\cite{LaU3a}, to demonstrate such a possibility, we introduced a model
of adversarial networked control (ANC), which, while capturing the same
fundamental aspects of the problem as in \cite{Abhi}, modified the
jammer's action space so that each jammer's decision corresponded to a choice
of a binary automaton governing the transmission rather than to passing/blocking
transmission directly. The
corresponding one-step zero-sum game was shown to have a unique
saddle point in the space of mixed jammer's strategies.
The optimal jammer's strategy was shown to randomly choose between two
automata, each having a nonzero probability to be selected. In turn, the
controller's best response to
the jammer's optimal strategy was to act as if it was operating
over a packet-dropping channel whose statistical characteristics were controlled
by the jammer. Since under normal circumstances the controller cannot be
aware of these characteristics, and cannot implement such a
best response strategy, the system performance is likely to be adversely
affected when the jammer follows its optimal strategy; see
Section~\ref{LQR.reward.section}.
In this paper, we show that such a situation is not specific to the
ANC problem considered in~\cite{LaU3a}, and it arises in a much more general
zero-sum stochastic game setting. The only common
feature between our problem formulation and that in~\cite{LaU3a} is the
general mechanism of decision making adopted by the jammer. All other
attributes of the problem (the plant model, the assumptions on the
stage cost, etc.) are substantially more general, to the extent
that unlike~\cite{LaU3a}, the saddle point cannot be computed
directly. Instead, for the one-step game, we obtain sufficient conditions
under which optimal jammer's strategies in the class of mixed strategies
are to randomly choose between two actions. That is, to make a maximum
impact on the control performance,
the jammer must act randomly, in contrast to~\cite{Abhi}.
Our conditions for the one-step game are quite general, they apply to nonlinear
systems and draw on standard convexity/coercivity properties of payoff
functions. Under additional smoothness conditions, these conditions are
also necessary and sufficient. Also, we specialize these conditions
to three linear-quadratic control problems over a packet-dropping link. In
two of these problems, our conditions allow for a direct
characterization of a set of plant's initial states for which optimal
jammer's randomized strategies exist. We also compute controller's optimal
responses to those strategies, which turn out to be nonlinear. The third
example revisits the problem setting in \cite{Abhi}, showing that our
conditions naturally rule out randomized jammer's behaviour in that
problem.
Our analysis of the one-step game can be thought of as reflecting a
more general
situation where one is dealing with a one-step
Hamilton-Jacobi-Bellman-Isaacs (HJBI) min-max problem associated
with a multi-step ANC problem.
Also, even the one-step formulation provides a rich insight into
a possible scenario of attacks on controller networks. For instance,
dynamic multistep jamming attacks can be planned so that at each step the
jammer chooses its actions based on the
proposed formulation. Greedy jamming strategies where at each
time step the jammer pursues a strategy which is optimal only at this
particular time are discussed
in Section~\ref{multistage}.
Compared with the conference version~\cite{LaU3c}, here we have obtained a
new sufficient condition for the one-step ANC game to have a
nontrivial equilibrium. This condition does not
require the stage cost to be a smooth function, which potentially makes
this result applicable to the mentioned one-step HJBI min-max problems
where in general
the smoothness of the value function cannot be guaranteed in advance; see
Theorem~\ref{exist_theo}. Also, the paper introduces a multi-stage game
model to study intelligent jamming attacks on linear
control systems.
The paper is organized as follows. A general controller-jammer ANC game and
its connections with
intelligent jamming models are
presented in Section~\ref{sec_mod}. The conditions for the one-step ANC
game to have a non-pure saddle point are presented in
Section~\ref{Static.ANC.Section}. First we
present a general sufficient condition suitable for analysis of
general multi-input networked control systems. We then show that in the case of single-input
systems they are in fact necessary and sufficient (under an additional
smoothness assumption). Next, in
Section~\ref{Examples} we demonstrate applications of these results to three
linear-quadratic static problems. In one of
these problems, which is an extension of the problem in~\cite{LaU3a}, the
jammer is offered an additional reward for undertaking actions concealing its
presence. In another problem, the jammer's actions take into account the cost
the controller must pay to mitigate the jammer's presence should the jammer
reveal itself. The third problem revisits the problem
in~\cite{Abhi}. Section~\ref{multistage} generalizes some of the results of
Section~\ref{Static.ANC.Section} about the
existence of saddle-point strategies to the case of multistage ANC games;
this generalization requires the plant to be linear. The Appendix
(Section~\ref{Appendix}) contains proofs of the results.
Conclusions are given in Section~\ref{Conclusions}.
\vspace{-20pt}
\paragraph*{Notation}
$\mathbb{R}^n$ is the $n$-dimensional Euclidean space of real vectors,
$\mathbb{R}^n_+$ is the cone in $\mathbb{R}^n$ consisting of vectors whose
all components are non-negative.
The unit simplex in $\mathbb{R}^N$ is denoted $\mathcal{S}_{N-1}$; i.e.,
$\mathcal{S}_{N-1}=\{p\in \mathbb{R}^N: 0\le p_j\le 1,
\sum_{j=1}^Np_j=1\}$. $|\mathcal{F}|$ is
the cardinality of a finite set
$\mathcal{F}$. $\delta_{i,j}$ is the Kronecker symbol, i.e.,
$\delta_{i,j}=1$ if $i=j$, otherwise $\delta_{i,j}=0$.
For two sets $M$, $U$, $M\backslash U=\{x\in M\colon x\not\in
U\}$. The symbol $\mathrm{Pr}(\cdot)$ denotes probability of an event, and
$\mathrm{Pr}(A|z)$ denotes the conditional probability of an event $A$
given $z$.
\section{Adversarial Network Control Games}
\label{sec_mod}
\subsection{The general system setup}\label{setup}
We consider a general setup, within which the evolution of a plant controlled over a
communication link subject to adversarial interference is described by a
mapping $\mathbb{R}^n\times \mathbb{R}^m\to \mathbb{R}^n$,
\begin{equation}
\label{plant.t}
x^{t+1}=F_t(x^t,v^t),
\end{equation}
describing the response of the plant, when it is at state $x^t$, to an
actuator signal $v^t$ at time $t$. The actuator signal is determined by the
controller who transmits control packets over a randomly varying
communication link.
The link can operate in one of several transmission regimes, and randomly
switches between them. The mechanism of the regime switching is controlled
by a strategic jammer, unbeknownst to the controller. For
simplicity, we identify the set of transmission regimes with the set of
integers, so that $\mathcal{F}=\{1,\ldots,|\mathcal{F}|\}$. Once the link
updates its transmission regime, it randomly assumes either the passing or
blocking state. Thus, the transmission state of the communication
link is a binary random variable $b_t$, taking values 0 and 1 associated
with blocking and passing control packets, and $v^t=b^tu^t$.
Evolution of the system over a time interval $\{0,\ldots,T\}$ is
captured by a bivariate stochastic process $\{(x^t,s^t)\}_{t=0}^T$, with
the state space $\mathcal{X}=\mathbb{R}^n\times \mathcal{F}$. We now
describe the dynamics of this bivariate process.
\textit{The initial state. }
Initially, at time $t=0$ the plant is at a state $x^0=x_0$, and the initial
transmission regime of the communication link is $s^0=s$. It is assumed that at
the time when the controller and the attacker make their decisions, both of
them know the current state of the plant and the transmission regime of the
link. In accordance with this assumption, they know $x^0$, $s^0$.
\textit{State updates. } The system state and the transmission regime of
the communication link are updated at every time $t$, in response
to controller's and jammer's actions, as described below.
\emph{Controller actions. }
At every time instant $t=0,\ldots,T-1$, the controller observes the current
system state $x^t$ and the transmission regime $s^t$ of the communication
link. Based on this information, it generates a control input
$u^t\in \mathbf{R}^m$ and sends it via
the communication link.
\emph{Jammer actions.} At every time step $t=0,\ldots, T-1$, the jammer observes
the plant state $x^t$, the transmission regime of the communication link
$s^t$, and the control signal $u^t$. Using this information, the jammer
selects a matrix from a predefined finite set of row stochastic matrices
$\mathcal{P}^t=\{P^t(a)\in \mathbb{R}^{|\mathcal{F}|\times
|\mathcal{F}|}\colon a\in \mathcal{A}=\{1,\ldots,N\}\}$. That is, its
action $a^t$ is to draw a matrix $P^t(a^t)\in\mathcal{P}^t$.
\emph{Communication link update. }
After the jammer has chosen its action $a^t=a$ and the corresponding
row stochastic matrix $P^t(a)$, the transmission regime of
the link changes from $s^t$ to $s^{t+1}$ according to a Markov chain with
$\mathcal{F}$ as a state space and $P^t(a^t)=P^t(a)$ as the transition
probability
matrix, i.e.,
\begin{eqnarray}\label{Pt}
\mathrm{Pr} (s^{t+1} = i| s^t=j, a^t=a)=P_{ji}^t(a) \quad
i,j\in \mathcal{F}.
\end{eqnarray}
The initial probability distribution of this Markov chain reflects that the
initial transmission regime is given to be $s^0=s$, i.e.,
$\mathrm{Pr}(s^0=i)=\delta_{i,s}$, $i\in\mathcal{F}$.
After the communication link randomly switches to the
transmission regime $s^{t+1}\in\mathcal{F}$, the transmission state of the
link is determined randomly and, given $s^{t+1}$, it is conditionally
independent of the previous transmission regimes, the current and past
states of the plant and the controller's and jammer's actions. Thus, the probability
of the link to become passing is determined by a stochastic kernel
$\mathbf{q}^t$ on
$\{0,1\}$ given $\mathcal{F}$:
\begin{eqnarray}
q_j^t = \mathbf{q}^t(b^t=1|j)&\triangleq& \mathrm{Pr}(b^t = 1 |s^{t+1}=j),
\quad j\in \mathcal{F}.
\label{q_j}
\end{eqnarray}
We denote $q^t\triangleq (q_1^t, \ldots,q_{|\mathcal{F}|}^t)'$. It is worth
noting that the pair of processes $(s^{t+1},b^t)_{t=0}^{T-1}$ form a
controlled hidden Markov process, with $\mathcal{F}$ and $\{0,1\}$ as its
the state space and the output alphabet, respectively, $\{\delta_{s^0,j},
j\in \mathcal{F}\}$ as its initial probability distribution, the sequence
of matrices $\{P^t(a^t)\}_{t=0}^{T-1}$ as the sequence of state
transition probability matrices, and the the sequence of stochastic kernels
$\{\mathbf{q}^t\}_{t=0}^{T-1}$ on $\{0,1\}$ given $\mathcal{F}$ as the
output probabilities. This hidden Markov process is denoted $\mathcal{M}$.
\emph{Plant state updates.}
Next, the plant state is updated according to (\ref{plant.t}), in response to
control $u^t$ and the jammer's action $a^t$. Specifically,
the transmission state of the link between the controller and the plant is
determined by the binary random variable $b^t$, whose
probability distribution given
$(x^t,s^t)$, $u^t$ and $a^t$
can now be expressed as
\begin{eqnarray}
&&\mathrm{Pr}(b^t=1|s^t\!=j,a^t\!=a,x^t\!=x,u^t\!=u)
=(P^t(a)q^t)_j, \quad \label{Prob.b=1}\\
&&\mathrm{Pr}(b^t=0|s^t=j,a^t=a)
=1-(P^t(c,a)q^t)_j.\label{Prob.b=0}
\end{eqnarray}
Then the actuator signal $v^t$ becomes $v^t=b^tu^t$, and
according to (\ref{plant.t}), the plant's new state becomes $x^{t+1}$.
\begin{proposition}\label{Markov}
Given a sequence of controller's and jammer's actions, the joint state-link
process $\{x^t,s^t\}_{t=0}^T$ is a Markov process.
\end{proposition}
The proof of this and all subsequent propositions is deferred to the
Appendix.
The transition probability measure of the Markov process
$\{x^t,s^t\}_{t=0}^T$ defines a
sequence of stochastic kernels on $\mathcal{X}$, given
$u\in\mathbb{R}^m$, and $a\in\mathcal{A}$,
\begin{eqnarray}
\label{Q.ker}
\lefteqn{Q_{t+1}(\Lambda\times S|x,j,u,a)} && \nonumber \\
&=& \mathrm{Pr}(x^{t+1}\in\Lambda,s^{t+1}\in S| x^t=x,s^t=j,u^t=u,a^t=a) \nonumber \\
&=&
\sum_{i\in S}P^t_{ji}(a)\left[q^t_i\chi_\Lambda(F_t(x,u)) +
(1-q^t_i)\chi_\Lambda(F_t(x,0))\right]
\end{eqnarray}
for $t=0, \ldots, T-1$; here $\Lambda$, $S$ are Borel subsets of
$\mathbb{R}^n$, $\mathcal{F}$ respectively, and $\chi_\Lambda(\cdot)$ is
the indicator function of the set $\Lambda$.
The expectation with respect to the kernel $Q_t(\cdot |x,s,u,a)$
will be denoted $\mathbb{E}_t[\cdot|x,s,u,a]$.
\subsection{An adversarial network control game}
\label{sec_form}
We now consider a zero-sum stochastic game associated with the described setup. Its main components are:
\begin{itemize}
\item
The set $\mathcal{X}=\mathbb{R}^n\times \mathcal{F}$ as the state space of
the game;
\item
the sets $\mathbb{R}^m$ and $\mathcal{A}$ as action spaces for the
controller and the jammer, respectively.
\item
The sequence of stochastic kernels (\ref{Q.ker}) on $\mathcal{X}$ given
$\mathcal{X}\times \mathbb{R}^m\times \mathcal{A}$ and
the Markov process $\{(x^t,s^t)\}_{t=0}^T$ associated with
given sequences of controller's and jammer's actions.
\item
A real-valued finite horizon cost
\begin{equation}
\label{cost_cont}
\Upsilon\left(\{x^t\}_{t=0}^T, \{u^t\}_{t=0}^{T-1} \right) = \sum_{t=0}^{T-1}
\sigma^t(x^t,u^t) + \sigma^T(x^T).
\end{equation}
The stage cost $\sigma^t(x^t,u^t)$ in (\ref{cost_cont})
symbolizes the performance loss incurred by the system (1) when the control
$u^t$ is applied to the system while it is in state $x^t$. In the
absence of the jammer, the controller would be expected to minimize this
loss.
\item
A real-valued function representing the cost of jammer's actions
$a^t$, $t=0,\ldots, T$:
\begin{equation}
\label{cost_jam}
\Gamma(\{a^t\}_{t=0}^{T-1},\{s^t\}_{t=0}^{T-1}) =\sum_{t=0}^{T-1}
g^t(a^t,s^t).
\end{equation}
It describes how the jammer's resources and
incentives are affected, when it takes its actions to control
the communication link. The stage cost $g^t(a^t,s^t)$ in (\ref{cost_jam})
symbolizes the cost incurred by the jammer when at time $t$ it selects
$P^t(a^t)$ as a state transition probability matrix for the Markov
process $\mathcal{M}$. Normally, the jammer
would be expected to minimize this cost.
\item
A total cost of the controller's and jammer's actions
\begin{eqnarray}
\lefteqn{\Sigma\left(\{x^t\}_{t=0}^T, \{u^t\}_{t=0}^{T-1},
\{a^t\}_{t=0}^{T-1}\right)} && \nonumber \\
&&=\Upsilon\left(\{x^t\}_{t=0}^T, \{u^t\}_{t=0}^{T-1} \right)
-\Gamma\left(\{a^t\}_{t=0}^{T-1},\{s^{t-1}\}_{t=0}^T\right). \qquad
\label{cost_total}
\end{eqnarray}
The minus sign in (\ref{cost_total}) indicates that degrading the control performance comes at a cost
to the jammer, who must spend its resources to achieve its goals.
\end{itemize}
In what follows we consider a class of control input sequences
$\{u^t\}_{t=0}^T$ and a class of jammer's strategies consisting of sequences
$\{p^t\}_{t=0}^{T-1}$ of probability vectors $p^t$ over $\mathcal{A}$.
Associated with every such
sequence of the controller's and jammer's strategies
$\{u^t\}_{t=0}^{T-1}$, $\{p^t\}_{t=0}^{T-1}$ and system and link
initial conditions $x^0,s^0$ is a
probability distribution on the space of sequences of system and
communication link states endowed with the $\sigma$-algebra of all Borel
subsets\footnote{In (\ref{total.Q}), $x_t$ is an arbitrary vector in
$\mathbb{R}^n$, in contrast to the state $x^t$ of the plant at time
$t$. Likewise, $s_t$ is an
integer in $\mathcal{F}$, in contrast to the random state $s^t$ of the
Markov process $\mathcal{M}$ with values in $\mathcal{F}$.}
\begin{eqnarray}
\label{total.Q}
\lefteqn{\mathbf{Q}^{u,p}(dx_1\ldots,dx_T,s_1,\ldots,s_T|x_0,s_0)}
&& \nonumber \\
&&=
Q^{u,p}_1\!(dx_1,\!s_1|x_0,s_0) \ldots
Q^{u,p}_T(dx_T,\!s_T|x_{T-1},\!s_{T-1}),
\end{eqnarray}
generated by the sequence of stochastic kernels
\begin{eqnarray}
\label{Q.ker.p}
\lefteqn{Q^{u,p}_{t+1}(dx,s|x,j)=
\sum_{a\in\mathcal{A}} p^t_aQ_{t+1}(dx,s|x,j,u^t,a),}
\end{eqnarray}
where $Q_t$ is the stochastic kernel defined in (\ref{Q.ker}).
The expectation with respect to the probability measure
$\mathbf{Q}^{u,p}$ will be denoted $\mathbb{E}^{u,p}$.
We will omit the superscripts $^{u,p}$ when this does not lead to a
confusion.
\begin{definition}
The zero-sum stochastic game with the state space $\mathcal{X}$, action
spaces $\mathbb{R}^m$ for the controller and $\mathcal{A}$ for the jammer,
the stochastic kernels $\{Q^t,t=0,\ldots,T\}$ defined in (\ref{Q.ker}) and the
payoff function $\Sigma$ is called the adversarial networked control (ANC) game
associated with the Markov process $\{(x^t,s^t)\}_{t=0}^T$ and costs
(\ref{cost_cont}), (\ref{cost_jam}), (\ref{cost_total}).
For a given plant initial condition $x^0=x$ and an initial transmission
regime of the link
$s^0=s$, solving the
ANC game requires one to find (if they exist) strategies for the jammer
$p^*=\{(p^*)^t\}_{t=0}^{T-1}$ and
for the controller $u^*=\{(u^*)^t\}_{t=0}^{T-1}$
such that
\begin{eqnarray}
\lefteqn{\mathbb{E}^{u,p^*}\left[\Sigma\left(\{x^t\}_{t=0}^T,
\{(u^*)^t\}_{t=0}^{T-1}, \{a^t\}_{t=0}^{T-1}\right)\right]} && \nonumber \\
&&
=\inf_{\{u^t\}_{t=0}^{T-1}}\sup_{\{p^t\}_{t=0}^{T-1}}
\mathbb{E}^{u,p}\left[\Sigma\left(\{x^t\}_{t=0}^T, \{u^t\}_{t=0}^{T-1},
\{a^t\}_{t=0}^{T-1}\right)\right] \nonumber \\
&&
=\sup_{\{p^t\}_{t=0}^{T-1}}\inf_{\{u^t\}_{t=0}^{T-1}}
\mathbb{E}^{u,p}\left[\Sigma\left(\{x^t\}_{t=0}^T, \{u^t\}_{t=0}^{T-1},
\{a^t\}_{t=0}^{T-1}\right)\right].\nonumber \\
\label{equi-point.t}
\end{eqnarray}
\end{definition}
\subsection{Additional comments and special cases}
\subsubsection{Relation to conventional DoS attacks on
communications}\label{relation}
In the model presented in Section~\ref{setup}, the adversary
controls information transmission strategically and indirectly, unbeknownst
to the controller. The motivation for introducing the indirect jamming
model is to reduce the possibility of attack detection by adding intelligence to
jamming strategy and attempting to force the controller to believe that
performance degradation is due to poor link conditions and not due to the
presence of the attack, i.e., our model is consistent with objectives of
\emph{intelligent Denial-of-Service
jamming}~\cite{PIK-2011}. We now present two intelligent jamming
scenarios which our model captures.
\begin{figure}
\centering
\includegraphics[width=0.9\columnwidth]{system.eps}
\caption{An attack by re-routing control packets. The jammer
strategically selects a binary channel which randomly blocks or passes
transmission of control information from the controller to the plant.}
\label{fig:system}
\end{figure}
\emph{An attack by re-routing. }
In this scenario, the controller and the plant are connected by a multi-hop
network (i.e., a graph), with each transmission regime corresponding to a
path connecting the controller and the plant vertices in that graph. Assuming that the graph is acyclic, the set of
such paths has finite (yet possibly large) cardinality, so it can be modeled by
our set $\mathcal{F}$.
When a jammer intercepts a message at a vertex and re-routes it on an
outgoing edge of its choosing it, essentially, modifies the characteristics
(packet-drop rate, delay, etc.) of the communication channel experienced by
the controller. It can thus, in effect, be thought of as controlling the
characteristics of a communication channel or as `switching' channels.
Accordingly, the jammer can be thought of having the action set
$\mathcal{A}=\mathcal{F}$, and the row stochastic matrices (\ref{Pt})
describing changes of the transmission regimes in this example are defined as
\begin{equation}
\label{Pt.1}
P^t_{ji}(a)=\begin{cases}1, & \text{if $i=a$},\\
0, & \text{if $i\neq a$},
\end{cases}
\end{equation}
i.e., the control information is transmitted through the channel selected
by the jammer.
The controller may know the previous channel
used for transmission (e.g., from an acknowledgement from the plant), and
therefore in general its decision $u^t$ can depend on $s^t$. However, even
though the controller has knowledge about the previously used channel and
can use this knowledge to select a channel which it wants to use, the
attacker overrules this selection and redirects control packets through a
different channel. The
actual mechanism through which (re)routing, and the ensuing `switching',
is performed in the network is not important for our purposes. All that
matters is that jammer's actions eventually affect the row stochastic
matrix describing transmission, as (\ref{Pt.1}) shows. In that
sense, the picture in Fig.~\ref{fig:system} is a good metaphor (it is not
an exact technical description) of the jamming process.
Letting the jammer select the channel
randomly, according to a probability vector
$p^t=(p^t_1,\ldots,p^t_N)'$ over $\mathcal{F}$
will allow it to control the probability of packet dropouts, since in this
case
\begin{eqnarray}
\label{bt=1}
\mathrm{Pr}(b^t=1|s^t=j)=(p^t)'q^t.
\end{eqnarray}
As a result, the end-to-end statistical characteristics of
the communication link depend on the jammer's selection of the probability
distribution $p^t$ but are independent of the past channel
$s^t$ known to the controller. Hence, such characteristics are
difficult for the controller to predict. Implications of this observation
will be considered in detail in the next sections.
\emph{An attack by modifying channel characteristics. }
Where there is a single physical channel between the
controller and the plant, the adversary can interfere with transmission by
means of intercepting control packets and `filtering' them through one of
several binary automata available to it. Each `filter'-automaton determines
the transmission regime in this case. Indeed, let again
$\mathcal{A}=\mathcal{F}$ and let $P^t_{ji}(a)$ be defined as in
(\ref{Pt.1}). Then the probability for the link to become passing when
the jammer selects automaton $a^t=i$ becomes the function of the jammer's
action, since according to~(\ref{Prob.b=1}) we have:
\begin{eqnarray*}
\mathrm{Pr}(b^t=1|s^t=j,a^t=i)=q^t_i
=\mathrm{Pr}(b^t=1|a^t=s^{t+1}=i).
\end{eqnarray*}
Again, we see that this probability does not depend on the transmission
regime $s^t$ utilized at the previous time step but depends on the jammer's
action. As in the previous attack model considered, the end-to-end
statistical characteristics of the communication link depend on the
jammer's actions and hence are difficult for the controller to
predict. Letting the jammer select its actions according to a probability
distribution $p^t=(p^t_1,\ldots,p^t_N)'$ will allow it to exercise even
greater control over the distribution of $b^t$, according to (\ref{bt=1}).
In this scenario, since the transmission regimes are fully controlled by
the jammer, the controller is unlikely to be able to observe past jammer's
actions. In view of this restriction, the controller's feasible strategies are
limited to state feedback strategies $u^t=u^t(x^t)$, which are a special
case of more general control strategies dependent on $s^t$
mentioned earlier.
In both attack scenarios presented above, direct jamming has been
forsaken in favour of intelligently controlling the probability of control
packets delivery. As was mentioned, a direct control over
transmission was shown in~\cite{Abhi} to result in a deterministically
predictable jamming strategy. We will show in this
paper that the proposed intelligent jamming strategies lead to a distinctly
different jammer behaviour while forcing the controller to respond in a manner
distinct from what one would expect in the situation where packet loss is
benign.
\subsubsection{Strategy spaces}
In the ANC game (\ref{equi-point.t}),
an optimal jammer's strategy is sought in the set of mixed strategies, i.e.,
probability distributions on $\mathcal{A}$. On the other hand,
the controller does not use mixed strategies. Indeed, in a number of control
problems considering benign loss of communication, optimal
control laws are sought in the class of linear non-randomized functions of
the (estimated) state of the plant; e.g, see~\cite{Sche}. It is this sort of
situation that we consider as a target for stealthy intelligent jamming ---
unless
the controller knows that the system is under attack, it has no reason to
deviate from its optimal policy.
\subsubsection{The actuation model and control information}
The proposed actuation model assumes that
when the link drops control packets,
the actuator signal $v^t$ is set to 0. The `hold' situation where
$v^t$ is set to the last received control signal
$u^-$ whenever $u^t$ is dropped, can be reduced to this case by the change
of control variables.
Our control model includes feedback controls that use
the full information about the state of the underlying Markov process
$\mathcal{M}$. In practice, it may not always be possible for the
controller to observe this state; the second example in
Section~\ref{relation} alludes to such
situation. Games with partial information are known to be much more
difficult to solve, and the existence of a saddle point is more difficult
to establish if possible at all. Considering a larger class of
controllers which includes Markov control laws allows us to circumvent this
difficulty, and obtain conditions under which the ANC
game has an equilibrium (as will be shown, under these conditions, the
controller's
optimal response is indeed Markov). The upper value of this game then
sets the lower bound on control performance which can be achieved when, for
instance, the controller is agnostic about the transmission characteristics
of the communication link.
\section{Static ANC games}\label{Static.ANC.Section}
\subsection{One-stage ANC games}
Our aim is to determine conditions under
which an ANC game admits non-pure saddle points. By non-pure saddle point
we mean a saddle point of the game (\ref{equi-point.t}) consisting of
sequences of non-pure strategy vectors $(p^*)^t$, each being a linear
combination of two or more vertices of the simplex
$\mathcal{S}_{N-1}$, and the corresponding controller's best
responses $(u^*)^t$. As demonstrated in Section~\ref{relation},
non-pure policies allow the attacker to
exercise an intelligent DoS jamming by randomizing its actions and
controlling the probability of control packet transmission. To facilitate characterization of non-pure ANC
saddle-point strategies, in this section we consider one-stage ANC games which can be
regarded as a special case of the ANC game (\ref{equi-point.t}) played over
a one time step horizon.
To emphasize the one-stage nature of the game, we temporarily suppress the time variable $t$, and adopt a
simplified notation, where the variables current at time $t$ are not
indexed, while the variables which are updated and become current at time $t+1$
are marked with the superscript $^+$. With this convention, a one-step
version of the general model presented in Section~\ref{sec_mod} involves:
\begin{itemize}
\item
A plant initial state $x$ and an initial transmission regime of the
communication link $s$, which captures characteristics of the link between
the controller and the plant before the jamming attack is undertaken.
\item
Controller and jammer actions $u$ and $a$, with $a$ selected
according to a probability distribution $p$ over $\mathcal{A}$.
\item
A transmission mode $s^+$ of the link, randomly drawn from $\mathcal{F}$
according to the probability distribution $P_{s,\cdot}(a)$ corresponding to
the $s$-th row of the matrix $P(a)$ selected by the jammer; see (\ref{Pt}).
\item
The probability of the link operating in the transmission regime
$s^+\in\mathcal{F}$ to become passing, determined by equation
(\ref{q_j}). The vector of these
probabilities is denoted $q=(q_1, \ldots, q_{|\mathcal{F}|})'$.
\item
The binary random variable $b$ capturing the transmission state of the
communication link at the time of plant state
update. According to (\ref{Prob.b=1}), when the jammer's actions have
a distribution $p$, the probability of the link to become
passing is
$\sum_{a=1}^{N}p_a(P(c,a)q)_s$.
\item
The updated state of the plant $x^+$, which is the terminal plant state in the
one-stage ANC game. From (\ref{plant.t}),
\begin{equation}
\label{plant}
x^+=F(x,bu).
\end{equation}
\item
The payoff function associated with the controller's and jammer's
actions and the given initial system state $x$ and the link transmission regime
$s$,
\begin{equation}
\label{sigma}
\Sigma(x^+,u,a)=\sigma^0(x,u)+\sigma^1(x^+)-g^0(a,s).
\end{equation}
The latter is a special case of the payoff (\ref{cost_total}).
\end{itemize}
In the one-step case, the probability measure (\ref{total.Q}) reduces to
the conditional probability measure on
$\mathcal{X}$ given that the plant starts at $x$ and the link
is initiated at an initial transmission regime $s$
\begin{eqnarray}
\label{total.Q.0}
\mathbf{Q}^{u,p}(dx^+,s^+|x,s)&=& \sum_{a=1}^{N}
p_a P_{ss^+}(a)\left[q_{s^+}\delta(x^+-F(x,u)) \right. \nonumber \\
&&\hspace{-.5cm}+\left.(1-q_{s^+})\delta(x^+-F(x,0))\right]dx^+.
\end{eqnarray}
\begin{definition}\label{greedy.ANC.game}
The one-stage ANC game is to find (if they exist) a strategy for the jammer
$p^*\in\mathcal{S}_{N-1}$ and a feedback strategy for the
controller $u^*$ such that
\begin{eqnarray}
\label{equi-point.t.0}
\mathbb{E}^{u^*,p^*}\Sigma(x^+,u^*,a)=J_1=J_2,
\end{eqnarray}
where $J_1$ and $J_2$ are the upper and the lower values of the game,
\begin{eqnarray}
J_1&=&\inf_{u\in\mathbb{R}^m} \sup_{p\in \mathcal{S}_{N-1}} \mathbb{E}^{u,p}
\Sigma(x^+,u,a), \label{inf_sup} \\
J_2&=&\sup_{p\in \mathcal{S}_{N-1}} \inf_{u\in\mathbb{R}^m} \mathbb{E}^{u,p}
\Sigma(x^+,u,a).
\label{sup_inf}
\end{eqnarray}
The pair $(u^*,p^*)$ is then a saddle point of the game.
\end{definition}
We wish to determine whether the ANC game has non-pure
saddle points. As was explained earlier, such
saddle points signify a possibility for the jammer to randomly choose
between several actions as its optimal strategy.
\subsection{Existence of a saddle point in one-stage ANC games}\label{main}
Our result on the existence of an equilibrium of
the one-stage game (\ref{equi-point.t.0}) relies on the following
assumption.
\begin{assumption}\label{sigma.A3}
For every $x\in\mathbb{R}^n$, $a\in \mathcal{A}$, the functions
$\Sigma(F(x,0),\cdot,a)$ and $\Sigma(F(x,\cdot),\cdot,a)$ are continuous,
coercive\footnote{Recall that a function $h:\mathbb{R}^m\to \mathbb{R}$ is coercive
if there exists a function $\eta:\mathbb{R}_+\to \mathbb{R}$ such that
$\lim_{y\to+\infty} \eta(y)=+\infty$ and $h(u)\geq \eta(\|u\|)$ for all
$u\in \mathbb{R}^m$.} and convex functions $\mathbb{R}^m\to \mathbb{R}$.
\end{assumption}
According to (\ref{total.Q.0}), the
expected cost in (\ref{equi-point.t.0}) has the form
\begin{eqnarray}
\label{ESigma}
\mathbb{E}^{u,p} \Sigma(x^+,u,a)=p'h^{x,s}(u),
\end{eqnarray}
where $h^{x,s}(\cdot)$ is a vector function $\mathbb{R}^m\to
\mathbb{R}^{N}$, whose $i$-th component represents
the conditional expected cost value given a jamming action $a=i$:
\begin{eqnarray}
\label{hj}
h^{x,s}_i(u)&=& \mathbb{E}^{u,p}[\Sigma(x^+,u,a)|a=i] \nonumber \\
&=&(P(i)q)_s \Sigma(F(x,u),u,i) \nonumber \\
&& \hspace{.5cm}+(1-(P(i)q)_s)\Sigma(F(x,0),u,i).
\end{eqnarray}
Under Assumption~\ref{sigma.A3}, each function $h_i^{x,s}(\cdot)$ is continuous, convex and coercive for every
$s\in\mathcal{F}$ and $x\in\mathbb{R}^n$.
\begin{theorem}\label{BO.T4}
Under Assumption~\ref{sigma.A3}, for every initial pair $(x,s)$, the
one-stage ANC game has a finite value, i.e.,
$
-\infty<J_1=J_2<\infty,
$
and the game has a (possibly non-unique) saddle point. Furthermore, for
every $x$, there exists a compact set $U(x)\subset \mathbb{R}^m$ which
contains the controller's optimal response $u^*=u^*(x,s)$ and is such that
\begin{eqnarray}
J_1&=&\inf_{u\in U(x)} \sup_{p\in \mathcal{S}_{N-1}} \mathbb{E}^{u,p}
\Sigma(x^+,u,a) \label{inf_U_sup} \\
&=&\sup_{p\in \mathcal{S}_{N-1}} \inf_{u\in U(x)} \mathbb{E}^{u,p}
\Sigma(x^+,u,a) = J_2.
\label{J1J2}
\end{eqnarray}
\end{theorem}
Unlike standard results on
the existence of a saddle point in a static zero-sum convex-concave
game~\cite{B&O}, the
strategy space of the minimizer is not bounded in the game
(\ref{inf_sup}), (\ref{sup_inf}). Theorem~\ref{BO.T4} shows that the
minimization over $u\in\mathbb{R}^m$ in (\ref{inf_sup}) and
(\ref{sup_inf}) can be reduced to a minimization over a compact set.
According to (\ref{J1J2}), every saddle point of the static game played on
$U(x)\times \mathcal{S}_{N-1}$ is a saddle point of the game played on
$\mathbb{R}^m\times \mathcal{S}_{N-1}$.
\subsection{General sufficient conditions for the existence of optimal
non-pure jammer strategies}\label{main.1}
Theorem~\ref{BO.T4} asserts the existence of a saddle-point strategy for
the ANC game~(\ref{equi-point.t.0}). However, it does not answer the question
as to whether the jammer's corresponding strategy
is randomized or not, which is of central
importance for a possibility of intelligent jamming attacks. To answer this
question, we now provide sufficient and, under additional technical assumptions,
necessary and sufficient conditions for the existence of non-pure saddle
points in the ANC game~(\ref{equi-point.t.0}). These
conditions characterize the controller-jammer games in which the jammer
randomizes its choice of optimal strategies. As we will see in
Section~\ref{Examples}, this will force the controller to respond in a
non-obvious manner in order to remain optimal.
\begin{lemma}\label{suff_cond}
Let $H=[H_1,\ldots, H_N]'$ be a convex
vector-valued function $\mathbb{R}^m \rightarrow \mathbb{R}^{N} $ (i.e.,
each component of $H$ is a convex function). Assume there
exist $u^* \in \mathbb{R}^m$ and a set $\mathcal{G} \subset \mathcal{A}$ with
$|\mathcal{G}| \geq 2$ such that
\begin{enumerate}[(a)]
\item
$H_i(u^*) = \max_{1 \leq j \leq N} H_j(u^*)$ for all $i \in \mathcal{G}$.
\item
For all $u \neq u^*$, there exists $i \in \mathcal{G}$ such that $H_i(u) > H_i(u^*)$.
\item
$u^*$ is not a minimum of any $H_i$, $i \in \mathcal{G}$.
\end{enumerate}
Then, there exists a non-pure vector $p^* \in \mathcal{S}_{N-1}$, with
support $I( p^* ) \subseteq \mathcal{G}$ such that
\begin{eqnarray*}
\inf_{u\in \mathbb{R}^m}\! \sup_{p \in \mathcal{S}_{N-1}}\! p' H(u)
&=& (p^*)' H(u^*) = \!\!\sup_{p \in \mathcal{S}_{N-1}}\! \inf_{u\in
\mathbb{R}^m}\! p' H(u).
\end{eqnarray*}
\end{lemma}
Our first result about the ANC game
(\ref{equi-point.t.0}) now follows.
\begin{theorem}
\label{Suff_theorem}
Suppose Assumption~\ref{sigma.A3} holds and for every $x\in\mathbb{R}^n$,
$s\in\mathcal{F}$, the function
$
H(u)\triangleq h^{x,s}(u)=[h_1^{x,s}(u),\ldots,
h_{N}^{c,s}(u)]'
$
satisfies conditions (a)-(c) of Lemma~\ref{suff_cond}; i.e., there exist
$u^*$ and a set $\mathcal{G}\subset \mathcal{A}$ for which conditions
(a)-(c) hold. Then the static ANC game
(\ref{equi-point.t.0}) has a non-pure saddle point $(u^*,p^*)$.
\end{theorem}
Theorem~\ref{Suff_theorem} asserts the existence of a non-pure saddle
point in the
one-stage game under consideration.
The jammer can use Theorem~\ref{Suff_theorem} to assess whether
it can launch a randomized jamming attack, as follows.
The jammer
observes the state of the system $(x,s)$ and the control signal $u$, then
checks whether $u$ belongs to the set
\begin{eqnarray*}
\mathcal{U}^{s,x}=\{u^*\colon \exists \mathcal{G}\subseteq\mathcal{A}, |\mathcal{G}|\ge 2,
\mbox{ s.t. $H(u^*)=h^{x,s}(u^*)$}\\\mbox{verifies
conditions of Lemma~\ref{suff_cond}}\}.
\end{eqnarray*}
If $u\in\mathcal{U}^{s,x}$ and the corresponding set $\mathcal{G}$ exists, the
jammer can launch an attack by randomly selecting $a\in \mathcal{G}$,
according to an
arbitrary probability distribution $p^*$ supported on $\mathcal{G}$ (it
is shown in the proof of Lemma~\ref{suff_cond} that any such vector can serve as
the jammer's best response; see
Appendix). The controller also can carry out a similar
analysis if it knows the state of the system $(x,s)$ and the set
$\mathcal{A}$, to determine whether the
control input $u$ it has chosen can trigger a randomized jamming
behaviour. For this, the controller must verify whether
$u\in\mathcal{U}^{s,x}$. When the controller does not know the transmission
regime $s$, then a conservative test can be performed to check whether
$u\in\cup_s\mathcal{U}^{s,x}$.
Neither the jammer nor the controller need to compute their optimal
strategies to perform this analysis. In the remainder of
this Section and in Section~\ref{Examples}, we will further particularize
conditions of Theorem~\ref{Suff_theorem}, to
provide a better insight into how Theorem~\ref{Suff_theorem} enables such
an analysis.
Lemma \ref{suff_cond} and Theorem~\ref{Suff_theorem} make no
assumption regarding the smoothness of the function $H$, which is useful for
application to dynamic ANC games, where the game (\ref{inf_sup}),
(\ref{sup_inf}) may arise as an Isaacs equation from application of the
Dynamic Programming. The value function in such an equation
may not be smooth (e.g., in~\cite{LaU3a} it was shown to be only
piece-wise smooth). However, Theorem~\ref{Suff_theorem} can be
sharpened when local differentiability holds. This will be
demonstrated in the next section.
\subsection{Necessary and sufficient conditions for strategic
jamming}\label{main.2}
The analysis in this section requires control inputs $u$ to be one-dimensional,
and
the functions $h_i^{x,s}(\cdot)$, $i\in \mathcal{G}$ must be piece-wise
smooth. Furthermore, we assume that the set $\mathcal{G}$ consists of only
two actions, $\mathcal{G}=\{a_1,a_2\}$.
\begin{assumption}\label{sigma.A1'}
Suppose the space of control inputs is one-dimensional. Also, for every $x\in
\mathbb{R}^n$, $a\in\mathcal{A}$, the functions
$\Sigma(F(x,\cdot),\cdot,a)$ and
$\Sigma(F(x,0),\cdot,a)$ are convex functions defined on
$\mathbb{R}^1$, which are continuously differentiable on $\mathbb{R}^1$,
perhaps with the exception of a finite number of
points; let $U^d(x)$ be the set of such points.
\end{assumption}
Clearly, under Assumption~\ref{sigma.A1'}, the functions $h_{a_1}^{x,s}(\cdot)$,
$h_{a_2}^{x,s}(\cdot)$ are convex. Also, these functions are continuously
differentiable at every $u$, except for $u\in U^d$.
\begin{theorem}\label{saddle.point}
Suppose Assumption \ref{sigma.A1'} holds.
\begin{enumerate}[(i)]
\item
If for every $x,s$, there exists $\bar u\not\in U^d$ such that
\begin{eqnarray}\label{F=F}
&& h_{a_1}^{x,s}(\bar u)=h_{a_2}^{x,s}(\bar u), \\
\label{FF>F}
&&h_i^{x,s}(\bar u)\ge h_a^{x,s}(\bar u), \quad \forall i\in\mathcal{G},
a\not\in \mathcal{G},
\end{eqnarray}
and one of the following conditions hold: either
\begin{equation}\label{dF.dF<0}
\left(\frac{d h_{a_1}^{x,s}(\bar u)}{d u}\right)
\left(\frac{d h_{a_2}^{c,s}(\bar u)}{d u}\right)<0,
\end{equation}
or
\begin{equation}\label{dF=dF=0}
\frac{dh_{a_1}^{x,s}(\bar u)}{d u}=
\frac{dh_{a_2}^{x,s}( \bar u)}{d u}=0,
\end{equation}
then the zero-sum game (\ref{inf_sup})
admits a non-pure saddle point $(u^*, p^*)$, $u^*\not\in U^d$, with $p^*$
supported on $\mathcal{G}=\{a_1,a_2\}$.
\item
Conversely, if the zero-sum game (\ref{inf_sup})
admits a non-pure saddle point $(u^*, p^*)$, $u^*\not\in U^d$, with $p^*$
supported on $\mathcal{G}=\{a_1,a_2\}$, then there
exists $\bar u\not\in U^d$ such that either (\ref{F=F}), (\ref{dF.dF<0}) or
(\ref{F=F}), (\ref{dF=dF=0}) hold.
\end{enumerate}
\end{theorem}
The conditions of Theorem~\ref{saddle.point} are illustrated in
Figure~\ref{h.figure}.
\begin{figure}[t]
\psfrag{u2}{$\bar u$}
\psfrag{u1}{$u^0$}
\psfrag{h1}{$h_{a_1}^{x,s}$}
\psfrag{h2}{$h_{a_2}^{x,s}$}
\centering
\subfigure[\label{(a)}]{%
\includegraphics[width=0.2\textwidth]{h1.eps}
}
\quad
\subfigure[\label{(b)}]{%
\includegraphics[width=0.2\textwidth]{h2.eps}
}
\caption{Graphs of the functions $h_{a_1}^{x,s}( \cdot),
h_{a_2}^{x,s}(\cdot)$ in
Theorem~\ref{saddle.point}. In Fig.~(a), $\bar u$ satisfies conditions
(\ref{F=F}) and (\ref{dF.dF<0}), but $u^0$ does not satisfy
(\ref{dF.dF<0}). In Fig.~(b), $\bar u$ satisfies both
(\ref{F=F}) and (\ref{dF=dF=0}).}
\label{h.figure}
\end{figure}
We note that
conditions (\ref{F=F}), (\ref{FF>F}) are a special case of
condition~(a) of Theorem~\ref{Suff_theorem}. Also, it will be shown in the
proof of this theorem in the Appendix that conditions (b) and (c) of
Theorem~\ref{Suff_theorem} follow from condition
(\ref{dF.dF<0}) when $h_{a_1}^{x,s}(\cdot)$ and $h_{a_2}^{x,s}(\cdot)$
are smooth and strictly convex. On the other hand, condition (\ref{dF=dF=0}) was ruled out in
Theorem~\ref{Suff_theorem}; see condition (c) in that
theorem. Indeed, conditions (\ref{dF.dF<0}) and (\ref{dF=dF=0}) are
mutually exclusive.
\subsection{Rewarding certain actions leads to randomized jamming
strategies}\label{main.3}
Attacker's decisions to pass/block transmission of control
information may be based on considerations other than cost to the
controller. These considerations encoded in the
jamming cost $g^0(a,s)$ in (\ref{sigma}) may either
discourage the jammer from launching an attack, or conversely encourage it
to undertake a denial-of-service attack. The cost of link switching
may be one consideration behind the jammer's decisions whether to
launch an attack. Also, the jammer
may be rewarded for being inactive to ensure it is not detected; e.g., this situation may occur when the
controller monitors the
communication link, and an anomaly in the link behaviour can reveal the
jammer. In this section we show that when the attacker is rewarded for undertaking certain actions, a set $\mathcal{G}$
considered in Lemma~\ref{suff_cond} and Theorem~\ref{Suff_theorem} arises
naturally.
Most generally, the reward scenario can be captured by reserving
special actions in the jammer's action space $\mathcal{A}$; such actions
will typically attract a distinctly different cost.
For simplicity let $a_\circ$ be the only reserved action. Next, suppose the
remaining actions are ranked in accordance with
their contribution to the game payoff.
\begin{assumption}\label{sigma.A2}
For any two actions $j,k\in\mathcal{A}$, $j,k\neq a_\circ$, if $j<k$ then
for all $ u\in \overset{\circ}U(x)$
\begin{eqnarray}
\label{chan.ineq}
\mathbb{E}^{u,p}[\Sigma(x^+,u,a)|a=j]>
\mathbb{E}^{u,p}[\Sigma(x^+,u,a)|a=k],
\end{eqnarray}
here $\overset{\circ}U(x)$ is the interior of the compact set $U(x)$ from
Theorem~\ref{BO.T4}.
\end{assumption}
Under Assumption~\ref{sigma.A2}, the jammer who seeks a higher value of
the game will favour actions with lower numbers,
since these actions generate larger payoff. In contrast, the
controller should be forcing the jammer into
utilizing actions with higher numbers. The reserved action $a_\circ$ has
been excluded from ranking. Doing so is instrumental to provide the jammer
with a genuine choice between taking the reward and blocking/passing
transmission.
We now show that using the action
ranking from Assumption~\ref{sigma.A2}, the value and the saddle
points of the game (\ref{inf_sup}) can be characterized by solving a game
over a reduced jammer's action space $\mathcal{G}$ consisting of the reserved action $a_\circ$ and one of the remaining actions which delivers the highest
payoff to the jammer when it seeks to block communications between the
controller and the plant.
Note that when $a_\circ\neq 1$, then according to (\ref{chan.ineq}), the
jammer's highest payoff among `regular' (i.e., not reserved) actions is
associated with action $a=1$. Alternatively, if
$a_\circ= 1$, then according to (\ref{chan.ineq}), the highest
payoff among the actions from $\mathcal{A}\backslash \{a_\circ\}$ is
delivered when the jammer selects $a=2$. In both cases, the reduced action
space will contain only two actions from
$\mathcal{A}$; in the first case, $\mathcal{G}=\{1,a_\circ\}$, or
$\mathcal{G}=\{1,2\}$ in the second case. The analysis of the reduced game
is the same in
both cases, therefore we only consider the case
$\mathcal{G}=\{1,a_\circ\}$. In Section~\ref{Examples}, detailed examples
will be given to illustrate this case.
Now that the set $\mathcal{G}$ has been established, the existence of
non-pure strategies in the ANC game with reserved actions can be derived
from the results in the previous section. The first result is a corollary
from Theorem~\ref{Suff_theorem} and is applicable when the
control input is a vector.
\begin{corollary}\label{Suff_theorem.2.a}
Suppose Assumptions~\ref{sigma.A3} and~\ref{sigma.A2} hold. Furthermore,
suppose that for given initial $x$, $s$ there exists $u^*=u^*(x,s)
\in \overset{\circ}{U}$ such that the functions $h_1^{x,s}(\cdot)$,
$h_{a_\circ}^{x,s}(\cdot)$ satisfy the conditions
\begin{enumerate}[(a)]
\item $h_1^{x,s}(u^*)=h_{a_\circ}^{x,s}(u^*)$;
\item For all $u\neq u^*$, $h_1^{x,s}(u)>h_1^{x,s}(u^*)$
or $h_{a_\circ}^{x,s}(u)> h_{a_\circ}^{x,s}(u^*)$;
\item $u^*$ is not a minimum of $h_1^{x,s}(\cdot)$,
$h_{a_\circ}^{x,s}(\cdot)$.
\end{enumerate}
Then, the zero-sun game (\ref{inf_sup}), (\ref{sup_inf}) admits a
non-pure saddle point $(u^*,p^*)$ with non-pure vector $p^*$ supported on
$\mathcal{G}=\{1,a_\circ\}$.
\end{corollary}
\emph{Proof: }
Under Assumption~\ref{sigma.A2}, $h_1^{x,s}(u^*)> h_k^{x,s}(u^*)$
$\forall k\not\in\{1,a_\circ\}$. Together with condition (a),
this observation verifies condition (a) of
Lemma~\ref{suff_cond}, with $\mathcal{G}=\{1,a_\circ\}$. Conditions (b)
and (c) of that lemma trivially follow from (b) and (c) in this
corollary. Thus, from Lemma~\ref{suff_cond}, the ANC game has a saddle
point $(u^*, p^*)$ with $ p^*$
supported on $I( p^* ) \subseteq \mathcal{G}$. Since $|\mathcal{G}|=2$,
and $p^*$ is not pure, then $|I(p^* )|=2$, i.e, $0<
p^*_1<1$ and $0<p^*_{a_\circ}<1$.
\hfill$\Box$
The second corollary follows from Theorem~\ref{saddle.point} and
applies when the control input is scalar. It eliminates condition
(\ref{FF>F}) which is the gap between the necessity and sufficiency
statements in that theorem.
\begin{corollary}\label{saddle.point.a}
Suppose Assumptions~\ref{sigma.A1'}, \ref{sigma.A2}
hold. The zero-sum game (\ref{inf_sup})
admits a non-pure saddle point $(u^*, p^*)$, $u^*\not\in U^d$, with $p^*$
supported on $\mathcal{G}=\{1,a_\circ\}$, if and
only if there exists $\bar u\in
\overset{\circ}U(x)\backslash U^d$ satisfying (\ref{F=F}) and either
(\ref{dF.dF<0}) or (\ref{dF=dF=0}) with $a_1=1$ and $a_2=a_\circ$.
\end{corollary}
\emph{Proof: }
The corollary directly follows from Theorem~\ref{saddle.point} since
condition (\ref{FF>F}) of the sufficiency part of that theorem
is trivially satisfied under Assumption~\ref{sigma.A2}.
\subsection{Remarks on the single-stage payoff}\label{Remark-on-signle}
The foregoing analysis of the single-stage ANC
game (\ref{inf_sup}) has relied on the properties of conditional payoff
functions $h_i^{x,s}(\cdot)=\mathbb{E}^{u,p}[\Sigma(x^+,\cdot,a)|a=i]$
which in turn follow from coercivity, convexity and
continuity of $\Sigma(F(x,\cdot),\cdot,a)$ and $\Sigma(F(x,0),\cdot,a)$. Of
course these properties can be readily validated from the corresponding
properties of $\sigma^0$ and $\sigma^1$ through (\ref{sigma}). However,
we stress that the results in this section are in fact
more general in that they apply to functions $\Sigma$ more general than
(\ref{sigma}); this observation will be useful in the next section.
\section{Linear-quadratic controller-jammer games}\label{Examples}
In this section, we specialize the results of
Section~\ref{Static.ANC.Section} to one-stage controller-jammer ANC games
where the plant (\ref{plant.t}) is linear, and hence (\ref{plant}) becomes
\begin{equation}
\label{plant.lin}
x^+ = A x + b Bu,
\end{equation}
and the cost of control is quadratic. Also, we give examples of
the situations alluded in Section~\ref{Static.ANC.Section}, where
rewarding certain actions leads to randomized jamming.
Two such games will be considered. In the first game the jammer is rewarded
for remaining stealthy, while in the second game its decisions are
determined by the premium the controller must pay for
terminating the game
(e.g., as a cost of repair or cost of re-routing control signals). We show
that in both games, there is a region in the plant state space where
the jammer's optimal policy is to randomize among its actions, and an
optimal control response to this jamming policy is nonlinear. We
will also revisit the game from~\cite{Abhi} and will show that the
deterministically predictable behaviour of the jammer observed in~\cite{Abhi} can be predicted using our results.
In order to provide a clear context of the attack strategies
resulting from these games we revisit the intelligent DoS by re-routing;
see Section~\ref{relation}. That is, we assume that
the jammer's actions are to randomly select one of the available communication
channels, i.e., $\mathcal{A}=\mathcal{F}$, and $P(a)$ is defined as
in (\ref{Pt.1}). In addition, we will assume that $u\in\mathbb{R}^1$;
this will allow us to apply Theorem~\ref{saddle.point} and, under
Assumption~\ref{sigma.A2}, Corollary~\ref{saddle.point.a}.
Thanks to the linear-quadratic nature of the games, in all three problems
the conditional
expected payoff (\ref{hj}), given the jammer's action $a=j$, will have the
form\footnote{The superscript $^{x,s}$ is suppressed in this section, for
economy of notation.}
\begin{eqnarray}
h_j(u)
&=&\gamma_j(x)+u^2+r_jq_ju(u+2\beta(x)),
\label{hj.LaU3}
\end{eqnarray}
where $r_j\ge 0$ is a constant, and $\gamma_j(x)\ge 0$ for all $j$. Also, all
available channels are assumed to be ordered according to their probability
to become passing, that is, the probabilities (\ref{q_j}) are assumed to
be ordered as
\begin{eqnarray}
q_1<q_2<\ldots<q_n.
\label{qq}
\end{eqnarray}
\begin{lemma}\label{U.LQ}
The set $U(x)=\{u:~u(u+2\beta(x)) \le 0 \}$ verifies properties
stated in Theorem~\ref{BO.T4}. Also, let $a_\circ\neq 1$ denote a reserved
action, and suppose $r_j=r>0$ and $\gamma_j(x)=\gamma(x)$ for all
$j\neq a_\circ$. Then under condition (\ref{qq}),
Assumption~\ref{sigma.A2} is also satisfied with $U(x)$ defined above.
\end{lemma}
\emph{Proof: }
We fix $x$ and assume $\beta(x)>0$. The case $\beta(x)<0$ can be analyzed
in a similar manner, while the case $\beta(x)=0$ is trivial.
The functions $h_j(u)$ defined in (\ref{hj.LaU3}) are continuous and strictly
convex in $u$. They are monotone decreasing on the interval
$(-\infty,-2\beta(x)]$ and are monotone increasing on the interval
$[0,+\infty)$.
Therefore, $\hat h(u)=\max_j h_j(u)$ and
$\bar h(u)=\sum_j p_jh_j(u)$ are
also monotone decreasing on the interval
$(-\infty,-2\beta(x)]$ and are monotone increasing on $[0,+\infty)$. Since
both functions are continuous,
\begin{eqnarray*}
&& \min_{u\le -2\beta(x)}\hat h(u) = \hat h(-2\beta(x)), \qquad \min_{u\ge 0}\hat h(u) = \hat h(0), \\
&& \min_{u\le -2\beta(x)} \bar h(u) = \bar h(-2\beta(x)),
\qquad \min_{u\ge 0} \bar h(u) = \bar h(0).
\end{eqnarray*}
Therefore, since the set $U(x)$ is closed and contains the points $0$ and
$-2\beta(x)$, then
\begin{eqnarray*}
\lefteqn{\inf_u \sup_{p\in\mathcal{S}_{N-1}} \bar h(u)= \inf_u \hat h(u)} && \\
&=&\min\left[ \inf_{u\le -2\beta(x)} \hat h(u), \inf_{u\in U(x)}\hat h(u),
\inf_{u\ge 0}\hat h(u)\right] \\
&=& \inf_{u\in U(x)}\hat h(u)=\inf_{u\in U(x)}\sup_{p\in\mathcal{S}_{N-1}} \bar
h(u).
\end{eqnarray*}
Also, for every $p\in \mathcal{S}_{N-1}$, $\inf_u \bar h(u)$ is attained at
$u=-\frac{\sum_j p_jr_jq_j}{1+\sum_j p_jr_jq_j}\beta(x)\in U(x)$,
therefore $\displaystyle \inf_u \bar h(u)= \inf_{u\in U(x)}\bar h(u)$ and
$
\displaystyle\sup_{p\in\mathcal{S}_{N-1}}\inf_u \bar h(u)=
\sup_{p\in\mathcal{S}_{N-1}} \inf_{u\in U(x)}\bar h(u).
$
This proves that an optimal response of the minimizing player in the game
(\ref{inf_sup}) lies within the interval $[-2\beta(x),0]$.
To verify the second claim of the lemma, we note that for any $j,k\neq
a_\circ$ if $j>k$ then due to (\ref{qq}) $h_j(u)<h_k(u)$
for all $u\in (-2\beta(x),0)$ i.e., (\ref{chan.ineq}) is satisfied.
\hfill$\Box$
\subsection{LQ control under reward for
stealthiness}\label{LQR.reward.section}
Consider a controller-jammer game for the plant (\ref{plant.lin})
with initial conditions $x^0=x$ and $s^{0}=s$ and
the quadratic payoff (\ref{sigma}), with
$\sigma^0(x,u)=\|x\|^2+u^2$, $\sigma^1(x^+)=\|x^+\|^2$,
$g^0(a,s)=-\tau \delta_{a,s}$.
Here,
$\tau>0$ is the constant payoff which the jammer receives if
it does not re-route control packets through a different channel. The
rationale here is to reward the jammer for not switching channels when
excessive switching may reveal its presence
(hence rewarding stealthiness), or may drain its resources. Thus, the
reserved action is to maintain transmission through the initial channel
$s$, i.e., $a_\circ=s$.
The corresponding function $\Sigma$ (\ref{sigma}) in this case is
\begin{equation}
\Sigma(x^+,u,a)=\begin{cases} \|x\|^2+u^2+\|x^+\|^2, & a\neq s, \\
\|x\|^2+u^2+\|x^+\|^2+\tau, & a=s,
\end{cases}
\label{LQ.cost.sigma}
\end{equation}
and the static LQ ANC game is to find a control strategy $u^*$
and a jammer's non-pure strategy $p^*$ which form a saddle point of the game
(\ref{inf_sup}) for the plant (\ref{plant.lin}), with the payoff
(\ref{LQ.cost.sigma}). We now show that Corollary~\ref{saddle.point.a} can be
used for that. Indeed, the functions
$h_j(u)=\mathbb{E}^{u,p}[\Sigma(x^+,u,a)|a=j]$ have the form
(\ref{hj.LaU3}), with $\gamma_j(x)= x'(I+A'A)x$, $j\neq s$
$\gamma_s(x)=x'(I+A'A)x+\tau$,
and $\beta(x)=\frac{1}{\|B\|^2}B'Ax$, $r_j=\|B\|^2$ for all
$j\in\mathcal{A}$.
According to Lemma~\ref{U.LQ}, with $a_\circ=s$,
Assumption~\ref{sigma.A2} is satisfied in this special case. Furthermore,
Assumption~\ref{sigma.A1'} is also satisfied, due to linearity of the plant
and a quadratic nature of the payoff. Then the analysis of the ANC game can
be reduced to verifying whether the payoff functions
for the reduced zero-sum game, namely
$h_1^{x,s}(u)= h_1(u)$ and $h_{a_\circ}^{x,s}(u)= h_s(u)$
satisfy the conditions of Corollary~\ref{saddle.point.a}.
Using (\ref{hj.LaU3}), condition (\ref{F=F}) reduces to the
equation to be solved for $\bar u\in (-2\beta(x),0)$,
\begin{equation}
\label{F=F.LQ}
\bar u \left(\bar u + \frac{2}{\|B\|^2}B'Ax\right)=
\frac{\tau}{\|B\|^2(q_1-q_s)},
\end{equation}
which admits real solutions if $\frac{1}{\|B\|^2}x'A'BB'Ax\ge
\frac{\tau}{q_s-q_1}$.
Also, condition (\ref{dF.dF<0}) reduces to the condition
\begin{equation}
\label{dF.dF<0.LQ}
-\frac{\|B\|^2q_s}{1+\|B\|^2q_s}< \bar u <
-\frac{\|B\|^2q_1}{1+\|B\|^2q_1}.
\end{equation}
The analysis of conditions (\ref{F=F.LQ}), (\ref{dF.dF<0.LQ}) shows that only
one of the solutions of equation (\ref{F=F.LQ}), namely
\begin{eqnarray}
\bar u&\triangleq &u^*\!=\! -\frac{1}{\|B\|^2}B'Ax\!\left(\!1-\!\sqrt{\frac{\tau
\|B\|^2}{(q_1-q_s)x'A'BB'Ax}}\!\right) \quad
\label{u*}
\end{eqnarray}
satisfies (\ref{dF.dF<0.LQ}) provided
\begin{eqnarray}
&&R_1< x'A'BB'Ax <R_s,
\label{z.LaU3a} \\
&&
R_1\triangleq \frac{(1+\|B\|^2q_1)^2}{(1+\|B\|^2q_1)^2-1}\frac{q_s-q_1}{\tau
\|B\|^2}, \nonumber \\
&&
R_s\triangleq \frac{(1+\|B\|^2q_s)^2}{(1+\|B\|^2q_s)^2-1}\frac{q_s-q_1}{\tau
\|B\|^2}. \nonumber
\end{eqnarray}
Condition (\ref{z.LaU3a}) describes the region in the state space in which the
jammer's optimal policy is to choose randomly between the initial channel
$s$ and the most blocking channel $1$. In the
case where the plant (\ref{plant.lin}) is scalar and $B=1$, we recover
exactly the condition obtained in~\cite{LaU3a} by direct
computation. That is, Corollary~\ref{saddle.point} confirms the existence of
the jammer's non-pure optimal strategy for this region. We refer the
reader to~\cite{LaU3a} for the exact value of the optimal vector $p^*$;
the calculation for the multidimensional plant (\ref{plant.lin}) follows
same lines, and is omitted for the sake of brevity. We
also point out that the optimal controller's policy (\ref{u*}) is
nonlinear.
Let us now compare quadratic performance
of the optimal response control $u^*$ with performance of the
optimal guaranteed cost control law designed to control the plant
(\ref{plant.lin}) over a \emph{bona fide} packet dropping link with unknown
probability distribution of packet dropouts. Since the controller is unaware
of the attack and is also unaware of the precise statistical characteristics of
the channel, such a control strategy is
a natural choice. Let $d$ denote the unknown probability distribution of
the transmission state of a packet dropping link perceived by the
controller. The set of all feasible probability distributions $d$ is
denoted $D$. The optimal
guaranteed performance control $u^{\textrm{LQR}}$ is characterized by the condition
\begin{eqnarray}
\lefteqn{\sup_{d\in D}
\mathbb{E}^d[\|x\|^2+|u^{\textrm{LQR}}|^2+\|x^+\|^2]} && \nonumber \\
&=&\inf_u\sup_{d\in D} \mathbb{E}^d[\|x\|^2+|u|^2+\|x^+\|^2];
\label{lqr.opt}
\end{eqnarray}
here $\mathbb{E}^d$ denotes the expectation with
respect to the probability vector $d$. In particular, when the link is
optimally controlled by the
jammer, we have $d^*=[(p^*)'q,~(1-(p^*)'q)]'$. Hence when $d^*\in D$, then
\begin{eqnarray}
\lefteqn{\mathbb{E}^{u^{\textrm{LQR}},p^*}[\|x\|^2+|u^{\textrm{LQR}}|^2+\|x^+\|^2]} &&
\nonumber \\
&\le& \sup_{d\in D} \mathbb{E}^d[\|x\|^2+|u^{\textrm{LQR}}|^2+\|x^+\|^2] \nonumber \\
&=&\inf_u\sup_{d\in D} \mathbb{E}^d[\|x\|^2+|u|^2+\|x^+\|^2].
\label{lqr.saddle.point.2}
\end{eqnarray}
On the other hand, since $(u^*,p^*)$ is the saddle point of
the one-stage min-max ANC game which we have shown to admit
the upper value, we conclude that for all $u$,
\begin{eqnarray}
\lefteqn{\mathbb{E}^{u^*,p^*}[\|x\|^2+|u^*|^2+\|x^+\|^2+\delta_{a,s}\tau]} &&
\nonumber \\
&\le& \mathbb{E}^{u,p^*}[\|x\|^2+|u|^2+\|x^+\|^2+\delta_{a,s}\tau].
\label{lqr.saddle.point}
\end{eqnarray}
Drop the term
$\mathbb{E}^{u^*,p^*}[\delta_{a,s}\tau]
=\mathbb{E}^{u,p^*}[\delta_{a,s}\tau]=p_s^*\tau$
on both sides of
(\ref{lqr.saddle.point}),
it then follows from (\ref{lqr.saddle.point.2}),
(\ref{lqr.saddle.point})
\begin{eqnarray}
\lefteqn{\mathbb{E}^{u^*,p^*}[\|x\|^2+|u^*|^2+\|x^+\|^2]} &&
\nonumber \\
&\le&
\inf_u\sup_{d\in D} \mathbb{E}^d[\|x\|^2+|u|^2+\|x^+\|^2].
\label{lqr.saddle.point.3}
\end{eqnarray}
This argument shows that when the jammer exercises its optimal randomized
strategy, unbeknownst to the controller, and forces the latter to
perceive the communication link as a benign uncertain packet dropping
channel, the guaranteed cost control law designed under this
assumption will have an inferior performance, compared with $u^*$, provided
$d^*\in D$. We interpret this situation as a signature of a successful DoS
attack by the jammer.
From the above analysis, it appears that a possible line of
defence against the DoS attack analyzed in this section could be
controlling the system so as to avoid the
region defined by (\ref{z.LaU3a}). In
this case, the jammer will be forced to deterministically route
control packets over the genuine, albeit most damaging, packet dropping
channel. An impact of this defense on the system performance is an open
problem which will be studied in future work.
\subsection{Linear quadratic game with cost on loss of
control}
We again consider the plant (\ref{plant.lin}), but with the
payoff
\begin{equation*}
\|x\|^2+v^2+\|x^+\|^2
=\|x\|^2+b^2u^2+\|x^+\|^2.
\label{LQ.cost.Abhi}
\end{equation*}
This is a one-step
version of the payoff considered in~\cite{Abhi}. The
payoff in this game directly depends on whether the control input is blocked.
In this case, the functions $h_j$ have a form slightly different from those
in Section~\ref{LQR.reward.section}:
\begin{eqnarray*}
h_j(u)&=&x'(I+A'A)x \\
&& +q_j(1+\|B\|^2)u\left(u+\frac{2}{1+\|B\|^2}B'Ax\right).
\end{eqnarray*}
According to Lemma~\ref{U.LQ}, Assumption~\ref{sigma.A2} is still
satisfied (with the reserved
action $a_\circ=s$), and we can attempt to apply
Corollary~\ref{saddle.point.a}. For
every $x\neq 0$, two points solve condition (\ref{F=F}),
$
\bar u=0$ and $\bar u=-\frac{2}{1+\|B\|^2}B'Ax$,
but none of them satisfy conditions (\ref{dF.dF<0}) or
(\ref{dF=dF=0}). Hence, the jammer's
optimal strategy is to switch to the most blocking channel $1$, instead of
randomizing between $s$ and $1$. This finding is consistent with
the result obtained in~\cite{Abhi}.
\subsection{Linear-quadratic game with termination payoff}
In this example, suppose the controller chooses a channel $s$ to transmit
information and receives messages from the plant as to which
channel was used for transmission. Once the controller detects change,
it terminates the game and pays a termination fee $T$, otherwise its terminal
cost is a regular state-dependent cost $\sigma^1(x^+)$. The jammer has a
choice between disrupting that channel
$s$ and thus revealing itself, and holding off
the attack to remain undetected. The
game payoff is then
\[
\Sigma(x^+,u,a)=\|x\|^2+u^2+(1-\delta_{a,s})T + \delta_{a,s}\|x^+\|^2.
\]
Owing to the term $\delta_{a,s}\|x^+\|^2$, this payoff is not of the
form (\ref{sigma}), however its conditional expectation given $a=j$
has the form (\ref{hj.LaU3}), with $\gamma_j(x)=\|x\|^2+T$, $r_j=0$, $j\neq
s$, $\gamma_s(x)=x'(I+A'A)x$, $r_s=\|B\|^2$,
and $\beta(x)=\frac{1}{\|B\|^2}B'Ax$; it satisfies all the convexity and
coercivity conditions required in Section~\ref{Static.ANC.Section}, hence
the results developed in Section~\ref{Static.ANC.Section} can be applied in
this problem; see the remarks in Section~\ref{Remark-on-signle}. Without
loss of generality, we only consider the case where $B'Ax\le 0$. The
analysis of the case $B'Ax\ge 0$ follows the same lines.
In the game considered, all the channels except
$s$ have equal value for the jammer. Essentially, the jammer has to choose
between two actions: allow the controller to use its chosen channel $s$ or
reveal itself by selecting some other channel, e.g., channel 1. For that
reason, we select $\mathcal{G}=\{1,s\}$ and
proceed using Theorem~\ref{saddle.point}. Naturally, we assume $s\neq 1$,
since the case $s=1$ is trivial.
According to our selection of the set $\mathcal{G}$, the functions
$h_{a_1}^{x,s}$ and $h_{a_2}^{x,s}$ in Theorem~\ref{saddle.point} are $h_1$
and $h_s$ from~(\ref{hj.LaU3}), respectively. It can be shown that if
$B'Ax\le 0$, $T\ge x'A'(I-\frac{q_s}{\|B\|^2}BB')Ax$, then
\begin{eqnarray}
\bar u=u^*&=&-\frac{1}{\|B\|^2}B'Ax \nonumber \\
&+&\sqrt{\frac{\|B\|^2T-x'A'(\|B\|^2I-(q_s)BB')Ax}{\|B\|^4q_s}} \quad
\label{baru.g2}
\end{eqnarray}
validates conditions (\ref{F=F}), (\ref{dF.dF<0}) of
Theorem~\ref{saddle.point} when
\begin{equation}
\bar u<0 \quad \mbox{and} \quad (1+\|B\|^2q_s)\bar u + (q_s)x'A'B>0.
\label{int.x.2}
\end{equation}
Substituting (\ref{baru.g2}) into (\ref{int.x.2}) yields
\begin{eqnarray}
&&x'\!A'\!Ax\!>\! T,~~ T\!>\!x'A'\!\left(\!I\!-\!\frac{(2+\|B\|^2q_s)q_s^2}{(1+\|B\|^2q_s)^2}BB'\!\right)\! Ax.\qquad
\label{int.x.3}
\end{eqnarray}
Note that
$
I-\frac{(2+\|B\|^2q_s)q_s^2}{(1+\|B\|^2q_s)^2}BB'>I-\frac{q_s}{\|B\|^2}BB'>0.
$
Therefore the region in the plant's state space where the game has a
non-pure saddle point is the intersection of the interior of the ellipsoid
defined by condition (\ref{int.x.3}) and the set $\{x:~ \|Ax\|^2>
T\}$. Such an intersection is clearly not an empty set, since
$I-\frac{(2+q_s\|B\|^2)q_s^2}{(1+\|B\|^2q_s)^2}BB'<I$.
Once again, as in Section~\ref{LQR.reward.section},
our analysis discovers a region in the state space where the
jammer's optimal strategy is to act randomly. In fact, in this
problem the choice is between allowing transmission through the
channel $s$ selected by the controller and switching to some other channel ---
no matter which channel is selected to replace $s$, the value of the game
is not affected by this selection. The jammer's optimal policy vector $p^*$
can be computed directly in this problem to be an arbitrary vector in
$\mathcal{S}_{N-1}$ with the $s$-th component being equal to
\begin{eqnarray}
\label{p*.T}
p_s^*&=&-\frac{1}{\|B\|^2q_s} \nonumber \\
&\times&\!\left(\!1-\!
\sqrt{\frac{(q_s)x'A'Ax}{\|B\|^2T-x'A'(\|B\|^2I-(q_s)BB')Ax}}\!\right).
\end{eqnarray}
Again, as
in Section~\ref{LQR.reward.section}, the controller's best response is
nonlinear in $x$.
\section{Existence of saddle-point strategies for multistage finite horizon
ANC games}\label{multistage}
In this section we extend some of our previous results about the
existence of saddle-point strategies to the case of the multistage ANC game
(\ref{equi-point.t}). The game was posed in Section~\ref{sec_mod}, but our
generalization
will be concerned with a special case where the function $F_t$ is a linear
function, $F_t(x,v)=A_tx+B_tv$,
where $A_t$, $B_t$ are matrices of matching dimensions.
That is, we restrict attention to linear systems of the form
\begin{equation}
\label{plant.t.linear}
x^{t+1}=A_tx^t+b^tB_tu^t.
\end{equation}
\begin{assumption}\label{CL.assum}
\begin{enumerate}[(i)]
\item
For every $t=0,\ldots,T-1$, there exist scalars $e_t,d_t$ and functions $\alpha_t, \beta_t: \mathbb{R}_+ \rightarrow \mathbb{R}$, with $\lim_{y \rightarrow +\infty} \alpha_t(y) = \lim_{y \rightarrow +\infty} \beta_t(y) = +\infty $ and $\alpha_t(y) \geq e_t$, $\beta_t(y) \geq d_t$ such that
\[
\sigma^t(u,x) \geq \alpha_t(\|u\|) + \beta_t(\|x\|) \quad \forall x \in
\mathbb{R}^n, u \in \mathbb{R}^m.
\]
\item
For all $t=0,\ldots,T-1$, the function $\sigma^t: \mathbb{R}^n \times
\mathbb{R}^m \rightarrow \mathbb{R}_+$ is convex in both its arguments.
\item
The function $\sigma^T: \mathbb{R}^n \rightarrow \mathbb{R}_+$ is convex
and there exist a scalar $d_T$ and a function $\beta_T: \mathbb{R}_+
\rightarrow \mathbb{R}_+$, with $ \lim_{y \rightarrow +\infty} \beta_T(y)
= +\infty $ and $\beta_T(y) \geq d_T$ such that
\[
\sigma^T(x) \geq \beta_T(\|x\|).
\]
\end{enumerate}
\end{assumption}
\begin{assumption}\label{contin}
The function $\sigma^T(\cdot)$ is continuous. Furthermore, for every
$t=0,\ldots,T-1$, the function $\sigma^t(\cdot,u)$ is continuous uniformly in
$u\in \mathbb{R}^m$. Also, the functions $\sigma^t(x,\cdot)$
are continuous for every $x\in \mathbb{R}^n$.
\end{assumption}
The main result of this section is now presented.
\begin{theorem}
\label{exist_theo}
Suppose Assumptions~\ref{CL.assum} and~\ref{contin}
hold. Then the
value functions
$\{V_t\}_{t=0}^T$ of the ANC game (\ref{equi-point.t})
defined recursively by
\begin{eqnarray}
V_T(x,s) &=& \sigma^T(x) - g^T(s), \nonumber \\
V_t(x,s) &=& \inf_{u \in \mathbb{R}^n} \sup_{p \in
\mathcal{S}_{N-1}} p'
\mathcal{V}_t(x,s,u) \label{infsup_t} \\
&= & \sup_{p \in \mathcal{S}_{N-1}} \inf_{u \in \mathbb{R}^n}
p'\mathcal{V}_t(x,s,u). \label{supinf_t}
\end{eqnarray}
for all $t=0,\ldots,T-1$ and $x\in\mathbb{R}^n$,
$s\in\mathcal{F}$, where $\mathcal{V}_t$ is a function
$\mathcal{X}\times \mathbb{R}^m\to
\mathbb{R}^{N}$ with components
\begin{eqnarray}
\lefteqn{[\mathcal{V}_t(x,s,u)]_a\triangleq
\sigma^t(x,u) - g^t(a,s)} && \nonumber \\
&&+
\mathbb{E}_t\!\left[V_{t+1}(x^{t+1},s^{t+1})|
x^t\!=\!x, s^t\!=\!s, u^t\!=\!u, a^t \!=\! a\right], \qquad
\label{calV}
\end{eqnarray}
are all well defined, convex and continuous in $x$.
Furthermore, the strategy pair ($u^*,p^*$) defined by
\begin{eqnarray}
(u^*)^t&=&\arg \inf_{u \in \mathbb{R}^n} \sup_{p \in \mathcal{S}_{N-1}} p'
\mathcal{V}_t(x,s,u), \\
(p^*)^t&=& \arg \sup_{p \in \mathcal{S}_{N-1}}
\inf_{u \in \mathbb{R}^n} p'
\mathcal{V}_t(x,s,u),
\end{eqnarray}
is a saddle-point strategy of the ANC game
(\ref{equi-point.t}).
\end{theorem}
Theorem~\ref{exist_theo} introduces the HJBI
equation for the ANC game~(\ref{equi-point.t}) associated with the linear
plant (\ref{plant.t.linear}), see (\ref{infsup_t}), (\ref{supinf_t}).
Such an equation reduces finding jammer's
optimal strategies and the corresponding controller's best responses for the
multi-step ANC problem to a one-step game-type problem of the type
considered in the previous sections. Unfortunately, even for linear plants it
appears to be difficult to obtain an analytical answer to the question
whether the jammer's corresponding optimal strategy is randomized or
not. The main difficulty appears to be obtaining a closed form expression
for $V_t(x,s)$ --- of course, the tools developed in the previous
sections can be used to characterize a possibility of non-pure equilibria
numerically. An
alternative is to consider greedy jamming strategies, where at each time
step the jammer pursues a strategy which is (sub)optimal only at this particular
time. For example, one possibility is to use a lower bound for $V_{t+1}$ in the
HJBI equation~(\ref{calV}),
\begin{eqnarray*}
&&\inf_{u \in \mathbb{R}^n} \sup_{p \in
\mathcal{S}_{N-1}} p'
\tilde{\mathcal{V}}_t(x,s,u), \label{infsup_t.greedy}
\\
\lefteqn{[\tilde{\mathcal{V}}_t(x,s,u)]_a\triangleq
\sigma^t(x,u) - g^t(a,s)} && \nonumber \\
&&\quad +
\mathbb{E}_t\left[\nu_{t+1}(\|A_tx+b^tB_tu\|)\big|
s^t=s, a^t = a\right].
\label{calV.greedy}
\end{eqnarray*}
While not optimal, such greedy strategies may
allow the jammer launch a randomized DoS attack which will likely be as
difficult to detect as an optimal one. The effect of such an
attack on the overall system performance and defence strategies against
it are an open question.
\section{Discussion and conclusions}\label{Conclusions}
In this paper we have analyzed a class of control problems over
adversarial communication links, in which the jammer strategically
disrupts communications between the controller and the plant. Initially, we have
posed the problem as a static game, and have given necessary and sufficient
conditions for such a game to have a non-pure saddle point. This allows a characterization of a set of plant's initial states for
which a DoS attack can be mounted that requires a nontrivial controller's
response.
For instance, in two linear quadratic
problems analyzed in Section~\ref{Examples} the optimal control law is
nonlinear. This gives the jammer an advantage over any linear control
policy in those problems. The jammer achieves this by randomizing
its choice of a packet-dropping transmission regime rather than direct jamming. In those problems,
the part
of the state space where the jammer randomizes is determined by the
jammer's cost of switching (reward for not switching), cost of termination, and transition probabilities of the current and the most
blocking regimes. If these parameters can be
predicted/estimated by the controller, it has a chance of mitigating the
attack by either eliminating those regions, or steering the plant so that
it avoids visiting those regions.
Also, a multi-stage finite-horizon game has been considered for linear plants.
We have shown that equilibria for that game can be found by solving
similar one-stage games, although in general it is difficult to
obtain closed form solutions for these
games, and one may need to resort to solving them numerically. As an
alternative, a greedy suboptimal analysis has been proposed.
Future work will be directed to further understanding conditions for
DoS attacks, with the aim to obtain a deeper insight into dynamic/multi-step ANC
problems. Another interesting question is whether associating a distinct
payoff with one of the channels is necessary for the jammer to resort to
randomization. The system closed-loop stability under the proposed randomized
jamming attack is also an interesting problem, namely the question whether
it is possible for the jammer to degrade control performance and avoid
being caught due to causing an instability. Analysis of this
problem requires a different, infinite horizon problem formulation.
\section{Appendix}\label{Appendix}
\subsection{Proof of Proposition~\ref{Markov}}
Since the process $s^t$ is a Markov chain,
for each $t=0,\ldots, T-1$ and an arbitrary measurable set
$\Lambda\times S\subseteq \mathcal{X}$,
\begin{eqnarray*}
\lefteqn{\mathrm{Pr}(x^{t+1}\in\Lambda,s^{t+1}\in S|\{(x^\theta,s^\theta),u^\theta,a^\theta\}_{\theta=0}^t)}&& \nonumber
\\
&&=
\sum_{i\in S} P_{s^t, i}^t(a^t)
\mathrm{Pr}(x^{t+1}\in\Lambda|s^{t+1}=i, \{(x^\theta,s^\theta),u^\theta,
a^\theta\}_{\theta=0}^t). \nonumber
\end{eqnarray*}
Furthermore, from (\ref{q_j}) and (\ref{plant.t}), since given $s^{t+1}$,
$b_t$ is conditionally independent of $\{(x^\theta,s^\theta),u^\theta,
a^\theta\}_{\theta=0}^t$, then
\begin{eqnarray}
\label{markov.prob}
\lefteqn{\mathrm{Pr}(x^{t+1}\in\Lambda,s^{t+1}\in S|
\{(x^\theta,s^\theta),\{u^\theta,a^\theta\}_{\theta=0}^t)} &&
\nonumber \\
&&=
\sum_{i\in S}
\mathrm{Pr}(x^{t+1}\in\Lambda|s^{t+1}=i, x^t,u^t)P_{s^t,i}^t(a^t)
\nonumber \\
&&=
\mathrm{Pr}(x^{t+1}\in\Lambda,s^{t+1}\in S|x^t,s^t,u^t,a^t),
\end{eqnarray}
proving that $\{x^t,s^t\}_{t=0}^T$ is a Markov process.
\subsection{Proof of Theorem~\ref{BO.T4}}
First, we observe that since the function
$h_a^{x,s}(\cdot)$ is continuous and coercive, then according
to~\cite[Theorem~1.4.1]{PSU-1988},
$\inf_{u}h_a^{x,s}( u)>-\infty$. Let $\alpha_x$ be a constant such that
$\alpha_x \ge \max_{a,s} \inf_{u} h_a^{x,s}( u)$. Owing to the
coercivity property of $h_a^{x,s}(\cdot)$ there exists $M^{s}_a(x)$
such that if $\|u\|>M^{s}_a(x)$ then
$
h_a^{x,s}(u) > \eta_a^{s,x}(\|u\|)> \alpha_x.
$
Let $M(x)=\max_{a,s}M^{s}_a(x)$, and consider the ball
$U(x)=\{u:\|u\|\le M(x)\}$. Then the following facts hold
\begin{enumerate}[(i)]
\item
For all $s$,
$U^{s}(x)\triangleq\{u: \max_{a\in\mathcal{A}} h_a^{x,s}(u)\le \alpha_x\} \subseteq U(x).
\label{Uh.1}
$
Indeed, if $u\in U^{s}(x)$, then $h_a^{x,s}(u)\le \alpha_x$ therefore
$\|u\|\le M^{s}_a(x)\le M(x)$.
\item
Also, for all $p\in\mathcal{S}_{N-1}$ and $x\in\mathbb{R}^n$,
$s\in \mathcal{F}$,
\begin{equation}
\{u: p'h^{x,s}(u) \le \alpha_x \}\subseteq U(x) \quad \forall
p\in\mathcal{S}_{N-1}.
\label{Uh.2}
\end{equation}
Indeed, if $\|u\|> M(x)$, then $h_a^{x,s}(u) > \alpha_x$ for all
$a\in\mathcal{A}$ and we must have $p'h^{x,s}(u)>\alpha_x$. Therefore
$p'h^{x,s}(u) \le \alpha_x$ implies that $\|u\|\le M(x)$.
\end{enumerate}
Using (i) and the fact that $p'h^{x,s}(u)$ is linear in $p$ and
therefore $\sup_{p\in \mathcal{S}_{N-1}}
p'h^{x,s}(u)=\max_{a\in \mathcal{A}} h^{x,s}_a(u)$,
we obtain
\begin{eqnarray}
J_1 &=& \inf_{u\in \mathbb{R}^m}\max_{a\in \mathcal{A}} h_a^{x,s}(u) \le \inf_{u\in U(x)}\max_{a\in \mathcal{A}} h_a^{x,s}(u) \nonumber \\
& \le& \inf_{u\in U^{s}(x)}\max_{a\in \mathcal{A}} h_a^{x,s}(u)= \inf_{u\in
U^{s}(x)}\sup_{p\in \mathcal{S}_{N-1}} p'h^{x,s}(u). \qquad
\label{Uh.3}
\end{eqnarray}
On the other hand, by definition, for $u\in\mathbb{R}^m\backslash
U^{s}(x)$, $\displaystyle\max_{a\in \mathcal{A}} h^{x,s}(u)> \alpha_x$, therefore
$\displaystyle
J_1\! =\!\!\inf_{u\in U^{s}(x)} \sup_{p\in \mathcal{S}_{N-1}}\!\!\!
p'h^{x,s}(u).
$
Together with (\ref{Uh.3}) this yields~(\ref{inf_U_sup}).
In a similar manner, from (\ref{Uh.2}) it follows that $\forall p\in
\mathcal{S}_{N-1}$,
$
\inf_{u\in \mathbb{R}^m} p'h^{x,s}(u) = \inf_{u\in U(x)} p'h^{x,s}(u)$.
The identity
$
J_2 = \sup_{p\in \mathcal{S}_{N-1}} \inf_{u\in U(x)} p'h^{x,s}(u)
$
immediately follows from that identity, i.e., the rightmost identity
(\ref{J1J2}) holds.
We have established that both the upper value (\ref{inf_sup}) and the lower
value (\ref{sup_inf}) can be computed by performing minimization over the
compact set $U(x)$ which is also convex.
Since $\mathcal{S}_{N-1}$ is also compact and convex, and the
payoff function $p'h^{x,s}(u)$ is continuous and convex in $u$
for each $p\in \mathcal{S}_{N-1}$ and is continuous and concave
in $p$ for each $u \in U(x)$, the
zero-sum game on the right-hand side of (\ref{inf_U_sup})
has a saddle point in $U(x)\times \mathcal{S}_{N-1}$,
but this saddle point may not be
unique~\cite[Theorem 4, p.168]{B&O}. That is, the leftmost identity
(\ref{J1J2})
holds and the value of the zero-sum game over $U(x)\times
\mathcal{S}_{N-1}$ is finite. Then, using (\ref{inf_U_sup}) and
(\ref{J1J2}) we conclude that both $J_1$ and $J_2$ are finite and equal.
\subsection{Proof of Lemma~\ref{suff_cond}}
The proof is a variation of well-known arguments regarding the connection
between convex duality and the existence of a saddle-point for the
Lagrangian, as well as dual characterization of minimal elements of
convex sets (see, e.g., \cite{Boyd}). Because of our need to
incorporate unboundedness of vector $u^*$ and non-purity of vector $p$,
however, we find it clearer to provide a full
derivation here than to directly resort to these arguments.
Consider the set
\begin{eqnarray}
M:= \{z \in \mathbb{R}^{|\mathcal{G}|} \;|\; \exists u \mbox{ such that }
H_\mathcal{G}(u) \leq z \};
\label{Mset}
\end{eqnarray}
here the notation $H_\mathcal{G}(u)$ refers to the vector comprised of the
components of $H(u)$ whose indexes belong to $\mathcal{G}$. Also, the
inequality in (\ref{Mset})
is understood component-wise. The interior and the boundary
of $M$ are denoted $\overset{\circ}{M}$ and $\partial M (=
M\setminus\overset{\circ}{M})$.
$M$ is clearly convex since $H$ is. In addition, assumption (b) implies
that $H_\mathcal{G}(u^*) \in \partial M$. Indeed, $H_\mathcal{G}(u^*)$
clearly belongs to $M$. If, in addition, we let $\mathbf{1}$ denote the
vector of all ones then, for any $r >0$ the point $z_r :=
H_\mathcal{G}(u^*) - \frac{r}{|\mathcal{G}|} \mathbf{1}$ belongs to the ball
$\mathcal{B}(H_\mathcal{G}(u^*),r)$ of center $H_\mathcal{G}(u^*)$ and
radius $r$ in $\mathbb{R}^{|\mathcal{G}|}$ but does \textit{not} belong to
$M$ since
\begin{itemize}
\item $H_\mathcal{G}(u^*) > z_r$, and
\item according to (b), for any $u \neq u^*$, there exists $i$ such that
$H_i(u) > H_i(u^*) >(z_r)_i$, i.e., $H_\mathcal{G}(u) \nleq z_r$ $\forall
u\neq u^*$.
\end{itemize}
We have thus shown that, for any $r>0$, $\mathcal{B}(H_\mathcal{G}(u^*),r)$
is \textit{not} a subset of $M$, which implies that $H_\mathcal{G}(u^*)$ is
not in the interior of $M$. Now, because $H_\mathcal{G}(u^*) \in \partial
M$, we can use the supporting hyperplane theorem (see, e.g., p.~51 of
\cite{Boyd}), to claim that there exists $\bar{p} \in
\mathbb{R}^{|\mathcal{G}|}$, $\bar{p}\neq 0$, such that
\begin{equation}
\bar{p}' H_\mathcal{G}(u^*) \leq \bar{p}' z \mbox{ for all } z \in M.
\label{separation}
\end{equation}
Now, we claim that $\bar{p} \in \mathbb{R}^{|\mathcal{G}|}_+$. Indeed, note
that if $z^0 \in M$, the
ray $R_i := z^0 + \mathbb{R}^1_+ \mathbf{e}_i \subset M$, for any basis
vector $\mathbf{e}_i$. Hence, because of (\ref{separation}), the function
$z \mapsto
\bar{p}' z$ is lower-bounded on $R_i$, which implies that $\bar{p}_i \geq
0$. Also note that $\bar{p}$ is non-pure, for otherwise, from
(\ref{separation}), there would exist $i \in \mathcal{G}$ such that
$
H_i(u^*)= \bar{p}' H_\mathcal{G}(u^*) \leq \bar{p}' H_\mathcal{G}(u) =
H_i(u)$ $\mbox{ for all } u ,
$
(because $H_\mathcal{G}(u) \in M$ for all $u$), which contradicts (c).
Now, if we define $p^* \in \mathbb{R}^N$ by
$p^*_i=\frac{\bar{p}_i}{\bar{p}_1+\ldots+ \bar{p}_{|\mathcal{G}|}}$ for all $i \in \mathcal{G}$ and $p^*_i=0$ for all $i \notin \mathcal{G}$, we find that $p^* \in \mathcal{S}_{N-1}$, $I( p^*) \subset \mathcal{G}$ and
\begin{eqnarray*}
(p^*)' H(u^*) &=& \frac{1}{\bar{p}_1+\ldots+ \bar{p}_{|\mathcal{G}|}}
\bar{p}'H_\mathcal{G}(u^*) \\
&
\leq & \frac{1}{\bar{p}_1+\ldots +\bar{p}_{|\mathcal{G}|}} \bar{p}'H_\mathcal{G}(u) = (p^*)' H(u)
\end{eqnarray*}
$ \mbox{ for all } u$, which means that $u^*$ is a best response to $p^*$, i.e.,
$
u^* \in \arg\inf_{u \in \mathbb{R}^m} (p^*)'H(u).
$
Now, note that (a) implies that $p^*$ is a best response to $u^*$, i.e., $
p^* \in \arg\sup_{p \in \mathcal{S}_{N-1}} p'H(u^*),
$ since
\begin{align*}
(p^*)'H(u^*) &= \sum_{i \in \mathcal{G}} p^*_i H_i(u^*)=(\sum_{i \in \mathcal{G}} p^*_i) \max_{1 \leq j\leq N} H_j(u^*)\\
&= \max_{1 \leq j\leq N} H_j(u^*) \geq p' H(u^*) \mbox{ for all } p \in \mathcal{S}_{N-1}.
\end{align*}
In fact, the same proof would show that any vector with support included in $\mathcal{G}$ is a best response to $u^*$. Now,
\begin{eqnarray*}
\inf_{u \in \mathbb{R}^m} \sup_{p \in \mathcal{S}_{N-1}} p'H(u) &\leq&
\sup_{p \in \mathcal{S}_{N-1}} p'H(u^*)=(p^*)'H(u^*) \\
= \inf_{u \in \mathbb{R}^m} (p^*)' H(u)
&\leq & \sup_{p \in \mathcal{S}_{N-1}} \inf_{u \in \mathbb{R}^m} p' H(u),
\end{eqnarray*}
while it is always true that
$
\sup_{p} \inf_{u} p' H(u) \leq \inf_{u} \sup_{p} p' H(u).
$
This concludes the proof.
\hfill$\Box$
\subsection{Proof of Theorem~\ref{saddle.point}}
\emph{Sufficiency. }
First we show that (\ref{F=F}), (\ref{FF>F}) and (\ref{dF.dF<0}) imply the
existence of a non-pure saddle point for (\ref{inf_sup}) supported on
$\mathcal{G}$. Without loss of generality suppose
\begin{equation}\label{dF.dF<0.1}
\frac{dh_{a_1}^{x,s}(\bar u)}{d u}>0, \quad
\frac{dh_{a_2}^{x,s}(\bar u)}{d u}<0.
\end{equation}
Since $h_{a_1}^{x,s}(\cdot)$ is convex, it follows from
(\ref{dF.dF<0.1}) that $\frac{dh_{a_1}^{x,s}(u)}{d u}$ is non-decreasing
in the region $u\ge \bar u$. This is true for all points $u\ge \bar u$
including the points of the set $U^d$ where we have the inequality between
the right-hand side and left-hand side derivatives,
$\frac{d^-h_{a_1}^{x,s}(u)}{d u}\le \frac{d^+h_{a_1}^{x,s}(u)}{d u}$.
Hence $\frac{dh_{a_1}^{x,s}(u)}{d u}>0$ for all
$u\ge \bar u$ and thus $h_{a_1}^{x,s}(u)>h_{a_1}^{x,s}(\bar u)$ for all $u>\bar
u$. In the same manner we can show that $h_{a_2}^{x,s}(u)<h_{a_2}^{x,s}(\bar u)$
for all $u<\bar u$. Also, $\bar u$ is not a minimum of
$h_{a_1}^{x,s}( \cdot)$ and $h_{a_2}^{x,s}(\cdot)$
since $\frac{dh_{a_1}^{x,s}(\bar u)}{d u}\neq 0$, $\frac{dh_{a_2}^{x,s}(\bar
u)}{d u}\neq 0$. The sufficiency of conditions (\ref{F=F}), (\ref{FF>F}) and
(\ref{dF.dF<0}) now follows from Theorem~\ref{Suff_theorem}.
We now consider the second alternative case where (\ref{F=F}), (\ref{FF>F}) and
(\ref{dF=dF=0}) hold. Since $h_{a_1}^{x,s}(u)$ and $h_{a_2}^{x,s}(u)$ are
convex, (\ref{dF=dF=0}) implies that $\bar u$ is a global minimum
of both $h_{a_1}^{x,s}(u)$ and $h_{a_2}^{x,s}(u)$. Therefore for an
arbitrary $p\in \mathcal{S}_{N-1}$ with $p_a=0$ for $a\neq
\mathcal{G}$,
$\bar u$ is a global minimum of
$
\mathbb{E}^{u,p}\Sigma(x^+,u,a)=p'H(u),
$
where $H(u)=h^{x,s}(u)$ is the vector function defined in
Theorem~\ref{Suff_theorem}. That is,
$
\inf_u p' H(u)
=p' H(\bar u)
=h_{a_1}^{x,s}(\bar u)=h_{a_2}^{x,s}(\bar u).
$
It then follows that for arbitrary $\bar p, \tilde p \in
\mathcal{S}_{N-1}$ supported on $\mathcal{G}$
and $u\in\mathbb{R}^1$,
\begin{eqnarray}
\tilde p' H(\bar u)\le \bar p' H(\bar u)
\le \bar p' H(u).
\label{sp.1}
\end{eqnarray}
The leftmost inequality holds since both expressions are equal to
$h_{a_1}^{x,s}(\bar u)=h_{a_2}^{x,s}(\bar u)$.
Next, consider an arbitrary vector
$p\in\mathcal{S}_{N-1}$. From (\ref{FF>F}) we have
\begin{eqnarray}
p'H(\bar u)&=&\sum_{j\neq a_2}
p_j\mathbb{E}^{\bar u,p}[\Sigma(x^+,\bar u,a)|a=j] + p_{a_2}
h_{a_2}^{x,s}(\bar u) \nonumber \\
&\le& (\sum_{j\neq a_2} p_j)\mathbb{E}^{\bar u,p}[\Sigma(x^+,\bar u,a)|a=a_1] +
p_{a_2} h_{a_2}^{x,s}(\bar u) \nonumber \\
&=& \tilde p' H(\bar u),
\label{sp.3}
\end{eqnarray}
where $\tilde p$ is defined as $\tilde p_{a_1}=\sum_{j\neq a_2} p_j$,
$\tilde p_{a_2}=p_{a_2}$ and $\tilde p_a=0$ for $a\not\in \mathcal{G}$, and
is supported on $\mathcal{G}$. Then from (\ref{sp.1}), it follows
that for all $u\in\mathbb{R}^1$, and $p\in\mathcal{S}_{N-1}$
$
p'H(\bar u)\le (\bar p)'H(\bar u) \le (\bar p)'H(u).
$
Hence for an arbitrary $\bar p \in
\mathcal{S}_{N-1}$ supported on $\mathcal{G}$, $(\bar
u,\bar p)$ is a saddle point of the game. Clearly, a non-pure $\bar p$
exists for this purpose.
\emph{Necessity. }
Let $(u^*,p^*)$, $u^*\not\in U^d$,
be a non-pure saddle point of the game
(\ref{inf_sup}) supported on $\mathcal{G}=\{a_1,a_2\}$.
That is, $0<p_{a_1}^*<1$ and
\begin{eqnarray}
p' H(u^*)
\le (p^*)' H(u^*)
\le ( p^*)' H(u), \quad \nonumber \\
\forall
u\in\mathbb{R}^1, p\in \mathcal{S}_{N-1}.
\label{sp.*}
\end{eqnarray}
The last inequality implies
\begin{eqnarray*}
\inf_u \max_{p\in \mathcal{S}_{N-1}}p' H(u) && \le \max_{p\in
\mathcal{S}_{N-1}} p' H(u^*) = (p^*)' H(u^*) \\
&& = \inf_u (p^*)' H(u)
\le \max_{p\in \mathcal{S}_{N-1}}\inf_u p' H(u).
\end{eqnarray*}
However, the game has the value, therefore all the inequalities above are in
fact exact identities. That is,
\begin{eqnarray*}
\inf_u \max_{p\in \mathcal{S}_{N-1}} p' H(u)
= \max_{p\in \mathcal{S}_{N-1}}p' H(u^*).
\end{eqnarray*}
In other words, $u^*\in \arg \inf_u \max_{p\in
\mathcal{S}_{N-1}} p' H(u)$, and taking into account
linearity of the payoff function in $p$, we further have
$
u^*\in
\arg \inf_u \max[h_{a_1}^{x,s}(u), h_{a_2}^{x,s}(u)].
$
We now show that $h_{a_1}^{x,s}(u^*)=h_{a_2}^{x,s}(u^*)$.
Suppose this is not true, and $h_{a_1}^{x,s}(u^*)<h_{a_2}^{x,s}(u^*)$. Then,
since $p_{a_1}^*>0$, $p_{a_2}^*>0$, and $p_{a_1}^*+p_{a_2}^*=1$ by
assumption,
\begin{eqnarray*}
h_{a_2}^{x,s}(u^*)= (p_{a_1}^*+p_{a_2}^*) h_{a_2}^{x,s}(u^*)
> (p^*)'H(u^*).
\end{eqnarray*}
The latter condition is in contradiction with the leftmost inequality in
(\ref{sp.*}). The converse inequality $h_{a_2}^{x,s}(u^*)<h_{a_1}^{x,s}(u^*)$ is also not possible, by the same argument. This proves
that
$h_{a_1}^{x,s}(u^*)=h_{a_2}^{x,s}(u^*)$, i.e., $u^*$ satisfies the condition (\ref{F=F})
of the theorem.
It remains to prove that $u^*$ satisfies ether (\ref{dF.dF<0}) or
(\ref{dF=dF=0}). We prove this by ruling out all other possibilities.
\emph{Case 1: $\left(\frac{dh_{a_1}^{x,s}(u^*)}{d u}\right)
\left(\frac{dh_{a_2}^{x,s}(u^*)}{d u}\right)>0$.}
First suppose $\frac{dh_{a_1}^{x,s}(u^*)}{d u}<0$,
$\frac{dh_{a_2}^{x,s}(u^*)}{d u}<0$. Then, in a
sufficiently small neighbourhood of $u^*$ one can find a point $u<u^*$ such
that
\begin{eqnarray*}
h_{a_1}^{x,s}(u) < h_{a_1}^{x,s}(u^*) \quad \mbox{and} \quad
h_{a_2}^{x,s}(u) < h_{a_2}^{x,s}(u^*).
\end{eqnarray*}
That is, we found a point $u<u^*$ such that
$(p^*)' H(u) < ( p^*)' H(u^*)$.
This conclusion is in contradiction with the rightmost inequality
(\ref{sp.*}). The hypothesis that $\frac{dh_{a_1}^{x,s}(u^*)}{d
u}>0$, $\frac{dh_{a_2}^{x,s}(u^*)}{d u}>0$ will lead to
a similar contradiction. These contradictions rule out Case 1.
\emph{Case 2: Either $\frac{dh_{a_1}^{x,s}(u^*)}{d u}=0$
and $\frac{dh_{a_2}^{x,s}(u^*)}{d u}\neq 0$, or
$\frac{dh_{a_1}^{x,s}(u^*)}{d u}\neq 0$
and $\frac{dh_{a_2}^{x,s}(u^*)}{d u}= 0$.}
Suppose $\frac{dh_{a_1}^{x,s}(u^*)}{d u}=\beta>0$ and
$\frac{dh_{a_2}^{x,s}(u^*)}{d u}= 0$.
Since $h_{a_1}^{x,s}(\cdot)$, $h_{a_2}^{x,s}(\cdot)$ are continuously
differentiable at $u^*$, then for any
sufficiently small $\epsilon>0$, there exists $\delta>0$ such that for any
$u\in (u^*-\delta,u^*+\delta)$,
$
\frac{dh_{a_1}^{x,s}(u)}{d u}>\beta-\epsilon$,
$\left|\frac{dh_{a_2}^{x,s}(u)}{d u}\right|<\epsilon. $
Let us choose $\epsilon$ so that $\epsilon< p_{a_1}^*\beta<\beta$ and
consider the Taylor expansions of $h_{a_1}^{x,s}(u)$, $h_{a_2}^{x,s}(u)$,
$u^*-\delta<u<u^*$, with the remainders in the Cauchy form
\begin{eqnarray*}
h_{a_1}^{x,s}(u)= h_{a_1}^{x,s}(u^*)+\frac{d h_{a_1}^{x,s}(\xi_1)}{d u} (u-u^*), \\
h_{a_2}^{x,s}(u)= h_{a_2}^{x,s}(u^*)+\frac{dh_{a_2}^{x,s}(\xi_2)}{d u} (u-u^*),
\end{eqnarray*}
where $\xi_1,\xi_2\in (u,u^*)$. Since $h_{a_2}^{x,s}(u)$ is convex
and $\frac{dh_{a_2}^{x,s}(u^*)}{d u}= 0$, then
$-\epsilon<\frac{dh_{a_2}^{x,s}(\xi_2)}{d u}\le 0$ for
$u^*-\delta<u<\xi_2<u^*$. This leads us to conclude that
\begin{eqnarray*}
p_{a_1}^*\frac{dh_{a_1}^{x,s}(\xi_1)}{d u}
+p_{a_2}^*\frac{dh_{a_2}^{x,s}(\xi_2)}{d u} &>&
p_{a_1}^*(\beta-\epsilon) - p_{a_2}^*\epsilon >0.
\end{eqnarray*}
Then we have
\begin{eqnarray}
(p^*)' H(u)&=&(p^*)' H(u^*) \nonumber \\
&+& \left( p_{a_1}^*\frac{dh_{a_1}^{x,s}(\xi_1)}{d u}
+ p_{a_2}^*\frac{dh_{a_2}^{x,s}(\xi_2)}{d
u}\right)(u-u^*) \nonumber \\
&<& (p^*)' H(u^*).
\end{eqnarray}
Again, we arrive at a contradiction with the assumption that $(u^*,p^*)$ is
a saddle point and must satisfy (\ref{sp.*}).
Other similar possibilities in this case will lead to a contradiction as
well. This leaves two possibilities: either $u^*$ satisfies
(\ref{dF.dF<0}), or it satisfies (\ref{dF=dF=0}).
\subsection{Proof of Theorem~\ref{exist_theo}}\label{exist_theo.proof}
We need to show that each function $V_t$ is well-defined, i.e., that there
is indeed equality between (\ref{infsup_t}) and (\ref{supinf_t}) for any
$x,s$; this amounts to the zero-sum game solved at time $t$ having a
value. We will proceed by backwards induction and show that the following
predicate holds for all $t=0,\ldots,T$:
\begin{description}
\item[$(\mathbf{P}_t):$] $V_t(\cdot,s)$ is a well-defined continuous convex
function for all $s\in \mathcal{F}$. In addition,
there exist a function $\nu_t$ and scalar $v_t$ such that
\begin{enumerate}[(a)]
\item
$\nu_t(y) \geq v_t$ for all $y$,
\item
$\lim_{y \rightarrow
+\infty }\nu_t(y) = + \infty$ and,
\item
$V_t(x,s) \geq \nu_t(\|x\|)$ for all
$x \in \mathbb{R}^n$, $s\in \mathcal{F}$.
\end{enumerate}
\end{description}
Clearly predicate $\mathbf{P}_T$ holds since $\sigma^T$ is convex and continuous and
according to
Assumption~\ref{CL.assum},
\begin{eqnarray}
V_T(x,s) &=& \sigma^T(x) - g^T(s) \ge \beta_T(\|x\|)-\max_{s\in\mathcal{F}}g^T(s) \nonumber \\
&\triangleq & \nu_T(\|x\|) \ge v_T
\end{eqnarray}
where $v_T\triangleq d_T-\max_{s\in\mathcal{F}}g^T(s)$.
Let us now assume that predicate $\mathbf{P}_{t+1}$ holds for $t \le T-1$
and show
that $\mathbf{P}_t$ holds. Note that
\begin{eqnarray}
\lefteqn{[\mathcal{V}_t(x,s,u)]_a=
\sigma^t(x,u) - g^t(a,s)} && \nonumber \\
&& + \sum_{i=1}^{|\mathcal{F}|} P_{si}^t(a) \left[
(1-q_i^t)
V_{t+1}(A_tx,s) \right. \nonumber \\
&& + \left.
q_i^t
V_{t+1}(A_tx+B_tu,s) \right],
\label{calV.1}
\end{eqnarray}
Using Assumption \ref{CL.assum} we then find that for
all $a\in \mathcal{A}$,
\begin{eqnarray}
\lefteqn{[\mathcal{V}_t(x,s,u)]_a
\geq \alpha_t(\|x\|) + \beta_t(\|u\|) -
\max_{s \in \mathcal{F}} g_t(a,s)} && \nonumber \\
&& \quad + \sum_{i=1}^{|\mathcal{F}|} P_{si}^t(a) \left[ (1-q^t_i)
\nu_{t+1}(\|A_tx\|)\right. \nonumber \\
&& \quad\qquad +
q^t_i \nu_{t+1}(\|A_tx+B_tu\|) \nonumber \\
&& \quad \geq
\alpha_t(\|x\|) + \beta_t(\|u\|) - \max_{s \in \mathcal{F}} g_t(a,s) +
v_{t+1}.
\label{minor}
\end{eqnarray}
That is, for all fixed $(x,s)\in\mathcal{X}$, $a\in \mathcal{A}$, the
function $[\mathcal{V}_t(x,c,s,\cdot)]_a$ is coercive on
$\mathbb{R}^m$.
Also, since according to predicate $\mathbf{P}_{t+1}$, $V_{t+1}(\cdot,s)$ is
a continuous function, then by Assumption~\ref{contin} the
function $[\mathcal{V}_t(x,s,\cdot)]_a$ is continuous on $\mathbb{R}^m$
for all $x\in \mathbb{R}^n$, $a\in \mathcal{A}$, and $s\in
\mathcal{F}$.
Finally, we note that since $V_{t+1}(\cdot,s)$ is a convex function by
assumption, and $A_tx+B_tu$ is linear with respect to $u$, then
$V_{t+1}(A_tx+B_tu,s)$ is convex in $u$. Also, $\sigma^t(x,u)$ is convex in
$u$ by Assumption~\ref{CL.assum}. Hence we conclude that
$[\mathcal{V}_t(x,s,\cdot)]_a$ is convex.
We have verified all the conditions of Lemma~\ref{BO.T4},
which can now be applied to ascertain
that the $\inf\sup$ and $\sup\inf$ expressions in (\ref{infsup_t}) and
(\ref{supinf_t}) are equal and finite. Thus, the function $V_t(x,s)$ is
well-defined, and there exists a saddle point pair of strategies
$(u^*)^t(x,s)$, $(p^*)^t(x,s)$ defined by the static zero-sum game
(\ref{infsup_t}).
Furthermore, it follows from (\ref{minor}) that $V_t(x,s)$
satisfies properties (a)-(c) stated in predicate $\mathbf{P}_t$ with
the function $\nu_t(\cdot)$ and constant $v_t$ defined as
\begin{eqnarray*}
&&\nu_t(y)=\alpha_t(y)+d_t
-\max_{a\in\mathcal{A}}\max_{s\in\mathcal{F}}g_t(a,s)+v_{t+1};
\\
&&v_t=e_t+d_t -\max_{a\in\mathcal{A}}\max_{s\in\mathcal{F}}g_t(a,s)+v_{t+1}.
\end{eqnarray*}
It remains to prove that $V_t(\cdot,s)$ is convex and continuous.
For continuity, we note that composition of $V_{t+1}(\cdot,s)$
and $A_tx+B_tu$ is continuous uniformly in
$u$, since the latter function has this property and the former function
is continuous. Then
$P_{si}^t(a)q_i^tV_{t+1}(A_tx+B_tu,s)$ is also continuous
uniformly in $u$. Therefore, for every $\tilde x\in\mathbb{R}^n$ and
$\epsilon>0$
one can find $\delta^{a,s}(\tilde x,\epsilon)>0$ which does not depend on
$u$ and such that $\|x-\tilde x\|< \delta^{a,s}(\tilde x,\epsilon)$ implies
$
|(\mathcal{V}_t(x,s,u))_a
-(\mathcal{V}_t(\tilde x,s,u))_a|<\frac{\epsilon}{2}.
$
Selecting $\delta(\tilde x,\epsilon)=\min_{a,s} \delta^{a,s}(\tilde
x,\epsilon)$ we obtain
\begin{eqnarray*}
p'\mathcal{V}_t(\tilde x,s,u)-\frac{\epsilon}{2}< p'\mathcal{V}_t(x,s,u) <
p'\mathcal{V}_t(\tilde x,s,u)+\frac{\epsilon}{2} \\
\forall x \in \{x: \|x-\tilde x\|\le \delta(\tilde x,\epsilon)\},
\ p\in\mathcal{S}_{N-1}.
\end{eqnarray*}
From here we readily conclude that
\begin{eqnarray*}
\lefteqn{\inf_{u}\sup_{p\in\mathcal{S}_{N-1}} p'\mathcal{V}_t(\tilde
x,s,u)- \epsilon} && \\
&&\le \inf_{u}\sup_{p\in\mathcal{S}_{N-1}} p'\mathcal{V}_t(x,s,u)
<
\inf_{u}\sup_{p\in\mathcal{S}_{N-1}} p'\mathcal{V}_t(\tilde
x,s,u) + \epsilon,
\end{eqnarray*}
for all $x \in \{x: \|x-\tilde x\|\le \delta(\tilde x,\epsilon)\}$, proving
that $V_t(\cdot,s)$ is continuous at an arbitrarily chosen
$\tilde x$.
For convexity of $V_t(\cdot,s)$, we note that each function
$(x,u)\to (\mathcal{V}_t(x,s,u))_a$ is convex since $\sigma^t$ is convex
in $(x,u)$ and $V_{t+1}(\cdot,s)$ is convex by the induction
hypothesis. As a result, the function
$\sup_{p\in\mathcal{S}_{N-1}} p'\mathcal{V}_t(\tilde x,s,u)$
is convex in $(x,u)$; see \cite[Section~3.2.3]{Boyd}. In turn, using
identity (\ref{inf_U_sup}) of Lemma~\ref{BO.T4},
we conclude that
\begin{eqnarray*}
V_t(x,s)&=&\inf_{u\in\mathbb{R}^m}\sup_{p\in\mathcal{S}_{N-1}}
p'\mathcal{V}_t(\tilde x,s,u) \\
&=&\inf_{U(x)}\sup_{p\in\mathcal{S}_{N-1}}
p'\mathcal{V}_t(\tilde x,s,u)
\end{eqnarray*}
is convex since $U(x)$ is a convex set.
| {'timestamp': '2017-06-07T02:02:17', 'yymm': '1706', 'arxiv_id': '1706.01559', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01559'} | arxiv |
\section*{Abstract}
The Indo-Pacific region contains a unique mix of opportunities for the development and use of genetic-pest-management, gene-drive, and gene-drive-like technologies. Here I collectively refer to these technologies as Evolutionary Genetic Engineering (EGE). Indo-Pacific Islands have some of the world's highest rates of endemism and extinction—species and entire ecosystems are at risk. This threat to the natural world is coupled with the burden of human diseases, many of which are new and emerging or neglected tropical diseases. The same factors which have led to high rates of endemism also, in some ways, make this region an ideal testing ground for some types of EGE's. There is great potential for positive humanitarian, economic, and conservation applications of EGE's. However, these types of new technologies will be initially viewed from the perspective of the recent history of a loss of self determination, issues of social justice, and the testing of new technologies (e.g., biocontrol, agricultural, nuclear) in the Indo-Pacific—a region of the world that is still extensively colonized and controlled by Western Nations. Experience with successes and failures in related technologies suggests a path to move forward—a set of eight recommendations—to maximize the potential payoffs and minimize unintended negative effects of EGE's.
\section*{Introduction}
The Island Indo-Pacific is a large, important, unique, and unfortunately often overlooked region of the world. There is tremendous potential for the positive use of Evolutionary Genetic Engineering (EGE) in the region in both humanitarian and conservation applications. This potential stems from the regions geographic isolation, collection of infectious diseases, and species conservation urgencies. However, it would be a mistake to neglect the context of recent and ongoing political and social challenges in the region. Doing so is likely to generate a negative reaction that could inhibit the applications of promising emerging technologies. This context includes issues of colonialism, self determination, biocontrol, the testing of new technologies, and early experiences with genetically modified agricultural crops in the region. In this article I am focused on the Island Indo-Pacific Tropics, but also use examples from the broader region including India and Australia. I am also focusing on terrestrial applications of EGE’s. There are potential freshwater and marine applications, but this is less developed and goes beyond the scope of the current article.
In order to move forward in a way that does not sacrifice long term progress for short term convenience, we must accept that everyone has a role to play in shaping our technological future; this is not always easy to do when faced with confrontations and fundamental disagreements. To do this we must
\begin{enumerate}
\item enhance communications and avoid a reluctance to provide more detailed information about new technologies or to be dismissive of inquiries.
\item EGE applications should only be pursued if there is a genuine benefit to the local population (and if the people potentially affected generally agree that this is desirable rather than the decision being made externally), not in order to test new technologies in a “safe” manner or to avoid jurisdictional regulations.
\item The potential benefits and risks of EGE's, along with the degree of uncertainty surrounding both, need to be unambiguously communicated.
\item There needs to be a frank discussion of unintended side effects and the potential for misuse of the technology.
\item Humanitarian goals need to be administered and controlled by humanitarian organizations while conservation goals need to be administered and under the control of conservation organizations (applicable to both governmental and non-governmental organizations); this is especially true in an international setting.
\item Proactive research needs to be conducted and the data available to address common concerns about the possible ecological and health effects of EGE’s.
\item It takes broad perspectives, beyond what any single person is capable of, to identify potential promises and pitfalls of the development and implementations of EGE's.
\item Finally, a broad-based community discussion of, and direct involvement in, EGE development and applications should occur as early as possible. This will positively shape both the development and applications of the technology and help build a solid social foundation for future developments.
\end{enumerate}
\section*{Potential Evolutionary Genetic Engineering Applications in the Island Indo-Pacific.}
The Indo-Pacific spans half of the Earth’s circumference yet receives relatively less international focus. A revealing example is that this is the non-polar region that is most often divided on map projections of the world. This inattention is not simply due to a smaller population; the four most populous countries in the world (China, India, the USA, and Indonesia) have territory and active interests in the region.
The Island Indo-Pacific has some of the world’s highest rates of both species endemism (unique genetic diversity) and extinction \citep{vitousek1988, fleischer1998, myers2000, kier2009}.
Adaptive radiations of species here have served as prime examples of evolutionary biology \citep[p.~380][]{darwin1845, dobzhansky1973}.
Extinctions in these species-rich regions are proceeding at an alarming rate \citep{pimm1995, ganzhorn2001, fonseca2009, loehle2012, regnier2015} and this is predicted to be exacerbated by climate change \citep{benning2002, mora2013}.
The region is in dire need of effective conservation strategies and potential Evolutionary Genetic Engineering (EGE) applications targeting introduced species and diseases have been proposed to establish effector genes refractory to introduced vectored disease (genetic modifications to block transmission of the disease) and genetic sterile insect techniques to suppress populations of invasive species \citep{clarke2002, wimmer2005, sinkins2006, altrock2010, esvelt2014, reeves2014, webber2015}.
The Island Indo-Pacific is also home to newly emerging and/or neglected tropical diseases that affect human health as well as economically important species. Vector borne human diseases in the region include chikungunya, dengue fever, Japanese encephalitis, lymphatic filariasis, malaria, plague and Rift Valley fever (in Madagascar), schistosomiasis, scrub typhus, West Nile fever, and zika. Additionally there are diverse agricultural crop pests and diseases that impact food production across the region. A major goal of EGE development is to address human disease, and there is also potential for agricultural applications \citep{alphey2002, sinkins2006, gould2008a, wimmer2013, esvelt2014, champer2016}.
When countries are listed by gross domestic product per capita it becomes apparent that the Indo-Pacific contains, in terms of national economic wealth, many of the poorest countries in the world. For example, the Comoros, Kiribati, Madagascar, Marshall Islands, Micronesia, Papua New Guinea, Solomon Islands, Tuvalu, and Vanuatu have an average per capita GDP of Intl.\$2,387, approximately 1/8th of the world average, Intl.\$18,872 \citep{IMF2016}. This limits the resources available that these governments can apply to humanitarian and conservation interventions and suggests an enhanced value of international collaboration.
In many ways the terrestrial isolation that has led to the Indo-Pacific's tremendous biological diversity also makes the region ideal for some EGE applications. Suppressing or modifying non-native invasive species is an obvious place to start. However, what may be a pest in one location may be a highly valued or important ecological species in another (e.g., nopal \textit{Opuntia} cacti are a highly valued component of Mexican cuisine and source of animal fodder while considered an invasive species pest in Australia---\textit{Cactoblastis cactorum} has been used successfully as bio-control in Australia but is now threatening native \textit{Opuntia} in the Americas \citep{zimmerman2004}. Proper application of Type 1 and 2a EGE’s (Appendix A: Types of Evolutionary Genetic Engineering) can leave a species genetically unmodified within its native range, even with low levels of migration between islands or islands and continents \citep{altrock2010, altrock2011, laruson2016}. The limited and discrete partitioning of land area of islands make 100\% local genetic transformation or eradication of a species possible without resorting to type 2b or 3 EGE’s (Appendix A) and allows the application to proceed in a stepwise fashion across multiple islands using limited resources.
\section*{Colonialism, self determination, and the testing of new technologies}
We have different perspectives depending on our experiences and social / cultural identities, and we are all-too-often not aware of how our individual perspective differs from others. In the middle of the abstract I used the following sentence, ``The same factors which have led to high rates of endemism also, in some ways, make this region an ideal testing ground for some types of EGE's.'' I chose the wording of this sentence carefully. What was your reaction? For many of the people reading this article the sentence seemed perfectly natural and flows into the ideas of the preceding and following sentences. However, for some readers the phrase ``testing ground'' is likely to stand out. Our reaction to this sentence is related to our perspective. For many who do not live in the island Indo-Pacific it is easy to see the region as something external to our daily lives and more disposable for testing and experimenting. In contrast, for some the Indo-Pacific represents home, family, work, and is also fundamentally connected to a cultural identity. I ask readers to construct your own sentence connecting a place that is highly valued to you personally (your hometown, where you live now, or a place of historical, religious, or cultural importance) with a ``testing ground'' of a new potentially powerful technology with its own set of concerns and unknowns.
The Indo-Pacific has a long and continuing history of a loss of self determination and sovereignty.
The UN Special Committee on Decolonization lists American Samoa, French Polynesia, Guam, New Caledonia, Pitcairn, and Tokelau as Non-Self-Governing-Territories.
The total number of ongoing sovereignty disputes encompasses many more islands and regions too extensive to list here. Colonization includes the establishment of extensive military bases and use of the islands for tests of nuclear, biological, and chemical warfare technologies---and these were not limited to a few isolated incidents, for example hundreds of nuclear weapons tests were conducted by France in Mururoa and Fangataufa Atolls, by the United Kingdom in South Australia, Montebello, and Kiritimati Islands, by the United States in Pikinni (Bikini), \=Anewetak (Enewetak), Johnston (Kalama) Atolls, and Kiritimati.
This history of military testing, non-military testing of new technologies (e.g., disastrous attempts at classical biological control by introducing new species, e.g., \citealt{howarth1983,clarke1984,henneman2001,messing2006,hays2007,parry2009}), and colonization in the region can severely inhibit international biological research and potential applications including EGE’s.
There is a case study that deserves special mention within the context of EGE’s in the Indo-Pacific, especially in the context of international programs and applications of mosquito genetic engineering.
From 1969–1975 the World Health Organization (WHO) collaborated with the US Public Health Service (PHS) and the Indian Council of Medical Research (ICMR) to establish a Genetic Control of Mosquitoes Research Unit (GCMRU) in India; this was financially supported by the Government of India, US PL-480 funds, and the CDC \citep{AEND1975a}.
The GCMRU was studying and implementing mosquito control technologies including the release of sterilized individuals. What appears to have started with concerns about a carcinogen (thiotepa) being added to well water in the village of Pochanpur without public or government consultation got caught up in politics \citep{AEND1975b,hanlon1975}, with widespread accusations in the media and later by the Government of India, and grew into a political disaster with suspicions that the US military was using India to test methods of biological warfare using mosquitoes \citep{AEND1974, sehgal1974,anonymous1975, AEND1975b, hanlon1975, anonymous1976,powell2002}.
The addition of thiotepa to village water has been denied by WHO \citep{tomiche1975}, but publications preceding the accusations suggest this may have happened \citep[pp. 85-87][]{pal1974}---and therein lies one problem.
There was a lack of clear unambiguous communication from the beginning. Furthermore, PHS did have military connections and shared materials and information with the US military \citep{langer1967,treaster1975}.
The US military did conduct chemical and biological tests in the Indo-Pacific; this included the release of mosquitoes off the coast of Baker Island (``Magic Sword'' 1965), the release of \textit{Bacillus globigii} in O`ahu (``Big Tom'' 1965), shelling sarin nerve agent in Wai\=akea Forest Reserve, Hawai`i (``Red Oak'' 1967), and the dispersal of \textit{Staphylococcus aureus} enterotoxin type B over \=Anewetak (Enewetak) Atoll (``DTS Test 68-50'' 1968).
However, in all likelihood there was no military or biological warfare connections with the GCMRU \citep{WHO1976,powell2002}.
Covert transfer of US funds to keep GCMRU going was briefly discussed with WHO \citep{AEND1975c, SSWDC1975} but this was considered too risky and the US suspended funding the project.
Despite denials by WHO \citep{tomiche1975}, the GCMRU, which was planned to extend at least until 1978, was forced to shut down prematurely in 1975 \citep{AEND1975d} and the project was deemed a failure \citep{curtis2007}.
What can be learned from this?
\begin{enumerate}
\item There was a clear lack of communication resulting from a reluctance of either the WHO or the US to engage the media and comment on the allegations \citep{AEND1974, AEND1975e, anonymous1975, tomiche1975}. This was unfortunate as it, perhaps rationally, fuelled suspicions. The public perception of public perception may differ from public perception---the individual perception of public opinion is influenced by a range of factors and may not be an accurate reflection of commonly held attitudes \citep[e.g.,][]{mutz1989}. The idea that providing more information would undermine support conflicts with recent results that show the more informed people are of the release of genetically modified mosquitoes the more supportive they become; however, a great deal of public engagement has to be accomplished, especially for women, minorities, and people with lower education levels and lower household incomes \citep{ernst2015,kolopack2015}.
\item There was a perception that these experiments would not have been permitted in Western countries and that India was being used as a testing ground \citep{anonymous1975,raghavan1975}. Knowledge that a technology has been effective in other countries is one factor associated with strong public support \citep{ernst2015}. It is unfortunate that prior programs in the US, Myanmar/Burma, Tanzania, Western Africa, and France were not communicated to the Indian press \citep{laven1972,WHO1976,curtis2007}. The perception that an international project is being conducted to avoid home country regulation should certainly be (truthfully) avoided.
\item The potential benefits of the project to the people of India was unclear \citep{AEND1974,anonymous1975}. This is perhaps most tragic of all. India suffers from mosquito vectored dengue, malaria, Japanese encephalitis, chikungunya, and lymphatic filariasis \citep{sharma2015}. While a balance must be struck to not over-promise results that may not be realized, the goals and potential benefits of EGE applications must also be clearly advertised.
\item There was a lack of an \textit{a priori} open and frank discussion about possible misuse of the technology \citep{hanlon1975}. While any technology can be potentially misused by individuals or organizations, a nation's government, and especially its military, has non-humanitarian and non-conservation priorities that can potentially conflict with the goals of humanitarian and conservation projects. Regardless of the existence of an actual conflict, the perception of possible conflict does exist, which can undermine credibility \citep{serafino2008,charney2013}. Fortunately today this is widely recognized and the 1978 UN ENMOD treaty (\url{http://www.un-documents.net/enmod.htm}) may prevent, depending on interpretation, military involvement in EGE technologies except perhaps for some limited applications of type 0 and 1 systems (Appendix A). The ENMOD treaty states that ``Each State Party to this Convention undertakes not to engage in military \ldots environmental modification techniques having widespread, long-lasting or severe effects \ldots the term `environmental modification techniques' refers to any technique for changing---through the deliberate manipulation of natural processes---the dynamics, composition or structure of the Earth, including its biota \ldots'' However, there is still a need for an open discussion about potential malicious uses, and military involvement with EGE projects should be avoided in order to encourage international trust and cooperation.
\end{enumerate}
In response, Dr.~B.~D.~Nagchaudhuri's, physicist and scientific adviser to the Indian Ministry of Defence, recommendations were ``(A) that research proposals and projects are available to the public; and (B) that pertinent records contain clear statements as to why the objective is important, what is the [Government of India's] interest, and what is the [United States Government's] interest'' \citep{AEND1975f} and ``ministry officials must be alerted to any sensitive problems by the technical experts involved''; also, that ``each collaborative project should also be approved at the ministerial or secretary level of the ministry under which the project would fall i.e. health projects - Ministry of Health, Agricultural Projects - Ministry of Agriculture, \ldots This should also hold true whether on the Indian side or the US side'' \citep{AEND1975g}. Dr.~Hanlon recommends ``At the very least, there should be an open discussion of the [biological warfare] potential of such projects before they begin, so that countries can make informed choices'' \citep[p.~103][]{hanlon1975}.
There is a value to compartmentalizing different aspects of a government’s actions. It seems almost self evident that funds for research are best spent by research agencies, funds for health are best spent in agencies focused on health, funds for conservation are best spent by agencies trained in and focused on conversation. Even if there were sufficient funding and resources we would not want the EPA (Environmental Protection Agency) or DOH (Department of Health) carrying out military actions; the converse is also true. We don’t want to rely on our military to carry out conservation, human health, or humanitarian actions when there are other agencies, without conflicting priorities, that can and should be doing this \citep{serafino2008,charney2013}. The author has discussed EGE's and the ENMOD treaty in person with current and former members of DARPA, a research branch of the military with an interest in EGE's, and has been told that the military has to carry out high risk (in the sense of new and experimental) research because NSF (National Science Foundation) and NIH (National Institutes of Health) cannot. I completely disagree. Research agencies can and should also be funding higher risk, higher pay-off research instead of abdicating this role to the military---and to avoid the kinds of conflicts suggested in the WHO experience in India. This is not done in the US because of historical inertia and objectively unbalanced federal budget allocations (a Department of Defense, DOD, estimated research budget of \$66 billion versus \$29 billion for NIH and only \$6 billion for NSF in FY2015, \citealt{hourihan2016}). Reallocating civilian research funds to civilian agencies would also free up the military to focus on military actions and capabilities.
\section*{Recent experiences with GMO’s in the Indo-Pacific}
EGE’s are likely to be initially framed in terms of the GMO (Genetically Modified Organism) crop debate \citep{knols2007}.\footnote{Although, classical sterile insect technique involving radiation or chemicals and Wolbachia based techniques stand as exceptions. These are genetic approaches in the sense that the organisms chromosomes are affected (Callaini et al., 1997; Robinson, 2005), but they are not considered genetic modifications.} Within Hawai`i, Rainbow Papaya and GMO Taro serve as contrasting examples of the interaction between social acceptance, development, and deployment of new technologies. \textit{Carica papaya} was not grown in Hawai`i until after European contact in 1778. The papaya industry in Hawai`i was devastated in the 1990’s by the ringspot virus. A genetically engineered ``rainbow'' papaya resistant to ringspot infection was developed at Cornell University by Dr.~D.~Gonsalves \citep{ferreira2002} who was originally from Hawai`i. While GMO papaya is not without controversy \citep[e.g.,][]{harmon2014,hofschneider2016} it is credited with rescuing the industry and is \textit{de facto} widely adopted in Hawai`i today \citep[e.g.,][]{kallis2013}.
\textit{Colocasia esculenta} (Taro or Kalo in Hawaiian) was brought to Hawai`i by the ancient Polynesians. A wide range of Kalo varieties have had a central role in traditional Hawaiian culture as a staple food crop and continues to be economically important \citep{whitney1939,fleming1994}. Furthermore, Kalo is literally the brother of humans (H\=aloa) in the Hawaiian creation tradition and words for family and relationships also refer to parts of the plant \citep{kahumoku1980}. Taro leaf blight (\textit{Phytophthora colocasiae}) was introduced to Hawai`i in the 1900’s and has significantly impacted Kalo \citep{nelson2011}. Work at the University of Hawai`i was begun to to breed resistant varieties which resulted in patents in 2002. Separately a Chinese variety of Taro was genetically modified from 2001 to 2006 with a gene from wheat to be resistant to leaf blight. This resulted in widespread public outrage and large protest rallies in 2006 that resulted in the university relinquishing its patents and issuing an indefinite moratorium on the genetic engineering of Hawaiian Kalo \citep{ritte2006,CTAHR2009}.
With these cases in mind consider a potential EGE project. Culex mosquitoes were introduced to Hawai`i in the mid 1800’s. They vector \textit{Plasmodium relictum} which is responsible for avian malaria. Many Hawaiian forest bird species, important in traditional Hawaiian culture (e.g., `ahu `ula, mahiole, and in Hawaiian religion), have no immunity or tolerance to \textit{P.~relictum} and have become extinct, with many currently threatened, as a result \citep{warner1968}. These two previous contrasting examples suggest that genetically modifying non-native mosquitoes to reduce the frequency of avian malaria is much more socially acceptable than the reverse: genetically modifying native Hawaiian birds to be resistant to infection by Plasmodium (although it would be worth conducting the relevant public surveys to determine this). Also, doing the research locally in Hawai`i is not necessarily an advantage in terms of securing broad local public support, buy-in, and acceptance (however, it is an advantage in terms of engaging the public).\footnote{Another fascinating dimension is the degree of public awareness and identity with conservation goals and issues. This varies tremendously across the Indo-Pacific with various emphasis on terrestrial and marine issues and could be the subject of an article and research project in its own right.} These are aspects that might not initially be appreciated by scientists designing EGE technologies.
On a broader scale across the Indo-Pacific, consider the cases of golden rice and Bt-cotton. Rice (\textit{Oryza sativa}) is a staple crop for a large segment of the population across the Indo-Pacific. A major nutritional shortcoming of rice is the lack of beta-carotene that can be metabolized into vitamin A, which in many of these populations is \textit{de facto} not simply rectified by supplementing with additional food sources. This unfortunate situation leads to blindness and the deaths of over half a million people a year. To address this, rice has been engineered since 2000 with DNA sequences from other plants to produce bio-available beta-carotene \citep{ye2000,paine2005,tang2009}. This ``golden rice'' has also been the target of a great deal of controversy, protest, and misinformation \citep[e.g.,][]{dobson2000,potrykus2001,enserink2008,lynas2013b}. Much of this protest originates in the Western world where ironically we have a wide range of nutritional supplements added to our food including vitamin D in milk, calcium in orange juice, niacin and folic acid in bread, iodine in salt, and fluoride in drinking water. One question to ask ourselves is, why is it so easy to add all of these supplements to our food supply, not to mention widespread adoption of genetically modified corn, soybeans, cotton, potatoes, sugar beets, \textit{etc}., in parts of the West, when providing vitamin A in the form of Golden Rice for much of the world’s population is still not approved and remains in a testing phase well over a decade later?
Bt-cotton, which has received less attention in the media, provides a contrasting case to golden rice where a GM crop has been embraced in the Indo-Pacific and this has been in large part driven by local buy-in. Bt-cotton is engineered to produce a naturally occurring insecticide from a bacteria (\textit{Bacillus thuringiensis}). The intention is to kill larvae of the cotton bollworm (\textit{Helicoverpa armigera}). A seed company in India led by Dr.~D.~B.~Desai began selling ``Navbharat 151'' seed in 1998 with the claim that the plants did not have to be sprayed with pesticides for bollworm. This proved to be the case during a large bollworm outbreak in Gujarat in 2001, which raised questions. It was found that Navbharat 151 plants had a genetic modification created by Monsanto. The Indian government filed criminal charges against Dr.~Desai, ordered the seed destroyed, and 4,000 hectares of planted fields burned. Thousands of farmers rallied to support Dr.~Desai and block burning the fields; the Gujarat government refused to carry out the order; the recall was cancelled, and some farmers saved their own seed for replanting. The opposite of concerns about using India as a testing ground as discussed in the WHO mosquito project of the 1970's (point 2 above) were expressed: `How can something made in the United States, many of them wonder aloud, be unsafe in India? ``I think they grow it in China and other countries,'' says Kalidas Patel, who grew Navbharat cotton in Gujarat' \citep{mcgray2002}. Later Monsanto was granted a license to market Bt-cotton in India and in all likelihood the prior experience with Navbharat 151 promoted public buy-in \citep{menon2001,mcgray2002}. In recent years Bt-cotton is widely adopted, approximately 90\% of the cotton grown in India, and a black market for Bt-cotton seeds also appears to be thriving \citep[e.g.,][]{kathage2012,nemana2012}.
However, this is in no way a simple matter and debates regarding Bt-cotton, Monsanto, and regulation continue \citep[e.g.,][]{anonymous2016,basheer2016}.
Regardless, the support among Indian farmers for Bt-cotton stands in stark contrast to the protests over golden rice being planted in test beds in the Philippines \citep{lynas2013a}. The cause of the difference between these experiences is hard to isolate and a large number of idiosyncratic effects likely contribute including the pivotal actions of a few or a single individual. However, the effects of local buy-in, combined with local access to technologies, and first hand experience with these technologies, should not be ignored.
Finally, concerns about ecological effects of EGE’s are associated with strong opposition to the technology \citep{ernst2015}. There are also questions of possible, but unlikely, bioaccumulation of toxic proteins and allergenicity \citep{curtis2007,reeves2012}. In addition to the four guidelines in the previous section, despite limited time and funding, we should conduct the work to have the data on hand to address these questions to the public \citep{curtis2007}.
\section*{Everyone has a role to play}
We live in a world that is often overly self-polarizing.
I am a geneticist; I entered this field because of personal interest, excitement, and challenges of the promise and potential of genetics.
Unintentionally, this has become a part of my identity.
When I was first exposed to protests over genetic technology it was all too easy to feel that it was also a personal attack. This is nested within the context of broader anti-scientific popular views related to climate change, evolution, renewable energy, vaccinations, \textit{etc}. The natural reaction is to reflexively move in the opposite direction and argue that genetic technologies are safe, protesters don't understand the issues, \textit{etc}. and be overly dismissive; a position that I may not have had initially.
The difficult but essential step for growth is to try to find a middle ground and synthesize a path forward \citep[see also][]{NPR2013}. Right or wrong, no single perspective can do this on its own and, because of our perspectives, we are often blind to potential issues apparent to other people. It is easier to see a potential risk if you are looking for a risk instead of working toward developing a desired application of a new technology. For example, the potential of allergic reactions to genetic modifications are real and not to be dismissed \citep[e.g.,][]{nordlee1996}, and many crops have a strong cultural significance that many people may not be aware of such as Kalo in Hawai`i, discussed above, or maize in Chiapas \citep{bellon1994,perales2005,brush2007}. As geneticists we are in a unique position to be able to critically assess potential benefits and risks, once we perceive them, of genetic technology from a scientific perspective. It is our responsibility to embrace and communicate this rather than contributing to destructive polarization. However, it is not our job to be overly encompassing and give equal weight to all objections; we also must be willing to learn from past experiences (such as the disastrous effects of the perception of possible military involvement in the WHO program in India) and to rationally disagree when we reason this to be the case. For example, despite claims to the contrary \citep{seralini2012}, there is no scientific evidence that herbicide resistant maize is carcinogenic. There is a great deal of misinformation and misconceptions surrounding who would or would not benefit, and to what degree, from golden rice \citep{harmon2013}. Attitudes regarding GMO's are divisive, some are not based on factual evidence and can be labeled as irrational although this quickly gets complex \citep{stone2010,lynas2013a,blancke2015,hicks2015}; regardless, the GMO debate will continue to prove a rich subject for the analysis of the dynamics of politics, the media, framing effects, confirmation bias, social identity, information cascades, \textit{etc}., for many years to come.
An area that can benefit from improvement is to incorporate this synthesis earlier into the research and development process. If individuals with different perspectives were able to directly participate in the design of a new technology, they could shape the direction in which it develops towards an outcome that might be more desirable and socially acceptable. (Recall the effect of personal experience with Bt-cotton and its adoption in India.) Often the way development of a new technology works is in incremental steps of design, troubleshooting, and research funding, to consultation and approval from regulatory agencies, to building the logistics of application and deployment. Public consultation and asking for acceptance occurs only at the end of the day, when many steps have been cast and it is more difficult and time consuming to make fundamental revisions. One possibility is to include grant support for individuals from the social sciences to be ``embedded'' in a biological laboratory in order to fully participate in a laboratory’s research and conduct their own research about social attitudes, context, communication, perceptions, \textit{etc}., both in its own right and as a bidirectional conduit to facilitate communication, public guidance, and knowledge transfer in the development of EGE technologies (see \citealt{kolopack2015} for a highly effective example of community engagement albeit not exactly in the same form that I am proposing here). The local community can directly participate in the development of a new technology, possibly facilitating progress in a direction that is unanticipated by the researchers, funding, and regulatory agencies, but one that results in a greater positive potential being realized at the end of the day.
\section*{Conclusion}
This Indo-Pacific is geographically isolated, under a burden of infectious diseases, and is in dire need of protection of its natural world. This creates an opportunity for positive, highly valued, effective applications of EGE's. However, it would be a mistake to ignore the history and social realities thought the region. To reiterate the eight points from the introduction that have been expanded upon through this article:
\begin{enumerate}
\item There is a need to enhance and engage communications in all directions.
\item EGE applications should only be pursued if there is a genuine benefit to, and buy-in from, the local population.
\item The potential benefits and risks of EGE's need to be unambiguously communicated.
\item There needs to be a clear unambiguous discussion of unintended side effects and potential misuses of the technology.
\item Humanitarian goals need to be administered and controlled by humanitarian organizations and conservation goals need to be administered and under the control of conservation organizations.
\item Proactive research needs to be conducted and the data available to address common concerns.
\item It takes broad perspectives to broadly identify potential promises and pitfalls of EGE's.
\item An early broad-based community discussion of, and involvement in, EGE development and applications should occur.
\end{enumerate}
Finally, no matter how ``new'' a technology or situation seems, there is still much to be learned from history.
\section*{Ancknowledgements}
I thank \'Aki L\'aruson, Vanessa Reed, and three anonymous reviewers for comments on the manuscript. Related work in the Reed lab has been recently supported by the Hawai`i Community Foundation, the State of Hawai`i Department of Land and Natural Resources, and by the Reed family.
\section*{Appendix A: Types of Evolutionary Genetic Engineering}
An important concept that cannot be over-emphasized is the diverse types of EGE's and their predicted effects. At the risk of oversimplification, here are four main types with an important boundary between them.\footnote{Another important type of classification are the types of likely effects and dynamics that occur when the drive systems are disrupted by mutation, recombination, and selection and how EGE's are likely to be converted into different types, but this goes beyond the scope of this article.}
\begin{description}
\item [Type 0]
Generic genetic modifications not designed to change in frequency over time using evolutionary principles. In general these are expected to either drift neutrally (if there is little to no effect) or be removed by natural selection. For example fluorescent proteins are often used to mark and keep track of genetic inserts; however, these proteins can have toxic effects \citep[e.g.,][]{liu1999, devgan2004, shaner2004, shaner2005}. This tends to reduce an organism’s fitness and these modifications are not expected to persist in the wild over many generations.
\item [Type 1]
Deleterious EGE's that are designed to be transient and removed from the population. Examples of type 1 include the “killer-rescue” system \citep{gould2008b}, genetic sterile insect technique \citep{horn2003}, and Wolbachia in cytoplasmic incompatibility population suppression applications \citep{laven1967, knipling1968}. These may persist in the wild for a shorter period of time than type 0 EGE’s.
\item [Type 2]
Threshold EGE’s that cannot increase in frequency when very rare but can increase in frequency and persist indefinitely once a critical frequency point is passed.
\begin{description}
\item [Type 2a]
Thresholds that are above a frequency of one half. These include chromosomal rearrangements \citep{foster1972}, haploinsufficient induced underdominance \citep{reeves2014} and possibly some forms of maternal-effect underdominance \cite{akbari2013}.
\item [Type 2b]
Thresholds that are below a frequency of one half. This includes Wolbachia \citep{hoffmann2011}, some forms of maternal-effect underdominance \cite{akbari2013}, and some theoretical systems \citep{davis2001}.
\end{description}
\item [Type 3]
Unconditionally driving EGE’s that can invade a population from arbitrarily low frequencies. These include Medea \citep{chen2007}, homing endonucleases \citep{windbichler2011}, transposable elements \citep{carareto1997}, meiotic drive \citep{cha2006} and some types of CRISPR systems \citep{gantz2015, dicarlo2015, hammond2015}.
\end{description}
In one perspective, the most important distinction is the boundary between 2a and 2b. This predicts what will happen without human intervention (without additional releases of modified or unmodified individuals) among multiple populations within a species due to the forces of migration and selection \citep{barton2011}. Type 1-2a will tend to reduce in range and disappear (although this may take many generations) while type 2b and 3 will tend to spread and become more established (and this may occur in a small number of generations for type 3) with the concern that once widespread enough this may be irreversible. While type 2a systems might be considered ``gene drive'' in a broad sense the term is probably more accurate to describe type 2b and especially type 3 systems (gene drive in the strong sense). The boundary between 2a and 2b represents a balance between ease of transformation of a population and reversibility back to a transformation free state---a balance between safety and efficiency.
Some natural EGE systems in the type 3 category have been shown to be capable of moving across subspecies and species boundaries, rapidly spreading worldwide, and lowering the average fitness of a species \citep[e.g.,][]{eanes1988, morita1992, hill2016}. The concern of this possibly happening due to artificial genetic engineering is not a new one \citep{gould2006}). For example, fully functioning transposable elements have been introduced into various new species in the lab \citep[e.g.,][]{brennan1984, daniels1989}, sometimes with little to no discussion of containment and possible escape. Fortunately there are methods of building in safeguards to minimize the chance of unintended spread in the wild \citep{dafaalla2006, gokhale2014}.
Additionally, it is important to keep in mind the (sometimes unexpected) effects of mutations and selection that can change the dynamics of EGE’s. For example, Y chromosome meiotic drive can be quickly suppressed by sex chromosome aneuploidy \citep{lyttle1981}. Arthropod species have been observed to rapidly evolve to suppress some effects of Wolbachia \citep{charlat2007}. Type 0 EGE’s may drift at some frequency in a population by unintended contamination \citep[e.g.,][]{gonsalves2012, xiao2016}; one concern that goes beyond this is that genetically engineered disease resistance may be adaptive, if infection by the disease has a large enough fitness cost, and the type 0 EGE may deterministically increase in frequency in the wild, essentially becoming a type 3 EGE (although to date there are not clear examples of this, e.g., \citealt{fuchs2004}). Some of these unexpected effects can be detected in laboratory experiments and incorporated into the design and predictions of the EGE.
It is already a challenge to filter out misinformation and misconceptions regarding genetic modifications. The author realizes that this adds another challenge; however, the fact is there are various types of EGE's with a range of predicted effects regarding how well they can be established in the wild and how reversible they are. It is appropriate, if possible, for these dynamics to be considered and to interact with regulatory approval and public acceptance \citep{harmon2014}.
| {'timestamp': '2017-06-07T02:05:31', 'yymm': '1706', 'arxiv_id': '1706.01710', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01710'} | arxiv |
\section{Introduction}
Quantification of left ventricle (LV) from cardiac imaging is among the most clinically important and most frequently demanded tasks for identification and diagnosis of cardiac disease~\cite{karamitsos2009role}, yet still a challenging task due to the high variability of cardiac structure across subjects and the complicated global/regional temporal dynamics.
Full quantification, i.e., to simultaneously quantify all LV indices including two areas, six regional wall thicknesses (RWT), three LV dimension, and one phase (as shown in Fig.~\ref{fig_indices}), providing more detailed information for comprehensive cardiac function assessment, is even more challenging since the uncertain relatedness intra and inter each type of indices may hinder the learning procedure from better convergence and generalization. In this work, we propose a newly-designed deep multitask learning network FullLVNet for full quantification of LV respecting both intra- and inter-task relatedness.
In clinical practice, obtaining reliable quantification is subjected to measuring on segmented myocardium, which is usually obtained by manually contouring the borders of myocardium~\cite{suinesiaputra2015quantification} or manual correction of contours~\cite{attili2010quantification,kawel2015normal} generated by LV segmentation algorithms~\cite{peng2016review}. However, manually contouring is time-consuming, of high inter-observer variability, and typically limited to the end diastolic (ED) and end systolic (ES) frames, which makes it insufficient for dynamic function analysis. LV segmentation algorithms, despite the recent advances, is still a difficult problem due to the lack of edge information and presence of shape variability. Most existing segmentation methods for cardiac MR images~\cite{peng2016review,petitjean2011review,ayed2012max} requires strong prior information and user interaction to obtain reliable results, which may prevent them from efficient clinical application.
\begin{figure}[t]
\centering
\includegraphics[width=10cm]{fig/all_indices.pdf}
\caption{Illustration of LV indices to be quantified for short-axis view cardiac image. (a) Cavity (blue) and myocardium (orange) areas. (b) directional dimensions of cavity (red arrows). (c) Regional wall thicknesses (red arrows). A: anterior; AS: anterospetal; IS: inferoseptal; I: inferior; IL: inferolateral; AL: anterolateral. (d) Phase (systole or diastole).}
\label{fig_indices}
\end{figure}
In recent years, direct methods without segmentation have grown in popularity in cardiac volumes estimation~\cite{afshin2012global,afshin2014regional,wang2014direct,zhen2015direct,zhen2014direct,zhen2015multi,zhen2017direct}.
Although these methods obtained effective performance by leveraging state-of-art machine learning techniques, they suffer from the following limitations.
1) Lack of powerful task-aware representation. The vulnerable hand-crafted or task-unaware features are not capable of capturing sufficient task-relevant cardiac structures.
2) Lack of temporal modeling. Independently handling each frame without assistance from neighbors can not guarantee the consistency and accuracy.
3) Not end-to-end learning. The separately learned representation and regression models cannot be optimal for each other.
4) Not full quantification. Only cardiac volume alone is not sufficient for comprehensive global, regional and dynamic function assessment.
In this paper, we propose a newly-designed multitask learning network (FullLVNet), which is constituted by a specially tailored deep CNN for expressive feature embedding; two followed parallel RNN modules for temporal dynamic modeling; and four linear models for the final estimation. During the final estimation, FullLVNet is capable of improving the generalization by 1) modeling intra-task relatedness through group lasso regularization within each regression task; and 2) modeling inter-task relatedness with three phase-guided constraints that penalize violation of the temporal behavior of LV indices. After being trained with a two-step strategy, FullLVNet is capable of delivering accurate results for all the considered indices of cardiac LV.
\section{Multitask learning for full quantification of cardiac LV}
The proposed FullLVNet models full quantification of cardiac LV as a multitask learning problem. Three regression tasks $\{y_{area}^{s,f}, y_{dim}^{s,f}, y_{rwt}^{s,f}\}$ and one classification task $y_{phase}^{s,f}$ are simultaneously learned to predict frame-wise values of the above mentioned LV indices from cardiac MR sequences $\mathcal{X}=\{X^{s,f}\}$, where $s=1\cdots S$ indexes the subject and $f=1\cdots F$ indexes the frame.
The objective of FullLVNet is:
\begin{equation}\label{eq_objective}
W_{optimal}=\min_{W}\frac{1}{S\times F}\sum_{s,f}\sum_{t}L_t(\hat{y}_t^{s,f}(X^{s,f}|W),y_t^{s,f})+\lambda \mathcal{R}(W)
\end{equation}
where $t\in \{area, dim, rwt, phase\}$ denotes a specific task, $\hat{y}_t$ is the estimated results for task $t$, $L_t$ is the loss function of task $t$ and $\mathcal{R}(W)$ denotes regularization of parameters in the network.
\begin{figure}[h]
\centering
\includegraphics[width=10cm]{fig/network.pdf}
\caption{Overview of FullLVNet, which combines a deep CNN network (details shown in the left) for feature embedding, two RNN modules for temporal dynamic modeling, and four linear models for final estimation. Intra- and inter-task relatedness are modeled in the final estimation to improve generalization.}
\label{fig_network}
\end{figure}
\subsection{Architectures of FullLVNet}
Fig.~\ref{fig_network} shows the overview of FullLVNet. A deep CNN is firstly designed to extract from cardiac images expressive and task-aware feature, which is then fed to the RNN modules for temporal dynamic modeling. Final estimations are given by four linear models with the output of RNN modules as input. To improve generalization of FullLVNet, both intra- and inter-task relatednesses are carefully modeled through group lasso and phase-guided constraints for the linear models.
\textbf{CNN for deep feature embedding}
To obtain expressive and task-aware features, we design a specially tailored deep CNN for cardiac images, as shown in the left of Fig.~\ref{fig_network}.
Powerful representations can be obtained by transfer learning~\cite{shin2016deep} from well-known deep architectures in computer vision for applications with limited labeled data. However, transfer learning may incur 1) restriction of network architecture, resulting in incompatible or redundant model; and 2) restriction of input channel and dimension, leading to requirement of image resizing and channel expanding.
We reduce the number of filters for each layer to avoid model redundancy. As for the kernel size of convolution and pooling, $5\times 5$, instead of the frequently used $3\times 3$, is deployed to introduce more shift invariance. Dropout and batch normalization are adopted to alleviate the training procedure. As can be seen in our experiments, our CNN is very effective for cardiac images even without transfer learning. As a feature embedding network, our CNN maps each cardiac image $X^{s,f}$ into a fixed-length low dimension vector $e^{s,f}=f_{cnn}(X^{s,f}|w_{cnn})\in \mathcal{R}^{100}$.
\textbf{RNNs for temporal dynamic modeling}
Accurate modeling of cardiac temporal dynamic assistants the quantification of current frame with information from neighbors. RNN, especially when LSTM units~\cite{graves2012supervised} are deployed, is specialized in temporal dynamic modeling and has been employed in cardiac image segmentation~\cite{poudel2016recurrent} and key frame recognition~\cite{kong2016recognizing} in cardiac sequences.
In this work, two RNN modules, as shown by the green and yellow blocks in Fig.~\ref{fig_network}, are deployed for the regression tasks and the classification task. For the three regression tasks, the indices to be estimated are mainly related to the spatial structure of cardiac LV in each frame. For the classification task, the cardiac phase is mainly related to the structure difference between successive frames. Therefore, the two RNN modules are designed to capture these two kinds of dependencies. The outputs of RNN modules are $\{h_m^{s,1},,,,h_m^{s,F}\}=f_{rnn}([e^{s,1},...e^{s,F}]|w_{m}),m\in\{rnn1,rnn2\}$.
\textbf{Final estimation}
With the outputs of RNN modules, all the LV indices can be estimated with a linear regression/classification model:
\begin{equation}\label{eq_linear_model}
\begin{cases}
\hat{y}_{t}^{s,f}=w_{t}h_{rnn1}^{s,f}+b_t, ~where ~t\in\{area, dim, rwt\} \\
p(\hat{y}_{t}^{s,f}=0)=\frac{1}{1+\exp(w_{t}h_{rnn2}^{s,f}+b_t)}, ~t=phase
\end{cases}
\end{equation}
where $w_{t}$ and $b_t$ are the weight and bias term of the linear model for task $t$, $0$ and $1$ denote the two cardiac phase $Diastole$ and $Systole$, and $p(\hat{y}_{phase}^{s,f}=1)=1-p(\hat{y}_{phase}^{s,f}=0)$.
For the loss function in~(\ref{eq_objective}), Euclidean distance and cross-entropy are employed for the regression tasks and the classification task, respectively.
\begin{equation}
L_{t} = \begin{cases}
\frac{1}{2}\|\hat{y}_t^{s,f}-y_t^{s,f}\|_2^2, ~where ~t\in\{area, dim, rwt\}\\
-\log p(\hat{y}_{t}^{s,f}=y_{t}^{s,f}),~t=phase
\end{cases}
\end{equation}
\subsection{Intra-task and inter-task relatedness}
Significant correlations exist between the multiple outputs of each task and those of different tasks, and are referred as intra- and inter-task relatedness. Intra-task relatedness can be effectively modeled by the well-known group lasso regularization, while inter-task relatedness is modeled by three phase-guided constraints. Improved generalization can be achieved with both of them fully leveraged in our FullLVNet.
\textbf{Intra-task relatedness based on group lasso}
Group lasso, also known as L1/L2 regularization, can perfectly model relatedness within groups of outputs, i.e, the three regression tasks. It enforces common feature selection cross related outputs with the L2 norm, and encourages sparse selection of the most related features with the L1 norm for each task. In this way, the relevant features of different tasks can be well disentangled. To leverage this advantage, group lasso is applied to the weight parameters of the three regression models in~(\ref{eq_linear_model}).
\begin{equation}
\mathcal{R}_{intra}=\sum_t \sum_i\|w_t(i)\|_2, ~for ~t\in\{area, dim, rwt\}
\end{equation}
where $w_t(i)$ denotes the $i$th column of $w_t$.
\textbf{Inter-task relatedness based on phase-guided constraints}
Three phase-guided constraints are proposed to model inter-task relatedness, i.e, the cardiac phase and other LV indices. Cardiac phase indicates the temporal dynamics of LV myocardium in a cardiac cycle. Other LV indices change accordingly with cardiac phase: 1) cavity area and LV dimensions increase in the diastole phase and decrease in the systole phase; 2) myocardium area and RWT decrease in the diastole phase and increase in the systole phase. Effectively modeling such an intrinsic phase-guided relatedness would ensure that the estimated LV indices are consistent with the temporal dynamics of LV.
To penalize violation of these inter-task relatednesses, three phase-guided constraints are applied to the predicted results of areas, dimensions and RWT.
\begin{equation}
\begin{split}
\mathcal{R}_{inter}^{area}=\frac{1}{2S\times F}&\sum_{s,f}[\mathbbm{1}(y_{phase}^{s,f}=0)(\max(-z_{area}^{s,f,1},0)+\max(z_{area}^{s,f,2},0))\\
&+\mathbbm{1}(y_{phase}^{s,f}=1)(\max(z_{area}^{s,f,1},0)+\max(-z_{area}^{s,f,2},0))]
\end{split}
\end{equation}
\begin{equation}
\mathcal{R}_{inter}^{dim}=\frac{1}{S\times F}\sum_{s,f}[\mathbbm{1}(y_{phase}^{s,f}=0)\max(-\bar{z}_{dim}^{s,f},0)+ \mathbbm{1}(y_{phase}^{s,f}=1)\max(\bar{z}_{dim}^{s,f},0)]
\end{equation}
\begin{equation}
\mathcal{R}_{inter}^{rwt}=\frac{1}{S\times F}\sum_{s,f}[\mathbbm{1}(y_{phase}^{s,f}=0)\max(\bar{z}_{rwt}^{s,f},0)+ \mathbbm{1}(y_{phase}^{s,f}=1)\max(-\bar{z}_{rwt}^{s,f},0)]
\end{equation}
where $\mathbbm{1}(\cdot)$ is the indicator function, $z_t^{s,f}=\hat{y}_t^{s,f}-\hat{y}_t^{s,f-1}, for~t\in\{area,dim,rwt\}$, $z_t^{s,f,i}$ denotes the $i$th output of $z_t$ and $\bar{z}_t$ denotes the average value of $z_t$ across its multiple outputs. Totally, our regularization term becomes
\begin{equation}
\mathcal{R}(W)=\lambda_1\mathcal{R}_{intra}+\lambda_2(\mathcal{R}_{inter}^{area}+\mathcal{R}_{inter}^{dim}+\mathcal{R}_{inter}^{rwt})
\end{equation}
\section{Dataset and Configurations}
Our FullLVNet is validated with short-axis cardiac MR images of 145 subjects. Temporal resolution is 20 frames per cardiac cycle, resulting in a total of 2900 images in the dataset. The pixel spacings range from 0.6836 mm/pixel to 2.0833 mm/pixel, with mode of 1.5625 mm/pixel. The ground truth values are computed from manually obtained contours of LV myocardium. Within each subject, frames are labeled as either Diastole phase or Systole phase, according to the obtained values of cavity area.
In our experiments, two landmarks, i.e, junctions of the right ventricular wall with the left ventricular, are manually marked for each image to provide reference for ROI cropping and the LV myocardial segments division. The cropped images are resized to $80\times80$. The network is implemented by Caffe with SGD solver. Five-fold cross validation is employed for performance evaluation and comparison. Data augmentation is conducted by randomly cropping images of size $75\times 75$ from the resized image.
\textbf{Two-step strategy training}
We apply a two-step strategy for training our network to alleviate the difficulties caused by the different learning rate and loss function in multitask learning~\cite{zhang2010convex,zhang2014facial}.
Firstly the CNN embedding, the first RNN module and the three regression models are learned together with no back propagation from the classification task, to obtain accuracy prediction for the regression tasks; with the obtained CNN embedding, the second RNN module and the linear classification model are then learned while the rest of the network are kept frozen. As shown in the experiments, such a strategy delivers excellent performance for all the considered tasks.
\section{Results and Analysis}
FullLVNet is extensively validated under different configurations in Table.~\ref{table_results}. From the last column, we can draw that FullLVNet successfully delivers accurate predictions for all the considered indices, with average Mean Absolute Error (MAE) of 1.41$\pm0.72mm$, 2.68$\pm1.64mm$, 190$\pm128mm^2$ for RWT, dimension, and areas. For reference, the maximums of these indices in our dataset are 24.4$mm$, 81.0$mm$, 4936$mm^2$. Error rate (1-accuracy) for phase identification is 10.4\%.
Besides, the effectivenesses of intra- and inter-task relatedness are also demonstrated by the results in the third and fourth column: intra-task relatedness brings clearly improvements for all the tasks, while inter-task relatedness further brings moderate improvement. Compared to the recent direct multi-feature based method~\cite{zhen2015multi}, which we adapt to our full quantification task, FullLVNet shows remarkable advantages even without intra- and inter-task relatedness.
\begin{table*}[t]
\caption{Performance of FullLVNet under different configurations (e.g, intra/N means only intra-task relatedness is included) and its competitor for LV quantification. Mean Absolute Error (MAE) is used for the three regression tasks and prediction error rate is used for the phase identification task.}
\label{table_results}
\centering
\begin{tabular}{l|c|ccc}
\hline
\multirow{2}{*}{Method} & Multi-features & \multicolumn{3}{c}{FullLVNet}\\ \cline{3-5}
&\cite{zhen2015multi} &N/N&intra/N&intra/inter\\
\hline
\multicolumn{5}{c}{RWT (mm)}\\
\hline
IS&1.70$\pm$1.47&1.42$\pm$1.21&1.39$\pm$1.10&\textbf{1.32$\pm$1.09}\\
I&1.71$\pm$1.34&1.53$\pm$1.25&1.48$\pm$1.16&\textbf{1.38$\pm$1.10}\\
IL&1.97$\pm$1.54&1.74$\pm$1.43&1.61$\pm$1.29&\textbf{1.57$\pm$1.35}\\
AL&1.82$\pm$1.41&1.59$\pm$1.31&\textbf{1.53$\pm$1.06}&1.60$\pm$1.36\\
A&1.55$\pm$1.33&1.36$\pm$1.17&\textbf{1.32$\pm$1.06}&1.34$\pm$1.11\\
AS&1.68$\pm$1.43&1.43$\pm$1.24&1.37$\pm$1.10&\textbf{1.26$\pm$1.10}\\
\hline
Average&1.73$\pm$0.97&1.51$\pm$0.81&1.45$\pm$0.69&\textbf{1.41$\pm$0.72}\\
\hline
\multicolumn{5}{c}{Dimension (mm)}\\
\hline
dim1&3.53$\pm$2.77&2.87$\pm$2.23&2.69$\pm$2.05&\textbf{2.62$\pm$2.09}\\
dim2&3.49$\pm$2.87&2.96$\pm$2.35&2.67$\pm$2.15&\textbf{2.64$\pm$2.12}\\
dim3&3.91$\pm$3.23&2.92$\pm$2.48&2.70$\pm$2.22&\textbf{2.77$\pm$2.22}\\
\hline
Average&3.64$\pm$2.61&2.92$\pm$1.89&2.69$\pm$1.67&\textbf{2.68$\pm$1.64}\\
\hline
\multicolumn{5}{c}{Area (mm$^2$)}\\
\hline
cavity&231$\pm$193&205$\pm$182&182$\pm$152&\textbf{181$\pm$155}\\
myocardium&291$\pm$246&204$\pm$195&205$\pm$168&\textbf{199$\pm$174}\\
\hline
Average&261$\pm$165&205$\pm$145&194$\pm$125&\textbf{190$\pm$128}\\
\hline
\multicolumn{5}{c}{Phase (\%)}\\
\hline
phase&22.2&13.0&11.4&\textbf{10.4}\\
\hline
\end{tabular}
\end{table*}
\section{Conclusions}
We propose a multitask learning network FullLVNet for full quantification of LV, which includes three regression tasks and one classification task. By taking advantages of expressive feature embeddings from deep CNN and effective dynamic temporal modeling from RNN, and leveraging intra- and inter-task relatedness with group lasso regularization and phase-guided constraints, FullLVNet is capable of delivering state-of-art accuracy for all the tasks considered.
\bibliographystyle{splncs03}
| {'timestamp': '2017-06-15T02:08:30', 'yymm': '1706', 'arxiv_id': '1706.01912', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01912'} | arxiv |
\section{Introduction}
Process Control Systems (PCSs) are at the core of Critical Infrastructures (CIs), as they control, automate and monitor most of the processes that power modern societies. Power generation, transport, critical manufacturing, water treatment and fuel transport are some examples of CIs. As such, it is necessary to protect PCSs and related assets in order to ensure the correct functioning of modern societies.
This necessity has been further revealed by the existence of security incidents directly related to PCSs where skilled attackers disturbed normal functioning of PCSs, affecting the surrounding environment, some of them concerning CIs.
Examples of successful cyber-attacks involving PCSs with physical impact include Stuxnet~\cite{Langner2011Stuxnet:} and the German Steel Plant incident~\cite{Bundesamt2014Die}.
Consequently, PCS security has been the object of considerable research attention, specially in the development of novel security mechanisms.
Among these mechanisms, Anomaly Detection Systems (ADSs) have a prominent space.
The predictable and static nature of PCSs make them suitable candidates for anomaly detection~\cite{MitchellSurvey}.
However, when detecting a particular anomalous event in PCSs, the factors that cause it can be diverse.
These factors can be classified in two large sets: process disturbances or malfunctioning, and attacks or intrusions.
In this paper we analyze the limitation and possibilities of distinguishing process disturbances and intrusions by using Multivariate Statistical Process Control (MSPC) in a process agnostic manner.
The rest of the paper is organized as follows: Section~\ref{mi:sec:related} presents related works in the literature. Section~\ref{mi:sec:mspc} introduces Multivariate Statistical Process Control. Section~\ref{mi:sec:approach} outlines our approach while Section~\ref{mi:sec:results} evaluates it experimentally. Finally, Sections~\ref{mi:sec:conclusions} and~\ref{mi:sec:future} extract some conclusions and draw some lines for further work, respectively.
\section{Related Work}
\label{mi:sec:related}
Anomaly detection in PCSs and industrial environments in general has gathered wide attention from the scientific community.
While most of the approaches leverage network level data to detect anomalies in PCSs (see survey~\cite{MitchellSurvey}), other proposals, such as ours, address this task by leveraging process and sensor-level data.
When dealing with process level data, proposals can be further classified in two subgroups: (1) solutions that require a model of the monitored process to detect anomalies and (2) approaches where modelling the process is not necessary.
Process model dependant contributions include the work of McEvoy and Wolthusen~\cite{McEvoy2011plant} and Svendsen and Wolthusen~\cite{Svendsen2009Using}.
While effective to detect anomalies, these approaches require accurate modelling of the physical process.
This requirement poses an important obstacle for implementing detection systems of this nature, especially in complex processes.
More process-independent approaches on the other hand, include the work of Kiss et al.~\cite{kiss2015clustering} and Krotofil et al.~\cite{Krotofil2015Process}.
Kiss et al.~\cite{kiss2015clustering} present an anomaly detection technique based on the Gaussian mixture model clustering of the sensor-level observations.
Later, they use silhouette examinations to interpret the results.
Nevertheless, they only consider attacks as possible factors for abnormal situations in the process, without considering process faults or disturbances.
Therefore, process related anomalies could be mislabeled as attacks and vice versa.
Krotofil et al.~\cite{Krotofil2015Process} propose a method to detect when attackers tamper with sensor signals.
To this end, they use entropy to detect inconsistent sensor signals among a cluster of correlated signals.
Although they consider scenarios with process disturbances, there is no direct comparison between tampered sensor signals and similar process disturbances.
In this approach, we go beyond the state of the art by presenting a novel security anomaly detection and diagnosis technique for PCSs.
Additionally, we also analyze the effect of process disturbances and its effect when detecting security anomalies.
\section{Multivariate Statistical Process Control}
\label{mi:sec:mspc}
\begin{figure}
\centering
\includegraphics[width=.6\columnwidth]{media/mi_example_control_chart.pdf}
\caption{Example of a control chart. Control limits are presented for 95\% (lower dashed line) and for a 99\% (upper dashed line) confidence levels}
\label{mi:fig:example_control_chart}
\end{figure}
Figure~\ref{mi:fig:example_control_chart} shows an example of a control chart.
Under normal process operating conditions, 99\% of all the points will fall under the upper control limit.
In that case, we consider that the process is in a state of \textit{statistical control}.
It is important not to confuse the term statistical control with other similar terms, such as automatic feedback control, as they refer to different concepts.
Statistical control refers to the state of the process where only common causes of variation are present~\cite{MacGregor1995Statistical}.
The existence of consistent observation series over the established control limit, is likely to be attributed to a new special cause.
In the case of PCSs, this variation source may be attributed to attacks or process disturbances, i.e.\ an anomaly.
By using tools such as Principal Component Analysis (PCA), MSPC provides an efficient methodology to monitor variable magnitude and relation to other variables.
\subsection{PCA-based MSPC}
Let us consider process historical data as an $\mathbf{X} = N\times M$ two-dimensional dataset, where $M$ variables are measured for $N$ observations.
PCA transforms the original $M$-dimensional variable space into a new subspace where variance is maximal.
It converts the original variables into a new set of uncorrelated variables (generally fewer in number), called Principal Components (PCs) or Latent Variables.
For a mean-centered and auto-scaled\footnote{Normalized to zero mean and unit variance} $\mathbf{X}$ and $A$ principal components, PCA follows the next expression:
\begin{equation}
\mathbf{X} = \mathbf{T_A P^{t}_A} +\mathbf{E_A}
\end{equation}
\noindent where $\mathbf{T_A}$ is the $N \times A$ score matrix, that is, the original observations represented according to the new subspace; $\mathbf{P^{t}_A}$ is the $M \times A$ loading matrix, representing the linear combination of the original variables that form each of the PCs; finally, $\mathbf{E_A}$ is the $N \times M$ matrix of residuals.
In PCA-based MSPC, both the scores and the residuals are monitored, each in a separate control chart~\cite{Camacho2015Multivariate}.
On the one hand, to comprise the scores, the D-statistic or Hotelling's $T^2$~\cite{hotelling1947multivariate} is monitored.
On the other hand, in the case of the residuals, the chosen statistic is the Q-statistic or $SPE$~\cite{jackson1979control}.
$D$ and $Q$ statistics are computed for each of the observations in the calibration data, and control limits are set for each of the two charts.
Later, these statistics are also computed for incoming data and plotted in the control chart.
When an unexpected change occurs in one (or more) of the original measured $M$ variables, one (or both) of these statistics will go beyond control limits.
Thus, a $M$-dimensional monitoring scenario is effectively converted into a two-dimensional one.
In this work, we consider an event as anomalous when three consecutive observations surpass the 99\% confidence level control limit.
Once an anomaly has been detected, we use oMEDA plots~\cite{camacho2011observation} to diagnose the anomaly causes by relating anomalous events to the original variables.
In essence, oMEDA plots are bar plots where the highest or lowest values in a set of variables reflect their contribution to a group of observations.
Therefore, when computed on a group of observations within an anomalous event, the most relevant variables related to that particular event will be the ones with the highest and lowest bars.
\section{Proposed approach}
\label{mi:sec:approach}
\begin{figure}
\centering
\includegraphics[width=.5\columnwidth]{media/mi_control_loop.pdf}
\caption{Example of a PCS and used attack model.}
\label{mi:fig:example_pcs}
\end{figure}
Figure~\ref{mi:fig:example_pcs} shows an example of a PCS.
At the core of the system resides a physical process, with a fixed number of sensors and actuators.
These sensors and actuators are the input/output devices that controllers use to interact with the process.
Controllers read process data from the sensors, and according to the control algorithm implemented in them, they decide what is the next step to be performed on the actuators.
Once the actuators change, the process evolves and with it, the sensor reading. Then, sensor data is fed to the controllers again, thus repeating the steps.
However, the communication between process controllers and sensor/actuators is often performed over insecure transmission lines, frequently using unencrypted, unauthenticated, legacy protocols.
Thus, it is possible for an attacker to interact with the communication, performing Man-in-the-Middle (MitM) attacks.
This can lead to situations where the data fed to the controller is not the real read by the sensors, or that the actuators receive data that was not sent as such by the controllers.
In this work we use MSPC over a simulated industrial process, the Tennessee-Eastman~\cite{downs1993plang}, to detect anomalies and diagnose their cause distinguishing between natural (disturbances) and human induced (attacks) factors.
\subsection{Tennessee-Eastman process} \label{mi:sec:te}
The Tennessee-Eastman (TE) process is a well-known challenge process, modeled after a real chemical process.
First presented by Downs and Vogel~\cite{downs1993plang}, it has been widely used by researchers to test different control strategies.
Though initially designed as a process control challenge, the TE process has also become a prominent choice among security research works~\cite{McEvoy2011plant,Cardenas2011Attacks,Krotofil2015Process,kiss2015clustering}.
In this work we use Ricker's~\cite{ricker1996decentralized} decentralized control strategy, along with the added randomness model by Krotofil et al.~\cite{Krotofil2015Process}.
The TE model has 41 measured variables (XMEAS), 12 manipulated variables (XMV) and 20 process disturbances (IDV) implemented.
For a full description of the variables and disturbances, refer to~\cite{downs1993plang}.
The XMEAS are read by the controllers, and interact by setting values to the XMVs.
Compared to the simplified Figure~\ref{mi:fig:example_pcs}, XMEAS variables correspond to the sensor readings and XMVs to the actuator settings.
Process disturbances are unexpected and undesired changes in process conditions that can affect process normal operation.
Out of the modelled disturbances, IDV(6) is one of the most difficult to handle.
It models a loss of reactant in an input feed (Feed A).
The input flux of feed A is measured by XMEAS(1), whereas XMV(3) is the manipulated that controls the valve of feed A.
Therefore, it is to be expected that attacks on closing the valve XMV(3) and the existence of disturbance IDV(6), will affect similarly to XMEAS(1).
Figure~\ref{mi:fig:a_feed} shows both situations.
When monitoring XMEAS(1), there is almost no difference between IDV(6) and an integrity attack on XMV(3) where the attacker commands closing the valve controlling feed A, as the flow decreases abruptly in both cases.
Both the disturbance and the attack occur at the tenth hour.
After 17 hours and 43 minutes, the process shuts down in both cases as the stripper liquid level becomes too low to continue safe operation of the plant.
\begin{figure}[!t]
\centering
\subfloat[IDV(6)]{\includegraphics[width=.48\columnwidth]{media/mi_a_feed_idv6.pdf}\label{mi:fig:a_feed_iv6}} \hfil
\subfloat[Attack on XMV(3)]{\includegraphics[width=.48\columnwidth]{media/mi_a_feed_xmv3atk.pdf}\label{mi:fig:a_feed_xmv3atk}}
\caption{Comparison of the evolution of XMEAS(1) under disturbance IDV(6) or an integrity attack on XMV(3).} \label{mi:fig:a_feed}
\end{figure}
Having a process disturbance and a potential attack on a process variable that react almost identically with the process provides a sound setup to test the performance of techniques that try to distinguish them.
\subsection{Adversary modelling}
The adversary and attack models considered in this scenario are the ones proposed by Krotofil et al.~\cite{Krotofil2015Process}.
We consider that the adversary is able to read and manipulate network traffic, between controllers and the physical process as depicted in Figure~\ref{mi:fig:example_pcs}.
Therefore, the attacker is capable of manipulating input data both at the controllers' (forged XMEAS data) and/or the physical process' (forged XMV data) end, performing an integrity attack.
Following the model of Krotofil et al.~\cite{Krotofil2015Process}, we consider an attacked variable $Y'_i(t)$ at time $t$, $0\leq t\leq T$ as follows, where $T$ is the duration of the simulation and $T_a$ the arbitrary attack interval. An integrity attack is defined as follows:
\begin{equation}
Y'_i(t) =
\begin{cases}
Y_i(t), & \mbox{for } t \notin T_a \\
Y^{a}_i(t), & \mbox{for } t \in T_a
\end{cases}
\end{equation}
\noindent where $Y_i^a(t)$ is the modified variable value injected by the attacker.
Similarly, during DoS, the attacker effectively stops communication, and no communication reaches the actuator or the controller. Krotofil et al.~\cite{Krotofil2015Process} define as a DoS attack starting at $t_a$ as:
\begin{equation}
Y^a_i(t)= Y_i(t_a-1)
\end{equation}
\noindent where $Y_i^a$ is the last value received before the DoS attacks.
\section{Experimental results}
\label{mi:sec:results}
In order to evaluate our approach, we conduct a set of experiments where the
randomized TE model is run ten times per anomalous situation.
The model we used for the set of experiments is the DVCP-TE
model presented by Krotofil and Larsen~\cite{krotofil2015}, freely
available on Github\footnote{\url{http://github.com/satejnik/DVCP-TE}}.
The time length of each simulation is 72 hours, except in the cases where the process shut itself down due to safety constraints.
For each simulation hour, variable data is recorded 2000 times, that
is, every 1.75 seconds.
Calibration data consists of 30 runs, and this data is used to build the MSPC
model and establish the control limits of the $D$ and $Q$ statistics.
All anomalies start at the 10th hour of simulation.
For each of the anomalous situations, we calculate the Average Run Length (ARL), that refers to the lapsed time between the start of the anomalous event and its detection in the control charts.
As previously stated, an event is flagged as anomalous when three consecutive observations surpass the 99\% control limit.
Once an anomaly is flagged, oMEDA charts are computed for the set of the first observations that surpass control limits in each of the ten runs in either of the two control charts (monitoring $D$ and $Q$-statistic).
For each anomalous event two plots are created, one with real process data (data the process receives and sends), and the other with controller level data.
Both data sets will be identical in case of an attack free environment.
But, in the case of attacks, both data sets will diverge.
For the analysis of the process data, and plotting purposes, we used the MEDA toolbox~\cite{Camacho2015Multivariate}.
We set four different scenarios: \textit{a)} Disturbance IDV(6), \textit{b)} Integrity attack on XMV(3), \textit{c)} Integrity attack on XMEAS(1), and \textit{d)} Denial of Service on XMV(3).
Resultant oMEDA for controller level and process level variables are shown in Figures~\ref{mi:fig:cn_omedas} and~\ref{mi:fig:sn_omedas}, respectively.
\begin{figure*}[!ht]
\centering
\subfloat[IDV(6)]{\includegraphics[width=.7\columnwidth]{media/omeda_idv6_cn.pdf}\label{mi:fig:omeda_idv6_controller}}
\subfloat[Integrity attack on XMV(3)]{\includegraphics[width=.69\columnwidth]{media/omeda_xmv3_close_cn.pdf}\label{mi:fig:omeda_xmv3_close_controller}}\\
\subfloat[Integrity attack on XMEAS(1)]{\includegraphics[width=.7\columnwidth]{media/omeda_xmeas1_close_cn.pdf}\label{mi:fig:omeda_xmeas1_close_controller}}
\subfloat[DoS attack on XMV(3)]{\includegraphics[width=.69\columnwidth]{media/omeda_xmeas1_dos_cn.pdf}\label{mi:fig:omeda_xmv3_dos_controller}}
\caption{oMEDA plots of different anomalies from the controller point of view} \label{mi:fig:cn_omedas}
\end{figure*}
\begin{figure*}[!ht]
\centering
\subfloat[IDV(6)]{\includegraphics[width=.7\columnwidth]{media/omeda_idv6_sn.pdf}\label{mi:fig:omeda_idv6_process}}
\subfloat[Integrity attack on XMV(3)]{\includegraphics[width=.7\columnwidth]{media/omeda_xmv3_close_sn.pdf}\label{mi:fig:omeda_xmv3_close_process}}\\
\subfloat[Integrity attack on XMEAS(1)]{\includegraphics[width=.7\columnwidth]{media/omeda_xmeas1_close_sn.pdf}\label{mi:fig:omeda_xmeas1_close_process}}
\subfloat[DoS attack on XMV(3)]{\includegraphics[width=.7\columnwidth]{media/omeda_xmeas1_dos_sn.pdf}\label{mi:fig:omeda_xmv3_dos_process}}
\caption{oMEDA plots of different anomalies from the process point of view} \label{mi:fig:sn_omedas}
\end{figure*}
Figures~\ref{mi:fig:omeda_xmv3_close_controller} and~\ref{mi:fig:omeda_xmv3_close_process} show the oMEDA charts for the case of where the attacker performs and attack and closes the valve of feed A.
In this case, from the controllers point of view, the anomaly is similar to the one with IDV(6).
It is when we look at process-level data that we see that the real concerned variable is not XMEAS(1).
Rather, the attacker is manipulating XMV(3) to perform the attack.
Figures~\ref{mi:fig:omeda_xmeas1_close_controller} and~\ref{mi:fig:omeda_xmeas1_close_process} shows the oMEDA plots of an scenario where the attacker manipulates the XMEAS(1) variable and sets it to zero.
Therefore, the controller receives the information that there is no flow in Feed A.
That is why the XMEAS(1) value from the controller point of view is lower than usual, because the attacker has set it so.
As the control algorithm tries to tackle the situation, it opens XMV(3) more, and thus flowing more reactant A to the process.
From the process point of view, that is the reason XMV(3) and XMEAS(1) have higher values than usual.
oMEDA plots for a DoS attack on XMV(3) are shown in Figures~\ref{mi:fig:omeda_xmv3_dos_controller} and~\ref{mi:fig:omeda_xmv3_dos_process}.
In this scenario, the process keeps receiving a constant value, previous to the attack.
Neither of the oMEDA plots show a variable, let alone XMV(3) that stands out clearly among others.
It is worth noting that the ARL, on the other cases almost immediate, in DoS attacks is significantly higher.
In this case, DoS detection takes almost an hour.
\subsection{Discussion}
Our approach detects all anomalous situations of disturbances and attacks.
However, when diagnosing an anomaly, controller-based readings --on witch traditional MSPC has relied on-- are not enough to do so correctly.
Both integrity attacks and the process disturbance are diagnosed in a very similar way, in a manner that it is not feasible to distinguish what caused the anomaly.
To address this matter, we have extended the MSPC model and measure both process and controller level variables.
Having this two level input makes possible monitoring a wide range of process variables.
Moreover, when anomalies occur, it is possible to distinguish the origin of the anomaly.
When considering DoS attacks, the ARL is significantly longer than with integrity attacks or process disturbances and the diagnosis is not as clear as in the other scenarios.
\section{Conclusions}
\label{mi:sec:conclusions}
We have presented a process-independent approach to detect and distinguish process
disturbances from related attacks. Unlike previous approaches, it is not a
process-dependant approach and it is able distinguish between disturbances and
attacks.
Our methodology is based on MSPC for anomaly detection and oMEDA plots for anomaly diagnosis.
We have used the popular Tennessee-Eastman process to experimentally evaluate our approach.
Distinguishing process disturbances and low level attacks in PCSs is a complex task, especially if all controller's I/O are to be considered compromised.
We extended the traditional MSPC model to monitor both controller and process level variables, to efficiently monitor PCSs.
Often, PCSs assign measured variables to the manipulated ones, so this approach is feasible in these environments.
This scenario, would also complicate the work of an attacker, as it would need to forge both the target manipulated variable and the associated measured one to avoid detection.
When analyzing process disturbances or integrity attacks, the oMEDA plots clearly show the implicated variables.
In the case of DoS, detection time is significantly longer and the diagnosis with oMEDA is not related to the attacked variable.
\section{Future work}
\label{mi:sec:future}
To overcome current anomaly diagnosis limitations, it is necessary to add more information to the MSPC model.
In the case of PCSs, a promising source of additional information is the one
created at the network level (packets, flows, logs etc.).
MSPC-like methodologies have already been used in regular IT networked environments for security monitoring~\cite{Camacho2016pca}.
We are confident that adding network-level variables to the ones of the process will ease anomaly diagnosis (e.g.\ by detecting increased traffic in the case of network DoS attacks) and will also shorten the ARL required to detect anomalies, as while the process might be slow to surpass control limits due to slow dynamics, network variables show more immediate information.
\section*{Acknowledgments}
Research in this paper is partially supported by the Basque Government's Elkartek program under grant number KK-2015/0000080, the Provincial Council of Gipuzkoa's ``Red guipuzcoana de Ciencia, Tecnolog\'ia e Innovaci\'on'' program through grant 56/15 and the Spanish Government-MINECO (Ministerio de Econom\'ia y Competitividad) and FEDER funds, through project TIN2014-60346-R.
\bibliographystyle{IEEEtran}
| {'timestamp': '2017-06-07T02:04:58', 'yymm': '1706', 'arxiv_id': '1706.01679', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01679'} | arxiv |
\section{Introduction}
Developing a new drug to the market is very costly and usually takes too much time \cite{dimasi2001new,chen2015drug}. Therefore, in order to save time and cost, scientists have tried to identify new uses of existing drugs, known as drug repositioning. Moreover, predicting these interactions between drugs and targets is one of the most active domains in drug research since they can help in the drug discovery \cite{hopkins2009drug,wishart2006drugbank,duran2017pioneering}, drug side-effect \cite{lounkine2012large,pauwels2011predicting} and drug repositioning \cite{cheng2012prediction,dudley2011exploiting,swamidass2011mining,moriaud2011identify}. Currently, the known interactions between drugs and target proteins are very limited \cite{dobson2004chemical,kanehisa2006genomics}, while it is believed that any single drug can interact with multiple targets \cite{chong2007new,macdonald2006identifying,xie2012novel,nascimento2016multiple}. However, laboratory experiments of biochemical verification on drug-target interactions are extremely expensive, laborious and time-consuming \cite{whitebread2005keynote,haggarty2003multidimensional,kuruvilla2002dissecting} since there are too many possible interactions to check. Thanks to the increasing capability to collect, store and process large-scale chemical and protein data, \textit{in silico} prediction of the interactions between drugs and target proteins becomes an effective and efficient tool for discovering the new uses of existing drugs. The prediction results provide helpful evidences to select potential candidates of drug-target interactions for further biochemical verification, which can reduce the costs and risks of failed drug development \cite{liu2016neighborhood,ashburn2004drug}.
There are two major approaches in \textit{in silico} prediction, including docking simulation and machine learning \cite{ding2013similarity}. Docking simulation is a common method in biology, but it has two major limitations. Firstly, this method requires three-dimensional structures of targets to compute the binding of each drug candidate \cite{halperin2002principles,rarey1996fast,shoichet1992molecular}, but such kind of information is usually not available \cite{ballesteros2001g,klabunde2002drug}. Secondly, it is very time-consuming. Therefore, in the last decade, many efforts have been made to solve the DTI prediction problem by machine learning approaches \cite{ding2013similarity,yamanishi2008prediction,bleakley2009supervised}. Most known machine learning methods \cite{nagamine2007statistical,nagamine2009integrating,yabuuchi2011analysis} treat DTI prediction as a binary classification prediction in which the drug-target interactions are regarded as instances and the characteristics of the drugs and target proteins are considered as features. To train the classifier, machine learning methods require label data, e.g., positive samples of truly existing interactions and negative samples of noninteractive pairs. Normally, the positive samples are available, but the negative samples are not known.
Whenever extra characteristic information about the drugs and targets are not available and only a portion of interactions between drugs and targets are known, similarity-based methods are suitable to solve this problem. However, there are also some limitations of the similarity-based methods. Firstly, similarity-based methods are not applicable for new drugs or targets that do not have any interactions at all since the methods cannot compute their similarities with the others. Secondly, although similarity-based methods are simple, sometimes they do not perform well \cite{pech2017link} since common neighbor and Jaccard indices, Cannistraci resource allocation (CRA) \cite{daminelli2015common} and Cannistraci Jaccard index (CJC) \cite{daminelli2015common} utilize only local information of networks. Katz index also performs unsatisfactorily (will show later) since the large decay factor will bring redundant information \cite{zhou2009accurate}, while the small decay factor makes Katz index close to common neighbor index or local path index \cite{zhou2009predicting,lu2009similarity}.
To overcome the limitations of machine learning methods and similarity-based methods, we propose a matrix-based method, namely low-rank matrix projection (LMP). LMP does not require negative samples. When the extra characteristic information of drugs and target proteins are not available, LMP utilizes only the known interactions. On the other hand, if the extra information is available, LMP can also take such information into consideration and remarkably improve the performances. LMP has been shown to perform better than similarity-based methods on the five renown datasets (e.g., MATADOR, enzyme, ion channel, GPCR and nuclear receptor). By embedding extra information of drugs and targets, LMP has been shown to outperform many baseline methods that also use extra information. Finally, LMP can effectively predict the potential interactions of new drugs or targets that do not have any known interactions at all. The proposed method can help selecting the most likely existing interactions for further chemical verifications in case only interaction information is known or only some of characteristic information is available. In a word, LMP can reduce cost and failure in drug development, and thus advance drug discoveries.
\begin{figure*}[ht!]
\centering
\includegraphics[width=0.95\textwidth]{framework.eps}
\caption{The illustration of the proposed method. Firstly, the known drug-target interactions are utilized to construct the adjacency matrix $\bf A$. Secondly, $\bf A$ is decomposed into a low-rank matrix ${\bf X}^*$ and a sparse matrix ${\bf E}^*$, which can be used to depict the hidden pattern and the noise in the original data. Finally, the score matrix is computed by projecting the adjacency matrix onto a lower-dimensional space via the low-rank matrix ${\bf X}^*$.}
\label{fig_framework}
\end{figure*}
\section{Methods}
\subsection{Notations}
In this work, various matrices and their similarity matrices are computed by the proposed method based on the characteristic information of the biological data. We denote them as follows:
\begin{itemize}
\item $\mathbf{A}$: the adjacency matrix denoted the known interactions between drugs and proteins and its entries are defined as in Eq. (\ref{eq_adj_mat}).
\item $\mathbf{X}_{D}^*$: the low-rank similarity matrix computed based on drug information in $\mathbf{A}$, i.e., similar drugs interact with similar targets.
\item $\mathbf{X}_{T}^*$: the low-rank similarity matrix computed based on target information of $\mathbf{A}^T$ (transpose of $\mathbf{A}$), i.e., similar targets is interacted by similar drugs.
\item $\mathbf{Z}_{AD}$: the score matrix obtained from the projection of $\mathbf{A}$ onto $\mathbf{X}_{D}^*$.
\item $\mathbf{Z}_{AT}$: the score matrix obtained from the projection of $\mathbf{A}$ onto $\mathbf{X}_{T}^*$.
\item $\mathbf{Z}_A$: the score matrix computed by combining $\mathbf{Z}_{AD}$ and $\mathbf{Z}_{AT}$.
\item $\mathbf{S}_D$: the similarity matrix of drug compound computed by SIMCOMP \cite{hattori2003development} from the chemical structures of drugs which are obtained from KEGG LIGAND \cite{kanehisa2006genomics}.
\item $\mathbf{X}_{SD}^*$: the low-rank similarity matrix computed by the proposed method on $\mathbf{S}_D$.
\item $\mathbf{Z}_{D}$: the score matrix obtained by projecting $\mathbf{A}$ on $\mathbf{X}_{SD}^*$.
\item $\mathbf{S}_T$: the similarity matrix of protein sequences computed by a normalized Smith-Waterman score \cite{smith1981identification} from GEGG GENES \cite{kanehisa2006genomics}.
\item $\mathbf{X}_{ST}^*$: the low-rank similarity matrix computed by the proposed method on $\mathbf{S}_T$.
\item $\mathbf{Z}_{T}$: the score matrix obtained by projecting $\mathbf{A}$ on $\mathbf{X}_{ST}^*$.
\item $\mathbf{Z}_{ADT}$: the score matrix computed by combining $\mathbf{Z}_{A}$, $\mathbf{Z}_{D}$ and $\mathbf{Z}_{T}$.
\end{itemize}
\subsection{Datasets}
In this work, we implement the proposed method as well as similarity-based methods on five benchmark and renown datasets namely MATADOR \cite{gunther2007supertarget}, enzyme \cite{yamanishi2008prediction}, ion channel \cite{yamanishi2008prediction}, G-protein-coupled receptors (GPCR) \cite{yamanishi2008prediction}, and nuclear receptors \cite{yamanishi2008prediction}. The manually annotated target and drug online resource (MATADOR) (May 2017) dataset is a free online dataset of chemical and target protein interactions. There are 13 columns in the dataset, however, we utilize only two columns, including Chemical ID and Protein ID, to construct the adjacency matrix. MATADOR dataset has no characteristic information about the drugs and targets. Enzyme, ion channel, GPCR, and nuclear receptors (May 2017) are the drug-target interaction networks for human beings. The statistics of the five datasets are presented in table \ref{table_stat}.
\begin{table}
\caption{ The statistics of the five datasets.}
\begin{tabular}{p{3.5cm} p{2.7cm} p{2.7cm} p{2.5cm} p{2.5cm}}
\hline \\ [-5.5ex]
Dataset & Drug & Target & Interaction & Sparsity of $\mathbf{A}$ \\
\hline \\ [-5.5ex]
MATADOR & 801 & 2901 & 15843 & 0.007 \\
enzyme & 445 & 664 & 2926 & 0.010 \\
ion channel & 210 & 204 & 1476 & 0.034 \\
GPCR & 223 & 95 & 635 & 0.030 \\
nuclear receptors & 54 & 26 & 90 & 0.061 \\ [0.5ex]
\hline \\
\end{tabular}
\label{table_stat}
\end{table}
\subsection{Low-Rank Matrix Projection}
In the real-world problems, many data that are lying on the high-dimensional space and full of noise normally contain hidden features which can be seen after they are projected onto the lower dimensional space and simultaneously the noise are subtracted from them \cite{vidal2011tutorial}. Low-rank matrix has been shown to be a powerful and suitable tool to capture the patterns in high dimensional-space and noisy data \cite{wright2009robust,lin2010augmented,peng2012rasl}. Therefore, it is deserved to be investigated to solve DTI problem. In this section we assume that only known interactions between drugs and targets are available so we aim at learning the low-rank matrix from this interaction information. First of all, we construct the adjacency matrices of the drug-target interactions in the five datasets. Mathematically, the adjacency matrix is defined as
\begin{equation}
\mathbf{A}_{ij}= \left\{ \begin{array}{l l l}
1, \ \ \ \textrm{if drug } i \textrm{ interacts with target } j \\
0, \ \ \ \textrm{otherwise} \end{array}\right. .
\label{eq_adj_mat}
\end{equation}
Then we obtain $\mathbf{A}\in\mathbb{R}^{m\times n}$, where $m$ is the number of drugs and $n$ is the number of target proteins.
The real data are normally far from perfect, meaning that a portion of the drug-target interactions in the real data may be incorrect or redundant, and also some other drug-target interactions may be missing from the observed data. Therefore, the adjacency matrix $\mathbf{A}$ can be decomposed into two parts. The first part is a linear combination of $\mathbf{A}$ with the low-rank matrix, which is essentially a projection from the noisy data $\bf A$ into a more refined or informative and lower-dimensional space. The second part can be considered as the noise or the outliers, which is strained off from the original data $\bf A$ and represented by a sparse matrix with most entries being zeros. The method seeks the lowest-rank matrix among all the candidates which is further utilized to construct the score matrix that estimates the likelihoods of the potential interactions.
\begin{table}
\begin{threeparttable}
\centering
\small{
\caption{The illustration of the Inexact ALM algorithm}
\begin{tabular}{p{1.1cm} p{1.3cm} p{10.0cm}}
\hline \\ [-5.5ex]
\multicolumn{3}{l}{\textbf{Algorithm 1}: Solving problem of Eq. (\ref{eq_unconstraint_lrr}) by Inexact ALM } \\
\hline \\ [-5.5ex]
\multicolumn{3}{l}{\textbf{Input:} Given a dataset $\mathbf{A}$ parameters $\alpha$} \\
\multicolumn{3}{l}{\textbf{Output:} $\mathbf{X}^*$ and $\mathbf{E}^*$} \\ [0.8ex]
\multicolumn{3}{l}{\textbf{Initialize:} $\mathbf{X}=0, \mathbf{E}=0, \mathbf{Y}_1=0, \mathbf{Y}_2=0, \mu=10^{-4}$, $\max_{\mu}=10^{10}, \rho=1.1, \epsilon=10^{-8}$} \\
\multicolumn{3}{l}{\textbf{while} not converged do}\\
& 1. & fix the other and update $\mathbf{J}$ by \\
& & $\mathbf{J} = \arg \min \frac{1}{\mu}||\mathbf{J}||_* +\frac{1}{2}||\mathbf{J-(X+Y}_2/\mu)||_F^2$ \\
& 2. & fix the other and update $\mathbf{X}$ by \\
& & \multicolumn{1}{l}{ \ $\mathbf{X} = (\mathbf{I}+\mathbf{A}^T\mathbf{A})^{-1}$ $\left(\mathbf{A}^T\mathbf{A}-\mathbf{A}^T\mathbf{E}+\mathbf{J}+(\mathbf{A}^T\mathbf{Y}_1-\mathbf{Y}_2)/\mu\right)$} \\
& 3. & fix the other and update $\mathbf{E}$ by\\
& \multicolumn{2}{l}{$\mathbf{E} = \arg \min \frac{\alpha}{\mu}||\mathbf{E}||_{2,1} + \frac{1}{2}||\mathbf{E-(A-AX+Y}_1/\mu)||_F^2$}\\
& 4. & update the multiplier\\
& & $\mathbf{Y}_1 = \mathbf{Y}_1 + \mu(\mathbf{A-AX-E})$ \\
& & $\mathbf{Y}_2 = \mathbf{Y}_2 + \mu(\mathbf{X-J})$ \\
& 5. & update parameter $\mu$ by \\
& & $\mu = min(\rho \mu,\max_{\mu})$ \\
& 6. & check the convergence condition \\
& & \ \ \ $||\mathbf{A-AX-E}||_{\infty} < \epsilon $ and $||\mathbf{X-J}||_{\infty} < \epsilon $\\
\multicolumn{3}{l}{\textbf{end while}}\\[0.3ex]
\hline
\end{tabular}
}
\label{table:algoLRR}
\begin{tablenotes}
\small
\item \small{The setting of the hyperparameters follows the implementation of \cite{lin2010augmented}:
} Since as stated in the literature, they are the optimal ones.
\end{tablenotes}
\end{threeparttable}
\end{table}
Firstly, we decompose $\mathbf{A}$ as follows,
\begin{equation}
\mathbf{A=AX+E}.
\label{eq_decom}
\end{equation}
Obviously, there are infinite solutions of Eq. (\ref{eq_decom}). However, since we wish $\mathbf{X}$ to be low-rank, where rank of a matrix is the maximum number of linearly independent column (or row) vectors in the matrix, and $\mathbf{E}$ to be sparse, we can enforce the nuclear norm or trace norm on $\mathbf{X}$ and sparse norm on $\mathbf{E}$. Mathematically, Eq. (\ref{eq_decom}) can be thus relaxed as
\begin{equation}
\min_{\mathbf{X,E}} ||\mathbf{X}||_*+\alpha||\mathbf{E}||_{2,1} \ \ \ \mathrm{s.t.} \ \ \ \mathbf{A = AX+E},
\label{eq_lrr}
\end{equation}
where $||\mathbf{A}||_*=\sum_i{\sigma_i}$ (i.e., $\sigma_i$ is the singular values of $\mathbf{A}$), $||\mathbf{E}||_{2,1}=\sum_{j=1}^n\sqrt{\sum_{i=1}^m(\mathbf{E}_{ij})^2}$ is the noise regularization strategy and $\alpha$ is a positive free parameter taking a role to balance the weights of low-rank matrix and sparse matrix. Minimizing the trace norm of a matrix well favors the lower-rank matrix, meanwhile the sparse norm is capable of identifying noise and outliers.
Eq. (\ref{eq_lrr}) can also be regarded as a generalization of the robust PCA \cite{liu2013robust,liu2010robust} because if the matrix $\mathbf{A}$ in $\mathbf{AX}$ in the right side of Eq. (\ref{eq_lrr}) is set as identity matrix, then the model is degenerated to the robust PCA. Eq. (\ref{eq_lrr}) can be rewritten into an equivalent problem as,
\begin{equation}
\min_{\mathbf{X,E,J}}||\mathbf{J}||_*+\alpha||\mathbf{E}||_{2,1} \ \ \ \mathrm{s.t.} \ \ \ \mathbf{A = AX + E, X=J}.
\label{eq_alm_equivalent}
\end{equation}
Eq. (\ref{eq_alm_equivalent}) is the constraint and convex optimization problem which can be solved by many off-the-self methods, e.g., iterative method (IT) \cite{cai2010singular}, accelerated proximal gradient (APG) \cite{wright2009robust}, dual approach \cite{lin2009fast}, and augmented Lagrange multiplier (ALM) \cite{lin2010augmented}. In this work, we employ Inexact ALM method by firstly converting Eq. (\ref{eq_alm_equivalent}) to an unconstraint problem, then minimize this problem by utilizing augmented Lagrange function such that
\begin{equation}
\begin{split}
&\mathcal{L}= ||\mathbf{J}||_*+\alpha||\mathbf{E}||_{2,1}+\mathrm{tr} \left(\mathbf{Y}_1^T\left(\mathbf{A-AX-E}\right)\right) + \\
&\mathrm{tr}\left(\mathbf{Y}_2^T\left(\mathbf{X-J}\right)\right)+\frac{\mu}{2}\left(||\mathbf{A-AX-E}||_F^2+||\mathbf{X-J}||_F^2\right),
\end{split}
\label{eq_unconstraint_lrr}
\end{equation}
where $\mu \ge 0$ is a penalty parameter and $\mathrm{tr(.)}$ is the trace norm. The Eq. (\ref{eq_unconstraint_lrr}) is unconstraint and can be solved by minimizing with respect to $\mathbf{J,X}$ and $\mathbf{E}$, respectively, by fixing the other variables and then updating the Lagrange multipliers $\mathbf{Y}_1,\mathbf{Y}_2$.
The detailed illustration of how to solve Eq. (\ref{eq_unconstraint_lrr}) is shown in table \ref{table:algoLRR}.
We denote the solution of Eq. (\ref{eq_unconstraint_lrr}) as $\mathbf{X}_T^*$, if $\mathbf{A}_{ij}$ represents the interaction drug $i$ and protein $j$, then $\mathbf{X}_T^* \in \mathbb{R}^{n\times n}$. It can be considered as a similarity matrix that describes similarity between proteins. While if $\mathbf{A}_{ij}$ represents the interactions between protein $i$ and drug $j$ (as the transposition of the adjacency matrix in Eq. (\ref{eq_decom})), then the solution of Eq. (\ref{eq_unconstraint_lrr}) is denoted as $\mathbf{X}_D^*\in\mathbb{R}^{m\times m}$ which describes similarity between drugs. After obtaining these two similarity matrices, we project the adjacency matrix $\mathbf{A}$ onto these lower dimensional spaces, respectively, as
\begin{equation}
\mathbf{Z}_{AD}=\mathbf{A}^T\mathbf{X}^*_D \ \ \textrm{and} \ \ \mathbf{Z}_{AT}=\mathbf{A}\mathbf{X}^*_T.
\label{eq_similarity}
\end{equation}
Finally, we combine the two similarity matrices as
\begin{equation}
\mathbf{Z}_A=\frac{\mathbf{Z}^T_{AD}+{\mathbf{Z}_{AT}}}{2}.
\label{eq_similarity_com}
\end{equation}
After obtaining $\mathbf{Z}_A$, we remove the known interactions by setting the entries of $\mathbf{Z}_A$ corresponding to nonzero entries in $\mathbf{A}$ to zeros and sort the remaining scores in descending order. The drugs-target pairs with highest scores are the most likely unknown interacting pairs. The full process of the proposed method is illustrated in Fig. \ref{fig_framework}. The algorithm 1 illustrates the detailed procedure of the proposed method LMP.
\begin{table}
\caption{The illustration of the LMP algorithm}
\begin{tabular}{p{2.1cm} p{1.1cm} p{12.0cm}}
\hline \\[-5.5ex]
\multicolumn{3}{l}{\textbf{Algorithm 2}: The algorithm of the proposed method} \\
\hline \\[-5.5ex]
\multicolumn{3}{l}{\textbf{Input:} Given an adjacency matrix $\mathbf{A}$} \\
& 1. & compute the low-rank similarity matrix $\mathbf{X}^*$ and \\
& & sparse noise $\mathbf{E}^*$ of Eq. (\ref{eq_unconstraint_lrr}) by using Algorithm 1\\
& 2. & compute the similarity matrices $\mathbf{Z}_{AD}$ and $\mathbf{Z}_{AT}$ by Eq. (\ref{eq_similarity}) \\
& 3. & combine the two similarity matrices as in Eq. (\ref{eq_similarity_com})\\
& 4. & sort the scores in $\mathbf{Z}_A$ in descending order\\
\multicolumn{3}{l}{\textbf{Output:} The highest scores are the most potential interactions} \\[0.3ex]
\hline
\end{tabular}
\label{table_LMP}
\end{table}
\subsection{Working with Heterogeneous Data}
Using only interaction dataset and ignoring the extra characteristic information of the drugs and targets is throwing away the important information. In this subsection, we show how the proposed method is capable of utilizing this characteristic information. Based on the hypothesis that similar drugs interact with similar targets and vice versus, we can utilize the two kinds of characteristic information, namely drug similarity and target similarity to infer the potential interactions.
Drug similarity $\mathbf{S}_D$ was computed by using SIMCOMP \cite{hattori2003development} from the chemical structures of drugs which are obtained from KEGG LIGAND \cite{kanehisa2006genomics}. On the other hand, target similarity $\mathbf{S}_T$ is computed by using a normalized Smith-Waterman score \cite{smith1981identification} from GEGG GENES \cite{kanehisa2006genomics}. These two datasets are available online \cite{yamanishi2008prediction}. Directly using these two similarity datasets makes the proposed method perform unsatisfactorily since there exist some noise inside these two datasets. Therefore, we compute the new similarity matrices which are low-rank from these two similarity matrices by the proposed method, then projecting the adjacency matrix onto these lower-dimensional spaces. There are two main properties of this low-rank matrix learning from the characteristic information. Firstly, as discussed above the noise are subtracted. Moreover, the interaction information is projected on the lower-dimensional feature space which is more informative.
The low-rank similarity matrices of the characteristic information $\mathbf{S}_D$ and $\mathbf{S}_T$ can be computed as shown in Eq. (\ref{eq_lrr}) by replacing the adjacency matrix $\mathbf{A}$ with $\mathbf{S}_D$ and $\mathbf{S}_T$, respectively. After obtaining the low-rank similarity matrices of the drug and target denoted as $\mathbf{X}^*_{SD}$ and $\mathbf{X}^*_{ST}$, we project the adjacency matrix $\mathbf{A}$ onto them as shown in Eq. (\ref{eq_similarity}) and we call them the score matrices denoted as $\mathbf{Z}_D$ and $\mathbf{Z}_T$, respectively. Finally, we combine all these three score matrices which are $\mathbf{Z}_A$, $\mathbf{Z}_D$ and $\mathbf{Z}_T$ as
\begin{equation}
\mathbf{Z}_{ADT} = \gamma_1\mathbf{Z}_{A} +\gamma_2 \mathbf{Z}^T_{D} + \gamma_3\mathbf{Z}_{T},
\end{equation}
where $\gamma_1$, $\gamma_2$ and $\gamma_3$ are the weighting parameters and are set to 0.5, 0.25 and 0.25, respectively. Since the known interactions are experimentally verified, the similarity matrix obtained from this information plays more important role than the other two similarity matrices. The algorithm of the proposed method is illustrated in table \ref{table_LMP}.
\subsection{Predicting the New Drugs and Targets}
In case that there are new drugs or targets which do not have any known interactions at all, the proposed method can also be simply extended to predict their interactions. However, we need to use the characteristic information about the new drugs or new targets. On one hand, once we are given a drug with characteristic information, we wish to predict which target proteins that this drug interactions with. On the other hand, we aim at predicting the new drugs based on the known protein target by using the characteristic information of the target proteins. Consider predicting new targets, first of all, one needs to compute the low-rank similarity matrix of the given drug with others based on their characteristic information, i.e., computing $\mathbf{X}^*_{SD}$. With the assumption that similar drugs interact with similar targets, we can predict the potential interactions based on this similarity matrix, i.e., projecting $\mathbf{A}$ onto $\mathbf{X}^*_{SD}$. Similarly, when a new target is given with its biological information, one can compute the low-rank similarity matrix, i.e., $\mathbf{X}^*_{ST}$, of that protein with the others. The potentially interacted drugs with this protein are those that interact with proteins that are most similar to the given protein.
\begin{table*}[ht!]
\centering
\small{
\caption{ The interaction predicted results measured by AUC and AUPR by 5$\times$10-fold cross validation for LMP and the benchmark methods. In the first parts only the known interactions are utilized, while in the second parts characteristic information is also employed. The best performed results are emphasized in bold.}
\begin{tabular}{p{2.0cm} p{0.7cm} p{0.9cm} p{0.7cm} p{0.9cm} p{0.7cm} p{0.9cm} p{0.7cm} p{0.9cm} p{0.7cm} p{1.2cm} p{0.7cm} p{1cm}}
\hline \\ [-5.5ex]
Dataset & \multicolumn{2}{c}{MATADOR} & \multicolumn{2}{c}{NR} & \multicolumn{2}{c}{GPCR}& \multicolumn{2}{c}{ion channel} & \multicolumn{2}{c}{enzyme} & \multicolumn{2}{c}{Average} \\ [0.5ex]
\hline \\ [-5.5ex]
Metric & AUC & AUPR & AUC & AUPR & AUC & AUPR & AUC & AUPR & AUC & AUPR & AUC & AUPR \\ [0.5ex]
\hline \\ [-5.5ex]
CN & 0.930 & 0.603 & 0.688 & 0.249 & 0.826 & 0.491 & 0.915 & 0.724 & 0.910 & 0.678 & 0.854 & 0.549 \\
Katz & 0.894 & 0.393 & 0.679 & 0.263 & 0.800 & 0.479 & 0.893 & 0.707 & 0.869 & 0.644 & 0.827 & 0.497 \\
Jaccard & 0.933 & 0.612 & 0.686 & 0.249 & 0.828 & 0.531 & 0.920 & 0.680 & 0.911 & 0.704 & 0.856 & 0.555 \\
CJC & 0.930 & 0.609 & 0.693 & 0.265 & 0.828 & 0.531 & 0.914 & 0.731 & 0.910 & 0.673 & 0.855 & 0.562 \\
CRA & 0.937 & 0.714 & 0.696 & \textbf{0.289} & 0.833 & 0.565 & 0.923 & 0.737 & \textbf{0.912} & 0.752 & 0.860 & 0.612 \\
LMP-$\mathbf{Z}_A$ & \textbf{0.946} & \textbf{0.796} & \textbf{0.702} & 0.276 & \textbf{0.853} & \textbf{0.601} & \textbf{0.941} & \textbf{0.846} & 0.900 & \textbf{0.766} & \textbf{0.868} & \textbf{0.657} \\ [0.5ex]
\hline \\ [-4.8ex]
BLM & -- & -- & 0.694 & 0.204 & 0.884 & 0.464 & 0.918 & 0.591 & 0.928 & 0.496 & 0.856 & 0.439 \\
LapRLS & -- & -- & 0.855 & 0.539 & 0.941 & 0.640 & 0.969 & 0.804 & 0.962 & 0.826 & 0.932 & 0.702 \\
NetLapRLS & -- & -- & 0.859 & \textbf{0.563} & 0.946 & 0.703 & 0.977 & 0.898 & 0.968 & \textbf{0.874} & 0.938 & \textbf{0.760} \\
LMP-$\mathbf{Z}_{ADT}$ & -- & -- & \textbf{0.863} & 0.513 & \textbf{0.950} & \textbf{0.706} & \textbf{0.979} & \textbf{0.900} & \textbf{0.973} & \textbf{0.875} & \textbf{0.941} & 0.747 \\ [0.5ex]
\hline
\end{tabular}
\label{table_pre}
}
\end{table*}
\subsection{Evaluation and Experimental Settings}
We adopt a cross validation technique and two popular metrics to test the proposed method as well as previous benchmarks. We apply the 10-fold cross validation \cite{ding2013similarity,lu2017link}, which divides the total known interactions between the chemicals and proteins into 10 sets with approximately the same size, and then utilize 9 sets as training data and keep the remaining set as testing data. We repeat it for ten times where each set has one chance to be the testing set. In the simulation, we independently run the 10-fold cross validation for five times and report average values accordingly.
We consider the two popular metrics, including the area under the receiver operating characteristic (ROC) curve (AUC) and the area under precision and recall curve (AUPR), to evaluate the performances of the proposed method and the benchmarks. ROC is the diagnostic ability of a binary classifier with regarding to different thresholds \cite{hanley1982meaning}, while AUC curve displays true positive rate (sensitivity) versus false positive rate (1-specificity) at different values of thresholds. The sensitivity is the percentage of the test samples with ranks higher than a given threshold, whereas, specificity is the percentage the test samples that fall below the threshold. When there are many fewer positive elements in the testing data comparing to the total number in testing data, AUC may give overoptimistic results of the algorithms \cite{bleakley2009supervised,davis2006relationship,lu2012recommender,lobo2008auc}. Therefore, utilizing only AUC may mislead our conclusion. In such case, AUPR can give better evaluation, especially in biological significance.
The simulations are conducted within three manners, e.g., drug-target pairs, new drugs, and new targets. In the first manner, we divide the total known interactions into 10-folds with approximately the same size. On the other hand, in the second manner we divide the total drugs into 10-folds. For the last manner, all the targets are divided into 10-folds. In each simulation, we use 9 sets as training data and keep the remaining as testing data.
\subsection{Baseline Methods}
First, we compare LMP with the similarity-based methods, e.g., common neighbor index (CN), Katz index and Jaccard index, Cannistraci resource allocation (CRA) \cite{daminelli2015common} and Cannistraci Jaccard index (CJC) \cite{daminelli2015common}. In this comparison, we use only the known interactions of drug and targets. The methods that utilize both interaction information and characteristic information normally outperform the methods that utilize only the known interactions. However, they cannot work with the dataset that do not have characteristic information such as MATADOR. We further compare LMP with bipartite local learning model (BLM) \cite{bleakley2009supervised}, Laplacian regularized least squares (LapRLS) and Net Laplacian regularized least squares (NetLapRLS) \cite{xia2010semi} which utilizes both the known interaction information and characteristic information about the drugs and targets. The first group of methods can only predict the interactions between drugs and targets, meanwhile the second group can predict the new drugs given targets or predict the new targets given drugs by using their characteristic information.
\begin{table*}[t!]
\centering
\caption{ The drug and target predicted results measured by AUC and AUPR by 5$\times$10-fold cross validation for LMP and the benchmark methods. The best performed results are emphasized in bold.}
\begin{tabular}{p{2.2cm} p{0.7cm} p{0.9cm} p{0.7cm} p{0.9cm} p{0.7cm} p{0.9cm} p{0.7cm} p{1.2cm} p{0.7cm} p{1cm}}
\hline \\ [-5.5ex]
Dataset & \multicolumn{2}{c}{nuclear receptors} & \multicolumn{2}{c}{GPCR}& \multicolumn{2}{c}{ion channel} & \multicolumn{2}{c}{enzyme} & \multicolumn{2}{c}{Average} \\ [0.5ex]
\hline \\ [-5.5ex]
Metric & AUC & AUPR & AUC & AUPR & AUC & AUPR & AUC & AUPR & AUC & AUPR \\ [0.5ex]
\hline \\ [-5.5ex]
BLM & 0.693 & 0.194 & 0.829 & 0.210 & 0.770 & 0.167 & 0.781 & 0.092 & 0.768 & 0.166 \\
LapRLS & 0.820 & \textbf{0.482} & 0.845 & 0.397 & \textbf{0.796} & \textbf{0.366} & {0.800} & 0.368 & 0.815 & \textbf{0.403} \\
NetLapRLS & 0.819 & 0.418 & 0.834 & 0.397 & 0.783 & 0.343 & 0.791 & 0.298 & 0.807 & 0.364 \\
LMP-$\mathbf{Z}_{T}$ & \textbf{0.831} & 0.384 & \textbf{0.854} & \textbf{0.399} & 0.778 & 0.353 & \textbf{0.824} & \textbf{0.392} & \textbf{0.822} & 0.382 \\ [0.5ex]
\hline \\ [-5.5ex]
BLM & 0.458 & 0.325 & 0.627 & 0.367 & 0.881 & 0.641 & 0.843 & 0.611 & 0.702 & 0.486 \\
LapRLS & 0.563 & 0.432 & 0.788 & 0.508 & 0.920 & 0.778 & 0.914 & 0.792 & 0.796 & \textbf{0.628} \\
NetLapRLS & 0.561 & \textbf{0.433} & 0.787 & 0.503 & 0.916 & 0.762 & 0.909 & 0.787 & 0.793 & 0.621 \\
LMP-$\mathbf{Z}_{D}$ & \textbf{0.688} & 0.293 & \textbf{0.847} & \textbf{0.583} & \textbf{0.938} & \textbf{0.790} & \textbf{0.928} & \textbf{0.803} & \textbf{0.850} & 0.617 \\ [0.5ex]
\hline
\end{tabular}
\label{table_preTarget}
\end{table*}
\begin{figure*}[t!]
\centering
\includegraphics[width=0.95\textwidth]{aupr_alpha.eps}
\caption{The AUPR of the proposed method on the four datasets. Panel A illustrates the predicted results on the new drugs, while panel B displays the predicted results on the new targets.}
\label{fig_auprAlpha}
\end{figure*}
\subsection{Parameter Settings}
In the proposed method, there is a free parameter $\alpha$ that balances the weights of low-rank matrix and sparse matrix as shown in Eq. (\ref{eq_lrr}). When $\alpha$ is set too large, the sparse norm will compress most of the entries of matrix $\mathbf{E}$ to zeros, while if $\alpha$ is very small, most of the entries of $\mathbf{E}$ will be small but not zeros. In this work, we obtain the optimal value of the parameter $\alpha$ by manually and empirically tuning it and check the accuracy according to each value of $\alpha$. Predicting the interactions based on only the known interaction, we perform the grid search for $\alpha$ in which one dimension is corresponding to drug similarity and another one is corresponding to target similarity. Based on the empirical simulation, $\alpha$ for predicting the interactions based on only known interactions falls between [0.1,0.25]. When characteristic information is embedded, one needs to tune $\alpha$ according to this information, e.g., the parameter $\alpha$ falls between [0.1,2]. Moreover, there is only one $\alpha$ in each case, eg., predicting the new drugs or targets. We visualize the sensitivity of $\alpha$ corresponding to the predicted results, i.e., AUPR, on the new drugs and targets, in Fig. \ref{fig_auprAlpha}.
\section{Results}
We report the performances of the proposed method and the others that use only the known interaction information in the first part of table \ref{table_pre}, meanwhile for the performances of the methods that use together interaction information and characteristic information are shown in the second part of the same table. Consider the first group of the methods. LMP outperforms the other methods on three datasets including MATADOR, GPCR, and ion channel in terms of AUC and AUPR. In term of AUPR, LMP outperforms the others in enzyme, while LMP outperforms only Katz index in enzyme in term of AUC. It is worth noting that for the small matrix or network such as nuclear receptor, the predicted results from all the methods are not stable and they are approximately the same.
When the characteristic information of the drugs and targets are employed, the performances of the LMP remarkably improved as shown in the second part of table \ref{table_pre}. Since the characteristic information of the drugs and targets in MATADOR is not available, we either cannot obtain the results of this dataset. LMP outperforms the others on nuclear receptor and GPCR in term of AUC, while NetLapRLS is the best in term of AUPR on nuclear receptor. LMP perform better than the others measured by AUPR in GPCR and ion channel. LMP outperforms the others in term of AUC, while NetLapRLS produces the highest AUPR on enzyme.
The predicted results on the new drugs and target proteins are illustrated in table \ref{table_preTarget} in the first and second part, respectively. All the methods produce competitive results in predicting the new drugs, while LMP outperform the others in term of AUC and AUPR on GPCR, ion channel and enzyme in predicting new targets.
\section{Conclusion and discussion}
In this work, we have proposed a matrix-based method, namely low-rank matrix projection (LMP), to solve the DTI prediction problem. It has been shown that LMP overcomes the drawbacks of the machine learning and similarity-based methods. On one hand, LMP can work on datasets that have only known interaction information between the drugs and targets such as MATADOR. On the other hand, LMP can integrate the information about the characteristics of the drugs and targets to improve the predicted results. Moreover, the proposed method can also effectively deal with the new drugs and targets that do not have any known interaction at all by utilizing only some characteristic information of the drugs or targets.
In LMP, the low-rank matrix plays a very important role in making the data homogenous, meanwhile the sparse matrix captures the noise or outliers in the data. By decomposing the original data into a clean (a linear combination of low-rank matrix and the adjacency matrix) and noise (sparse matrix) parts, we can obtain a clean data to predict the interactions between drugs and target proteins. The disadvantage of LMP is that we need to empirically tune $\alpha$ and check the accuracy corresponding to each value of $\alpha$. Until now, designing the effective method to estimate the optimal value of this parameter is still an open question. Moreover, LMP may not perform well with small matrix, e.g., nuclear receptor, since the information is very limited for matrix decomposition.
LMP is an alternative, effective and efficient \textit{in silico} tool for predicting the drug-target interactions. It can help drug development and drug reposition. In this paper, LMP aims at learning the low-rank similarity matrices from the known drug-target interaction information and similarity matrices of the drugs and targets. We believe that the proposed method can also be applied to learn other high-dimensional biological data such as drug compound, chemical structures, and so on, and we leave these problems to the future work.
| {'timestamp': '2018-05-04T02:05:15', 'yymm': '1706', 'arxiv_id': '1706.01876', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01876'} | arxiv |
\section{Introduction}
\label{intro}
Multibody system dynamics is a well established discipline in the context of railway vehicle design.
It is used for new concept performance evaluation, stability, lifetime, wear prediction, etc. In general it is desirable to be able to do these analyses as fast as possible. In particular, due to the huge number of computations required, computational performance can be very important when dealing with design optimization. Nevertheless these tasks do not demand strict real-time performance.
The computational power available on today's off-the-shelf computers is getting closer to allow real-time direct numerical simulation of complex railway vehicle models. This in turn opens up new possibilities
that can greatly benefit the design, safety, and model based predictive maintenance in the railway field.
Most important applications can be considered to be HiL (Hardware in the Loop) on the design side, and on-line filtering techniques (Kalman filter alike) in the context of safety, and model based predictive maintenance.
These developments usually run on the heels of previous work done in the context of vehicle dynamics.
Symbolic multibody models have demonstrated to be an effective tool for the modeling of general multibody systems. In particular they have been shown to be very fast when using recursive $O(n^3)$ formulations \cite{samin2003}, that in turn require a parametrization based on relative coordinates. Main challenges are related to the enormous size of the expressions that the symbolic processor needs to deal with as this can limit the size of the problem to be analyzed. Recently, in \cite{Plaza2015} the authors presented a symbolic multibody library in which the concept of recursivity is extended so that it is no longer based on the formulation but, instead, on the parametrization level. This is achieved by the definition of an algebra that includes the typical mechanics operators (position vector, velocity,... ) and that deals with the recursivity that might be embedded into the parametrization. The typical tree-shaped body structure is replaced by a tree structure for points and another one for bases. This gives a fine grained control of the recursivity that, in this way, can be different for both tree structures. No limitation is imposed on the parametrization of the system. As a consequence the library allows to implement arbitrary dynamics formulations. Atomization (optimization of symbolic expression representation) is embedded into the library from the very bottom upwards. This alleviates the symbolic manipulation of expressions and lowers their complexity to a minimum. This in turn allows to obtain optimal atomizations that minimize the computational complexity and increases the size of the problems that is possible to analyze.
This article pursues to evaluate the feasibility of real-time numerical simulation of a complex locomotive multibody model using state of the art symbolic modeling techniques referred above. For our study we use the FEVE 3000 locomotive. A generic (spline based) definition for the contact surfaces of the wheels and rails, including irregularities, is used. Based on these, creep forces are modeled using a direct symbolic implementation of the standard linear Kalker model without simplifications of any kind. Bodies and rail are considered rigid with three-dimensional kinematics. No further simplifications as contact coordinate removal \cite{Shabana2005}, pre-calculated tables \cite{malvezzi2008determination}, partial linearization \cite{Escalona2015} or base parameter reduction \cite{Iriarte2015} are presented.
To that end the modeling is done based on the multibody system symbolic library \verb!lib_3D_MEC_GiNaC! \cite{Plaza2015}, using a relative parametrization with respect to the inertial reference.
The paper is structured as follows: In section \ref{sec1} the symbolic methods used in this work are briefly described. In section \ref{sec2} the description of the modeled system is presented. In section \ref{sec3} the most interesting details of the multibody modeling are presented. In section \ref{sec4} the results of the simulations are shown and discussed. Finally in section \ref{sec5} the main conclusions of this work are presented.
\section{Symbolic modeling procedures}
\label{sec1}
Simply stated, the main goal of the symbolic modeling of multibody systems can be defined as:
``\textit{to obtain a set of functions that allow for the determination of the position, velocities and accelerations of all the bodies of the system}''.
Special symbolic procedures are required if a real-time-capable fast multibody model is desired. The main features of these procedures, as
proposed in \cite{PlazaThesis2015}, are summarized below.
\subsection{Parametrization and system topology.}
In order to model the multibody system a set of geometric parameters $\mathbf{p}$ and generalized coordinates $\mathbf{q}$, along with their associated velocity $\dot{\mathbf{q}}$ and generalized accelerations $\ddot{\mathbf{q}}$ are defined. We propose to split up the classical tree-shaped body structure into two different tree-shaped structures: 1) the bases structure and 2) the points structure, see Fig.~\ref{fig:points_bases}.
In this approach, bases $\B_{j}$ and points $P_{j}$ are defined in terms of other bases $\B_{i}$ and points $P_{i}$ by the way of relative base-change or rotation matrices $\mathbf{R}_{\B_{i}}^{\B_{j}}$ and positions vectors $\mathbf{r}_{P_{i}}^{P_{j}}$. The functions used by the symbolic library \cite{ros2007lib3d} can be schematically represented as
\begin{eqnarray}
\label{eq:new_base}
\B_{i} &\xrightarrow{\mathbf{R}_{\B_{i}}^{\B_{j}}(exp_x(\mathbf{q},~t,\mathbf{p}),exp_y(\mathbf{q},t,\mathbf{p}),exp_z(\mathbf{q},t,\mathbf{p}),~exp_\phi(\mathbf{q},t,\mathbf{p}))} &\B_{j}~~~~~~~ \\
\label{eq:new_point}
P_{i} &\xrightarrow{\mathbf{r}_{P_{i}}^{P_{j}}(exp_x(\mathbf{q},t,\mathbf{p}),~exp_y(\mathbf{q},t,\mathbf{p}),~exp_z(\mathbf{q},t,\mathbf{p}),~\B_k)}& P_{j},
\end{eqnarray}
where $exp_*(\mathbf{q},t,\mathbf{p})$ represent arbitrary symbolic expressions in terms of which vectors and base-change matrices are defined. This in turn confers physical meaning to the defined coordinates and parameters. Note that, in order to illustrate the procedure, the rotation matrix appearing in Eq.~(\ref{eq:new_base}) is parametrized using Euler parameters.
\begin{figure}
\centering
\begin{minipage}{.33\textwidth}
\centering
\includegraphics[width=\textwidth]{./bases_tree.pdf}
\end{minipage}%
\begin{minipage}{.05\textwidth}
\phantom{A}
\end{minipage}%
\begin{minipage}{.6\textwidth}
\centering
\includegraphics[width=\textwidth]{./points_tree.pdf}
\end{minipage}
\caption{Illustrative examples of bases (left) and points (right) structures }
\label{fig:points_bases}
\end{figure}
This splitting of the body structure into the bases and points structures confers complete flexibility to the choice of the parametrization. A body position and orientation
no longer needs to be defined with respect to the preceding body in the tree-shaped bodies structure.
Instead, the body position is given by a point in the points structure and an orientation by a base in the bases structure.
It should be noted that the bases structure is independent of the points structure. Conversely, the points structure is dependent on the bases structure as the relative position vector components are given using arbitrary bases (note the $\B_k$ parameter in Eq.~(\ref{eq:new_point})). Finally, it should be understood that the nature of the parameterization depends on the definition of the rotation matrices and position vectors. For example, if they are defined with respect to another point or orientation the coordinates will be ``relative'', but if they are defined with respect to an absolute point or orientation they will be ``absolute''.
\subsection{``On-the-way'' atomization}
The symbolic expressions that we need to deal with can be huge. The successive multiplication of symbolic expressions leads to an explosive growth in the size of the expressions that can limit the maximum size of the multibody systems that can be analyzed. In order to deal with this problem we use a standard technique in the context of symbolic computations that we call \textit{atomization}.
Atomization is a technique that condenses a symbolic expression set by splitting their expressions into several elemental sub-expressions. We call ``atoms'' to these elemental sub-expressions. They can be defined in terms of binary operations between symbols, numbers and/or other atoms. Or as transcendental functions of atoms.
This technique is beneficial when repeated sub-expressions appear and the same atom is used to represent them. Symbolically, this means less memory -as the sub-expression is allocated in memory once- and faster
symbolic manipulations. Numerically, this implies that the repeated sub-expression is only computed once leading to computational cost savings.
In the present context, we deal with the sets of expressions related to
the functions used to computationally implement a given MSD formalism. This atomized representation leads directly to the exportation of these functions in a way that benefits from the referred computational cost savings. To get a less abstract idea, Fig.~\ref{fig_atomization} shows the exported C code for the mass matrix of a simple four-bar linkage mechanism.
\begin{figure}
\hrule
\begin{multicols}{2}
{\tiny
\begin{verbatim}
atom27 = sin(theta2);
atom0 = cos(theta3);
atom1 = sin(theta3);
atom26 = cos(theta2);
atom49 = atom1*atom26+atom27*atom0;
atom46 = -atom27*atom1+atom26*atom0;
atom237 = m3*l2*( cg3x*atom0+atom1*cg3z);
atom253 = m3*l1*( cg3x*atom46+atom49*cg3z)+atom237;
atom200 = -l1*atom26;
atom214 = -l2*atom200;
atom197 = (l1*l1);
atom215 = (l2*l2);
atom270 = atom27*l1*cg2z*m2+m3*( atom214+atom215)
-m2*cg2x*atom200+I3yy+atom237+I2yy+atom253;
atom229 = m3*l2*cg3x*atom0+m3*l2*atom1*cg3z;
atom271 = m3*l1*cg3x*atom46+I3yy+m3*atom49*l1*cg3z
+atom229;
atom273 = I3yy+atom229;
_M[0] = -m3*( atom197+2.0*atom214+atom215)-atom197*m2
-I3yy-I2yy+-2.0*atom253-I1yy
+-2.0*( atom27*cg2z+atom26*cg2x)*l1*m2;
_M[1] = -atom270;
_M[2] = -atom271;
_M[3] = -atom270;
_M[4] = -m3*atom215-I3yy+-2.0*atom237-I2yy;
_M[5] = -atom273;
_M[6] = -atom271;
_M[7] = -atom273;
_M[8] = -I3yy;
\end{verbatim}
}
\end{multicols}
\hrule
\caption{Exported C code for atomized mass matrix.}
\label{fig_atomization}
\end{figure}
The atomization process should ideally be done ``on-the-way'', meaning that every time a new algebraic operation is performed a new atom is created or replaced by an existing matching atom.
Thus, the symbolic method takes advantage of the memory savings and the associated complexity reduction as soon as possible in the problem setup.
This means that the symbolic algebra system works internally with atomized expressions. A feature that is not obvious for the standard user but that is widespread in computer algebra systems. See Fig.~\ref{fig:on_the_way} for an elemental example.
\begin{figure}
\hrule
The addition of vectors $\vect{u}$ and $\vect{v}$ given their components represented in bases $\B_1$ and $\B_2$
\begin{equation*}
\begin{aligned}
\begin{Bmatrix} \vect{u} \end{Bmatrix}_{\B_1}= \begin{Bmatrix} u_x\\ u_y \\ u_z \end{Bmatrix}_{\B_1}
~~\text{and }~~
\begin{Bmatrix} \vect{v} \end{Bmatrix}_{\B_2}= \begin{Bmatrix} v_x\\ v_y \\ v_z \end{Bmatrix}_{\B_2}
\end{aligned}
\end{equation*}
is sought. Let the rotation matrix be
\begin{equation*}
\begin{aligned}
\mR{\B_1}{\B_2} =
\begin{bmatrix}
1 & 0&0\\
0 &\cos(\theta) & -\sin(\theta)\\
0 & \sin(\theta) & \cos(\theta)
\end{bmatrix}
\end{aligned}.
\end{equation*}
The addition of the two vectors represented in $\B_1$ base is performed as follows:
\begin{equation*}
\begin{aligned}
\begin{Bmatrix}\vect{u}+ \vect{u}\end{Bmatrix}_{\B_1} &=\begin{Bmatrix} \vect{u} \end{Bmatrix}_{\B_1} +\mR{\B_1}{\B_2} \begin{Bmatrix} \vect{v} \end{Bmatrix}_{\B_2} =
\begin{Bmatrix} u_x\\ u_y \\ u_z \end{Bmatrix}_{\B_1} +
\begin{bmatrix} 1 & 0&0\\0 &\cos(\theta) & -\sin(\theta)\\ 0 & \sin(\theta) & \cos(\theta)\end{bmatrix}
\begin{Bmatrix} v_x\\ v_y \\ v_z \end{Bmatrix}_{\B_2}
=\\
&\begin{Bmatrix} u_x\\ u_y \\ u_z \end{Bmatrix}_{\B_1} +
\begin{bmatrix} 1 & 0&0\\0 &\alpha_1 & -\alpha_2 \\ 0 & \alpha_2 & \alpha_1 \end{bmatrix}
\begin{Bmatrix} v_x\\ v_y \\ v_z \end{Bmatrix}_{\B_2}
=
\begin{Bmatrix} u_x\\ u_y \\ u_z \end{Bmatrix}_{\B_1} +
\begin{Bmatrix} v_x\\ \alpha_1 v_y -\alpha_2 v_z \\ \alpha_2 v_y +\alpha_1 v_z \end{Bmatrix}_{\B_1}
=\\
&\begin{Bmatrix} u_x\\ u_y \\ u_z \end{Bmatrix}_{\B_1} +
\begin{Bmatrix} v_x\\ \alpha_3 - \alpha_4 \\ \alpha_5 + \alpha_6 \end{Bmatrix}_{\B_1}
=
\begin{Bmatrix} u_x\\ u_y \\ u_z \end{Bmatrix}_{\B_1} +
\begin{Bmatrix} v_x\\ \alpha_7 \\ \alpha_8 \end{Bmatrix}_{\B_1}
=
\begin{Bmatrix} \alpha_9\\ \alpha_{10} \\\alpha_{11} \end{Bmatrix}_{\B_1}
\end{aligned}
\end{equation*}
where $\alpha_i$ are the atoms:
\begin{equation*}
\begin{aligned}
\alpha_1 &= \cos(\theta) & \alpha_2 &= \sin(\theta) & \alpha_3 &=\alpha_1 v_y & \alpha_4 &= \alpha_2 v_z & \alpha_5 &=\alpha_2 v_y &\alpha_6 =\alpha_1 v_z \\
\alpha_7 &=\alpha_3 - \alpha_4 & \alpha_8 &= \alpha_5 - \alpha_6 & \alpha_9 &= u_x+v_x & \alpha_{10} &=u_y + \alpha_7 & \alpha_{11} &= u_z + \alpha_8\\
\end{aligned}
\end{equation*}
\hrule
\caption{``On-the-way'' atomization example.}
\label{fig:on_the_way}
\end{figure}
In the same line, it is important to remember that the fundamental symbolic differentiation and substitution operations should be implemented to work directly on atomized expressions. This maximizes atom recycling and limits enormously the time and memory requirements of the algorithms.
In this context, to take advantage of the atomization, care should be taken when choosing the way and order in which the required operations
are performed.
The operation number should be minimized and atom recycling maximized.
A general purpose algorithm
aiming at finding an absolute minimum number of operations would require an exhaustive search that is beyond the reach of reasonable computational resources.
Therefore, it is required to define appropriate heuristics. Recursive dynamics formulations are usually taken as the starting point to define such heuristics. In our work, these heuristics are partly implemented by the way of mechanics operators, as will be explained in the next section.
\subsection{Recursive kinematic operators}
Recursive formulations represent the state-of-the-art on symbolic MSD \cite{samin2003}. These formulations use relative coordinates to parametrize the system leading to a tree-shaped body structure\footnote{Closed loops are opened to parametrize and closed through constraint equations.}.
This allows the recursive determination positions, velocities and accelerations of points as well as orientations, angular velocities and accelerations of bodies, by the way of the well known ``motion composition laws''. When different elements -points and orientations- share a common path towards the tree root, this implies the sharing of common sub-expressions. If applied symbolically, this recursive computation produces nearly good optimal ``on-the-way'' atomizations. This sharing of expressions is the main feature on which the kinematic forward recursion step, found in recursive formulations, is based.
For example, for a serial multibody system the angular velocity of body $S_{i+1}$ with respect to $S_{i-1}$ could be expressed as follows:
\begin{eqnarray}
\boldsymbol{\omega}^{S_{i+1}}_{S_{i-1}} = \boldsymbol{\omega}^{S_{i}}_{S_{i-1}} + \boldsymbol{\omega}^{S_{i+1}}_{S_{i}}
\end{eqnarray}
In the same way the angular velocity of body $S_{i+2}$ with respect to $S_{i-1}$ is expressed as:
\begin{eqnarray}
\boldsymbol{\omega}^{S_{i+2}}_{S_{i-1}} =
\boldsymbol{\omega}^{S_{i}}_{S_{i-1}} + \boldsymbol{\omega}^{S_{i+1}}_{S_{i}} + \boldsymbol{\omega}^{S_{i+2}}_{S_{i+1}}=
\boldsymbol{\omega}^{S_{i+1}}_{S_{i-1}} + \boldsymbol{\omega}^{S_{i+2}}_{S_{i+1}}
\end{eqnarray}
So, when computing magnitudes related to a given element it can be appreciated how computations related to elements down in the same chain can be reused. Other kinematic entities like position vectors, base-change matrices, linear velocities, accelerations and angular accelerations can be dealt with analogously.
In correspondence with the substitution of the bodies structure by the bases and points structures proposed in our work, the recursivity at the level of bodies is now dealt with at the bases and points structure levels.
This allows not only to use arbitrary parametrizations, as commented before, but also a better use of the any degree of recursivity that may be implicit when using arbitrary parametrizations.
To that end, kinematic operators that take advantage of any recursivity present in the parameterization are defined: Position vector between two points, velocity of a point with respect to a given frame (point plus orientation), angular velocity, base-change matrix, and so on. Basically the typical \textit{recursivity} found in recursive algorithms is translated to the operator algebra.
To support this an algebra of 3D vectors and tensors is defined. This algebra relieves the user of dealing with base-changes that are internally dealt with.
The full system works using ``on-the-way'' atomization and the operators are implemented taking advantage of the aforementioned recursivity. In this way, the number of operations is minimized and the reuse of atoms is maximized. As a consequence an optimal implementation of the given formalism for any parameterization chosen by the user is obtained.
The backward recursion of $O(n^3)$ algorithms can be considered a particular implementation of the principle of the virtual power.
The inertia forces and moments of the bodies affected by a given virtual movement appear added together in the contribution of this virtual movement to the system dynamic equations. Recursive formulations take advantage of this grouping so that they minimize the required operation count.
Taking advantage of this when applying symbolically the principle of virtual power produces atomizations as efficient as state-of-the-art $O(n^3)$ formulations. This is the approach followed by the symbolic implementation of the virtual power principle used in this work.
As an illustration of the achievements of our symbolic methods, we can obtain nearly optimal atomized equations for standard multibody systems using for example the principle of the virtual power and relative coordinates. Some authors \cite{samin2003} claim to be unable to do the same unless a direct symbolic implementation of a recursive formulation is used\footnote{In comparison, our method presents the overhead of having to deal with the common atom search. Even if using hash tables to do the search our symbolic processing phase seems to take longer.}.
\subsection{Other symbolic methods}
There are other symbolic methods that can be applied to reduce even further the complexity of the resulting model: \textit{``trigonometricaly simplifiable expression removal''} \cite{PlazaThesis2015}, \textit{``base parameter formulation of the system inertias''}\cite{khalil1987,Ros2012,Ros2015}, \textit{``base parameter elimination''}\cite{Iriarte2015}, etc... This methods can be applied directly on top of the presented modeling techniques. However, they are not considered in this work.
\section{Multibody model description}
\label{sec2}
The \textit{FEVE 3000} \cite{feve3000} locomotive multibody model developed in this work is depicted in Fig.~\ref{fig:locomotive} with an expanded view of the main parts shown in Fig.~\ref{fig:expanded_bodies}.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{./locomotive.png}
\caption{Multibody model}
\label{fig:locomotive}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=\textwidth]{./expanded_bodies.png}
\caption{Expanded View}
\label{fig:expanded_bodies}
\end{figure}
The $Vehicle\ Body$ (dark grey) is attached to the front and rear bogies thought two $Slider$ (green) bodies. The front bogie consists of a $Slider$ that rests on a couple of
$Suspender$ (orange) bodies hanging from the $Bogie\ Frame$ (dark blue), and two $Wheelset$ bodies (light blue) each of them with two $Axle\ Box$ (red) bodies. There is a couple of anti-yaw links (grey) between each $Suspender$ and the bogie frame. The rear bogie is identical to the front one but it includes two motors (one per each $Wheelset$). The motor $Housing$ (mauve) rotates around the relative $Wheelset$ and is attached to the $Bogie\ Frame$ using a bushing. The motor includes a $Rotor$ (pink). The transmission of motion from the $Rotor$ to the $Wheelset$ is done by the way of a gear pair.
The $Slider$ is connected by four identical spring-dampers to the Suspender part of the $Bogie\ Frame$. In a similar way, each $Axle\ Box$ is connected to the $Bogie\ Frame$ by two identical spring-dampers. The $Housing$ is also attached to the $Bogie\ Frame$ using a bushing. Compliance is considered in the gearing contacts. Linear stiffness and damping is assumed for spring-dampers, bushings and gear compliance.
Braking on the wheels and traction on the rotors is modeled considering externally applied torques.
The wheel-rail interaction model considers a fully three-dimensional rolling contact considering a single contact point per wheel. Normal contact is enforced through the use of constraints, while the tangential forces are determined based on the standard Kalker linear constitutive model.
Note that we consider generic wheel and rail profiles. The rails can present general irregularities along the track.
\subsection{Parametrization}
\subsubsection*{Multibody}
The $Vehicle\ Body$ is positioned relative to the track using absolute coordinates (3 translations followed by 3 Euler rotations).
Each $Slider$ is attached to the $Vehicle$ $Body$ by a revolute joint. A rotation relative to the $Vehicle\ Body$, in the vertical direction, is used to position the $Slider$.
To simplify the modeling, the effect of the anti-yaw bar is accounted for by removing the relative yaw motion between the $Bogie\ Frame$ and the $Slider$. With the same purpose, the $Suspender$ is considered fixed to the $Bogie\ Frame$. We use a vertical translation followed by two successive horizontal rotations (roll and tilt) to position the $Bogie\ Frame$ relative to the $Slider$. Each $Axle\ Box$ is positioned fixed to the ``non-spinning wheelset'' frame (NSWHS), a frame that follows the relative $Wheelset$ but that does not spin with it. Each $Wheelset$ is positioned relative to the $Bogie\ Frame$ using a vertical translation and two horizontal rotations (roll and spin). Other relative degrees of freedom between these bodies are removed by the particular configuration of the spring-dampers.
A rotation around the $Wheelset$ axis, relative to the NSWHS frame, is used to place each motor $Housing$. A rotation in the same direction, also relative to the NSWHS frame, is introduced to give the angular position of the $Rotor$ of each motor.
A total number of $60$ generalized coordinates, ${\mathbf{q}}$, is used in this parametrization.
\subsubsection*{Contact}
The rails and wheel surfaces are described using cubic splines \cite{pombo2003general},
\begin{equation}\begin{aligned}
f^*(u^*) = (((a^* (u^*-u^*_{bp}) + b^* ) (u^*-u^*_{bp}) + c^*) (u^*-u^*_{bp}) +d^*),
\label{eq:spline}
\end{aligned} \end{equation}
defined based on a set of control points that approximate their geometry.
\begin{figure}
\centering
\includegraphics[width=\textwidth]{./wheel_rail_profiles.pdf}
\caption{Surfaces and railway parametrization}
\label{fig:surfaces}
\end{figure}
Figure \ref{fig:surfaces} schematically shows the parametrization for a wheel-rail pair. The wheel and rail profiles are given respectively by $f^w(u^w)$ and $f^r(u^r)$, while the shape of the center line of the base of the rail along the track is given by $f_x^t(s^r)$, $f_y^t(s^r)$ and $f_z^t(s^r)$. Wheel surfaces are supposed to have cylindrical symmetry. Not represented in the figure is the spline used to represent the camber of the rail $f_\theta^t(s^r)$.
For the contact point at each wheel-rail pair the parameters $\theta^w, u^w$ and $s^r, u^r$ play the role of ``generalized coordinates'' used to position the contact points, $P^w$ and $P^r$, respectively onto the wheel and rail surfaces. When the contact is materialized, the point $P^w$
and the point $P^r$ -defined as an arbitrary points in the surfaces of the wheel and rail respectively- are coincident.
The position of $P^w$ is given relative to a reference point in the wheel axis, $O^w$, as
\begin{equation}\begin{aligned}
\mathbf{r}_{O^w}^{P^w}(u^w,\theta^w) = f^w(u^w) \cos(\theta^w) \mathbf{e}^w_x + u^w \mathbf{e}^w_y - f^w(u^w)\sin(\theta^w) \mathbf{e}^w_z.
\label{eq:OwPw}
\end{aligned} \end{equation}
For numerical reasons, the position of this point is given relative to a NSWHS base, $\mathbf{e}^w_x,\mathbf{e}^w_y ,\mathbf{e}^w_z$.
Analogously, the position of $P^r$ is given relative to a reference point in ground or track reference, $O^r$
\begin{equation}\begin{aligned}
\mathbf{r}_{O^r}^{P^r}(u^r,s^r) = f_x^t(s^r)\mathbf{e}^r_x + f_y^t(s^r) \mathbf{e}^r_y + f_z^t(s^r) \mathbf{e}^r_z
+ u^r \hat{\mathbf{c}} + f^r(u^r) \hat{\mathbf{n}}
\end{aligned} \end{equation}
The base $\mathbf{e}^r_x,\mathbf{e}^r_y ,\mathbf{e}^r_z$ is fixed at the ground. Defining $\hat{\mathbf{t}}$ as a unit vector tangent to the center line of the rail base, $\hat{\mathbf{c}}$ is defined as a unit vector perpendicular to $\hat{\mathbf{t}}$ with an angle $f_\theta^t(s^r)$ with the ground measured in the positive direction of $\hat{\mathbf{t}}$. $\hat{\mathbf{n}}$ completes the base so that it is dexterous.
The whole set of $8\times 4=32$ generalized coordinates required to position the $i=1,...,8$ contact points used in the analyzed example is referred as $\mathbf{s}=[...,\mathbf{s}_i^\mathsf{T},...]^\mathsf{T}$. Where $\mathbf{s}_i=[\theta^w_i, u^w_i,s^r_i, u^r_i]^\mathsf{T}$ is set of coordinates required to position points $P^w_i$ and $P^r_i$ at the $i$-th contact point.
From the symbolic modeling point of view, functions $f^*(u^*)$ are the are modeled as if a single $3^{rd}$ order polynomial completely represents the whole profiles. At ``show-time'', the coefficients $a^*$, $b^*$, $c^*$, $d^*$ and break-points $u^*_{bp}$ are updated depending on the position of the contact point.
As commented before, for the purposes of this paper we only consider a single point of contact. Note, that
flange contact rarely occurs when the train runs along straight tracks or huge radii curved tracks unless train velocity is close to its critical speed \cite{andersson1999rail}. Nevertheless the parametrization proposed here is compatible
some multiple-point-of-contact approaches \cite{andersson1999rail}.
\subsection{Constraint equations}\label{subsec:ConstrEqus}
The only constrains that are present in the analyzed problem are those related to the contact points between wheel an rail.
At a given contact, it should be enforced that the points $P^w$ and $P^r$ are coincident and that the surfaces at these points are tangent.
Defining the tangent and normal vectors to the wheel at point $P^w$ as $\mathbf{t}_x^w$, $\mathbf{t}_y^w$, $\mathbf{n}^w$, and
the tangent and normal vectors to the rail at point $P^r$ as $\mathbf{t}_x^r$, $\mathbf{t}_y^r$, $\mathbf{n}^r$. These conditions can be written
\cite{Shabana2005} as:
%
\begin{equation}
{\boldsymbol{\phi}^n} ({\mathbf{q}},{\mathbf{s}})= \mathbf{n}^r \cdot \mathbf{r}^{P^w}_{P^r} = \mathbf{0}
\end{equation}
and
\begin{equation}
{\boldsymbol{\phi}^d} ({\mathbf{q}},{\mathbf{s}})=
\left[
\begin{array}{c}
\mathbf{t}_x^r\cdot\mathbf{r}^{P^w}_{P^r}\\
\mathbf{t}_y^r\cdot\mathbf{r}^{P^w}_{P^r}\\
\mathbf{t}_x^w\cdot\mathbf{n}^r\\
\mathbf{t}_y^w\cdot\mathbf{n}^r
\end{array}
\right]
=
\mathbf{0},
\end{equation}
where ${\boldsymbol{\phi}^n}$ is the so called normal constraint, and ${\boldsymbol{\phi}^d}$ are the so called tangent constraints.
For each contact point, the tangent and normal vectors can be defined as:
\begin{eqnarray}
\mathbf{t}^r_x&=\dfrac{{\partial\mathbf{r}_{O^r}^{P^r}}/{\partial s^r}}{\left|{\partial\mathbf{r}_{O^r}^{P^r}}/{\partial s^r}\right|}
, ~ ~
\mathbf{t}^r_y=\dfrac{{\partial\mathbf{r}_{O^r}^{P^r}}/{\partial u^r}}{\left|{\partial\mathbf{r}_{O^r}^{P^r}}/{\partial u^r}\right|}
\text{, and } ~ ~
\mathbf{n}^r= \mathbf{t}^r_x \times \mathbf{t}^r_y\\
\mathbf{t}^w_x&=\dfrac{{\partial\mathbf{r}_{O^w}^{P^wr}}/{\partial \theta^w}}{\left|{\partial\mathbf{r}_{O^w}^{P^w}}/{\partial \theta^w}\right|}
, ~ ~
\mathbf{t}^w_y=\dfrac{{\partial\mathbf{r}_{O^w}^{P^w}}/{\partial u^w}}{\left|{\partial\mathbf{r}_{O^w}^{P^w}}/{\partial u^w}\right|}
\text{, and } ~ ~
\mathbf{n}^w= \mathbf{t}^w_x \times \mathbf{t}^w_y.
\end{eqnarray}
These vectors and constraint equations can easily be defined using the symbolic procedures previously discussed. It will be seen that
this symbolic implementation will be very efficient as well.
Now, we use the subindex $i=1,...,8$ to refer to the constraint equations relative to each of the $8$ contact points. The set of all the normal constraints is referred as ${\boldsymbol{\phi}^n} ({\mathbf{q}},{\mathbf{s}})=[...,{\boldsymbol{\phi}^n}_i ({\mathbf{q}},{\mathbf{s}}),...]^\mathsf{T}$. Analogously,
the set of all the tangent constraints is referred as ${\boldsymbol{\phi}^d} ({\mathbf{q}},{\mathbf{s}})=[...,{\boldsymbol{\phi}^d}_i ({\mathbf{q}},{\mathbf{s}}),...]^\mathsf{T}$.
\subsection{Dynamic equations}
As commented previously the dynamic equations are obtained based on the direct application of the principle of virtual power. Using the vector $[{\mathbf{q}},{\mathbf{s}}]$ as the set of generalized coordinates, the mass matrix $\mathbf{M}$ is obtained by differentiation of the equations motion with respect to the the generalized accelerations and the generalized force $\boldsymbol{\delta}$ vector is obtained by substitution of the generalized accelerations by zero in the equations of motion. These equations should be complemented by the second derivative of the constraint equations to have a determined set equations
\begin{eqnarray}
\ddot{{\boldsymbol{\phi}^n}}({\mathbf{q}},{\mathbf{s}}) &= \mathbf{0} \label{eq:phin}\\
\ddot{{\boldsymbol{\phi}^d}}({\mathbf{q}},{\mathbf{s}}) &= \mathbf{0} \label{eq:phit},
\end{eqnarray}
This set of equations shows the following structure:
%
\begin{align}
\begin{bmatrix}
{\mathbf{M}}_{{\mathbf{q}}\vq}({\mathbf{q}},{\mathbf{\dot{q}}}) & \mathbf{0} & \dot{\boldsymbol{\phi}}_{\vdq}^{n}{\T}({\mathbf{q}},{\mathbf{s}}) & \dot{\boldsymbol{\phi}}_{\vdq}^{d}{\T}({\mathbf{q}},{\mathbf{s}}) \\
\mathbf{0} &\mathbf{0} & \mathbf{0} & \dot{\boldsymbol{\phi}}_{\vds}^{d}{\T}({\mathbf{q}},{\mathbf{s}}) \\
\dot{\boldsymbol{\phi}}_{\vdq}^{n}({\mathbf{q}},{\mathbf{s}}) & \mathbf{0} & \mathbf{0} &\mathbf{0} \\
\dot{\boldsymbol{\phi}}_{\vdq}^{d}({\mathbf{q}},{\mathbf{s}}) & \dot{\boldsymbol{\phi}}_{\vds}^{d}({\mathbf{q}},{\mathbf{s}}) & \mathbf{0} &\mathbf{0}
\end{bmatrix}
\begin{bmatrix} {\mathbf{\ddot{q}}} \\ {\mathbf{\ddot{s}}} \\ {\boldsymbol{\lambda}}^n \\ {\boldsymbol{\lambda}}^d \end{bmatrix}
=
\begin{bmatrix} {\boldsymbol{\delta}}_{{\mathbf{q}}}({\mathbf{q}},{\mathbf{\dot{q}}}) \\ \mathbf{0} \\ {\boldsymbol{\gamma}^n}({\mathbf{q}},{\mathbf{s}},{\mathbf{\dot{q}}},{\mathbf{\dot{s}}}) \\ {\boldsymbol{\gamma}}^d({\mathbf{q}},{\mathbf{s}},{\mathbf{\dot{q}}},{\mathbf{\dot{s}}}) \end{bmatrix},
\end{align}
where ${\mathbf{M}}_{{\mathbf{q}}\vq}$ and ${\boldsymbol{\delta}}_{{\mathbf{q}}}$ are the blocks of the mass matrix $\mathbf{M}$ and vector ${\boldsymbol{\delta}}$ related to the set of coordinates ${\mathbf{q}}$.
In reference \cite{Shabana2005}, the authors refer this formulations as the Augmented Contact Constraint Formulation (ACCF).
The particular structure of the dynamic equations for the problem analyzed can appreciated on Fig.~\ref{fig1}. There, the nonzero entries for matrix $\left[[ {\mathbf{M}},\dot{\boldsymbol{\phi}}_{\vdq}{\T} ;\dot{\boldsymbol{\phi}}_{\vdq},\mathbf{0}],[{\boldsymbol{\delta}};{\boldsymbol{\gamma}} ]\right]$ are shown as dots. It should be noted that, $\dot{\boldsymbol{\phi}}_{\vds}^{n}$ is zero numerically, even if symbolically there can be seen few nonzero expressions.
\begin{figure}[h]
\centering
\includegraphics[height=80mm]{./M_Phi_dqT_Phi_dq_delta_gamma.pdf}
\caption{Dynamic model structure $\left[[ {\mathbf{M}},\dot{\boldsymbol{\phi}}_{\vdq}{\T} ;\dot{\boldsymbol{\phi}}_{\vdq},\mathbf{0}],[{\boldsymbol{\delta}};{\boldsymbol{\gamma}} ]\right]$}
\label{fig1}
\end{figure}
As accelerations ${\mathbf{\ddot{s}}}$ are not needed, the previous system of equations can be reduced to
\begin{equation}
\begin{bmatrix}
{\mathbf{M}}_{{\mathbf{q}}\vq}({\mathbf{q}},{\mathbf{\dot{q}}}) & \dot{\boldsymbol{\phi}}_{\vdq}^{n}{\T}({\mathbf{q}},{\mathbf{s}}) \\
\dot{\boldsymbol{\phi}}_{\vdq}^{n}({\mathbf{q}},{\mathbf{s}}) & \mathbf{0}
\end{bmatrix}
\begin{bmatrix} {\mathbf{\ddot{q}}} \\ {\boldsymbol{\lambda}}^n \end{bmatrix} \label{eq:MphiTPhiZero4}
=
\begin{bmatrix} {\boldsymbol{\delta}}_{{\mathbf{q}}}({\mathbf{q}},{\mathbf{\dot{q}}}) \\ {\boldsymbol{\gamma}^n}({\mathbf{q}},{\mathbf{s}},{\mathbf{\dot{q}}},{\mathbf{\dot{s}}}) \end{bmatrix},
\end{equation}
The reduced structure of the dynamic equations can appreciated on Fig.~\ref{fig2}. Obviously, standard linear solution procedures are going to perform much more efficiently in this case.
There, the nonzero entries for matrix $\left[[ {\mathbf{M}}_{{\mathbf{q}}\vq},\dot{\boldsymbol{\phi}}_{\vdq}^{n}{\T} ;\dot{\boldsymbol{\phi}}_{\vdq}^{n},\mathbf{0}],[{\boldsymbol{\delta}}_{{\mathbf{q}}};{\boldsymbol{\gamma}^n}]\right]$ are shown as dots.
\begin{figure}[h]
\centering
\includegraphics[height=32mm]{./M_Phi_dqT_Phi_dq_delta_gamma-reduced.pdf}
\caption{Dynamic model structure $\left[[ {\mathbf{M}}_{{\mathbf{q}}\vq},\dot{\boldsymbol{\phi}}_{\vdq}^{n}{\T} ;\dot{\boldsymbol{\phi}}_{\vdq}^{n},\mathbf{0}],[{\boldsymbol{\delta}}_{{\mathbf{q}}};{\boldsymbol{\gamma}^n}]\right]$}
\label{fig2}
\end{figure}
In reference \cite{Shabana2005}, the authors refer this formulation as the Embedded Contact Constraint Formulation (ECCF) \cite{Shabana2005}.
Constraint stabilization is performed based on projection on the coordinate and velocity manifolds. That requires the solution of the following equations
\begin{eqnarray}
{\boldsymbol{\phi}^n}({\mathbf{q}},{\mathbf{s}}) &= \mathbf{0} \label{eq:phin}\\
{\boldsymbol{\phi}^d}({\mathbf{q}},{\mathbf{s}}) &= \mathbf{0} \label{eq:phit},
\end{eqnarray}
at the coordinate level, and of
\begin{eqnarray}
\dot{\boldsymbol{\phi}}_{\vdq}^{n}({\mathbf{q}},{\mathbf{s}}) {\mathbf{\dot{q}}} &= {\boldsymbol{\beta}}^n({\mathbf{q}},{\mathbf{s}}) = \mathbf{0} \label{eq:dqproj} \\
\dot{\boldsymbol{\phi}}_{\vdq}^{d}({\mathbf{q}},{\mathbf{s}}) {\mathbf{\dot{q}}} + \dot{\boldsymbol{\phi}}_{\vds}^{d}({\mathbf{q}},{\mathbf{s}}) {\mathbf{\dot{s}}} &= {\boldsymbol{\beta}}^d({\mathbf{q}},{\mathbf{s}}) = \mathbf{0} \label{eq:dsproj}
\end{eqnarray}
at the velocity level. Note that there are no rheonomous equations in the problem analyzed, an therefore ${\boldsymbol{\beta}}^n({\mathbf{q}},{\mathbf{s}}) $ and ${\boldsymbol{\beta}}^d({\mathbf{q}},{\mathbf{s}})$ are $\mathbf{0}$. For example, we frequently use coordinate partitioning \cite{Wehage1982,Haug1989} into dependent and independent. Dependent coordinates and velocities are obtained in terms of the independent ones.
It should be remarked that in the ECCF context, ${\mathbf{s}}$ and ${\mathbf{\dot{s}}}$ are better not considered standard generalized coordinates, but a set of auxiliary variables that must be known in order to solve equation system (\ref{eq:MphiTPhiZero4}). After the integration, Eq.~(\ref{eq:phit}) and Eq.~(\ref{eq:dsproj}) can be used to
obtain the auxiliar variables ${\mathbf{s}}$ and ${\mathbf{\dot{s}}}$ in terms of ${\mathbf{q}}$ and ${\mathbf{\dot{q}}}$. In this context the position and velocity projection would be performed after this step, based
on Eq.~(\ref{eq:phin}) and Eq.~(\ref{eq:dqproj}), respectively. These inertia-less coordinates find different names in the literature, such as ``surface parameters'' \cite{shabana2004development,Shabana2005,pombo2007new,auciello2009dynamic,arnold2004simulation}, ``non-generalized coordinates'' \cite{shabana2001augmented} or ``auxiliary variables'' \cite{fisette2000multibody}, but their main feature is that they do not participate in the system dynamics.
\subsection{Contact model.}
In the context of railway dynamic simulation is very important to correctly determine the values of the creep forces between the wheel and the rail. To that end, in this work the well known linear contact theory of Kalker \cite{kalker1967rolling} is used. This theory requires the determination of several data: location of the contact point, the creepages, normal loads at this contact point, wheel and rail surface curvatures at the contact point, tangent and normal vectors at the contact patch. This computations are
big and must be done for every contact. To speed up computations, several authors \cite{bozzone2011lookup,sugiyama2011wheel,escalona2015modeling} propose the use of pre-calculated look-up tables to determine the required data. This procedure is tedious and usually requires to introduce some modeling simplifications. We propose to compute these quantities without simplifications, on line, based on functions exported using the proposed symbolic methods. This is a more simple and general procedure to apply. The results will confirm that this is very fast procedure.
\subsubsection*{Contact patch geometry determination.}
Based on classical Hertzian contact theory, the contact patch is a flat ellipse \cite{Iwnicki2006}. The semi-axes of this ellipse in the longitudinal and transversal directions, $a$ and $b$ respectively, are determined as follows:
\begin{equation}
a=\left(\frac{3}{2} \frac{1-\nu^2}{E}\frac{1}{A+B} N \right)^{\frac{1}{3}}m(\theta)~~~\text{and}~~~
b=\left(\frac{3}{2} \frac{1-\nu^2}{E}\frac{1}{A+B} N \right)^{\frac{1}{3}}n(\theta).
\end{equation}
In these expressions, $N$ is the normal contact force acting on the wheel, $E$ is the Young’s modulus, $\nu$ the Poisson’s ratio. $m(\theta)$ and $n(\theta)$ are adimensional functions proposed by Hertz. We use on-line interpolation in table $4.1$ in Ref.~\cite{Iwnicki2006} to evaluate these functions. $\theta=\cos^{-1}{\left(\frac{\left|A-B\right|}{A+B}\right)}$, where $A$ and $B$ are determined as
\begin{equation}
A=\frac{1}{2}\left(\frac{1}{R^{w}_{x}}+\frac{1}{R^{r}_{x}}\right)~~~\text{and}~~~B=\frac{1}{2}\left(\frac{1}{R^{w}_{y}}+\frac{1}{R^{r}_{y}}\right).
\end{equation}
$R^{w}_{x}$, $R^{w}_{y}$, $R^{r}_{x}$, $R^{r}_{y}$ are the curvature radii of wheel and rail surfaces at the contact point. For the case studied these are computed as:
\begin{equation}
\begin{array}{cc}
R^{w}_{x}= \dfrac{\sqrt{(\mathbf{r}_{O^w}^{P^w}\mathbf{e}_{x}^{w})^2+(\mathbf{r}_{O^w}^{P^w}\mathbf{e}_{y}^{w})^2}}{\sqrt{1-\left(\mathbf{n}^r \mathbf{e}^w_y\right)^2}}~~~~~\footnotemark
&
~~~~~R^{w}_{y}=\left|\dfrac{(1+\frac{\partial f^w}{\partial{u_w}})^{3/2}}{\frac{\partial^2 f^w}{{\partial u_w}^2}}\right|
\\
R^{r}_{y}=\left|\dfrac{(1+\frac{\partial f^r}{\partial{u_r}})^{3/2}}{\frac{\partial^2 f^r}{{\partial u_r}^2}}\right|
&
R^{r}_{x}=\infty
\end{array}
\end{equation}
\footnotetext{Distance from the rotation axis to the contact point along the normal at contact point.}
These curvature radii are obtained and exported based on the symbolic methods presented preciously in this paper. The normal force $N$ is the Lagrange multiplier associated with the normal constraint of the relative contact point. It is obtained directly from the solution of the dynamic system of
equations. To keep the dynamic problem linear, avoiding a nonlinear iteration, the normal force used is the one obtained in the previous integration step.
\subsubsection*{Creep forces and moments}
From the modeling perspective creep forces and moments are considered external actions, so their effect is contained in vector $\boldsymbol{\delta}_{{\mathbf{q}}}$, along with all the contributions due to other inertial constitutive and external forces.
For each wheel the these forces and moments are symbolically expressed as
\begin{equation}
\mathbf{f}=f_x~\mathbf{t}^r_x+f_y~\mathbf{t}^r_y ~~~~\text{and}~~~~ \mathbf{m}=m_z~\mathbf{n}^r,
\end{equation}
where $f_x$, $f_y$ and $m_z$ are symbols. These represents the tangent contact force and spin contact moment acting on the wheel at the contact point $P^w$. They are defined at the contact base $\mathbf{t}^r_x$,$\mathbf{t}^r_y$, $\mathbf{n}^r$.
The components of these vectors are numerically computed as
\begin{equation}
\left[
\begin{array}{c}
f_x\\
f_y\\
m_z
\end{array}
\right]=-G
\left[
\begin{array}{ccc}
a b ~c_{11}&0&0\\
0& a b ~c_{22}& \sqrt{ab}~c_{23}\\
0&-\sqrt{ab}~c_{23}& (ab)^2~c_{33}
\end{array}
\right]
\left[
\begin{array}{c}
\xi_x\\
\xi_y\\
\varphi_z
\end{array}
\right]
\label{eq:kalker1}
\end{equation}
\cite{Iwnicki2006}. Parameter $G$ is the material shear modulus and $c_{ij}(a/b,\nu)$ are the coefficients determined by Kalker, tabulated in Ref.~\cite{kalker1968tangential}. We use on-line interpolation in these tables. The creepages $\xi_x$, $\xi_y$ and $\varphi$ are defined as:
\begin{eqnarray}
\xi_x = \frac{\mathbf{v}_{Gr.}^{P^w}}{\frac{1}{2}(\left|\mathbf{v}_{Gr.}^{O^w}\right|+\left|\boldsymbol{\omega}_{Gr.}^{w} \wedge \mathbf{r}_{O^w}^{P^w}\right|)}~\mathbf{t}^r_x \\
\xi_y = \frac{\mathbf{v}_{Gr.}^{P^w}}{\frac{1}{2}(\left|\mathbf{v}_{Gr.}^{O^w}\right|+\left|\boldsymbol{\omega}_{Gr.}^{w} \wedge \mathbf{r}_{O^w}^{P^w}\right|)}~\mathbf{t}^r_y \\
\varphi_z = \frac{\boldsymbol{\omega}_{Gr.}^{w}}{\frac{1}{2}(\left|\mathbf{v}_{Gr.}^{O^w}\right|+\left|\boldsymbol{\omega}_{Gr.}^{w} \wedge \mathbf{r}_{O^w}^{P^w}\right|)}~\mathbf{n}^r
\end{eqnarray}
where $\mathbf{v}_{Gr.}^{P^w}$ in the velocity with respect to the ground ($Gr.$) of the $P^w$ contact point when moves ``attached'' to the wheel and $\boldsymbol{\omega}_{Gr.}^{w}$ is the wheel-set angular velocity with respect to the ground. $\mathbf{v}_{Gr.}^{O^w}$ in the velocity with respect to the ground of the center of the wheel-set and $\mathbf{r}_{O^w}^{P^w}$ is the position vector form $O^w$ to $P^w$ as shown in Eq.~(\ref{eq:OwPw}). The creepages are determined numerically based on exported functions for the numerators and denominators of these expressions. In this way division by zero can be dealt within the numerical solver.
All the symbolic functions required for the implementation of the Kalker model for all the different contact points, referred previously, are computed in a single function call. In this way recycling of atoms is maximized.
\section{Numerical integration}
\label{sec3}
For our case study the Linear Kalker model used to model the contact forces has been a mayor source of problems.
To some extent, these forces can be considered viscous friction forces with a
huge value for the equivalent viscous constant, making the system dynamics stiff. In this context, the use of an explicit integration scheme
is going to require a very small time step, spoiling real-time performance.
In order to solve this problem we have devised an Implicit-Explicit (IMEX) \cite{ascher1995implicit} integration schema, and adjusted it to overcome the problem associated with the contact forces without penalizing the computational cost.
The use of these schemes is not new. It has appeared in the bibliography under other names: semi-implicit \cite{arnold2007linearly}, additive or combined methods \cite{fulton2004semi}, etc. These methods use different types of discretization for the different terms in the dynamic equations. Those terms that are not related to the stiff behavior of the equations are discretized using a low-cost explicit scheme while, the stiff terms are discretized using an implicit scheme.
As commented before creep forces and moments are introduced in the model as external actions, and their contribution is embedded in vector ${\boldsymbol{\delta}}_{{\mathbf{q}}}$. Lets make this contribution explicit, by splitting ${\boldsymbol{\delta}}$ into two Kalker ($K$) and non-Kalker ($NK$) contributions.
In this way, first equation in Eq.~(\ref{eq:MphiTPhiZero4}) can be rewritten as:
\begin{equation}
\begin{bmatrix}
{\mathbf{M}}_{{\mathbf{q}}\vq} & \dot{\boldsymbol{\phi}}_{\vdq}^{n}{\T} \\
\dot{\boldsymbol{\phi}}_{\vdq}^{n} & \mathbf{0}
\end{bmatrix}
\begin{bmatrix} {\mathbf{\ddot{q}}} \\ {\boldsymbol{\lambda}}^n \end{bmatrix}
=
\begin{bmatrix} {\boldsymbol{\delta}}^{K}_{{\mathbf{q}}} + {\boldsymbol{\delta}}^{NK}_{{\mathbf{q}}} \\ {\boldsymbol{\gamma}^n} \end{bmatrix}
\end{equation}
This new set of equations can be integrated using an IMEX method. The terms related to creep forces will be integrated using an Implicit scheme and the rest using an Explicit scheme.
Eq.~(\ref{eq:kalker1}) can be expressed as a typical viscous contribution
\begin{equation}
\mathbf{f}^K= -\frac{1}{V}
\mathbf{C}^K
\boldsymbol{\nu}
\label{eq:kalker_viscous}
\end{equation}
where $\mathbf{f}^K=[f_x,f_y, m_z]\T1$, $V=\frac{1}{2}(\left|\mathbf{v}_{Gr.}^{O^w}\right|+\left|\boldsymbol{\omega}_{Gr.}^{w} \wedge \mathbf{r}_{O^w}^{P^w}\right|)$, $\boldsymbol{\nu} = [\mathbf{v}_{Gr.}^{P^w} \mathbf{t}^r_x ~~ \mathbf{v}_{Gr.}^{P^w}\mathbf{t}^r_y ~~ \boldsymbol{\omega}_{Gr.}^{w}\mathbf{n}^r]^\mathsf{T}$ and
\begin{equation}
\mathbf{C}^K=G
\left[
\begin{array}{ccc}
a b ~c_{11}&0&0\\
0& a b ~c_{22}& \sqrt{ab}~c_{23}\\
0&-\sqrt{ab}~c_{23}& (ab)^2~c_{33}
\end{array}
\right]
\end{equation}
Adding a subindex $i$ to refer to a particular contact point, the contribution ${\boldsymbol{\delta}}^{K}$ can be obtained as:
\begin{align}
{\boldsymbol{\delta}}^{K}_{{\mathbf{q}}} = \sum_{i=1}^8 \frac{\partial {\boldsymbol{\delta}}^{K}_{{\mathbf{q}}}}{\partial \mathbf{f_i}^{K}} \mathbf{f_i}^{K} =
- \sum_{i=1}^8 \frac{\partial {\boldsymbol{\delta}}^{K}_{{\mathbf{q}}}}{\partial \mathbf{f_i}^{K}} \frac{1}{V_i} \mathbf{C}^K_i
\frac{\partial \boldsymbol{\nu}_i}{\partial {\mathbf{\dot{q}}}} {\mathbf{\dot{q}}} = - \mathbf{C}^{K}_{{\mathbf{q}}\vq} {\mathbf{\dot{q}}}
\end{align}
In order to determine matrix $ \mathbf{C}^{K}_{{\mathbf{q}}\vq}$, we symbolically export matrices
\begin{equation}
\frac{\partial {\boldsymbol{\delta}}^{K}_{{\mathbf{q}}}}{\partial \mathbf{f_i}^{K}} \mathbf{C}_i^{K}\frac{\partial \boldsymbol{\nu}_i}{\partial {\mathbf{\dot{q}}}} ~,~~~i=1,\ldots,8,
\end{equation}
and numerically assemble matrix as
\begin{equation}
\mathbf{C}^{K}_{{\mathbf{q}}\vq}= \sum_{i=1}^8 \frac{1}{V_i} ~~\frac{\partial {\boldsymbol{\delta}}^{K}_{{\mathbf{q}}}}{\partial \mathbf{f_i}^{K}} \mathbf{C}^K_i
\frac{\partial \boldsymbol{\nu}_i}{\partial {\mathbf{\dot{q}}}},
\end{equation}
where $V_i$ and $\mathbf{C}^K_i$ are determined using the same procedures described in the previous section.
The contribution ${\boldsymbol{\delta}}^{NK}$, can be obtained symbolically substituting by zero en ${\boldsymbol{\delta}}_{{\mathbf{q}}}$ the symbols associated to the external forces
$f_x,f_y, m_z$ for every contact point.
Now write the dynamic equation set can be expressed as follows:
\begin{align}
\begin{bmatrix}
{\mathbf{M}}_{{\mathbf{q}}\vq} & \dot{\boldsymbol{\phi}}_{\vdq}^{n}{\T} \\
\dot{\boldsymbol{\phi}}_{\vdq}^{n} & \mathbf{0}
\end{bmatrix}
\begin{bmatrix} {\mathbf{\ddot{q}}} \\ {\boldsymbol{\lambda}}^n \end{bmatrix}
&=
\begin{bmatrix} {\boldsymbol{\delta}}^{NK}_{{\mathbf{q}}}-\mathbf{C}^{K}_{{\mathbf{q}}\vq}{\mathbf{\dot{q}}} \\ {\boldsymbol{\gamma}^n} \end{bmatrix}
\label{eq:MphiTPhiZero5}
\end{align}
The IMEX integration procedure proposed follows directly from this equation.
Must be observed that in Kalker's Linear Theory when saturation occurs this method is also valid, because in this case force can be also written as the product of a constant matrix and the creepages. The numerical solver must handle with which matrix use at each moment.
\subsubsection*{Discretization}
The contribution $\mathbf{C^{K}}_{{\mathbf{q}}\vq}{\mathbf{\dot{q}}}$ is discretized using an implicit Euler. To that end it is evaluated at the next time step $t+\Delta t$,
\begin{equation}
\mathbf{C}^{K}_{{\mathbf{q}}\vq}{\mathbf{\dot{q}}}_{t+\Delta t}
\end{equation}
An explicit Euler scheme for the remaining terms requires acceleration to be discretized as
\begin{equation}
{\mathbf{\ddot{q}}}_{t+\Delta t}=\frac{{\mathbf{\dot{q}}}_{t+\Delta t}-{\mathbf{\dot{q}}}_{t}}{\Delta t}
\end{equation}
and ${\boldsymbol{\delta}}^{K}_{{\mathbf{q}}}$ to be evaluated at $t$.
Substituting this into Eq.~(\ref{eq:MphiTPhiZero5}) the final discretization of the system
takes the form:
\begin{align}
\begin{bmatrix}
{\mathbf{M}}_{{\mathbf{q}}\vq} + \mathbf{C}^{K}_{{\mathbf{q}}\vq} \Delta t &~ &\dot{\boldsymbol{\phi}}_{\vdq}^{n}{\T} \Delta t\\
\dot{\boldsymbol{\phi}}_{\vdq}^{n} &~& \mathbf{0}
\end{bmatrix}
\begin{bmatrix} {\mathbf{\dot{q}}}_{t+\Delta t} \\ {\boldsymbol{\lambda}}^n \end{bmatrix}
&=
\begin{bmatrix} {\boldsymbol{\delta}}^{NK}_{{\mathbf{q}}} \Delta t + {\mathbf{M}}_{{\mathbf{q}}\vq} {\mathbf{\dot{q}}}_{t} \\ {\boldsymbol{\gamma}^n} \Delta t + \dot{\boldsymbol{\phi}}_{\vdq}^{n} {\mathbf{\dot{q}}}_{t} \end{bmatrix}
\label{eq:MphiTPhiZero6}
\end{align}
where all the functions are computed at time $t$.
Note that, to keep the equation solution linear, $\mathbf{C}^{K}$ is evaluated at $t$ instead of $t+\Delta t$.
The structure of this system of equations can be observed in Fig.~ \ref{fig3}. It is noticeable that the sparsity structure is very similar to the one seen in Fig.~\ref{fig2}.
\begin{figure}[h]
\centering
\includegraphics[height=32mm]{./M_Phi_dqT_Phi_dq_delta_gamma-emb.pdf}
\caption{Dynamic model structure $\left[[ {\mathbf{M}}_{{\mathbf{q}}\vq} + \mathbf{C}^{K}_{{\mathbf{q}}\vq} \Delta t,\dot{\boldsymbol{\phi}}_{\vdq}^{n}{\T} \Delta t;\dot{\boldsymbol{\phi}}_{\vdq}^{n},\mathbf{0}],[ {\boldsymbol{\delta}}^{NK}_{{\mathbf{q}}} \Delta t + {\mathbf{M}}_{{\mathbf{q}}\vq} {\mathbf{\dot{q}}}_{t};{\boldsymbol{\gamma}^n} \Delta t + \dot{\boldsymbol{\phi}}_{\vdq}^{n} {\mathbf{\dot{q}}}_{t}]\right]$}
\label{fig3}
\end{figure}
This problem has the same mathematical structure that the standard full dynamic set, so it can be solved using the same procedures. We use coordinate partitioning \cite{Wehage1982,Haug1989}. This is a good performing strategy that is also used by other practitioners in the symbolic multibody field.
We use a $LU$ procedure with full pivoting on the non tangent constraint Jacobian in the generalized velocities ${\mathbf{\dot{q}}}$, so we can choose the set of independent coordinates at each iteration step. This way, no conditions are enforced on the parameterization ${\mathbf{q}}$ used.
Thus using this IMEX scheme comes for free, as the evaluation of the functions appearing in Eq.~ (\ref{eq:MphiTPhiZero6}) has the same complexity as the functions in Eqs.~ (\ref{eq:MphiTPhiZero5}) or (\ref{eq:MphiTPhiZero4}).
It should be noted that the matrix ${\mathbf{M}}_{{\mathbf{q}}\vq} + \mathbf{C}_{{\mathbf{q}}\vq}^{K} \Delta t$ is not symmetric, so $LU$ decomposition should be used in place of $LDL^{^\mathsf{T}}$ incurring a small penalty in performance.
The solution of this system will give the value of the generalized velocities at $t+\Delta t$, ${\mathbf{\dot{q}}}_{t+\Delta t}$. To obtain the coordinates
at ${\mathbf{q}}_{t+\Delta t}$ the following explicit mid-point rule is used:
\begin{equation}
{\mathbf{q}}_{t+\Delta t}={\mathbf{q}}_{t}+\frac{{\mathbf{\dot{q}}}_{t+\Delta t}+{\mathbf{\dot{q}}}_{t}}{2}{\Delta t}.
\end{equation}
Note that it is second order and comes at no cost.
Next coordinate projection is performed. First Eq.~(\ref{eq:phit}) is used to obtain the contact coordinates ${\mathbf{s}}_{t+\Delta t}$ in terms of the ${\mathbf{q}}_{t+\Delta t}$. As ${\mathbf{q}}_{t+\Delta t}$ is accurate to second order, this procedure gives a error of the same order. To this end the following iterative Newton-Raphson procedure is used:
\begin{equation}
\dot{\boldsymbol{\phi}}_{\vds}^{d}({\mathbf{q}},{\mathbf{s}}) ({\mathbf{s}}_{k+1}-{\mathbf{s}}_k) = -{\boldsymbol{\phi}^d}({\mathbf{q}},{\mathbf{s}}) \label{eq:NRs}
\end{equation}
this usually involves a single iteration\footnote{This is related to the NSWHS frame used to define the contact point in the wheel.}. After the update of ${\mathbf{s}}$, Eq.~(\ref{eq:phin}) is solved for ${\mathbf{q}}$ using the same iterative procedure:
\begin{equation}
\dot{\boldsymbol{\phi}}_{\vdq}^{n}({\mathbf{q}},{\mathbf{s}}) ({\mathbf{q}}_{k+1}-{\mathbf{q}}_k) = -{\boldsymbol{\phi}^n}({\mathbf{q}},{\mathbf{s}}) \label{eq:NRq}
\end{equation}
This procedure usually converges in a single iteration. Note that ${\mathbf{q}}_{t+\Delta t}$ is accurate to second order after the integration step. Note that the LU decomposition of the previous Jacobians, $\dot{\boldsymbol{\phi}}_{\vdq}^{n}({\mathbf{q}},{\mathbf{s}})$ and $\dot{\boldsymbol{\phi}}_{\vdq}^{d}({\mathbf{q}},{\mathbf{s}})$, is known as they have computed at the previous velocity projection step (described latter). So the Jacobian and its decomposition is not updated in this step.
In the velocity projection step, first Eq.~(\ref{eq:dqproj}) is solved for ${\mathbf{\dot{q}}}$. To that end, the Jacobian $\dot{\boldsymbol{\phi}}_{\vdq}^{n}({\mathbf{q}},{\mathbf{s}})$ and its $LU$ decomposition are updated. Then, Eq.~(\ref{eq:dsproj}) is solved for ${\mathbf{\dot{s}}}$. To that end, the Jacobians $\dot{\boldsymbol{\phi}}_{\vdq}^{d}({\mathbf{q}},{\mathbf{s}})$ and $\dot{\boldsymbol{\phi}}_{\vds}^{d}({\mathbf{q}},{\mathbf{s}})$ are updated
and the $LU$ decomposition of $\dot{\boldsymbol{\phi}}_{\vds}^{d}({\mathbf{q}},{\mathbf{s}})$ is computed.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{algoritmo.pdf}
\caption{Integration procedure}
\label{fig:integration}
\end{figure}
In Fig.~\ref{fig:integration}, a schematic representation of the integration procedure described here is presented.
To get a more clear picture, the steps related to the determination of the creep forces has been represented.
\section{Results}
\label{sec4}
\subsubsection*{Simulation description}
The track used in the simulation starts and ends with two straight and
parallel segments running in the $x$ direction and separated $50 ~\text{m}$.
Both stretches are joined by a symmetric and smooth double transition curve $270 ~\text{m}$ long in direction $x$.
On top of the defined geometry, two harmonic vertical irregularities with an amplitude of $10~\text{mm}$ are added. These irregularities are defined
using a sine wave that runs in direction of $x$ with a wave length of $10~\text{m}$. Right and left rail
irregularities present a phase difference of $\pi/2$. As commented earlier, third order splines are used to discretize the whole track, including the irregularity.
The simulation starts with an initial forward speed of $23.7~\text{m/s}$ with the $Vehicle$ $Body$ centered at $x=0 ~\text{m}$ and with a lateral misalignment of $5~\text{mm}$ with respect to to the track center.
Vehicle motors are actuated with a constant $200~\text{Nm}$ torque.
\subsubsection*{Computational results}
Fig.~\ref{fig:xzmainbody2} shows the trajectory followed by the $Vehicle\ Body$ center.
Note that the the given initial state is not in dynamic equilibrium and therefore, the oscillations at the beginning
of the simulation are in part due to this. This is related to the sudden application of torque at the simulation start.
By the time that the vehicle center enters the track, the oscillations seen are no longer related to the initial condition.
\begin{figure}[h]
\centering
\includegraphics[width=0.99\textwidth]{trainpos2.pdf}
\caption{Trajectories followed by the main body}
\label{fig:xzmainbody2}
\end{figure}
Fig.~\ref{fig:hunting} shows a zoom of the first graph in Fig.~\ref{fig:xzmainbody2}. This is done to make the oscillations
in that plane visible. The zone in which the vehicle exits the second curve is shown.
Two different oscillations can be seen. Two oscillations are clearly distinguishable: The hunting oscillation is the one with the largest wave length, while the shorter one is related
to the irregularities of the track.
\begin{figure}[h]
\centering
\includegraphics[width=0.99\textwidth]{zoom.pdf}
\caption{Hunting oscillation in detail.}
\label{fig:hunting}
\end{figure}
Creep velocities and creep forces and moments are presented in Fig.~\ref{fig:kalkerforces}.
It can be observed that creep velocities are higher when the vehicle is at the middle of the curved tracks
($t\approx 5~s$ and $t\approx 10~s$). The same behavior is seen for the forces and moments. Small fluctuations
on the creepages and forces in the second straight track ($t> 15~s$) are due to the vertical irregularities.
\begin{figure}[h]
\centering
\includegraphics[width=0.99\textwidth]{kalker26.pdf}
\caption{Creep velocities and forces the Rear Bogie, Front-Right wheelset }
\label{fig:kalkerforces}
\end{figure}
Using the proposed IMEX integrator with a $\Delta t = 1~\text{ms}$ a stable integration is achieved by a generous margin.
In the same conditions, using an explicit Euler for velocities and the explicit mid-point rule for accelerations time steps smaller than
$10^{-4}~\text{ms}$, not compatible with a real-time performance, are required. Implicit trapezoidal rule has also been used with showing a stable
behavior around $\Delta t \approx 1~\text{ms}$ with not such a generous margin.
Using the IMEX Euler method a fine grained analysis of the computation times required by the different steps of the proposed algorithm is done.
The results are given in Table~ \ref{table:times}. A seven years old \textit{Intel Core vPro i5 @ 3500}{MHz} has been used for the test.
From this data it can be seen that it takes $256 ~\mu \text{s}$ of CPU time to complete one integration step. That is, \textit{hard} real-time performance
is achieved by a wide margin using the proposed procedures. In comparison, using the trapezoidal rule \textit{soft} real-time performance can be achieved by a short margin.
\begin{table}[]
\centering
\caption{Results per time step ($1~\text{ms}$)}
\label{table:times}
\begin{tabular}{lrr}
\hline
Task & CPU Time $\mu \text{s}$ \\
\hline
Contact Area, Look up Kalker coeffs. and evaluate $\frac{\partial {\boldsymbol{\delta}}^{K}_{{\mathbf{q}}}}{\partial \mathbf{f_i}^{K}} \mathbf{C}_i^{K}\frac{\partial \boldsymbol{\nu}_i}{\partial {\mathbf{\dot{q}}}}$ ($\times 8$) & 30 \\
Look up Wheel profile, rail profile and railway spline coeffs. ($\times 8$) & 1 \\
Evaluate ${\mathbf{M}}$,${\boldsymbol{\delta}}$ and ${\boldsymbol{\gamma}^n}$ & 55 \\
Dynamics Solution $\Rightarrow {\mathbf{\dot{q}}}, {\boldsymbol{\lambda}}$ & 103 \\
Time Integration $\Rightarrow {\mathbf{q}}$ & 1 \\
Evaluate ${\boldsymbol{\phi}^n}$, ${\boldsymbol{\phi}^d}$, $\dot{\boldsymbol{\phi}}_{\vdq}^{n}$, $\dot{\boldsymbol{\phi}}_{\vdq}^{d}$, $\dot{\boldsymbol{\phi}}_{\vds}^{d}$ and ${\boldsymbol{\beta}}^n$ & 29 \\
Projection Solution $\Rightarrow {\mathbf{q}}, {\mathbf{\dot{q}}}, {\mathbf{s}}, {\mathbf{\dot{s}}}$ & 37 \\
\hline
Total Time & 256 \\
\hline
\end{tabular}
\end{table}
In Fig.~\ref{fig:nriter} the number of iterations required by the ${\mathbf{q}}$-projection and ${\mathbf{s}}$-projection steps are shown.
It is noticeable that the ${\mathbf{q}}$-projection only requires a single Newton-Raphson\footnote{the tolerance used is $10^{-6}$ amounting to a negligible error of $\approx 10^{-3}~\text{mm}$ for lengths} iteration.
The same is true for the ${\mathbf{s}}$-projection. This has required to integrate ${\mathbf{s}}$ after the integration step using an explicit Euler procedure ${\mathbf{s}}_{t+\Delta t}={\mathbf{s}}_t + {\mathbf{\dot{s}}}_t ~\Delta t$ leading to an to a smaller error ($O(\Delta t^2)$)
at the start of the Newton-Raphson iteration. Clearly, the increased number of iterations is coincident with
the curved stretches. This result justify the approach adopted in which, the ${\mathbf{s}}$-projection is performed before the ${\mathbf{q}}$-projection.
\begin{figure}[h]
\centering
\includegraphics[width=0.99\textwidth]{nr_iter2.pdf}
\caption{Iterative steps needed by the Newton-Rapshon algorithm}
\label{fig:nriter}
\end{figure}
In Table~\ref{table:functions} the number of operations required for the evaluation of the different functions used by the proposed dynamic formalism are presented.
\begin{table}[h]
\centering
\caption{Atoms and operation for the evaluation of the model functions}
\label{table:functions}
\begin{tabular}{lrr}
\hline
Function & Atoms & Operations \\ \hline
${\mathbf{M}}_{{\mathbf{q}}\vq}$ & 1795 & 10910 \\
${\boldsymbol{\delta}}_{{\mathbf{q}}}$ & 3648 & 19015 \\
${\boldsymbol{\phi}^n}$ & 425 & 1709 \\
${\boldsymbol{\phi}^d}$ & 541 & 2150 \\
$\dot{\boldsymbol{\phi}}_{\vdq}^{n}$ & 784 & 4116 \\
$\dot{\boldsymbol{\phi}}_{\vds}^{n}$ & 846 & 6668 \\
$\dot{\boldsymbol{\phi}}_{\vdq}^{d}$ & 964 & 6574 \\
$\dot{\boldsymbol{\phi}}_{\vds}^{d}$ & 1113 & 8437 \\
${\boldsymbol{\beta}}^n$ & 0 & 0 \\
${\boldsymbol{\gamma}^n}$ & 3779 & 25870 \\
$\frac{\partial {\boldsymbol{\delta}}^{K}_{{\mathbf{q}}}}{\partial \mathbf{f_i}^{K}} \mathbf{C}_i^{K}\frac{\partial \boldsymbol{\nu}_i}{\partial {\mathbf{\dot{q}}}}$ & 350 & 1917 \\ \hline
\end{tabular}
\end{table}
The results show a correlation between the time for function evaluations and the number of operations.
As a major result of this study, it can be seen that using the symbolic procedures proposed the penalties incurred for
using an exact treatment of the linear Kalker contact model are barely noticeable. Note that this is a fair comparison,
as the operation count related to other dynamic and kinematic computations are very optimized, showing numbers compatible with state-of-the-art
recursive formulations. This
puts into perspective the relevance of symbolic methods proposed in achieving hard real-time performance in the railway dynamics simulation context.
Still, there are still some possibilities to further improve the results given in this article.
1.-The dynamic system structure shown in Fig.~\ref{fig2} shows a decent amount of sparsity. This sparsity is shared with the IMEX discretized dynamic matrix.
Important savings can therefore be obtained using a sparse $LU$ algorithm.
2.- In the ${\mathbf{s}}$-projection and ${\mathbf{\dot{s}}}$-projection problems $\dot{\boldsymbol{\phi}}_{\vds}^{d}$ is a maximum rank block-diagonal matrix with
$4\times4$ blocks \cite{samin2003}. Therefore, its computation can be speeded up by big integer factor. The solution could be easily
implemented symbolically or even in parallel.
3.- Removal of the repeated evaluation of constant atoms from the symbolic functions and reuse of atoms common to different exported functions.
As commented in the introduction, at the expense of some accuracy, partial linearization \cite{Escalona2015} or
base parameter reduction \cite{Iriarte2015}, can be used to further improve the computational performance of the model.
\section{Conclusions}
\label{sec5}
The purpose of the article was to test state-of-the-art methods for the symbolic modeling
in the railway context. A complex locomotive running on a track with a complex and general surface geometry has been modeled and tested.
Main aspects of the symbolic methods proposed are summarized: atomization, recursive operators, points and bases structures, general parameterization, etc.
Based on this methods the model is obtained using a direct implementation of the principle of virtual work.
Creep forces and moments are modeled using a direct symbolic implementation of the linear Kalker model without simplifications.
An Implicit-Explicit (IMEX) integrator has been proposed to cope with the contact model while attaining real-time performance.
The resulting equations are solved using coordinate partitioning MSD procedures.
A very stable hard-real-time-compatible performance with a time step of $1~\text{ms}$ is obtained. A CPU time of $256~\mu\text{s}$ per time step
is required in a seven year old \textit{Intel Core vPro i5 @ 3500} MHz.
It is noticeable the small time required for the determination of the creep forces
when an exact implementation of the linear Kalker model is used. Also, the compromise efficiency/robustness of the IMEX integrator proposed is remarkable.
The results obtained show the relevance of the
methods proposed for the real-time simulation of railway vehicles.
There are still obvious possibilities to improve on the results presented in this work: better sharing of atoms,
constant atom revaluation, sparse linear solver implementation and parallelization, are the most obvious.
On top of this, with a small accuracy
penalty, techniques such as partial-linearization and parameter reduction can be used
to improve even further the results presented.
\section{Acnowledgements}
This work was partially supported by the ``Plan Nacional de Investigación Científica, Desarrollo e Innovación Tecnológica'', ``Ministerio de Economía y Competitividad'' [grant numbers IPT-2011-1149-370000 and TRA2014\_57609\_R].
\bibliographystyle{unsrt}
| {'timestamp': '2017-06-07T02:04:36', 'yymm': '1706', 'arxiv_id': '1706.01657', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01657'} | arxiv |
\section{Introduction} \label{intro}
Advances in a wide range of medical imaging technologies have revolutionized how we view functional and pathological events in the body and define anatomical structures in which these events take place. X-ray, CAT, MRI, Ultrasound, nuclear medicine, among other medical imaging technologies, enable 2D or tomographic 3D images to capture in-vivo structural and functional information inside the body for diagnosis, prognosis, treatment planning and other purposes.
One fundamental problem in medical image analysis is image segmentation, which identifies the boundaries of objects such as organs or abnormal regions (e.g. tumors) in images. Since manually annotation can be very time-consuming and subjective, an accurate and reliable automatic segmentation method is valuable for both clinical and research purpose. Having the segmentation result makes it possible for shape analysis, detecting volume change, and making a precise radiation therapy treatment plan.
In
the literature of image processing and computer vision, various theoretical frameworks have been proposed for automatic segmentation. Traditional unsupervised methods such as thresholding~\cite{otsu1979threshold}, region growing~\cite{adams1994seeded}, edge detection and grouping~\cite{canny1986computational}, Markov Random Fields (MRFs)~\cite{manjunath1991unsupervised}, active contour models~\cite{kass1988snakes}, Mumford-Shah functional based frame partition~\cite{mumford1989optimal}, level sets~\cite{malladi1995shape}, graph cut~\cite{shi2000normalized}, mean shift~\cite{comaniciu2002mean}, and their extensions and integrations~\cite{gooya2011deformable, lee2008segmenting, lefohn2003interactive} usually utilize constraints about image intensity or object appearance. Supervised methods~\cite{menze2015multimodal,cobzas20073d, geremia2011spatial, wels2008discriminative,ronneberger2015u, havaei2017brain}, on the other hand, directly learn from labeled training samples, extract features and context information in order to perform a dense pixel (or voxel)-wise classification.
Convolutional Neural Networks (CNNs) have been widely applied to visual recognition problems in recent years, and they are shown effective in learning a hierarchy of features at multiple scales from data. For pixel-wise semantic segmentation, CNNs have also achieved remarkable success. In~\cite{long2015fully}, Long \emph{et al.} first proposed a fully convolutional networks (FCNs) for semantic segmentation. The authors replaced conventional fully connected layers in CNNs with convolutional layers to obtain a coarse label map, and then upsampled the label map with deconvolutional layers to get per pixel classification results. Noh \emph{et al.}~\cite{noh2015learning} used an encoder-decoder structure to get more fine details about segmented objects.
With multiple unpooling and deconvolutional layers in their architecture, they avoided the coarse-to-fine stage in~\cite{long2015fully}. However, they still needed to ensemble with FCNs in their method to capture local dependencies between labels. Lin \emph{et al.}~\cite{lin2016efficient} combined Conditional Random Fields (CRFs) and CNNs to better explore spatial correlations between pixels, but they also needed to implement a dense CRF to refine their CNN output.
In the field of medical image segmentation, deep CNNs have also been applied with promising results. Ronneberger \emph{et al.}~\cite{ronneberger2015u} presented a FCN, namely U-net, for segmenting neuronal structures in electron microscopic stacks. With the idea of skip-connection from~\cite{long2015fully}, the U-net achieved very good performance and has since been applied to many different tasks such as image translation~\cite{isola2016image}.
In addition, Havaei \emph{et al.}~\cite{havaei2017brain} obtained good performance for medical image segmentation with their InputCascadeCNN. The InputCascadeCNN has image patches as inputs and uses a cascade of CNNs in which the output probabilities of a first-stage CNN are taken as additional inputs to a second-stage CNN.
Pereira \emph{et al.}~\cite{pereira2016brain} applied deep CNNs with small kernels for brain tumor segmentation.
They proposed different architectures for segmenting high grade and low grade tumors, respectively.
Kamnitsas \emph{et al.}~\cite{kamnitsas2017efficient} proposed a 3D CNN using two pathways with inputs of different resolutions. 3D CRFs were also needed to refine their results.
Although these previous approaches using CNNs for segmentation have achieved promising results, they still have limitations. All above methods utilize a pixel-wise loss, such as softmax, in the last layer of their networks, which is insufficient to learn both local and global contextual relations between pixels. Hence they always need models such as CRFs ~\cite{chen14semantic} as a refinement to enforce spatial contiguity in the output label maps. Many previous methods \cite{havaei2017brain,kamnitsas2017efficient,pereira2016brain} address this issue by training CNNs on image patches and using multi-scale, multi-path CNNs with different input resolutions or different CNN architectures. Using patches and multi-scale inputs could capture spatial context information to some extent.
Nevertheless, as described in U-net~\cite{ronneberger2015u}, the computational cost for patch training is very high and there is a trade-off between localization accuracy and the patch size.
Instead of training on small image patches, current state-of-the-art CNN architectures such as U-net are trained on whole images or large image patches and use skip connections to combine hierarchical features for generating the label map. They have shown potential to implicitly learn some local dependencies between pixels. However, these methods are still limited by their pixel-wise loss function, which lacks the ability to enforce the learning of multi-scale spatial constraints directly in the end-to-end training process.
Compared with patch training, an issue for CNNs trained on entire images is label or class imbalance. While patch training methods can sample a balanced number of patches from each class, the numbers of pixels belonging to different classes in full-image training methods are usually imbalanced. To mitigate this problem, U-net uses a weighted cross-entropy loss to balance the class frequencies. However, the choice of weights in their loss function is task-specific and is hard to optimize. In contract to the weighted loss in U-net, a general loss that could avoid class imbalance as well as extra hyper-parameters would be more desirable.
In this paper, we propose a novel end-to-end Adversarial Network architecture, called SegAN, with a multi-scale $L_1$ loss function, for semantic segmentation. Inspired by the original GAN~\cite{goodfellow2014generative}, the training procedure for SegAN is similar to a two-player min-max game in which a segmentor network ($S$) and a critic network ($C$) are trained in an alternating fashion to respectively minimize and maximize an objective function. However, there are several major differences between our SegAN and the original GAN that make SegAN significantly better for the task of image segmentation.
\begin{itemize}
\vspace{-6pt}
\item
In contrast to classic GAN with separate losses for generator and discriminator, we propose a novel multi-scale loss function for both segmentor and critic.
Our critic is trained to maximize a novel multi-scale $L_{1}$ objective function that takes into account CNN feature differences between the predicted segmentation and the ground truth segmentation at multiple scales (i.e. at multiple layers).
\item We use a fully convolutional neural network (FCN) as the segmentor $S$, which is trained with only gradients flowing through the critic, and with the objective of minimizing the same loss function as for the critic.
\item Our SegAN is an end-to-end architecture trained on whole images, with no requirements for patches, or inputs of multiple resolutions, or further smoothing of the predicted label maps using CRFs.
\end{itemize}
By training the entire system end-to-end with back propagation and alternating the optimization of $S$ and $C$, SegAN can directly learn spatial pixel dependencies at multiple scales. Compared with previous methods that learn hierarchical features with multi-scale multi-path CNNs~\cite{farabet2013learning}, our SegAN network applies a novel multi-scale loss to enforce the learning of hierarchical features in a more straightforward and efficient manner.
Extensive experimental results demonstrate that the proposed SegAN achieves comparable or better results than the state-of-the-art CNN-based architectures including U-net.
The rest of this paper is organized as follows. Section \ref{methods} introduces our SegAN architecture and methodology. Experimental results are presented in Section 3. Finally, we conclude this paper in Section 4.
\section{Methodology} \label{methods}
\begin{figure*}[tb]
\centerline{
\includegraphics[width=0.99\textwidth,height = 350pt]{framework.pdf}}
\caption{The architecture of the proposed SegAN with segmentor and critic networks. $4 \times 4$ convolutional layers with stride $2$ (S2) and the corresponding number of feature maps (e.g., N64) are used for encoding, while image resize layers with a factor of $2$ (R2) and $3 \times 3$ convolutional layers with stride $1$ are used for decoding. Masked images are calculated by pixel-wise multiplication of a label map and (the multiple channels of) an input image. Note that, although only one label map (for whole tumor segmentation) is illustrated here, multiple label maps (e.g. also for tumor core and Gd-enhanced tumor core) can be generated by the segmentor in one path. }
\label{fig:architecture}
\end{figure*}
As illustrated in Figure~\ref{fig:architecture}, the proposed SegAN consists of two parts: the segmentor network $S$ and the critic network $C$.
The segmentor is a fully convolutional encoder-decoder network that generates a probability label map from input images.
The critic network is fed with two inputs: original images masked by ground truth label maps, and original images masked by predicted label maps from $S$.
The $S$ and $C$ networks are alternately trained in an adversarial fashion: the training of $S$ aims to minimize our proposed multi-scale $L_1$ loss, while the training of $C$ aims to maximize the same loss function.
\vspace{-8pt}
\subsection{The multi-scale $L_1$ loss}
The conventional GANs \cite{goodfellow2014generative} have an objective loss function defined as:
\begin{equation}
\begin{split}
\min_{\theta_G} &\max_{\theta_D} \mathcal{L}(\theta_G,\theta_D)\\
&= \mathbb{E}_{x\sim P_\mathrm{data}}[\log D(x)] + \mathbb{E}_{z\sim P_z}\log (1 - D(G(z)))] \enspace .
\end{split}
\end{equation}
In this objective function, $x$ is the real image from an unknown distribution $P_\mathrm{data}$, and $z$ is a random input for the generator, drawn from a probability distribution (such as Gaussion) $P_z$. $\theta_G$ and $\theta_D$ represent the parameters for the generator and discriminator in GAN, respectively.
In our proposed SegAN, given a dataset with $N$ training images $x_n$ and corresponding ground truth label maps $y_n$, the multi-scale objective loss function $\mathcal{L}$ is defined as:
\begin{equation}
\begin{split}
\min\limits_{\theta_S} &\max\limits_{\theta_C}\mathcal{L}(\theta_S,\theta_C) \\
&= \frac{1}{N}\sum_{n=1}^N
\ell_\mathrm{mae}(f_C(x_n \circ S(x_n)), f_C(x_n \circ y_n)) \enspace ,
\label{eq:SegGANloss}
\end{split}
\end{equation}
where $\ell_\mathrm{mae}$ is the Mean Absolute Error (MAE) or $L_1$ distance;
$x_n \circ S(x_n)$ is the input image masked by segmentor-predicted label map (i.e., pixel-wise multiplication of predicted\_label\_map and original\_image); $x_n \circ y_n$ is the input image masked by its ground truth label map (i.e., pixel-wise multiplication of ground\_truth\_label\_map and original\_image); and $f_C(x)$ represents the hierarchical features extracted from image $x$ by the critic network. More specifically, the $\ell_\mathrm{mae}$ function is defined as:
\begin{equation}
\ell_\mathrm{mae}(f_C({x}), f_C({x}^{\prime})) = \frac{1}{L}\sum_{i=1}^L ||f_C^i({x}) - f_C^i({x}^{\prime})||_{1} \enspace ,\label{eq:mae}
\end{equation}
where $L$ is the total number of layers (i.e. scales) in the critic network, and $f_C^i({x})$ is the extracted feature map of image ${x}$ at the $i$th layer of $C$.
\subsection{SegAN Architecture}
\textbf{Segmentor.} We use a fully convolutional encoder-decoder structure for the segmentor $S$ network.
We use the convolutional layer with kernel size $4 \times 4$ and stride $2$ for downsampling, and perform upsampling by image resize layer with a factor of $2$ and convolutional layer with kernel size $3 \times 3$ stride $1$.
We also follow the U-net and add skip connections between corresponding layers in the encoder and the decoder.
\noindent\textbf{Critic.}
The critic $C$ has the similar structure as the decoder in $S$.
Hierarchical features are extracted from multiple layers of $C$ and used to compute the multi-scale $L_1$ loss.
This loss can capture long- and short-range spatial relations between pixels by using these hierarchical features, i.e., pixel-level features, low-level (e.g. superpixels) features, and middle-level (e.g. patches) features.
More details including activation layers (e.g., leaky ReLU), batch normalization layer and the number of feature maps used in each convolutional layers can be found in Figure~\ref{fig:architecture}.
\subsection{Training SegAN}
The segmentor $S$ and critic $C$ in SegAN are trained by back-propagation from the proposed multi-scale $L_1$ loss. In an alternating fashion, we first fix $S$ and train $C$ for one step using gradients computed from the loss function, and then fix $C$ and train $S$ for one step using gradients computed from the same loss function passed to $S$ from $C$.
As shown in (\ref{eq:SegGANloss}), the training of $S$ and $C$ is like playing a min-max game: while $G$ aims to minimize the multi-scale feature loss, $C$ tries to maximize it. As training progresses, both the $S$ and $C$ networks become more and more powerful. And eventually, the segmentor will be able to produce predicted label maps that are very close to the ground truth as labeled by human experts. We also find that the $S$-predicted label maps are smoother and contain less noise than manually-obtained ground truth label maps.
We trained all networks using RMSProp solver with batch size $64$ and learning rate $0.00002$. We used a grid search method to select the best values for the number of up-sampling blocks and the number of down-sampling blocks for the segmentor (four, in both cases), and for the number of down-sampling blocks for the critic (three).
\vspace{-25pt}
\subsection{Proof of training stability and convergence}
\vspace{-10pt}
Having introduced the multi-scale $L_1$ loss, we next prove that our training is stable and finally reaches an equilibrium. First, we introduce some notations.
Let $f:\mathcal{X} \rightarrow \mathcal{X}^{\prime}$ be the mapping between an input medical image and its corresponding ground truth segmentation, where $\mathcal{X}$ represents the compact space of medical images\footnote[1]{Although the pixel value ranges of medical images can vary, one can always normalize them to a certain value range such as [0,1], so it is compact.} and $\mathcal{X}^{\prime}$ represents the compact space of ground truth segmentations. We approximate this ground truth mapping $f$ with a segmentor neural network $g_\theta : \mathcal{X} \rightarrow \mathcal{X}^{\prime}$ parameterized by vector $\theta$ which takes an input image, and generates a segmentation result. Assume the best approximation to the ground truth mapping by a neural network is the network $g_{\hat{\theta}}$ with optimal parameter vector $\hat{\theta}$.
Second, we introduce a lemma about the Lipschitz continuity of either the segmentor or the critic neural network in our framework.
\begin{lemma}\label{lem1}
Let $g_\theta$ be a neural network parameterized by $\theta$, and $x$ be some input in space $\mathcal{X}$, then $g_\theta$ is Lipschitz continuous with a bounded Lipschitz constants $K(\theta)$ such that
\begin{equation}||g_{\theta}(x_1) - g_{\theta}(x_2)||_1 \leqslant K(\theta)(||x_1 - x_2||_1) \enspace ,
\label{eq:lemma1_1}
\end{equation}
and for different parameters with same input we have
\begin{equation}
||g_{\theta_1}(x) - g_{\theta_2}(x)||_1 \leqslant K(x)||\theta_1 - \theta_2||_1
\enspace ,
\label{eq:lemma1_2}
\end{equation}
\end{lemma}
Now we prove Lemma~\ref{lem1}.
\begin{proof}
Note that the neural network consists of several affine transformations and pointwise nonlinear activation functions such as leaky ReLU (see Figure~\ref{fig:architecture}). All these functions are Lipschitz continuous because all their gradient magnitudes are within certain ranges. To prove Lemma~\ref{lem1}, it's equivalent to prove the gradient magnitudes of $g_\theta$ with respect to $x$ and $\theta$ are bounded. We start with a neural network with only one layer: $g_\theta(x) = A_1(W_1x)$ where $A_1$ and $W_1$ represent the activation and weight matrix in the first layer. We have $\nabla_{x}g_{\theta}(x) = W_1 D_1$ where $D_1$ is the diagonal Jacobian of the activation, and we have
$\nabla_{\theta} g_{\theta}(x) = D_1 x$ where $\theta$ represents the parameters in the first layer.
Then we consider the neural network with $L$ layers.
We apply the chain rule of the gradient and we have $\nabla_{x}g_{\theta}(x) = \prod_{k=1}^{L}W_k D_k$ where $k$ represent the $k$-th layer of the network. Then we have
\begin{equation}
\begin{split}
||\nabla_{x} g_{\theta}(x)||_1 = ||\prod_{k=1}^{L}W_k D_k||_1\enspace .
\end{split}
\end{equation}
Due to the fact that all parameters and inputs are bounded, we have proved (\ref{eq:lemma1_1}).
Let's denote the first $i$ layers of the neural network by $g^i$ (which is another neural network with less layers), we can compute the gradient with respect to the parameters in $i$-th layer as $\nabla_{\theta_i} g_{\theta}(x) = (\prod_{k=i+1}^{L}W_k D_k)D_ig^{i-1}(x)$. Then we sum parameters in all layers and get
\begin{equation}
\begin{split}
||\nabla_{\theta} g_{\theta}(x)||_1 &= ||\sum_{i=1}^{L}(\prod_{k=i+1}^{L}W_k D_k)D_ig^{i-1}(x)||_1\\
&\leqslant \sum_{i=1}^{L}||((\prod_{k=i+1}^{L}W_k D_k)D_i)g^{i-1}(x)||_1\enspace .
\end{split}
\end{equation}
Since we have proved that $g(x)$ is bounded, we finish the proof of (\ref{eq:lemma1_2}).
\end{proof}
Based on Lemma~\ref{lem1}, we then prove that our multi-scale loss is bounded and won't become arbitrarily large during the training, and it will finally converge.
\begin{theorem}
Let $\mathcal{L}_t(x)$ denote the multi-scale loss of our SegAN at training time $t$ for input image $x$, then there exists a small constant $C$ so that
\begin{equation}
\lim_{t\rightarrow + \infty} \mathbb{E}_{x \in \mathcal{X}} \mathcal{L}_t(x) \leqslant C\enspace .
\end{equation}
\label{thm:thm1}
\end{theorem}
\begin{proof}
Let $g$ and $d$ represent the segmentor and critic neural network, $\theta$ and $w$ be the parameter vector for the segmentor and critic, respectively. Without loss of generality, we omit the masked input for the critic and rephrase (\ref{eq:SegGANloss}) and (\ref{eq:mae}) as
\begin{equation}
\min_{\theta} \max_{w} \mathcal{L}_t = \mathbb{E}_{x \in \mathcal{X}} \frac{1}{L}\sum_{i=1}^L ||d^i(g_{\theta}({x})) - d^i(g_{\hat{\theta}}({x}))||_{1}\enspace ,
\label{eq9}
\end{equation}
recall that $g_{\hat{\theta}}$ is the ground truth segmentor network and $d^i$ is the critic network with only first $i$ layers. Let's firstly focus on the critic. To make sure our multi-scale loss won't become arbitrarily large, inspired by~\cite{arjovsky2017wasserstein}, we clamp the weights of our critic network to some certain range (e.g., $[-0.01,0.01]$ for all dimensions of parameter) every time we update the weights through gradient descent. That is to say, we have a compact parameter space $\mathcal{W}$ such that all functions in the critic network are in a parameterized family of functions $\{d_w\}_{w \in \mathcal{W}}$. From Lemma~\ref{lem1}, we know that $||d_{w}(x_1) - d_{w}(x_2)||_1 \leqslant K(w)(||x_1 - x_2||_1)$. Due to the fact that $\mathcal{W}$ is compact, we can find a maximum value for $K(w)$, $K$, and we have
\begin{equation}
||d(x_1) - d(x_2)||_1 \leqslant K||x_1 - x_2||_1\enspace .
\end{equation}
Note that this constant $K$ only depends on the space $\mathcal{W}$ and is irrelevant to individual weights, so it is true for any parameter vector $w$ after we fix the vector space $\mathcal{W}$. Since Lemma~\ref{lem1} applies for the critic network with any number of layers, we have
\begin{equation}
\frac{1}{L}\sum_{i=1}^L||d^i (g_{\theta}(x)) - d^i (g_{\hat{\theta}}(x))||_1 \leqslant K||g_{\theta}(x) - g_{\hat{\theta}}(x)||_1\enspace .
\label{eq11}
\end{equation}
Now let's move to the segmentor. According to Lemma~\ref{lem1}, we have $||g_{\theta}(x) - g_{\hat{\theta}}(x)||_1 \leqslant K(x)||\theta - \hat{\theta}||_1$, then combined with (\ref{eq11}) we have
\begin{equation}
\frac{1}{L}\sum_{i=1}^L||d^i (g_{\theta}(x)) - d^i (g_{\hat{\theta}}(x))||_1 \leqslant K(x)K||\theta - \hat{\theta}||_1\enspace .
\label{eq12}
\end{equation}
We know $\mathcal{X}$ is compact, so there's a maximal value for $K(x)$ and it only depends on the difference between the ground truth parameter vector $\hat{\theta}$ and the parameter vector of the segmentor $\theta$. Since we don't update weights in the segmentor when we update weights in the critic, there's an upper bound for $\mathcal{L}_t$ when we update the critic network and it won't be arbitrarily large during the min-max game.
When we update the parameters in the segmentor, we want to decrease the loss. This makes sense because smaller loss indicates smaller difference between $\hat{\theta}$ and $\theta$. When $\theta \rightarrow \hat{\theta}$, $\mathcal{L}_t$ converges to zero because the upper bound of $\mathcal{L}$ becomes zero. However, we may not be able to find the global optimum for $\theta$. Now let us denote a reachable local optimum for $\theta$ in the segmentor by $\theta_0$, we will keep updating parameters in the segmentor through gradient descent and gradually approaches $\theta_0$. Based on (\ref{eq9}) and (\ref{eq12}), we denote the maximum of $K(x)$ by $K^\prime$ and have
\begin{equation}
\lim_{t\rightarrow + \infty} \mathcal{L}_t(x) \leqslant K K^{\prime}||\hat{\theta} - \theta_0||_1 = C\enspace .
\end{equation}
Since the constant $C$ does not depend on input $x$, we have proved Theorem~\ref{thm:thm1}.
\end{proof}
\section{Experiments}
In this section, we evaluated our system on the fully-annotated MICCAI BRATS datasets~\cite{menze2015multimodal}. Specifically,
we trained and validated our models using the BRATS 2015 training dataset, which consists of $220$ high grade subjects and $54$ low grade subjects with four modalities: T1, T1c, T2 and Flair. We randomly split the BRATS 2015 training data with the ratio $9 : 1$ into a training set and a validation set. We did such split for the high grade and low grade subjects separately, and then re-combined the resulting sets for training and validation. Each subject in BRATS 2015 dataset is a 3D brain MRI volume with size $240 \times 240 \times 155$. We center cropped each subject into a subvolume of $180 \times 180 \times 128$, to remove the border black regions while still keep the entire brain regions. We did our final evaluation and comparison on the BRATS 2015 test set using the BRATS online evaluation system, which has \emph{Dice}, \emph{Precision} and \emph{Sensitivity} as the evaluation metrics. The Dice score is is identical to the F-score which normalizes the number of true positives to the average size of the two segmented regions:
\begin{equation}
\mathrm{Dice} = \frac{2|P \cap T|}{|P|+|T|}
\end{equation}
where $P$ and $T$ represent the predicted region and the ground truth region, respectively.
Since the BRATS 2013 dataset is a subset of BRATS 2015, we also present our results on BRATS 2013 leaderboard set.
Although some work with 3D patching CNNs have been done for medical image segmentation, due to the limitation of our hardware memory and for the reason that brain images in BRATS dataset are inconsistent in third dimension, we built a 2D SegAN network to generate the label map for each axial slice of a 3D volume and then restack these 2D label maps to produce the 3D label map for brain tumor. Since each subject was center cropped to be a $180 \times 180 \times 128$ volume, it yields 128 axial slices each with the size $180 \times 180$. These axial slices were further randomly cropped to size $160 \times 160$ during training for the purpose of data augmentation. They were centered cropped to size $160 \times 160$ during validation and testing.
We used three modalities of these MRI images: T1c, T2, FLAIR. Corresponding slices of T1c, T2, FLAIR modalities are concatenated along the channel dimension and used as the multi-channel input to our SegAN model, as shown in Figure~\ref{fig:architecture}.
The segmentor of SegAN outputs label maps with the same dimensions as the input images.
As required by the BRATS challenge~\cite{menze2015multimodal}, we did experiments with the objective to generate label maps for three types of tumor regions: \emph{whole tumor}, \emph{tumor core} and \emph{Gd-enhanced tumor core}.
\begin{figure}[!htbp]
\centering
\includegraphics[width=0.48\textwidth]{component_analysis.pdf
\caption{Average dice scores of different architectures on BRATS validation set}
\label{fig:component}
\end{figure}
\subsection{Choice of components in SegAN architecture}
In this section, we compare different implementations of the proposed SegAN architecture and also evaluate the effectiveness of the proposed multi-scale $L_1$ loss on the BRATS validation set for the brain tumor segmentation task.
Specifically, we compare the following implementations:
\begin{itemize}
\vspace{-6pt}
\item \textbf{S1-1C.} A separate SegAN is built for every label class, i.e. one segmentor (S1) and one critic (1C) per label.
\item \textbf{S3-1C:} A SegAN is built with one segmentor and one critic, but the segmentor generates a three-channel label map, one channel for each label. Therefore, each 3-channel label map produces three masked images (one for each class), which are then concatenated in the channel dimension and fed into the critic.
\item \textbf{S3-3C.} A SegAN is built with one segmentor that generates a three-channel (i.e. three-class) label map, but three separate critics, one for each label class. The networks, one $S$ and three $C$s, are then trained end-to-end using the average loss computed from all three $C$s.
\item \textbf{S3-3C single-scale loss models.} For comparison, we also built two single-scale loss models: S3-3C-s0 and S3-3C-s3. S3-3C-s0 computes the loss using features from only the input layers (i.e., layer $0$) of the critics, and S3-3C-s3 calculates the loss using features from only the output layers (i.e., layer $3$) of the critics.
\end{itemize}
As shown in Figure~\ref{fig:component}, models S1-1C and S3-3C give similar performance which is the best among all models. Since the computational cost for S1-1C is higher than S3-3C, S3-3C is more favorable and we use it to compare our SegAN model with other methods in Section \ref{sec:comparison}.
In contrast, while model S3-1C is the simplest requiring the least computational cost, it sacrifices some performance; but by using the multi-scale loss, it still performs better than any of the two single-scale loss models especially for segmenting tumor core and Gd-enhanced tumor core regions.
\begin{figure}
\includegraphics[width=0.48\textwidth]{examples}
\caption{Example results of our SegGAN (right) with corresponding T2 slices (left) and ground truth (middle) on BRATS validation set.}
\label{fig:examples}
\label{sec:comparison}
\end{figure}
\begin{table*}[!htbp]
\caption{Comparison to previous methods and a baseline implementation of U-net with softmax loss for segmenting three classes of brain tumor regions: whole, core and Gd-enhanced (Enha.)}
\label{tb:result}
\centering
\begin{tabular}{c|c|c|c|c|c|c|c|c|c|c}
\cline{1-11}
\multirow{2}{2cm}{}&\multirow{2}{*}{Methods} & \multicolumn{3}{|c}{Dice} &
\multicolumn{3}{|c}{Precision} & \multicolumn{3}{|c}{Sensitivity} \\
\cline{3-11}
& & Whole& Core & Enha. & Whole& Core & Enha. & Whole& Core & Enha.\\
\hline
\multirow{3}{1.8cm}{BRATS 2013 Leaderboard}
&Havaei~\cite{havaei2017brain} &
\textbf{0.84} &0.71 &0.57 &\textbf{0.88} &0.79 &0.54 &0.84 &0.72 &0.68 \\
\cline{2-11}
&Pereira~\cite{pereira2016brain} &
\textbf{0.84} &\textbf{0.72} &0.62 &0.85 &\textbf{0.82} &0.60 &\textbf{0.86} &\textbf{0.76} &0.68\\
\cline{2-11}
&\textbf{SegAN} &
\textbf{0.84} & 0.70 & \textbf{0.65} &0.87 &0.80 &\textbf{0.68} &0.83 & 0.74 &\textbf{0.72}\\
\hline
\hline
\multirow{3}{1.8cm}{BRATS 2015 Test} &Kamnitsas~\cite{kamnitsas2017efficient} &
\textbf{0.85} &0.67 &{0.63} &0.85 &\textbf{0.86} &0.63 &\textbf{0.88} &0.60 &\textbf{0.67}\\
\cline{2-11}
&U-net &
0.80 &0.63 &0.64 &0.83 &0.81 &\textbf{0.78} &0.80 &0.58 &0.60\\
\cline{2-11}
&\textbf{SegAN} &
\textbf{0.85} &\textbf{0.70} &\textbf{0.66} &\textbf{0.92} &0.80 &0.69 &0.80 &\textbf{0.65} &0.62\\
\hline
\end{tabular}
\end{table*}
\subsection{Comparison to state-of-the-art}
In this subsection, we compare the proposed method, our S3-3C SegAN model, with other state-of-the-art methods on the BRATS 2013 Leaderboard~\cite{havaei2017brain,pereira2016brain} Test and the BRATS 2015 Test~\cite{kamnitsas2017efficient}.
We also implemented a U-net model \cite{ronneberger2015u} for comparison. This U-net model has the exact same architecture as our SegAN segmentor except that the multi-scale SegAN loss is replaced with the softmax loss in the U-net. Table~\ref{tb:result} gives all comparison results. From the table, one can see that our SegAN compares favorably to the existing state-of-the-art on BRATS 2013 while achieves better performance on BRATS 2015.
Moreover, the dice scores of our SegAN outperform the U-net baseline for segmenting all three types of tumor regions. Another observation is that our SegAN-produced label maps are smooth with little noise. Figure~\ref{fig:examples} illustrates some example results of our SegAN; in the figure, the segmented regions of the three classes (whole tumor, tumor core, and Gd-enhanced tumor core) are shown in yellow, blue, and red, respectively. One possible reason behind this phenomenon is that the proposed multi-scale $L_1$ loss from our adversarial critic network encourages the segmentor to learn both global and local features that capture long- and short-range spatial relations between pixels, resulting fewer noises and smoother results.
\section{Discussion}
To the best of our knowledge, our proposed SegAN is the first GAN-inspired framework adapted specifically for the segmentation task that produces superior segmentation accuracy.
While conventional GANs have been successfully applied to many unsupervised learning tasks (e.g., image synthesis~\cite{zhang2016stackgan}) and semi-supervised classification~\cite{salimans2016improved}, there are very few works that apply adversarial learning to semantic segmentation. One such work that we found by Luc \emph{et al.}~\cite{luc2016semantic} used both the conventional adversarial loss of GAN and pixel-wise softmax loss against ground truth.
They showed small but consistent gains on both the Stanford Background dataset and the PASCAL VOC 2012 dataset; the authors observed that pre-training only the adversarial network was unstable and suggested an alternating scheme for updating the segmenting network’s and the adversarial network’s weights.
We believe that the main reason contributing to the unstable training of their framework is: the conventional adversarial loss is based on a single scalar output by the discriminator that classifies a whole input image into real or fake category.
When inputs to the discriminator are generated \emph{vs.} ground truth dense pixel-wise label maps as in the segmentation task, the real/fake classification task is too easy for the discriminator and a trivial solution is found quickly. As a result, no sufficient gradients can flow through the discriminator to improve the training of generator.
In comparison, our SegAN uses a multi-scale feature loss that measures the difference between generated segmentation and ground truth segmentation at multiple layers in the critic, forcing both the segmentor and critic to learn hierarchical features that capture long- and short-range spatial relationships between pixels. Using the same loss function for both $S$ and $C$, the training of SegAN is end-to-end and stable.
\section{Conclusions}
In this paper, we propose a novel end-to-end Adversarial Network architecture, namely SegAN, with a new multi-scale loss for semantic segmentation. Experimental evaluation on the BRATS brain tumor segmentation dataset shows that the proposed multi-scale loss in an adversarial training framework is very effective and leads to more superior performance when compared with single-scale loss or the conventional pixel-wise softmax loss.
As a general framework, our SegAN is not limited to medical image segmentation applications. In our future work, we plan to investigate the potential of SegAN for general semantic segmentation tasks.
\section{Acknowledgements}
This research was supported in part by the Intramural Research Program of the National Institutes of Health (NIH), National Library of Medicine (NLM), and Lister Hill National Center for Biomedical Communications (LHNCBC), under Contract HHSN276201500692P.
\bibliographystyle{spbasic} | {'timestamp': '2017-07-18T02:05:30', 'yymm': '1706', 'arxiv_id': '1706.01805', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01805'} | arxiv |
\section{Introduction}
\label{sec:intro}
\input{text-16p/intro}
\section{Problem Formulation}
\label{sec:pf}
\input{text-16p/pf2}
\section{Concurrent Estimation and Sensor Planning}
\label{sec:sol}
\input{text-16p/sol2}
\section{Main Results}
\label{sec:assume}
\input{text-16p/assume2}
\section{Convergence of Algorithm~\ref{alg:filter+opt}}
\label{sec:converge}
\input{text-16p/converge2}
\section{Numerical Experiments}
\label{sec:sims}
\input{text-16p/sims2}
\section{Conclusion}
\label{sec:conc}
\input{text-16p/conc}
\appendices
\section{Proof of Lemmas~\ref{lem:summable_constraints}~and~\ref{lem:summable_grads}}
\label{app:summability}
\input{text-16p/proofs1-2}
\section{Proof of Lemmas~\ref{lem:basic}-\ref{lem:disagree}}
\label{app:lemmaproofs2}
\input{text-16p/proofs2}
\bibliographystyle{IEEEtran}
\subsection{Bounds}
The norms of $\nu_{s,k}$ and $\boldsymbol{\delta}_{s,k}$ are bounded, i.e., for some scalars $D, N > 0$, there holds for all $k \in \mbN$ and $s \in \ccalS$ \textit{a.s.}:
$
|\nu_{s,k}|\le N$ and $\|\boldsymbol{\delta}_{s,k}\| \le D.
$
We calculate the exact values of $D$ and $N$ in Corollaries~\ref{cor:N} and \ref{cor:D}, respectively.
The set $\ccalX_0 = \Gamma \times \ccalU$ is convex and compact.
Therefore, there must exist a constant $C_{\mathbf{z}} > 0$ such that for any $\mathbf{z}_1, \mathbf{z}_2 \in \mathcal{X}_0$
\begin{equation}\label{eqn:C_z}
\|\mathbf{z}_1 -\mathbf{z}_2\| \le C_{\mathbf{z}}.
\end{equation}
Also, note that the functions $f(\cdot)$ and $h(\mathbf{z};\ccalD,i)$ for $i \in \ccalI$ are convex (not necessarily differentiable) over some open set that contains $\mathcal{X}_0$.
A direct consequence of this and the compactness of $\mathcal{X}_0$ is that the subdifferentials $\partial f (\mathbf{z})$
and $\partial h_+ (\mathbf{z};\ccalD,i)$ are nonempty over $\mathcal{X}_0$,
where note that here we use the symbol $\partial$ to refer to the subdifferential set and not a partial derivative.
It also implies that
the subgradients $f'(\mathbf{z}) \in \partial f (\mathbf{z})$ and $h_+'(\mathbf{z};\ccalD,i) \in \partial h_+ (\mathbf{z};\ccalD,i)$ are uniformly bounded over the set $\mathcal{X}_0$. That is, there is a scalar $L_f$ such that for all $f'(\mathbf{z}) \in \partial f (\mathbf{z})$ and $\mathbf{z}\in \mathcal{X}_0$,
\begin{subequations}
\begin{equation}\label{eqn:L_f1}
\|f'(\mathbf{z})\| \le L_f,
\end{equation}
and for any $\mathbf{z}_1, \mathbf{z}_2 \in \mathcal{X}_0$,
\begin{equation}\label{eqn:L_f2}
|f(\mathbf{z}_1)-f(\mathbf{z}_2)| \le L_f \|\mathbf{z}_1-\mathbf{z}_2\|.
\end{equation}
\end{subequations}
Note that for the objective function $f$ in \eqref{eq:distributed}, we have $L_f = 1.$
Also, there is a scalar $L_h$ such that for all $h_+'(\mathbf{z};\ccalD,i)\in \partial h_+ (\mathbf{z};\ccalD,i)$, $\mathbf{z} \in \mathcal{X}_0$, $i \in \ccalI$,
\begin{equation}\label{e:Lh}
\|h_+'(\mathbf{z};\ccalD,i)\| \le L_h.
\end{equation}
We calculate the exact value of $L_h$ in Corollary~\ref{cor:D}.
\begin{comment}
Similarly, we know the function $h(\mathbf{z};\ccalD,i)$, for each $i \in \ccalI$, is defined and convex in $\mathbf{z}$ (not necessarily differentiable) over some open set that contains $\mathcal{X}_0$.
A direct consequence is that the subdifferentials $\partial h_+ (\mathbf{z};\ccalD,i)$ are nonempty over $\mathcal{X}_0$. It also implies that
the subgradients $h_+'(\mathbf{z};\ccalD,i) \in \partial h_+ (\mathbf{z};\ccalD,i)$ are uniformly bounded over the set $\mathcal{X}_0$. That is, there is a scalar $L_h$ such that for all $h_+'(\mathbf{z};\ccalD,i)\in \partial h_+ (\mathbf{z};\ccalD,i)$, $\mathbf{z} \in \mathcal{X}_0$, $i \in \ccalI$,
\[
\|h_+'(\mathbf{z};\ccalD,i)\| \le L_h.
\]
We calculate the exact value of $L_h$ in Corollary~\ref{cor:D}.
\end{comment}
From relation \eqref{eq:differror} we have for any $i\in \ccalI$, $s \in \ccalS$, $k \in \mbN$, and $\mathbf{z}\in \mathcal{X}_0$
\begin{subequations}
\begin{equation}\label{eqn:L_h1}
\|h_+'(\mathbf{z};\ccalD_{s,k},i)\| = \|h_+'(\mathbf{z};\ccalD,i) + \bbdelta_{s,k}\|\le L_h +D,
\end{equation}
and for any $\mathbf{z}_1, \mathbf{z}_2 \in \mathcal{X}_0$
\begin{equation}\label{eqn:L_h2}
|h_+(\mathbf{z}_1;\ccalD_{s,k},i) \! - \! h_+(\mathbf{z}_2;\ccalD_{s,k},i)| \le (L_h+D) \|\mathbf{z}_1 \! - \! \mathbf{z}_2\|.
\end{equation}
\end{subequations}
The compactness of $\mathcal{X}_0$, the boundedness of the data sequences $\ccalD_{s,k}$, and the continuity of the functions $h_+(\mathbf{z};\ccalD,i)$ for $i \in \ccalI$ imply that there exist constants $C_h >0$ such that for any $s \in \ccalS$, $k \in \mbN$, $i \in \ccalI$ and $\mathbf{z} \in \mathcal{X}_0$
\begin{subequations}
\begin{equation}\label{eqn:C_h1}
|h_+(\mathbf{z};\ccalD,i)| \le C_h,
\end{equation}
\begin{equation}\label{eqn:C_h2}
|h_+(\mathbf{z};\ccalD_{s,k},i)| = |h_+(\mathbf{z};\ccalD,i)+\nu_{s,k}| \le C_h+N,
\end{equation}
\end{subequations}
where the second relation follows from \eqref{eq:constrainterror}.
Furthermore, when $h_+(\mathbf{z};\ccalD_{s,k},i) \neq 0$, we have $h_+'(\mathbf{z};\ccalD_{s,k},i) \neq \bb0$. Therefore, there must exist a constant $c_h >0$ such that
\begin{align}\label{eqn:dhbnd}
\|h_+'(\mathbf{z};\ccalD_{s,k},i)\| \ge c_h
\end{align}
for all $\mathbf{z} \in \mathcal{X}_0$, $s \in \ccalS$, $k \in \mbN$, and $i \in \ccalI$.
This and relation (\ref{eqn:C_h2}) imply that
\begin{align}\label{eqn:betabnd}
\beta_{s,k} = \frac{h_+(\mathbf{z};\ccalD_{s,k},\omega_{s,k})}{\|h'_+(\mathbf{z};\ccalD_{s,k},\omega_{s,k})\|^2} \le \frac{C_h+N}{c_h^2}.
\end{align}
Note that when $h_+(\mathbf{z};\ccalD_{s,k},\omega_{s,k}) = 0$, the above bound holds trivially.
\subsection{Assumptions}
In the preceding sections, we have made extensive use of the function $Q\colon \reals^q \times \reals^p \to {\rm Sym}_{+}(p,\reals).$
For our algorithm to converge, we require the following to hold true regarding this information model.
\begin{assumption}
\label{assume:Q}
We assume that the information function $Q$
\begin{enumerate}[(a)]
\item is bounded,\label{a:bd}
\item is twice subdifferentiable\label{a:sub}
\item has bounded subdifferentials up to the second order, and\label{a:bd_sub}
\item has relatively few critical points, i.e., the sets of critical points of $Q$ and its partial derivatives up to the second order are measure zero. \label{a:crit}
\end{enumerate}
Denote the bound on the magnitude of $Q$ by $\eta_0$, the bound on its first derivatives by $\eta_1$, and the bound on its second derivatives by $\eta_2.$
\end{assumption}
The technical restrictions on the information model $Q$ are not overly restrictive in practice.
In particular, items~\ref{a:bd}, \ref{a:sub}, and \ref{a:bd_sub} imply that one cannot obtain infinite information and that, by changing sensor configuration, the information rate (and the rate of change of the rate) cannot change infinitely quickly.
Item~\ref{a:crit} essentially allows us to distinguish between sensor configurations, i.e., the set of configurations that offer ``optimal'' information rates are relatively sparse with respect to the space of signal source positions and sensor configurations $\reals^q \times \reals^p.$
The next two assumptions are related to the random variables $\omega_{s,k}$.
At each iteration $k$ of the inner-loop, recall that each sensor $s$ randomly generates $\omega_{s,k} \in \ccalI$. We assume that they are \textit{i.i.d.} samples from some probability distribution on $\ccalI$.
\begin{assumption}\label{assume:Pr}
In the $k$-th iteration of the inner-loop,
each element $i$ of $\ccalI$ is generated with nonzero probability,
i.e., for any $s \in \ccalS$ and $k \in \mbN$ it holds that
$
\pi_i \triangleq \textrm{Pr}\{ \omega_{s,k} = i\} > 0.
$
\end{assumption}
Assumption~\ref{assume:Pr} is easy to satisfy because $\ccalI$ is a finite set.
\begin{assumption}\label{assume:c}
For all $s \in \ccalS$ and $k \in \mbN$,
there exists a constant $\kappa> 0$ such that for all $\mathbf{z} \in \mathcal{X}_0$
$
\mathrm{dist}^2 (\mathbf{z},\mathcal{X}) \le \kappa \mathsf{E}\left[h_+^2(\mathbf{z};\ccalD_{s,k},\omega_{s,k})\right].
$
\end{assumption}
\noindent The upper bound in Assumption \ref{assume:c} is known as \textit{global error bound} and is crucial for the convergence analysis of Algorithm \ref{alg:filter+opt}.
Sufficient conditions for this bound have been shown in \cite{pang-book,Lewis96errorbounds,Bauschke:1996,Gubin19671}, which includes the case when each function $h(\cdot;\cdot,i)$ is linear in $\bbz$,
or when the feasible set $\mathcal{X}$ has a nonempty interior.
\begin{assumption}\label{assume:network}
For all $k \in \mbN$, the weighted graphs $\mathcal{G}_k = (\ccalS,\mathcal{E}_k,W_k)$ satisfy:
\begin{enumerate}[(a)]
\item There exists a scalar $\eta \in (0,1)$ such that $[W_k]_{sj} \ge \eta$ if $j \in \mathcal{N}_{s,k}$. Otherwise, $[W_k]_{sj} = 0$.
\item The weight matrix $W_k$ is doubly stochastic, i.e., $\sum_{s\in\ccalS}[W_k]_{sj}=1$ for all $j \in \ccalS$ and $\sum_{j\in\ccalS}[W_k]_{sj}=1$ for all $s \in \ccalS$.
\item There exists a scalar $Q > 0$ such that the graph $\left(\ccalS,\cup_{\ell=0,\ldots,Q-1} \mathcal{E}_{t+\ell}\right)$ is strongly connected for any $t \ge 1$.
\end{enumerate}
\end{assumption}
\noindent This assumption ensures a balanced communication between sensors. It also ensures that there exists a path from one sensor to every other sensor infinitely often even if the underlying graph topology is time-varying.
\subsection{Main result}
Our main result shows the almost sure convergence of Algorithm~\ref{alg:filter+opt}.
Specifically, the result states that the sensors asymptotically reach an agreement to a random point $\bbz^*$ which is in the optimal set $\ccalX^*$ almost surely (a.s.), as given in the following theorem.
\begin{theorem}[Asymptotic Convergence Under Noise]
\label{prop:main}
Let Assumptions
\ref{assume:Q} - \ref{assume:network}
hold.
Let also the stepsizes be such that $\sum_{k=1}^{\infty} \alpha_k = \infty$ and $\sum_{k=1}^{\infty} \alpha_k^2 < \infty$.
Then, the iterates $\{\bbz_{s,k}\}$ generated by each agent $s \in \ccalS$ via Algorithm~\ref{alg:filter+opt}
converge almost surely to the same point in the optimal set $\ccalX^*$, i.e., for a random point $\bbz^*\in \ccalX^*$
$
\lim_{k\to\infty} \bbz_{s,k} = \bbz^*, \quad \forall s \in \ccalS \quad a.s.
$
\end{theorem}
\subsection{Preliminary Results}
\begin{lemma}[Non-expansiveness \cite{BNO}]
\label{lem:proj}
Let $\mathcal{X} \subseteq \mathbb{R}^d$ be a nonempty closed convex set.
The function $\mathsf{\Pi}_{\mathcal{X}}: \mathbb{R}^d \rightarrow \mathcal{X}$ is nonexpansive, i.e.,
$
\|\mathsf{\Pi}_{\mathcal{X}}[\bba]-\mathsf{\Pi}_{\mathcal{X}}[\bbb]\| \leq \|\bba - \bbb\|
$
for all
$
\bba , \bbb \in \mathbb{R}^d.
$
\end{lemma}
\begin{lemma}[\!\!{\cite[Lemma 10-11, p. 49-50]{polyak}}]
\label{thm:super}
Let
$
\mathcal{F}_k \triangleq \set{v_\ell, u_\ell, a_\ell, b_\ell}_{\ell=0}^k
$
denote a collection of nonnegative real random variables for $k \in \mbN \cup \set{\infty}$ such that
$
\mathsf{E}[v_{k+1}|\mathcal{F}_k] \leq (1+a_k)v_k - u_k + b_k
$
for all
$
k \in \set{0}\cup \mbN \quad a.s.
$
Assume further that
$
\set{a_k}
$
and
$
\set{b_k}
$
are \textit{a.s.} summable.
Then, we have \textit{a.s.} that (i)
$
\set{u_k}
$
is summable and (ii) there exists a nonnegative random variable
$
v
$
such that
$
\set{v_k} \to v.
$
\end{lemma}
In the next lemma, we relate the two iterates $\mathbf{p}_{s,k}$ and $\mathbf{z}_{s,k}$ in Line \ref{line:p} and \ref{line:z} of Algorithm \ref{alg:filter+opt}.
In particular, we show a relation of $\mathbf{p}_{s,k}$ and $\mathbf{z}_{s,k-1}$
associated with any convex function $g$
which will be often used in the analysis. For example, $g(\mathbf{z}) = \|\mathbf{z}-\mathbf{a}\|^2$ for some $\mathbf{a}\in\mathbb{R}^n$ or
$g(\mathbf{z}) = \mathrm{dist}^2 (\mathbf{z},\mathcal{X})$.
\begin{lemma}[Convexity and Double Stochasticity]
\label{lem:ds}
For any convex function $g : \mathbb{R}^n \to \mathbb{R}$, we have
\[
\sum\nolimits_{s\in \ccalS} g(\mathbf{p}_{s,k}) \le \sum\nolimits_{s\in \ccalS} g(\mathbf{z}_{s,k-1})
\]
\end{lemma}
\begin{proof}
The double stochasticity of the weights plays a crucial role in this lemma. From the definition of $\mathbf{p}_{s,k}$ in Line \ref{line:p} of Algorithm \ref{alg:filter+opt}, we obtain
\begin{align*}
\sum_{s\in \ccalS} g(\mathbf{p}_{s,k}) \le~& \sum_{s\in \ccalS} \sum_{j\in \ccalS} [W_k]_{sj} g(\mathbf{z}_{j,k-1})\\
=~& \sum_{j\in \ccalS} \left(\sum_{s\in \ccalS} [W_k]_{sj}\right)g(\mathbf{z}_{j,k-1})= \sum_{j\in \ccalS} g(\mathbf{z}_{j,k-1}).
\end{align*}
\end{proof}
\begin{comment}
\begin{proof}
The doubly stochasticity of the weights plays a crucial role in this lemma. From the definition of $p_{i,k}$ in (\ref{eqn:algo1}),
\begin{align*}
\sum_{i\in \mathcal{V}} h(p_{i,k}) \le~& \sum_{i\in \mathcal{V}} \sum_{j\in \mathcal{V}} [W_k]_{ij} h(x_{j,k-1})\\
=~& \sum_{j\in \mathcal{V}} \left(\sum_{i\in \mathcal{V}} [W_k]_{ij}\right)h(x_{j,k-1})\\
=~& \sum_{j\in \mathcal{V}} h(x_{j,k-1}). \quad \square
\end{align*}
\end{proof}
\end{comment}
Lastly, for the convergence proof of our algorithm, we use a result from \cite{Ram2012}, which ensures successful consensus in the presence of a well behaved disturbance sequence.
\begin{lemma}[Perturbed Consensus]
\label{lemma:ram}
Let Assumption \ref{assume:network} hold.
Consider the iterates generated by
\begin{equation}\label{eqn:rule}
\boldsymbol{\theta}_{s,k} \hspace{-0.5mm}= \hspace{-0.5mm}\sum_{v\in\ccalS} [W_k]_{sv} \boldsymbol{\theta}_{v,k-1} + \mathbf{e}_{s,k},~ \forall s \in \ccalS,
\end{equation}
Suppose there exists a nonnegative nonincreasing scalar sequence $\{\alpha_k\}$ such that
$
\sum_{k=1}^{\infty} \alpha_k \|\mathbf{e}_{s,k}\|< \infty \text{ for all } s \in \ccalS.
$
Then, for all $s,v \in \ccalS$,
$
\sum_{k=1}^{\infty} \alpha_k \|\boldsymbol{\theta}_{s,k} -\boldsymbol{\theta}_{v,k}\| < \infty.
$
\end{lemma}
In addition to the well-known results of Lemmas~\ref{lem:proj}-\ref{lemma:ram}, we need the following intermediate results before the main result in Theorem~\ref{prop:main} can be proven.
The proofs of all of these Lemmas are deferred to Appendices~\ref{app:summability} and \ref{app:lemmaproofs2}.
In the first two of them, we posit that the two error sequences $\{\nu_{s,k}\}$
and $\{\bbdelta_{s,k}\}$ are summable.
\begin{lemma}[Summable Constraint Errors]
\label{lem:summable_constraints}
For almost every bounded sequence $\set{\bbz_{s,k}},$
the error in the constraint $\{|\nu_{s,k}|\}_{k \in \mbN}$ is summable a.s., i.e.,
$
\sum_{k=0}^\infty \abs{\nu_{s,k} }<\infty.
$
\end{lemma}
\begin{lemma}[Summable Constraint Violation Errors]
\label{lem:summable_grads}
For almost every bounded sequence $\set{\bbz_{s,k}},$
the error in the gradient of the constraint $\{\|\bbdelta_{s,k}\|\}_{k \in \mbN}$ is summable a.s., i.e.,
$
\sum_{k=0}^\infty \norm{\bbdelta_{s,k} }<\infty.
$
\end{lemma}
In the next lemma, we relate the two iterates $\mathbf{p}_{s,k}$ and $\mathbf{z}_{s,k}$ in Line \ref{line:p} and \ref{line:z} of Algorithm \ref{alg:filter+opt}.
\begin{lemma}[Basic Iterate Relation]
\label{lem:basic}
Consider the sequences $\{\mathbf{z}_{s,k}\}_{k =0}^\infty$ and $\{\mathbf{p}_{s,k}\}_{k =0}^\infty$ for $s \in \ccalS$ generated by Algorithm \ref{alg:filter+opt}. Then, for any $\mathbf{z},\check{\mathbf{z}} \in \mathcal{X}$, $s \in \ccalS$ and $k \in \mbN$, we have \textit{a.s.}:
\begin{align*}
&\|\mathbf{z}_{s,k}-\mathbf{z}\|^2
\le \|\mathbf{p}_{s,k}-\mathbf{z}\|^2 - 2\alpha_k(f(\check{\mathbf{z}})-f(\mathbf{z}))\\
&~+ 2\frac{C_{\mathbf{z}}(C_h+N)}{c_h^2}\|\boldsymbol{\delta}_{s,k}\| +2\frac{C_h+N}{c_h^2}|\nu_{s,k}|\\
&~ + \frac{1}{4\eta}\|\mathbf{p}_{s,k} - \check{\mathbf{z}}\|^2 -\frac{\tau-1}{\tau(L_h+D)^2}h_+^2(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\\
&~ + A_{\eta,\tau}\alpha_k^2L_f^2,
\end{align*}
where $A_{\eta,\tau} = 1+4\eta+\tau$ and $\eta,\tau>0$ are arbitrary.
\end{lemma}
Since we use a random approximate projection, we cannot guarantee the feasibility of the sequences $\mathbf{p}_{s,k}$ and $\mathbf{z}_{s,k}$ for every $k \in \mbN$ and $s \in \ccalS$. In the next lemma, we prove that $\mathbf{p}_{s,k}$ for all $s \in \ccalS$ asymptotically achieve feasibility even under the effect of the disturbances $\{\nu_{s,k}\}$
and $\{\bbdelta_{s,k}\}$.
\begin{lemma}[Asymptotic Feasibility Under Noise]
\label{lem:feas}
Let Assumption
\ref{assume:Pr} and
\ref{assume:c} hold.
Let $\alpha_k$ be square summable Consider the sequences $\{\mathbf{p}_{s,k}\}$ for $s \in \ccalS$ generated by Algorithm \ref{alg:filter+opt}.
Then, for any $s \in \ccalS$, the sequence
$
\set{ \mathrm{dist}(\mathbf{p}_{s,k},\mathcal{X}) }_{k \in \mbN}
$
is \textit{a.s.} square summable.
\end{lemma}
In the final Lemma, we show that $\|\mathbf{z}_{s,k}-\mathbf{p}_{s,k}\|$ eventually converges to zero for all $s \in \ccalS$.
This result combined with Lemma \ref{lem:feas} implies that the sequences $\set{ \mathbf{z}_{s,k} }_{k \in \mbN} $ also achieve asymptotic feasibility.
\begin{lemma}[Network Disagreement Under Noise]
\label{lem:disagree}
Let Assumptions
\ref{assume:Pr}-\ref{assume:network} hold. Let the sequence
$\{\alpha_k\}$ is such that $\sum_{k=1}^\infty \alpha_k^2<\infty$.
Define
$\mathbf{e}_{s,k}=\mathbf{z}_{s,k}-\mathbf{p}_{s,k}$ for all $s\in \ccalS$ and $k\ge 1$.
Then, we have \textit{a.s.}:
\begin{enumerate}[(a)]
\item
$\sum_{k=1}^\infty \|\mathbf{e}_{s,k}\|^2 <\infty \quad \text{for all } s \in \ccalS$,
\item
$\sum_{k=1}^\infty\alpha_k\|\check{\mathbf{z}}_{s,k}-\bar {\check{\mathbf{z}}}_k\|<\infty \quad \hbox{for all $s \in \ccalS$}$,
\end{enumerate}
where $\check{\mathbf{z}}_{s,k} = \mathsf{\Pi}_{\mathcal{X}}[\mathbf{p}_{s,k}]$ and $\bar {\check{\mathbf{z}}}_k = \frac{1}{n}\sum_{s \in \ccalS}\check{\mathbf{z}}_{s,k}$.
\end{lemma}
Note that the sequences $\{\mathbf{z}_{s,k}\}_{k \in \mbN}$ for $s \in \ccalS$ generated by Algorithm \ref{alg:filter+opt} can be
represented as relation \eqref{eqn:rule}. That is,
$
\mathbf{z}_{s,k}= \sum_{s\in\ccalS} [W_k]_{sj} \mathbf{z}_{j,k-1} + \mathbf{e}_{s,k}
$
for all $s \in \ccalS$
and $\mathbf{e}_{s,k} = \mathbf{z}_{s,k}-\mathbf{p}_{s,k}$.
Therefore, from Lemma \ref{lem:disagree}(a), we have
$
\sum_{k=1}^\infty \alpha_k\|\mathbf{e}_{s,k}\| = \frac{1}{2}\sum_{k=1}^\infty \alpha_k^2 + \frac{1}{2}\sum_{k=1}^\infty \|\mathbf{e}_{s,k}\|^2<\infty.
$
Invoking Lemma \ref{lemma:ram}, we see that there is consensus among $\mathbf{z}_{s,k}$ for $s \in \ccalS$.
\subsection{Proof of Theorem~\ref{prop:main}}
We invoke Lemma \ref{lem:basic} with $\check{\mathbf{z}} = \check{\mathbf{z}}_{s,k}$ (Note that $\check{\mathbf{z}}_{s,k}$ is defined as $\mathsf{\Pi}_{\mathcal{X}}[\mathbf{p}_{s,k}]$ in Lemma \ref{lem:disagree}), $\tau = 4$ and $\eta = \kappa(L_h+D)^2$.
We also let
$\mathbf{z} = \mathbf{z}^*$ for an arbitrary $\mathbf{z}^* \in \mathcal{X}^*$. Therefore, for any $\mathbf{z}^* \in \mathcal{X}^*$, $s \in \ccalS$ and $k \in \mbN$, we have \textit{a.s.}:
\begin{align}\label{eqn:pr1}
&\|\mathbf{z}_{s,k}-\mathbf{z}^*\|^2
\le \|\mathbf{p}_{s,k}-\mathbf{z}^*\|^2 - 2\alpha_k(f(\check{\mathbf{z}}_{s,k})-f(\mathbf{z}^*))\nonumber\\
&~+ 2\frac{C_{\mathbf{z}}(C_h+N)}{c_h^2}\|\boldsymbol{\delta}_{s,k}\| +2\frac{C_h+N}{c_h^2}|\nu_{s,k}|\nonumber\\
&~ + \frac{1}{4\kappa(L_h+D)^2}\mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X})+A\alpha_k^2L_f^2\nonumber\\
&~-\frac{3}{4(L_h+D)^2}h^2_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k}),
\end{align}
where $A = 5+4\kappa(L_h+D)^2$. From Assumption \ref{assume:c}, we know that
$
\mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X}) \le \kappa \mathsf{E}\left[h^2_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\mid \mathcal{F}_{k-1}\right].
$
Denote by $\mathcal{F}_k$ the sigma-field induced by the history of the algorithm up to time $k$, i.e.,
$
\mathcal{F}_k = \{\mathbf{z}_{s,0},~(\omega_{s,\ell},~ 1 \le \ell \le k),~ s\in \ccalS\} \quad \text{for } k \in \mbN,
$
and $\mathcal{F}_0 = \{\mathbf{z}_{s,0},~ s\in \ccalS\}$.
Taking the expectation conditioned on $\mathcal{F}_{k-1}$ in relation (\ref{eqn:pr1}), summing this over $s \in \ccalS$, and using the above relation, we obtain
\begin{align}\label{eqn:pr2}
&\sum_{s\in\ccalS}\mathsf{E}\left[\|\mathbf{z}_{s,k}-\mathbf{z}^*\|^2\mid \mathcal{F}_{k-1}\right]\\
&~\le \sum_{s\in\ccalS}\|\mathbf{z}_{s,k-1}-\mathbf{z}^*\|^2 - 2\alpha_k\sum_{s\in \ccalS}(f(\check{\mathbf{z}}_{s,k})-f(\mathbf{z}^*))\nonumber\\
&~~+ 2\frac{C_{\mathbf{z}}(C_h+N)}{c_h^2}\sum_{s\in\ccalS}\mathsf{E}[\|\boldsymbol{\delta}_{s,k}\|\mid \mathcal{F}_{k-1}] \nonumber\\ &~~+2\frac{C_h+N}{c_h^2}\sum_{s\in\ccalS}\mathsf{E}[|\nu_{s,k}|\mid \mathcal{F}_{k-1}]\nonumber\\
&~ -\frac{1}{2\kappa_2(L_h+D)^2}\sum_{s\in\ccalS}\mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X}) + A\alpha_k^2nL_f^2,\nonumber
\end{align}
where we used Lemma \ref{lem:ds} for the first term on the right-hand side.
Recall that $f(\mathbf{z})=\sum_{s\in\ccalS} f(\mathbf{z})$ and $\bar{\check{\mathbf{z}}}_k \triangleq \frac{1}{n}\sum_{\ell \in \ccalS} \check{\mathbf{z}}_{\ell,k}$.
Using $\bar{\check{\mathbf{z}}}_k$ and $f$,
we can rewrite the term $\sum_{s\in\ccalS}(f(\check{\mathbf{z}}_{s,k})-f(\mathbf{z}^*))$ as follows:
\begin{subequations}
\begin{align}
\sum_{s\in\ccalS} &(f(\check{\mathbf{z}}_{s,k})-f(\mathbf{z}^*)) \nonumber\\
&~= \sum_{s\in\ccalS} (f(\check{\mathbf{z}}_{s,k})-f(\bar{\check{\mathbf{z}}}_k)) + (f(\bar{\check{\mathbf{z}}}_k)-f^*)\label{eqn:rewrite1}\\
&~\le \sum_{s\in\ccalS} \langle f'(\bar{\check{\mathbf{z}}}_k),\bar{\check{\mathbf{z}}}_k-\check{\mathbf{z}}_{s,k}\rangle+ (f(\bar{\check{\mathbf{z}}}_k)-f^*)\label{eqn:rewrite2}\\
&~ \le \sum_{s\in\ccalS} \|f'(\bar{\check{\mathbf{z}}}_k)\|\,\|\check{\mathbf{z}}_{s,k}-\bar{\check{\mathbf{z}}}_k\|+ (f(\bar{\check{\mathbf{z}}}_k)-f^*)\label{eqn:rewrite3}\\
&~ \le L_f\sum_{s\in\ccalS} \|\check{\mathbf{z}}_{s,k}-\bar{\check{\mathbf{z}}}_k\|+ (f(\bar{\check{\mathbf{z}}}_k)-f^*),\label{eqn:rewrite4}
\end{align}
\end{subequations}
where (\ref{eqn:rewrite1}) follows from adding and subtracting $f(\bar{\check{\mathbf{z}}}_k)$;
(\ref{eqn:rewrite2}) follows from the convexity of the function $f$;
(\ref{eqn:rewrite3}) follows from the Schwarz inequality;
and (\ref{eqn:rewrite4}) follows from relation \eqref{eqn:L_f1} and $\bar{\check{\mathbf{z}}}_k \in \mathcal{X} \subseteq \mathcal{X}_0$.
Combining (\ref{eqn:rewrite4}) with (\ref{eqn:pr2}), we obtain
\begin{align*}
&\sum_{s\in\ccalS}\mathsf{E}\left[\|\mathbf{z}_{s,k}-\mathbf{z}^*\|^2\mid \mathcal{F}_{k-1}\right]\\
&~\le \sum_{s\in\ccalS}\|\mathbf{z}_{s,k-1}-\mathbf{z}^*\|^2 - 2\alpha_k(f(\bar{\check{\mathbf{z}}}_k)-f^*)\\
&~~+ 2\frac{C_{\mathbf{z}}(C_h+N)}{c_h^2}\sum_{s\in\ccalS}\mathsf{E}[\|\boldsymbol{\delta}_{s,k}\|\mid \mathcal{F}_{k-1}] \\ &~~+2\frac{C_h+N}{c_h^2}\sum_{s\in\ccalS}\mathsf{E}[|\nu_{s,k}|\mid \mathcal{F}_{k-1}]\\
&~~ +L_f\sum_{s\in\ccalS} \alpha_k \|\check{\mathbf{z}}_{s,k}-\bar{\check{\mathbf{z}}}_k\| + A\alpha_k^2nL_f^2,
\end{align*}
where we omitted the negative term.
Since $\bar{\check{\mathbf{z}}}_k \in \mathcal{X}$, we have $f(\bar{\check{\mathbf{z}}}_k) - f^* \ge 0$.
Thus, under the assumption $\sum_{k=0}^{\infty} \alpha_k^2 < \infty$ and Lemma \ref{lem:disagree}(b), the above relation satisfies all the conditions of Lemma \ref{thm:super}. Using this, we have the following results.
\textit{Result 1:} For some $\bbz^* \in \ccalX^*$ and any $s \in \ccalS$, the sequence $\{\|\mathbf{z}_{s,k}-\mathbf{z}^*\|\}$ is
convergent \textit{a.s.}
\textit{Result 2:}
$
\sum_{k=1}^{\infty} \alpha_k(f(\bar{\check{\mathbf{z}}}_k)-f^*) < \infty \quad a.s.
$
As a direct consequence of \textit{Result 1},
we know that the sequences $\{\|\mathbf{p}_{s,k}-\mathbf{z}^*\|\}$ and $\{\|\check{\mathbf{z}}_{s,k}-\mathbf{z}^*\|\}$ are also
convergent \textit{a.s.}
(This is straightforward from Line \ref{line:p} of Algorithm \ref{alg:filter+opt} and Lemma \ref{lem:feas} with the knowledge that
$\mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X}) = \|\mathbf{p}_{s,k}-\check{\mathbf{z}}_{s,k}\|^2$.)
Since $\|\bar{\check{\mathbf{z}}}_k-\mathbf{z}^*\| \le \frac{1}{N} \sum_{i\in \ccalS}\|\check{\mathbf{z}}_{s,k}-\mathbf{z}^*\|$,
we further know that the sequence $\{\|\bar{\check{\mathbf{z}}}_k-\mathbf{z}^*\|\}$ is also
convergent \textit{a.s.}
As a direct consequence of \textit{Result 2}, since $\alpha_k$ is not summable,
$
\liminf_{k\rightarrow \infty} (f(\bar{\check{\mathbf{z}}}_k)-f^*)=0 \; a.s.
$
From this relation and the continuity of $f$, it follows that
the sequence $\{\bar{\check{\mathbf{z}}}_k\}$ must have one accumulation point in the set $\mathcal{X}^*$ \textit{a.s.}
This and the fact that $\{\|\bar{\check{\mathbf{z}}}_k-\mathbf{z}^*\|\}$ is convergent \textit{a.s.} for every $\mathbf{z}^* \in \mathcal{X}^*$ imply that
\begin{equation}\label{eqn:z_final1}
\lim_{k \rightarrow \infty} \bar{\check{\mathbf{z}}}_k = \mathbf{z}^* \quad a.s.
\end{equation}
Also, by Lemma \ref{lem:disagree}(b), we have
\begin{align}\label{eqn:liminfv1}
\liminf_{k \rightarrow \infty} \|\check{\mathbf{z}}_{s,k}-\bar{\check{\mathbf{z}}}_k\| = 0 \quad \text{for all } s \in \ccalS \quad a.s.
\end{align}
The fact that $\{\|\check{\mathbf{z}}_{s,k}-\mathbf{z}^*\|\}$ is convergent \textit{a.s.} for all $s\in\ccalS$, together with~\eqref{eqn:z_final1}
and~\eqref{eqn:liminfv1} implies that
\begin{equation}\label{eqn:consensus1}
\lim_{k \rightarrow \infty} \check{\mathbf{z}}_{s,k} = \mathbf{z}^* \quad \text{for all } s \in \ccalS \quad a.s.
\end{equation}
Since $\|\mathbf{z}_{s,k}-\check{\mathbf{z}}_{s,k}\| \le \|\mathbf{z}_{s,k}-\mathbf{p}_{s,k}\| + \|\mathbf{p}_{s,k}-\check{\mathbf{z}}_{s,k}\|$, by invoking Lemma \ref{lem:feas} and \ref{lem:disagree}(a), we have
$
\lim_{k\to \infty} \|\mathbf{z}_{s,k}-\check{\mathbf{z}}_{s,k}\| = 0$ for all $ s \in \ccalS \quad a.s.
$
This and relation (\ref{eqn:consensus1}) give us the desired result, which is
$
\lim_{k \rightarrow \infty} \mathbf{z}_{s,k} = \mathbf{z}^\star$ for all $ s \in \ccalS \quad a.s.
$
\subsection{Sensor Model}\label{sec:mod}
We assume that the landmarks live in $\reals^2$ and denote the configuration of landmark $i$ by $\bbx_i.$
We also assume that the configuration space of the robot is $\reals^2$.
Generic models for the measurement covariance matrix for sparse landmark localization have been proposed \cite{chung06, simonetto11, jalalkamali12}.
These models have two important characteristics that apply to a wide variety of localization sensors:
\begin{enumerate*}[label=(\itshape\roman*\upshape)]
\item Measurement quality is inversely proportional to viewing distance, and
\item The direction of maximum uncertainty is the viewing direction, i.e., the sensors are more proficient at sensing bearing than range.
\end{enumerate*}
The general idea is to use the vector $\hbbx_{i}(t)-\bbr_s(t)$ to construct a diagonal matrix in a coordinate frame relative to the sensor, then rotate the matrix to a global coordinate frame so that it can be compared to other observations.
Following the accepted generic sensor models, we express $Q(\bbr_s, \hbbx_{i})$ by its eigenvalue decomposition
$
Q= R_{\phi_{i} } \Lambda_{i}R_{\phi_{i}}^\top,
$
where the argument $(\bbr_s, \hbbx_{i})$ of $Q$, $\Lambda_i$, and $R_{\phi_i}$ is implicit.
The angle $\phi_{i} \in \left(-\frac{\pi}{2},\frac{\pi}{2} \right]$ is defined so that the first column of $R_{\phi_{i}}$, which by convention is $[\cos \phi_{i} \; \sin \phi_{i}]^\top \! \! , \;$ is parallel to the subspace spanned by the vector $\hbbx_{i}-\bbr_{s}$.
This angle is given by
$
\phi_{i} = \tan^{-1} \left(
( [\hbbx_{i}]_2-[\bbr_{s}]_2)/([\hbbx_{i}]_1 - [\bbr_{s}]_1)
\right),
$
where the subscripts outside the brackets refer to the first and second coordinate of the vector representing the location of the landmark and sensor located at $\hbbx_{i}$ and $\bbr_s$.
The eigenvalue matrix is given by $\Lambda_{i} = \textrm{diag}(\lambda_{1,i}, \lambda_{2,i}),$ where
$
\lambda_{1,i} = c_0(/1 + c_1\norm{\hbbx_{i} -\bbr_{s}}_2 ) \and \lambda_{2,i} =\rho \lambda_{1,i} .
$
In the body frame of sensor $s$, the eigenvalues $\lambda_{1,i}$ and $\lambda_{2,i} $ control the shape of the confidence ellipses for individual measurements of the $i$-th target.
The parameter $c_0 >0$ represents the overall sensor quality and scales the whole region equally, $c_1 > 0$ controls the sensitivity to depth, and $\rho >1$ controls eccentricity of the confidence regions associated with the measurements.
Figure~\ref{fig:params} illustrates the measurement model for one sensor and two targets.
\begin{figure}[t]
\begin{center}
\includegraphics[width=\columnwidth]{figures/meas.pdf}
\vspace{-1.0cm}
\caption{A sensor at $\bbr_s$ observes targets it believes to be at $\hbbx_i$ and $\hbbx_j$.
Possible confidence regions are shown in grey.
Dotted lines are parallel to the global $\hat{\imath}$ axis.
Red lines guide the eye from the sensor to targets
}
\vspace{-0.7cm}
\label{fig:params}
\end{center}
\end{figure}
Since $\tan^{-1}$ is not continuous at zero, we need to impose the following restriction so that Assumption~\ref{assume:Q} holds.
Essentially, we assume that, for the selected $\delta>0$, which recall has an affect on the robot's ability to translate in $\reals^2,$ we choose a $\tau_i$ such that
$
\tau_i < c_0 / (1 + c_1\delta).
$
Thus, if the robot is within $\delta$ of a target $i$, the constraint $h(\bbz, \ccalD, i)$ is trivially satisfied, and therefore we will never evaluate $Q$ or any of its derivatives in this region.
\subsection{Results}
\begin{figure}[!t]
\centering
\includegraphics[width=\columnwidth]{figures/traj_stills.pdf}
\vspace{-0.7cm}
\caption{Four sensors localize 100 landmarks.
Gray $\times$'s indicate landmarks with uncertainty above the threshold, and black $\circ$'s indicate localized landmarks.
Gray lines connecting the agents indicate the communication links.
}
\vspace{-0.7cm}
\label{fig:traj}
\end{figure}
Figure~\ref{fig:traj} shows an example of the resulting active sensing trajectories for a network of four sensors that cooperatively localize a uniformly random distribution of 100 landmarks in a square $100 \,{{\rm m}}^2$ workspace to a desired accuracy of $1\, {{\rm m}}$.
This corresponds to an eigenvalue tolerance of $\tau_1=\cdots=\tau_m=9\,{{\rm m}}^{-2}.$
The prior distribution on the landmarks was uninformative, i.e., the initial mean estimate and information matrix are given by the initial observations $\set{\bby_{i,s} (0)\mid i \in \ccalI, s \in \ccalS}$ and the corresponding information matrices were set to $\set{Q(\bbr_s (0), \bby_{i,s} (0))}_{ i \in \ccalI, s \in \ccalS}.$
The parameters of the sensing model $Q$ were set to $c_0 = \frac{1}{2}, c_1 = 10, \and \rho = 30$.
The feasible control set $\ccalU$ was set to
$
\ccalU = \set{\bbu_s \in \reals^2 \mid \norm{\bbu_s}\leq 1\,{{\rm m}}}.
$
In the figure, note that between $t=194$ and $t=242$, the agent in the bottom right moves north in order to maintain connectivity while the other agents move to finish the localization task.
It can be seen
from the four snapshots of the trajectories in Fig.~\ref{fig:traj}, that the robots effectively ``divide and conquer'' the task based on proximity to unlocalized targets.
\begin{figure}[!t]
\centerin
\includegraphics[width=\columnwidth]{code/paper_plots.pdf}
\vspace{-0.7cm}
\caption{
Top panel:
Evolution of the minimum eigenvalues.
The center curve is the mean among all 100 targets, with the grey block extending to the lowest and largest eigenvalues at each time instant.
The dotted line is at the tolerance $\tau=9\,{{\rm m}}^{-2}$.
Bottom panel:
Evolution of localization error.
The center curve is the mean among all 100 targets, with the grey block extending to the minimum and maximum errors at each time instant.
The dotted line is at the desired accuracy of $1\,{{\rm m}}$.
Note that the scale on vertical axis is large because the initial uncertainty is infinite.
}
\vspace{-0.3cm}
\label{fig:eigs_and_errs}
\end{figure}
Fig.~\ref{fig:eigs_and_errs} shows the evolution of the minimum eigenvalues of the information matrices $S_i(t)$ from the simulation shown in Fig.~\ref{fig:traj}.
Note that, even after the minimum eigenvalue associated with a landmark has surpassed $\tau$, more information is still collected, but it does not affect the control signal.
Note also that the maximal uncertainty in the bottom panel does not go below the desired threshold, even though the minimal eigenvalue does go above the threshold in the top panel.
This is expected because we use the 95\% confidence interval to generate the threshold $\tau$, thus we expect 5\% of landmarks to have errors larger than the desired threshold.
In this case study, we selected the termination criterion for Algorithm~\ref{alg:filter+opt} to be at most 30 iterations.
When testing the algorithm with $\alpha_k = 1/k$, we observed that the relative change in the iterates $\bbz_{s,k}$ and the data $\ccalD_{s,k}$ would often reach levels at or below 10\% inside of thirty iterations, so we allowed the message passing to terminate early if this criterion was met.
\begin{figure}[!t]
\centering
\includegraphics[width=0.9\columnwidth]{code/constraint-viols.eps}
\caption{
Plotting the amount of constraint violation of the original nonlinear constraint that will occur because we solve a linearized version.
Twenty lines are drawn, one for each landmark in a simulation with $m=20.$
The horizontal axis represents the outer loop iterations $t$.
Lines are drawn to guide the eye
}
\vspace{-0.7cm}
\label{f:viols}
\end{figure}
Figure~\ref{f:viols} measures the amount of constraint violation of the original nonlinear constraints for the solution obtained from the linearized version that we observed in a simulation with twenty landmarks.
For the $\ccalU$ and the parameters for the function $Q$ used in these simulations, the constraint violation was very small, and driven to zero typically for $t > 10.$
We tested larger feasible sets $\ccalU$ and (predictably) observed a general increase in the constraint violation, although we still observed reasonable robot behaviors.
\subsection{Distributed Information Filtering}
We solve problem~\eqref{eq:distributed} using an iterative approach.
Let $\ccalD_{s,k}$ denote the copy of the data set $\ccalD$ that is local to sensor $s$ at iteration $k \in \mbN$, where $\mbN = \set{1,2,3,\dots}$ denotes the natural numbers.
Additionally, let $\bbz_{s,k}$ denote the decision variables of the sensor $s$ at iteration $k$.
The first step of the algorithm is for sensor $s$ to broadcast $\bbz_{s,k-1} $ and a summary of $\ccalD_{s,k-1}.$
In Algorithm~\ref{alg:filter+opt}, the \emph{data summary for state} $i$ is captured by the intermediate information matrix $\bbXi_{i, s, k}$ and information vector $\bbxi_{i, s, k},$ defined in lines \ref{line:Xi} and \ref{line:xi}.
We refer the reader to \cite{kamal12} for a detailed discussion of Information Consensus Filtering, but we note briefly here that if the sensors each compute $\bbXi_{i,s,0}$ and $\bbxi_{i,s,0}$, and carry out the weighted averaging that is standard in all consensus algorithms, given in lines \ref{line:Xi_new} and \ref{line:xi_new}, then $n \bbXi_{i, s, k}$ and $\bbxi_{i, s, k}$ converge geometrically to the consensus posterior information.
In other words, under the ICF, we have that, for all $s \in \ccalS,$
$
\set{ \left( n\Xi_{1, s, k}, \dots, n\Xi_{m,s,k} \right)}_{k \in \mbN}\to S
$
for all
$i \in \ccalI$
and
$
\set{\big((n\Xi_{1,s,k})^{-1} \bbxi_{1, s, k}, \dots, (n\Xi_{m,s,k})^{-1} \bbxi_{m,s,k}\big)}_{k \in \mbN} \to \hbbx.
$
In particular, let $\ccalG_k = (\ccalS, \ccalE_k)$ represent a communication graph such that $(s,v) \in \ccalE_k$ if and only if sensors $s$ and $v$ can communicate at iteration $k$.
This defines the \emph{neighbor set},
$
\ccalN_{s,k} \triangleq \set{s} \cup \set{
v \in \ccalS \mid (v,s) \in \ccalE_k
}.
$
Sensor $s$ receives $\set{\bbz_{v,k-1}, \set{\bbxi_{i,v,k},\bbXi_{i,v,k}}_{i \in \ccalI} \mid v \in \ccalN_{s,k}}.$
With this new information, the sensor updates its own optimization variable and data summary via using weighted averaging.
In particular, let $W_k$ be an $n \times n$ row stochastic matrix such that
$
[W_k]_{sv} > 0 \iff v \in \ccalN_s.
$
The exact assumptions for $W_k$ will be introduced later, when they are necessary for the proof of our main result.
The consensus steps are depicted in lines~\ref{line:p}, \ref{line:Xi_new}, and \ref{line:xi_new} of Algorithm~\ref{alg:filter+opt}.
Then, the agent can compute $\ccalD_{s,k}$ as shown in line~\ref{line:D}, concluding the IF portion of iteration $k.$
Note that, given initial conditions $\set{ \ccalD_{s, 0}}_{s \in \ccalS},$ the data for any sensor $s$ at time $k$ is bounded by the initial conditions as
\begin{equation}\label{eq:bound_data}
\norm{ \ccalD_{s,k} } \leq
\max_{v \in \ccalS}
\norm{
\left( \ccalD_{v,0}
\right)
}
,
\end{equation}
where $\norm{\cdot}$ is any norm in the space of data $\reals^{pm} \times \left( {\rm Sym}_{++} (p, \reals) \right)^m.$
This implies that the set of possible data is bounded with respect to any norm in the vector space $\reals^{pm} \times\left( {\rm Sym} (p, \reals) \right)^m.$
Note that, by the same arguments as can be found in \cite{kamal12}, under any norm, all sensors' data converge to the same consensus value, i.e.,
$
\norm{ \ccalD_{s,k} - \ccalD_{v,k } }\to 0
$
and
$
\norm{ \ccalD_{s,k} - \ccalD }\to 0
$
for all $s , v \in \ccalS.$
\subsection{Random Approximate Projections}
The optimization part of the algorithm begins in line \ref{line:v} by computing a negative subgradient of the $f$ at the local iterate, which we denote by $- f'(\bbz_{s,k})$, taking a gradient descent step, and projecting the iterate back to the simple constraint set $\ccalX_0$.
The positive step size $\alpha_k$ is diminishing, non-summable and square-summable, i.e, $\alpha_k \to 0$, $\sum_{k \in \mbN}\alpha_k = \infty$ and $\sum_{k \in \mbN}\alpha_k^2 < \infty$.
The last step of our method is not a projection to
the feasible set, but instead a subgradient step in the direction
that minimizes the violation of a \textit{single} LMI constraint.
Essentially, each node selects one of
the LMI’s randomly, measures the violation of that constraint,
and takes an additional gradient descent step with step size
$\beta_{s,k}$ in order to minimize this violation.
We call this process \textit{random approximate projection}.
Specifically, line~\ref{line:o} randomly assigns $\omega_{s,k} \in \ccalI$, effectively choosing to activate $h\left(\cdot; \cdot, \omega_{s,k} \right)$.
The idea behind line~\ref{line:z} is to minimize a scalar metric that measures the amount of violation of $h\left(\cdot; \cdot, \omega_{s,k} \right)$, which we denote by $h_+\left(\cdot; \cdot, \omega_{s,k} \right),$ while remaining feasible.
Let $\mathsf{\Pi}_+ \colon {\rm Sym}(p,\reals) \to {\rm Sym}_+(p,\reals)$ denote the projection operator onto the set of positive semidefinite matrices, given by
\begin{equation}\label{eq:pi}
\mathsf{\Pi}_+X = E \textrm{diag}\left[ (\lambda_1)_+, \dots, (\lambda_p)_+\right] E^\top,
\end{equation}
where
$(\cdot)_+ \triangleq \max \set{\cdot, 0}$
and $\lambda_1, \dots, \lambda_p$ are the eigenvalues and $E$ is a matrix with columns $\bbe_1, \dots, \bbe_p$ that are the corresponding eigenvectors of $X$.
A measure of the ``positive definiteness'' of $X$ is thus
$
\norm{\mathsf{\Pi}_+ X }_F
\equiv \sqrt{ (\lambda_1)_+^2 + \cdots + (\lambda_p)_+^2}.
$
This defines our measure of constraint violation,
\begin{align}
h_+ \left(\bbz; \ccalD, i\right) &\triangleq \norm{ \mathsf{\Pi}_+ h \left(\bbz; \ccalD, i\right) }_F.
\end{align}
We use special notation to denote the vector of derivatives of $h_+$ with respect to the decision variables $\bbz$ evaluated at $(\bbz; \ccalD, i)$.
In particular, define the gradient
$
h'_+ \left(\bbz; \ccalD, i\right)= \left(\nabla_1 h_+ (\bbz; \ccalD,i), \dots , \nabla_{ m+qn} h_+ (\bbz ; \ccalD,i) \right)^\top
= \nabla_\bbz h_+(\bbz; \ccalD, i).
$
Defining the function
$
\psi_{ij} \colon {\rm Sym} (p, \reals) \times \reals^{m +qn} \times \left(\reals^{pm} \times \left( {\rm Sym}_{+} (p, \reals) \right)^m \right) \to \reals
$
for notational convenience, the $j$-th entry of $h'_+ \! \left(\bbz; \ccalD, i\right)$ is given by
\begin{equation}\label{eq:dh+_dzj}
\nabla_{j} h_+ (\bbz; \ccalD,i)
= \psi_{ij} \Big( \mathsf{\Pi}_+ \big( h\left(\bbz;\ccalD, i \right) \big), \bbz, \ccalD\Big),
\end{equation}
where
\begin{equation}\label{eq:psi}
\psi_{ij} (X,\bbz,\ccalD)\triangleq\begin{cases}
\frac{
{{\rm Tr}}
\left(
\nabla_j h (\bbz, \ccalD,i)
X
\right) }{\norm{X}_F}
&{{\rm if}} \; \norm{X}_F\! >0\\
d&{{\rm else}}
\end{cases}
\end{equation}
and $d >0$ is some arbitrary constant.
The function $\psi_{ij}$ is not continuous at $X=\bb0,$ and we set $d \neq 0$ for technical reasons discussed below.
The step size
\begin{equation}\label{eqn:beta}
\beta_{s,k} = \frac{h_+(\bbv_{s,k}; \ccalD_{s,k}, \omega_{s,k})}{\norm{h'_+(\bbv_{s,k}; \ccalD_{s,k}, \omega_{s,k})}^2}
\end{equation}
given in line \ref{line:b} is a variant of the Polyak step size \cite{polyak-sg}.
Note that this is a well defined step size as we let
$
h_+' (\bbv_{s,k}; \ccalD_{s,k}, \omega_{s,k}) = d {\bf 1}_{m+qn}
$
(cf. Eq \eqref{eq:psi})
whenever
$
h_+(\bbv_{s,k}; \ccalD_{s,k}, \omega_{s,k})=0
$
and
it is nonzero elsewhere by construction.
\subsection{Proof of the Lemmas in \ref{subsec:lem}}
\begin{proof}[Proof of Lemma \ref{lem:basic}]
From Line \ref{line:z} of Algorithm \ref{alg:filter+opt}, the following chain of relations hold for any feasible point $\mathbf{z} \in \mathcal{X} \subseteq \mathcal{X}_0$ \textit{a.s.}:
\begin{subequations}
\begin{align}
&\|\mathbf{z}_{s,k}-\mathbf{z}\|^2 \le \|\mathbf{v}_{s,k}-\mathbf{z} \! - \! \beta_{s,k}h'_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})\|^2\label{eqn:basica}\\
&~\le \|\mathbf{v}_{s,k}-\mathbf{z}\|^2 \! - \! 2\beta_{s,k} \langle h'_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}), \mathbf{v}_{s,k}-\mathbf{z} \rangle \nonumber\\
&~+ \beta_{s,k}^2 \|h'_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})\|^2\label{eqn:basicb}\\
&~\le \|\mathbf{v}_{s,k}-\mathbf{z}\|^2 \! - \! 2\beta_{s,k} \langle h'_+(\mathbf{v}_{s,k};\ccalD,\omega_{s,k}), \mathbf{v}_{s,k} \! - \! \mathbf{z} \rangle \label{eqn:basicc} \\
&~~+\! 2\beta_{s,k} \|\boldsymbol{\delta}_{s,k}\|\|\mathbf{v}_{s,k} \! - \! \mathbf{z} \|
\! + \! \beta_{s,k}^2 \|h'_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})\|^2 \nonumber \\
&~\le \|\mathbf{v}_{s,k}-\mathbf{z}\|^2 \! - \! 2\beta_{s,k} h_+(\mathbf{v}_{s,k};\ccalD,\omega_{s,k})\label{eqn:basicd}\\
&~+ 2\beta_{s,k} \|\boldsymbol{\delta}_{s,k}\|\|\mathbf{v}_{s,k} \! - \! \mathbf{z} \|
+ \beta_{s,k}^2 \|h'_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})\|^2,\nonumber
\end{align}
\end{subequations}
where (\ref{eqn:basica}) follows from the nonexpansiveness of the projection operator; (\ref{eqn:basicb}) follows from the expansion of $\|\cdot\|^2$; (\ref{eqn:basicc}) follows from relation (\ref{eq:differror}) and the Schwarz inequality;
and (\ref{eqn:basicd}) follows from the convexity of the function $h_+(\cdot;\cdot,\omega_{s,k})$, and $h_+(\mathbf{z};\ccalD,\omega_{s,k})=0$ due to the feasibility of the point $\mathbf{z}$, i.e.,
$
h_+(\mathbf{v}_{s,k};\ccalD,\omega_{s,k})
\le \langle h'_+(\mathbf{v}_{s,k};\ccalD,\omega_{s,k}), \mathbf{v}_{s,k}-\mathbf{z} \rangle.
$
From relation (\ref{eq:constrainterror}) and the definition of $\beta_{s,k}$ in (\ref{eqn:beta}), we further have
\begin{align*}
&- 2\beta_{s,k} h_+(\mathbf{v}_{s,k};\ccalD,\omega_{s,k})+ \beta_{s,k}^2 \|h'_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})\|^2\\
&~= - 2\beta_{s,k} h_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}) + 2\beta_{s,k}|\nu_{s,k}| \\
&~~+ \beta_{s,k}^2 \|h'_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})\|^2\\
&~= 2\beta_{s,k}|\nu_{s,k}| - \frac{h^2_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})}{\|h'_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})\|^2}\\
&~\le 2\beta_{s,k}|\nu_{s,k}| - \frac{h_+^2(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})}{(L_h+D)^2},
\end{align*}
where the last inequality follows from relation \eqref{eqn:L_h1}.
Combining this with inequality (\ref{eqn:basicd}), we obtain for any $\mathbf{z} \in \mathcal{X}$ \textit{a.s.}:
\begin{align}\label{eqn:basic1}
\|\mathbf{z}_{s,k}-\mathbf{z}\|^2
\le &~ \|\mathbf{v}_{s,k}-\mathbf{z}\|^2
+ 2\beta_{s,k} \|\boldsymbol{\delta}_{s,k}\|\|\mathbf{v}_{s,k}-\mathbf{z} \|\\
&~+2\beta_{s,k}|\nu_{s,k}|
- \frac{h_+^2(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})}{(L_h+D)^2}.\nonumber
\end{align}
For the last term on the right-hand side, we can rewrite
$
h_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}) = h_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}) -h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})
+h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k}).
$
Therefore,
\begin{align}\label{eqn:gfnpre}
&h_+^2(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})\ge 2h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\nonumber\\
&\hspace{2cm}\times\left(h_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}) -h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\right)\nonumber\\
&\hspace{3cm} + h_+^2(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k}).
\end{align}
Regarding the first term on the right-hand side of (\ref{eqn:gfnpre}), the following chain of relations holds:
\begin{subequations}\label{eqn:basice}
\begin{align}
&2h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\nonumber\\
&~~\times\left(h_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}) -h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\right)\nonumber\\
&~\ge-2h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\nonumber\\
&~~\times\left|h_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}) -h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\right|\label{eqn:basicf}\\
&~\ge -2(L_h+D)\|\mathbf{v}_{s,k}-\mathbf{p}_{s,k}\|h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\label{eqn:basicg}\\
&~\ge -2\alpha_k (L_h+D)L_fh_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\label{eqn:basich}\\
&~\ge -\tau \alpha_k^2(L_h+D)^2L_f^2 - \frac{1}{\tau}h_+^2(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k}),\label{eqn:basici}
\end{align}
\end{subequations}
where (\ref{eqn:basicf}) follows from the Schwarz inequality; (\ref{eqn:basicg}) follows from relation (\ref{eqn:L_h2}); (\ref{eqn:basich}) follows from Line \ref{line:v} of Algorithm \ref{alg:filter+opt}; and (\ref{eqn:basici}) follows from using
$
2|a||b| \le \tau a^2 + \frac{1}{\tau} b^2
$
with $a=\alpha_k (L_h+D)L_f$ and $b=h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})$, and $\tau >0$ is arbitrary.
Using relations (\ref{eqn:gfnpre})-(\ref{eqn:basice}) in (\ref{eqn:basic1}), we obtain for all $\mathbf{z} \in \mathcal{X}$ \textit{a.s.}:
\begin{align}\label{eqn:basic2}
&\|\mathbf{z}_{s,k}-\mathbf{z}\|^2 \le \|\mathbf{v}_{s,k}-\mathbf{z}\|^2
+ 2\beta_{s,k} \|\boldsymbol{\delta}_{s,k}\|\|\mathbf{v}_{s,k}-\mathbf{z} \|\\
&~+2\beta_{s,k}|\nu_{s,k}|-\frac{\tau-1}{\tau (L_h+D)^2}h_+^2(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})
+\tau \alpha_k^2 L_f^2.\nonumber
\end{align}
Similarly to (\ref{eqn:basica})-(\ref{eqn:basicd}), from Line \ref{line:v} of Algorithm \ref{alg:filter+opt}, the following chain of relations hold for any $\mathbf{z}\in \mathcal{X} \subseteq \mathcal{X}_0$ \textit{a.s.}:
\begin{subequations}
\begin{align}
&\|\mathbf{v}_{s,k}-\mathbf{z} \|^2\le \|\mathbf{p}_{s,k}-\mathbf{z}-\alpha_kf'(\mathbf{p}_{s,k})\|^2\label{eqn:basicj}\\
&~\le \|\mathbf{p}_{s,k}-\mathbf{z}\|^2 - 2\alpha_k\langle f'(\mathbf{p}_{s,k}), \mathbf{p}_{s,k}-\mathbf{z}\rangle + \alpha_k^2\|f'(\mathbf{p}_{s,k})\|^2\label{eqn:basick}\\
&~\le \|\mathbf{p}_{s,k}-\mathbf{z}\|^2 - 2\alpha_k(f(\mathbf{p}_{s,k})-f(\mathbf{z})) + \alpha_k^2L_f^2,\label{eqn:basicm}
\end{align}
\end{subequations}
where (\ref{eqn:basicj}) follows from the nonexpansive projection;
(\ref{eqn:basick}) follows from the expansion of $\|\cdot\|^2$;
(\ref{eqn:basicm}) follows from the convexity of the function $f$ and relation \eqref{eqn:L_f1}.
For the second term on the right-hand side, we further have for any $\check{\mathbf{z}} \in \mathcal{X}$:
\begin{subequations}
\begin{align}
&- 2\alpha_k(f(\mathbf{p}_{s,k})-f(\mathbf{z})) \nonumber\\
&~= -2\alpha_k(f(\mathbf{p}_{s,k}) - f(\check{\mathbf{z}}) + f(\check{\mathbf{z}})-f(\mathbf{z}))\label{eqn:basicn}\\
&~\le - 2\alpha_k \langle f'(\check{\mathbf{z}}), \mathbf{p}_{s,k} - \check{\mathbf{z}}\rangle - 2\alpha_k(f(\check{\mathbf{z}})-f(\mathbf{z}))\label{eqn:basico}\\
&~\le 2\alpha_k L_f \|\mathbf{p}_{s,k} - \check{\mathbf{z}}\| - 2\alpha_k(f(\check{\mathbf{z}})-f(\mathbf{z}))\label{eqn:basicp}\\
&~\le 4\eta\alpha_k^2 L_f^2 + \frac{1}{4\eta}\|\mathbf{p}_{s,k} - \check{\mathbf{z}}\|^2 - 2\alpha_k(f(\check{\mathbf{z}})-f(\mathbf{z})),\label{eqn:basicq}
\end{align}
\end{subequations}
where (\ref{eqn:basicn}) follows from adding and subtracting $f(\check{\mathbf{z}})$;
(\ref{eqn:basico}) follows from the convexity of the function $f$;
(\ref{eqn:basicp}) follows from the Schwarz inequality;
and (\ref{eqn:basicq}) follows from using
$
2|a||b| \le 4\eta a^2 + \frac{1}{4\eta} b^2
$
with $a = \alpha_kL_f$ and $b = \|\mathbf{p}_{s,k} - \check{\mathbf{z}}\|$.
Combining (\ref{eqn:basicq}) in (\ref{eqn:basicm}), we have for any $\mathbf{z}, \check{\mathbf{z}} \in \mathcal{X} \subseteq \mathcal{X}_0$ \textit{a.s.}:
\begin{align*}
\|\mathbf{v}_{s,k}-\mathbf{z} \|^2
\le&~ \|\mathbf{p}_{s,k}-\mathbf{z}\|^2 - 2\alpha_k(f(\check{\mathbf{z}})-f(\mathbf{z})) \\
&~+ \frac{1}{4\eta}\|\mathbf{p}_{s,k} - \check{\mathbf{z}}\|^2 + (1+4\eta)\alpha_k^2L_f^2.
\end{align*}
Substituting this inequality in relation (\ref{eqn:basic2}), we obtain
\begin{align*}
&\|\mathbf{z}_{s,k}-\mathbf{z}\|^2
\le \|\mathbf{p}_{s,k}-\mathbf{z}\|^2 - 2\alpha_k(f(\check{\mathbf{z}})-f(\mathbf{z}))\\
&~+ 2\beta_{s,k} \|\boldsymbol{\delta}_{s,k}\|\|\mathbf{v}_{s,k}-\mathbf{z} \|+2\beta_{s,k}|\nu_{s,k}|\\
&~ + \frac{1}{4\eta}\|\mathbf{p}_{s,k} - \check{\mathbf{z}}\|^2 + A_{\eta,\tau}\alpha_k^2L_f^2\\
&~-\frac{\tau-1}{\tau(L_h+D)^2}h^2_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k}),
\end{align*}
where $A_{\eta,\tau} = 1+4\eta+\tau$.
From relation \eqref{eqn:C_z}, we have
$
\|\mathbf{v}_{s,k}-\mathbf{z} \|\le C_{\mathbf{z}}.
$
Using this and the upper estimate for $\beta_{s,k}$ in (\ref{eqn:betabnd}) for bounding the three error terms completes the proof.
\end{proof}
\begin{proof}[Proof of Lemma \ref{lem:feas}]
We use Lemma~\ref{lem:basic} with $\check{\mathbf{z}}=\mathbf{z} = \mathsf{\Pi}_{\mathcal{X}}[\mathbf{p}_{s,k}]$.
Therefore, for any $s\in \ccalS$, and $k \ge 1$, we obtain \textit{a.s.}:
\begin{align}\label{eqn:lem2a}
&\|\mathbf{z}_{s,k}-\mathsf{\Pi}_{\mathcal{X}}[\mathbf{p}_{s,k}]\|^2
\le \|\mathbf{p}_{s,k}-\mathsf{\Pi}_{\mathcal{X}}[\mathbf{p}_{s,k}]\|^2 \\
&~+ 2\frac{C_{\mathbf{z}}(C_h+N)}{c_h^2}\|\boldsymbol{\delta}_{s,k}\| +2\frac{C_h+N}{c_h^2}|\nu_{s,k}|\nonumber\\
&~ + \frac{1}{4\eta}\|\mathbf{p}_{s,k} - \mathsf{\Pi}_{\mathcal{X}}[\mathbf{p}_{s,k}]\|^2 + A_{\eta,\tau}\alpha_k^2L_f^2\nonumber\\
&~ -\frac{\tau-1}{\tau(L_h+D)^2}h_+^2(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k}),\nonumber
\end{align}
where $A_{\eta,\tau} = 1+4\eta+\tau$ and $\eta,\tau > 0$ are arbitrary.
By the definition of the projection, we have
$
\mathrm{dist}(\mathbf{p}_{s,k},\mathcal{X}) = \|\mathbf{p}_{s,k} - \mathsf{\Pi}_{\mathcal{X}}[\mathbf{p}_{s,k}]\|$
and
$
\mathrm{dist}(\mathbf{z}_{s,k},\mathcal{X})
= \|\mathbf{z}_{s,k}-\mathsf{\Pi}_{\mathcal{X}}[\mathbf{z}_{s,k}]\| \le \|\mathbf{z}_{s,k}-\mathsf{\Pi}_{\mathcal{X}}[\mathbf{p}_{s,k}]\|.
$
Upon substituting these estimates in relation (\ref{eqn:lem2a}), we obtain
\begin{align}\label{eqn:lem2b}
&\mathrm{dist}^2(\mathbf{z}_{s,k},\mathcal{X})
\le \mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X}) \\
&\hspace{2cm}+ 2\frac{C_{\mathbf{z}}(C_h+N)}{c_h^2}\|\boldsymbol{\delta}_{s,k}\| +2\frac{C_h+N}{c_h^2}|\nu_{s,k}|\nonumber\\
&\hspace{2cm} + \frac{1}{4\eta}\mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X}) + A_{\eta,\tau}\alpha_k^2L_f^2\nonumber\\
&\hspace{2cm} -\frac{\tau-1}{\tau(L_h+D)^2}h_+^2(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k}).\nonumber
\end{align}
Taking the expectation conditioned on $\mathcal{F}_{k-1}$ and noting that $\mathbf{p}_{s,k}$ is fully determined by $\mathcal{F}_{k-1}$,
we have for any $s\in \ccalS$ and $k \ge 1$ \textit{a.s.}:
\begin{align}\label{eqn:lem2c}
&\mathsf{E}\left[\mathrm{dist}^2(\mathbf{z}_{s,k},\mathcal{X}) \mid \mathcal{F}_{k-1}\right]
\le \mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X}) \\
&+ \hspace{-0.5mm}2\frac{C_{\mathbf{z}}(C_h+N)}{c_h^2}\mathsf{E}[\|\boldsymbol{\delta}_{s,k}\|\mid \mathcal{F}_{k-1}] \hspace{-0.5mm}+\hspace{-0.5mm}2\frac{C_h+N}{c_h^2}\mathsf{E}[|\nu_{s,k}|\mid \mathcal{F}_{k-1}]\nonumber\\
& + \frac{1}{4\eta}\mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X})
+ A_{\eta,\tau}\alpha_k^2L_f^2\nonumber\\
&~ -\frac{\tau-1}{\tau(L_h+D)^2}\mathsf{E}\left[h^2_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\mid\mathcal{F}_{k-1}\right].\nonumber
\end{align}
We now choose $\tau =4$, $\eta = \kappa(L_h+D)^2$ and use Assumption \ref{assume:c} to yield
\begin{align*}
&\mathsf{E}\left[\mathrm{dist}^2(\mathbf{z}_{s,k},\mathcal{X}) \mid \mathcal{F}_{k-1}\right]
\le \mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X}) \\
&+ \hspace{-0.5mm}2\frac{C_{\mathbf{z}}(C_h+N)}{c_h^2}\mathsf{E}[\|\boldsymbol{\delta}_{s,k}\| \mid \mathcal{F}_{k-1}] \hspace{-0.5mm}+2\hspace{-0.5mm}\frac{C_h+N}{c_h^2}\mathsf{E}[|\nu_{s,k}| \mid \mathcal{F}_{k-1}]\nonumber\\
& -\frac{1}{2\kappa(L_h+D)^2}\mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X}) + A\alpha_k^2L_f^2,\nonumber
\end{align*}
where $A = 5+4\kappa(L_h+D)^2$.
Finally, by summing over all $s \in \ccalS$ and using Lemma \ref{lem:ds} with $h(x) = \mathrm{dist}^2(x,\mathcal{X})$,
we arrive at the following relation:
\begin{align} \label{eqn:lem2e}
&\sum_{s\in\ccalS}\mathsf{E}\left[\mathrm{dist}^2(\mathbf{z}_{s,k},\mathcal{X}) \mid \mathcal{F}_{k-1}\right]
\le \sum_{s\in\ccalS}\mathrm{dist}^2(\mathbf{z}_{s,k-1},\mathcal{X}) \\
&~+ 2\frac{C_{\mathbf{z}}(C_h+N)}{c_h^2}\sum_{s\in\ccalS}\mathsf{E}[\|\boldsymbol{\delta}_{s,k}\| \mid \mathcal{F}_{k-1}] \nonumber\\ &~+2\frac{C_h+N}{c_h^2}\sum_{s\in\ccalS}\mathsf{E}[|\nu_{s,k}| \mid \mathcal{F}_{k-1}]\nonumber\\
&~ -\frac{1}{2\kappa(L_h+D)^2}\sum_{s\in\ccalS}\mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X}) + A\alpha_k^2nL_f^2.\nonumber
\end{align}
Therefore, from $\sum_{k\ge 0} \alpha_k^2 < \infty$ and Lemmas~\ref{lem:summable_constraints} and \ref{lem:summable_grads}, all the conditions in the convergence theorem (Theorem~\ref{thm:super}) are satisfied and the desired result follows.
\end{proof}
\begin{proof}[Proof of Lemma \ref{lem:disagree}(a)]
From Line \ref{line:p}-\ref{line:v} and \ref{line:z} of Algorithm \ref{alg:filter+opt}, we define $\mathbf{e}_{s,k} \triangleq \mathbf{z}_{s,k} - \mathbf{p}_{s,k}$ for $s\in \ccalS$ and $k \ge 0$. Hence, $\mathbf{e}_{s,k}$ can be viewed as the perturbation that we make on $\mathbf{p}_{s,k}$ after the network consensus step in Line \ref{line:p} of Algorithm \ref{alg:filter+opt}.
Consider $\|\mathbf{e}_{s,k}\|$, for which we can write
\begin{align} \label{eqn:lem3a}
\|\mathbf{e}_{s,k}\|
\le{}& \|\mathbf{z}_{s,k} - \mathbf{v}_{s,k}\| +\|\mathbf{v}_{s,k} - \mathbf{p}_{s,k}\|\nonumber\\
= {}&\left\|\mathsf{\Pi}_{\mathcal{X}_0}\left[\mathbf{v}_{s,k} - \beta_{s,k}h_+'(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})\right] -\mathbf{v}_{s,k}\right\| \nonumber\\
{}&+\left\|\mathsf{\Pi}_{\mathcal{X}_0}[\mathbf{p}_{s,k}- \alpha_k f'(\mathbf{p}_{s,k})]- \mathbf{p}_{s,k}\right\|\nonumber\\
\le{}&\frac{h_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})}{c_h} +\alpha_kL_f,
\end{align}
where the second inequality follows from fact that $\mathbf{p}_{s,k}, \mathbf{v}_{s,k} \in \mathcal{X}_0$, the nonexpansiveness of the projection operator, relations \eqref{eqn:L_f1} and \eqref{eqn:dhbnd}.
Applying $(a+b)^2 \le 2a^2 + 2b^2$ in inequality (\ref{eqn:lem3a}), we have for all $s\in \ccalS$ and $k\ge 1$,
\begin{equation}\label{eqn:lem3b}
\|\mathbf{e}_{s,k}\|^2 \leq 2\frac{h_+^2(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})}{c_h^2} +2\alpha_k^2L_f^2
\end{equation}
For the term $h_+^2(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k})$ in (\ref{eqn:lem3b}), we have the following chain of relations:
\begin{align}
&h_+^2(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}) \nonumber\\
=&~ \left(h_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}) -h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\right)^2 \label{eqn:dis1}\\
&~+\hspace{-0.7mm} h_+^2(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\nonumber\\
&~ + 2h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\nonumber\\
&~ \times\left(h_+(\mathbf{v}_{s,k};\ccalD_{s,k},\omega_{s,k}) -h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\right)\nonumber\\
\le &~ (L_h+D)^2\|\mathbf{v}_{s,k}-\mathbf{p}_{s,k}\|^2 + h^2_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\label{eqn:dis2}\\
&~+ 2(L_h+D)\|\mathbf{v}_{s,k}-\mathbf{p}_{s,k}\|h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\nonumber\\
\le &~ \alpha_k^2(L_h+D)^2L_f^2 + h^2_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\label{eqn:dis3}\\
&~+ 2\alpha_k(L_h+D)L_fh_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})\nonumber\\
\le &~ 2\alpha_k^2(L_h+D)^2L_f^2 + h_+^2(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k}),\label{eqn:dis4}
\end{align}
where (\ref{eqn:dis1}) follows from adding and subtracting $h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})$;
(\ref{eqn:dis2}) follows from relation (\ref{eqn:L_h2});
(\ref{eqn:dis3}) follows from Line \ref{line:v} of Algorithm \ref{alg:filter+opt};
(\ref{eqn:dis4}) follows from using the relation $2|a||b| \le a^2 + b^2$ with $a = \alpha_k(L_h+D)L_f$ and $b = h_+(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})$.
By combining (\ref{eqn:lem3b}) and (\ref{eqn:dis4}), we obtain
\begin{align*}
\|\mathbf{e}_{s,k}\|^2 \leq &~ 2\alpha_k^2L_f^2\left(1+\frac{2(L_h+D)^2}{c_h^2}\right) + \frac{2h_+^2(\mathbf{p}_{s,k};\ccalD_{s,k},\omega_{s,k})}{c_h^2}\\
\leq &~ 2\alpha_k^2L_f^2\left(1+\frac{2(L_h+D)^2}{c_h^2}\right) + \frac{2L_h^2 \mathrm{dist}^2(\mathbf{p}_{s,k},\mathcal{X})}{c_h^2},
\end{align*}
where the last inequality is from \eqref{e:Lh}.
Therefore, from Lemma \ref{lem:feas} and $\sum_{k=1}^\infty\alpha_k^2<\infty$, we conclude that
$
\sum_{k=1}^\infty \|\mathbf{e}_{s,k}\|^2 <\infty$ for all $ s \in \ccalS \quad a.s.$
\end{proof}
\begin{proof}[Proof of Lemma \ref{lem:disagree}(b)]
The proof of this part of Lemma will coincide with \cite[Lemma 6(b)]{lee15approx}.
\end{proof}
| {'timestamp': '2018-01-16T02:07:07', 'yymm': '1706', 'arxiv_id': '1706.01576', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01576'} | arxiv |
\section{Introduction}
\label{sec:Introduction}
Over the past decades, biometric authentication systems have gained popularity due to the reliability and adaptability. Existing biometric authentication systems generally include physiological and behavioral ones. The former is based on individuals' unique intrinsic features (e.g., face \cite{givens2013biometric}, iris \cite{latman2013field}, retina \cite{sadikoglu2016biometric}, voice \cite{goldstein2016methods}, and fingerprint \cite{unar2014review}) and the latter is based on individuals' behavior patterns such as gait analysis \cite{boulgouris2013gait}.
Recently, biometrics (e.g., fingerprint, face) based authentication systems face an increasing threat of being deceived as a result of the rapid development of manufacturing industry and technologies. For example, individuals can easily trick a fingerprint-based authentication system by using a fake fingerprint film\footnote{\url{http://www.instructables.com/id/How-To-Fool-a-Fingerprint-Security\-System-As-Easy-/}}
or an expensive face recognition-based authentication systems by simply wearing a two-hundred-dollar
anti-surveillance mask\footnote{\url{http://www.urmesurveillance.com/urme-prosthetic/}}.
Thus, fake-resistance characteristics are becoming a more significant requirement for any authentication system.
To address the aforementioned issues, EEG (Electroencephalography) signal-based cognitive biometrics and gait-based systems have been attracting increasing attention.
\begin{table}[t]
\centering
\caption{Comparison of various biometrics. EEG and Gait have considerable fake-resistance which is the most significant characteristic of authentication systems. $\uparrow$ denotes the higher the better while $\downarrow$ denotes the lower the better.}
\label{tab:comparison_1}
\resizebox{\textwidth}{!}{\begin{tabular}{lllllllll}
\hline
& \textbf{Biometrics} & \begin{tabular}[c]{@{}l@{}}\textbf{Fake-}\\ \textbf{-resistance}\end{tabular} $\uparrow$ & \textbf{Universality} $\uparrow$ & \textbf{Uniqueness} $\uparrow$ & \textbf{Stability} $\uparrow$ & \textbf{Accessibility} $\uparrow$ & \textbf{Performance} $\uparrow$ & \begin{tabular}[c]{@{}l@{}}\textbf{Computational}\\ \textbf{Cost}\end{tabular} $\downarrow$ \\ \hline
\multirow{8}{*}{\begin{tabular}[c]{@{}l@{}}\textbf{Uni-}\\ \textbf{-modal}\end{tabular}} & Face/Vedio & Medium & Medium & Low & Low & High & Low & High \\
& Fingerprint/Palmprint & Low & High & High & High & Medium & High & Medium \\
& Iris & Medium & High & High & High & Medium & High & High \\
& Retina & High & Medium & High & Medium & Low & High & High \\
& Signature & Low & High & Low & Low & High & Low & Medium \\
& Voice & Low & Medium & Low & Low & Medium & Low & Low \\
& Gait & High & Medium & High & Medium & Medium & High & Low \\
& EEG & High & Low & High & Low & Low & High & Low \\ \hline
\multirow{6}{*}{\begin{tabular}[c]{@{}l@{}}\textbf{Mulit-}\\ \textbf{-modal}\end{tabular}} & Fingerprint+face & Low & High & Low & Low & High & Medium & High \\
& Iris+pupil & Medium & Medium & High & High & Medium & High & High \\
& Iris+face & Medium & High & Medium & Medium & Medium & Medium & High \\
& ECG+fingerprint & High & Medium & Medium & High & Low & High & Medium \\
\hline
& \textbf{ EEG+gait}& \textbf{ High} & \textbf{ Low} & \textbf{ High} & \textbf{ High} & \textbf{ Low} & \textbf{ High} & \textbf{ Low} \\ \hline
\end{tabular}
}
\end{table}
EEG signal-based authentication systems are an emerging approach in physiological biometrics.
EEG signals measure the brain's response and record the electromagnetic, invisible, and untouchable electrical neural oscillations. Many research efforts have been made on EEG-based biometric authentication for the uniqueness and reliability .
EEG data are unique for each person and almost impossible to be cloned and duplicated. Therefore, an EEG-based authentication system has the potential to uniquely identify humans and ingenious enough to protect against faked identities~\cite{chuang2013think}.
For instance, Chuang et al. \cite{chuang2013think}propose a single-channel EEG-based authentication system, which achieves an accuracy of 0.99. Sarineh Keshishzadeh et al. \cite{keshishzadeh2016improved} employ a statistical model for analyzing EEG signals and achieves an accuracy of 0.974. Generally, EEG signals have the following inherent advantages:
\begin{itemize}
\item \textit{Fake-resistibility.} EEG data are unique for each person and almost impossible to be cloned and duplicated.
EEG signals are individual-dependent. Therefore, an EEG-based authentication system has the potential to verify human identity and ingenious enough to protect against faked identities\cite{chuang2013think}.
\item \textit{Reliability.} An EEG-based authentication system can prevent the subjects under abnormal situations (e.g., dramatically spiritual fluctuating, hysterical, drunk, or under threaten) since EEG signals are sensitive to human stress and mood.
\item \textit{Feasibility.} We have seen an important trend to build authentication systems based on EEG because the equipment for collecting EEG data is cheap and easy to acquire, and it is expected to be more precise, accessible, and economical in the future.
\end{itemize}
In comparison, gait-based authentication systems have been an active direction for years \cite{yao2018compressive,qian2018enabling}. Gait data are more generic and can be gathered easily from popular inertial sensors. Gait data are also unique because they are determined by intrinsic factors (e.g., gender, height, and limb length),
temporal factors \cite{callisaya2009population} (e.g., step length, walking speed, and cycle time) and kinematic factors (e.g., joint rotation of the hip, knee, and ankle, mean joint angles of the hip/knee/ankle, and thigh/trunk/foot angles). In addition, a person's gait behavior is established inherently in the long-term and therefore difficult to be faked.
Hoang et al. \cite{hoang2014secure} propose a gait-based authentication biometric system to analyze gait data gathered by mobile devices, adopt error correcting codes to process the variation in gait measurement, and finally achieve a false acceptance rate (FAR) of 3.92\% and a false rejection rate (FRR) of 11.76\%.
Cola et al. \cite{cola2016gait} collect wrist signals and train gait patterns to detect invalid subjects (unauthenticated people). The proposed method achieves an equal error rate (EER) of 2.9\%.
Despite the tremendous efforts,
various other challenges still remain in single EEG/gait based authentication systems:
(i) the solo EEG/gait authentication system generally obtains a False Acceptance Rate (FAR, which is extremely crucial in high-confidential authentication scenarios)
higher than $3\%$. It is not precise enough for highly confidential places such as military bases, the treasuries of banks and political offices where tiny misjudges could provoke great economic or political catastrophes; (ii) the single authentication system may break down under attack but no backup plan is provided; (iii) the solo EEG-based authentication system is easy to be corrupted by environmental factors (e.g., noise) and subjective factors (e.g., mental state) although it has high rake-resistance; (iv) the solo gait-based authentication system has relatively low performance although it is more stable over different scenarios.
In this paper, we propose Deepkey, a novel biometric authentication system that enables dual-authentication leveraging on the advantages of both gait-based and EEG-based systems. Compared with either gait-based or EEG-based authentication system, a dual-authentication system offers more reliable and precise identification.
Table~\ref{tab:comparison_1} summarizes the overall comparison of Deepkey with some representative works on seven key aspects.
Deepkey consists of three main components: the Invalid ID Filter Model to eliminate invalid subjects, the EEG Identification Model to identify EEG IDs, and the Gait Identification Model to identify gait IDs.
An individual is granted access only after she/he passes all the authentication components. Our main contributions
are highlighted as follows:
\begin{itemize}
\item We present Deepkey, a dual-authentication system that exploits both EEG and gait biological traits. To the best of our knowledge, Deepkey is the first two-factor authentication system for person authentication
using EEG and gaits.
Deepkey is empowered high-level fake-resistance and reliability because both EEG and gait signals are invisible and
hard to be reproduced.
\item We design a robust framework that includes an attention-based RNN to detect and classify of multimodal sensor data, and to decode the large diversity in how people perform gaits and brain activities simultaneously. The delta band of EEG data is decomposed for the rich discriminative information.
\item We validate and evaluate Deepkey on several locally collected datasets. The results show that Deepkey significantly outperforms a series of baseline models and the state-of-the-art methods, achieving FAR of 0 and FRR of $1\%$. Further, we design extensive experiments to investigate the impact of key elements.
\end{itemize}
The remainder of this paper is organized as follows. Section~\ref{sec:Related Work} introduces the EEG-based, gait-based, and
multimodal biometric systems briefly. Section~\ref{sec:The Proposed approach} present the methodology framework and three key models (Invalid ID Filter Model, Gait Identification Model, and EEG Identification Model) of the DeepKey authentication system in detail. Section~\ref{sec:experiment_and_results} evaluates the proposed approach on the public Gait and EEG dataset and provides analysis of the experimental results. Finally, Section~\ref{sec:discussions_and_future_work} discusses the opening challenges of this work and highlight the future scope while Section~\ref{sec:conclusion} summarizes the key points this paper.
\section{Related Work}
\label{sec:Related Work}
In this section, we introduce the related studies on several topics: biometric authentication technologies, EEG-based authentication, gait-based authentication, and multimodal biometric authentication.
\subsection{Biometric authentication technologies}
\label{sec:biometric_authentication_technologies}
Since biometric features cannot be stolen or duplicated easily, biometric authentication is becoming increasingly a commonplace. Currently, the most mature biometric authentication technology is fingerprint-based authentication which has been demonstrated to high matching accuracy and been used for decades \cite{maio2002fvc2002}. Iris recognition is another popular approach for biometric authentication owing to its unique and stable pattern \cite{pillai2014cross}.
In 1993, Daugman \cite{daugman1993high} proposes to use Gabor phase information and Hamming distance for iris code matching, which still is the most classic iris recognition method. Based on \cite{daugman1993high}, a flurry of research \cite{pillai2014cross} has emerged offering solutions to ameliorate iris authentication problems.
For example, Pillai et al. \cite{pillai2014cross} introduce kernel functions to represent transformations of iris biometrics. This method restrains both the intra-class and inter-class variability to solve the sensor mismatch problem. Face recognition techniques \cite{guzman2013thermal, drira20133d, zhou2014recent} is the most commonly used and accepted by the public for its unique features and non-intrusiveness. Since face recognition systems require tackling different challenges including expression, image quality, illumination, and disguise to achieve high accuracy, infrared (IR) \cite{guzman2013thermal} and 3D \cite{drira20133d} systems have attracted much attention. According to \cite{zhou2014recent}, multimodal recognition combining traditional visual textual features and IR or 3D systems can achieve higher accuracy than single modal systems. \par
\subsection{EEG-based Authentication}
\label{sec:eeg_based_authentication}
Since EEG can be gathered in a safe and non-intrusive way, researchers have paid great attention to exploring this kind of brain signals. For person authentication, EEG is, on the one hand, promising for being confidential and fake-resistant but, on the other hand, complex and hard to be analyzed. Marcel and Mill{\'a}n \cite{marcel2007person} use Gaussian Mixture Models and train client models with maximum A Posteriori (MAP). Ashby et al. \cite{ashby2011low} extract five sets of features from EEG electrodes and inter-hemispheric data, combine them together, and process the final features with support vector machine (SVM). The study shows that EEG authentication is also feasible with less-expensive devices. Altahat et al. \cite{altahat2015analysing} select Power Spectral Density (PSD) as the feature instead of the widely used autoregressive (AR) models to achieve higher accuracy. They also conduct channel selection to determine the contributing channels among all 64 channels. Thomas and Vinod \cite{thomas2016utilizing} take advantage of individual alpha frequency (IAF) and delta band signals to compose specific feature vector. They also prefer PSD features but only perform the extraction merely on gamma band.
\subsection{Gait-based Authentication}
\label{sec:gait_based_authentication}
As the most basic activity in our daily lives, walking is an advanced research hotspot for activity recognition \cite{yao2016learning, huang2016exploiting, mennicken2016s}. Differing from previous work, our work focuses on human gait, a spatio-temporal biometric that measures a person's manner
on walking. On the one hand, gait can be collected remotely without human interaction
compared
to
other aforementioned biometric features \cite{wang2012human}.
On the other hand, it is challenging to eliminate the influence of exterior factors including clothing, walking surface, shoes, carrying stuff, and other environmental factors. Existing gait recognition approaches sit in two categories. One is {\em model-based approach} \cite{nixon2009model}, which models gait information with mathematical structures, and the other is
{\em appearance-based approach}, which extracts features in a straightforward way irrespective of the mathematical structure.
Due to its high efficiency and remarkable performance, Gait Energy Image (GEI) \cite{man2006individual} has become one of the most popular appearance-based methods in recent years. Based on GEIs,
conducts enhancing process and autocorrelation on the contour profile. Besides, the cross-view variance is also a concern of gait identification \cite{kusakunniran2013new, kusakunniran2014recognizing}. For example, Wu et al. \cite{wu2017comprehensive} consider not only the cross-view variance but also deep convolutional neural networks (CNNs) for robust gait identification.
\subsection{Multimodal Biometric Authentication}
\label{sec:multimodal_biometric_authentication}
Since traditional unimodal authentication suffers from the negative influence of loud noise, low universality, and intra-class variation, it cannot achieve higher accuracy in a wide range of applications. To address this issue, multimodal biometric authentication
which combines and uses biometric traits in different ways, is becoming popular. Taking the commonness into consideration, most works choose two biometrics from face, iris, and fingerprints and make the fusion \cite{telgad2014combination, khiari2016quality, kumar2013feature}. In \cite{derawi2014fusion}, an innovative combination between gait and electrocardiogram (ECG) is shown to be effective. Manjunathswamy et al. \cite{manjunathswamy2015multimodal} combine ECG and fingerprint at the score level.
To the best of our knowledge, the approach proposed in this paper is the first
to combine EEG and gaits for person authentication. Taking advantages of both EEG and gait signals, the combination is expected to improve the reliability of authentication systems.
This dual-authentication system is partially based on our previous work MindID \cite{zhang2018mindid} which is an EEG-based identification system. We emphasize several difference compared to \cite{zhang2018mindid}: 1) this work is an authentication system with an invalid ID filter while \cite{zhang2018mindid} only focuses on identification; 2) this work adopt two biometrics including EEG and gait while \cite{zhang2018mindid} only exploit EEG signals; 3) this work conduct extensive real world experiments to collect gait signals.
\section{Deepkey Authentication System}
\label{sec:The Proposed approach}
In this section, we first report the workflow of Deepkey
to give
an overview of the authentication algorithm, and then present the technical details for each component.
\subsection{Deepkey System Overview}
\label{sec:system_overview}
\begin{figure}
\includegraphics[width=\linewidth]{figure/scenario.pdf}
\caption{Workflow of Deepkey authentication system. The data collection of EEG and gait are cascade.}
\label{fig:scenario}
\end{figure}
The Deepkey system is supposed to be deployed in access to confidential locations (e.g., bank vouchers, military bases, and government confidential residences). As shown in Figure~\ref{fig:scenario}, the overall workflow of the Deepkey authentication system consists of the following four steps:
\begin{enumerate}
\item Step 1: EEG data collection. The subject, who
requests for authentication, is required to wear the EEG headset and stays in a relaxed state.
The EEG data ($\mathcal{E}$) will typically take 2 seconds.
\item Step 2: Gait data collection. The subject takes off the EEG headset and puts three IMUs (Inertial Measurement Unit) and walks through an aisle to collect gait data $\mathcal{G}$ by IMUs.
\item Step 3: Authentication. The gathered EEG and gait data are flatten and associated with input data $\mathcal{I} =[\mathcal{E}:\mathcal{G}]$ to be fed into the Deepkey authentication algorithm.
\item Step 4: Decision. An \textit{Approve} or \textit{Deny} decision will be made according to the Deepkey authentication results.
\end{enumerate}
The most crucial component among above the steps is the third step, where the Deepkey authentication system receives the associated input data $\mathcal{I}$ and accomplishes two goals: authentication and identification.
For the former goal, we employ EEG signals to justify the impostor for its high fake-resistance. EEG signals are invisible and unique, making them difficult to be duplicated and hacked.
For the latter goal, we adopt a deep learning model to extract the distinctive features and feed them into a non-parametric neighbor-based classifier for ID identification. In summary, the Deepkey authentication algorithm contains several key stages, namely {\em Invalid ID Filter}, {\em Gait-based Identification}, {\em EEG-based Identification} and {\em Decision Making}.
The overall authentication contains the following several stages (Figure~\ref{fig:attention}):
\begin{enumerate}
\item Based on the EEG data, the Invalid ID Filter decides the subject is an impostor or a genuine. If the subject is an impostor, the request will be denied.
\item If the individual is determined as genuine, the EEG/Gait Identification Model will identify the individual's authorized EEG/Gait ID. This model is pre-trained off-line with the attention-based Long Short-Term Member (LSTM) model (Section~\ref{sec:eeg_id_identification_model}). The output is the ID number associated with the person's detailed personal information.
\item The final stage is to check the consistency of the EEG ID and the Gait ID. If they are identical,
the system will grant an approval, otherwise, deny the subject and take corresponding security measures.
\end{enumerate}
\begin{table}%
\caption{Notation}
\label{tab:notation}
\begin{minipage}{\columnwidth}
\begin{center}
\begin{tabular}{ll}
\toprule
\textbf Parameters& \textbf Explanation\\
\hline
$L^{\circ}$ & the number of authorized subjects (genuine)\\
$E$ & the set of EEG signals \\
$G$ & the set of gait signals \\
$n_s$ & the number of features in input data sample\\
$G_i$ & the $i$-th gait data\\
$n_g$ & the number of features in per gait sample\\
$E_i$ & the $i$-th EEG data\\
$n_e$ & the number of features in EEG data sample\\
$X^i$ & the data in the $i$-th layer of attention RNN\\
$N^i$ &the number of dimensions in $X^i$\\
$K$ & the number of participants (genuine and impostor) \\
$c^{i'}_{j} $ & the hidden state in the $j$-th LSTM cell \\
$\mathcal{T}(\cdot)$ & the linear calculation of dense neural layers \\
$\mathcal{L}(\cdot)$ & The LSTM calculation process \\
$\odot$ & the element\-wise multiplication \\
$C_{att}$ & attention based code \\
\bottomrule
\end{tabular}
\end{center}
\end{minipage}
\end{table}%
\begin{figure}[t]
\includegraphics[width=0.8\linewidth]{figure/EEG_topo.pdf}
\caption{EEG topography of different subjects under different frequency bands. The inter-subject EEG signal cosine-similarity is calculated under each band and the results are reported as $0.1313$ (full bands), $0.0722$ (Delta band), $0.1672$ (Theta band), $0.2819$ (Alpha band), $0.0888$ (Beta band), and $0.082$ (Gamma band). This illustrates that the delta band with the lowest similarity contains the most distinguishable features for person identification.}
\label{fig:topo}
\end{figure}
\subsection{Invalid ID Filter Model}
\label{sec:invalid_detection_model}
Since the high fake-resistance of EEG data and rich distinguishable features in EEG signal, which lead to competitive invalid filter performance, in the Invalid ID Filter Model, only the EEG data $E_i$ is utilized to detect the genuine\footnote{Through our preliminary experiments, the gait signal is not effectiveness enough for invalid ID filtering.}.
The subjects in an authentication system are categorized into two classes: {\em authorized} and {\em unauthorized}. Since the unauthorized data are not available in training stage, therefore, an unsupervised learning algorithm is required to identify the invalid ID. In this work, we apply one-class SVM to sort out the unauthorized subjects.
Given a set of authorized subjects $\mathcal{S}=\left \{S_{i},i=1,2,\cdots,L^{\circ}\right \}$,
$S_{i}\in R^{n_s}$, where $L^{\circ}$ denotes the number of authorized subjects and $n_s$ denotes the number of dimensions
of the input data.
The input data consist of
EEG data $\mathcal{E}=\left \{E_{i},i=1,2,\cdots,L^{\circ}\right \}$, $E_{i}\in R^{n_e}$ and gait data $\mathcal{G}=\left \{ G_{i},i=1,2,\cdots,L^{\circ}\right \}, G_{i}\in R^{n_g}$.
$n_g$ and $n_e$ denote the number of dimensions
of the
gait data and EEG data, respectively, and
$n_s=n_g+n_e$. The notation can be found in Table~\ref{tab:notation}.
For each authentication, the collected EEG data $E_i$ includes a number of samples. Each sample is a vector with shape $[1,14]$ where $14$ denotes the number of electric-nodes in Emotiv headset. To trade-off the authentication efficiency (less collecting and waiting time) and
computational performance,
based on the experimental experience, we fed 200 samples ([200, 14]) into the Invalid ID Filter. 200 EEG samples are collected in 1.56 seconds which is acceptable.
The final filter result is the mean of the results on all the samples.
\begin{table*}[!tb]
\centering
\caption{Characteristics of EEG frequency bands. Awareness Degree denotes the degree of being aware of an external world.}
\label{tab:bands}
\resizebox{\textwidth}{!}{
\begin{tabular}{llllll}
\hline
\textbf{Name} & \textbf{Frequency ($Hz$)} & \textbf{Amplitude} & \textbf{Brain State} & \textbf{Awareness Degree} & \textbf{Produced Location} \\ \hline
\textbf{Delta} & 0.5-3.5 & Higher & Deep sleep pattern & Lower & Frontally and posteriorly \\
\textbf{Theta} & 4-8 & High & Light sleep pattern & Low & Entorhinal cortex, hippocampus \\
\textbf{Alpha} & 8-12 & Medium & Closing the eyes, relax state & Medium & Posterior regions of head \\
\textbf{Beta} & 12-30 & Low & \begin{tabular}[c]{@{}l@{}}Active thinking, focus, \\high alert, anxious \end{tabular} & High & Most evident frontally \\
\textbf{Gamma} & 30-100 & Lower & \begin{tabular}[c]{@{}l@{}}During cross-modal \\sensory processing \end{tabular} & Higher & Somatosensory cortex\\ \hline
\end{tabular}
}
\end{table*}
\begin{figure}[t]
\includegraphics[width=0.8\linewidth]{figure/workflow.pdf}
\caption{Authentication workflow. If the input data can not pass the invalid ID filter, it would directly regarded as an impostor and deny access. If pass, the Delta pattern and gait signals are parallelly fed into an attention-based RNN structure to study the distinctive features $C_{att}$. The learned features are classified by the EEG and Gait classifier in order to identify the subject's EEG and Gait ID. The subject is approved only if the EEG ID is match with Gait ID.}
\label{fig:attention}
\end{figure}
\subsection{EEG Identification Model}
\label{sec:eeg_id_identification_model}
Compared to
gait data,
EEG data contain more noise which is more challenging to handle. Given the complexity of EEG signals, the data pre-processing is necessary. In practical EEG data analysis, the assembled EEG signals can be divided into several different frequency patterns (delta, theta, alpha, beta, and gamma) based on the strong intra-band correlation with a distinct behavioral state.
The EEG frequency patterns and the corresponding characters are listed in Table~\ref{tab:bands} \cite{zhang2018mindid}. Figure~\ref{fig:topo} reports the topography of EEG signals of different subjects under different frequency bands and demonstrates that the Delta wave, compared to other bands, enriches distinctive features. In detail, we calculate the inter-subject EEG signal cosine-similarity which measure the average similarity among different subjects under all the EEG bands. The results are reported as 0.1313 (full bands), 0.0722(Delta band), 0.1672 (Theta band), 0.2819 (Alpha band), 0.0888 (Beta band), and 0.082 (Gamma band). This
illustrates that the delta band with the lowest similarity contains the most distinguishable features for person
identification. Our previous work \cite{zhang2018mindid} has demonstrated that Delta pattern, compare to other EEG patterns contains the most distinctive information and is the most stable pattern in different environments by qualitative analysis and empirical experiment results. Thus, in this paper, we adopt a bandpass (0.5Hz-3.5Hz) butter-worth filter to extract Delta wave signal for further authentication. For simplicity, we denote the filtered EEG data as $\mathcal{E}$.
Since different EEG channels record different aspects of the brain signals, some of which are more representative of the individual, an approach that assumes all dimensions to be equal may not be suitable. Thus, we attempt to develop a novel model which can pay more attention to the most informative signals. In particular, the proposed approach is supposed to automatically learn the importance of the different parts of the EEG signal and focus on the valuable part. The effectiveness of attention-based RNN has been demonstrated in various domains including natural language processing \cite{wang2016attention} and speech recognition \cite{chan2017speech}.
Inspired by the wide success of this approach, we introduce the attention mechanism to the Encoder-Decoder RNN model to assign varying weights to different dimensions of the EEG data.
After EEG filtering, the composed Delta pattern $\mathcal{E}$ is fed into an attention-based Encoder-Decoder RNN structure \cite{wang2016attention} aiming to learn more representative features for user identification. The general Encoder-Decoder RNN framework regards all the feature dimensions of input sequence has the same weights, no matter how important the dimension is for the output sequence. In this paper, the different feature dimensions of the EEG data
correspond
to the different nodes of the EEG equipment. For example, the first dimension (first channel) collects the EEG data from the $AF3$\footnote{Both $AF3$ and $O1$ are EEG measurement positions in the International 10-20 Systems.} node
located at the frontal lobe of the scalp while the 7-th dimension is gathered from $O1$ node at the occipital lobe.
To assign
various
weights to different dimensions of $\mathcal{E}$, we introduce the attention mechanism to the Encoder-Decoder RNN model. The proposed attention-based Encoder-Decoder RNN
consists of three components (Figure~\ref{fig:attention}): the encoder, the attention module, and the decoder. The encoder is designed to compress the input Delta $\delta$ wave into a single intermediate code $C$; the attention module helps the encoder
calculate a better intermediate code $C_{att}$ by generating a sequence of the weights $W_{att}$ of different dimensions; the decoder accepts the attention-based code $C_{att}$ and decodes it to the output layer $Y'$.
Suppose the data in $i$-th layer can be denoted by $X^i=(X^i_j;i\in[1,2,\cdots,I], j\in[1,2,\cdots, N^i])$
where $j$ denotes the $j$-th dimension of $X^i$. $I$ represents the number of neural network layers while $N^i$ denotes the number of dimensions in $X^i$. Take the first layer as an example, we have $X^1=\mathcal{E}$ which indicates that the input sequence is the Delta pattern. Let the output sequence be $Y=(Y_k; k\in[1,2,\cdots,K])$ where K denotes the number of users.
In this paper, the user ID is represented by the one-hot label with length $K$.
For simplicity, we define the operation $\mathcal{T}(\cdot)$ as:$\mathcal{T}(X^i)=X^iW+b$.
Further more, we have
$$\mathcal{T}(X^{i-1}_j,X^i_{j-1})=X^{i-1}_j*W'+X^i_{j-1}*W''+b'$$
where $W$, $b$, $W'$, $W''$, $b'$ denote the corresponding weights and biases parameters.
The encoder component contains several non-recurrent fully-connected layers and one recurrent Long Short-Term Memory (LSTM) layer. The non-recurrent layers are employed to construct and fit into a non-linear function to purify the input Delta pattern, the necessity is demonstrated by the preliminary experiments\footnote{Some optimal designs like the neural network layers are validated by the preliminary experiments but the validation procedure will not be reported in this paper for space limitation.}.
The data flow in these non-recurrent layers can be calculated by
$$X^{i+1}=tanh(\mathcal{T}(X^i))$$
where $tanh$ is the activation function. We engage the $tanh$ as an activation function instead of $sigmoid$ for the stronger gradient \cite{lecun1998efficient}. The LSTM layer is adopted to compress the output of non-recurrent layers to a length-fixed sequence which is regarded as the intermediate code $C$. Suppose LSTM is the $i'$-th layer, the code equals to the output of LSTM, which is $C=X^{i'}_j$. The $X^{i'}_j$ can be measured by
\begin{equation}
\label{equ:1}
X^{i'}_j=\mathcal{L}(c^{i'}_{j-1},X^{i-1}_j,X^{i'}_{j-1})
\end{equation}
where $c^{i'}_{j-1}$ denotes the hidden state of the $(j-1)$-th LSTM cell. The operation $\mathcal{L}(\cdot)$ denotes the calculation process of the LSTM structure, which can be inferred from the following equations.
\[X^{i'}_{j}=f_o\odot tanh(c^{i'}_{j})\]
\[c^{i'}_{j}=f_f\odot c^{i'}_{j-1}+f_i\odot f_m\]
\[f_o=sigmoid(\mathcal{T}(X^{i'-1}_{j},X^{i'}_{j-1}))\]
\[f_f=sigmoid(\mathcal{T}(X^{i'-1}_{j},X^{i'}_{j-1}))\]
\[f_i=sigmoid(\mathcal{T}(X^{i'-1}_{j},X^{i'}_{j-1}))\]
\[f_m=tanh(\mathcal{T}(X^{i'-1}_{j},X^{i'}_{j-1}))\]
where $f_o,f_f, f_i$ and $f_m$ represent the output gate, forget gate, input gate and input modulation gate
,
respectively, and $\odot$ denotes the element-wise multiplication.
The attention module accepts the final hidden states as the unnormalized attention weights $W'_{att}$ which can be measured by the mapping operation $\mathcal{L}'(\cdot)$ (similar with Equation~\ref{equ:1})
$$W'_{att}=\mathcal{L}'(c^{i'}_{j-1},X^{i-1}_j,X^{i'}_{j-1})$$
and calculate the normalized attention weights $W_{att}$
$$W_{att}=softmax(W'_{att})$$
The softmax function is employed to normalize the attention weights into the range of $[0,1]$. Therefore, the weights can be explained as the probability that how the code $C$ is relevant to the output results.
Under the attention mechanism, the code $C$ is weighted to $C_{att}$
$$C_{att}=C\odot W_{att}$$
Note, $C$ and $W_{att}$ are trained instantaneously.
The decoder receives the attention-based code $C_{att}$ and decodes it to the output $Y'$.
Since $Y'$ is predicted at the output layer of the attention based RNN model ($Y'=X^I$), we have
$$Y'=\mathcal{T}(C_{att})$$
At last, we employ the cross-entropy cost function and $\ell_2$-norm (with parameter $\lambda$) is selected to prevent overfitting. The cost is optimized by the AdamOptimizer algorithm \cite{kingma2014adam}.
The iterations threshold of attention-based RNN is set as $n^E_{iter}$.
The weighted code $C_{att}$ has a
direct linear relationship with the output layer and the predicted results. If the model is well trained with low cost, we could regard the weighted code as a high-quality representation of the user ID. We set the learned deep feature $X_D$ to $C_{att}$, $X_D=C_{att}$, and feed it into a lightweight nearest neighbor classifier. The EEG ID, which is denoted by $E_{ID}$, can be directly predicted by the classifier.
\begin{algorithm}[!t]
\caption{Deepkey System}
\label{alg:Deepkey}
\begin{algorithmic}[1]
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\REQUIRE EEG data $\mathcal{E}$ and Gait data $\mathcal{G}$
\ENSURE Authentication Decision: Approve/Deny
\STATE \#Invalid ID Filter:
\FOR{$\mathcal{E}, \mathcal{G}$}
\STATE Genuine/Impostor $\gets \mathcal{E}$
\IF{Impostor}
\RETURN Deny
\ELSIF{Genuine}
\STATE \#EEG Identification Model:
\WHILE{$iteration<n^E_{iter}$}
\STATE $X^{i+1}=tanh(\mathcal{T}(X^i))$ \COMMENT{$X^1 = \mathcal{E}$}
\STATE $C=X^{i'}_j=\mathcal{L}(c^{i'}_{j-1},X^{i-1}_j,X^{i'}_{j-1})$
\STATE $W_{att}=softmax(\mathcal{L}'(c^{i'}_{j-1},X^{i-1}_j,X^{i'}_{j-1}))$
\STATE $C_{att}=C\odot W_{att}$
\STATE $E_{ID}\gets C_{att}$
\ENDWHILE
\STATE \#Gait Identification Model:
\WHILE{$iteration<n^G_{iter}$}
\STATE $G_{ID}\gets \mathcal{G}$
\ENDWHILE
\IF{$E_{ID}=G_{ID}$}
\RETURN Approve
\ELSE
\RETURN Deny
\ENDIF
\ENDIF
\ENDFOR
\end{algorithmic}
\end{algorithm}
The Gait Identification Model
works similar as the EEG Identification Model except the frequency band filtering. The iterations threshold of attention-based RNN is set as $n^G_{iter}$.
The Gait Identification Model receives subjects' gait data $\mathcal{G}$ from the input data $\mathcal{I}$ and
maps to the user's Gait ID $G_{ID}$. All the model structures, hyper-parameters, optimization, and other settings in the EEG and Gait Identification Models remain the same to keep the lower model complexity of the Deepkey system.
\begin{figure}[!t]
\includegraphics[width=\linewidth]{figure/collection.pdf}
\caption{Data collection. Two collection steps are cascade to eliminate the impact on EEG data of walking. The first step collects the solo EEG signals while the second step collects the gait signals.}
\label{fig:collection}
\end{figure}
\section{Experiments and results}
\label{sec:experiment_and_results}
In this section, we first outline the experimental setting including dataset, hyper-parameters settings, and evaluation metrics. Then we systematically investigate:
1) the comparison with the state-of-the-art authentication systems in both system-level and component-level;
2) the impact of key paramters like single/multiple sessions\footnote{Single session refers to the dataset collected in one session (the period from one subject putting the EEG headset on until all the experiments are finished then putting off). Multi-session represents the EEG data is collected from different sessions, which considered the effect on EEG data quality caused by the headset position errors.}, EEG band, and datasize;
3) the authentication latency?
\subsection{Experimental Settings}
\label{sub:setting}
\begin{table}[!bt]
\centering
\caption{Datasets description. \#-D denotes the number of dimensions.}
\label{tab:dataset}
\resizebox{0.6\textwidth}{!}{
\begin{tabular}{llllll}
\rowcolor[HTML]{FFFFFF}
\hline
\textbf{Dataset} & \textbf{Biometric} & \textbf{\#-D} & \textbf{Session} & \textbf{Frequency} & \textbf{Samples} \\ \hline
\textbf{EID-S} & EEG & 14 & Single & 128Hz & 49,000 \\
\textbf{EID-M} & EEG & 14 & Multiple & 128Hz & 147,000 \\
\textbf{GID-S} & Gait & 27 & Single & 80Hz & 140,000 \\
\textbf{GID-M} & Gait & 27 & Multiple & 80Hz & 420,000 \\ \hline
\end{tabular}
}
\vspace{-3mm}
\end{table}
\begin{table*}[!bt]
\centering
\caption{System-level comparison between Deepkey and other biometrics authentication systems. The performance of our methods are evaluated on multi-session datasets (EID-M, GID-M).}
\label{tab:system_comparison}
\resizebox{\textwidth}{!}{\begin{tabular}{lllllllll}
\hline \hline
& \textbf{Reference} & \textbf{Biometric} & \textbf{Method} & \#-Subject & Dataset & \textbf{Accuracy} & \textbf{FAR} & \textbf{FRR} \\ \hline
\multirow{11}{*}{\begin{tabular}[c]{@{}l@{}}\textbf{Uni-}\\ \textbf{-modal}\end{tabular}} & \cite{cola2016gait} & Gait & semi-supervised anomaly detection+NN & 15 & Local & 97.4 & & \\
& \cite{muramatsu2015gait} & Gait & AVTM-PdVs &100 & Public & 77.72 & & \\
& \cite{al2017unobtrusive} & Gait & MLP & 60 &Local & 99.01 & & \\
& \cite{sun2014gait} & Gait & Artificial features + voting classifier & 10 &Local & 98.75 & & \\
& \cite{konno2015gait} & Gait & Two SVMs & 50 &Local & & 1.0 & 1.0 \\
& \cite{thomas2017eeg} & EEG & PSD + cross-correlation values &109 &Public & & 1.96 &1.96 \\
& \cite{chuang2013think} & EEG & Customized Threshold &15 &Local & & 0& 2.2 \\
& \cite{gui2014exploring} & EEG &Low-pass filter+wavelets+ ANN &32 &Local & 90.03 & & \\
& \cite{bashar2016human} & EEG & Bandpass FIR filter +ECOC + SVM & 9 & Local & 94.44 & & \\
& \cite{thomas2016utilizing} & EEG & \begin{tabular}[c]{@{}l@{}}IAF + delta band EEG \\ + Cross-correlation values\end{tabular} &109 &Public & 90.21 & & \\
& \cite{jayarathne2016brainid} & EEG & CSP +LDA & 12 & Local & 96.97 & & \\
& \cite{zhang2018mindid} & EEG & Attention-based RNN + XGB & 8 &Local & 98.82 & & \\
& \cite{keshishzadeh2016improved} & EEG & AR + SVM & 104 & Public& 97.43 & & \\ \hline \hline
\multirow{18}{*}{\begin{tabular}[c]{@{}l@{}}\textbf{Multi-}\\ \textbf{-modal}\end{tabular}} & \multirow{3}{*}{\cite{long2012multimodal}} & Fingerprint & \multirow{3}{*}{ZM + RBF Neural Network} & & & 92.89 & 7.108 & 7.151 \\
& & Face & & & & & 11.52 & 13.47 \\
& & Fusion & & 40 &Public & & 4.95 & 1.12 \\ \cline{2-9}
& \multirow{3}{*}{\cite{yano2012multimodal}} & Iris & \multirow{3}{*}{\begin{tabular}[c]{@{}l@{}}Gabor 2D wavelets + Gabor 2D wavelets\\ + Hamming distance \end{tabular}} & & & & 13.88 & 13.88 \\
& & Pupil & & & & &5.47 & 5.47 \\
& & Fusion & & 59 &Public & &2.44 & 2.44 \\ \cline{2-9}
& \multirow{3}{*}{\cite{manjunathswamy2015multimodal}} & ECG & wavelet decomposition & & & & 2.37 & 9.52 \\
& & Fingerprint & Histogram manipulation Image Enhancement & & & & 7.77 & 5.55 \\
& & Fusion & Score Fusion &50 &Public & & 2.5 & 0 \\ \cline{2-9}
& \multirow{3}{*}{\cite{derawi2014fusion}} & ECG & \multirow{2}{*}{linear time interpolation + cross correlation} & & & & 4.2 & 4.2 \\
& & Gait & & & & & 7.5 & 7.5 \\
& & Fusion & Score Fusion & 30 &Local & & 1.26 &1.26 \\ \cline{2-9}
& \multirow{3}{*}{Ours} & EEG & Delta wave + Attention-based RNN +KNN & & & 99.96 & & \\
& & Gait & Attention-based RNN +KNN & & & 99.61 & & \\
& & Fusion & &7 &Local & \textbf{99.57} & \textbf{0} & \textbf{1.0} \\ \hline \hline
\end{tabular}}
\end{table*}
\begin{figure*}[t]
\hspace{5mm}
\centering
\begin{subfigure}[t]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/eeg_1trial_cm.png}
\caption{EID-S CM}
\end{subfigure}%
\begin{subfigure}[t]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/eeg_3trial_cm.png}
\caption{EID-M CM}
\end{subfigure}%
\begin{subfigure}[t]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/gait_1trial_cm.png}
\caption{GID-S CM}
\end{subfigure}%
\begin{subfigure}[t]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/gait_3trial_cm.png}
\caption{GID-M CM}
\end{subfigure}%
\centering
\begin{subfigure}[t]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/deepkey_eeg_1trial_roc.png}
\caption{EID-S ROC}
\end{subfigure}%
\begin{subfigure}[t]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/deepkey_eeg_3trial_roc.png}
\caption{EID-M ROC}
\end{subfigure}%
\begin{subfigure}[t]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/deepkey_gait_1trial_roc.png}
\caption{GID-S ROC}
\end{subfigure}%
\begin{subfigure}[t]{0.25\textwidth}
\centering
\includegraphics[width=\textwidth]{figure/deepkey_gait_3trial_roc.png}
\caption{GID-M ROC}
\end{subfigure}%
\caption{Confusion matrix and ROC curves of the datasets. CM denotes confusion matrix. The AUC are provided on the figures. }
\label{fig:cm_roc}
\end{figure*}
\begin{table*}[tb]
\centering
\caption{Classification report of the datasets including precision, recall and F-1 score. The proposed approach gains impressive results (higher than 99\%) on all the metrics over all the 7 subjects.
}
\label{tab:classification_report}
\resizebox{\textwidth}{!}{
\begin{tabular}{l|lll|lll|lll|lll}
\hline
\textbf{Datasets} & \multicolumn{3}{c|}{\textbf{EID-S}} & \multicolumn{3}{c|}{\textbf{EID-M}} & \multicolumn{3}{c|}{\textbf{GID-S}} & \multicolumn{3}{c}{\textbf{GID-M}} \\ \hline
\textbf{Metrics} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-score} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-score} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-score} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-score} \\ \hline
\textbf{0} & 1.0 & 1.0 & 1.0 & 0.998 & 1.0 & 0.999 & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 \\
\textbf{1} & 1.0 & 1.0 & 1.0 & 1.0 & 0.9996 & 0.9998 & 0.996 & 0.996 & 0.996 & 0.9915 & 0.9904 & 0.9909 \\
\textbf{2} & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 & 0.9999 & 1.0 & 0.9999 \\
\textbf{3} & 1.0 & 1.0 & 1.0 & 1.0 & 0.9992 & 0.9996 & 0.9992 & 0.9988 & 0.999 & 0.9937 & 0.9948 & 0.9942 \\
\textbf{4} & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 & 1.0 & 0.9976 & 0.998 & 0.9978 & 0.9949 & 0.996 & 0.9955 \\
\textbf{5} & 1.0 & 1.0 & 1.0 & 0.9996 & 0.9992 & 0.9994 & 0.9969 & 0.9984 & 0.9977 & 0.9963 & 0.996 & 0.9961 \\
\textbf{6} & 1.0 & 1.0 & 1.0 & 0.9996 & 0.9993 & 0.9994 & 0.9988 & 0.9972 & 0.998 & 0.9962 & 0.9953 & 0.9958 \\
\textbf{Average} & \textbf{1.0} & \textbf{1.0} & \textbf{1.0} & \textbf{0.9996} & \textbf{0.9996} & \textbf{0.9996} & \textbf{0.9983} & \textbf{0.9983} & \textbf{0.9983} & \textbf{0.9961} & \textbf{0.9961} & \textbf{0.9961} \\ \hline
\end{tabular}
}
\end{table*}
\subsubsection{Datasets}
\label{sub:datasets}
We design real-world experiments to collect EEG data and gait data in cascade. The experiments (Figure~\ref{fig:collection}) are conducted by 7 healthy participants aged $26\pm2$ including 4 males and 3 females.
In Step 1, each participant remains standing and
relaxed with eye closed.
The EEG data are collected by EPOC+ Emotiv headset\footnote{\url{https://www.emotiv.com/product/emotiv-epoc-14-channel-mobile-eeg/}} which integrates 14 electrodes (corresponding to 14 EEG channels) with 128Hz sampling rate.
In Step 2, each participant walks in an aisle to generate the gait data. In the gait collection procedure, three IMUs are attached to the participants' left wrist, the middle of the back, and the left ankle, respectively. Each IMU (PhidgetSpatial 3/3/3\footnote{\url{https://www.phidgets.com/?&prodid=48}}) with 80Hz sampling rate gathering 9 dimensional motor features contains a 3-axis accelerometers, 3-axis gyroscopes, and 3-axis magnetometers.
To investigate the impact of dataset sessions, both the EEG and gait data are collected in three sessions. In every cycle of single session, the subject puts on the equipment (headset/IMUs), gathers data, and then takes the equipment off. Therefore, in different sessions, the positions of the equipment may have slight deviation.
Table~\ref{tab:dataset} reports the details of the datasets used in this paper. Each EEG or gait sample contains 10 continuous instances without overlapping.
The single session datasets (EID-S and GID-S) are collected in single experiment session whilst the multi-session datasets (EID-M and GID-M) are gathered in three sessions. All the sessions are conducted in the same place but three different days (each session in one day). The EEG data are easily influenced if the emotional or physical states has changed, thus, we believe the collected data are diverse because of the varying environmental factors (e.g., noise and temperature) and subjective factors (e.g., participants' mental state and fatigue state). Similarly, the gait signals could be affected by lots of variables like different shoes (comfortable/uncomfortable). In this paper, as an exploratory work, we focus to develop a robust discriminative deep learning model which is strong enough to prevent the corruption of the aforementioned influencing factors. The investigation of the detail effect brought by each specific factor will be left as a future research direction.
\subsubsection{Parameter Settings}
\label{sub:parameter_settings}
The Invalid ID Filter attempts to recognize the unauthorized subject based on the unique EEG data. The filter chooses the RBF kernel with $nu = 0.15$. In the EEG Identification Model, the Delta band ($[0.5Hz,3.5Hz]$) is filtered by 3 order butter-worth bandpass filter. In the attention-based RNN, for both EEG and gait, each hidden layer contains 64 nodes, while the learning rate and $\lambda$ are both set to 0.001. The weighted code is produced after 1,000 iterations.
87.5\% of the datasets are used for training while the remaining datasets are used for testing. The user ID is ranged from 0 to 6 and represented in the one-hot label.
\begin{table*}[t]
\centering
\caption{Component-level comparison. DL denotes Deep Learning. Att-RNN denotes attention-based RNN.
}
\label{tab:component_level_comparison}
\resizebox{\textwidth}{!}{
\begin{tabular}{l|l|llll|llll}
\hline \hline
\multirow{2}{*}{\textbf{Baseline}} & \multirow{2}{*}{\textbf{Methods}} & \multicolumn{4}{c|}{\textbf{EID-S}} & \multicolumn{4}{c}{\textbf{EID-M}} \\ \cline{3-10}
& & \textbf{Accuracy} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-score} & \textbf{Accuracy} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-score} \\ \hline
\multirow{5}{*}{\textbf{Non-DL Baseline}} & \textbf{SVM} & 0.4588 & 0.5848 & 0.4588 & 0.4681 & 0.7796 & 0.7815 & 0.7796 & 0.7796 \\
& \textbf{RF} & 0.9875 & 0.9879 & 0.9876 & 0.9876 & 0.8124 & 0.8139 & 0.8124 & 0.812 \\
& \textbf{KNN} & 0.9897 & 0.9899 & 0.9898 & 0.9898 & 0.8211 & 0.8232 & 0.8211 & 0.8197 \\
& \textbf{AB} & 0.2872 & 0.3522 & 0.2871 & 0.2337 & 0.3228 & 0.3224 & 0.3228 & 0.2815 \\
& \textbf{LDA} & 0.1567 & 0.1347 & 0.1567 & 0.1386 & 0.3082 & 0.285 & 0.3082 & 0.2877 \\ \hline
\multirow{3}{*}{\textbf{DL Baseline}} & \textbf{LSTM} & 0.9596 & 0.9601 & 0.9596 & 0.9597 & 0.8482 & 0.8509 & 0.8483 & 0.8489 \\
& \textbf{GRU} & 0.9633 & 0.9636 & 0.99631 & 0.9631 & 0.862 & 0.8638 & 0.8626 & 0.8629 \\
& \textbf{CNN} & 0.8822 & 0.8912 & 0.8813 & 0.8912 & 0.7647 & 0.7731 & 0.7854 & 0.7625 \\ \hline
\multirow{3}{*}{\textbf{State-of-the-art}} & \textbf{\cite{jayarathne2016brainid}} & 0.5843 & 0.5726 & 0.5531 & 0.5627 & 0.5735 & 0.5721 & 0.5443 & 0.5579 \\
& \textbf{\cite{keshishzadeh2016improved}} & 0.8254 & 0.8435 & 0.8617 & 0.8525 & 0.8029 & 0.7986 & 0.8125 & 0.8055 \\
& \textbf{\cite{gui2014exploring}} & 0.8711 & 0.8217 & 0.7998 & 0.8106 & 0.8567 & 0.8533 & 0.8651 & 0.8592 \\ \hline
\textbf{} & \textbf{Att-RNN} & 0.9384 & 0.9405 & 0.9388 & 0.9391 & 0.9324 & 0.9343 & 0.9322 & 0.9326 \\
\textbf{} & \textbf{Ours} & \textbf{1.0} & \textbf{1.0} & \textbf{1.0} & \textbf{1.0} & \textbf{0.9996} & \textbf{0.9996} & \textbf{0.9996} & \textbf{0.9996} \\ \hline \hline
\multirow{2}{*}{\textbf{Baselines}} & \multirow{2}{*}{\textbf{Methods}} & \multicolumn{4}{c|}{\textbf{GID-S}} & \multicolumn{4}{c}{\textbf{GID-M}} \\ \cline{3-10}
& & \textbf{Accuracy} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-score} & \textbf{Accuracy} & \textbf{Precision} & \textbf{Recall} & \textbf{F1-score} \\ \hline
\multirow{5}{*}{\textbf{Non-DL Baseline}} & \textbf{SVM} & 0.9981 & 0.9981 & 0.9981 & 0.9981 & 0.993 & 0.993 & 0.993 & 0.993 \\
\textbf{} & \textbf{RF} & 0.9878 & 0.9878 & 0.9878 & 0.9878 & 0.9954 & 0.9954 & 0.9954 & 0.9954 \\
\textbf{} & \textbf{KNN} & 0.9979 & 0.9979 & 0.9979 & 0.9979 & 0.9953 & 0.9953 & 0.9953 & 0.9953 \\
\textbf{} & \textbf{AB} & 0.5408 & 0.5689 & 0.5409 & 0.4849 & 0.5401 & 0.5135 & 0.542 & 0.4985 \\
\textbf{} & \textbf{LDA} & 0.688 & 0.6893 & 0.688 & 0.6855 & 0.6933 & 0.693 & 0.6933 & 0.6915 \\ \hline
\multirow{3}{*}{\textbf{DL Baseline}} & \textbf{LSTM} & 0.9951 & 0.9951 & 0.9951 & 0.9951 & 0.9935 & 0.9936 & 0.9936 & 0.9936 \\
\textbf{} & \textbf{GRU} & 0.9949 & 0.9949 & 0.9949 & 0.9949 & 0.9938 & 0.9938 & 0.9938 & 0.9938 \\
\textbf{} & \textbf{CNN} & 0.9932 & 0.9932 & 0.9932 & 0.9932 & 0.9845 & 0.9845 & 0.9845 & 0.9845 \\ \hline
\textbf{State-of-the-art} & \textbf{\cite{cola2016gait}} & 0.9721 & 0.9789 & 0.9745 & 0.9767 & 0.9653 & 0.9627 & 0.9669 & 0.9648 \\
\textbf{} & \textbf{\cite{al2017unobtrusive}} & 0.9931 & 0.9934 & 0.9957 & 0.9945 & 0.9901 & 0.9931 & 0.9942 & 0.9936 \\
\textbf{} & \textbf{\cite{sun2014gait}} & 0.9917 & 0.9899 & 0.9917 & 0.9908 & 0.9875 & 0.9826 & 0.9844 & 0.9835 \\ \hline
\textbf{} & \textbf{Att-RNN} & 0.99 & 0.99 & 0.99 & 0.99 & 0.9894 & 0.9895 & 0.9895 & 0.9895 \\
\textbf{} & \textbf{Ours} & \textbf{0.9983} & \textbf{0.9983} & \textbf{0.9983} & \textbf{0.9983} & \textbf{0.9961} & \textbf{0.9961} & \textbf{0.9961} & \textbf{0.9961} \\ \hline \hline
\end{tabular}
}
\end{table*}
\subsubsection{Metrics}
\label{sub:evaluation}
The adopted evaluation metrics are accuracy, ROC, AUC, along with {\em False Acceptance Rate} (FAR) and {\em False Rejection Rate } (FRR).
Deepkey is very sensitive to the invalid subject and can acquire very high accuracy in Invalid ID Filter Model for the reason that even tiny misjudgment may lead to catastrophic consequences. Therefore, FAR is more important than other metrics. Therefore, in Deepkey, FAR has higher priority compared to other metrics such as FRR.
\subsection{Overall Comparison}
\label{sub:overall_comparison}
\subsubsection{System-level Comparison}
\label{sub:system_level_comparison}
To evaluate the performance of Deepkey, by comparing it with a set of the state-of-the-art authentication systems. Deepkey is empowered to solve both the authentication and identification problems. As shown in Table~\ref{tab:system_comparison}, Deepkey achieves a FAR of 0 and a FRR of 1\%, outperforming other uni-modal and multimodal authentication systems. Specifically, our approach, compared to the listed uni-modal systems, achieves the highest EEG identification accuracy (99.96\%) and Gait identification accuracy (99.61\%).
\subsubsection{Component-level Comparison}
\label{sub:component_level_comparison}
To have a closer observation, we provide the detailed performance study of each component.
In the Invalid ID Filter, to enhance the accuracy and robustness of the classifier, EEG samples are separated into different segments, with each segment (without overlapping) having $200$ continuous samples.
Six in seven subjects are labeled as genuine while the other subject is labeled as
an impostor. In the training stage, all the EEG segments are fed into the one-class SVM with rbf kernel for pattern learning. In the test stage, 1,000 genuine segments and 1,000 impostor segments are randomly selected to asses the performance. We use the leave-one-out-cross-validation training strategy and achieve \textbf{ a FAR of 0 and a FRR of 0.006}.
In the EEG/Gait Identification Model, the proposed approach achieves an accuracy of 99.96\% and 99.61\% over the multi-session datasets, respectively. The detailed confusion matrix, ROC curves with AUC scores, and the classification reports (precision, recall, and F1-score) over all the datasets are presented in Figure~\ref{fig:cm_roc} and Table~\ref{tab:classification_report}. The above evaluation metrics demonstrate that the proposed approach achieves a performance of over 99\% on all the metrics over each subject and each dataset.
Furthermore, the overall comparison between our model and other state-of-the-art baselines
are listed in Table~\ref{tab:component_level_comparison}. RF denotes Random Forest, AdaB denotes Adaptive Boosting, LDA denotes Linear Discriminant Analysis. In addition, the key parameters of the baselines are listed here: Linear SVM ($C=1$), RF ($n=200$), KNN ($k=3$). The settings of LSTM are the same as the attention-based RNN classifier, along with the GRU (Gated Recurrent Unit).
The CNN contains 2 stacked convolutional layers (both with stride $[1,1]$, patch $[2,2]$, zero-padding, and the depth are 4 and 8, separately.) and followed by one pooling layer (stride $[1,2]$, zero-padding) and one fully connected layer (164 nodes). Relu activation function is employed in the CNN.
The methods used for comparison (3 for EEG-based authentication and 3 for gait-based authentication) are introduced as follows:
\begin{itemize}
\item Jayarathne et al. \cite{jayarathne2016brainid} feed EEG data to a bandpass filter ($8Hz-30Hz$), extract CSP (Common Spatial Pattern) and recognize the user ID by LDA.
\item Keshishzadeh et al. \cite{keshishzadeh2016improved} extract autoregressive coefficients as the features and identify the subject by SVM.
\item Gui et al. \cite{gui2014exploring} employ low-pass filter (60Hz) and wavelet packet decomposition to generate features and distinguish unauthorized person through deep neural network.
\item Cola et al. \cite{cola2016gait}
hire neural networks to analyze user gait pattern by artificial features such as kurtosis, peak-to-peak amplitude and skewness.
\item Al-Naffakh et al. \cite{al2017unobtrusive} propose to utilize time-domain statistical features and Multilayer Perception (MLP) for person identify.
\item Sun et al. \cite{sun2014gait} adopt a weighted voting classifier to process the extracted features like gait frequency, symmetry coefficient, and dynamic range.
\end{itemize}
\begin{table*}[t]
\centering
\caption{EEG bands comparison. The full band denotes the raw EEG data with full frequency bands.}
\label{tab:bands_comparison}
\resizebox{\textwidth}{!}{
\begin{tabular}{lllllllllll}
\hline \hline
\multirow{2}{*}{\textbf{Dataset}} & \multirow{2}{*}{\textbf{Baseline}} & \multirow{2}{*}{\textbf{Methods}} & \multicolumn{6}{c}{\textbf{EEG Bands}} & \multirow{2}{*}{\textbf{Best Level}} & \multirow{2}{*}{\textbf{Best Band}} \\ \cline{4-9}
& & & \textbf{Delta} & \textbf{Theta} & \textbf{Alpha} & \textbf{Beta} & \textbf{Gamma} & \textbf{Full} & & \\ \hline
\multirow{13}{*}{\textbf{EID-S}} & \multirow{5}{*}{\textbf{\begin{tabular}[c]{@{}l@{}}Non-DL\\ Baseline\end{tabular}}} & \textbf{SVM} & 0.4588 & 0.4682 & 0.7484 & 0.5955 & 0.5239 & 0.8788 & 0.8788 & Full \\
& & \textbf{RF} & 0.9875 & 0.8006 & 0.7729 & 0.6376 & 0.5469 & 0.8931 & 0.9875 & Delta \\
& & \textbf{KNN} & 0.9897 & 0.8084 & 0.7465 & 0.5553 & 0.4606 & 0.8792 & 0.9897 & Delta \\
& & \textbf{AB} & 0.2872 & 0.2879 & 0.2318 & 0.3069 & 0.2922 & 0.3289 & 0.3289 & Full \\
& & \textbf{LDA} & 0.1567 & 0.1802 & 0.1957 & 0.1502 & 0.1306 & 0.4547 & 0.4547 & Full \\ \cline{2-11}
& \multirow{3}{*}{\textbf{\begin{tabular}[c]{@{}l@{}}DL\\ Baseline\end{tabular}}} & \textbf{LSTM} & 0.9596 & 0.8126 & 0.8277 & 0.6906 & 0.6027 & 0.9273 & 0.9596 & Delta \\
& & \textbf{GRU} & 0.9633 & 0.7996 & 0.8082 & 0.6902 & \textbf{0.6985} & 0.9251 & 0.9633 & Delta \\
& & \textbf{CNN} & 0.8822 & 0.7416 & 0.8079 & \textbf{0.6918} & 0.6059 & 0.8985 & 0.8985 & Full \\ \cline{2-11}
& & \textbf{\cite{jayarathne2016brainid}} & 0.5843 & 0.4487 & 0.2918 & 0.3017 & 0.4189 & 0.5112 & 0.5843 & Delta \\
& & \textbf{\cite{keshishzadeh2016improved}} & 0.8254 & 0.7935 & 0.7019 & 0.6368 & 0.6621 & 0.8018 & 0.8254 & Delta \\
& \multirow{-3}{*}{\textbf{\begin{tabular}[c]{@{}l@{}}State-of\\ -the-art\end{tabular}}} & \textbf{\cite{gui2014exploring}} & 0.8711 & 0.8531 & 0.7556 & 0.6882 & 0.5101 & 0.7819 & 0.8711 & Delta \\ \cline{2-11}
& \textbf{} & \textbf{Att-RNN} & 0.9384 & 0.7928 & 0.8318 & 0.6854 & 0.6046 & 0.9238 & 0.9384 & Delta \\
& \textbf{} & \textbf{Ours} & \textbf{1.0} & \textbf{0.9285} & \textbf{0.8366} & 0.5529 & 0.4558 & 0.9417 & 1.0 & Delta \\ \hline \hline
\multirow{13}{*}{\textbf{EID-M}} & \multirow{5}{*}{\textbf{\begin{tabular}[c]{@{}l@{}}Non-DL \\ Baseline\end{tabular}}} & \textbf{SVM} & 0.7796 & 0.5424 & 0.5664 & 0.6522 & 0.4915 & 0.7477 & 0.7796 & Delta \\
& & \textbf{RF} & 0.8124 & 0.7194 & 0.7351 & \textbf{0.6842} & 0.4765 & 0.8121 & 0.7194 & Delta \\
& & \textbf{KNN} & 0.8211 & 0.7501 & 0.7649 & 0.6611 & 0.3821 & 0.8162 & 0.7501 & Delta \\
& & \textbf{AB} & 0.3228 & 0.3095 & 0.2478 & 0.2548 & 0.2529 & 0.3189 & 0.3228 & Delta \\
& & \textbf{LDA} & 0.3082 & 0.1681 & 0.1621 & 0.1824 & 0.1311 & 0.2995 & 0.3082 & Delta \\ \cline{2-11}
& \multirow{3}{*}{\textbf{\begin{tabular}[c]{@{}l@{}}DL \\ Baseline\end{tabular}}} & \textbf{LSTM} & 0.8482 & 0.6926 & 0.7438 & 0.5726 & 0.5008 & 0.8185 & 0.8482 & Delta \\
& & \textbf{GRU} & 0.862 & 0.6935 & 0.7531 & 0.5672 & \textbf{0.5072} & 0.8221 & 0.862 & Delta \\
& & \textbf{CNN} & 0.7647 & 0.6712 & 0.7191 & 0.5588 & 0.4949 & 0.7749 & 0.7749 & Full \\ \cline{2-11}
& \multirow{3}{*}{\textbf{\begin{tabular}[c]{@{}l@{}}State-of\\ -the-art\end{tabular}}} & \textbf{\cite{jayarathne2016brainid}} & 0.9721 & 0.7019 & 0.7091 & 0.4189 & 0.4089 & 0.8195 & 0.9721 & Delta \\
& & \textbf{\cite{keshishzadeh2016improved}} & 0.9931 & 0.6891 & 0.6988 & 0.5124 & 0.3397 & 0.7963 & 0.9931 & Delta \\
& &\textbf{\cite{gui2014exploring}} & 0.9917 & 0.7199 & 0.6572 & 0.4911 & 0.3977 & 0.8011 & 0.9917 & Delta \\ \cline{2-11}
& \textbf{} & \textbf{Att-RNN} & 0.9324 & 0.6847 & 0.6846 & 0.5732 & 0.4941 & 0.7976 & 0.9324 & Delta \\
& & \textbf{Ours} & \textbf{0.9996} & \textbf{0.9013} & \textbf{0.8989} & 0.4428 & 0.3661 & \textbf{0.8858} & 0.9996 & Delta\\ \hline \hline
\end{tabular}
}
\end{table*}
\begin{figure*}[t]
\centering
\begin{minipage}[b]{0.48\linewidth}
\centering
\includegraphics[width=\textwidth]{figure/session-eps-converted-to.pdf}
\caption{Impact of Session}
\label{fig:sessions}
\end{minipage}
\begin{minipage}[b]{0.48\textwidth}
\includegraphics[width=\textwidth]{figure/deepkey_latency-eps-converted-to.pdf}
\caption{Latency}
\label{fig:latency}
\end{minipage}
\end{figure*}
The primary conclusions from Table~\ref{tab:component_level_comparison} are summarized as follows:
\begin{itemize}
\item Our approach achieves the highest performance over both EEG and gait datasets under single session and multi-session settings;
\item For most of the baselines, we observe lower accuracy in EEG dataset compared to that in gait dataset, implying the EEG-based authentication is still challenging and our approach has room to improve; nevertheless, our model outperforms others and show superiority to both EEG-based or Gait-based methods;
\item The results on single-session datasets are better than that on multi-session datasets. This is reasonable, and it demonstrates that the number of sessions does affect the authentication accuracy. This problem will be further analyzed in Section~\ref{sub:impact_of_sessions};
\item Our model achieves better performance than Att-RNN. Since the diversity between our model and Att-RNN is that we employ an external classifier, this observation demonstrates that the external classifier is effective and efficient.
\end{itemize}
In Deepkey, the subjects passing the Invalid ID Filter are regarded as genuine only if their recognized IDs are consistent, i.e., $E_{ID}=G_{ID}$. It can be inferred easily that the FAR of Deepkey is
0 as well. However, the FRR depends on one or more of these
three scenarios: the false rejection of Invalid ID Filter; the incorrect Gait identification; the incorrect EEG identification. In summary, the overall FAR is \textbf{0} and the overall FRR is calculated as $\mathbf{1\%}=(0.006+0.994*((1-0.9961)+0.9961*(1-0.9996)))$.
\subsection{Impact of Key Parameters}
\label{sub:impact_of_key_parameters}
\subsubsection{Impact of sessions}
\label{sub:impact_of_sessions}
In practical applications, sessions in different scenarios may result in a minor difference in equipment position, signal quality, and other factors. To investigate the impact of sessions, we conduct external experiments by comparing the performance between single-session datasets and multi-session datasets. The comprehensive evaluation metrics and the comparison over various baselines are listed in Table~\ref{tab:classification_report} and Table~\ref{tab:component_level_comparison} while the comparison is summarized in Figure~\ref{fig:sessions}. The experiment results show that on the multi-session datasets, compared the single-session datasets, we achieve a slightly lower but still highly competitive performance.
\subsubsection{Impact of EEG Band}
\label{sub:impact_of_eeg_band}
A series of comparison experiments are designed to explore the optimal EEG frequency band which contains the most discriminative features. The results presented in Table~\ref{tab:bands_comparison} illustrate that:
\begin{itemize}
\item The Delta band consistently provides higher identification accuracy compared to other frequency bands for both single and multiple sessions. This observation shows that Delta pattern contains the most discriminative information for person identification.
\item Our method gains the best outcome on both datasets with different sessions. This validates the robustness and adaptability of the proposed approach.
\end{itemize}
Why Delta pattern could outperform other patterns since Delta wave mainly appear in deep sleep state? Here we give one possible reason. We know the fact that the EEG patterns are associated with individuals' mental and physical states (organics and systems). For example, while the subject is under deep sleep and producing Delta pattern, the most parts of physical functions of the body (such as sensing, thinking, even dreaming) are completely detached. Only the very essential life-support organs and systems (such as breathing, heart beating, and digesting) keep working, which indicates the brain areas corresponding to life-support functions are active. While the subject is awake (e.g., relax state) and producing Alpha pattern, the subject has more activated functions such as imaging, visualizing and concentrating. Also, more brain functions like hearing, touching, and thinking are attached, which means that more physical brain areas (such as frontal lobe, temporal lobe, and parietal lobe) are activated. At this time, the life-support organs are still working. In short, only the life-support organs related brain areas are active in the first scenario (Delta pattern) whilst the brain areas controlling life-support and high-level functions (e.g., concentrating) are active in the second scenario (Alpha pattern). Thus, we infer that the delta pattern is correspond to the life-support organs and systems, which is the most stable function in different scenarios and the most discriminative signal in inter-subject classification.
\subsubsection{Impact of Datasize}
\label{sub:impact_of_datasize}
Datasize is one crucial influence element in deep learning based algorithms. In this section, we conduct experiments to train the proposed method over various data sizes. As shown in the radar chart (Figure~\ref{fig:datasize}), four datasets are evaluated under different proportion of training datasize. It has five equi-angular spokes which represent the proportion of datasize (20\%, 40\%, 60\%, 80\%, 100\%), respectively. The four concentric circles indicate the accuracy which are 85\%, 90\%, 95\%, and 100\%, respectively. Each closed line represent a dataset and have five intersections with the five spokes. Each intersection node represents the classification accuracy of a specific dataset with a specific proportion datasize. For example, the intersection of EID-S line and 20\% spoke is about 0.92, which denote that our approach achieves the accuracy of 92\% over EID-S dataset with 20\% datasize.
The radar chart infers that gait datasets (GID-S and GID-M) obtain competitive accuracy even with 20 percent datasize; nevertheless, EID-S and EID-M highly rely on the datasize. This phenomenon is reasonable because EEG data has lower signal-to-noise ratio and requires more samples to learn the latent distribution pattern.
\subsection{Latency Analysis}
\label{sub:latency_analysis}
We also study the latency of Deepkey since low delay is highly desirable in real-world deployment.
The latency of Deepkey is compared to the response time of several state-of-the-art authentication approaches. The comparison results are shown in Figure~\ref{fig:latency}.
The latency of our method is 0.39 sec, which is competitive compared
to the state-of-the-art baselines.
Specifically, the reaction time of Deepkey is composed of three components, with the Invalid ID Filter taking 0.06 sec and the ID Identification taking 0.33 sec.
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{figure/radar.png}
\caption{Impact of Datasize. The spokes of this radar chart represent the datasize proportion (20\%, 40\%, 60\%, 80\%, 100\%) while the concentric circles indicate the classification accuracy (85\%, 90\%, 95\%, and 100\%).}
\label{fig:datasize}
\end{figure}
\section{Discussions and Future Work}
\label{sec:discussions_and_future_work}
In this paper, we propose a biometric identification system based both EEG and gait information. In this section, we discuss the open challenges and potential future research directions.
First, the datasets used in this paper only has limited participants. The extensive evaluations over more subjects are necessary. However, compare to some existing works (\cite{zhang2018mindid}, \cite{bashar2016human}, \cite{sun2014gait} have 8, 9, 10 subjects in their experiments, respectively), we believe our participants amount is acceptable.
Our work has already demonstrate that Deepkey can be used in settings such as small offices which are accessed by a small group of people.
In addition, evaluation can be improved by extending observations on how the system performs in different conditions. For example, considering changes in EEG signals during more trails, and longer times (hours, days or even months) to understand if these are consistent and reliable for detection.
Second, wearable sensors like EEG headset and wearable IMUs are required in the data collection stage of Deepkey system. Extensive experiments are meaningful in the future to investigate how the placement position of the wearable sensor matters. The EEG headset position on the head and the IMU position on the arms may affect the authentication performance. With the development of hardware related techniques, the EEG headset is becoming more portable and affordable. For example, the developed cEEGrids\footnote{http://ceegrid.com/home/}, an flex-printed, multi-channel sensor arrays that are placed around the ear using an adhesive, are easy and comfortable to wear and dispatch. This a good tendency of EEG acquisition equipment although the cEEGrids are currently expensive.
In the future, the widely deployment of DeepKey authentication system in real world environment is possible.
Moreover, another future scope is to develop device-free authentication techniques to overstep the inconvenient brought by wearable sensors. We have analyzed the computational latency in Section~\ref{sub:latency_analysis}. However, the overall system latency not only include the computation latency but also include the data collection latency such as the time cost when wear the EEG headset and the IMUs. The data collection latency of our system is about ten seconds while EEG collection requires about four seconds and gait collection requires above six seconds. Compare to other authentication system such as fingerprint, our data collection latency is much higher. This is one of the major future directions of our work. A potential solution is develop device-free authentication system and measure gait signals by environmental sensors such as RFID (Radio Frequency IDentification) tags.
The Received Signal Strength Indication (RSSI) of RFID tag measures the present received signal power which reflects the target subject's walking information.
Additionally, a promising future work is the real-world online deployment of the proposed DeepKey system. Since we have demonstrated that the effectiveness and efficiency of Deepkey in off-line situation, the future step is to build a real-time authentication environment to evaluate the online performance.
Furthermore, the proposed DeepKey still facing the challenge of `in the wild' scenario since the gathered EEG data are easily corrupted by physical actions like walking. In this work, the EEG and gait data are gathered in two separate steps. However, in the outdoor environments, the user is hardly stand still and wait for the authentication. Fortunately, our system has competitive performance in a fixed indoor environment (such as bank vouchers) which can provide a stable data collection environment and mainly concerned about the high fake-resistance.
\section{Conclusion}
\label{sec:conclusion}
Taking the advantages of both EEG- and gait-based systems for fake resistance, we propose Deepkey, a multimodal biometric authentication system, to overcome the limitations of traditional unimodal biometric authentication systems.
This authentication system Deepkey contains three independent models: an Invalid ID Filter Model, a Delta band based EEG Identification Model, and a Gait Identification Model, to detect invalid EEG data, recognize the EEG ID and Gait ID, respectively.
The Deepkey system outperforms the state-of-the-art baselines by achieving a FAR of $0$ and a FRR of $1\%$. In addition, the key parameters (such as sessions and EEG frequency band) and the system latency are also investigated by extensive experiments.
This work sheds the light on further research on multimodal biometric authentication systems based on EEG and gait data. Our future work will focus on deploying the Deepkey system in an online real-world environment. In addition, the gait signals are currently gathered by three wearable IMUs, which may obstruct the large-scale deployment in
practice. Therefore, another direction in the future is to collect gait data from non-wearable gait solutions (e.g., sensors deployed in environments).
\bibliographystyle{ACM-Reference-Format}
| {'timestamp': '2019-05-28T02:26:17', 'yymm': '1706', 'arxiv_id': '1706.01606', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01606'} | arxiv |
\section{Introduction}
Learning distributions is a fundamental problem in statistics and computer science, and has numerous applications in machine learning and signal processing.
The problem can be stated as:
{\begin{quote}{Given an i.i.d.\ sample generated from an unknown probability distribution $g$, find a distribution $\hat{g}$ that is close to $g$ in total variation distance.\footnote{Total variation distance is a prominent distance measure between distributions. For a discussion on this and other choices see~\cite[Chapter~5]{devroye_book}.
}
}\end{quote}}
This strong notion of learning is not possible in general using a finite number of samples. However, if we assume that the target distribution belongs to or can be approximated by a family of distributions, then there is hope to acquire algorithms with finite-sample guarantees. In this paper, we study the important family of mixture models within this framework.
Notice that we consider PAC learning of distributions (a.k.a.\ density estimation), which is different from parameter estimation.
In the parameter estimation problem, it is assumed that the target distribution belongs to some parametric class, and the goal is to learn/identify the parameters (see, e.g.,~\cite{dasgupta1999learning,Belkin,moitravaliant}).
As an example of our setting, assume that the target distribution is a Gaussian mixture with $k$ components in $\mathbb{R}^d$. Then, how many examples do we need to find a distribution that is $\epsilon$-close to the target? This \emph{sample complexity} question, as well as the corresponding \emph{computational complexity} question, has received a lot of attention recently (see, e.g.~\cite{axis_aligned,onedimensional,spherical,robustestimation,gaussian_mixture,nearlylinear}).
In this paper, we consider a scenario in which we are given a method for learning a class of distributions (e.g., Gaussians). Then, we ask whether we can use it, as a black box, to come up with an algorithm for learning a mixture of such distributions (e.g., mixture of Gaussians). We will show that the answer to this question is affirmative.
We propose a generic method for learning mixture models. Roughly speaking, we show that by going from learning a single distribution from a class
to learning a mixture of $k$ distributions from the same class, the sample complexity is multiplied by a factor of at most ${(k\log^2 k)}/{\epsilon^2}$. This result is general, and yet it is surprisingly tight in many important cases.
In this paper, we assume that the algorithm knows the number of components $k$.
As a demonstration, we show that our method provides a better sample complexity for learning mixtures of Gaussians than the state of the art. In particular, for learning mixtures of $k$ Gaussians in $\mathbb{R}^d$, our method requires $\widetilde{O}({d^2k}/{\epsilon^4})$ samples, improving by a factor of $k^2$ over the $\widetilde{O}({d^2k^3}/{\epsilon^4})$ bound of~\cite{gaussian_mixture}.
Furthermore, for the special case of mixtures of axis-aligned Gaussians, we provide an upper bound of $\widetilde{O}({dk}/{\epsilon^{4}})$, which is the first optimal bound with respect to $k$ and $d$ up to logarithmic factors, and improves upon the
$\widetilde{O}({dk^9}/{\epsilon^{4}})$ bound of~\cite{spherical}, which is only shown for the subclass of spherical Gaussians.
One merit of our approach is that it can be applied in the agnostic (a.k.a.\ robust) setting, where the target distribution does not necessarily belong to the mixture model of choice.
To guarantee such a result, we need the black box to work in the agnostic setting.
For example, an agnostic learning method for learning Gaussians can be lifted to work for Gaussian mixtures in the agnostic setting.
We would like to emphasize that our focus is on the information-theoretic aspects of learning rather than the computational ones; in particular, although our framework is algorithmic, its running time is exponential in the number of required samples. Proving sample complexity bounds is important in understanding the statistical nature of various classes of distributions (see, e.g., the recent work of \cite{logconcave}), and may pave the way for developing efficient algorithms.
\subsection{Our Results}
Let $\mathcal F$ be a class of probability distributions, and let $\mathcal{F}^k$ denote the class of $k$-mixtures of elements of $\mathcal F$.
In our main result, Theorem~\ref{thm:main}, assuming the existence of a method for learning $\mathcal F$ with sample complexity $m_{\mathcal{F}}(\epsilon)$,
we provide a method for learning $\mathcal F^k$ with sample complexity
$O({k\log^2 k \cdot m_{\mathcal F}(\varepsilon) }/{\epsilon^{2}})$.
Our mixture learning algorithm has the property that, if the $\mathcal F$-learner is proper, then the $\mathcal F^k$-learner would be proper as well (i.e., the learner will always output a member of $\mathcal{F}^k$).
Furthermore, the algorithm works in the more general agnostic setting provided that the base learners are agnostic learners.
We provide several applications of our main result.
In Theorem~\ref{axisalignedupperbound}, we show that the class of mixtures of $k$ axis-aligned Gaussians in $\mathbb{R}^d$
is PAC-learnable in the agnostic setting with
sample complexity $O({kd\log^2 k}/{\epsilon ^ 4})$ (see Theorem~\ref{thm:lowerbound}).
This bound is tight in terms of $k$ and $d$ up to logarithmic factors.
In Theorem~\ref{gaussianupperbound}, we show that the class of mixtures of $k$ Gaussians in $\mathbb{R}^d$
is PAC-learnable in the agnostic setting with
sample complexity
$O({kd^2\log^2 k}/{\epsilon ^ 4})$. Finally, in Theorem~\ref{logconcave}, we prove that the class of mixtures of $k$ log-concave distributions over $\mathbb{R}^d$ is PAC-learnable using $\widetilde{O}(d^{(d+5)/2}\varepsilon^{-(d+9)/2}k)$ samples. To the best of our knowledge, this is the first upper bound on the sample complexity of learning this class.
\subsection{Related Work}
PAC learning of distributions was introduced by~\cite{Kearns}, we refer the reader to~\cite{Diakonikolas2016} for a recent survey. A closely related line of research in statistics (in which more emphasis is on sample complexity) is density estimation, for which the book by \cite{devroye_book} is an excellent resource.
One approach for studying the sample complexity of learning a class of distributions is bounding the VC-dimension of its associated Yatrocas class (see Definition~\ref{def_yatrocas}), and applying results such as Theorem~\ref{thm:distributionVC}\footnote{These VC-dimensions have mainly been studied for the purpose of proving generalization bounds for neural networks with sigmoid activation functions.}. In particular, the VC-dimension bound of \cite[Theorem~8.14]{AB99} -- which is based on the work of~\cite{Karpinski} -- implies a sample complexity upper bound of
$O((k^4d^2+k^3d^3)/\varepsilon^2)$
for PAC learning mixtures of
axis-aligned Gaussians,
and an upper bound of $O(k^4d^4/\varepsilon^2)$ for PAC learning mixtures of general Gaussians (both results hold in the more general agnostic setting).
A sample complexity upper bound of $O(d^2 k^3 \log^2k / \varepsilon^4)$ for learning mixtures of Gaussians
in the realizable setting was proved in~\cite[Theorem~A.1]{gaussian_mixture} (the running time of their algorithm is not polynomial).
Our algorithm is motivated by theirs, but we have introduced several new ideas in the algorithm and in the analysis,
which has resulted in improving the sample complexity bound by a factor of $k^2$ and an algorithm that works in the more general agnostic setting.
For mixtures of spherical Gaussians,
a polynomial time algorithm for the realizable setting with sample complexity
$O(dk^9\log^2(d)/\varepsilon^4)$
was proposed in \cite[Theorem~11]{spherical}.
We improve their sample complexity by a factor of $\widetilde{O}(k^8)$, and moreover our algorithm works in the agnostic setting, too.
In the special case of $d=1$, a non-proper agnostic polynomial time algorithm with the optimal sample complexity of $\widetilde{O}(k/\varepsilon^2)$
was given in~\cite{onedimensional}, and a proper agnostic algorithm with the same sample complexity and better running time was given in~\cite{gmm_1d_proper}.
An important question, which we do not address in this paper, is finding polynomial time algorithms for learning distributions.
See~\cite{gaussian_mixture} for the state-of-the-art results on computational complexity of learning mixtures of Gaussians.
Another important setting is computational complexity in the agnostic learning, see, e.g.,~\cite{robustestimation} for some positive results.
A related line of research is parameter estimation for mixtures of Gaussians, see, e.g.,~\cite{dasgupta1999learning,Belkin,moitravaliant}, who gave polynomial time algorithms for this problem assuming certain separability conditions (these algorithms are polynomial in the dimension and the error tolerance but exponential in the number of components).
Recall that parameter estimation is a more difficult problem and any algorithm for parameter estimation requires some separability assumptions for the target Gaussians\footnote{E.g.,\ consider the case that $k=2$ and the two components are identical; then there is no way to learn their mixing weights.}, whereas for density estimation no such assumption is needed.
We finally remark that characterizing the sample complexity of learning a class of distributions in general is an open problem, even for the realizable (i.e., non-agnostic) case (see~\cite[Open Problem~15.1]{Diakonikolas2016}).
\section{The Formal Framework}
Generally speaking, a \emph{distribution learning method} is an algorithm that takes a
sample of i.i.d.\ points from distribution $g$
as input, and outputs (a description) of a distribution $\hat{g}$ as an estimation for $g$.
Furthermore, we assume that $g$ belongs to or can be approximated by class $\mathcal{F}$ of distributions,
and we may require that $\hat{g}$ also belongs to this class (i.e., proper learning).
Let $f_1$ and $f_2$ be two probability distributions defined over the Borel $\sigma$-algebra $\mathcal{B}$. The total variation distance between $f_1$ and $f_2$ is defined as
\[\|f_1- f_2\|_{TV} = \sup_{B\in \mathcal{B}}|f_1(B) - f_2(B)| = \frac{1}{2}\|f_1 - f_2\|_1 \:,
\]
where
\[\|f\|_1\coloneqq \int_{-\infty}^{+\infty} |f(x)|\mathrm{d} x\]
is the $L_1$ norm of $f$.
In the following definitions, $\mathcal{F}$ is a
class of probability distributions, and $g$ is a distribution not necessarily in $\mathcal{F}$.
Denote the set $\{1,2,...,m\}$ by $[m]$.
All logarithms are in the natural base.
For a function $g$ and a class of distributions $\mathcal{F}$, we define
\[
\opt(\mathcal{F}, g) \coloneqq \inf_{f\in \mathcal{F}}\|f-g\|_1
\]
\begin{definition}[$\varepsilon$-approximation, $(\varepsilon, C)$-approximation]
A distribution $\hat{g}$ is an \emph{$\varepsilon$-approximation} for $g$ if $ \|\hat{g}- g\|_1 \leq \varepsilon$.
A distribution $\hat{g}$ is an \emph{$(\epsilon, C)$-approximation} for $g$ with respect to $\mathcal{F}$ if
\[ \|\hat{g}- g\|_1 \leq C\times \opt(\mathcal{F}, g) + \varepsilon\]
\end{definition}
\begin{definition}[PAC-Learning Distributions, Realizable Setting]
A distribution learning method is called a \emph{(realizable) PAC-learner} for $\mathcal{F}$ with sample complexity $m_{\mathcal{F}}(\epsilon, \delta)$, if for all distribution $g\in\mathcal F$ and all $\epsilon, \delta >0$, given $\epsilon$, $\delta$, and a sample of size $m_{\mathcal{F}}(\epsilon, \delta)$, with probability at least $1-\delta$ outputs an $\epsilon$-approximation of $g$.
\end{definition}
\begin{definition}[PAC-Learning Distributions, Agnostic Setting]
For $C>0$, a distribution learning method is called a \emph{$C$-agnostic PAC-learner for $\mathcal{F}$} with sample complexity $m_{\mathcal{F}}^C(\epsilon, \delta)$, if for all distributions $g$ and all $\epsilon, \delta >0$, given $\epsilon$, $\delta$, and a sample of size $m_{\mathcal{F}}^C(\epsilon, \delta)$, with probability at least $1-\delta$ outputs an $(\epsilon, C)$-approximation of $g$.\footnote{Note that in some papers, only the case $C\leq1$ is called agnostic learning, and the case $C>1$ is called semi-agnostic learning.}
\end{definition}
Clearly, a $C$-agnostic PAC-learner (for any constant $C$)
is also a realizable PAC-learner, with the same error parameter $\varepsilon$.
Conversely a realizable PAC-learner can be thought of an $\infty$-agnostic PAC-learner.
\section{Learning Mixture Models}
Let $\Delta_n$ denote the $n$-dimensional simplex:
\[
\Delta_n \:= \{ (w_1,\dots,w_n) : w_i\geq 0, \sum_{i=1}^k w_i=1\}
\]
\begin{definition}
Let $\mathcal{F}$ be a class of probability distributions. Then the class of \emph{$k$-mixtures of $\mathcal{F}$}, written $\mathcal{F}^k$, is defined as
$$\mathcal{F}^k \coloneqq \left\{\sum_{i=1}^{k}w_{i}f_{i}: (w_1,\dots,w_k)\in \Delta_k ,
f_1,\dots,f_k\in\mathcal F
\right\}.$$
\end{definition}
Assume that we have a method to PAC-learn $\mathcal{F}$. Does this mean that we can PAC-learn $\mathcal{F}^k$? And if so, what is the sample complexity of this task?
Our main theorem gives an affirmative answer to the first question, and provides a bound for sample complexity of learning $\mathcal{F}^k$.
\begin{theorem}
\label{thm:main}
Assume that $\mathcal{F}$ has a $C$-agnostic PAC-learner
with sample complexity $m_{\mathcal{F}}^C(\epsilon, \delta) = {\lambda(\mathcal F,\delta)}/{\epsilon^\alpha}$ for some $C>0$, $\alpha \geq 1$ and some function
$\lambda(\mathcal F,\delta) = \Omega(\log(1/\delta))$.
Then there exists a $3C$-agnostic PAC-learner for the class
$\mathcal{F}^k$ requiring $m_{\mathcal{F}^k}^{3C}(\epsilon, \delta) =$
\[ O\left(\frac{\lambda (\mathcal F, \frac{\delta}{3k}) k\log k}{\epsilon^{\alpha+2}}\right)
=
O\left(\frac{k\log k \cdot m_{\mathcal F}(\varepsilon, \frac{\delta}{3k}) }{\epsilon^{2}}\right)
\]
samples.
\end{theorem}
Since a realizable PAC-learner is an $\infty$-agnostic PAC-learner, we immediately obtain the following corollary.
\begin{corollary}
Assume that $\mathcal{F}$ has a realizable PAC-learner
with sample complexity $m_{\mathcal{F}}(\epsilon, \delta) = {\lambda(\mathcal F,\delta)}/{\epsilon^\alpha}$ for some $\alpha \geq 1$ and some function
$\lambda(\mathcal F,\delta) = \Omega(\log(1/\delta))$.
Then there exists a realizable PAC-learner for the class
$\mathcal{F}^k$ requiring $m_{\mathcal{F}^k}(\epsilon, \delta) =$
\[ O\left(\frac{\lambda (\mathcal F, \frac{\delta}{3k}) k\log k}{\epsilon^{\alpha+2}}\right)
=
O\left(\frac{k\log k \cdot m_{\mathcal F}(\varepsilon, \frac{\delta}{3k}) }{\epsilon^{2}}\right)
\]
samples.
\end{corollary}
Some remarks:
\begin{enumerate}
\item
Our mixture learning algorithm has the property that, if the $\mathcal F$-learner is proper, then the $\mathcal F^k$-learner is proper as well.
\item
The computational complexity of the resulting algorithm is exponential in the number of required samples.
\item
The condition
$\lambda(\mathcal F,\delta) = \Omega(\log(1/\delta))$
is a technical condition that holds for all interesting classes $\mathcal F$.
\item
One may wonder about tightness of this theorem.
In Theorem~2 in \cite{spherical}, it is shown that
if $\mathcal F$ is the class of spherical Gaussians, we have
$m_{\mathcal{F}^k}^{O(1)}(\epsilon, \delta) = \Omega(k m_{\mathcal F}(\varepsilon, \delta/k) )$, therefore, the factor of $k$ is necessary in general. However, it is not clear whether the additional factor of
$\log k /\varepsilon^2$ in the theorem is tight.
\item
The constant 3 (in the $3C$-agnostic result) comes from
\cite[Theorem~6.3]{devroye_book} (see Theorem~\ref{thm:candidates}), and it is not clear whether it is necessary. If we allow for randomized algorithms (which produce a random distribution whose expected distance to the target is bounded by $\varepsilon$), then the constant can be improved to 2, see \cite[Theorem~22]{density_estimation_lineartime}.
\end{enumerate}
In the rest of this section we prove
Theorem~\ref{thm:main}.
Let $g$ be the true data generating distribution,
and let
\begin{equation}\label{def_rho}
g^* = \argmin_{f \in\mathcal{F}^k} \|g-f\|_1
\textnormal{ and }
\rho = \|g^*-g\|_1=\opt(\mathcal F^k,g)\:.
\end{equation}
Note that although $g^*\in\mathcal{F}^k$,
$g$ itself is not necessarily in the form of a mixture.
Since our algorithm works for mixtures, we would first like to write $g$ in the form of a mixture of $k$ distributions, such that they are on average close to being in $\mathcal{F}$.
This is done via the following lemma.
\begin{lemma}\label{lem:projection}
Suppose that $g$ is a probability density function with $\opt(\mathcal{F}^k,g)=\rho$.
Then we may write
\(g = \sum_{i\in [k]} w_i {G_i},\)
such that $w\in\Delta_k$,
each $G_i$ is a density, and
we have
$\sum_{i\in[k]} w_i \opt(\mathcal F,G_i) = \rho$.
\end{lemma}
\begin{proof}
Let $f\in \mathcal{F}^k$ be such that $\|g-f \|_1\leq \rho$, and let $X=\{x: g(x) < f(x)\}$.
Suppose $f = \sum_{i\in[k]} w_i f_i$, where $f_i\in \mathcal{F}$.
Define
\[
G_i(x) = \left\{\begin{array}{lr}
{f_i(x)g(x)}/{f(x)}, & \text{for } x\in X \\
f_i(x)+\Delta_i(x), & \text{for } x\notin X\\
\end{array}\right.
\]
where
\[
\Delta_i(x) = {(g(x)-f(x))\left(\int_X f_i(x)(f(x)-g(x)) \mathrm{d} x /f(x) \right)} \bigg/ \left({\int_X (f(x)-g(x)) \mathrm{d} x}\right).
\]
Observe that each $G_i$ is a density and that $g=\sum_{i\in[k]}w_i G_i$.
Finally, note that $f_i(x)>G_i(x)$ precisely on $X$. Thus,
\begin{align*} \rho=\|g-f \|_1 =
2\int_X (f(x) - \sum_i w_i G_i(&x))
=2\int_X \sum_i w_i (f_i(x)-G_i(x)) \\&=2\int_X \sum_i w_i |f_i(x)-G_i(x)| = \sum_i w_i \|f_i-G_i\|_1. \qedhere
\end{align*}
\end{proof}
By Lemma~\ref{lem:projection}, we have
\(g = \sum_{i\in [k]} w_i {G_i},\)
where each $G_i$ is a probability distribution.
Let \(\rho_i \coloneqq \opt (\mathcal{F}, G_i)\),
and by the lemma we have
\begin{equation}
\sum_{i \in[k]} w_i \rho_i = \rho.\label{sumrhoiisrho}.
\end{equation}
The idea now is to learn each of the $G_i$'s separately using the agnostic learner for $\mathcal{F}$.
We will view $g$ as a mixture of $k$ distributions
$G_1,G_2,\dots,G_k$.
For proving Theorem~\ref{thm:main}, we will use the following theorem on learning finite classes of distributions,
which immediately follows from \cite[Theorem~6.3]{devroye_book} and a standard Chernoff bound.
\begin{theorem}\label{thm:candidates}
Suppose we are given $M$ candidate distributions $f_1,\dots,f_M$ and we have access to i.i.d.\ samples from an unknown distribution $g$.
Then there exists an algorithm that given the $f_i$'s and $\varepsilon>0$, takes
$\log (3M^2/\delta)/2\varepsilon^2$ samples from $g$, and with probability $\geq 1-\delta/3$ outputs an index $j\in[M]$ such that
\[
\|f_j-g\|_1 \leq 3 \min_{i\in[M]} \|f_i-g\|_1 + 4\varepsilon \:.
\]
\end{theorem}
We now describe an algorithm that with probability $\geq 1-\delta$ outputs a distribution with $L_1$ distance $13\varepsilon + 3C\rho$ to $g$ (the error parameter is $13\varepsilon$ instead of $\varepsilon$ just for convenience of the proof; it is clear that this does not change the order of magnitude of sample complexity).
The algorithm, whose pseudocode is shown in Figure~\ref{fig:alg}, has two main steps.
In the first step we generate a set of candidate distributions, such that at least one of them is $(3\varepsilon+\rho)$-close to $g$ in $L_1$ distance.
These candidates are of the form $\sum_{i=1}^{k} \widehat{w}_i \widehat{G}_i$, where the $\widehat{G}_i$'s are extracted from samples and are estimates for the real components $G_i$,
and the $\widehat{w}_i$'s come from a fixed discretization of $\Delta_k$, and are estimates for the real mixing weights $w_i$.
In the second step, we use Theorem~\ref{thm:candidates} to obtain a distribution that is $(13\varepsilon+3C\rho)$-close to $g$.
\begin{figure}
\begin{tcolorbox}
Input: $k, \epsilon, \delta$ and an iid sample $S$\\
0. Let $\widehat{W}$ be an $(\epsilon/k)$-cover for $\Delta_k$ in $\ell_{\infty}$ distance.\\
1. $\mathcal C = \emptyset$ (set of candidate distributions)\\
2. For each $(\widehat{w}_1,\dots,\widehat{w}_k)\in \widehat{W}$ do:\\
\phantom{aa}3. For each possible partition of $S$ into \\
\phantom{aa aaaaaa}$A_1, A_2, ...,A_{k}$:\\
\phantom{aaaa}4. Provide $A_i$ to the $\mathcal F$-learner, and let $\widehat{G}_i$ \\\phantom{aaaa aaaaaa}be its output.\\
\phantom{aaaa}5. Add the candidate distribution \\ \phantom{aaaa aaaaaa}$ \sum_{i\in [k]} \widehat{w}_i \widehat{G}_i $ to $\mathcal C$.\\
6. Apply the algorithm for finite classes (Theorem~\ref{thm:candidates}) to $\mathcal C$ and output its result.
\end{tcolorbox}
\caption{Algorithm for learning the mixture class $\mathcal F^k$}
\label{fig:alg}
\end{figure}
We start with describing the first step.
We take
\begin{equation}
\label{s_def}
s=
\max \left \{
\frac
{2k\lambda(\mathcal F, \delta/3k)}
{ \varepsilon^{\alpha} },
\frac{16 k \log(3k/\delta)}{\varepsilon}
\right\}
\end{equation}
i.i.d.\ samples from $g$.
Let $S$ denote the set of generated points.
Note that $\lambda(\mathcal F,\delta)=\Omega(\log(1/\delta))$ implies
\[s=O({k\lambda (\mathcal F, \delta/3k) }\times {\epsilon^{-\alpha}}).\]
Let $\widehat{W}$ be an $\varepsilon/k$-cover for $\Delta_k$ in $\ell_{\infty}$ distance of cardinality
$(k/\varepsilon+1)^k$.
That is, for any $x\in \Delta_k$ there exists $w\in\widehat{W}$ such that $\|w-x\|_{\infty}\leq\varepsilon/k$.
This can be obtained from a grid in $[0,1]^k$ of side length $\varepsilon/k$, which is an $\varepsilon/k$-cover for $[0,1]^k$, and projecting each of its points onto $\Delta_k$.
By an \emph{assignment}, we mean a function
$A:S\to [k]$.
The role of an assignment is to ``guess'' each sample point is coming from which component, by mapping them to a component index.
For each pair $(A,(\widehat{w}_1,\dots,\widehat{w}_k))$, where
$A$ is an assignment and $(\widehat{w}_1,\dots,\widehat{w}_k)\in \widehat{W}$,
we generate a candidate distribution as follows:
let $A^{-1}(i)\subseteq S$ be those sample points that are assigned to component $i$.
For each $i\in[k]$, we provide the set $A^{-1}(i)$ of samples to our $\mathcal F$-learner, and the learner provides us with a distribution $\widehat{G}_i$.
We add the distribution $\sum_{i\in [k]} \widehat{w}_i \widehat{G}_i $
to the set of candidate distributions.
\begin{lemma}
\label{somecandidateisclose}
With probability $\geq 1-2\delta/3$, at least one of the generated candidate distributions is $(3\varepsilon+C\rho)$-close to $g$.
\end{lemma}
Before proving the lemma, we show that it implies our main result, Theorem~\ref{thm:main}.
By the lemma, we obtain a set of candidates such that at least one of them is $(3\varepsilon+C\rho)$-close to $g$ (with failure probability $ \leq 2\delta/3$).
This step takes
$s=
O({k\lambda (\mathcal F, \delta/3k) }\times {\epsilon^{-\alpha}})$ many samples.
Then, we apply Theorem~\ref{thm:candidates} to output one of those candidates that is $(13\varepsilon+3C\rho)$-close to $g$ (with failure probability $\leq \delta/3$), therefore using $\log(3M^2/\delta)/2\varepsilon^2$ additional
samples.
Note that the number of generated candidate distributions is
$M = k^s \times (1+k/\varepsilon)^k$.
Hence, in the second step of our algorithm,
we take
\begin{align*}
\log(3M^2/\delta)/2\varepsilon^2
=
O\left(\frac{\lambda (\mathcal F, \delta/3k) k\log k}{\epsilon^{\alpha+2}}\right)
=
O\left(\frac{m_{\mathcal F}(\varepsilon, \delta/3k) k\log k}{\epsilon^{2}}\right)
\end{align*}
additional samples.
The proof is completed noting the total failure probability is at most $\delta$ by the union bound.
We now prove Lemma~\ref{somecandidateisclose}.
We will use the following concentration inequality, which holds for any binomial random variable $X$ (see \cite[Theorem~4.5(2)]{Mitzenmacher}):
\begin{equation}
\label{chernoffhalf}
\Pr\{X < \mathbf{E} X/2\} \leq \exp(-\mathbf{E} X/8)\:.
\end{equation}
Say a component $i$ is \emph{negligible}
if
\[ w_i \leq \frac{8 \log(3k/\delta)}{s}
\]
Let $L\subseteq[k]$ denote the set of negligible components.
Let $i$ be a non-negligible component.
Note that, the number of points coming from component $i$
is binomial with parameters
$s$ and $w_i$ and thus has mean
$ s w_i$,
so (\ref{chernoffhalf})
implies that, with probability at least $1-\delta/3k$, $S$ contains at least
$w_is/2 $ points from $i$.
Since we have $k$ components in total, the union bound implies that,
with probability at least $1-\delta/3$,
uniformly for all $i\notin L$,
$S$ contains at least
$w_is/2 $ points from component $i$.
Now consider the pair $(A,(\widehat{w}_1,\dots,\widehat{w}_k))$ such that $A$ assigns samples to their correct indices,
and has the property that $|\widehat{w}_i-w_i|\leq\varepsilon/k$ for all $i\in[k]$.
We claim that the resulting candidate distribution is $(3\varepsilon+C\rho)$-close to $g$.
Let $\widehat{G}_1,\dots,\widehat{G}_k$ be the distributions provided by the learner.
For each $i\in[k]$ define
\[
\varepsilon_i \coloneqq \left ( \frac
{2\lambda(\mathcal F, \delta/3k)}
{ w_is }
\right)^{1/\alpha}
\]
For any $i\notin L$,
since there exists at least
$ w_is/2 $ samples for component $i$,
and since
\[
w_is/2 = \lambda(\mathcal F, \delta/3k) \varepsilon_i^{-\alpha} = m_{\mathcal F} (\varepsilon_i, \delta/3k)\:,
\]
we are guaranteed that
$\|\widehat{G}_i-G_i\|_1\leq C\rho_i + \varepsilon_i$ with probability $1-\delta/3k$
(recall that each $G_i$ is $\rho_i$-close to the class $\mathcal{F}$).
Therefore,
$\|\widehat{G}_i-G_i\|_1\leq C\rho_i+\varepsilon_i$ holds uniformly over all $i\notin L$, with probability $\geq 1-\delta/3$.
Note that since $\alpha\geq1$, the function $w_i^{1-1/\alpha}$ is concave in $w_i$, so by Jensen's inequality we have
\[
\sum_{i\in [k]} w_i^{1-1/\alpha}
\leq k \left ( (\sum_{i\in [k]} w_i / k)^{1-1/\alpha}\right)
= k^{1/\alpha}\:,
\]
hence
\begin{align*}
\sum_{i\notin L}
w_i \varepsilon_i =
\left ( \frac
{2\lambda(\mathcal F, \delta/3k)}
{s}
\right)^{1/\alpha}
\sum_{i\notin L} w_i^{1-1/\alpha}
\leq
\left ( \frac
{2k\lambda(\mathcal F, \delta/3k)}
{s }
\right)^{1/\alpha}.
\end{align*}
Also recall from (\ref{sumrhoiisrho}) that $\sum_{i \in[k]}w_i \rho_i \leq \rho$.
Proving the lemma is now a matter of careful applications of the triangle inequality:
\begin{align*}
\left\| \sum_{i\in [k]} \widehat{w}_i \widehat{G}_i
- g\right\|_1
&=
\left\| \sum_{i\in [k]} \widehat{w}_i \widehat{G}_i
-
\sum_{i\in [k]} w_i G_i
\right\|_1\\
&
\leq
\left\|\sum_{i\in [k]} {w}_i (\widehat{G}_i
- G_i)
\right\|_1
+
\left\|\sum_{i\in [k]} (\widehat{w}_i-w_i) \widehat{G}_i
\right\|_1
\\
& \leq
\left\|\sum_{i\in L}{w_i} (\widehat{G}_i
- G_i)
\right\|_1
+
\left\|\sum_{i\notin L}{w_i} (\widehat{G}_i
- G_i)
\right\|_1
+
\sum_{i\in [k]} |\widehat{w}_i-w_i| \left\|\widehat{G}_i
\right\|_1
\\
& \leq
2\sum_{i\in L}{w_i}
+
\sum_{i\notin L}{w_i} (\varepsilon_i + C\rho_i)
+
\sum_{i\in [k]} \varepsilon/k \times 1
\\
&\leq
2k \times \frac{8 \log(3k/\delta)}{s}
+
\left ( \frac
{2k\lambda(\mathcal F, \delta/3k)}
{ s }
\right)^{1/\alpha}
+ C \rho + \varepsilon
\\
&\leq \varepsilon+\varepsilon+\varepsilon + C \rho\:,
\end{align*}
where for the last inequality we used the definition of $s$ in (\ref{s_def}).
This completes the proof of Lemma~\ref{somecandidateisclose}.
\section{Learning Mixtures of Gaussians}
Gaussian Mixture Models (GMMs) are probably the most widely studied mixture classes with numerous applications; yet, the sample complexity of learning this class is not fully understood, especially when the number of dimensions is large. In this section, we will show that our method for learning mixtures can improve the state of the art for learning GMMs in terms of sample complexity. In the following, $\mathcal{N}_d(\mu, \Sigma)$ denotes a Gaussian density function defined over $\mathbb{R}^d$, with mean $\mu$ and covariance matrix $\Sigma$.
\subsection{Mixture of Axis-Aligned Gaussians}
\label{sec:axisaligned}
A Gaussian is called \emph{axis-aligned} if its covariance matrix $\Sigma$ is diagonal.
The class of axis-aligned Gaussian Mixtures is an important special case of GMMs that is thoroughly studied in the literature (e.g.~\cite{axis_aligned}).
\begin{theorem}{\label{thm:AAGaussianUpperBound}}
Let $\mathcal F$ denote the class of $d$-dimensional axis-aligned Gaussians.
Then $\mathcal F$ is 3-agnostic PAC-learnable with
$m_{\mathcal F}^3(\varepsilon,\delta)=O((d+\log(1/\delta))/{\epsilon ^ 2})$.
\end{theorem}
We defer the proof of this result to the appendix.
Combining this theorem with Theorem~\ref{thm:main} we obtain the following result:
\begin{theorem}
\label{axisalignedupperbound}
The class $\mathcal{F}^k$ of mixtures of $k$ axis-aligned Gaussians in $\mathbb{R}^d$
is 9-agnostic PAC-learnable with
sample complexity
$m_{\mathcal F^k}^9(\epsilon,\delta) = O({kd\log k \log(k/\delta)}/{\epsilon ^ 4})$. Accordingly, it is also PAC-learnable in the realizable case with the same number of samples.
\end{theorem}
This theorem improves the upper bound of
$O(dk^9\log^2(d/\delta)/\varepsilon^4)$
proved in \cite[Theorem~11]{spherical} for spherical Gaussians in the realizable setting.
Spherical Gaussians are special cases of axis-aligned Gaussians in which all eigenvalues of the covariance matrix are equal, i.e., $\Sigma$ is a multiple of the identity matrix.
The following minimax lower bound (i.e., worst-case on all instances) on the sample complexity of learning mixtures of spherical Gaussians is proved in the same paper.
\begin{theorem}[Theorem~2 in \cite{spherical}]\label{thm:lowerbound}
The class $\mathcal{F}^k$ of mixtures of $k$ axis-aligned Gaussians in $\mathbb{R}^d$
in the realizable setting has
$m_{\mathcal{F}^k}(\epsilon,1/2)=\Omega(dk/\epsilon^2)$.
\end{theorem}
Therefore, our upper bound of Theorem~\ref{axisalignedupperbound} is optimal in terms of dependence on $d$ and $k$ (up to logarithmic factors) for axis-aligned Gaussians.
\subsection{Mixture of General Gaussians}
For general Gaussians, we have the following result.
\begin{theorem}{\label{thm:GaussianUpperBound}}
Let $\mathcal F$ denote the class of $d$-dimensional Gaussians.
Then, $\mathcal F$ is 3-agnostic PAC-learnable with
$m_{\mathcal F}^3(\varepsilon,\delta)=O((d^2+\log(1/\delta))/{\epsilon ^ 2})$.
\end{theorem}
We defer the proof of this result to the appendix.
Combining this theorem with Theorem~\ref{thm:main}, we obtain the following result:
\begin{theorem}
\label{gaussianupperbound}
The class $\mathcal{F}^k$ of mixtures of $k$ Gaussians in $\mathbb{R}^d$
is 9-agnostic PAC-learnable with
sample complexity
$m_{\mathcal F^k}^9(\epsilon,\delta) = O({kd^2\log k \log(k/\delta)}/{\epsilon ^ 4})$. Accordingly, it is also PAC-learnable in the realizable case with the same number of samples.
\end{theorem}
This improves by a factor of $k^2$ the upper bound
of $O(k^3d^2 \log k / \varepsilon^4)$
in the realizable setting,
proved in~\cite[Theorem~A.1]{gaussian_mixture}.
Note that Theorem \ref{thm:lowerbound}
gives a lower bound of
$\Omega(kd/{\epsilon ^ 2})$ for
$m_{\mathcal F^k}(\epsilon,\delta)$,
hence the dependence of Theorem~\ref{gaussianupperbound} on $k$ is optimal (up to logarithmic factors).
However, there is a factor of $d/\epsilon^2$ between the upper and lower bounds.
\section{Mixtures of Log-Concave Distributions}
A probability density function over $\mathbb{R}^d$ is log-concave if its logarithm is a concave function. The following result about the sample complexity of learning log-concave distributions is the direct consequence of the recent work of \cite{logconcave}.
\begin{theorem} Let $\mathcal{F}$ be the class of distributions corresponding to the set of all log-concave pdfs over $\mathbb{R}^d$. Then $\mathcal{F}$ is $3$-agnostic PAC learnable using $m^{3}(\epsilon, \delta)=O((d/\varepsilon)^{(d+5)/2}\log^2(1/\varepsilon))$ samples.
\end{theorem}
Using Theorem~\ref{thm:main}, we come up with the first result about the sample complexity of learning mixtures of log-concave distributions.
\begin{theorem}\label{logconcave}
The class of mixtures of $k$ log-concave distributions over $\mathbb{R}^d$ is $9$-agnostic PAC-learnable using $\widetilde{O}(d^{(d+5)/2}\varepsilon^{-(d+9)/2}k)$ samples.
\end{theorem}
\section{Conclusions}
We studied PAC learning of classes of distributions that are in the form of mixture models, and proposed a generic approach for learning such classes in the cases where we have access to a black box method for learning a single-component distribution. We showed that by going from one component to a mixture model with $k$ components, the sample complexity is multiplied by a factor of at most $(k\log^2 k)/\epsilon^2$.
Furthermore, as a corollary of this general result, we provided upper bounds for the sample complexity of learning GMMs and axis-aligned GMMs---$O({kd^2\log^2 k}/{\epsilon ^ 4})$ and $O({kd\log^2 k}/{\epsilon ^ 4})$ respectively. Both of these results improve upon the state of the art in terms of dependence on $k$ and $d$.
It is worthwhile to note that for the case of GMMs, the dependence of our bound is $1/ \epsilon^4$. Therefore, proving an upper bound of $kd^2/\epsilon^2$ remains open.
Also, note that our result can be readily applied to the general case of mixtures of the exponential family. Let $\mathcal{F}_d$ denote the $d$-parameter exponential family. Then the VC-dimension of the corresponding Yatrocas class (see Definition~\ref{def_yatrocas}) is $O(d)$ (see Theorem 8.1 in \cite{devroye_book}) and therefore by Theorem \ref{thm:distributionVC}, the sample complexity of PAC learning $\mathcal{F}_d$ is $O(d/\epsilon^2)$. Finally, applying Theorem \ref{thm:main} gives a sample complexity upper bound of $\widetilde{O}(k d/ \epsilon^4)$ for learning $\mathcal{F}_d^k$
\paragraph{Addendum.}
After an earlier version of this work was presented in AAAI 2018 (and appeared on arXiv), we obtained improved results for learning mixtures of Gaussians: the class of mixtures of $k$ axis-aligned
Gaussians in $\mathbb{R}^d$ is agnostic PAC-learnable with sample
complexity $\widetilde{O}(kd/\varepsilon^2)$,
and
the class of mixtures of $k$ general
Gaussians in $\mathbb{R}^d$ is agnostic PAC-learnable with sample
complexity $\widetilde{O}(kd^2/\varepsilon^2)$,
The proof uses novel techniques,
see~\cite{2017-abbas} for details.
| {'timestamp': '2018-06-05T02:12:07', 'yymm': '1706', 'arxiv_id': '1706.01596', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01596'} | arxiv |
\section{Introduction}\label{sec:intro}
In multi-user communication, the signal received by any user (UE) is a superposition of the desired information and the information intended for other UEs. Transmit beamforming at a base station (BS) plays a pivotal role in
focusing the energy of the desired signal and suppressing the multi-user interference to achieve better throughput at UEs \cite{ShangIT11,GSO}.
For effective beamforming, the number of UEs
usually does not exceed the number of transmit antennas. Using more transmit antennas and thus increasing the dimensionality of beamforming vectors can improve the UEs' throughput with reduced transmit power. However, allocating more transmit power under fixed number of transmit antennas still does not necessarily improve the UEs' throughput.
Non-orthogonal multiple access (NOMA) \cite{DSP16,DingMag17} has been introduced to improve
the UEs' throughput by allowing UEs with better channel conditions to access
and decode the signals, which are intended for the UEs with poorer channel conditions. In other words, the UEs with
poorer channel conditions can achieve higher throughput by compromising their information privacy in NOMA \cite{DingTWC16}.
This privacy compromise for the UEs with poor channel conditions is unavoidable in NOMA. Moreover, by restricting all beamforming vectors in the same space, beamforming in NOMA still needs that the dimension of this space, which is
equal to the number of transmit antennas, should not be less than the number of UEs to allow the suppression of multiuser interference \cite{Dietal17}.
It is noteworthy that the UEs with good channel conditions may need only a fraction of the time unit to achieve their needed throughput.
Therefore, by serving them only per fractional time, the BS still has the remaining time room to serve
the UEs with poor channel conditions. In this way, the information privacy for each UE is preserved because all UEs are allowed to
decode their own information only. More importantly, the number of UEs supported at the same fractional
time is effectively reduced. Thus, the BS will not need more transmit antennas to suppress the multi-user interference.
In this letter, the fractional time allocation to UEs with similar channel conditions and beamforming are enhanced
for improving the system's throughput and meeting the UEs' quality-of-service (QoS) in terms of the throughput requirement.
This problem is mathematically modelled by a highly nonconvex optimization problem, for which a path-following computational procedure
of low complexity is then developed for its computation. Finally, the numerical examples are provided to demonstrate the
advantage of the proposed optimization scheme.
\textit{Notation.} We use bold upper-case letters for matrices, bold lower-case letters for column vectors, lower-case letters for scalars. $\Re\{x\}$ denotes the real part of a complex number $x$. The notation $(\cdot)^{H}$ stands for the Hermitian transpose. $\mathbf{x}\sim\mathcal{CN}(\boldsymbol{\eta},\boldsymbol{Z})$ means that $\mathbf{x}$ is a random vector following a complex circular Gaussian distribution with mean $\boldsymbol{\eta}$ and covariance matrix $\boldsymbol{Z}$.
\section{System Model and Problem Formulation}\label{sec:sys_model}
Consider a multiuser downlink system over a given frequency band with
a BS equipped with $N_t > 1$ antennas in serving $2K$ single-antenna UEs as illustrated by Fig. \ref{fig:Layout}.
There are $K$ UEs $(1,k)$, $k=1,\dots K$, which are located in a zone nearer to the BS, called by zone-1,
and $K$ UEs $(2,k)$, $k=1,\dots, K$, which are located in a zone farer from the BS, called by zone-2.
Denote by $\mathcal{K} \triangleq\{1,2,\dots, K\}$ and $\mathcal{M}=\{1,2\}\times \mathcal{K}$.
Within one time unit, BS uses the fraction time (FT) $\tau_1:=\tau\;(0 < \tau < 1)$ to serve UEs $(1,k)$
and uses the remaining FT $\tau_2:=(1 - \tau)$ to serve UEs $(2,k)$.
The BS deploys a transmit beamformer $\mathbf{w}_{i,k}\in\mathbb{C}^{N_t\times 1}$ to deliver the information signal $x_{i,k}$ with $\mathbb{E}\{|x_{i,k}|^2 \} =1$ to UE $(i,k)$.
Let $\mathbf{h}_{i,k}\in\mathbb{C}^{N_t\times 1}$ be the channel vector from the BS to UE $(i,k)$, which is assumed to follow frequency flat fading with the effects of both large-scale pathloss and small-scale fading counted. The complex baseband signal received by UE $(i,k)$ can be expressed as
\[
y_{i,k} = \mathbf{h}_{i,k}^H\mathbf{w}_{i,k}x_{i,k} + \sum_{j\in\mathcal{K}\setminus \{k\}}\mathbf{h}_{i,k}^H\mathbf{w}_{i,j}x_{i,j} + n_{i,k}
\]
where the first term is the desired signal, the second term is the multi-user interference, and the third term
$n_{i,k}\sim\mathcal{CN}(0,\sigma^2_{i,k})$ is additive noise.
{\color{black}For $\mathbf{w}_i\triangleq (\mathbf{w}_{i,k})_{k\in{\cal K}}$,
the throughput at UE $(i,k)$ is
\[
{\cal R}_{i,k}\bigl(\mathbf{w}_i,\tau_i \bigr) = \tau_i\ln\Bigl(1+\frac{ |\mathbf{h}_{i,k}^H\mathbf{w}_{i,k}|^2}{\sum_{j\in\mathcal{K}\setminus \{k\}}|\mathbf{h}_{i,k}^H\mathbf{w}_{i,j}|^2 + \sigma^2_{i,k}}\Bigl)
\]
which by \cite{WLP} can be equivalently reformulated by
\begin{equation}\label{frate}
{\cal R}_{i,k}\bigl(\mathbf{w}_i,\tau_i \bigr) = \tau_i\ln\Bigl(1+\frac{ (\Re\{\mathbf{h}_{i,k}^H\mathbf{w}_{i,k}\})^2}{\sum_{j\in\mathcal{K}\setminus \{k\}}|\mathbf{h}_{i,k}^H\mathbf{w}_{i,j}|^2 + \sigma^2_{i,k}}\Bigl)
\end{equation}
under the additional condition
\begin{equation}\label{ad}
\Re\{\mathbf{h}_{i,k}^H\mathbf{w}_{i,k}\} \geq 0, (i,k)\in {\cal M}.
\end{equation}
}
The main advantage of this FT-based beamforming scheme is that there is no inter-zone interference in (\ref{frate})
that is in contrast with the
conventional scheme to concurrently serve all UEs, under which the throughput at UE $(i,k)$ is
\begin{equation}\label{crate}
{\cal R}_{i,k}^{'}(\mathbf{w}) = \ln\Bigl(1+ \frac{(\Re\{\mathbf{h}_{i,k}^H\mathbf{w}_{i,k}\})^2}{\sum_{(i,j)\in\mathcal{M}\setminus \{(i,k)\}}|\mathbf{h}_{i,k}^H\mathbf{w}_{i,j}|^2 + \sigma^2_{i,k}}\Bigl)
\end{equation}
with the full inter-zone interference. Here and in the sequence $\mathbf{w}\triangleq (\mathbf{w}_1, \mathbf{w}_2)$ and $\boldsymbol{\tau}\triangleq(\tau_1,\tau_2)$.
We are interested in the following problem of jointly designing FT $(\tau_1,\tau_2)$ and the beamformers $(\mathbf{w}_1, \mathbf{w}_2)$ to maximize the system sum throughput (ST):
\begin{subequations}\label{eq:SRoptimi}
\begin{eqnarray}
&\underset{\mathbf{w},\boldsymbol{\tau}}{\max}& \sum_{(i,k)\in{\cal M}} {\cal R}_{i,k}(\mathbf{w}_i,\tau_i) \quad {\mathrm{s.t.}} \quad (\ref{ad}), \label{eq:SRoptimi:a}\\
&&{\cal R}_{i,k}\bigl(\mathbf{w}_i,\tau_i \bigr) \geq {\mathsf{\bar R}}_{i,k},\ \forall(i,k)\in\mathcal{M}, \label{eq:SRoptimi:b}\\
&&\tau_1\|\mathbf{w}_{1}\|^2 + \tau_2\|\mathbf{w}_{2}\|^2 \leq P_{bs}^{\max},\label{eq:SRoptimi:d}\\
&& \tau_1\geq 0, \tau_2\geq 0, \tau_1+\tau_2\leq 1. \label{eq:SRoptimi:e}
\end{eqnarray}
\end{subequations}
Here ${\mathsf{\bar R}}_{i,k}$ sets a minimum throughput requirement for UE $(i,k)$ and $P_{bs}^{\max}$ is a given power budget.
Since ${\cal R}_{i,k}(\mathbf{w}_i,\tau_i)$ is a nonconcave function, the optimization problem (\ref{eq:SRoptimi}) is regarded
as a highly nonconvex optimization problem, for which finding a feasible point is already computationally difficult. The next
section is devoted to a computational path-following procedure for its solution.
\begin{figure}[t]
\centering
\includegraphics[width=0.28\textwidth,trim={0cm 0.0cm -0cm -0cm}]{Layout.eps}
\caption{Scenario with $K=4$.}
\label{fig:Layout}
\end{figure}
\section{Convex Quadratic-based Path-following method}\label{sec:CQBI}
The most important step is to provide an effective lower bounding approximation for the function
${\cal R}_{i,k}(\mathbf{w}_i,\tau_i)$ defined by (\ref{frate}) to facilitate
a path-following computational procedure of the problem (\ref{eq:SRoptimi}).
We use the variable changes $\pmb{\alpha}\triangleq (\alpha_1, \alpha_2)=(1/\tau_1,1/\tau_2)$,
which satisfy the following convex constraint:
\begin{equation}\label{eq:changevariables:b}
1/\alpha_1+1/\alpha_2 \leq 1, \alpha_1>0, \alpha_2>0.
\end{equation}
The problem \eqref{eq:SRoptimi} can be equivalently expressed as
\begin{subequations}\label{eq:SRMequi}
\begin{eqnarray}
&\underset{\mathbf{w}, \pmb{\alpha}}{\max}& \Phi(\mathbf{w},\pmb{\alpha})\triangleq \sum_{(i,k)\in{\cal M}}
{\cal R}_{i,k}(\mathbf{w}_i,1/\alpha_i)\quad {\mathrm{s.t.}}\quad (\ref{ad}), \eqref{eq:changevariables:b},\label{eq:SRMequi:a}\qquad\\
&&{\cal R}_{i,k}(\mathbf{w}_i,1/\alpha_i) \geq {\mathsf{\bar R}}_{i,k},\ \forall(i,k)\in{\cal M},\label{eq:SRMequi:b}\\
&&(1-1/\alpha_2)\|\mathbf{w}_{1}\|^2 + \|\mathbf{w}_{2}\|^2/\alpha_2 \leq P_{bs}^{\max}.\label{eq:SRMequi:d}
\end{eqnarray}
\end{subequations}
At a feasible point $(\mathbf{w}^{(\kappa)},\pmb{\alpha}^{(\kappa)})$, define
$x_{i,k}^{(\kappa)}\triangleq \Re\{\mathbf{h}_{i,k}^H\mathbf{w}_{i,k}^{(\kappa)}\}>0$,
$y_{i,k}^{(\kappa)}\triangleq\sum_{j\in\mathcal{K}\setminus \{k\}}|\mathbf{h}_{i,k}^H\mathbf{w}_{i,j}^{(\kappa)} |^2 + \sigma^2_{i,k} $,
$d_{i,k}^{(\kappa)} \triangleq (x_{i,k}^{(\kappa)})^2/y_{i,k}^{(\kappa)}>0$,
$a^{(\kappa)}_{i,k}\triangleq 2{\cal R}_{i,k}(\mathbf{w}_i^{(\kappa)},1/\alpha_i^{(\kappa)})+d_{i,k}^{(\kappa)}/\alpha_i^{(\kappa)}(d_{i,k}^{(\kappa)}+1)>0$,
$b^{(\kappa)}_{i,k}\triangleq (d_{i,k}^{(\kappa)})^2/\alpha_i^{(\kappa)}(d_{i,k}^{(\kappa)}+1)>0$, and
$c_{i,k}^{(\kappa)}\triangleq {\cal R}_{i,k}(\mathbf{w}_i^{(\kappa)},1/(\alpha_i^{(\kappa)})^2)>0$.
It follows from the inequality \eqref{inq1} in the appendix
that
\[
{\cal R}_{i,k}(\mathbf{w}_i,1/\alpha_i)\geq {\cal R}_{i,k}^{(\kappa)}(\mathbf{w}_i,\alpha_i)
\]
over the trust region
\begin{IEEEeqnarray}{rCl}
2\Re\{\mathbf{h}_{i,k}^H\mathbf{w}_{i,k}\} - \Re\{\mathbf{h}_{i,k}^H\mathbf{w}_{i,k}^{(\kappa)}\} > 0,\ \forall(i,k) \in\mathcal{M},
\label{eq:Rate1ktrust}
\end{IEEEeqnarray}
for the concave function
\[
{\cal R}_{i,k}^{(\kappa)}(\mathbf{w}_i,\alpha_i)\triangleq
a^{(\kappa)}_{i,k}-
b^{(\kappa)}_{i,k}\frac{\sum_{j\in\mathcal{K}\setminus \{k\}}|\mathbf{h}_{i,k}^H\mathbf{w}_{i,j}|^2 + \sigma^2_{i,k} }{x_{i,k}^{(\kappa)}(2\Re\{\mathbf{h}_{i,k}^H\mathbf{w}_{i,k}\}-x_{i,k}^{(\kappa)})}
- c_{i,k}^{(\kappa)}\alpha_i.
\]
Next, due to the convexity of function $\|\mathbf{w}_{1}\|^2/\alpha_2$, it is true that
$ \|\mathbf{w}_{1}\|^2/\alpha_2\geq 2\Re\{(\mathbf{w}_{1}^{(\kappa)})^H\mathbf{w}_{1}\}/\alpha_2^{(\kappa)}- (\|\mathbf{w}_{1}^{(\kappa)}\|^2/(\alpha_2^{(\kappa)})^2)\alpha_2$.
An inner convex approximation of nonconvex constraint \eqref{eq:SRMequi:d} is then given by
\begin{eqnarray}
\|\mathbf{w}_{1}\|^2 + \|\mathbf{w}_{2}\|^2/\alpha_2 - 2\Re\{(\mathbf{w}_{1}^{(\kappa)})^H\mathbf{w}_{1}\}/\alpha_2^{(\kappa)}&\nonumber\\
+ (\|\mathbf{w}_{1}^{(\kappa)}\|^2/(\alpha_2^{(\kappa)})^2)\alpha_2 &\leq P_{bs}^{\max}.\label{eq:SRMequi:d2}
\end{eqnarray}
Initialized by a feasible point $(\mathbf{w}^{(0)},\pmb{\alpha}^{(0)})$ for (\ref{eq:SRMequi}), the following convex quadratic program (QP)
is solved at the $\kappa$-th iteration to generate the next feasible point $(\mathbf{w}^{(\kappa+1)},\pmb{\alpha}^{(\kappa+1)})$:
\begin{eqnarray}
\displaystyle\max_{\mathbf{w},\pmb{\alpha}}\ \Phi^{(\kappa)}(\mathbf{w},\pmb{\alpha})\triangleq \sum_{(i,k)\in{\cal M}}{\cal R}_{i,k}^{(\kappa)}(\mathbf{w}_i,\alpha_i)\quad{\mathrm{s.t.}}\nonumber\\
{\cal R}_{i,k}^{(\kappa)}(\mathbf{w}_i,\alpha_i)\geq {\mathsf{\bar R}}_{i,k},\ \forall(i,k) \in\mathcal{M}, (\ref{ad}),
\eqref{eq:changevariables:b}, \eqref{eq:Rate1ktrust}, \eqref{eq:SRMequi:d2}. \label{QPproblem}
\end{eqnarray}
As problem \eqref{QPproblem} involves
$m=2(3K+1)$ quadratic and linear constraints, and $n=2(KN_t + 1)$ real decision variables, its
computational complexity is $\mathcal{O}(n^2m^{2.5}+m^{3.5})$.
Note that $\Phi(\mathbf{w},\pmb{\alpha})\geq \Phi^{(\kappa)}(\mathbf{w},\pmb{\alpha})$ $\forall (\mathbf{w},\pmb{\alpha})$, and
$\Phi(\mathbf{w}^{(\kappa)},\pmb{\alpha}^{(\kappa)})=\Phi^{(\kappa)}(\mathbf{w}^{(\kappa)},\pmb{\alpha}^{(\kappa)})$. Moreover,
$\Phi^{(\kappa)}(\mathbf{w}^{(\kappa+1)},\pmb{\alpha}^{(\kappa+1)})>\Phi^{(\kappa)}(\mathbf{w}^{(\kappa)},\pmb{\alpha}^{(\kappa)})$
whenever $(\mathbf{w}^{(\kappa+1)},\pmb{\alpha}^{(\kappa+1)})\neq (\mathbf{w}^{(\kappa)},\pmb{\alpha}^{(\kappa)})$ because the former and
the latter, respectively, are the optimal solution and feasible point for (\ref{QPproblem}). Therefore,
$\Phi(\mathbf{w}^{(\kappa+1)},\pmb{\alpha}^{(\kappa+1)})\geq \Phi^{(\kappa)}(\mathbf{w}^{(\kappa+1)},\pmb{\alpha}^{(\kappa+1)})>\Phi^{(\kappa)}(\mathbf{w}^{(\kappa)},\pmb{\alpha}^{(\kappa)})=
\Phi(\mathbf{w}^{(\kappa)},\pmb{\alpha}^{(\kappa)})$, showing that $(\mathbf{w}^{(\kappa+1)},\pmb{\alpha}^{(\kappa+1)})$ is a better feasible point
than $(\mathbf{w}^{(\kappa)},\pmb{\alpha}^{(\kappa)})$ for (\ref{eq:SRMequi}). The sequence $\{(\mathbf{w}^{(\kappa)},\pmb{\alpha}^{(\kappa)})\}$
of improved feasible points for (\ref{eq:SRMequi}) thus converges at least to a locally optimal solution satisfying the
Karush-Kuh-Tucker conditions \cite{MW78}. We summarize the proposed QP-based
path-following procedure in Algorithm~\ref{alg_SCALE_FW}.
\begin{algorithm}[t]
\begin{algorithmic}[1]
\protect\caption{QP-based path-following algorithm for ST maximization problem \eqref{eq:SRoptimi}}
\label{alg_SCALE_FW}
\global\long\def\textbf{Initialization:}{\textbf{Initialization:}}
\REQUIRE Iterate \eqref{qosconvex} for an initial feasible point $(\mathbf{w}^{(0)},\pmb{\alpha}^{(0)})$. Set $\kappa:=0$
\REPEAT
\STATE Solve convex quadratic program \eqref{QPproblem} to obtain the optimal solution: $(\mathbf{w}^{(\kappa+1)},\pmb{\alpha}^{(\kappa+1)})$.
\STATE Set $\kappa:=\kappa+1.$
\UNTIL Convergence
\end{algorithmic} \end{algorithm}
\textit{Generation of an initial point.}: Initialized from a feasible point $(\mathbf{w}^{(0)},\pmb{\alpha}^{(0)})$ for constraints
\eqref{eq:changevariables:b} and (\ref{eq:SRMequi:d2}), we iterate the convex program
\begin{equation}\label{qosconvex}
\max_{\mathbf{w}, \pmb{\alpha}} \min_{(i,k) \in\mathcal{M}} {\cal R}_{i,k}^{(\kappa)}(\mathbf{w}_i,\alpha_i)/\bar{\mathsf{R}}_{i,k}\quad
{\mathrm{s.t.}}\quad (\ref{ad}), \eqref{eq:changevariables:b}, \eqref{eq:Rate1ktrust},\eqref{eq:SRMequi:d2}
\end{equation}
till reaching
$\min_{(i,k)\in{\cal M}} {\cal R}_{i,k}^{(\kappa)}(\mathbf{w}_i^{(\kappa+1)},\alpha_i^{(\kappa+1)})/\bar{\mathsf{R}}_{i,k} \geq 1$
to make $(\mathbf{w}^{(\kappa+1)},\pmb{\alpha}^{(\kappa+1)})$ feasible for (\ref{eq:SRMequi}) and thus usable as an initial feasible
point for implementing Algorithm \ref{alg_SCALE_FW}.
\section{Numerical Results}\label{sec:simulation}
Monte Carlo simulations have been implemented to evaluate the performance of the proposed algorithm for $K=4$ ($8$ UEs)
and $N_t=5$ per the scenario in Fig.~\ref{fig:Layout}. The channel vector $\mathbf{h}_{i,k}$ between the BS and
UE $(i,k)$ at a distance $d_{i,k}$ (in kilometres) is generated as $\mathbf{h}_{i,k}=\sqrt{10^{-\sigma_{\mathsf{PL}}/10}}\tilde{\mathbf{h}}_{i,k}$, where $\sigma_{\mathsf{PL}}$ is the path loss (PL) in dB and $\tilde{\mathbf{h}}_{i,k}\sim\mathcal{CN}(0,\mathbf{I}_{N_t})$ represents small-scale effects.
The other parameters are given by Table \ref{parameter}. Without loss of generality, $\bar{\mathsf{R}}_{i,k}\equiv \bar{\mathsf{R}}$ is set. The numerical results are obtained using the parser YALMIP \cite{L04}.
We compare the performance of the proposed FT-based beamforming scheme with five other beamforming schemes:
$(i)$ ``Conventional DL,'' under which the problem of ST maximization is formulated similarly as:
$\max_{\mathbf{w}}\sum_{(i,k)\in {\cal M}} {\cal R}_{i,k}^{'}(\mathbf{w})\ {\mathrm{s.t.}}\ {\cal R}_{i,k}^{'}(\mathbf{w})\geq {\mathsf{\bar R}}_{i,k}, (i,k)\in{\cal M},
\|\mathbf{w}_1\|^2+\|\mathbf{w}_2\|^2\leq P_{bs}^{\max}$ under the definition (\ref{crate});
$(ii)$ ``NOMA'': {\color{black}each UE in zone-1 is paired with an UE in zone-2 according to the clustering algorithm
in \cite{Kietal13} to create a virtual cluster.} In each cluster, both UEs decode the signal intended for the UE in zone-2
and then the UE in zone-1 processes successive interference cancellation (SIC) to cancel the interference of the UE in zone-2 in decoding its own signal;
$(iii)$ ``FT + NOMA in both zones'': under FT, NOMA is zone-wide adopted;
$(iv)$ ``FT + NOMA in zone-1'': under FT, NOMA is adopted only in zone-1; and
$(v)$ ``FT + NOMA in zone-2'': under FT, NOMA is adopted only in zone-2. {\color{black}The reader is referred to \cite[Sec. V]{Dietal17}
for beamforming under NOMA, which is used in these five schemes. {\color{black}The
computational complexity of each iteration in NOMA is similar to that of (\ref{QPproblem}).}
Note that
the performance of NOMA-based beamforming can be improved by involving more UEs in virtual clusters \cite[Sec VI]{Dietal17} but the UEs' privacy is more compromised.}
\begin{table}[t]
\caption{Simulation Parameters}
\label{parameter}
\centering
\begin{tabular}{l|l}
\hline
Parameters & Value \\
\hline\hline
Noise power density & -174 [dBm/Hz] \\
Path loss from the BS to UE $(i,k)$, $\sigma_{\mathsf{PL}}$ & 128.1 + 37.6$\log_{10}(d_{i,k})$ [dB]\\
Radius of cell & 500 [m]\\
Coverage of zone-1 UEs & 200 [m]\\
Distance between the BS and nearest user & $>$ 10 [m]\\
\hline
\end{tabular}
\end{table}
On average, Algorithm~\ref{alg_SCALE_FW} requires about $10$ iterations for convergence.
\begin{figure}
\begin{center}
\begin{subfigure}[$\bar{\mathsf{R}} = 0 $ bps/Hz.]{
\includegraphics[width=0.32\textwidth]{SRvsPbs_R0.eps}}
\label{fig:SRMa}
\end{subfigure}
\begin{subfigure}[$\bar{\mathsf{R}} = 1 $ bps/Hz.]{
\includegraphics[width=0.32\textwidth]{SRvsPbs_R1.eps}}
\label{fig:SRMb}
\end{subfigure}
\caption{Average sum throughput versus $P_{bs}^{\max}$.}\label{fig:SRvsPmax}
\end{center}
\end{figure}
Fig.~\ref{fig:SRvsPmax} plots the average achievable ST versus the transmit power $P_{bs}^{\max}$ for $N_t = 5$. For $\bar{\mathsf{R}} = 0 $ bps/Hz shown in Fig.~\ref{fig:SRvsPmax}(a), one can see that the ST of
the proposed FT-based beamforming is higher than that achieved by the other schemes
in the high transmit power region. On the other
hand, the conventional DL outperforms NOMA and FT+NOMA schemes for high transmit power
by making the ST concentrated at those UEs with good channel conditions.
Apparently, NOMA does not look efficient when there is no UEs' QoS requirement.
In Fig.~\ref{fig:SRvsPmax}(b) with $\bar{\mathsf{R}} = 1 $ bps/Hz, the conventional DL performs worse than
NOMA at high $P_{bs}^{\max}$. The low STs of FT+NOMA-based schemes are probably attributed to the fact that NOMA is more efficient by exploiting their channel differentiation. Increasing $P_{bs}^{\max}$ leads to a remarkable gain in ST
by the proposed FT compared with the other schemes. In addition, the proposed FT is feasible in all range of $P_{bs}^{\max}$ while the other schemes cannot offer such high QoS to UEs at low $P_{bs}^{\max}$.
\begin{figure}
\centering
\includegraphics[width=0.32\textwidth]{SRvsRth.eps}
\caption{Average sum throughput versus $\bar{\mathsf{R}}$ for $P_{bs}^{\max} = 30$ dBm.}\label{fig:SRvsRth}
\end{figure}
The plot of the ST versus QoS requirement threshold $\bar{\mathsf{R}}\in[0.2,\;1.2]$ bps/Hz is illustrated in Fig.~\ref{fig:SRvsRth}. We can observe that the proposed FT-based beamforming performs quite well and only slightly degrades when $\bar{\mathsf{R}}$ increases. The performance gap between the proposed FT-based beamforming and other schemes substantially increases by increasing $\bar{\mathsf{R}}$. It is expected because the proposed
FT-based beamforming can tune the power allocation in meeting zone-2 UEs' QoS requirements without causing interference to the zone-1's UEs.
Next, we look for the max-min UE throughput optimization problem
\begin{equation}\label{eq:maxminoptimi}
\max_{\mathbf{w}, \boldsymbol{\tau}}\min_{(i,k) \in\mathcal{M}}{\cal R}_{i,k}(\mathbf{w}_i,\tau_i)\quad
{\mathrm{s.t.}}\quad \eqref{eq:SRoptimi:d}, \eqref{eq:SRoptimi:e}
\end{equation}
which can be addressed similarly by solving the convex program (\ref{qosconvex})
(with $\bar{\mathsf{R}}_{i,k}\equiv 1$) at each iteration.
\begin{figure}
\centering
\includegraphics[width=0.32\textwidth]{SRvsPbs_maxmin.eps}
\caption{Average max-min throughput versus $P_{bs}^{\max}$.}
\label{fig:MaxminPbs}
\end{figure}
Fig.~\ref{fig:MaxminPbs} plots the average UEs' worst throughput as a function of $P_{bs}^{\max}$.
It shows that the worst throughput achieved by
the conventional DL and FT + NOMA-based schemes is saturated once $P_{bs}^{\max}$ is beyond a threshold. It also
reveals that the proposed FT-based beamforming
and FT + NOMA in zone-1 achieve worst throughput that is higher than that achieved by others schemes.
\section{Conclusions}\label{sec:conclusion}
The paper has proposed a fractional time-based beamforming scheme at a base station to serve two groups of users, which
is able to improve the network throughput while preserving the information privacy for the users. Accordingly,
a path-following computational procedure for the joint design of fractional times and
beamforming vectors to maximize the network throughput has been developed. Extensive simulations have been
provided to demonstrate the superior performance of the proposed scheme over the exiting schemes.
\section*{Appendix} \label{Appendix:A}
For all $ x > 0$, $\bar{x} > 0$, $y>0$, $\bar{y}>0$, $t>0$, and $\bar{t}>0$, it is true that
\begin{eqnarray}
\displaystyle\frac{\ln(1+x^2/y)}{t}&\geq&\displaystyle a - b\frac{y}{x^2} - ct\label{ing1a}\\
&\geq&\displaystyle a - b\frac{y}{\bar{x}(2x-\bar{x})} - ct\label{inq1}
\end{eqnarray}
over the trust region
\begin{equation}\label{trust2}
2x-\bar{x}>0,
\end{equation} where
$a = 2 [\ln(1+d)]/\bar{t} +
d/\bar{t}(d+1) > 0, b=d^2/\bar{t}(d+1) > 0,\\
c = [\ln(1+d)]/\bar{t}^2> 0, d=\bar{x}^2/\bar{y}.$
Inequality (\ref{ing1a}) follows
from \cite{Ngetal17} while inequality (\ref{inq1}) is obtained by using $x^2\geq \bar{x}(2x-\bar{x})>0$ over the
trust region (\ref{trust2}).
\bibliographystyle{IEEEtran}
\balance
| {'timestamp': '2017-08-29T02:09:22', 'yymm': '1706', 'arxiv_id': '1706.01771', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01771'} | arxiv |
\section{Introduction}
The social impact of online services built on information posted by their users
has also turned them into a lucrative medium for fraudulently influencing
public opinion~\cite{RRCC16,BLLTZ16,LZ16,SWEKVZZ13}. The need to aggressively
promote disinformation has created a black market for social network fraud,
that includes fake opinions and reviews, likes, followers and app
installs~\cite{MMLSV11,TSM,RR,RL,AV,AS,AR}. For instance, in
$\S$~\ref{sec:model:adversary}, we show that in fraud markets, a fake review
can cost between \$0.5 and \$3 and a fake social networking ``like'' can cost
\$2. The profitability of fraud suggests that current solutions that focus on
fraud detection, are unable to control organized fraud.
In this paper we introduce the concept of {\it fraud preemption systems},
solutions deployed to defend online systems such as social networks and app
markets. Instead of reacting to fraud posted in the past, fraud preemption
systems seek to discourage fraudsters from posting fraud in the first place. We
propose FraudSys, the first real-time fraud preemption system that reduces the
profitability of fraud from the perspective of both crowdsourced fraud workers
and the people who hire them. FraudSys imposes computational penalties: the
activity of a user (e.g., review, like) is posted online only after his device
solves a computational puzzle. Puzzles reduce the profitability of fraud by (i)
limiting the amount of fraud per time unit that can be posted for any subject
hosted on the online system, and (ii) by consuming the computational resources
of fraudsters. For instance, Figure~\ref{fig:timeline} shows the timelines of
daily penalties assigned by FraudSys to two fraudsters detected in Google
Play. Based only on the recorded activities, FraudSys frequently assigned
hundreds of hours of daily computational penalties to a single fraudster.
\begin{figure}
\centering
\includegraphics[width=0.47\textwidth]{graphs/gplay/penalty/worker_penalties.eps}
\caption{Timeline of daily penalties (in hours) assigned by FraudSys to the
Google Play activities of two fraudsters we identified in Freelancer.com.
FraudSys imposes daily penalties of up to 1,247 hours to the fraudster at the
top and 3,079 hours for the fraudster at the bottom. As a result, the
fraudsters need to consume significant computational resources, while their
fraud is significantly delayed. This in turn reduces the number of payments
they would receive, and impacts their profitability.}
\label{fig:timeline}
\vspace{-15pt}
\end{figure}
\vspace{0.05in}\noindent
{\bf Challenges}.
Implementing a fraud preemption system raises several challenges. First,
FraudSys needs to detect fraud in real-time, whenever a user performs an
online system activity. Once assigned, a puzzle cannot be rescinded.
This is in contrast to existing systems (e.g., Yelp) that detect fraud
retroactively and can update previous decisions when new information surfaces.
Second, FraudSys needs to impose difficult puzzles on fraudsters, but minimally
impact the experience of honest users. This is made even more complex by the
fact that fraudsters can attempt to bypass detection and even obscure their
true ability to solve puzzles. Third, a stateful FraudSys service that
maintains state for millions of issued and active puzzles is expensive and
vulnerable to DoS attacks.
\vspace{0.05in}\noindent
\noindent
{\bf Our Contributions}.
Through FraudSys, we introduce several innovative solutions. To address the
first challenge, we exploit observations of fraudulent behaviors gleaned from
crowdsourcing sites and online systems, to propose a real-time graph based
algorithm to infer an {\it activity fraud score}, the chance that a user
activity is fraudulent [$\S$~\ref{sec:fraudsys:fraud}]. More specifically, we
introduce features that group fraudulent activities according to their human
creator: FraudSys identifies densely connected components in the co-review
graph of the subject targeted by the user activity, each presumably controlled
by a different fraudster. It then quantifies the connectivity of the user
account performing the action, to each component, and uses the highest
connectivity as features that may indicate that the user account and the
corresponding component are controlled by the same fraudster. FraudSys then
leverages supervised learning algorithms trained on these features to infer the
activity fraud score.
To address the second challenge, we develop adaptive hashrate inference
techniques to detect the computational capabilities of even adversarial
controlled devices to solve puzzles [$\S$~\ref{sec:fraudsys:all}], and devise
mechanisms to convert fraud scores to appropriate temporal penalty and puzzle
difficulty values [$\S$~\ref{sec:fraudsys:all}]. The puzzles assigned by
FraudSys do not alter the online experience of users, as they are solved on
their devices, in the background. However, the puzzles (1) significantly delay
detected fraudulent activities, posted only when the device returns the correct
puzzle solutions and (2) consume the computational resources of the fraudsters
who control the devices.
To address the third challenge, we propose the notion of {\it stateless
computational puzzles}, computational tasks that impose no storage overhead on
the fraud preemption system provider, but enable it to efficiently verify their
authenticity and the correctness of their solutions
[$\S$~\ref{sec:fraudsys:puzzler}]. Thus, the fraud preemption system can assign
a puzzle to a device from which an activity was performed on the online system,
without storing any state about this task. The device can return the results of
the puzzle in 5 seconds or 1 day, and the provider can verify that the task is
authentic, and its results are correct. This makes our approach resistant to
DoS attacks that attempt to exhaust the provider's storage space for assigned
puzzles.
We show that the computational penalty imposed by FraudSys on a fraudulent
activity is a function of the capabilities of the device from which it is
performed, and the probability that the activity is fraudulent. We introduce
and prove upper bounds on the profitability of fraud and the amount of fraud
that can be created for a single subject, per time unit
[$\S$~\ref{sec:properties}] .
We evaluate FraudSys on 23,028 fraudulent reviews (posted by 23 fraudsters from
2,664 user accounts they control), and 1,061 honest reviews we collected from
Google Play, as well as 274,297 fake and 180,400 honest likes from Facebook.
Even with incomplete data, FraudSys imposes temporal penalties that can be as
high as 3,079 hours per day for a single fraudster.
We also show that fraud does not pay off. At today's fraud payout, a
fraudster equipped with an AntMiner S7 (Bitcoin mining hardware) will earn
through fraud less than half the payout of honest Bitcoin mining.
\section{Related Work}
\noindent
{\bf Computation Based Fraud Preemption}.
Dwork and Naor~\cite{DN92} were the first to propose the use of computation to
prevent fraud, in particular spam, where the sender of an e-mail needs to
include the solution to a ``moderately hard function'' computed over a function
of the e-mail. Juels and Brainard~\cite{JB99} proposed to use puzzles to
prevent denial of service attacks, while Borisov~\cite{B06} introduced puzzles
that deter Sybils in peer-to-peer networks. In Borisov~\cite{B06}, newly joined
peers need to solve a puzzle to which all the other peers have contributed.
FraudSys not only seeks to adapt computational puzzles to prevent online system
fraud, but also needs to solve the additional challenges of building puzzles
whose difficulty is a function of the probability that an activity is
fraudulent, while handling heterogeneous user devices (e.g., ranging from
smartphones to machines that specialize in such puzzles).
\vspace{0.05in}\noindent
{\bf Graph Based Fraud Detection}.
Graphs have been used extensively to model relationships and detect fraudulent
behaviors in online systems. Ye and Akoglu~\cite{YL15} quantified the chance of
a subject to be a spam campaign target, then clustered spammers on a 2-hop
subgraph induced by the subjects with the highest chance values. Lu et
al.~\cite{LZXL13} proposed a belief propagation approach implemented on a
review-to-reviewer graph, that simultaneously detects fake reviews and
spammers (fraudsters).
Mukherjee et al.~\cite{MLG12} proposed a suite of features to identify reviewer
groups, as users who review many subjects in common but not much else, post
their reviews within small time windows, and are among the first to review the
subject. Hooi et al.~\cite{HSBSSF16} have recently shown that fraudsters have
evolved to hide their traces, by adding spurious reviews to popular items. To
identify ``camouflaged'' fraud, Hooi et al.~\cite{HSBSSF16} introduced
``suspiciousness'' metrics that apply to bipartite user-to-item graphs, and
developed a greedy algorithm to find the subgraph with the highest
suspiciousness. Akoglu et al.~\cite{ATK15} survey graph based online
fraud detection. \cite{FH16} provide a survey of community detection methods,
evaluation scores and techniques for general networks.
Unlike previous work, FraudSys assigns fraud scores to individual user
activities in {\it real time}, thus uses only partial information. To achieve
this, FraudSys develops and leverages features that quantify the connectivity
of the user activity to other groups of activities {\it previously} performed
by other fraudsters on the same subject. Further, FraudSys also imposes
computation and temporal penalties to discourage fraud creation.
\section{System and Adversary Model}
\label{sec:model}
\begin{figure}
\centering
\includegraphics[width=0.47\textwidth]{./figures/fraudsys/system.model.eps}
\caption{System model. The user performs actions on the online service, from a
device that can range from a smartphone to a Bitcoin miner. The online service
implements and posts the activity only if and after the FraudSys service
validates it. The FraudSys functionality can be implemented by the online
service or by a third party provider.}
\label{fig:system}
\vspace{-15pt}
\end{figure}
Figure~\ref{fig:system} illustrates the three main components of the system
model. First, the online service (the \textit{service}) hosts the system
functionality, and stores information about user accounts and featured
\textit{subjects}. Subjects can be apps in stores like Google Play, or pages
for businesses, accounts and stories in social networks like Facebook.
Second, the users: they register with the service, record profile information
(e.g., name) and receive initial service credentials, including a unique id.
Users can access the online service from a variety of devices. For this, they
need to install a client (e.g., app) on each device they use. The online
service stores and maintains information about each device that the user has
used, e.g., to provide compatibility information on Google Play apps.
Users are encouraged to {\it act} on existing subjects. The activities include
posting reviews, comments, or likes, installing mobile apps, etc. The online
service associates statistics over the activities performed for each supported
subject. The statistics have a significant impact on the popularity and search
rank of subjects~\cite{Ankit.Jain,RankGooglePlay}, thus are targets of manipulation by
fraudsters (see $\S$~\ref{sec:model:adversary}).
The third component of the system model is the FraudSys service, whose goal is
to validate user activities. For increased flexibility, Figure~\ref{fig:system}
shows FraudSys as an independent provider. However, FraudSys can also be a
component of the online service.
\subsection{Adversary Model}
\label{sec:model:adversary}
We consider two types of adversaries -- adversarial owners and crowdsourced
fraud workers.
\vspace{0.05in}\noindent
{\bf Adversarial owners}.
Adversarial behaviors start with the subject owners. Adversarial owners seek to
fraudulently promote their subjects (or demote competitor subjects) in order to
bias the popularity and public opinion of specific subjects. For instance,
fraudulent promotions seek to make subjects more profitable~\cite{LZ16,AM12},
increase the ``reachability'' of malware (through more app installs), and boost
the impact of fake news.
\vspace{0.05in}\noindent
{\bf Fraud workers ($=$ fraudsters)}.
We assume that adversarial owners crowdsource this promotion task (also known
as search rank fraud) to {\it fraud workers}, or fraudsters. In this paper we
focus on two types of fraudulent activities: writing fake reviews in Google
Play and posting fake ``Likes'' in Facebook. We have studied fraudster
recruitment jobs in crowdsourcing sites and fraud posted in Google Play and
Facebook. This has allowed us to collect fraud data (see $\S$~\ref{sec:data})
and to identify several fraud behaviors: (i) more than one fraudster can target
the same subject; (ii) user accounts controlled by a fraudster tend to have a
significant history of common activities, i.e., performed on the same subjects;
and (iii) accounts controlled by different fraudsters tend to have few common
past activities.
\begin{figure}
\centering
\includegraphics[width=0.47\textwidth]{./figures/fraudsites/price_per_review_2.eps}
\caption{Price per review (minimum, average and maximum), for crowdsourcing
sites that focus on app market fraud. The sites offer ``fraud packages'' and
even discounts for bulk fake review purchases. A fake review costs between
\$0.5-\$3.
\label{fig:fraudsites}}
\vspace{-15pt}
\end{figure}
\vspace{0.05in}\noindent
{\bf Fraud incentives}.
We assume that fraud workers are rational, motivated by financial incentives.
That is, given an original investment in expertise and equipment, a fraud
worker seeks to maximize his revenue achieved per time unit.
Figure~\ref{fig:fraudsites} shows the minimum, average and maximum cost per
fraudulent activity, as advertised by several crowdsourcing and
fraud-as-a-service (FAAS) sites: a fake review for an app is worth between
\$0.5-\$3, while a fake social networking ``like'' can cost \$2. In contrast,
an adversarial owner may have both financial incentives (e.g., increased
market share for his subject, thus revenue), and external incentives (e.g.,
malware or fake news distribution).
\subsection{Fraud Preemption System Definition}
\label{sec:model:problem}
We introduce the concept of {\it fraud preemption systems}, that seek to
restrict the profitability of fraud for both fraudsters and the people who hire
the fraudsters (i.e., adversarial owners). Specifically, let $Sys =
(\mathcal{U}, \mathcal{S}, \mathcal{F}, P)$ be a system that consists of finite
sets of users ($\mathcal{U}$), subjects ($\mathcal{S}$) and fraudsters
($\mathcal{F}$) that interact through a set of procedures $P$. In the adversary
model of $\S$~\ref{sec:model:adversary}, we say that $Sys$ is a (p,a)-{\it
fraud preemption system} if it satisfies the following two conditions:
\begin{enumerate}
\item
{\bf Fraudster deterrence}:
The average payout per time unit of any fraudster in $\mathcal{F}$ does not
exceed $p$.
\item
{\bf Adversarial owner deterrence}:
The average number of fraudulent activities allowed for any subject in
$\mathcal{S}$ per time unit does not exceed $a$.
\end{enumerate}
\noindent
In addition, a puzzle-based fraud preemption system needs to satisfy the
following requirements:
\begin{enumerate}
\item
{\bf Real-time fraud detection}.
Detect fraud at the time it is created, with access to only limited information
(i.e., no knowledge of the future).
\item
{\bf Penalty accuracy}.
Impose difficult puzzles on fraudsters, but minimally impact the online
experience of honest users.
\item
{\bf Device heterogeneity}.
Both honest and fraudulent users may register and use multiple devices to
access the online service. Malicious users may obfuscate the computational
capabilities of their devices.
\item
{\bf Minimize system resource consumption}.
The high number of issued, active puzzles will consume the resources of the
FraudSys provider, and open it to DoS attacks.
\end{enumerate}
\section{FraudSys}
\label{sec:fraudsys}
\begin{figure}
\centering
\includegraphics[width=0.49\textwidth]{./figures/fraudsys/fraudsys.eps}
\caption{FraudSys architecture. The Fraud Detector module uses supervised
learning to assign a fraud score to user activities. The Fraud2Penalty module
converts the fraud score to a {\it time penalty}. The Hashrate Inference module
estimates the computational capabilities of the user device. Finally, the
Puzzler module generates a puzzle that the device should take approximately the
time penalty to solve.
\label{fig:fraudsys}}
\vspace{-15pt}
\end{figure}
We introduce FraudSys, a real-time fraud preemption system that requires users
to verify commitment through an imposed resource consumption action for each
activity they perform on the online system. Specifically,
FraudSys requires the device from which the activity was issued, to solve a
{\it computational puzzle}. FraudSys consists of the modules illustrated in
Figure~\ref{fig:fraudsys}: The Fraud Detection module takes as input a user
activity and the current state of the subject, and outputs a {\it fraud score}.
The Fraud2Penalty module converts the fraud score to a {\it time penalty}: the
time that the user's device will need to spend working on a computational
puzzle. The Hashrate Inference module interacts with the user device in order
to learn its puzzle solving capabilities. Finally, the Puzzler module uses the
inferred device capabilities to generate a puzzle that the device will take
a time approximately equal to {\it time penalty} to solve.
To address requirement \#1, the Fraud Detection module exploits the fraudulent
behaviors described in $\S$~\ref{sec:model:adversary}. It builds {\it
co-activity graphs} and extracts features that model the relationships between
the user performing the activity and other users that have earlier performed
similar activities for the same subject.
We address requirement \#2 through a two-pronged approach. First, the Fraud
Detection and Fraud2Penalty modules ensure that the difficulty of a FraudSys
puzzle will be a function of the detected probability of fraud: activities
believed to be honest will be assigned trivial puzzles, while increasingly
fraudulent activities will be assigned increasingly difficult puzzles. Second,
FraudSys does not change the experience of the user on the online system: the
user writes the review or clicks on the like button, then continues browsing or
quits the app. The assigned puzzle is solved in the background by the device on
which the activity was performed. However, FraudSys delays the publication of
the activity, until the device produces the correct puzzle solution.
To address requirement \#3, the Hashrate Inference module estimates the
hashrate of the device performing the activity, and provides the tool to punish
devices that cheat about their puzzle solving capabilities. To solve
requirement \#4, the Puzzler module generates puzzles that outsource the
storage constraints from the FraudSys service to the user devices that solve
the puzzles. In the following we detail each FraudSys module, starting with the
central puzzle creation module.
\begin{table}
\setlength{\tabcolsep}{.16677em}
\centering
\textsf{
\small
\begin{tabular}{l r}
\toprule
\textbf{Notation} & \textbf{Definition}\\
\midrule
$U$, $D$, $S$, $A$ & user, device, subject, activity\\
T & time of puzzle issue\\
$r$ & activity fraud score\\
\midrule
$\Delta$ & puzzle difficulty\\
$\eta_D$ & hashrate of device $D$\\
$\Gamma$ & puzzle cookie\\
$\Pi$ & puzzle\\
$target$ & puzzle target value\\
$\tau$ & temporal penalty\\
$q$ & number of shares (puzzle solutions)\\
\midrule
$K$ & secret key of FraudSys\\
\bottomrule
\end{tabular}
}
\caption{FraudSys symbol table.}
\label{fig:symbols}
\vspace{-15pt}
\end{table}
\subsection{The Puzzler Module: Stateless Puzzles}
\label{sec:fraudsys:puzzler}
Let $U$ be a user that performs an activity $A$ from a device $D$, on a subject
$S$ hosted by the online service. Table~\ref{fig:symbols}
summarizes the notations we use. The FraudSys service stores minimal state for
each registered user, and {\it serializes} his activities, see
Figure~\ref{fig:serialization}: the devices from which a user performs a
sequence of activities on the online service, are assigned one puzzle per
activity, each with its own timeout. The device needs to return the puzzle
solutions before the associated timeout. To implement this, for
each user $U$, the FraudSys service stores the following entry:
\[
U, [\langle D_i, \eta_i \rangle]_{i=1..d}, timeout,
\]
where, for each of the $i = 1 .. d$ devices registered by $U$, $D_i$ is the
device identifier and $\eta_i$ is its hashrate (puzzle solving capabilities
measure, see following), and $timeout$ is the latest time by which one of these
devices needs to return puzzle solutions.
FraudSys builds on the computational puzzles of Bitcoin, see~\cite{N08}. Let
$H^2(M)$ denote the double SHA-256 hash of a message $M$. Then, the FraudSys
puzzle issued to device $D$ consists of a $target$ value and a fixed string
$F$. We detail $F$ shortly. To solve the puzzle, $D$ needs to randomly choose
32 byte long $nonce$ values until it finds at least one that satisfies:
\vspace{-5pt}
\begin{equation}
H^2(nonce || F) < target
\label{eq:puzzle}
\end{equation}
That is, the double hash of the $nonce$ concatenated with $F$, needs to be
smaller than the $target$ value, another 32 byte long value. A smaller $target$
implies a harder puzzle. The largest $target$ acceptable by the system
is called $target\_1$, or {\it target of difficulty 1}.
Bitcoin has two drawbacks. First, the current difficulty of Bitcoin puzzles
requires computational capabilities that greatly exceed those of devices used
to access online services. Second, Bitcoin requires the network to maintain
state about issued puzzles. State storage exposes FraudSys to attacks, while
not storing state can enable adversaries to lower the difficulty of their
assigned puzzles. To address these problems we (i) change the $target\_1$
difficulty to allow trivial puzzles, and (ii) introduce {\it puzzle cookies},
special values that authenticate puzzles with minimal FraudSys state, see
following.
\vspace{0.05in}\noindent
{\bf Device hashrate and puzzle difficulty}.
We set the $target\_1$ value to be a 32 byte long value with one zero at the
beginning, e.g., $2^{255}-1$. In addition, the {\it hashrate} $\eta_D$ of a
device $D$ is a measure that describes the ability of the device to solve
puzzles. Since the puzzles need to be solved in a brute force approach, the
hashrate is measured in hashes per second. A relevant concept is the notion of
\textit{difficulty}, denoted by $\Delta$, a measure of how difficult it is to
solve a puzzle whose input values hash below a given target. Its relationship
to the above $target$ value is given by:
\begin{figure}
\centering
\includegraphics[width=0.43\textwidth,height=0.9in]{./figures/fraudsys/serialization.eps}
\vspace{-5pt}
\caption{Puzzle serialization: a user can perform multiple activities, but each
receives a different puzzle with its own timeout, authenticated through the
cookie $\Gamma$.}
\label{fig:serialization}
\vspace{-10pt}
\end{figure}
\begin{equation}
\Delta = \frac{target\_1}{target} = \frac{2^{255}-1}{target}
\label{eq:delta:target}
\end{equation}
\noindent
Given $\eta_D$, we derive the time
$\tau$ taken by $D$ to solve a puzzle with difficulty $\Delta$, as follows.
First, the number of hashes smaller than a given target is equal to the target.
For instance, the number of hashes smaller than $target\_1$ is $2^{255}-1$ .
Then, the probability $p$ of finding an input that hashes to a value smaller
than the target is equal to the target divided by the total number of hashes
($2^{256}$). Furthermore, the expected number of hashes, $E$, before achieving
the target is given by $1/p$. Thus:
\[
E = \eta_D \times \tau = \frac{2^{256}}{target} =
\frac{ 2^{256} }{target\_1}\times \frac{target\_1}{target} \approx 2\times \Delta
\]
and conclude that
\begin{equation}
\tau = \frac {2 \times \Delta}{\eta_D}
\label{eq:time:to:hashrate:puzzler}
\end{equation}
\noindent
For instance, the lowest puzzle difficulty is 1, which occurs when the $target$
has a prefix of one zero and the device is expected to generate 2 hashes before
solving the puzzle. Similarly, the maximum difficulty is $(2^{255}-1)$, for a
$target$ = 1, when the device is expected to perform $\frac{2^{255}-1}{1}
\times 2 \approx 2^{256}$ hashes.
\begin{figure}[t]
\renewcommand{\baselinestretch}{0.7}
\begin{minipage}{0.4\textwidth}
\begin{algorithm}[H]
\begin{tabbing}
XXX\=X\=X\=X\=X\=X\= \kill
1. \small{Object \mbox{\bf{FraudSysService}}}\\
2.\> \small{K: key;}\\
3. \> \small{Function\ {\bf BuildCookie}($U$, $D$, $S$, $A$, $q$)}\\
4.\>\> \small{$\eta_D$ := getHashrate($U, D$);}\\
5.\>\> \small{$r$ := computeFraudScore($U, S, A$);}\\
6.\>\> \small{$\tau$ := fraud2Penalty($r$);}\\
7.\>\> \small{$\Delta$ := $\eta_D \times \tau / 2q$}\\
8.\>\> \small{$oldT$ := getTimeout(U);}\\
9.\>\> \small{$newT$ := $oldT + \tau$;}\\
10.\>\> \small{$\Gamma$ := HMAC($K, U, D, S, newT, \Delta, A$);}\\
11.\>\> \small{setTimeout($U$, $newT$);}\\
12.\>\> \small{return $\Gamma$, $\Delta$, $newT$;}\\
13.\> \small{Function\ {\bf VerifyPuzzle}($U$, $D$, $S$, $A$, $timeout$, $\Gamma$, $\sigma$: share[$q$])}\\
14.\>\> \small{\mbox{\bf{if}}\ ($\Gamma$ != HMAC($K, U, D, S, A, timeout, \Delta$)\ return -1;}\\
15.\>\> \small{$target$ := getTarget($\Delta$);}\\
16.\>\> \small{\mbox{\bf{for}}\ ($i$ := 0;\ $i< q$;\ $i$++)}\\
17.\>\>\> \small{\mbox{\bf{if}}\ ($H^2(\sigma[i]\ ||\ \Gamma) > target$)\ return -1;}\\
18.\>\> \small{waitUntil($timeout$); post $A$;}\\
19.\>\> \small{$\tau' := T_c - T$;}\\
20.\>\> \small{\mbox{\bf{if}}\ (($\eta_D := 2 \Delta/\tau') \ge \eta_{min}$)}\\
21.\>\>\> \small{updateHashrate($U$, $D$, $\eta_D$);}\\
22. \small{Object\ \mbox{\bf{UserDevice}}}\\
23.\> \small{Function\ {\bf SolvePuzzle}($\Gamma$, $\Delta$, $timeout$, $q$)}\\
24.\>\> \small{$target$ := getTarget($\Delta$);}\\
25.\>\> \small{$\sigma$ := new share[q]; $i$ := 0;}\\
26.\>\> \small{\mbox{\bf{while}}\ ($i < q$)\ \mbox{\bf{do}}}\\
27.\>\>\> \small{$nonce$ := getRandom();}\\
28.\>\>\> \small{\mbox{\bf{if}}\ ($H^2(nonce\ ||\ \Gamma) < target$)}\\
29.\>\>\>\> \small{$\sigma[i]$ := $nonce$;}\\
30.\>\>\>\> \small{$i$ := $i$+1;}\\
31.\>\> \small{return\ $U, D, S, A, timeout, \Gamma, \sigma$;}
\end{tabbing}
\caption{FraudSys puzzle creation, verification and computation components.}
\label{alg:fraudsys}
\end{algorithm}
\end{minipage}
\normalsize
\vspace{-5pt}
\end{figure}
\vspace{0.05in}\noindent
{\bf The FraudSys puzzle and cookies}.
To minimize the storage imposed on the FraudSys service (see above), we
leverage the cookie concept~\cite{B96}. Algorithm~\ref{alg:fraudsys}
illustrates the puzzle creation, verification and computation components. The
FraudSys service generates and stores a secret key $K$ (line 2). When a user
$U$ performs an activity $A$ from a device $D$ on a subject $S$ of the online service,
the online service calls the BuildCookie function of the FraudSys service
(lines 3-11).
BuildCookie retrieves the hashrate of the device $D$ from the record stored by
FraudSys for $U$ (line 4). It then computes the fraud score associated to the
activity (line 5) then converts it to a time penalty $\tau$ (line 6). We
describe this functionality in the next subsections. BuildCookie then uses a
modified Equation~\ref{eq:time:to:hashrate:puzzler} to compute the difficulty
$\Delta$ that the puzzle should have (line 7). $\Delta$ is $q$ times smaller
than in Equation~\ref{eq:time:to:hashrate:puzzler}, as the puzzle solution
consists of $q$ shares, see SolvePuzzle.
BuildCookie gets the current timeout $oldT$ of $U$, and updates it to $newT$ by
adding the penalty $\tau$ to it (lines 8-9). It then computes the puzzle cookie
$\Gamma$,
\[
\Gamma = HMAC_K (U, D, S, A, timeout, \Delta)
\]
as a keyed HMAC~\cite{BCK96} over the user and device id, subject, activity,
new timeout and puzzle difficulty (lines 9-10). BuildCookie sets $U$'s timeout
value to the updated $newT$ value (line 11), then returns the following puzzle
(line 12) to the online service that forwards it to device $D$ (see
Figure~\ref{fig:system}):
\[
\Pi = \Gamma, \Delta, timeout.
\]
The puzzle cookie ensures that an adversary that modifies the puzzle's
difficulty or timeout, will be detected: the adversary does not know the key
$K$, which is a secret of the FraudSys service. Puzzle cookies are unique with
high probability, due to collision resistance properties of the HMAC, whose
input is non-repeating.
\vspace{0.05in}\noindent
{\bf Solving the puzzle}.
When the device $D$ receives the puzzle, it needs to solve it: search for $q$
$nonce$ values that satisfy the inequality $H^2(nonce\ ||\ \Gamma) < target$,
for a $target$ corresponding to the difficulty $\Delta$. Specifically, $D$
invokes the SolvePuzzle function (lines 23-31), that needs to identify $q$ {\it
shares}, i.e., nonce values that satisfy the puzzle. $q$ is a system parameter.
The function first uses Equation~\ref{eq:delta:target} to retrieve the $target$
value corresponding to the difficulty $\Delta$ (line 24). Then, it generates
random $nonce$ values until it identifies $q$ values that satisfy the puzzle
condition (lines 25-30). SolvePuzzle returns the identified shares (in the
$\sigma$ array), which are then sent to the online service and forwarded to the
FraudSys server, along with the user, device and subject ids, activity, timeout
and cookie of the received puzzle (see line 12 and Figure~\ref{fig:system}).
\begin{figure}
\centering
\includegraphics[width=0.47\textwidth]{./figures/coreview/2clique.eps}
\caption{Visualization of the co-review graph of a fraudulent Google Play app.
The nodes represent user accounts; edges connect nodes corresponding to
accounts with common, past review activities. The nodes in each of the 2
clusters correspond to accounts controlled by the same fraudster.}
\label{fig:coreview:fraud}
\vspace{-15pt}
\end{figure}
\vspace{0.05in}\noindent
\noindent
{\bf Verification of puzzle correctness}.
Upon receiving these values, the FraudSys server invokes the VerifyPuzzle
function (lines 13-21), to verify its correctness as follows:
(1) Reconstruct the puzzle cookie $\Gamma$ based on the received values and the
secret key $K$. Verify that this cookie is equal to the received $\Gamma$
value (line 14). This ensures that all values, including the $timeout$
have not been altered by an adversary; and
(2)
Verify that each of the $q$ shares satisfy the puzzle (lines 15-17).
If these verifications succeed, FraudSys waits until $timeout$ expires to
confirm the user action $A$, for posting by the online service (line 18).
It then uses the time required by the device to solve the puzzle, to
re-evaluate the hashrate of the device (lines 19-20). It updates the stored
hashrate only if the new value is above a minimally accepted hashrate value
(lines 20-21).
\subsection{The Fraud Detection Module}
\label{sec:fraudsys:fraud}
To assign a fraud score to a user activity in real-time, the fraud detection
module can only rely on the existing history of the user and of the subject on
which the activity is performed. We propose an approach that builds on the {\it
co-activity graphs} of subjects, where nodes correspond to user accounts that
performed activities on the subject, and edges connect nodes whose user
accounts have a history of activities that targeted the same subjects. Edge
weights denote the size of that history. Figure~\ref{fig:coreview:fraud} shows
the co-review (where activities are reviews) graph of a fraudulent Google Play
app, that received fake reviews from 2 fraud workers. Each cluster is formed by
accounts controlled by one of the workers.
The fraud detection module leverages the adversary model findings
($\S$~\ref{sec:model:adversary}) that a fraudster-controlled user account that
performs a new activity on a subject, is likely to be well connected to the
co-activity graph of the subject, or at least one of its densely connected
sub-graphs. Figure~\ref{fig:coaction:dynamic} illustrates this approach: Let
$U$ be a user account that performs an activity $A$ for a subject $S$ at time
$T$. Let $G=(V, E)$ be the co-activity graph of $S$ before time $T$. Let $G_T
= (V_T, E_T)$ be the new co-activity graph of $S$, that also includes $U$,
i.e., $V_T = V \cup U$. Given $U$, $S$ and $G$, FraudSys extracts the following
features, that model the relationship of $U$ with $S$:
\begin{figure}
\centering
\includegraphics[width=3.5in]{./figures/fraudsys/fraudprob.eps}
\caption{Fraud detection illustration: temporal evolution of the co-activity
graph of a subject. The nodes represent user accounts that have performed an
activity on the subject. Edges connect accounts with common past activities. As
a new user account posts an activity, FraudSys assigns the activity a fraud
score (the $r_1 .. r_4$ values), based on its connectivity to previous
activities. Yellow nodes are considered fraudulent ($r >
0.5$).
\label{fig:coaction:dynamic}}
\vspace{-15pt}
\end{figure}
\vspace{0.05in}\noindent
$\bullet$
{\bf Connectivity features}.
The percentage of nodes in $V$ to whom $U$ is connected. The average weight of
the edges between $U$ and the nodes in $V$. The average weight of those edges
divided by the average weight of the edges in $E$. This feature will indicate
if $U$ increases or decreases the overall connectivity of $G$. The number of
triangles in $G_T$ that have $U$ as a vertex. The average edge weight of those
triangles.
\vspace{0.05in}\noindent
$\bullet$
{\bf Best fit connectivity features}.
Since $U$ may be controlled by one of multiple fraudsters who target $S$, $U$
may be better connected to the subgraph of $G$ controlled by that fraudster.
Then, use a weighted min-cut algorithm to partition $G$ into components
$G_1,..,G_k$, such that any node in a component is more densely connected to
the nodes in the same component than to the nodes in any of the other
components. $G_1,..,G_k$ may contain user accounts controlled by different
fraudsters, see Figure~\ref{fig:coreview:fraud}. Identify the component $G_b$,
$b \in \{1,..k\}$ to which $U$ is the most tightly connected (according to
the above connectivity features).
Output the connectivity features between $U$ and $G_b$.
\vspace{0.05in}\noindent
$\bullet$
{\bf Account based features}.
The number of activities previously performed by $U$. The age of $U$: the time
between $U$'s creation and the time when activity $A$ is performed on $S$. The
{\it expertise} of $U$: the number of actions of $U$ for subjects similar to
$S$. Similarity depends on the online service, e.g., same category apps in
Google Play, pages with similar topics in Facebook.
\vspace{0.05in}\noindent
The Fraud Detection module trains a probabilistic supervised learning algorithm
on these features and uses the trained model to output the probability that a
given activity is fraudulent. We detail the performance of various algorithms,
over data that we collected from Google Play and Facebook, in
$\S$~\ref{sec:evaluation}.
\vspace{0.05in}\noindent
{\bf Per-fraudster timeout}.
We exploit the ability of the fraud detection module to identify accounts
controlled by the same fraudster, to further restrict fraud. Specifically,
instead of storing a $timeout$ timestamp for each user account, FraudSys can
store a single $timeout$ per detected fraudster. Thus, FraudSys will accumulate
penalties in a single, per-fraudster account. This facilitates
Claim~\ref{claim:fps}.
\subsection{The Fraud2Penalty Module}
\label{sec:fraudsys:all}
Given the fraud score $r$ of an activity of user $U$ (output by the Fraud
Detection module), performed from a device $D$ associated with the account of
$U$ (see the model section), the Puzzler module generates a puzzle whose
difficulty is a function of both $r$ and the computational capability of $D$.
We now describe the Fraud2Penalty module, that converts $r$ into a time
penalty.
\begin{figure}
\centering
\includegraphics[width=0.47\textwidth]{graphs/conversion.function/all_functions2.eps}
\vspace{-5pt}
\caption{Comparison of functions to convert fraud scores (x axis) to time
penalties (y axis). The logistic function (red dot-line) exhibits the required
exponential increase.}
\label{fig:conversion}
\vspace{-15pt}
\end{figure}
We have explored several functions to convert the fraud score $r$ of a user
activity to a time penalty. Let $minh$ and $maxh$, and $minf$ and $maxf$,
denote the minimum and maximum times imposed on the device from which an
honest, respectively fraudulent activity is performed. Let $thr$ denote the threshold fraud score above which we start to consider a user
activity as being fraudulent. We propose a conversion function that increases
linearly when $r < thr$, and exponentially when $r > thr$. Specifically, we propose a flexible generalization of
the logistic function (when $r > thr$), where the parameter
$k$ is the {\it growth rate}:
\begin{equation}
\begin{cases}
\frac{maxh - minh}{thr} r + minh & 0 \leq r \leq thr \\
\frac{maxf}{1 + (\frac{maxf-minf}{minf})e^{-k(r-thr)}} & thr \leq r \leq 1
\end{cases}
\label{eq:fraud2penalty}
\end{equation}
\noindent
We have compared this logistic increase function with other functions, with the
same linear increase in the honest region, but exponential ($(maxf -
minf)\frac{e^{r} - e^{thr}}{e^{1} - e^{thr}}
+ minf$) and logarithmic ($(minf - maxf)\frac{log r}{log(thr)}
+ maxf$) increase in the fraudulent regions. Figure~\ref{fig:conversion}
compares the logistic, exponential and logarithmic functions. It shows that
unlike the exponential and logarithmic functions, the logistic function
exhibits the desired rapid increase for fraud probability values above the
threshold value.
In $\S$~\ref{sec:evaluation} we detail parameter values for the logistic
conversion function,
\subsection{The Hashrate Inference Module}
\label{sec:fraudsys:hashrate}
\noindent
{\bf New device registration}.
When a user registers a new device, the device sends its specs to the online
service that forwards them to FraudSys. FraudSys leverages its
list of profiled devices (see Table~\ref{table:hashrate}) to retrieve the
hashrate of the profiled device with the most similar capabilities. FraudSys
stores the new device along with this initial hashrate estimate under the id of
the user that registers it (see the Puzzle module).
Given this hashrate and the
above time penalty, FraudSys uses Equation~\ref{eq:time:to:hashrate:puzzler}
to compute an initial puzzle difficulty.
\vspace{0.05in}\noindent
{\bf Hashrate correction}.
The initial hashrate estimate of FraudSys may be incorrect. In addition, as
discussed in the System Model, the user may be adversarial, thus attempt to
provide an inaccurate view of the puzzle solving capabilities of his device.
To address these problems, FraudSys employs an adaptive hashrate correction
process. Specifically, an adversary with a more capable device than advertised
(see e.g., Table~\ref{table:hashrate}) will solve the assigned puzzle faster.
The incentive for this is a shorter wait time for his activity to post on the
online service. If this occurs, FraudSys increases its device hashrate
estimate to reflect the observed shorter time required by the device to solve
the puzzle (see Algorithm~\ref{alg:fraudsys}, lines 19-20).
\section{FraudSys Properties}
\label{sec:properties}
\begin{claim}
A fraudster that performs a fraudulent activity with fraud score $r$ from a
device with hashrate $\eta$, is expected to compute $\frac{\eta \times maxf}{1
+ (\frac{maxf-minf}{minf})e^{-k(r-thr)}}$ double hashes.
\label{claim:work}
\end{claim}
\vspace{-12pt}
\begin{proof}
According to Equation~\ref{eq:fraud2penalty}, the time penalty assigned to a
fraudulent activity with score $r$ is $\tau = \frac{maxf}{1 +
(\frac{maxf-minf}{minf})e^{-k(r-thr)}}$. Then,
Equation~\ref{eq:time:to:hashrate:puzzler} ensures that the number of expected
hashes that the device needs to perform to solve the puzzle of
Equation~\ref{eq:puzzle} is $\eta \times \tau$, which concludes the proof.
\end{proof}
\vspace{-5pt}
Let $f$ be the number of fraud workers in the system (i.e., $f =
|\mathcal{F}|$), $\tau$ be the average temporal penalty assigned by FraudSys
to a fraudulent activity, and let $p$ be the expected payout for a single
fraudulent activity. We introduce then the following claim:
\vspace{-5pt}
\begin{claim}
FraudSys is a $(p/\tau, f/\tau)$-fraud preemption\\ system.
\label{claim:fps}
\end{claim}
\vspace{-13pt}
\begin{proof}
The best fit connectivity features of the Fraud Detection module (see
$\S$~\ref{sec:fraudsys:fraud}) enable FraudSys to detect activities performed
from accounts controlled by the same fraudster. This, coupled with an
extension of the $timeout$ concept applied at the fraudster level (see
$\S$~\ref{sec:fraudsys:fraud}) ensures a serialization of fraudster activities.
Then, the average number of fraudulent activities that a fraudster can post per
time unit in FraudSys is $1/\tau$. This implies that, per time unit, the
expected payout of a fraudster is $p/\tau$, and a subject can be the target of
at most $f/\tau$ fraudulent activities. This, according to the definition of
$\S$~\ref{sec:model:problem}, completes the proof.
\end{proof}
\vspace{-5pt}
\subsection{Security Discussion and Limitations}
The FraudSys puzzle not only ties the penalty computation to the user
activity, but also addresses pre-computation, replay and guessing attacks: the
adversary cannot predict the cookie value of its actions, thus cannot
pre-compute puzzles and cannot reuse old cookies. It also offloads significant
work from the FraudSys service, which no longer needs to keep track of puzzle
assignments.
\vspace{0.05in}\noindent
{\bf Device deception}.
An adversary with a specialized puzzle solving device (e.g., AntMiner) will be
assigned puzzles with large difficulty values (see, e.g.,
Table~\ref{table:hashrate}), thus consume the same amount of time as when using
a resource constrained device (e.g., a smartphone). The adversary can exploit
this observation to avoid the implications of Claim~\ref{claim:work}: register
a resource constrained device, but rely on a powerful back-end device to solve
the assigned puzzles faster. The adversary has two options. First, report the
solutions as soon as the back-end device retrieves them. In this case however,
the adversary leaks his true capabilities, as FraudSys will update the
adversary hashrate (Algorithm~\ref{alg:fraudsys}, line 20). Thus,
subsequently, his assigned puzzles will have a significantly higher difficulty
value. In a second strategy, the adversary estimates the time that his
front-end device would take to complete the puzzle, then waits the remaining
penalty time. In this case, the adversary incurs two penalties, the long
wait time and the underutilized back-end device investment.
\vspace{0.05in}\noindent
{\bf Adversary strategies: new user accounts}.
To avoid the implications of Claim~\ref{claim:fps}, the adversary registers new
user accounts. While new accounts are cheap, their freshness and lack of
history will enable the account based features of the Fraud Detection module to
label them as being likely fraudulent. As the adversary reuses such accounts,
the connectivity features start to play a more important role in labeling their
activities as fraudulent. Thus, the adversary has a small usable window of
small penalties for new accounts.
While new honest accounts may also be assigned larger penalties for their first
few activities, they will not affect the user experience: the user can continue
her online activities, while her device solves the assigned puzzle in the
background.
\section{Empirical Evaluation}
\label{sec:evaluation}
\subsection{Datasets}
\label{sec:data}
\begin{figure*}
\centering
\captionsetup[subfigure]{aboveskip=0.1in, belowskip=-0.05in}
\begin{subfigure}[b]{2.25in}
\includegraphics[width=2.25in]{graphs/gplay/honest.fraud.penalty/penalty.evolution.eps}
\caption{}
\label{fig:penalty:evolution}
\end{subfigure}
~
\captionsetup[subfigure]{aboveskip=0.1in, belowskip=-0.05in}
\begin{subfigure}[b]{2.25in}
\includegraphics[width=2.25in]{graphs/gplay/honest.fraud.penalty/fraud.penalty.distribution.5min.24h.eps}
\caption{}
\label{fig:gplay:fraud}
\end{subfigure}
~
\begin{subfigure}[b]{2.25in}
\includegraphics[width=2.25in]{graphs/gplay/honest.fraud.penalty/honest.penalty.distribution.5min.24h.eps}
\caption{}
\label{fig:gplay:honest}
\end{subfigure}
\vspace{-5pt}
\caption{
Stats over the Google Play data when $maxf$ = 24h, $minh$ = 2s, $maxh = minf$ = 5min.
(a) Evolution of average, 1st and 3rd quartile of the penalty imposed on the
$i$-th fraud activity of a fraudster for the same subject. It
shows a steep increase: the average penalty of the first three fraud activities
for a subject sums to 15.34h, while {\bf the average penalty of the $12$th activity
exceeds 24h}.
(b) Distribution of per-fraudster daily penalties, over data from 23
fraudsters: in 1,812 days out of 2,708 days, the penalty assigned to a single
fraudster exceeds 24 hours.
(c) Distribution of penalties assigned to an honest review. Only 14 out of
4,600 honest review instances received a penalty exceeding 5 minutes, but still
below 1 hour.}
\label{fig:gplay}
\vspace{-15pt}
\end{figure*}
We have collected the following datasets of fraudulent and honest behaviors
from Google Play and Facebook.
\vspace{0.05in}\noindent
{\bf Google Play: fraud behavior data}.
We have identified 23 workers in Freelancer, Fiverr and Upwork, with proven
expertise on performing fraud on Google Play apps. We have
contacted these workers and collected the ids of 2,664 Google Play accounts
controlled by them. We have also collected 640 apps heavily reviewed from
those accounts, with between 7 and 3,889 reviews, of which between 2\% and
100\% (median of 50\%) were written from accounts controlled by the workers.
These apps form our gold standard {\it fraud app} dataset. We have also
collected the 23,028 fake reviews written from the 2,664 fraudster controlled
accounts for the 640 apps. Figure~\ref{fig:coreview:fraud} shows the co-review
graph of one of these apps, that received fake reviews from 2 of the identified
23 workers.
\vspace{0.05in}\noindent
{\bf Google Play: honest behavior data}.
We have selected $925$ candidate apps that have been developed by Google
designated ``top developers''. We have removed the apps whose apks
(executables) were flagged as malware by VirusTotal. We have manually
investigated $601$ of the remaining apps, and selected a set of $200$ apps that
(i) have more than $10$ reviews and (ii) were developed by reputable media
outlets (e.g., NBC, PBS) or have an associated business model (e.g., fitness
trackers). We call these the gold standard {\it benign app dataset}.
We have identified 600 reviewers of these 200 benign apps and 140 reviewers of
the 640 fraud apps (see above), such that each has reviewed at least 10 paid
apps, i.e., paid to install the app, then reviewed it, and had at least 5 posts
on their associated Google Plus (social network) accounts. These 740 user
accounts form our gold standard {\it honest user dataset}. We have then
retrieved and manually vetted 854 reviews written by the 600 honest reviewers
for the 200 benign apps, and 207 reviews written by the 140 honest reviewers of
the 640 fraud apps. Each selected review is informative, containing both
positive and negative sentiment statements. We call the resulting dataset, the
{\it honest review dataset}, with 1,061 reviews.
\vspace{0.05in}\noindent
{\bf Facebook Like dataset}.
We have used a subset of the dataset from~\cite{BLLTZ16}, consisting of 15,694
Facebook pages, that each has received at least 30 likes. The pages were liked
from 13,147 user accounts, of which 6,895 are fraudster controlled, and 6,252
are honest. In total, these fraudsters have posted 274,297 fake likes, and the
honest accounts have posted 180,400 honest likes.
\subsection{Device Hashrate Profile}
\begin{table}
\setlength{\tabcolsep}{.16677em}
\centering
\small
\textsf{
\begin{tabular}{l | r | r r r}
\toprule
\textbf{Device} & \textbf{Hashrate} & \textbf{Diff (5s)} & \textbf{ (12hr)} & \textbf{ (7 day)}\\
\midrule
Nexus 4 & 6.53 KH/s& 16.32K& 141.04M& 1.97G\\
Nexus 5 & 13.26 KH/s & 33.15K& 286.41M& 4.00G\\
LG Leon LTE & 10.1 KH/s& 25.25K& 218.16M& 3.05G\\
NVS 295 & 1.7MH/s & 4.25M& 36.72G& 514.08G\\
Server & 80 MH/s & 200M & 1.72T & 24.19T\\
AntMiner & 4.72 TH/s & 11.8T& 101.95P& 1427P\\
\bottomrule
\end{tabular}
}
\caption{Hashrate profiling table for various device types (smartphone, tablet,
PC and Bitcoin miner), along with difficulty values for penalty times of 5s, 12
hours and 7 days.}
\label{table:hashrate}
\vspace{-20pt}
\end{table}
\begin{table}[h]
\vspace{-5pt}
\centering
\textsf{
\begin{tabular}{l | r r | r}
\toprule
\textbf{Strategy} & \textbf{FPR}\% & \textbf{FNR}\% & \textbf{Accuracy}\%\\
\midrule
k-NN & 1.41 & 4.45 & 97.92\\
SVM & 5.8 & 11.3 & 92.40\\
Random Forest & 3.44 & 6.46 & 95.69\\
\bottomrule
\end{tabular}
}
\caption{10-fold cross validation results of supervised learning algorithms in
fraud vs. honest Google Play review classification. k-NN achieves the lowest
FPR and FNR.}
\label{table:fraudsys:algorithms}
\vspace{-15pt}
\end{table}
We have profiled the hashrate of several devices, ranging from smartphones to a
Bitcoin mining hardware (AntMiner S7: ARMv7 CPU, 254 Mb of RAM, 135 BM1385
chips @ 700MHz). Since Bitcoin mining requires capabilities far exceeding
those of smartphones, we have implemented an Android app to evaluate the
hashrate of several Android devices.
Table~\ref{table:hashrate} shows the hashrate values for the profiled devices,
along with the corresponding difficulty ($\Delta$) values for puzzles required
to impose 5 second, 12 hour and 7 day time penalties on such devices. We
observe the significant gap between the hashrate of a smartphone (10-15 KH/s)
and a specialized device (4.72 TH/s). This motivates the need for the puzzles
issued by FraudSys to have different $\Delta$ values for various user devices.
FraudSys maintains a similar table in order to be able to build appropriate
puzzles for newly registered devices.
\subsection{Fraud Penalty Evaluation: Google Play}
\begin{figure*}
\centering
\captionsetup[subfigure]{aboveskip=0.1in, belowskip=-0.05in}
\begin{subfigure}[b]{2.25in}
\includegraphics[width=2.25in]{graphs/facebook/honest.fraud.penalty/fraud.penalty.distribution.5min.24h.eps}
\caption{}
\label{fig:facebook:fraud:penalty}
\end{subfigure}
~
\captionsetup[subfigure]{aboveskip=0.1in, belowskip=-0.05in}
\begin{subfigure}[b]{2.25in}
\includegraphics[width=2.25in]{graphs/facebook/honest.fraud.penalty/honest.penalty.distribution.5min.24h.eps}
\caption{}
\label{fig:facebook:honest:penalty}
\end{subfigure}
~
\begin{subfigure}[b]{2.25in}
\includegraphics[width=2.25in]{graphs/payout/compare.fraud.payout.eps}
\caption{}
\label{fig:payouts}
\end{subfigure}
\vspace{-5pt}
\caption{
(a) Penalty distribution for the fake Facebook likes. 84\% of the likes
received a penalty that exceeds 12 hours, and the average fake like penalty is
19.32 hours.
(b) Penalty distribution for the honest Facebook likes. 82.97\% of the honest
likes are assigned a penalty of under 5 min. The maximum penalty assigned
to an honest like is 70 minutes.
(c) Comparison of daily payouts provided by Bitcoin mining, writing fake
reviews in Google Play and posting fake likes in Facebook, under FraudSys.
{\bf Fraud does not pay off under FraudSys}: the fraud payout is less than half
the Bitcoin mining payout.}
\label{fig:facebook}
\vspace{-5pt}
\end{figure*}
\noindent
{\bf Supervised learning algorithm choice}.
We first used 10 fold cross-validation to evaluate the ability of the Fraud
Detection module to correctly classify the 23,028 fraudulent vs. 1,061 honest
reviews of the Google Play dataset previously described.
Table~\ref{table:fraudsys:algorithms} shows the false positive (FPR) and
negative (FNR) rates, as well as the accuracy achieved by the top 3 performing
supervised algorithms. k-NN has the lowest FPR and FNR, for an accuracy of
97.92\%. Thus, in the following experiments we use only k-NN.
\vspace{0.05in}\noindent
{\bf Parameter evaluation}.
We have used the fraud and honest review datasets described earlier, to compute
the temporal penalties imposed by FraudSys on fraudsters and honest users. We
have performed the following experiments. In each experiment, we use the data
of 22 fraud workers and 200 randomly chosen honest reviews (out of 1,061) to
train the supervised learning algorithm (k-NN) then test the model on the data
of the remaining fraud worker and on the remaining 861 honest reviews. Thus,
we have performed 23 experiments, one for each worker.
We set the $maxf$ parameter such that the average daily payout of a fraudster
is below the average Bitcoin mining payout with a last generation AntMiner
device. Thus, this ensures that even such a powerful adversary has more
incentive to do Bitcoin mining instead of search rank fraud. Specifically, the
above AntMiner's current (Jan. 2017) average daily payout is 0.0037 BTC. At
the current BTC to USD rate, this means \$3.67 per day~\footnote{Historically
speaking, the BTC to USD rate is increasing. The next generation AntMiner
coming up this year is expected to be 3 times more capable.}. In addition, we
have experimented with $maxf$ values ranging from 12 to 48 hours. The average
penalty assigned by FraudSys to a fraudulent review is 8.01 hours when
$maxf$=12h, 15.34h when $maxf$=24h, and 29.33h when $maxf$=48h.
Figure~\ref{fig:penalty:evolution} shows the median, first and third quartiles
for the time penalty (in hours) imposed on the $i$-th fraudulent activity
performed by a fraudster for a subject, when $maxf$= 24h: the 12th fake
activity receives a median penalty of 24h.
Thus, we set $maxf$=24h, which is sufficient for Google Play reviews: A
fraudster would be able to post on average less than 2 fake reviews per day,
thus, even with a reward of \$2 per fraud activity (see
Figure~\ref{fig:fraudsites}), achieve a payout of around \$3.15 per day, below
the Bitcoin mining payout. In addition, we have set $minh$ = 2s.
Figure~\ref{fig:timeline} shows the penalty timelines of two workers when
$minh$ = 2s, $maxh = minf$ = 5 min, $maxf$ = 24 hours, $thr = 0.5$, and $k=30$
(for a steep increase of time penalty with fraud score). We note that a $maxh$
= 5 min is not excessive: this penalty is not imposed on the user, but on his
device. The user experience remains the same in the online service.
Each vertical bar shows the daily temporal penalty assigned to a single worker,
over reviews posted from multiple accounts. The maximum daily penalty of the
two workers is 1,247 hours and 3,079 hours respectively. We observe that each
worker has many days with a daily penalty exceeding 24 hours.
Figure~\ref{fig:gplay:fraud} shows for $maxh = minf$ = 5min, the overall
distribution of daily penalties assigned by FraudSys, over all the 23 fraud
workers, in the above experiment. It shows that during most of the active days,
fraud workers are assigned a daily penalty exceeding 24 hours.
Figure~\ref{fig:gplay:honest} (also for $maxh = minf$ = 5min) shows the
distribution of per-review penalty assigned by FraudSys to honest reviews,
shown over 4,600 (23 $\times$ 200) honest reviews. Irrespective of the $maxh$
value, only 14 honest reviews were classified as fraudulent, but assigned a
penalty below 1 hour. We observed minimal changes in the distribution of
penalties of fraudulent reviews when $maxh = minf$ ranges from 5 to 15 minutes.
\subsection{Fraud Penalty Evaluation: Facebook}
We have performed a similar parameter analysis using the Facebook ``like''
dataset. Since this dataset lacks information about the fraudsters who control
the accounts that posted fake likes, we focus on the penalties assigned by
FraudSys to fake and honest likes.
Figure~\ref{fig:facebook:fraud:penalty} shows the distribution of penalties
assigned to fake likes and Figure~\ref{fig:facebook:honest:penalty} shows the
distribution of the honest likes. Compared to the results over the Google Play
data, we observe a higher FPR, i.e., more honest likes with fraud level
penalties. We posit that this is due to the fewer features that we can extract
for the Facebook likes, as, unlike for Google Play reviews, we lack the time of
the activity. Specifically, absence of like sequence information enables us to
only extract features based on the last ``snapshot'' of the page, and not the
current page snapshot when the like was posted.
However, 82.97\% of the honest likes receive a penalty of under 5 mins and the
maximum penalty assigned to an honest review is 70 mins. In addition, 84\% of
the fake likes receive a penalty that exceeds 12 hours, and the average penalty
for a fake like is 19.32 hours. Figure~\ref{fig:payouts} compares the daily
payouts received by an AntMiner equipped fraudster who writes fake reviews in
Google Play (at \$1 per fake review), posts fake likes (at \$2 per fake like),
or honestly uses his device to mine Bitcoins. It shows that under FraudSys,
fraud doesn't pay off: the Bitcoin mining payout is more than double the fraud
payout for either fake reviews or likes.
\section{Conclusion}
We have introduced the concept of real-time fraud preemption systems, named as the FraudSys, that seek
to restrict the profitability and impact of fraud in online systems. We
propose and develop stateless, verifiable computational puzzles, that impose
minimal overheads, but enable their efficient verification. We have developed
a graph based, real-time algorithm to assign fraud scores to user activities
and mechanisms to convert scores to puzzle difficulty values. We used data
collected from Google Play and Facebook to show that our solutions impose
significant penalties on fraudsters, and make fraud less productive than
Bitcoin mining.
\section{Acknowledgments}
This research was supported in part by NSF grants CNS-1527153, SES-1450619,
CNS-1422215, IUSE-1525601, and Samsung GRO.
\bibliographystyle{abbrv}
| {'timestamp': '2017-06-07T02:02:19', 'yymm': '1706', 'arxiv_id': '1706.01560', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01560'} | arxiv |
\section*{Abstract}
\textbf{Background}: The analyses of human daily interactive behaviors at the population level play a critical role to understand many dynamic processes, e.g., information diffusion, and disease transmission, taking place in the human society. The recent advance of information technologies such as mobile phone, RFID, wireless sensor, and our interest in, WiFi provides powerful measures to digitize the population interactions and facilitate quantitative investigations.\\
\textbf{Methods and Findings}: To explore large-scale population indoor interactions, we analyze \emph{18,715} users' WiFi access logs recorded in a Chinese university campus during \emph{3} months, and define two categories of human interactions, the event interaction (EI) and the temporal interaction (TI). The EI helps construct a transmission graph, and the TI helps build an interval graph. The dynamics of EIs show that their active durations are truncated power-law distributed, which is independent on the number of involved individuals. The transmission duration presents a truncated power-law behavior at the daily timescale with weekly periodicity. Besides, those \emph{`leaf'} individuals in the aggregated contact network may participate in the \emph{`super-connecting cliques'} in the aggregated transmission graph. Analyzing the dynamics of the interval graph, we find that the probability distribution of TIs' inter-event duration also displays a truncated power-law pattern at the daily timescale with weekly periodicity, while the pairwise individuals with burst interactions are prone to randomly select their interactive locations, and those individuals with periodic interactions have preferred interactive locations.\\
\textbf{Conclusion and Significance}: The dynamics of a large-scale population's indoor interactions shows the convolution of human activities' daily bursts and weekly rhythms. The `leaf' individuals in the aggregated contact network gathering to function as `hubs' in the transmission graph highlights the significant difference between aggregated and temporal structures, and the analyses of temporal dyads from the spatiotemporal perspective pave a new path to predict human interactive behaviors.
\section*{Introduction}
Nowadays, a great deal of digital technologies are unobtrusively embedded into the physical world of human daily activities: we communicate with each other through emails and/or mobile phones, pay the shopping with credit cards, use public transportation by transit cards, and surf via wired or wireless networks. These technical innovations not only reshape our social life, but also record tremendous digital trajectories of human activities, which provide proxy clues to understand human behavioral patterns \cite{TechnoSocialSystem,ComputeSocialScience,email,mobilephone,banknote,onlinedata,Pentland2010AmerScience,Pentland2009WEF,Pentland2008Book,EagleN2005PhD,EagleN2006PUC,EagleN2009PNAS,RFID2010PLoSONE,RFID2011PLoSONEHosptial,RFID2010JTB,RFID2011PLoSONESchool,WirelessSensor2010PNAS,Takaguchi11PRX}. For instance, Pentland et al. \cite{Pentland2010AmerScience,Pentland2009WEF,Pentland2008Book} constructed `sociometers' to capture human honest signals in the workplace to infer their productivity and creativity. Eagle et al. \cite{EagleN2005PhD,EagleN2006PUC,EagleN2009PNAS} used Bluetooth embedded in the mobile phones to infer friendships from close proximity interactions. Barrat and his colleagues \cite{RFID2010PLoSONE,RFID2011PLoSONEHosptial,RFID2010JTB,RFID2011PLoSONESchool} built a flexible framework based on the distributed active Radio Frequency Identification (RFID) technology to record human face-to-face interactions in different rendezvouses, e.g., conference, office, hospital, museum, and school. Salath\'{e} et al. \cite{WirelessSensor2010PNAS} developed wireless sensors to evaluate the respiratory disease transmission risk among the members of a high school through person-to-person contacts. Takaguchi and his colleagues analyzed two sets of face-to-face interaction logs sampled by infrared sensor devices to predict conversation patterns\cite{Takaguchi11PRX}. Since human physical close proximity has been recognized to play a crucial role to (biological and computer) virus transmission, word-of-mouth information diffusion, and human social ties\cite{EagleN2009PNAS,RFID2011PLoSONEHosptial,RFID2010JTB,RFID2011PLoSONESchool,WirelessSensor2010PNAS,Takaguchi11PRX,RFIDDisease,RFIDInformation}, these fruitful researches not only shed light on human interactive features in a small community, but also inspire us to put a step further to explore human indoor interactions in an environment with a large-scale `natural' population.
Recent years, WiFi(or known as IEEE 802.11), as a ubiquitous wireless data exchange technology, has become one of the brightest areas in the communication business. Actually, WiFi signals can be found at almost every corner of the urban areas, and the notion of `WiFi-city' becomes reality. A university is a snapshot of the modern society, so is the WiFi coverage, where the WiFi control system records the digital access logs of the authorized WiFi users during their activities in the campus. Such WiFi access records work the proxy of a large-scale population's interactive activities with time stamps \cite{EPL68002,UrbComp2012}, which deserve more extensive efforts to capture the temporal patterns of their dynamics.
The WiFi dataset involved in this study was collected at Handan campus of Fudan University in Shanghai, China, which contains \emph{18,715} WiFi users' individual behavioral trajectories during \emph{3} months of a fall semester. We define two categories of human indoor interactions: event interaction(EI) and temporal interaction(TI). From the perspective of temporal networks\cite{Temporalnetworks}, the EIs help construct a transmission graph to characterize the group interactive features, and the TIs build an interval graph to characterize the dyad interactive features. The dynamics of EIs show that their active durations are truncated power-law distributed and `size-free', independent on the number of involved individuals. The transmission duration presents a power-law behavior at the daily timescale with weekly periodicity. Besides, some \emph{`leaf'} individuals in the aggregated contact network participate in the \emph{`super-connecting cliques'} of the aggregated transmission graph. Analyzing the dynamics of the interval graph, we find that the probability distribution of TIs' inter-event duration also displays a truncated power-law pattern at the daily timescale with weekly periodicity, while the pairwise individuals with burst interactions are prone to randomly select their interactive locations, and those individuals with periodic interactions have preferred interactive locations.
\section*{Results}
\subsection*{Two Categories of Human Indoor Interactions and Temporal Networks}
Before transforming the WiFi data of access logs as the proxy of a large-scale population's indoor interactions, we state our main assumption \cite{opportunistic2007IEEE,EPL68002,UrbComp2012} in this paper: the WiFi devices seeing the same wireless access point(WAP) infers an indoor interaction among these devices' owners (see \emph{Methods} and \emph{Text SI} for the validity of the main assumption).
We first define two categories of human indoor interactions and temporal graphs. Figure \ref{schematic}(a) shows an instance which translates three WiFi users' access logs into the individual behavioral traces. The bold lines pertain to their online durations. In the observed epoch [$t_0,t_7$], these three users are uniquely recorded by this WAP.
\indent
\textbf{From Event Interactions To Transmission Graph}
\indent
With the aforementioned main assumption - the users 'seeing' the same WAP have an indoor interaction, Figure \ref{schematic}(b) illustrate the process of translating individual behavioral trajectories into event interactions(EIs) and constructing the corresponding transmission graph(TG). Event interaction is defined to characterize the group interactive dynamics and evolution features, which facilitates the analysis of epidemic spread or information diffusion. For instance, in the epoch of [$t_{1},t_{2}$], the online duration of \emph{A} and \emph{B} are overlapped, we therefore define an EI $E_{AB}^{t_1}$ characterizing the fact that \emph{A} and \emph{B} are assembled as a contact group.
Regarding event interactions as vertices \cite{TG1,TG2}, we define two vertices are linked given the following three rules are satisfied:
\begin{enumerate}
\item In the time series, a source EI (e.g., $E_{AB}^{t_1}$) is the closest EI prior to the sink EI ($E_{ABC}^{t_2}$).
\item At least one user coexists in the source and sink EIs.
\item When there are several sources before one sink, any set of the shared users between the given source and sink EIs never intersect with each other(set).
\end{enumerate}
The three rules ensure that the source EI has a potential to transfer some information or virus to the sink EI due to the intermediate role of shared individuals. As illustrated in Figure 1(b), $E_{AB}^{t_1}$ is active in the epoch [$t_{1},t_{2}$] and $E_{ABC}^{t_2}$ in [$t_{2},t_{3}$], while two EIs satisfy the above three rules, a directed edge links these two vertices in the transmission graph.
To quantify the temporal information in event interactions and the transmission graph, we introduce the following quantities:
\begin{itemize}
\item The size \emph{s} of a given EI is defined as the number of users involved.
\item If a given EI is active in the period of [$t^{begin},t^{end}$], its active duration is defined as \\$\Delta t^{EI}=t^{end}-t^{begin}$.
\item Given two connected EIs, $i, j$, linked in the TG, denote the edge weight $\omega_{ij}=(\delta, t^{observed})$, i.e., the shortest transmission duration from the source $E_i$ to the sink $E_j$ is $\delta$ when observed at the time $t^{observed}$. (Without special statement, $t^{observed}$ is considered as $t^{begin}$ of each source EI in this paper.)
\end{itemize}
Generally, the topological properties of a temporal graph are measured from the corresponding aggregated network on a given time window \cite{RFID2010PLoSONE,RFID2011PLoSONEHosptial,RFID2010JTB,RFID2011PLoSONESchool }. Here, we aggregate the transmission graphs on the whole observation period (\emph{3 } months) to generate the aggregated transmission graph (ATG), and define several quantities as follows:
\begin{itemize}
\item The frequency $n^{EI}$ gives the number of EI's active times. For instance, $E_{AB}$ in Figure \ref{schematic}(b) takes place in two time intervals, $[t_1,t_2]$ and $[t_3,t_4]$, so the frequency $n^{EI}_{AB}=2$.
\item The number of repeated transmission paths from source EI (e.g.,$E_i$) to sink EI ($E_j$) is frequency $n^{TP}_{E_iE_j}$.
\end{itemize}
\indent
\textbf{From Temporal Interactions To Interval Graph}
\indent
We further define temporal interactions to characterize the dyad interactions. With the main assumption mentioned above, \emph{A} and \emph{B} in Figure \ref{schematic}(a,c), who share a common duration, assemble into a temporal interaction $T_{AB}^{t_1}$ during the epoch [$t_{1},t_{4}$]. The set of temporal interactions(TIs) can be represented by an interval graph \cite{Temporalnetworks} directly, where users are the vertices, and TIs are the edges.
The following definitions of an interval graph are introduced to quantify the temporal information of dyad interactions:
\begin{itemize}
\item Given an active TI during [$t^{started},t^{finished}$], the active duration of the edge (TI) is \\$\Delta t^{TI}= t^{started}-t^{finished}$.
\item The frequency of edge $n^{TI}_{ij}$ gives the number of times that two connected users $i,j$ repeat their TIs.
\item Given the same dyad's two successive TIs, $T^{1}_{ij}$ and $T^{2}_{ij}$ ($i,j$ are two users), their active durations are [$t^{started}_{1},t^{end}_{1}$] and [$t^{started}_{2},t^{end}_{2}$], respectively. The inter-event duration is defined as the difference between the beginning time of these two successive TIs ($\Delta\tau=t^{started}_{2}-t^{started}_{1}$). Take \emph{A} and \emph{C} in Figure \ref{schematic}(c) as an example, $\Delta\tau_{AC}=t_{6}-t_{2}$.
\end{itemize}
The dyads' TIs have a non-decreasing time sequence if their frequency $n^{TI}_{ij}>1$. As shown in Figure \ref{schematic}(c), the TIs of \emph{A,C} have a non-decreasing active time sequence:[$t_2,t_3$],[$t_6,t_7$].
\indent
To summarize, as shown in Figure \ref{schematic}, event interactions are driven by the group access-related events, while temporal interactions are driven by the time sequences of dyad interactions. Each event interaction possesses an exclusive time interval on the WAP it takes place, whereas different temporal interactions may coexist with each other (e.g., $T_{AC}^{t_2}$ and $T_{BC}^{t_3}$ in Figure \ref{schematic}(c)).
\subsection*{Dynamics of event interaction}
Figure \ref{dynei}(a) shows that the probability distribution of EIs' active durations collected in 3 months is a truncated power law (the exponent of the power-law part approximates to 1), indicating that the long-lasting group interactions can hardly survive due to the frequent emergence of abundant short-active-duration events. In Figure \ref{dynei}(b), the number of event interactions with a given size (\emph{N(s)}) is exponential distributed, which further implies that the EIs having large sizes are rare. Therefore, it is natural to explore the dependence between the distribution of EIs' active durations $\Delta t^{EI}$ and a given size \emph{s}. Firstly, we study the impact of small sizes on EIs' active durations: the probability distributions of EIs' active durations $\Delta t^{EI}_{s}$ with size $s=2,3,4,5$ exhibit the truncated power-law behaviors, and their power-law parts present the similar exponents close to 1. However, their exponential cutoffs gradually decay with the growth of event size(Figure \ref{dynei}(c)). Besides, when the size of EIs is larger than 5, the influence of EIs' sizes to their active durations is subtle. Figure \ref{dynei}(d) reports the probability distributions of the EIs' active durations with a given size $s\geq 5$, which keeps almost invariant with the growth of size, i.e., the active durations of EIs are \emph{`size free'} in this case.
As shown in Figure \ref{dynei}, all EIs' active durations are less than 5 hours, which are much less than the circadian rhythms \cite{Circadian2007}. On the contrary, many transmission durations are obviously longer than 24 hours. In Figure \ref{dyntg}(a), the probability distribution of the transmission durations in the whole dataset falls into a bifold power-law with the turning point approximately equal to 24 hours, indicating the existence of circadian rhythms. We also calculate the integral days spent by each $\delta$ ([$\frac{\delta}{1440}$]) to examine whether some periodicity exists. In Figure \ref{dyntg}(b), the probability distribution of [$\frac{\delta}{1440}$] has two peaks at the 1st day and 7th day, i.e., the daily bursty behavior of successive event interactions coevolutes with weekly rhythms. We further perform the de-seasoning analysis to remove the circadian or weekly rhythms presented in Figure \ref{dyntg}(a,b) with two methods: I) natural de-seasoning method: only conserve the source and sink EIs taking place in the same day; II) artificial de-seasoning time-shuffled method in \cite{Temporalnetworks,Karsai11PRE,Jo12NJP,KivelaArxiv2012} to suit event interactions' definition (the details see \emph{Text SI}). As shown in Figure \ref{dyntg}(c), the probability distributions of the transmission durations 'filtered' by two de-seasoning methods both fall into the truncated power-laws, which indicates that the bursty behavior of event interactions takes place independently on the daily and weekly rhythms.
In addition, we examine the dependence of the source and sink EIs' active durations of each transmission path as shown in Table \ref{dependence}. Both the Pearson's coefficients and memory coefficients \cite{burstcoefficient} between them are very minor, indicating there does not exist the interdependence although the two groups of EIs share some individuals. From the definition of transmission graph, the transmission durations may be equal to the source EIs' active durations. However, their Pearson's coefficients and memory coefficients are also very small, hence the source EI' active duration is only the lower bound of the corresponding transmission duration, and there is no more dependence between them.
We construct the aggregated transmission graph (ATG) with the whole 3-month WiFi data set (the statistical properties of the ATG see Figure S1 and \emph{Text SI}). In Figure S1(a), most of the vertices only have small out-degrees ($k_{out}<10$) and in-degrees($k_{in}<10$), but there are 20 vertices with both high out-degrees and in-degrees to function as `super-connecting groups'(hubs) (see \emph{Text SI}). Recent studies reveal that super-connectors(hubs) in an aggregated network dominate the susceptible-infected-susceptible spreading processes due to the fact that they are self-sustained sources continually diffusing the virus to other neighbors \cite{SpreadingPRL2001,ABRMP,NewmanSIAM,PhysRep,AdvanInPhys,NewmanPRE2002,ThresholdPRL2010}. Therefore, the members of these `super-connecting groups' play a crucial role in the dynamics of disease transmission. However, traditional studies about the roles of individuals in the spreading processes focus on human contact network (for reviews see \cite{spreadingReview1,spreadingReview2}), where vertices are individuals and links are their contacts. We also aggregate the whole WiFi data set into a contact network(the detailed aggregation procedure refers to \emph{Text SI}) and find that the members of those `super-connecting groups' are `leaf' individuals in the contact network(red circle in Figure \ref{leafhub}(a)). Moreover, we further explore two other human indoor interaction data sets collected in a conference and an public exhibition\cite{RFID2010JTB}(see \emph{Methods and Materials}). Both these two high-resolution human face-to-face data sets(Figure \ref{leafhub}(b,c)) and our data set (Figure \ref{leafhub}(a)) illustrate that `leaf' individuals in the static human contact network gather to function as `hubs' in the transmission graph independently on different rendezvouses, indicating that the roles of many `leaf' individuals in a traditional static contact network may have been underestimated in a spreading process.
\subsection*{Dynamics of temporal interaction}
As shown in Figure \ref{dynti}(a), the probability distribution of TIs' active durations shows an exponential pattern(and the maximum value of $\Delta t^{TI}$ is less than 24 hours), which is different from the empirical results of human close proximity interactions recorded by Bluetooth \cite{EagleN2006PUC} or wireless sensors \cite{WirelessSensor2010PNAS}. This difference might derive from the fact that our data reflects the university daily teaching schedules and the human circadian rhythms, which constrain the individuals' resident periods in classrooms. Since the TIs' active durations can not reflect the population's interactive features beyond one day, we analyze the probability distribution $P(n^{TI})$ of TIs' frequencies in Figure \ref{dynti}(b). The outcome of power-law distribution indicates that although the number of the frequent contacting pairwise individuals is far less than that of the casual encounters, they can not be ignored.
The inter-event duration measures the time interval between two successive TIs of the same dyads (considering the start point of the two TIs). We also partition all the inter-event durations into two subsets according to the following criterion: whether or not two TIs of the same two users take place in the same day. As shown in Figure \ref{dynti}(c), the probability distribution of the inter-event durations of the successive TIs taking place in the same day exhibits a truncated power-law, which is similar to the findings in \cite{interContact2007,opportunistic2007IEEE,opportunistic2005,pocketSwitched2005,Eagle2007}. Moreover, Figure \ref{dynti}(d) reports the probability distribution of the inter-event duration of the successive TIs taking place in different days, where the red circles emphasize that there are many remarkably peaks indicating the weekly periodicity of the inter-event features. Therefore, the temporal interactions is in fact the convolution of burst behaviors on daily timescale and weekly rhythms.
To further explore the pairwise individuals' inter-event durations, we randomly choose two frequently interactive dyads. The two chosen series of temporal interactions are labeled as \emph{TI 1} and \emph{TI 2} with frequency $n^{TI}_1=56,n^{TI}_2=59$, respectively. In Figure \ref{spatiotemporal}(a), the time series \emph{TI 1} shows a typical burst characteristics, while the time series \emph{TI 2} presents more regular intervals between two active events. We analyze the cumulative probability distribution(CPD) of the inter-event durations of \emph{TI 1, TI 2} in Figure \ref{spatiotemporal}(b). The CPD of \emph{TI 1}'s inter-event durations falls into a power-law with the cutoff of one week (10,000 minutes), while the CPD of \emph{TI 2}'s inter-event durations presents an exponential form. In addition, there does not exist the dependence between TI's active durations and inter-event durations as shown in Figure S3, which are uncorrelated.
Since the addresses of WAPs are encoded in the temporal interactions of pairwise users, we define '\emph{spatial entropy}' to measure the spatial information of involved temporal interactions:
$$H_{ij}(n^{TI})=-\sum\limits_{\ell=1}\limits^{L}p_{\ell} \ln p_{\ell}$$ ($L \leq n^{TI}$ and $n^{TI} \geq 2$), where $p_{\ell}$ is the probability that the TIs of users $i,j$ simultaneously occur at the location '$\ell$' (equivalent to WAP '$\ell$'). The average spatial entropy with a given frequency is averaged as:
$$<H(n^{TI})>=\frac{\sum\limits_{ij\in \Psi } H_{ij}(n^{TI})}{N(n^{TI})}$$ where $\Psi$ represents the set of pairwise users with the same frequency ($n^{TI}$), and $N(n^{TI})$ is the size of $\Psi$.
Figure S4 reports the average spatial entropy $<H(n^{TI})>$ increases with the growth of frequency $n^{TI}$ at the population level. However, at the level of dyads, the TIs' spatial entropy are independent on their frequency $n^{TI}$, as illustrated by two aforementioned (\emph{TI 1, TI 2}) in Figure \ref{spatiotemporal}(a). We further observe the occurrence probability of \emph{TI 1, TI 2} in Figure \ref{spatiotemporal}(c). The low entropy of \emph{TI 2} ($H = 0.25$) indicates that two individuals have preferred interactive locations, and the predication of their future interactive location is possible. While the high entropy of \emph{TI 1}($H = 2.48$) means that the involved individuals randomly select their interactive locations. To summarize, we conclude that the pair of individuals with burst interactions (\emph{TI 1} in Figure \ref{spatiotemporal}(b)) randomly select their interactive locations (Figure \ref{spatiotemporal}(c)), and the pair of individuals with periodic interactions (\emph{TI 2}) present their preference on the interactive locations.
\section*{Materials and Methods}
\subsection*{Ethics Statement}
Although there is no official institutional review board (IRB) or ethics committee in Fudan University, this research achieves the approvement from the Informatization Office of Fudan University, which is the chief office responsible for the deployment of the WiFi wireless access point network and data collection at Fudan University. According to the local regulation rules of Fudan University `THE REGULATIONS FOR ADMINISTRATION OF FUDAN UNIVERSITY WIFI CAMPUS USERS' (available: http://www.xxb.fudan.edu.cn/s/52/t/104/42/e6/info17126.htm (Chinese Edition)), the part of the ninth provision, `Without licence, monitor other people's information with any monitor software is forbidden.', we have signed a confidentiality agreement and obtained the permission from the Informatization Office of Fudan University, the administrative unit of department level in Chinese Government. We declare that we have the responsibility to protect the privacy of the WiFi Campus users at Fudan University involved in this research, the data set involved is de-identified, and none privacy information of the WiFi users are available.
\subsection*{Study Setting}
The WiFi wireless access point(WAP) network involved in this study is deployed at Handan campus of Fudan University in Shanghai, China. All of the WAPs deployed in the Campus provide the dual-band(802.11g/n (2.4-GHz) and 802.11a (5-GHz)) free wireless accessing services to all the authorized campus members (e.g., students, teachers, office staffs and visiting scholars). These members' wireless electronic devices are generally automatically connected to the \emph{closest} WAP. Only when the WAP is overloaded, the device will be switched to another adjacent WAP. In the campus WiFi system of Fudan University, each WAP can serve around 50 users. Considering the percentage of students equipping wireless devices in the involved data set collected in the teaching buildings, it is sufficient to guarantee that generally every wireless device is served by the closest WAP. Furthermore, the number of devices co-served by one WAP is equal to the size of event interactions. As shown in Figure \ref{dynei}(b), the maximum number of co-served devices is less than 50, i.e., all the involved WAPs were not overloaded in the three months.
\subsection*{The Pre-processing of the Data Set}
The main data set used in our study is named as `FudanWiFi09' which records the users' access logs in the 2009-2010 fall semester (18/10/2009-9/1/2010). It contains the hardware information of users' electronic devices (the Media Access Control address, CPU trademark, et al.), the hardware information of the connected WAP, and the connecting/disconnecting time as well. Since the Media Access Control address, as the unique serial number, can uniquely identify different electronic devices and WAPs, we conserve them with the connecting/disconnecting time in `FudanWiFi09'.
From the statistics of Fudan University (http://www.fudan.edu.cn/new\_genview/genview.htm), there are totally 33,239 students, teachers and staffs in the campus, and `FudanWiFi09' contains the records of 22,050 individuals' 423,422 behavioral trajectories in the three-month period. Since we target the proxy data of those wireless devices to feature the users' indoor interactive behaviors, we only focus our research on the WiFi data recorded in those buildings which are open to public without safeguards for the WiFi users' devices (i.e., when a user leaves such a place, he/she should bring the device with himself/herself.) Therefore, the dataset of 18,715 individuals' 262,109 behavioral trajectories from all six teaching buildings with the WiFi coverage have been employed in the work of this paper.
\subsection*{Two Public Data Sets Used in the Study}
Two public data sets used in the study are both collected by the RFID technology available at the website of SocioPatterns (http://www.sociopatterns.org), and a related research refers to \cite{RFID2010JTB}. The first data set `HT09' (http://www.sociopatterns.org/datasets/infectious-sociopatterns-dynamic-contact-networks/) was collected during the ACM Hypertext 2009 conference, hosted by the Institute for Scientific Inter-change Foundation in Turin, Italy, from June 29th to July 1st. It involved about 100 conference participants to wear radio badges which monitored around 10,000 face-to-face interactions in the conference period of three days. The next data set `HGInfectious' (http://www.sociopatterns.org/datasets/hypertext-2009-dynamic-contact-network/) contains more than 230,000 face-to-face contacts among more than 14,000 visitors, which was collected during the art-science exhibition `INFECTIOUS: STAY AWAY' at the Science Gallery of Dublin, Ireland, from April 17th to July 17th, 2009.
These two data sets both have the similar tab-separated lists representing the active contacts during 20-second intervals of the data collection. Each line has the form `$t$ $i$ $j$', where $i$ and $j$ are the anonymous IDs of the persons in contact, and the interval, during which this contact was active, is $[t-20s, t]$. In the study, the two data sets are pre-processed by assembling the continues contacts of the same pair into one interaction, before translating them into the defined event interactions as shown in Figure \ref{schematic}.
\subsection*{The Average Spatial Distances of Two Users}
In the campus WiFi system of Fudan University, each WAP can serve around 50 users, which we conjecture it is sufficient to guarantee that every device is served by the closest WAP. Besides, the WAPs in adjacent floors have none overlapped covered regions because the building materials can dramatically attenuate the wireless signals, and each floor can be decomposed by the WAPs into the corresponding Voronoi tessellations. However, it is impossible to precisely locate the position of a user within a Voronoi \cite{Gonzalez2008Nature}, and the spatial distance between any two users inside one Voronoi cell can not be directly calculated. Therefore, we propose an approximative method to estimate the average spatial distance of any two users in Voronoi cells (The details see \emph{Text SI}), and Table \ref{distance} shows the average spatial distances of any two users and their standard derivation in all involved teaching buildings.
\section*{Acknowledgments}
We gratefully acknowledge the insightful comments from Prof. Alain Barrat and two anonymous reviewers, and the assistance from Bochun Wu, and the Informatization Office of Fudan University for the WiFi Data collection, and the Archives of Fudan University for providing the blueprint of all the teaching buildings. This work was partly supported by the National Key Basic Research and Development Program (No.2010CB731403), the NCET program (No.NCET-09-0317), and the National Natural Science Foundation of China.
| {'timestamp': '2017-06-07T02:07:00', 'yymm': '1706', 'arxiv_id': '1706.01779', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01779'} | arxiv |
\subsection{The Adjoint Method} \label{sec:adjointM}
In this section, we discuss the details of the Adjoint Method to obtain the gradient of the SI problem (\ref{eq:opt}) that we formulated in Section \ref{sec:probDef}. Particularly, the Lagrangian function of this constrained optimization problem is given as
$$ \ccalL(c,s,w) = \ccalJ(c,s) + \inprod{w, \ccalM(c,s)} , $$
where $w \in V''$ is the adjoint variable. From reflexivity of the Hilbert space $V$, we get $V'' = V$. Then, referring to the definition of the AD model \eqref{eq:ADmodel}, we have
\begin{eqnarray*}
\inprod{w, \ccalM(c,s)} &=& \inprod{w, Ac - \ell(s)}_{V'' \times V'} \\
&=& \inprod{Ac - \ell(s), w}_{V' \times V} = a(c,w) - \ell(w;s) .
\end{eqnarray*}
Thus, we can rewrite the Lagrangian as
\begin{equation} \label{eq:Lag}
\ccalL(c,s,w) = \ccalJ(c,s) + a(c,w) - \ell(w;s) ,
\end{equation}
where $w \in V$ is the adjoint variable.
In what follows, we use the notion of a G\^ateaux derivative to differentiate the Lagrangian (\ref{eq:Lag}); see, e.g., \cite[sec. 9.4]{IFA1998R}.
\begin{definition}[G\^ateaux derivative] \label{def:Gateaux}
A functional $\ccalT: V \to \reals$ on a normed space $V$ is G\^ateaux-differentiable at $c \in V$ if there exists an operator $D_c\ccalT: V \to V'$ defined by
$$ \inprod{D_c \ccalT,h} \triangleq \inprod{ \ccalT'_c,h} \triangleq \frac{d}{d \epsilon} [ \ccalT (c+ \epsilon h)] \Big|_{\epsilon = 0} , $$
for all $h \in V$. We use the two notations $\inprod{D_c \ccalT,h}$ and $\inprod{ \ccalT'_c,h}$ interchangeably whenever one of them is clearer.
\end{definition}
The Adjoint Method consists of the following three steps that yield an organized procedure for the calculation of the desired gradient; see, e.g., \cite[sec. 4]{SIPEIUAM2003ANG}.
First, in order to satisfy the AD constraint in the SI problem \eqref{eq:opt}, we set the G\^ateaux derivative of the Lagrangian \eqref{eq:Lag} with respect to the adjoint variable $w$ and in an arbitrary direction $v$ equal to zero. The bilinear form $a(c,w)$ and the functional $\ell(w;s)$ are the terms in the Lagrangian that contain $w$.
G\^ateaux differentiating $a(c,w)$ with respect to $w$ we get
\begin{eqnarray*}
\inprod{D_w a(c,w),v} = \frac{d}{d \epsilon} a(c,w + \epsilon v) \Big|_{\epsilon = 0} = a(c,v) ,
\end{eqnarray*}
where we have used linearity of the bilinear operator $a(c, w)$ in each argument.
Similarly, G\^ateaux differentiating $\ell(w;s)$ with respect to $w$ we get $\inprod{D_w \ell (w;s), v} = \ell(v;s)$.
Therefore, the first equation of the Adjoint Method is given as
\begin{equation} \label{eq:AdM1}
\inprod{\ccalL'_w,v} = a(c,v) - \ell(v;s) = 0, \ \forall v \in V .
\end{equation}
Note that this equation is identical to the VBVP \eqref{eq:VBVP} and for the function $c$ satisfying this equation, i.e., $c = \ccalF(s)$, we get $\ccalL(c,s,w) = \bar{\ccalJ}(s)$. Consequently, we can differentiate the Lagrangian \eqref{eq:Lag} to get the desired derivative $\bar{\ccalJ}'_s$.
Since $c = \ccalF(s)$, in order to calculate $D_s \ccalL(c,s,w)$ we need the derivative $\ccalF'_s$. We can avoid this calculation by setting the G\^ateaux derivative of the Lagrangian \eqref{eq:Lag} with respect to the concentration $c$ equal to zero for any arbitrary direction $h$. The two terms containing $c$ are the objective functional $\ccalJ(c,s)$ and the bilinear form $a(c,w)$.
From Definition \ref{def:Gateaux}, the G\^ateaux derivative of $\ccalJ(c,s)$ with respect to $c$ can be calculated explicitly using equation \eqref{eq:obj} as
\begin{eqnarray} \label{eq:gradJc}
\inprod{\ccalJ'_c, h} = \int_{\Omega} h \, (c - c^m) \ \chi_E \ d\Omega.
\end{eqnarray}
Moreover, similar to the previous case the G\^ateaux derivative of the bilinear form $a(c, w)$ with respect to $c$ is given by
$ \inprod{D_c a(c,w), h} = a(h,w) = a^*(w,h) , $
where $a^*(w,h)$ is the adjoint operator of the bilinear form $a(h,w)$.
Therefore, the second equation of the Adjoint Method is given as
\begin{equation} \label{eq:AdM2}
\inprod{\ccalL'_c,h} = \inprod{\ccalJ'_c,h} + a^*(w,h) = 0, \ \forall h \in V .
\end{equation}
Because of the appearance of the adjoint operator, this equation is called the adjoint equation and the procedure of calculating the desired gradient is referred to as Adjoint Method. Given the concentration $c$ obtained from \eqref{eq:AdM1}, the solution of equation \eqref{eq:AdM2} yields the corresponding adjoint variable $w$.
From the definition of the Lagrangian \eqref{eq:Lag}, for the functions $c$ and $w$ satisfying equations \eqref{eq:AdM1} and \eqref{eq:AdM2}, we have $D_s \ccalL(c,s,w) = \bar{\ccalJ'_s}$. Thus, we can calculate the desired gradient of the objective functional $\bar{\ccalJ}(s)$ with respect to the source term $s$ in a given direction $q$ by G\^ateaux differentiating the Lagrangian \eqref{eq:Lag} as
$ \inprod{\ccalL'_s,q} = \inprod{\ccalJ'_s,q} - \inprod{\ell'_s(w;s),q} .$
Combining equations \eqref{eq:AdM1} and \eqref{eq:AdM2} with this equation, we summarize the Adjoint Method to calculate the gradient of $\bar{\ccalJ}(s)$ with respect to $s$ in a given direction $q$ as:
\begin{subequations} \label{eq:adjoint}
\begin{align}
& \text{AD-PDE:} \ \ \ \, a(c,v) - \ell(v;s) = 0 , \ \ \ \ \forall v \in V , \label{eq:adVBVP} \\
& \text{Adjoint Eq: } \inprod{\ccalJ'_c,h} + a^*(w,h) = 0 , \ \forall h \in V, \label{eq:adAdjoint} \\
& \text{Gradient:} \ \ \ \ \inprod{\ccalL'_s,q} = \inprod{\ccalJ'_s - \ell'_s(w;s),q} . \label{eq:adGrad}
\end{align}
\end{subequations}
\subsection{The Source Identification Problem} \label{sec:introSI}
The SI problem in AD transport systems is known as chemical plume tracing and odor localization in the robotic literature and has been investigated since the early $80$s. This task often entails three steps: detection, localization, and declaration, and most of the available algorithms focus on the localization stage \cite{ROL2008KR}. The algorithms differ depending on the dispersal mechanism, i.e., diffusion- or turbulence-dominated, and are specialized for the particular types of sensors used to take the measurements. They are often bio-inspired and try to mimic the behavior of different bacteria \cite{OMRN2002MND}, insects \cite{CRRCA2003RBSW}, or crabs \cite{BAASGTCP2012WVW}.
Generally, the main idea is to stay in the plume and move upwind, in the concentration ascent direction, or a combination of the two. In the literature, the former approach is called anemotaxis while the latter is called chemotaxis \cite{ROL2008KR}.
The authors in \cite{OMRN2002MND} propose a controller that combines anemotaxis and chemotaxis to localize a source. This method is compared to our algorithm in Section \ref{sec:sim}.
Arguing that gradient based methods can get trapped in local optima and plateaus, \cite{BREM2004DSR} proposes a biased random walk strategy for a robotic swarm to localize multiple point sources.
The authors in \cite{DRACPT2005ZSS} propose fluxotaxis which uses the mass conservation principle to trace a chemical plume using a robotic swarm.
In a more recent work \cite{DFOSLA2015SAPM}, a group of mobile agents are controlled to stay in a formation centered in the plume while they move upwind and localize an ethanol source. To localize multiple sources, the authors of \cite{VCPMOSL2013CMG} construct a statistical model of the discovered sources allowing the robots to find the next source by subtracting the effect of the previous ones.
When the transport phenomenon is turbulent, disconnected and non-smooth concentration patches appear in the medium. In this case, gradient-based approaches are often significantly inaccurate. The authors in \cite{infotaxis2007VVS} propose a gradient-less search strategy, called infotaxis, that maximizes the expected rate of local information gain. The authors in \cite{MSSLTM2016HHS} extend the infotaxis strategy to a multi-agent system. This approach shows a behavior that resembles that of a moth, i.e., casting and zigzagging, which amounts to an extensive exploration of the domain and can be energy-inefficient for a mobile sensor.
The above heuristic approaches to SI are often successful in practice but they also suffer from various drawbacks: First, they do not offer a systematic approach that can handle the localization task under a wide range of conditions. Instead, they are specialized for specific scenarios and sensors.
Second, these methods often can only localize a single point source or at best multiple point sources and provide no information about the intensity of the sources. Moreover, they declare localization when the robots physically reach the source while in fact it might be unsafe to approach the source in some applications.
Finally, often these heuristics are proposed for convex environments and they do not handle obstacles and non-convex domains easily.
These limitations can be addressed if the underlying physics is properly incorporated in the formulation, which leads to model-based SI methods. \footnote{Note that some of the heuristics above selectively utilize physical principles but our intention here is a dedicated, systematic formulation.}
These model-based SI methods are a special class of Inverse Problems (IPs) which have been studied for a long time; see, e.g., \cite{DIP2010H}. Methods to solve IPs rely on a mathematical model of the underlying transport phenomenon which often is a Partial Differential Equation (PDE) and, in the special case of SI problems, it is linear in the unknown source term.
The literature on model-based SI problems can be classified in different ways based on the state of the problem, the number of sources, and their shape.
Generally, transient transport phenomena are more challenging compared to the steady-state ones, but time-dependent measurements are more informative.
The localization of a single point source in steady-state is considered in \cite{SLSDENAD2005MGK} for a semi-infinite domain, whereas the authors in \cite{MBSTSLP2000AS} address the problem for transient transport relying on the \textit{a priori} knowledge of the possible point source locations.
SI in the presence of multiple point sources is considered using optimization-based methods.
For instance, the work in \cite{MSDLADPUWSN2009WSK} addresses the detection and localization of multiple such sources using a wireless sensor network.
More general problems that involve sources of arbitrary shapes in arbitrary domains are typically solved numerically using, e.g., the Finite Element Method (FEM).
Discretization of a steady-state PDE using the FEM, leads to a linear time-invariant system where the source term acts as a control input. From this perspective, the IP is similar to the problem of input reconstruction. However, one of the main assumptions in this problem is that the number of observations is no less than the dimension of the unknown input \cite{SEUIRRHSMO2012Z}. This assumption is violated in IPs which are typically ill-posed. To resolve this issue, regularization techniques can be used \cite{DIP2010H,meC4}.
The authors in \cite{VFEMSICDT2003ABGLW} use the FEM along with total variation regularization to solve the SI problem.
Similarly, in our previous work \cite{meC1}, we proposed the Reweighted Debiased $\ell_1$ algorithm, which is an iterative sparse recovery approach to the SI problem. Despite generality, numerical methods such as FEM become computationally demanding as the size of the domain grows.
Furthermore, unlike heuristic methods, none of the model-based SI methods discussed above, rely on robots to collect the measurements that are needed to solve the problem.
\subsection{Active Sensing} \label{sec:introOSP}
Optimal measurement collection has been long studied in the robotics literature to solve state estimation problems.
Given a probabilistic model of the measurement noise, information-theoretic indices, e.g., covariance \cite{meJ2}, Fisher Information Matrix (FIM) \cite{EEDI2016MSMM}, different notions of entropy \cite{PFBIAS2010RH}, mutual information \cite{MIPPASEP2014CLD,DASSSMRN2015ALP}, and information divergence \cite{SMPFT2011AL}, have been used for general robotic planning.
For example, given an information distribution, the authors in \cite{EEDI2016MSMM} propose an optimal controller to navigate the robot through an ergodic path. We investigate the performance of this planning method for SI in Section \ref{sec:sim}.
A common predicament in applying some of these methods for SI is the need for the posterior distribution of the unknown source parameters. Obtaining this distribution for SI problems requires solving stochastic IPs and is computationally expensive, see, e.g., \cite{SRM2010FMWB}. This makes the application of optimality indices that require calculation of the expected information gain, e.g., entropy, mutual information, and information divergence, intractable.
Typically in SI problems, the amount of information provided by a measurement depends on the value of the unknown parameters in addition to the measurement location. A common approach to address this point is to combine the path planning for optimal measurement collection with the solution of the SI problem in a feedback loop which leads to Active SI methods. To solve the planning problem, scalar measures of the FIM can be used, as for state estimation; see, e.g., \cite[Ch. 2]{OMMDPSI2004D}.
The difference is that in SI the unknown parameters cannot be obtained in closed form by a filter update, but instead they are obtained by the solution of an IP that is much more difficult to solve.
Specifically, the work in \cite{ASIGRPE2005CR} presents trajectory planning for an autonomous robot, utilizing the trace of the FIM, to identify parameters of a transient Advection-Diffusion model under an instantaneous gas release in an infinite domain.
Similarly, \cite{OSMSNDLSCS2008PU, OMSPPEDPS2008TC} propose continuous-time optimal control methods that utilize the determinant of the FIM for trajectory planning for IPs with a few unknowns; \cite{OSMSNDLSCS2008PU} considers the SI problem in transient state under the assumption that the noisy measurements are taken continuously, while \cite{OMSPPEDPS2008TC} is an extension of \cite{OSMSNDLSCS2008PU} for general IPs.
In a different approach, the authors of \cite{DPSUE2009BLTT} propose an adaptive SI algorithm to localize a single point source emphasizing on path planning in unknown, possibly non-convex, environments.
Common in the above literature on ASI is that the proposed methods avoid the solution of complex SI problems by either assuming very simple mathematical models for the SI problem that can be efficiently solved, or by assuming that the solution of the SI problem is provided \textit{a priori} and the goal of planning is to collect measurements that are then examined to find a source term that matches those measurements.
Therefore, these methods do not apply to general SI problems and for this reason they have also not been demonstrated in practice. To the best of our knowledge, our work is the first ASI method that considers active measurement collection for realistic SI problems.
\subsection{Proposed Method}
In this paper, we consider the problem of Active Source Identification in Advection-Diffusion (AD) transport systems in steady-state. As most path planning methods for state estimation, we propose a method that combines SI and path planning in a feedback loop. The difference is that here the estimation problem is not solved by a closed form filter update, but instead it requires the solution of a complex PDE-constrained optimization problem.
Particularly, given a set of noisy measurements, we formulate the SI problem as a variational regularized least squares optimization problem subject to the AD-PDE.
To obtain a tractable solution to this problem, we employ Proper Orthogonal Decomposition \cite{OFROMPOD2007A} to approximate the concentration field using a set of optimal basis functions.
Moreover, we model the source term using nonlinear basis functions, which decreases the dimension of the parameter space significantly, although at the expense of introducing nonlinearity.
Using these parameterizations, we approximate the functional formulation of the SI problem with a low dimensional, nonlinear, constrained optimization problem, which we solve iteratively utilizing the gradient and Hessian information that we explicitly provide. To initialize this nonlinear optimization problem, we rely on the point-source Sensitivity Analysis of the SI objective function \cite{SSASLSSLS2013SA}.
Assuming a small number of measurements are available to initialize the identification process, we determine a sequence of waypoints from where a mobile robot sensor can acquire further measurements by formulating a path planning problem that maximizes the minimum eigenvalue of the FIM of the unknown source parameters with respect to the noisy concentration measurements.
The integrated algorithm, alternates between the solution of the SI and path planning problems. In particular, with every new measurement the solution of the SI problem produces a new source estimate, which is used in the path planning problem to determine a new location from where a new measurement should be taken, and the process repeats.
By appropriately decomposing the domain, we show that the proposed algorithm can identify multiple sources in complex AD systems that live in non-convex environments.
\subsection{Contributions}
To the best of our knowledge, this is the first model-based ASI framework that has been successfully demonstrated in practice. As discussed in Section \ref{sec:introSI}, existing literature on ASI includes either model-free bio-inspired heuristic methods or model-based approaches that employ simplifying assumptions, e.g., point sources in infinite domains, to mitigate the complexity of solving real SI problems. Compared to the heuristic approaches, i.e., chemotaxis, amenotaxis, fluxotaxis, and infotaxis, our proposed model-based SI method combines all these bio-inspired behaviors systematically in a general identification framework. Specifically, the concentration readings are explicitly modeled in the least squares objective while the gradient information (chemotaxis), velocity information (anemotaxis), and the first principals (fluxotaxis) are rigorously encapsulated in the AD-PDE. Finally, the information content of the measurements (infotaxis) are incorporated in the solution of the planning problem. On the other hand, compared to model-based approaches that rely on oversimplified models, our method can solve more general and realistic problems. We have shown that our method outperforms existing approaches both in simulation and experimentally.
Like the path planning methods for state estimation, our method combines SI and path planning in a feedback loop. However, as discussed in Section \ref{sec:introOSP}, the difference is that unlike the estimation problem that is solved by a closed-form filter update, the SI problem requires the solution of a complex PDE-constrained optimization problem. The key ideas that enable a tractable solution to this problem are: (a) a suitable integration of model order reduction, point-source Sensitivity Analysis, and domain decomposition methods, (b) a nonlinear representation of the source term that reduces the dimension of the parameter space, and (c) an information theoretic metric to measure the value of measurements for identifying unknown source parameters. The result is a set of techniques, insights, and methodological advancements that show how to efficiently design a model-based SI method that can be implemented onboard robots. Form a technical standpoint, the proposed framework bridges the gap in the rich but disconnected literature on source localization and active sensing that was discussed before; see Figure \ref{fig:literature}.
\begin{figure}[t!]
\centering
\includegraphics[width=0.5\textwidth]{main.png}
\caption{A schematic representation of the relevant literature.} \label{fig:literature}
\end{figure}
A significant contribution of this work is that it is the first to demonstrate applicability of robotic model-based SI methods to real-world problems. Real-world SI problems present major practical challenges related to modeling and estimation of the flow properties, which serve as the data in the AD-PDE, instability of the AD-PDE itself, and the uncertainties that are present in the parameters and boundary conditions; see the discussion in Section \ref{sec:discussion}.
We show that our algorithm is robust to uncertainties and performs well despite various simplifying assumptions made to model the real world; see \cite{TMCFD1993W,TD2002RW} for more details about these assumptions.
A preliminary version of this work can be found in the conference paper \cite{meC2}. The conference version only discusses the SI problem in convex domains and many theoretical details are absent due to space limitations; these details are included in Section \ref{sec:SI}.
In addition, here we discuss the integrated ASI algorithm that combines SI and planning and we also consider non-convex environments. Finally, we present experimental results that illustrate our method for real-world SI problems.
The rest of this paper is organized as follows. In Section \ref{sec:SI} we introduce the SI problem and discuss the proposed approach to solve it. Section \ref{sec:path} is devoted to the formulation and discussion of the path planning algorithm.
We discuss the integration of the SI and path planning algorithms along with their extension to non-convex domains in Section \ref{sec:autoSI}.
Section \ref{sec:sim} contains the numerical simulations and experimental results and finally Section \ref{sec:concl} concludes the paper.
\section{Introduction} \label{sec:intro}
\input{Intro}
\section{Source Identification} \label{sec:SI}
\input{SIP}
\section{Mobile Robot Path Planning} \label{sec:path}
\input{path}
\section{Active Source Identification\\ in Complex Domains} \label{sec:autoSI}
\input{autoSI}
\section{Results} \label{sec:sim}
\input{sim}
\section{Conclusions} \label{sec:concl}
\input{concl}
\section*{Acknowledgements}
The authors would like to thank Eric Stach, Yihui Feng, and Yan Zhang for their help with the design of the experimental setup.
\appendices
\section{Adjoint Method} \label{sec:adjointM}
\input{adjointM}
\section{Numerical Solution of the\\Source Identification Problem} \label{sec:SInumeric}
\input{SInumeric}
\section{Sequential Semi-Definite Programming\\for the Next Best Measurement Problem} \label{sec:SSDP}
\input{SSDP}
\ifCLASSOPTIONcaptionsoff
\newpage
\fi
\bibliographystyle{ieeetr}
\subsection{Numerical Simulations} \label{sec:ppComp}
In this section, we study the performance of the ASI Algorithm \ref{alg:autoSI} in a large non-convex domain $\Omega$.
We assume that the air flows into the domain through the sides, i.e., constant velocity inlet boundary conditions. Then, an in-house fluid dynamics code is utilized to simulate the steady-state velocity in the domain as depicted in Figure \ref{fig:Ex_BI-flow}, where a FE mesh with $n = 15034$ points is used.
\begin{figure}[t!]
\centering
\includegraphics[width=0.5\textwidth]{flow.pdf}
\caption{Steady-state flow pattern for the non-convex domain. } \label{fig:Ex_BI-flow}
\end{figure}
We consider Peclet numbers $Pe = 2.5, Pe = 25$, and $Pe = 250$. Moreover to reduce the order of the model, we utilize $R = 597$ snapshots with $\eta = 0.97$ corresponding to $N = 154, N = 183$, and $N = 205$ basis functions for each Peclet number, respectively.
In our first simulation study, we compare the planning method presented in Section \ref{sec:path} to placement over a lattice and an ergodic placement method that uses the determinant of the FIM as the information metric.
Both of these planning approaches employ the algorithm developed in Section \ref{sec:SI} to solve the SI problem \eqref{eq:opt}
and, therefore, the purpose of this comparison is to showcase the relative performance of the planning method proposed here.
Specifically, given an information distribution, the ergodic planner aims at designing paths where the time spent by the robot at any region is proportional to the information at that region. This approach is proposed in \cite{MEDEDMAS2011MM} and used for active sensing in \cite{EEDI2016MSMM}. Specifically, we use the normalized determinant of the FIM \eqref{eq:FIM} as the information distribution in the ergodic planner, where we assign zero information value to the points on obstacles. We implement the controller proposed in \cite{MEDEDMAS2011MM} and, similar to the ASI Algorithm \ref{alg:autoSI}, we update the information distribution at every step as newer estimates of the source parameters become available.
To highlight the advantages of the proposed ASI framework against the heuristic methods discussed in Section \ref{sec:introSI}, we also compare our algorithm to a heuristic approach that drives the robot along the normalized concentration gradient ascent and upwind directions, as proposed in \cite{OMRN2002MND}. The robot uses the initial $\bbarm$ measurements to detect the plume and initializes its path from the highest measured concentration point. The velocity field is known exactly to the robot and the concentration gradient at each point is approximated by taking two additional measurements in orthogonal directions. Since the heuristic approach only provides a location estimate, it is compared to the other methods in terms of $e_{\text{loc}}$.
In the following simulations, we use $\bbarm = 28$ initial measurements for the ASI, ergodic, and heuristic methods and set the maximum number of steps to $m_{\max} = 42$. The lattice placement uses $m_{\max} = 42$ measurements obtained by sensors located on an equidistant grid. For the ergodic and heuristic methods, we use a first-order model for the dynamics of the robot.
The results are plotted in Figure \ref{fig:Ex_BI-LATvsEXP} where we average over $50$ randomly generated sources.
\begin{figure}[t!]
\centering
\includegraphics[width=0.5\textwidth]{ExBI.pdf}
\caption{Comparison of the ASI Algorithm \ref{alg:autoSI} with lattice and ergodic placements, and heuristic approach for three Peclet numbers. The figure depicts the average uncovered, false detection, intensity, and localization errors, respectively. The standard deviation bars and scatter plots are overlaid on the error bars. The success percents are also given on top of the first subfigure.} \label{fig:Ex_BI-LATvsEXP}
\end{figure}
It can be seen that the proposed planning Algorithm \ref{alg:pathPlan} outperforms the lattice method in all cases and performs more consistently in terms of standard deviation. Particularly, the success rate of the ASI algorithm, i.e., the number of instances that the algorithm finds an overlapping source estimate, is considerably higher for all three Peclet numbers.
Note that the average false detection error of the lattice placement for $Pe = 250$ is smaller than the ASI algorithm but since this method often fails to find an overlapping source estimate for this Peclet number, $e_{\text{fd}}$ only indicates that the falsely detected sources have smaller volumes than the true sources on average.
The performance of the ergodic approach is close to the proposed planning method since it uses a similar optimality index to collect the measurements. Note that as the domain becomes larger, the computation of the information distribution required by this approach becomes expensive rendering this planning method intractable.
Furthermore, since the performance of the ergodic method depends on the combination of exploration and exploitation \cite{EEDI2016MSMM}, we allow the robot to travel through obstacles and take a measurement every three steps so that it can reach more informative regions of the domain more often.
To the contrary, the behavior of the proposed ASI method indicates that given an initial set of measurements, necessary to detect the unknown sources, the most informative measurements are obtained close to the location of sources as opposed to points farther away. Therefore, the better performance of the ASI algorithm, i.e., its smaller and more consistent false detection error values, can be attributed to this fact.
Considering the last subfigure in Figure \ref{fig:Ex_BI-LATvsEXP}, we observe that the ASI algorithm provides more accurate localization for $Pe=2.5$ and $Pe=25$ but the heuristic method performs better for $Pe=250$.
The reason for this is that for very high Peclet numbers, for which advection is the primary means of transport, the reduced order AD model \eqref{eq:Model} becomes inaccurate resulting in poor localization for model-based methods; see Section \ref{sec:discussion}.
Nevertheless, the heuristic approach does not provide any information about the size or intensity of the source and in the case of multiple sources, it localizes at most one source or fails altogether.
In our second simulation study, we use the same settings as before and consider an AD transport with $Pe = 25$ and two sources, specifically, a circular source centered at $(2.5, 0.25)$ with radius of $0.08$ and intensity of $0.25$ and a rectangular source with parameters $\barbp = (0.2, 3.85, 3.95, 0.8, 0.95)$ creating the concentration filed given in Figure \ref{fig:ExBII_path}.
Since the two sources are not located in one convex domain, decomposing $\Omega$ into convex subdomains and following the procedure described in Section \ref{sec:autoSI} is necessary to recover both sources. We note that the ASI algorithm has no \textit{a priori} knowledge of the number of sources.
It solves the problem in $1951$sec in $22$ steps, which amounts to solving $22$ instances of the SI problem \eqref{eq:optFD}. Time required to solve the planning problem \eqref{eq:pathOptL} is negligible. The final error values are $e_{\text{un}} = 0.67$ and $e_{\text{fd}} = 0.61$ with SNR $= 19.02$ dB.
The waypoints of the robot are given in Figure \ref{fig:ExBII_path} by white stars. Note the accumulation of the measurements around the high concentration regions of the domain, i.e., the hot spots \cite{MIPPASEP2014CLD}.
Note also that to cover both sources simultaneously, the robot needs to move back and forth between them. We can minimize the travelled distance, by adding a penalty term in the planning problem \eqref{eq:pathOptL} to encourage more measurements before moving to the next source but this would be suboptimal from an information perspective. A more viable option is to use multiple robots, which is part of our future work.
The result of the SA initialization Algorithm \ref{alg:init} and the final solution with the true source overlaid on it are plotted in Figure \ref{fig:ExBII_source}.
\begin{figure}[t]
\centering
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{path1.pdf}
\caption{waypoints of the mobile robot} \label{fig:ExBII_path}
\end{subfigure}
\quad
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{source.pdf}
\caption{estimated source} \label{fig:ExBII_source}
\end{subfigure}
\caption{Waypoints of the mobile robot overlaid on the concentration field and the contours of the SA initialization and estimated source. The yellow stars in Figure \ref{fig:ExBII_path} indicate the initial measurements while the white stars show the sequence of waypoints. In Figure \ref{fig:ExBII_source}, the SA initialization (top) and the final solution (bottom) are shown, where the white squares depict the support of the initial estimate and the yellow lines delineate the support of the true source.} \label{fig:Ex_BII-twin}
\end{figure}
Note that the performance of the ASI Algorithm \ref{alg:autoSI} only depends on the dimensionless Peclet number. The units of the other quantities are arbitrary as long as they are selected consistently. Particularly, given a unit for concentration $c$, the unit for source term $s$ is defined as concentration per unit time; cf. AD-PDE \eqref{eq:BVP}. See the next section for a specific example.
\subsection{Experimental Results} \label{sec:experiment}
In this section, we demonstrate the performance of the proposed ASI Algorithm \ref{alg:autoSI} experimentally for the identification of an ethanol source in air. Particularly, we consider a non-convex domain with dimensions $2.2 \times 2.2 \times 0.4$m$^3$, cf. Figure \ref{fig:exp-dom}.
\begin{figure}[t!]
\centering
\includegraphics[width=0.4\textwidth]{domain.jpg}
\caption{Non-convex domain of the experiment. The velocity inlet, velocity outlet, and desired source are located in the lower-right, lower-left, and upper-right corners, respectively.} \label{fig:exp-dom}
\end{figure}
We connect a fan to the domain through a duct that blows air into domain with an axial speed of $0.9$m/s and a tangential speed of $0.2$m/s, creating a turbulent flow. We utilize \textsc{ANSYS-Fluent} to obtain the desired flow properties namely, the velocity and diffusivity fields. Since turbulence is a $3$D phenomenon, we build a $3$D mesh of the domain with $1.94 \times 10^6$ elements.
We note that determining the velocity and diffusivity fields for turbulent flow is non-trivial.
Turbulent flow is recognized with high Reynolds numbers and is characterized by severe fluctuations in the flow properties. These fluctuations enhance the mixing in the flow and facilitate the transport of the concentration. This enhanced mixing is often encapsulated in an effective turbulent diffusivity which is proportional to effective turbulent viscosity $\mu$ and the proportionality constant is the Schmidt number Sc. Then, the total diffusivity is the sum of laminar $\kappa_0$ and turbulent diffusivities \cite{TD2002RW}. Mathematically,
\begin{equation} \label{eq:diff}
\kappa = \kappa_0 + \frac{\mu}{\rho \, \text{Sc}} ,
\end{equation}
where $\rho \in \reals_+$ denotes the density of the transport medium.
We construct a $2$D discretized AD model using the FEM with $n=12121$ grid points located on the plane of the robot concentration sensor at height of $0.27$m. Using the $2$D model instead of a $3$D model is an approximation since we ignore the transport in $x_3$-direction but considerably decreases the computational cost.
The turbulent flow properties at the nodes of the AD FE mesh are interpolated from the \textsc{ANSYS-Fluent} $3$D model and are given in Figure \ref{fig:exp-turbSol}. The corresponding Peclet number is Pe $= 213$.
\begin{figure}[t]
\centering
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{vel.pdf}
\caption{velocity field (m/s)} \label{fig:exp-vel}
\end{subfigure}
\quad
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{diff.pdf}
\caption{diffusivity field (m$^2$/s)} \label{fig:exp-diff}
\end{subfigure}
\caption{Turbulent flow properties required for the solution AD-PDE. The fields are interpolated to the plane of concentration sensor located at a height of $0.27$m. Top figure shows the predicted velocity field generated by blowing air through the inlet using a fan. The bottom plot shows the corresponding total diffusivity field which is the sum of laminar and turbulent diffusivities, given by \eqref{eq:diff}, and lower bounded by $10^{-3}$m$^2$/s to stabilize the AD FE model.} \label{fig:exp-turbSol}
\end{figure}
Regarding the diffusivity field, the following points are relevant. For molecular diffusion of ethanol in air, $\kappa_0 \approx 1.1 \times 10^{-5}$m$^2$/s. Then, from Figure \ref{fig:exp-diff} it can be seen that the turbulent diffusivity is considerably larger than the laminar diffusivity. This contributes to the numerical stability of the AD model by decreasing the Peclet number.
To further increase the stability, we add an artificial diffusion lower bounding the total diffusivity \eqref{eq:diff} by $10^{-3}$m$^2$/s; see the discussion of Section \ref{sec:discussion} for more details.
Given the discretized model, we use $N = 900$ basis functions to construct the reduced model \eqref{eq:Model}.
The ethanol source is located at $x_1 = 1.8$m, $x_2 = 1.8$m, and $x_3 = 0.3$m, across from the velocity inlet and releases ethanol at a steady rate. To collect the measurements, we use a custom built differential drive mobile robot equipped with a \textsc{MiCS-5524} concentration sensor. In order to eliminate the effect of velocity field on the sensor readings, we place the sensor in a confined box and utilize an air pump to deliver air to the sensor with an approximately constant flow rate, cf. Figure \ref{fig:exp-robot}.
\begin{figure}[t!]
\centering
\includegraphics[width=0.2\textwidth]{robot-small.jpg}
\caption{Mobile robot used to collect the measurements: (i) the concentration sensor placed in a confined box to separate it from flow conditions, (ii) air pump, (iii) \textsc{OptiTrack} markers used for localization. The robot is remotely controlled by a computer via radio communication.} \label{fig:exp-robot}
\end{figure}
As mentioned in Section \ref{sec:introSI}, non-smooth concentration patches appear when the flow is turbulent. To ensure the detection of these patches, we need to allow enough instantaneous readings at each location. Furthermore, to minimize the effect of intervals of low concentration between the detections, we calculate the final concentration value as the average of the readings at the highest quartile. In the experiment, we record $1000$ instantaneous readings at each measurement location.
We perform the computations off-board and communicate the commands to the robot via radio communications. This allows us to use a very small robot minimizing the interference with the flow field. The localization needed for motion control of the robot, is provided by an \textsc{OptiTrack} motion capture system and a simple controller is implemented for line tracking. We utilize the \textsc{VisiLibity} toolbox to generate the geodesic path between each pair of waypoints given by the planning Algorithm \ref{alg:pathPlan}, taking into account the obstacle; see \cite{VisiLibity2008O}.
The robot collects $\bbarm = 16$ initial measurements; these measurements are shown in Figure \ref{fig:exp-meas}. Note that the pattern of readings are in agreement with the model prediction verifying the overall accuracy of the numerical solutions of the flow and the AD-PDE \eqref{eq:BVP}. Figure \ref{fig:exp-place} shows the waypoints where we set the maximum number of measurements to $m_{\max} = 25$.
\begin{figure}[t]
\centering
\begin{subfigure}[b]{0.48\textwidth}
\includegraphics[width=\textwidth]{measurements.pdf}
\caption{initial measurements} \label{fig:exp-meas}
\end{subfigure}
\quad
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{placement.pdf}
\caption{waypoints} \label{fig:exp-place}
\end{subfigure}
\caption{Top figure shows the initial $\bbarm$ measurements overlaid on the concentration field predicted by AD-PDE \eqref{eq:BVP} for a hypothetical source located at the true location. Bottom figure shows the waypoints of the robot.} \label{fig:exp-}
\end{figure}
The final solution is $\bbp = (3140, 1.69, 1.76, 1.77, 1.85)$ resulting in a location error $e_{\text{loc}} = 0.03$. This small error is due to the different heights of the planes at which ethanol is released ($x_3 = 0.30$m) and measurements are taken ($x_3 = 0.27$m). This causes the peak to be somewhat displaced downstream. The intensity of the source is predicted to be approximately $3 \times 10^3$ppm/s for the estimated source area of $5.6 \times 10^{-3}$m$^2$.
The video of the SI process is given in \cite{meJ1_video}. It can be seen from the video that the estimation of the source location approaches the true value immediately after the initial measurements are collected and the rest of the measurements correct the solution for the newer information that becomes available. Particularly, as the measurements get closer to the source, the intensity of the estimated source spikes to account for much larger observed concentration measurements.
\subsection{Discussion} \label{sec:discussion}
An important predicament in application of model-based ASI Algorithm \ref{alg:autoSI} is handling advection-dominated problems. Given a transport medium, e.g., air, high advection translates to turbulent flow which is non-trivial to model and an active area of research. Currently viable approaches are based on the Reynolds-Averaged Navier-Stokes (RANS) models that provide time-averaged properties. These models often suffice for engineering applications but major assumptions used in their derivation, technicalities pertaining to mesh generation and boundary layer treatment, and oftentimes conflicting predictions from different models affect their predictive ability so that additional experimental studies may be necessary to validate them; see \cite{TMCFD1993W} for more details.
On the other hand, advection-dominated AD models are also challenging and an active area of research. The reason is usually the presence of numerical instabilities.
In the previous section, we added a constant artificial diffusion which is a common practice in the relevant literature \cite{LRSROMBE2017BBSK}. Nevertheless, this might in general lead to forward solutions that are inconsistent with the solution of the original AD-PDE \cite{FEMFP2003DH}.
Numerous more advanced stabilization techniques exist that artificially introduce diffusion in a consistent manner; see e.g. \cite{SUPGFCDF1982BH}. Note that very high Peclet numbers, e.g., $Pe \approx 10^3$, are reported in the literature for the forward solution of the AD-PDE \eqref{eq:BVP} but solving the Inverse Problem using the AD model is considerably more challenging.
Specifically, instability of the AD model adversely affects the POD method, the SA initialization, and consequently the nonlinear optimization problems \eqref{eq:opt} and \eqref{eq:pathOptL}. After extensive simulation and experimental studies, we have observed that our method works well for Peclet numbers up to approximately $Pe \approx 250$.
While here we employ the standard Galerkin scheme for simplicity, more sophisticated FEM could be employed to improve this bound.
Note that an important feature of the ASI Algorithm \ref{alg:autoSI} is that it is highly modular, meaning that different components, i.e., the formulation of the SI problem \eqref{eq:opt}, planning problem \eqref{eq:pathOptL}, model reduction Algorithm \ref{alg:POD}, and SA initialization Algorithm \ref{alg:init}, can be independently improved for better SI performance. For instance in Section \ref{sec:ppComp} we replaced the planning module with the ergodic placement for the purpose of comparison.
Finally, for very low Peclet numbers, i.e., diffusion dominated cases, high concentration regions are local, thus it is possible for the SA method to miss some sources if there are no measurements close enough to those sources. Moreover, in the case of multiple sources, if the intensities differ considerably, the SA technique typically detects the high intensity ones.
In these cases, using higher numbers of initial measurements $\bbarm$ and tuning the thresholding parameter $\alpha$ in the SA Algorithm \ref{alg:init} can improve the initialization. We also note that, the SA initialization can be combined with possible prior knowledge about the sources to improve the performance of the proposed ASI algorithm.
\subsection{First Order Information} \label{sec:Grad}
In Appendix \ref{sec:adjointM} we discussed the Adjoint Method to obtain the gradient of the SI problem \eqref{eq:opt} when the variable $s$ is a function that lives in the infinite dimensional function space $S$. Here, we employ the approximations $V_d$ and $S_d$ defined in Section \ref{sec:finiteDim} to obtain a finite dimensional counterpart of the Adjoint Method equations \eqref{eq:adjoint} that is needed to solve the finite dimensional SI problem \eqref{eq:optFD} numerically.
First, we substitute the finite dimensional representations \eqref{eq:finiteDim} into equation \eqref{eq:adVBVP} to get
\begin{align*}
& a(c_d,v_d) - \inprod{\ell(s_d),v_d} = 0, \ \forall v_d \in V_d, \\
& a( \sum_{k=1}^N c_k \psi_k , \sum_{i=1}^N v_i \psi_i ) - \inprod{\ell(s_d), \sum_{i=1}^N v_i \psi_i } = 0, \ \forall v_i \in \reals, \\
& \sum_{i=1}^N v_i \set{ \sum_{k=1}^N c_k a( \psi_k , \psi_i ) - \inprod{\ell(s_d), \psi_i } } = 0, \ \forall v_i \in \reals, \\
& \sum_{k=1}^N c_k a( \psi_k , \psi_i ) - \inprod{\ell(s_d), \psi_i } = 0 , \ \forall i \in \set{1, \dots, N} .
\end{align*}
Writing the equations for all $i \in \set{1, \dots, N}$ in matrix form, we obtain the following linear system of equations
\begin{equation} \label{eq:VBVPLS}
\bbA \bbc = \bbb (\bbp),
\end{equation}
where $\bbA \in \reals^{N \times N}$ and $\bbb$ is a fixed vector for a given $\bbp$. Using equation \eqref{eq:VBVPLS}, we define the finite dimensional model in equation (\ref{eq:optFD}) explicitly as
\begin{equation} \label{eq:Model}
\bbM(\bbc, \bbp) = \bbA \bbc - \bbb (\bbp) = \bb0 .
\end{equation}
As explained in Section \ref{sec:ADPDE}, the AD model \eqref{eq:VBVP} has a unique solution that translates to the invertibility of matrix $\bbA$ in \eqref{eq:Model}.
Similar to approximations \eqref{eq:finiteDim}, we can write $w_d = \bbpsi \, \bbw \text{ and } \, h_d = \bbpsi \, \bbh$ where $\bbw, \bbh \in \reals^N$. Substituting these definitions into the adjoint equation \eqref{eq:adAdjoint}, we get
\begin{align*}
& \inprod{\ccalJ'_c, \psi_i } + \sum_{k=1}^N w_k a^*( \psi_k , \psi_i ) = 0 , \ \forall i \in \set{1, \dots, N} ,
\end{align*}
where the derivative $\inprod{\ccalJ'_c, \cdot }$ is defined by equation \eqref{eq:gradJc}.
Again writing the equations for all $i \in \set{1, \dots, N}$ in matrix form, we obtain
\begin{equation} \label{eq:adjointLS}
\bbA^T \bbw = - \bbd,
\end{equation}
where the transpose sign appears in \eqref{eq:adjointLS} because of the adjoint operator in the equations.
Given values for the source parameters $\bbp$, the linear systems \eqref{eq:VBVPLS} and \eqref{eq:adjointLS} can be used to obtain the corresponding concentration $\bbc$ and adjoint variable $\bbw$. This information can then be used in \eqref{eq:adGrad} to calculate the desired gradient $\nabla_{\bbp} \bbarJ$ of the objective function $\bbarJ(\bbp) = \bar{\ccalJ}(s_d)$ with respect to $\bbp$.
In order to simplify the notation and without loss of generality, we assume a single source in a $2$D domain given by
$ s_d(\bbx) = \beta \, \phi(\bbx; \undbbx, \barbx) ,$
where $\undbbx = (\undx_1,\undx_2)$ and $\barbx = (\bbarx_1, \bbarx_2)$.
Substituting the approximations \eqref{eq:finiteDim} in the Lagrangian \eqref{eq:Lag}, we get
$ \ccalL(c_d,s_d,w_d) = \ccalJ(c_d,s_d) + a(c_d,w_d) - \ell(w_d;s_d) .$
To obtain the finite dimensional counterpart of equation \eqref{eq:adGrad}, we need to take the derivative of this Lagrangian with respect to the parameters $\bbp$ of the source term $s_d$. The terms that contain $s_d$ are $\ccalJ(c_d,s_d)$ and $\ell(w_d; s_d)$.
For the objective functional $\ccalJ(c_d,s_d)$ from equation \eqref{eq:obj}, the only part involving $s_d$ is the regularization term
$ \int_{\Omega} s_d \ d\Omega = \beta \ (\bbarx_1 - \undx_1) (\bbarx_2 - \undx_2) .$
From this expression we can calculate the derivatives of $\ccalJ(c_d,s_d)$ with respect to $\bbp$, e.g.,
$$ \frac{\partial \ccalJ}{\partial \undx_1} = - \tau \beta (\bbarx_2 - \undx_2) . $$
For the functional $\ell(w_d; s_d)$, substituting $s_d$ into the definition \eqref{eq:functional} we get
$ \ell(w_d;s_d) =
\int_{\undx_1}^{\bbarx_1} \int_{\undx_2}^{\bbarx_2} \beta \ w_d(\bbx) \ dx_2 \ dx_1 . $
The derivative with respect to $\beta$ is straightforward and for the other parameters we use the Leibniz rule, e.g.,
$$ \frac{\partial \ell}{\partial \undx_1} = - \beta \int_{\undx_2}^{\bbarx_2} w_d(\undx_1, x_2) \ dx_2 . $$
Then by equation \eqref{eq:adGrad}, combining the two derivatives for $\undx_1$ we get
$ \partial \bbarJ / \partial \undx_1 = \partial \ccalJ / \partial \undx_1 - \partial \ell / \partial \undx_1 .$
The other derivatives can be calculated exactly the same way and we get the following values for the desired gradient
\begin{align} \label{eq:grad}
& \frac{\partial \bbarJ}{\partial \beta} = \displaystyle \tau (\bbarx_1 - \undx_1) (\bbarx_2 - \undx_2) - \int_{\undx_1}^{\bbarx_1} \int_{\undx_2}^{\bbarx_2} w_d(\bbx) \ dx_2 \ dx_1 , \nonumber \\
& \frac{\partial \bbarJ}{\partial \undx_1} = \displaystyle - \tau \beta (\bbarx_2 - \undx_2) + \beta \int_{\undx_2}^{\bbarx_2} w_d(\undx_1, x_2) \ dx_2 , \nonumber \\
& \frac{\partial \bbarJ}{\partial \undx_2} = \displaystyle - \tau \beta (\bbarx_1 - \undx_1) + \beta \int_{\undx_1}^{\bbarx_1} w_d(x_1, \undx_2) \ dx_1 , \nonumber \\
& \frac{\partial \bbarJ}{\partial \bbarx_1} = \displaystyle \tau \beta (\bbarx_2 - \undx_2) - \beta \int_{\undx_2}^{\bbarx_2} w_d(\bbarx_1, x_2) \ dx_2 , \nonumber \\
& \frac{\partial \bbarJ}{\partial \bbarx_2} = \displaystyle \tau \beta (\bbarx_1 - \undx_1) - \beta \int_{\undx_1}^{\bbarx_1} w_d(x_1, \bbarx_2) \ dx_1 ,
\end{align}
where $\bbarJ(\bbp) = \bar{\ccalJ}(s_d)$ and $\bbp = (\beta, \undx_1, \undx_2, \bbarx_1, \bbarx_2)$.
The process for calculating the desired gradient $\nabla_{\bbp} \bbarJ$ given a set of values for the parameters $\bbp$ is described in Algorithm \ref{alg:Grad}.
\begin{algorithm}[t]
\caption{The Adjoint Method}
\label{alg:Grad}
\begin{algorithmic}[1]
\REQUIRE The vector of parameters $\bbp$ and the matrix $\bbA$;
\STATE Compute the r.h.s. vector $\bbb$ of equation \eqref{eq:VBVPLS};
\STATE Solve the linear system $\bbA \bbc = \bbb$ for coefficients $\bbc$;
\STATE Compute the r.h.s. vector $\bbd$ of equation \eqref{eq:adjointLS} using \eqref{eq:gradJc};
\STATE Solve the adjoint equation $\bbA^T \bbw = - \bbd$ for $\bbw$;
\STATE Compute the desired gradient $\nabla_{\bbp} \bbarJ$ using equation (\ref{eq:grad}).
\end{algorithmic}
\end{algorithm}
Note that if there are multiple sources, i.e., if $M > 1$, then we calculate the gradients for each basis function separately. This follows from the rule for differentiating sums. Moreover if $\Omega \subset \reals^3$, we can exactly follow the same steps to calculate the gradient.
\subsection{Second Order Information} \label{sec:secOrderInfo}
Including second order information in the optimization algorithm can make the solution of the SI problem \eqref{eq:optFD} more efficient and accurate. Such information can be in the form of the Hessian $\bbH = \nabla_{\bbp \bbp} \bbarJ$ of the objective function itself, or in the form of a Hessian-vector product $\bbH \bbv$, for some vector $\bbv$, that is used in the optimization algorithm; see, e.g., \cite[ch. 7]{NO2006NW}.
The procedure to calculate the Hessian-vector multiplication is an attractive choice for large-scale problems but we use it here since it provides an organized approach to incorporate the AD model \eqref{eq:Model} into the Hessian calculations.
Specifically, using the finite dimensional approximation of the Lagrangian (\ref{eq:Lag}) given as
\begin{equation} \label{eq:LagFiniteDim}
L(\bbc, \bbp, \bbw) = J(\bbc, \bbp) + \bbw^T \bbM(\bbc, \bbp) = J(\bbc, \bbp) + \bbw^T (\bbA \bbc - \bbb) ,
\end{equation}
we can devise a procedure to calculate the product $\bbH \bbv$ for a given vector $\bbv$.
The details of this derivation can be found in \cite{PAPO2006ABGHK} and it results in the following equation
\begin{equation} \label{eq:HessVec}
\bbH \, \bbv = \bbM_{\bbp}^T \, \bbh_4 + \nabla^2_{\bbp \bbc} L \ \bbh_1 + \nabla^2_{\bbp \bbp} L \ \bbv ,
\end{equation}
where the subscripts denote differentiation and the process to calculate the vectors $\bbh_1$ and $\bbh_4$ is explained in Algorithm \ref{alg:Hess}.
\begin{algorithm}[t]
\caption{Hessian-vector Multiplication}
\label{alg:Hess}
\begin{algorithmic}[1]
\REQUIRE The vector $\bbv$;
\REQUIRE The matrices $\bbA$, $\bbM_{\bbp}$, $\nabla^2_{\bbc \bbc} L$, and $\nabla^2_{\bbp \bbp} L$ from equations \eqref{eq:VBVPLS}, \eqref{eq:Mp}, \eqref{eq:Lcc}, and \eqref{eq:Lpp};
\STATE Compute $\bbh_2 = \bbM_{\bbp} \bbv$ using equation \eqref{eq:Mp};
\STATE Solve $\bbM_{\bbc} \bbh_1 = \bbh_2$ for $\bbh_1$ where $\bbM_{\bbc} = \bbA$;
\STATE Compute $\bbh_3 = \nabla^2_{\bbc \bbp} L \, \bbv + \nabla^2_{\bbc \bbc} L \ \bbh_1 $ using equations \eqref{eq:Lpc} and \eqref{eq:Lcc};
\STATE Solve $\bbM_{\bbc}^{T} \bbh_4 = - \bbh_3$ for $\bbh_4$;
\STATE Calculate $\bbH \, \bbv$ from equation \eqref{eq:HessVec}.
\end{algorithmic}
\end{algorithm}
In what follows, we discuss all the second order terms needed in Algorithm \ref{alg:Hess} starting with the derivative of the AD model \eqref{eq:Model} with respect to the parameters denoted by $\bbM_{\bbp}$.
Recalling equation \eqref{eq:VBVPLS} and using the Leibniz rule, row $i$ of matrix $\bbM_{\bbp} \in \reals^{N \times 5}$ is given as
\begin{align} \label{eq:Mp}
& \frac{\partial \bbM_i}{\partial \beta} = - \int_{\undx_1}^{\bbarx_1} \int_{\undx_2}^{\bbarx_2} \psi_i(\bbx) \ dx_2 \ dx_1 , \nonumber \\
& \frac{\partial \bbM_i}{\partial \undx_1} = \beta \int_{\undx_2}^{\bbarx_2} \psi_i(\undx_1, x_2) \ dx_2 , \nonumber \\
& \frac{\partial \bbM_i}{\partial \undx_2} = \beta \int_{\undx_1}^{\bbarx_1} \psi_i(x_1, \undx_2) \ dx_1 , \nonumber \\
& \frac{\partial \bbM_i}{\partial \bbarx_1} = - \beta \int_{\undx_2}^{\bbarx_2} \psi_i(\bbarx_1, x_2) \ dx_2 , \nonumber \\
& \frac{\partial \bbM_i}{\partial \bbarx_2} = - \beta \int_{\undx_1}^{\bbarx_1} \psi_i(x_1, \bbarx_2) \ dx_1 .
\end{align}
Using equation \eqref{eq:Model}, the derivative of the AD model with respect to $\bbc$ is given as
$ \bbM_{\bbc} = \bbA . $
In addition, since there are no terms containing the multiplication of the concentration and source parameters, $\bbc$ and $\bbp$, in $L(\bbc, \bbp, \bbw)$, we have
\begin{equation} \label{eq:Lpc}
\nabla^2_{\bbp \bbc} L = \nabla^2_{\bbc \bbp} L = \bb0 .
\end{equation}
Finally we need to calculate the second order derivatives of the Lagrangian with respect to each of $\bbc$ and $\bbp$. Note that from equation \eqref{eq:LagFiniteDim}, $\nabla^2_{\bbc \bbc} L = \nabla^2_{\bbc \bbc} J$ and the value $\inprod{\ccalJ'_c,\psi_i}$ is basically the directional derivative in the direction $\psi_i$ or the derivative $\partial J / \partial c_i$. Thus we can Gateaux differentiate equation \eqref{eq:gradJc} once more to get the element in row $i$ and column $j$ of $\nabla^2_{\bbc \bbc} L$ as
\begin{eqnarray} \label{eq:Lcc}
[\nabla^2_{\bbc \bbc} L]_{ij} = \int_{\Omega} \chi_E \, \psi_i \, \psi_j \ d\Omega ,
\end{eqnarray}
where $i, j \in \set{1, \dots, N}$. Note that this expression is independent of the parameters $\bbp$ and can be calculated offline.
In order to calculate $\nabla^2_{\bbp \bbp} L$ note that the terms $J(\bbc, \bbp)$ and $\bbw^T \bbb$ in the Lagrangian (\ref{eq:LagFiniteDim}) contribute to this derivative. The calculation for $\nabla^2_{\bbp \bbp} J$ can be done by differentiating the result of Section \ref{sec:Grad} for $\nabla_{\bbp} J$ once more to get
\begin{equation} \label{eq:Jpp}
\nabla^2_{\bbp \bbp} J = \tau \left[
\begin{array}{ccccc}
0 & \cdot & \cdot & \cdot & \cdot \\
- (\bbarx_2 - \undx_2) & 0 & \cdot & \cdot & \cdot \\
- (\bbarx_1 - \undx_1) & \beta & 0 & \cdot & \cdot \\
(\bbarx_2 - \undx_2) & 0 & - \beta & 0 & \cdot \\
(\bbarx_1 - \undx_1) & - \beta & 0 & \beta & 0
\end{array}
\right] .
\end{equation}
For the second term we have $\bbw^T \bbb = \ell(w_d; s_d) $, since the Lagrangians \eqref{eq:Lag} and \eqref{eq:LagFiniteDim} are equivalent.
Thus, we can differentiate the expression for $\nabla_{\bbp} \ell$ from Section \ref{sec:Grad} once more, using the Leibniz rule, to get $ \nabla^2_{\bbp \bbp} \ell$ as is shown in equation \eqref{eq:LppSec}.
\begin{figure*}[t!]
\small
\begin{align} \label{eq:LppSec}
& \nabla^2_{\bbp \bbp} \ell = \nonumber \\
& \left[
\begin{array}{ccccc}
0 & \cdot & \cdot & \cdot & \cdot \\
- \int_{\undx_2}^{\bbarx_2} w_d(\undx_1, x_2) \ dx_2 &
- \beta \int_{\undx_2}^{\bbarx_2} \frac{\partial w_d}{\partial \undx_1} (\undx_1, x_2) \ dx_2
& \cdot & \cdot & \cdot \\
- \int_{\undx_1}^{\bbarx_1} w_d(x_1, \undx_2) \ dx_1 & \beta w_d(\undx_1, \undx_2) &
- \beta \int_{\undx_1}^{\bbarx_1} \frac{\partial w_d}{\partial \undx_2} (x_1, \undx_2) \ dx_1
& \cdot & \cdot \\
\int_{\undx_2}^{\bbarx_2} w_d(\bbarx_1, x_2) \ dx_2 & 0 & - \beta w_d(\bbarx_1, \undx_2) &
\beta \int_{\undx_2}^{\bbarx_2} \frac{\partial w_d}{\partial \bbarx_1} (\bbarx_1, x_2) \ dx_2
& \cdot \\
\int_{\undx_1}^{\bbarx_1} w_d(x_1, \bbarx_2) \ dx_1 & - \beta w_d(\undx_1, \bbarx_2) & 0 & \beta w_d(\bbarx_1, \bbarx_2) &
\beta \int_{\undx_1}^{\bbarx_1} \frac{\partial w_d}{\partial \bbarx_2} (x_1, \bbarx_2) \ dx_1
\end{array}
\right]
\end{align}
\end{figure*}
\normalsize
Putting the two terms given by equations \eqref{eq:Jpp} and \eqref{eq:LppSec} together, we have
\begin{equation} \label{eq:Lpp}
\nabla^2_{\bbp \bbp} L = \nabla^2_{\bbp \bbp} J - \nabla^2_{\bbp \bbp} \ell .
\end{equation}
Notice that we basically have differentiated equation (\ref{eq:grad}) once more in this process.
The case of multiple sources only affects the terms $\bbM_{\bbp}$ and $\nabla^2_{\bbp \bbp} L$ given by equations (\ref{eq:Mp}) and (\ref{eq:Lpp}), respectively.
Since the source term $s_d$ defined in equation \eqref{eq:sourceFiniteDim} is the summation of nonlinear basis functions, for $\bbM_{\bbp}$ we need to append more columns using equation \eqref{eq:Mp} corresponding to each basis function. On the other hand, for $\nabla^2_{\bbp \bbp} L$ we have to add blocks of matrices given by equation \eqref{eq:Lpp} corresponding to each basis function to the diagonal of $\nabla^2_{\bbp \bbp} L$.
\subsection{Initialization} \label{sec:init}
Appropriate initialization is critical for the solution of nonlinear optimization problems, such as \eqref{eq:optFD}, since otherwise the solution can get trapped in undesirable local minima.
In this paper, we employ a result on the point-source Sensitivity Analysis (SA) of the SI cost functional, presented in \cite{SSASLSSLS2013SA}, for initialization of our method.
The idea is to determine the sensitivity of the objective functional $\ccalJ(c,s)$ to the appearance of a point source in $\Omega$, i.e., we calculate the derivative of the objective with respect to the point-source term.
The regions with highest sensitivity represent the potential areas where the support of the true source function $\bbars$ is nonzero.
Note that by linearity of the AD-PDE (\ref{eq:BVP}), we only need to consider the infinitesimal deviations of the point-source from zero for a source-free domain, i.e., we calculate the derivative for the constant source function $s=0$.
In \cite{SSASLSSLS2013SA} it is shown that the adjoint variable is a measure of the sensitivity of the cost functional to these infinitesimal changes. Thus given the set of measurements $E$ introduced in Section \ref{sec:probDef}, we can obtain an approximation to the source locations via a solution of the adjoint equation. Specifically, we solve
$ \bbA^T \barbw = -\barbd $
with
$ \bbard_i = \int_{\Omega} c^m \ \psi_i \ d\Omega $
for $i \in \set{1, \dots, N}$, to get the desired finite dimensional adjoint function as $\bbarw_d = \bbpsi \, \barbw$.
Then an approximate localization of the source is obtained through thresholding as
\begin{equation} \label{eq:init}
\hhatw_d (\bbx) \triangleq
\left\{
\begin{array}{ll}
\bbarw_d (\bbx) & \text{if } \bbarw_d (\bbx) \leq \alpha \, \bbarw^{\min}_d \\
0 & \text{o.w.}
\end{array}
\right.
\end{equation}
where $\bbarw^{\min}_d = \min_{\bbx \in \Omega} \bbarw_d (\bbx)$ and $\alpha \in (0,1)$.
The thresholding parameter $\alpha$ determines the size of the support of $\hhatw_d (\bbx)$ and thus, the number of compact regions that indicate candidate source locations.
In order to separate these compact regions, we utilize the Single Linkage Agglomerative Clustering (SLAC) algorithm; see, e.g., \cite{MSTSLCA1969GR}. Specifically, given the nodal values $\hhatbbw_d$ of $\hhatw_d (\bbx)$ over the FE-mesh, we cluster the nonzero nodal values into sets $C_k$ for $k \in \set{1, \dots, K}$.
Then, we initialize the SI problem \eqref{eq:optFD} by placing a basis function with a small area at the point with highest sensitivity, given by equation \eqref{eq:init}, in each cluster; see Algorithm \ref{alg:init} for details.
\begin{algorithm}[t]
\caption{Point-source Sensitivity Analysis}
\label{alg:init}
\begin{algorithmic}[1]
\REQUIRE The set of measurements $E$;
\REQUIRE The thresholding parameter $\alpha \in (0,1)$;
\STATE Compute the sensitivity function $\hhatw_d (\bbx)$ from equation \eqref{eq:init} and the set $Z = \set {\bbz_i \, | \, \hhatw_d (\bbz_i) \neq 0, 1 \leq i \leq n}$;
\STATE Divide the set of points $Z$ into $K$ clusters $C_k$ according to their distance using the SLAC algorithm;
\STATE For each cluster $C_k$, set the cluster center as
$$\barbz_k = \argmin_{\bbz_i \in C_k} \hhatw_d (\bbz_i) ;$$
\STATE Initialize the source term \eqref{eq:sourceFiniteDim} using bases $\phi_k(\bbx)$ with small areas centered at $\barbz_k$ and $\beta_k \propto \abs{ \hhatw_d (\barbz_k) }$ .
\end{algorithmic}
\end{algorithm}
\subsection{Advection-Diffusion Transport} \label{sec:ADPDE}
Let $\Omega \subset \reals^d$ denote the domain of interest ($1 \leq d \leq 3$), and assume the presence of sources is modeled by a nonnegative function, $s: \Omega \rightarrow \reals_+$.
\footnote{For the problem considered here, we assume that sources are strictly positive functions. In general, sources can also be negative in the case of sinks. Sinks can appear, e.g., in the presence of chemical reactions that consume a contaminant. The treatment of the problem in that case is similar.}
Let $c: \Omega \rightarrow \reals_+$ be the measurable quantity, such as concentration, generated by this source function. Moreover, let the velocity at which this quantity is transported via advection be $\bbu \in \reals^d$ and $\kappa \in \reals_+$ be the diffusivity of the medium. Under steady-state assumption and applying a zero-valued Dirichlet condition to the boundaries $\Gamma$ of the domain, we arrive at the following Boundary Value Problem (BVP) \cite[ch. 2]{STMTPE2005SJ}
\begin{subequations} \label{eq:BVP}
\begin{eqnarray}
- \nabla \cdot ( \kappa \nabla c ) + \nabla \cdot (c \, \bbu) - s = 0 &\text{ in }& \Omega, \label{eq:ADPDE} \\
c = 0 &\text{ on }& \Gamma. \label{eq:EBC}
\end{eqnarray}
\end{subequations}
We consider Dirichlet conditions for the sake of simplicity; more general boundary conditions can be considered without any additional complications \cite{IFA1998R}.
In order for the BVP (\ref{eq:BVP}) to have a solution we assume that $s \in L^2(\Omega)$, i.e., $s$ is square integrable over $\Omega$, and define the feasible set for the source term as
$ S = \set{ s \in L^2(\Omega) \ | \ s \geq 0 } $.
The BVP (\ref{eq:BVP}) can be equivalently represented in variational form as follows.
Consider the set $V \subset H^1_0(\Omega)$, i.e., the set of functions that themselves and their first weak derivatives are square integrable and have compact supports. Thus every $v \in V$ satisfies the boundary condition (\ref{eq:EBC}).
Multiplying equation (\ref{eq:ADPDE}) by the trial function $v \in V$, integrating over the domain, and using Green's theorem, we obtain the variational formulation of the Advection-Diffusion PDE as
\begin{equation} \label{eq:VBVP}
a(c,v) = \ell(v;s), \ \forall v \in V ,
\end{equation}
where $a: V \times V \to \reals$ is a non-symmetric continuous positive-definite bilinear form defined as
\begin{equation} \label{eq:binomial}
a(c,v) \triangleq \int_{\Omega} \kappa \nabla c \cdot \nabla v \ d\Omega + \int_{\Omega} v \, \bbu \cdot \nabla c \ d\Omega ,
\end{equation}
\normalsize
and $\ell(s): V \to \reals$ is a continuous linear functional defined as
\begin{equation} \label{eq:functional}
\ell(v;s) \triangleq \inprod{\ell(s),v} \triangleq \int_{\Omega} sv \ d\Omega ,
\end{equation}
where the notation $\inprod{\ell(s),v}$ indicates the operation of $\ell(s)$ on the function $v$.
Given $s \in S$, we define the linear functional $\ccalM(c;s): V \to \reals$ as
\begin{equation} \label{eq:ADmodel}
\ccalM(c;s) \triangleq Ac - \ell(s) ,
\end{equation}
where the operator $A: V \to V'$ is defined by $\inprod{Ac,v} = a(c,v), \ \forall v \in V$. The notation $V'$ denotes the dual space of $V$, i.e., the space of linear functionals acting on $V$. Using this definition, the VBVP \eqref{eq:VBVP} is equivalent to the operator equation $\ccalM(c;s) = 0$ where $\ccalM: V \times S \to V'$.
Note that the functions $c$ and $v$ in the VBVP \eqref{eq:VBVP} have to be differentiable once.
Moreover, it can be shown that for $s \in S$ the BVP (\ref{eq:BVP}) and VBVP (\ref{eq:VBVP}) are equivalent and we can use them interchangeably. For further theoretical details, see \cite[ch. 8, 9]{IFA1998R}.
\subsection{The Source Identification Problem} \label{sec:probDef}
In this section, we formulate the SI problem as a constrained optimization problem subject to the AD transport model \eqref{eq:VBVP}.
Specifically, consider $m$ stationary sensors deployed in the domain $\Omega$ that take measurements of the concentration $c$, and let $E \subset \Omega$ be the set of $m$ compactly supported measurement areas enclosing the sensor locations.
\footnote{Note that the compact measurement area around any given sensor can be made arbitrarily small so that this sensing model approximates point measurements.}
Define, further, the indicator function $\chi_E: \Omega \to \set{0,1}$ for the set $E$ as
\begin{equation} \label{eq:indicFun}
\chi_E(\bbx) \triangleq
\left\{
\begin{array}{ll}
1 & \bbx \in E \\
0 & \bbx \notin E
\end{array}
\right.
\end{equation}
and let $c^m: \Omega \rightarrow \reals_+$ be a function that assigns to $\bbx \in \Omega$ the noisy concentration measurement at that location, i.e.,
\begin{equation} \label{eq:measureFun}
c^m(\bbx) = \chi_E(\bbx) \, c(\bbx) \, ( 1 + \epsilon ),
\end{equation}
where $\epsilon \sim {\cal{N}} (0, \ \sigma^2)$ and the measurement noise is proportional to the signal magnitude.
Then, the SI problem that we consider in this paper consists of determining an estimate $s$ of the true source term $\bbars$, given a set $E$ of $m$ noisy measurements in the domain $\Omega$, so that the AD model $\ccalM(c; s)=0$ defined in \eqref{eq:ADmodel} predicts the measurements $c^m$ as close as possible in the least squares sense.
The main challenges in solving the SI problem arise due to the following two reasons. First, generally the number of measurements $m$ is considerably smaller than the number of parameters that are used to describe the unknown source term. Second, the measurements are contaminated with noise.
To address these two challenges, we follow a standard approach and formulate the SI problem as a regularized least squares optimization problem subject to the AD model \eqref{eq:VBVP}. Let
\begin{equation} \label{eq:Xnorm}
\norm{c - c^m}_{\chi_E}^2 \triangleq \int_{\Omega} (c - c^m)^2 \ \chi_E \ d\Omega
\end{equation}
be a measure of discrepancy between the measurements and concentration field predicted by the AD model and define the cost functional $\ccalJ(c,s):V \times S \to \reals_+$ to be optimized by
$$ \ccalJ(c,s) \triangleq \frac{1}{2} \norm{c - c^m}_{\chi_E}^2 + \tau \ccalR(s) . $$
In this equation, $\tau$ is the regularization parameter and $\ccalR(s)$ is a functional that specifies the characteristics of the source $s$ that is selected as the solution of the SI problem.
In this work, we select
$ \ccalR(s) \triangleq \norm{s}_{L^1} = \int_{\Omega} \abs{s} \ d\Omega = \int_{\Omega} s \ d\Omega , $
where the last equality holds since $s$ is nonnegative. This choice of regularization penalizes the size of the source term.
Optimization of the objective functional $\ccalJ(c,s)$ subject to the AD model \eqref{eq:VBVP} gives rise to the following problem
\begin{equation} \label{eq:opt}
\min_{ (c,s) \in V \times S} \ccalJ(c,s) \ \, \st \ccalM(c,s) = 0,
\end{equation}
where the functional $\ccalM(c,s)$ is defined by \eqref{eq:ADmodel} and
\begin{equation} \label{eq:obj}
\ccalJ(c,s) = \frac{1}{2} \int_{\Omega} (c - c^m)^2 \ \chi_E \ d\Omega + \tau \int_{\Omega} s \ d\Omega .
\end{equation}
To solve the SI problem \eqref{eq:opt}, the gradient of the cost functional $\ccalJ(c,s)$ is needed. We obtain this gradient using the so called Adjoint Method. This method allows us to solve \eqref{eq:opt} directly in the reduced space $S$ of source functions rather than in the full space $V \times S$ of the concentration and source functions.
This is possible by using the model $\ccalM(c,s) = 0$ to represent the concentration $c$ as a function of the source term $s$, i.e., $c = \ccalF(s)$ where $\ccalF: S \to V$.
\footnote{As discussed in Section \ref{sec:ADPDE} such a representation exists and is unique.}
Using this gradient information we can minimize the cost functional $\bar{\ccalJ}(s) = \ccalJ(\ccalF(s),s)$ and determine the source term $s$ that solves the original problem \eqref{eq:opt}. See Appendix \ref{sec:adjointM} for the details of the Adjoint Method.
\subsection{Finite Dimensional Approximation} \label{sec:finiteDim}
The variables $c$ and $s$ of the optimization problem \eqref{eq:opt} are functions that live in the infinite dimensional function
spaces $V$ and $S$, respectively. Therefore, in order to solve this problem numerically, it is necessary to approximate $V$ and $S$ by finite dimensional subspaces $V_d \subset V$ and $S_d \subset S$ determined by appropriate sets of basis functions. This approximation allows us to parametrize the concentration and source functions by a finite number of parameters that depend on the basis functions that constitute $V_d$ and $S_d$.
The key idea to obtain the finite dimensional subspace $V_d$ of the concentration function space $V$ is to use Proper Orthogonal Decomposition (POD) to reduce the order of the model.
The POD method is easy to implement and gives an optimal set of basis functions that can be readily used in our formulation to parameterize $c$. For a survey of popular model order reduction methods, see, e.g., \cite{ALDS2005A}.
At the same time, we use a nonlinear representation of the source term $s$ as a combination of compactly supported tower functions. This representation reduces the dimension of $S_d$ drastically, compared to classical approaches that utilize the Finite Element method.
\subsubsection{Model Order Reduction} \label{sec:MOR}
To reduce the order of a model using POD we need to solve the AD-PDE \eqref{eq:BVP} for all values of the unknown source term and build a set of basis functions that span the solution of the AD model.
We refer to the solutions as the snapshots of the problem.
Let $C = \set{c_i(\bbx)}_{i=1}^R$ denote a set of $R$ snapshots obtained by solving the AD-PDE \eqref{eq:BVP} for different realizations of the source term, i.e., each $c_i(\bbx) \in V$ corresponds to a given $s_i(\bbx) \in S$.
The objective of POD is to generate a set of optimal basis functions that maximize the averaged projection of the snapshots over these basis functions; see, e.g., \cite{PODRBFCPE2001AK}.
This optimization problem is equivalent to an eigenvalue problem for the covariance matrix $\bbC \in \reals^{R \times R}$ defined by
\begin{equation} \label{eq:PODcov}
\bbC_{ij} \triangleq \frac{1}{R} \int_{\Omega} c_i \, c_j \, d\Omega .
\end{equation}
The details of this procedure are presented in Algorithm \ref{alg:POD}, which yields $V_d = \text{span} \set{\psi_k}_{k=1}^N $ for $N < R$ where $\psi_k$ are the POD basis functions.
\begin{algorithm}[t]
\caption{Proper Orthogonal Decomposition}
\label{alg:POD}
\begin{algorithmic}[1]
\REQUIRE The set of snapshots $C = \set{c_i(\bbx)}_{i=1}^R$;
\STATE Construct the covariance matrix $\bbC$ using equation (\ref{eq:PODcov});
\STATE Solve the eigenvalue problem $\bbC \bbQ = \bbLambda \bbQ$ such that \label{line:Lambda}
$$\lambda_1 \geq \lambda_2 \geq \dots \geq \lambda_R \geq 0 \text{ and } \bbQ = [\bbq^1 \ \bbq^2 \ \dots \ \bbq^R] ; $$
\STATE The POD bases $\set{\psi_k}_{k=1}^R$ are given by
\begin{equation}
\psi_k = \sum_{i=1}^R q^k_i c_i .
\end{equation}
\STATE For $N < R$ the reduced order model $c_d$ is given as $c_d \in V_d = \text{span} \set{\psi_k}_{k=1}^N$.
\end{algorithmic}
\end{algorithm}
In line \ref{line:Lambda} of this algorithm $\bbLambda$ is the diagonal matrix of the eigenvalues.
As shown in \cite[thm. 1]{PODRBFCPE2001AK}, the $i$-th eigenvalue $\lambda_i$ of matrix $\bbC$ contains the average energy in the $i$-th mode. Moreover for a given number $N < R$ of basis functions, the POD bases have the maximum possible energy and are optimal.
Thus, for a given fraction $\eta$, we can select the number $N$ of required bases as the smallest number such that
\begin{equation} \label{eq:selecN}
\frac{\sum_{i=1}^N \lambda_i}{\sum_{i=1}^R \lambda_i} \geq \eta.
\end{equation}
\subsubsection{Parameterization} \label{sec:param}
Using the basis functions $\psi_k$ that constitute $V_d = \set{\psi_k}_{k=1}^{N}$ we can represent the functions $c$ and $v$ by a finite number of parameters, that can be used for numerical optimization. Specifically, we define
\begin{equation} \label{eq:finiteDim}
c_d = \bbpsi \, \text{ and } \, v_d = \bbpsi \, \bbv ,
\end{equation}
where $\bbpsi = [\psi_1 \ \dots \ \psi_N]$ and $\bbc, \bbv \in \reals^N$.
To parametrize the source function $s$ we follow a different approach. Specifically, we propose a nonlinear representation of this term as a combination of compactly supported tower functions. The motivation for this representation is that each compactly supported source area can be approximately described by a very small number of parameters corresponding to the intensity and shape of the source. In this paper we focus on rectangular sources, although other geometric shapes can also be used for this purpose.
In particular, let $M$ be the number of basis functions used to approximate the source term in the domain $\Omega \subset \reals^d$ and consider two parameters $\set{ \undbbx_j, \barbx_j }$ for each basis function, where $\undbbx_j, \barbx_j \in \reals^d$ and $j \in \set{ 1, \dots, M}$. We define the compactly supported tower functions as
\begin{equation} \label{eq:towerF}
\phi_j(\bbx; \undbbx_j, \barbx_j) \triangleq
\left\{
\begin{array}{ccl}
1 & & \text{if } \undbbx_j \leq \bbx \leq \barbx_j \\
0 & & \text{o.w.}
\end{array}
\right.
\end{equation}
where the inequalities are considered component-wise and $\undbbx_j \leq \barbx_j$; cf. Figure \ref{fig:towerF}. Then, for practical purposes we can approximate the desired source term $s \in S$ by
\begin{equation} \label{eq:sourceFiniteDim}
s_d(\bbx) = \sum_{j=1}^M \beta_j \phi_j(\bbx; \undbbx_j, \barbx_j) ,
\end{equation}
where we require $\beta_j \geq 0$ so that $s_d \in S$.
We denote by $ \bbp = (\beta_1, \undbbx_1, \barbx_1, \dots, \beta_M, \undbbx_M, \barbx_M)$ the vector of parameters associated with the source term $s_d$. Thus for $\Omega \in \reals^d$, $\bbp \in \reals^p$ where $p = M(2d+1)$.
\begin{figure}[t!]
\centering
\includegraphics[width=0.35\textwidth]{main2.png}
\caption{The support of a tower function in $2$D case defined by equation \eqref{eq:towerF}. } \label{fig:towerF}
\end{figure}
Substituting the approximations $\set{c_d,s_d}$ of the concentration and source terms $c$ and $s$ in equation \eqref{eq:opt}, we obtain a finite dimensional counterpart of the SI problem as
\begin{align} \label{eq:optFD}
& \min_{ \bbc, \bbp} J(\bbc, \bbp) \\
& \ \st \bbM(\bbc, \bbp) = \bb0, \nonumber \\
& \ \ \ \ \ \ \beta_j \geq0, \ \bbl \leq \undbbx_j \leq \barbx_j \leq \bbu , \nonumber
\end{align}
where $j \in \set{ 1, \dots, M}$ and $\bbl, \bbu \in \reals^d$ are the lower and upper bounds on the coordinates of the domain.
\footnote{We can include additional convex constraints to confine the feasible region that might contain the true source. The extension to non-convex domains is considered in Section \ref{sec:autoSI}.}
Moreover, the objective $J:\reals^{N \times p} \to \reals_+$ is defined as $J(\bbc, \bbp) = \ccalJ(c_d, s_d)$ and the finite dimensional model $\bbM:\reals^{N \times p} \to \reals^N$ is defined as $\bbM(\bbc; \bbp) = \ccalM(c_d; s_d)$.
The optimization problem \eqref{eq:optFD} can be solved by a variety of available nonlinear optimization algorithms. Any such algorithm requires the first and possibly second order information, i.e., the gradient and Hessian of the objective function, as well as a proper initialization since the problem is nonlinear.
In Appendix \ref{sec:SInumeric}, we derive explicit expressions for the gradient and Hessian of the objective function in reduced space $S_d$. Consequently, only the bound constraints in \eqref{eq:optFD} need to be considered explicitly for numerical optimization. In the same appendix, we also discuss the Sensitivity Analysis (SA) method for the initialization of problem \eqref{eq:optFD}.
\subsection{The Next Best Measurement Problem} \label{sec:NBMP}
In this section we discuss the details of the numerical solution for the path planning developed in Section \ref{sec:path}. Let $\bbF(\bbx) = \bbS^T [ \bbX^T \bbX + \bbpsi(\bbx)^T \bbpsi(\bbx) ] \bbS$ denote the FIM at step $m$, where to simplify notation we have dropped the subscripts. Then introducing an auxiliary variable $z$ we can rewrite the optimization problem \eqref{eq:pathOptL} as
\begin{align} \label{eq:pathOptEig}
& \max_{z, \bbx} \ z \nonumber \\
& \ \st \lambda_i (\bbF(\bbx)) > z, \ \forall i \in \set{1, \dots, p}, \nonumber \\
& \ \ \ \ \ \ \bbx \in \Omega ,
\end{align}
where $\lambda_i$ denotes the $i$-th eigenvalue of the FIM. Problem \eqref{eq:pathOptEig} can be equivalently written as
\begin{align} \label{eq:pathOptL2}
& \max_{z, \bbx} \ z \nonumber \\
& \ \st \bbF(\bbx) - z \, \bbI \succ \bb0 , \nonumber \\
& \ \ \ \ \ \ \bbx \in \Omega ,
\end{align}
where the notation $\succ$ denotes a matrix inequality.
The optimization problem \eqref{eq:pathOptL2} is a nonlinear Semi-Definite Program (SDP) that can be solved using nonlinear optimization techniques; see, e.g., \cite{NO2006R}. In this paper we employ the Sequential SDP (SSDP) method which is the extension of sequential quadratic programming; see, e.g., \cite{SSDPMAPROM2005FJV}.
Defining
\begin{subequations} \label{eq:funDef}
\begin{align}
& f(z, \bbx) \triangleq -z , \label{eq:funDeff} \\
& \bbB(z, \bbx) \triangleq (\bbarepsilon+z) \bbI - \bbS^T [ \bbX^T \bbX + \bbpsi(\bbx)^T \bbpsi(\bbx) ] \bbS , \label{eq:funDefB}
\end{align}
\end{subequations}
where $0 < \bbarepsilon \ll 1$ is a very small positive number added to eliminate the strict inequality constraint, we can rewrite problem \eqref{eq:pathOptL2} in standard form as
\begin{align} \label{eq:NLSDP}
& \min_{z, \bbx} \ f(z, \bbx) \nonumber \\
& \ \st \bbB(z, \bbx) \preceq \bb0 , \nonumber \\
& \ \ \ \ \ \ \bbx \in \Omega .
\end{align}
The Lagrangian corresponding to problem \eqref{eq:NLSDP} is given as
\begin{equation} \label{eq:pathLag}
L(z, \bbx, \bbLambda) = f(z, \bbx) + ( \bbB(z, \bbx), \bbLambda ) \ ,
\end{equation}
where $\bbLambda \geq \bb0$ is the Lagrange multiplier matrix and the inner-product of two $r \times t$ real matrices $\bbB$ and $\bbLambda$ is defined as
$$ ( \bbB, \bbLambda ) = \tr (\bbB^T \bbLambda) = \sum_{i=1}^{r} \sum_{j=1}^{t} b_{ij} \lambda_{ij} . $$
Note that $\bbB(z, \bbx): \reals^{d+1} \to \mbS^p$ in \eqref{eq:funDefB} is a negative-semidefinite symmetric matrix function.
Since the Karush-Kuhn-Tucker (KKT) optimality conditions of the nonlinear SDP \eqref{eq:NLSDP} are locally identical to the second-order approximation around any point $(\bbarz, \barbx, \barbLambda)$, we can solve a sequence of convex SDPs to build the solution of the nonlinear problem \eqref{eq:NLSDP} iteratively. Under certain conditions that are satisfied for the functions in \eqref{eq:funDef}, the SSDP approach converges to a local minimum of the nonlinear SDP \eqref{eq:NLSDP}; see, e.g., \cite{SSDPMAPROM2005FJV}.
Specifically, at each iteration $k$, we construct a second-order convex approximation of \eqref{eq:NLSDP} at point $(z_k, \bbx_k, \bbLambda_k)$ as
\begin{align} \label{eq:tangent}
& \min_{\bbd \in \reals^{d+1}} \ \nabla f(\bbv_k)^T \bbd + 0.5 \ \bbd^T \, \bbH_k \, \bbd \nonumber \\
& \ \ \ \st \ \ \bbB(\bbv_k) + D_{\bbv} \bbB(\bbv_k) [\bbd] \preceq \bb0 , \nonumber \\
& \ \ \ \ \ \ \ \ \ \ \bbx_k + \bbd_{\bbx} \in \Omega ,
\end{align}
where $\bbv_k = (z_k, \bbx_k )$ is the primal variable at iteration $k$ and $\bbd = (d_z, \bbd_{\bbx})$ is a vector of directions, where $d_z \in \reals$ and $\bbd_{\bbx} \in \reals^d$ are the directions corresponding to $z_k$ and $\bbx_k$, respectively. The matrix $\bbH_k$ is a positive semidefinite approximation of the Hessian $ \nabla_{\bbv \bbv}^2 L(z_k, \bbx_k, \bbLambda_k)$ of the Lagrangian \eqref{eq:pathLag} and $D_{\bbv} \bbB(\bbv_k) [\bbd]$ is the directional derivative of the matrix function \eqref{eq:funDefB} at point $\bbv_k$ and direction $\bbd$ that is used to linearize the matrix inequality constraint around the current iterate $\bbv_k$.
This quantity along with the Hessian of the Lagrangian are derived in Appendix \ref{sec:1st2ndDeriv}.
We assume that the domain $\Omega$ is convex and defined by a set of affine constraints so that the linear constraint $\bbx_k + \bbd_{\bbx} \in \Omega$ can be directly incorporated in the SDP \eqref{eq:tangent}. This assumption holds for the box constrained domain that we considered in the SI problem \eqref{eq:optFD}.
The solution of the SDP \eqref{eq:tangent} denoted by $\bbd_k \in \reals^{d+1}$ determines the descent direction for the nonlinear problem \eqref{eq:NLSDP}. Using this solution, we update the primal variables as
\begin{equation} \label{eq:iterSSDP}
\bbv_{k+1} = \bbv_k + \alpha_k \bbd_k ,
\end{equation}
where $\alpha_k$ is a step-size whose selection is explained in Appendix \ref{sec:stepSize}.
Note that by the last constraint in the SDP problem \eqref{eq:tangent}, we implicitly assume that the maximum step-size is equal to one, i.e., $\alpha_{\max}=1$.
We update the dual variable $ \bbLambda_{k+1}$ directly as the optimal dual of the tangent problem \eqref{eq:tangent}. The details of the SSDP to solve the optimization problem \eqref{eq:pathOptL} are presented next.
\subsection{First and Second Order Information} \label{sec:1st2ndDeriv}
To solve problem \eqref{eq:NLSDP} we need the gradient and Hessian information. For this, we first define the expressions $D_{\bbv} \bbB(\bbv) [\bbd]$ and $\nabla_{\bbv \bbv}^2 L(z, \bbx, \bbLambda)$ that appear in the convex second-order SDP \eqref{eq:tangent}.
For the first term, we have
\begin{equation} \label{eq:linearCons}
D_{\bbv} \bbB(\bbv) [\bbd] = \sum_{i=1}^{d+1} d_i \ \bbB^{(i)}(\bbv) \, ,
\end{equation}
where $d_i$ is the $i$-th element of the vector of directions $\bbd$ and
\begin{equation} \label{eq:deriv1}
\bbB^{(i)}(\bbv) = \frac{\partial}{\partial v_i} \bbB(\bbv) ,
\end{equation}
for $i \in \set{1, \dots, d+1}$.
The operator $D_{\bbv} \bbB(\bbv): \reals^{d+1} \to \mbS^p$ is linear in $\bbd$ and $ D_{\bbv} \bbB(\bbv) [\bbd] \in \mbS^p$. Therefore the corresponding constraint in the SDP \eqref{eq:tangent} is a linear matrix inequality.
For the second term, i.e., the Hessian $\nabla_{\bbv \bbv}^2 L(z, \bbx, \bbLambda)$ of the Lagrangian \eqref{eq:pathLag}, since the objective function $f(z, \bbx)$ defined by equation \eqref{eq:funDeff} is linear, we have
$$\nabla_{\bbv \bbv}^2 L(z, \bbx, \bbLambda) = \nabla_{\bbv \bbv}^2 ( \bbB(z, \bbx), \bbLambda ) \in \mbS^{d+1} ,$$
where
\begin{align} \label{eq:LagHess}
\nabla_{\bbv \bbv}^2 ( \bbB, \bbLambda ) =
\left[
\begin{array}{ccc}
( \bbB^{(1,1)}, \bbLambda ) & \dots & ( \bbB^{(1,d+1)}, \bbLambda ) \\
\vdots & \ddots & \vdots \\
( \bbB^{(d+1,1)}, \bbLambda ) & \dots & ( \bbB^{(d+1,d+1)}, \bbLambda )
\end{array}
\right] ,
\end{align}
and
\begin{equation} \label{eq:deriv2}
\bbB^{(i,j)}(\bbv) = \frac{\partial^2}{\partial v_i \partial v_j} \bbB(\bbv) .
\end{equation}
Recalling the definition of the matrix function $\bbB(z, \bbx)$, given in equation \eqref{eq:funDefB}, we calculate the required derivatives \eqref{eq:deriv1} and \eqref{eq:deriv2} for, e.g., the $2$D case in which $\bbx = (x_1, x_2)$.
These derivatives then are used in equation \eqref{eq:tangent} to build quadratic SDPs that we solve sequentially to find the local optimum of the nonlinear SDP \eqref{eq:NLSDP}.
For the first order derivatives used in equation \eqref{eq:linearCons}, we have
\begin{align*}
& \bbB^{(1)} = \frac{\partial \bbB}{\partial z} = \bbI, \\
& \bbB^{(2)} = \frac{\partial \bbB}{\partial x_1} = - \bbS^T \left[ (\frac{\partial \bbpsi}{\partial x_1})^T \bbpsi + \bbpsi^T \frac{\partial \bbpsi}{\partial x_1} \right] \bbS .
\end{align*}
The value for $\bbB^{(3)}$ is exactly the same as $\bbB^{(2)}$, except that the differentiation variable is $x_2$.
Similarly for the second-order derivatives used in equation \eqref{eq:LagHess}, we have
$$ \bbB^{(1,1)} = \bbB^{(2,1)} = \bbB^{(3,1)} = \bb0 , $$
$$ \bbB^{(2,2)} = - \bbS^T \left\{ (\frac{\partial^2 \bbpsi}{\partial x_1^2})^T \bbpsi + 2 (\frac{\partial \bbpsi}{\partial x_1})^T \frac{\partial \bbpsi}{\partial x_1} + \bbpsi^T \frac{\partial^2 \bbpsi}{\partial x_1^2} \right\} \bbS. $$
$\bbB^{(3,3)}$ can be calculated exactly the same way. Finally, for the cross-derivative we have
\begin{align*}
\bbB^{(3,2)} = - \bbS^T & \left\{ (\frac{\partial^2 \bbpsi}{\partial x_1 x_2})^T \bbpsi + (\frac{\partial \bbpsi}{\partial x_1})^T \frac{\partial \bbpsi}{\partial x_2} + \right. \\
& \left. (\frac{\partial \bbpsi}{\partial x_2})^T \frac{\partial \bbpsi}{\partial x_1} + \bbpsi^T \frac{\partial^2 \bbpsi}{\partial x_1 x_2} \right\} \bbS.
\end{align*}
After calculating the Hessian $\nabla_{\bbv \bbv}^2 L(z, \bbx, \bbLambda)$ of the Lagrangian \eqref{eq:pathLag}, we construct a positive-definite approximation $\bbH$ of it so that the SDP \eqref{eq:tangent} is strictly convex with a unique global minimizer $\bbd$.
Such an approximation of $\bbH$ can be obtained in different ways; see, e.g., \cite{MIMAO1998HC}.
Here, we add a multiple of the identity matrix so that the minimum eigenvalue is bounded from zero by a small amount $\delta$, i.e., we set
\begin{equation} \label{eq:convexification}
\bbH = \nabla_{\bbv \bbv}^2 L + \mu \, \bbI,
\end{equation}
where $\mu = \max(0, \delta - \lambda_{\min}(\nabla_{\bbv \bbv}^2 L))$. The positive-definite matrix $\bbH$ is the closest to the Hessian $\nabla_{\bbv \bbv}^2 L$ measured by the induced Euclidean norm. Note that since the Hessian is a low dimensional matrix, i.e., $\nabla_{\bbv \bbv}^2 L \in \mbS^{d+1}$, we can easily calculate its minimum eigenvalue.
\subsection{Step-Size Selection} \label{sec:stepSize}
Necessary for the solution of the nonlinear SDP \eqref{eq:NLSDP} is an effective line-search strategy that connects the successive solutions of the quadratic SDPs \eqref{eq:tangent}. In this paper, we utilize the results from \cite{GANSDP2004C} to select an appropriate step-size $\alpha_k$ for the iterations of the SSDP defined by equation \eqref{eq:iterSSDP}.
The final SSDP algorithm to solve the nonlinear SDP \eqref{eq:NLSDP} is presented in Algorithm \ref{alg:SSDP}.
\begin{algorithm}[t]
\caption{Sequential Semi-definite Programming}
\label{alg:SSDP}
\begin{algorithmic}[1]
\REQUIRE The POD bases $\bbpsi = [\psi_1, \dots, \psi_N]$ of Algorithm \ref{alg:POD};
\REQUIRE The parameters $\bbarepsilon$ and $\delta$ of equations \eqref{eq:funDef} and \eqref{eq:convexification};
\REQUIRE The parameters $\epsilon_1$, $\epsilon_2$, and $\epsilon_3$ of equation \eqref{eq:stop};
\REQUIRE The parameters $\bbargamma > 0$, $\rho \in (0,1)$, and $\omega \in (0,1)$;
\STATE Initialize the iteration index $k=0$;
\STATE Initialize the primal variable $\bbv_0$ using equation \eqref{eq:initialize} and the dual variable $\bbLambda_0$ with $\bbLambda_0 \succeq \bb0$; \label{line:initialize}
\STATE Initialize the penalty parameter as $\gamma_0 = \tr(\bbLambda_0) + \bbargamma$;
\WHILE{the algorithm has not converged}
\STATE Build the convex SDP \eqref{eq:tangent} at $(\bbv_k, \bbLambda_k)$ using equations \eqref{eq:linearCons}, \eqref{eq:LagHess}, and \eqref{eq:convexification} and solve it for $(\bbd_k, \bbLambda_{k+1})$;
\STATE Check the stopping criterion \eqref{eq:stop} for $\bbv_k$;
\STATE Set $\gamma_k = \gamma_{k-1}$ if $\set{ \gamma_{k-1} \geq \tr(\bbLambda_{k+1}) + \bbargamma }$, otherwise set it as $\gamma_k = \max \set{1.5 \gamma_{k-1}, \tr(\bbLambda_{k+1}) + \bbargamma}$;
\STATE Select $\alpha_k$ as the largest member of the geometric sequence $\set{1, \rho, \rho^2, \dots}$ such that
$$ \theta_{\gamma_k} (\bbv_k + \alpha_k \bbd_k) \leq \theta_{\gamma_k} (\bbv_k) + \omega \alpha_k \Delta_k , $$
where the penalty function $\theta_{\gamma}(\bbv)$ and $\Delta_k$ are defined in equations \eqref{eq:penFun} and \eqref{eq:upperB}, respectively; \label{line:Armijo}
\STATE Update the primal variable $\bbv_{k+1}$ by equation \eqref{eq:iterSSDP};
\STATE $k \leftarrow k+1$;
\ENDWHILE
\end{algorithmic}
\end{algorithm}
In this algorithm, we define the penalty function $\theta_{\gamma}(\bbv)$ for the selection of the step-size $\alpha_k$ as
\begin{equation} \label{eq:penFun}
\theta_{\gamma}(\bbv) = f(\bbv) + \gamma \, \lambda_{\max}(\bbB(\bbv))_+ ;
\end{equation}
where $\gamma > 0$ is the penalty parameter, $\lambda_{\max}(\bbB)_+ = \max \set{0, \lambda_{\max}(\bbB)}$, and the functions $f(\bbv)$ and $\bbB(\bbv)$ are defined in equation \eqref{eq:funDef}. The upper bound $\Delta_k$ on the directional derivative $\theta'_{\gamma_k}(\bbv_k; \bbd_k)$ of the penalty function in a direction $\bbd_k$ is given as
\begin{equation} \label{eq:upperB}
\Delta_k = - \bbd_k^T \bbH_k \, \bbd_k + \tr(\bbLambda_{k+1} \bbB(\bbv_k)) - \gamma_k \, \lambda_{\max}(\bbB(\bbv_k))_+ ,
\end{equation}
where $\bbH_k$ is the positive-definite approximation given by equation \eqref{eq:convexification} and we have included the index $k$ to emphasize that we use the dual variable $\bbLambda_{k+1}$ to select the step-size $\alpha_k$.
The upper bound $\Delta_k$ is used in order to satisfy the Armijo condition in the backtracking line-search corresponding to line \ref{line:Armijo} in Algorithm \ref{alg:SSDP}. For theoretical details see \cite{GANSDP2004C}.
Note that since the domain of interest $\Omega$ is represented by a set of affine constraints that require no further linearization, the constraint $\bbx \in \Omega$ does not appear in the penalty function \eqref{eq:penFun}. Essentially, the constraint $\bbx \in \Omega$ is never violated and thus we do not penalize it in \eqref{eq:penFun}.
\subsection{Initialization and Stopping} \label{sec:pathInit}
Since the eigenvalue optimization problem \eqref{eq:pathOptL} is nonlinear, appropriate initialization of Algorithm \ref{alg:SSDP} is critical to obtain a reasonable solution.
Moreover, addition of a new measurement, reshapes the objective function \eqref{eq:pathOptL} and makes it flat around that measurement location. In other words, adding more measurements in that vicinity does not provide more information about the unknown source parameters compared to farther locations.
Therefore without global knowledge of the objective function, the algorithm gets trapped in undesirable local minima where the objective function does not change no matter how many measurements are taken in that region.
In order to generate new informative measurements, we sample the objective function of the Next Best Measurement Problem \eqref{eq:pathOptL},
$ g(\bbx) = \lambda_{\min} [ \bbF(\bbp) + \bbS(\bbp)^T \bbpsi(\bbx)^T \bbpsi(\bbx) \bbS(\bbp) ] , $
over a coarse set of points $\bbz_i \in \reals^d$ from the FE mesh, where $i \in \set{1, \dots, Z}$ for some $Z \ll n$ and $n$ is the number of FE grid points.
Then to initialize the primal variable $\bbv_0 = (z_0, \bbx_0)$ in Algorithm \ref{alg:SSDP} for step $m + 1$ of the robot, we calculate the values of the objective function $g_i = g(\bbz_i)$ over this set of points and we set
\begin{equation} \label{eq:initialize}
z_0 = \max_i g_i \ \text{and} \ \bbx_0 = \argmax_{\bbz_i} g(\bbz_i) ,
\end{equation}
where $z_0$ is the auxiliary variable introduced in \eqref{eq:pathOptEig}.
Note that each evaluation of the function $g(\bbx)$ amounts to solving a minimum eigenvalue problem for a $p \times p$ matrix where $p$ is the number of unknown parameters. The computational cost of such sampling procedure is comparable to a single backtracking line-search step of Algorithm \ref{alg:SSDP} in line \ref{line:Armijo}.
Finally, to determine whether Algorithm \ref{alg:SSDP} has reached a local minimum we evaluate bounds on the gradient of Lagrangian \eqref{eq:pathLag}, the nonlinear matrix inequality constraint violation, and the complementarity condition as follows
\begin{align} \label{eq:stop}
& \norm{ \nabla_{\bbv} L(\bbv_k, \bbLambda_{k+1}) }_2 \leq \epsilon_1, \ \lambda_{\max}(\bbB(\bbv_k))_+ \leq \epsilon_2, \nonumber \\
& \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \abs{ \tr(\bbLambda_{k+1} \bbB(\bbv_k)) } \leq \epsilon_3 .
\end{align}
See \cite{GANSDP2004C} for theoretical results supporting this selection of stopping criteria.
| {'timestamp': '2018-11-02T01:04:02', 'yymm': '1706', 'arxiv_id': '1706.01603', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01603'} | arxiv |
\section{Introduction}
Hyperparameter values---regularization strength, model family choices like depth of a neural network or which nonlinear functions to use, procedural elements like dropout rates, stochastic gradient descent step sizes, and data preprocessing choices---can make the difference between a successful application of machine learning and a wasted effort. To search among many hyperparameter values requires repeated execution of often-expensive learning algorithms, creating a major obstacle for practitioners and researchers alike.
In general, on iteration (evaluation) $k$, a hyperparameter searcher suggests a $d$-dimensional hyperparameter configuration $x_k \in \mathcal{X}$ (e.g., $\mathcal{X}=\mathbb{R}^d$ but could also include discrete dimensions), a worker trains a model using $x_k$, and returns a validation loss of $y_k \in \mathbb{R}$ computed on a hold out set.
In this work we say a hyperparameter searcher is \textbf{open loop} if $x_k$ depends only on $\{x_{i}\}_{i=1}^{k-1}$; examples include choosing $x_k$ uniformly at random \citep{randombergstra}, or $x_k$ coming from a low-discrepancy sequence (c.f., \cite{iaco2015low}).
We say a searcher is \textbf{closed loop} if $x_k$ depends on both the past configurations and validation losses $\{ (x_i,y_i) \}_{i=1}^{k-1}$; examples include Bayesian optimization \citep{practical_bo} and reinforcement learning methods \citep{zoph2016neural}.
Note that open loop methods can draw an infinite sequence of configurations before training a single model, whereas closed loop methods rely on validation loss feedback in order to make suggestions.
While sophisticated closed loop selection methods have been shown to empirically identify good hyperparameter configurations faster (i.e., with fewer iterations) than open loop methods like random search, \textbf{two trends have rekindled interest in embarrassingly parallel open loop methods}: 1) modern deep learning model are taking longer to train, sometimes up to days or weeks, and 2) the rise of cloud resources available to anyone that charge not by the number of machines, but by the number of CPU-hours used so that 10 machines for 100 hours costs the same as 1000 machines for 1 hour.
This paper explores the landscape of open loop methods, identifying tradeoffs that are rarely considered, if at all acknowledged.
While random search is arguably the most popular open loop method and chooses each $x_k$ independently of $\{x_{i}\}_{i=1}^{k-1}$, it is by no means the only choice.
In many ways uniform random search is the least interesting of the methods we will discuss because we will advocate for methods where $x_k$ depends on $\{x_i\}_{i=1}^{k-1}$ to promote \textbf{diversity}.
In particular, we will focus on drawing $\{x_i\}_{i=1}^k$ from a \textbf{$k$-determinantal point process (DPP)} \citep{dpps_for_ml}. We introduce a sampling algorithm which allows
DPPs to support real, integer, and categorical dimensions, any of which may have a tree structure, and we describe connections between DPPs and Gaussian processes (GPs).
In synthetic experiments, we find our diversity-promoting open-loop method outperforms other open loop methods. In practical hyperparameter optimization experiments, we find that it significantly outperforms other approaches in cases where the hyperparameter values have a large effect on performance. Finally, we compare against a closed loop Bayesian optimization method, and find that sequential Bayesian optimization takes, on average, more than ten times as long to find a good result, for a gain of only 0.15 percent accuracy on a particular hyperparameter optimization task.
\section{Related Work}
While this work focuses on open loop methods, the vast majority of recent work on hyperparameter tuning has been on closed loop methods, which we briefly review.
\subsection{Closed Loop Methods}
Much attention has been paid to sequential model-based optimization techniques such as Bayesian optimization \citep{bo_algos, practical_bo} which sample hyperparameter spaces adaptively. These techniques first choose a point in the space of hyperparameters, then train and evaluate a model with the hyperparameter values represented by that point, then sample another point based on how well previous point(s) performed. When evaluations are fast, inexpensive, and it's possible to evaluate a large number of points (e.g. $k = \Omega(2^d)$ for $d$ hyperparameters) these approaches can be advantageous, but in the more common scenario where we have limited time or a limited evaluation budget, the sequential nature of closed loop methods can be cumbersome. In addition, it has been observed that many Bayesian optimization methods with a moderate number of hyperparameters, when run for $k$ iterations, can be outperformed by sampling $2k$ points uniformly at random \citep{hyperband}, indicating that even simple open loop methods can be competitive.
Parallelizing Bayesian optimization methods has proven to be nontrivial, though many agree that it's vitally important. While many algorithms exist which can sample more than one point at each iteration \citep{parallel_bo_ucb,parallel_tradeoffs,batch_bo, parallel_thompson_bo}, the sequential nature of Bayesian optimization methods prevent the full parallelization open loop methods can employ. Even running two iterations (with batches of size $k/2$) will take on average twice as long as fully parallelizing the evaluations, as you can do with open loop methods like grid search, sampling uniformly, or sampling according to a DPP.
One line of research has examined the use of $k$-DPPs for optimizing hyperparameters in the context of parallelizing Bayesian optimization \citep{bo_dpp,bo_dpp_struct}. At each iteration within one trial of Bayesian optimization, instead of drawing a single new point to evaluate from the posterior, they define a $k$-DPP over a relevance region from which they sample a diverse set of points. They found their approach to beat state-of-the-art performance on a number of hyperparameter optimization tasks, and they proved that generating batches by sampling from a $k$-DPP has better regret bounds than a number of other approaches.
They show that a previous batch sampling approach which selects a batch by sequentially choosing a point which has the highest posterior variance \citep{parallel_bo_ucb} is just approximating finding the maximum probability set from a $k$-DPP (an NP-hard problem \citep{dpps_for_ml}), and they prove that sampling (as opposed to maximization) has better regret bounds for this optimization task.
We use the work of \citet{bo_dpp} as a foundation for our exploration of fully-parallel optimization methods, and thus we focus on $k$-DPP sampling as opposed to maximization.
So-called configuration evaluation methods have been shown to perform well by adaptively allocating resources to different hyperparameter settings \citep{freeze_thaw,hyperband}. They initially choose a set of hyperparameters to evaluate (often uniformly), then partially train a set of models for these hyperparameters. After some fixed training budget (e.g., time, or number of training examples observed), they compare the partially trained models against one another and allocate more resources to those which perform best. Eventually, these algorithms produce one (or a small number) of fully trained, high-quality models.
In some sense, these approaches are orthogonal to open vs.~closed loop methods, as the diversity-promoting approach we advocate can be used as a drop-in replacement to the method used to choose the initial hyperparameter assignments.
\subsection{Sampling proportional to the posterior variance of a Gaussian process}\label{sec:gaussian_process}
GPs have long been lauded for their expressive power, and have been used extensively in the hyperparameter optimization literature. \citet{gp_dpp} show that drawing a sample from a $k$-DPP with kernel $\mathcal{K}$ is equivalent to sequentially sampling $k$ times proportional to the (updated) posterior variance of a GP defined with covariance kernel $\mathcal{K}$. This sequential sampling is one of the oldest hyperparameter optimization algorithms, though our work is the first to perform an in-depth analysis. Additionally, this has a nice information theoretic justification: since the entropy of a Gaussian is proportional to the log determinant of the covariance matrix, points drawn from a DPP have probability proportional to $\exp(\text{information gain})$, and the most probable set from the DPP is the set which maximizes the information gain. With our MCMC algorithm presented in Algorithm \ref{alg:mixed_mcmc}, we can draw samples with these appealing properties from any space for which we can draw uniform samples. The ability to draw $k$-DPP samples by sequentially sampling points proportional to the posterior variance grants us another boon: if one has a sample of size $k$ and wants a sample of size $k+1$, only a single additional point needs to be drawn, unlike with the sampling algorithms presented in \citet{dpps_for_ml}. Using this approach, we can draw samples up to $k=100$ in less than a second on a machine with 32 cores.
\subsection{Open Loop Methods}
As discussed above, recent trends have renewed interest in open loop methods. While there exist many different batch BO algorithms, analyzing these in the open loop regime (when there are no results from function evaluations) is often rather simple. As there is no information with which to update the posterior mean, function evaluations are hallucinated using the prior or points are drawn only using information about the posterior variance. For example, in the open loop regime, \citet{parallel_thompson_bo}'s approach without hallucinated observations is equivalent to uniform sampling, and their approach with hallucinated observations (where they use the prior mean in place of a function evaluation, then update the posterior mean and variance) is equivalent to sequentially sampling according to the posterior variance (which is the same as sampling from a DPP). Similarly, open loop optimization in SMAC \citep{parallel_smac} is equivalent to first Latin hypercube sampling to make a large set of diverse candidate points, then sampling $k$ uniformly among these points.
Recently, uniform sampling was shown to be competitive with sophisticated closed loop methods for modern hyperparameter optimization tasks like optimizing the hyperparameters of deep neural networks \citep{hyperband}, inspiring other works to explain the phenomenon \citep{ahmed2016we}.
\citet{randombergstra} offer one of the most comprehensive studies of open loop methods to date, and focus attention on comparing random search and grid search.
A main takeaway of the paper is that uniform random sampling is generally preferred to grid search\footnote{Grid search uniformly grids $[0,1]^d$ such that $x_k = (\tfrac{i_1}{m}, \tfrac{i_2}{m}, \dots, \tfrac{i_d}{m})$ is a point on the grid for $i_j = 0,1,\dots,m$ for all $j$, with a total number of grid points equal to $(m+1)^d$.} due to the frequent observation that some hyperparameters have little impact on performance, and random search promotes more diversity in the dimensions that matter.
Essentially, if points are drawn uniformly at random in $d$ dimensions but only $d' < d$ dimensions are relevant, those same points are uniformly distributed (and just as diverse) in $d'$ dimensions.
Grid search, on the other hand, distributes configurations aligned with the axes so if only $d'<d$ dimensions are relevant, many configurations are essentially duplicates.
However, grid search does have one favorable property that is clear in just one dimension.
If $k$ points are distributed on $[0,1]$ on a grid, the maximum spacing between points is equal to $\frac{1}{k-1}$.
But if points are uniformly at random drawn on $[0,1]$, the expected largest gap between points scales as $\frac{1}{\sqrt{k}}$.
If, by bad luck, the optimum islocated in this largest gap, this difference could be considerable; we attempt to quantify this idea in the next section.
\section{Measures of spread}
Quantifying the spread of a sequence $\mathbf{x} = (x_1,x_2,\dots,x_k)$ (or, similarly, how well $\mathbf{x}$ covers a space) is a well-studied concept. In this section we introduce discrepancy, a quantity used by previous work, and dispersion, which we argue is more appropriate for optimization problems.
\subsection{Discrepancy}
Perhaps the most popular way to quantify the spread of a sequence is star discrepancy. One can interpret the star discrepancy as a multidimensional version of the Kolmogorov-Smirnov statistic between the sequence $\mathbf{x}$ and the uniform measure; intuitively, when $\mathbf{x}$ contains points which are spread apart, star discrepancy is small.
We include a formal definition in Appendix~\ref{sec:star_discrep}.
Star discrepancy plays a prominent role in the numerical integration literature, as it provides a sharp bound on the numerical integration error through the the Koksma-Hlawka inequality (given in Appendix~\ref{sec:koksma-hlawka}) \citep{koksma-hlawka}. This has led to wide adoption of low discrepancy sequences, even outside of numerical integration problems. For example, \citet{randombergstra} analyzed a number of low discrepancy sequences for some optimization tasks and found improved optimization performance over uniform sampling and grid search. Additionally, low discrepancy sequences such as the Sobol sequence\footnote{\citet{randombergstra} found that the Niederreiter and Halton sequences performed similarly to the Sobol sequence, and that the Sobol sequence outperformed Latin hypercube sampling. Thus, our experiments include the Sobol sequence (with the Cranley-Patterson rotation) as a representative low-discrepancy sequence.} are used as an initialization procedure for some Bayesian optimization schemes \citep{practical_bo}.
\subsection{Dispersion}\label{sec:dispersion}
Previous work on open loop hyperparameter optimization focused on low discrepancy sequences \citep{randombergstra, norandomnocry}, but optimization performance---how close a point in our sequence is to the true, fixed optimum---is our goal, not a sequence with low discrepancy. As discrepancy doesn't directly bound optimization error, we turn instead to dispersion
\begin{align*}
d_k(\mathbf{x}) = \sup_{x\in [0,1]^d} \min_{1\leq i \leq k} \rho (x, x_i),
\end{align*}
where $\rho$ is a distance (in our experiments $L_2$ distance). Intuitively, the dispersion of a point set is the radius of the largest Euclidean ball containing no points; dispersion measures the worst a point set could be at finding the optimum of a space.
Following \cite{niederreiter1992random}, we can bound the optimization error as follows. Let $f$ be the function we are aiming to optimize (maximize) with domain $\mathcal{B}$, $m(f)=\sup\limits_{x\in \mathcal{B}} f(x)$ be the global optimum of the function, and $m_k(f;\mathbf{x})=\sup\limits_{1\leq i\leq k} f(x_i)$ be the best-found optimum from the set $\mathbf{x}$. Assuming $f$ is continuous (at least near the global optimum), the modulus of continuity is defined as
\begin{align*}
\omega(f; t) = \sup_{\substack{x,y\in \mathcal{B} \\ \rho(x,y) \leq t}} \left|f(x) - f(y)\right|,\text{ for some } t\geq 0 .
\end{align*}
\begin{theorem}\label{theorem:opt_bound}
\citep{niederreiter1992random}
For any point set $\mathbf{x}$ with dispersion $d_k(\mathbf{x})$, the optimization error is bounded as
\begin{align*}
m(f) - m_k(f;\mathbf{x}) \leq \omega(f; d_k(\mathbf{x})).
\end{align*}
\end{theorem}
Dispersion can be computed efficiently (unlike discrepancy, $D_k(\mathbf{x})$, which is NP-hard \citep{zhigljavsky2007stochastic}), and we give an algorithm in Appendix~\ref{sec:dispersion_algo}.
Dispersion is at least $\Omega(k^{-1/d})$, and while low discrepancy implies low dispersion ($d^{-1/2}d_k(\mathbf{x}) \leq \frac{1}{2}D_k(\mathbf{x})^{1/d}$), the other direction does not hold.\footnote{Discrepancy is a global measure which depends on all points, while dispersion only depends on points near the largest ``hole''.}
Therefore we know that the low-discrepancy sequences evaluated in previous work are also low-dispersion sequences in the big-$O$ sense, but as we will see they may behave quite differently. Samples drawn uniformly are not low dispersion, as they have rate $(\ln(k)/k)^{1/d}$ \citep{zhigljavsky2007stochastic}.
Optimal dispersion in one dimension is found with an evenly spaced grid, but it's unknown how to get an optimal set in higher dimensions.\footnote{In two dimensions a hexagonal tiling finds the optimal dispersion, but this is only valid when $k$ is divisible by the number of columns and rows in the tiling.} Finding a set of points with the optimal dispersion is as hard as solving the circle packing problem in geometry with $k$ equal-sized circles which are as large as possible. Dispersion is bounded from below with $d_k(\mathbf{x})\geq \big( \Gamma(d/2+1)\big)^{1/d}\pi^{-1/2}k^{-1/d}$, though it is unknown if this bound is sharp.
\subsection{Comparison of Open Loop Methods}
In Figure~\ref{fig:dispersion} we plot the dispersion of the Sobol sequence, samples drawn uniformly at random, and samples drawn from a $k$-DPP, in one and two dimensions. To generate the $k$-DPP samples, we sequentially drew samples proportional to the (updated) posterior variance (using an RBF kernel, with $\sigma=\sqrt{2}/k$), as described in Section~\ref{sec:gaussian_process}. When $d=1$, the regular structure of the Sobol sequence causes it to have increasingly large plateaus, as there are many ``holes'' of the same size.\footnote{By construction, each individual dimension of the $d$-dimensional Sobol sequence has these same plateaus.} For example, the Sobol sequence has the same dispersion for $42\leq k \leq 61$, and $84 \leq k \leq 125$.
Samples drawn from a $k$-DPP appear to have the same asymptotic rate as the Sobol sequence, but they don't suffer from the plateaus. When $d=2$, the $k$-DPP samples have lower average dispersion and lower variance.
One other natural surrogate of average optimization performance is to measure the distance from a fixed point, say $\frac{1}{2} \mathbf{1} = (\frac{1}{2},\dots,\frac{1}{2})$ or from the origin, to the nearest point in the length $k$ sequence. Our experiments (in Appendix~\ref{sec:center_origin}) on these metrics show the $k$-DPP samples bias samples to the corners of the space, which can be beneficial when the practitioner defined the search space with bounds that are too small.
Note, the low-discrepancy sequences are usually defined only for the $[0,1]^d$ hypecrube, so for hyperparameter search which involves conditional hyperparameters (i.e. those with tree structure) they are not appropriate.
In what follows, we study the $k$-DPP in more depth and how it performs on real-world hyperparameter tuning problems.
\begin{figure*}[h]
\centering
\subfloat[Dispersion, with $d=1$. ]{\includegraphics[width=0.5\textwidth]{dispersion_1d.pdf}\label{fig:disp_1d}}
\hfill
\subfloat[Dispersion, with $d=2$.]{\includegraphics[width=0.5\textwidth]{dispersion_2d.pdf}\label{fig:disp_2d}}
\caption{Dispersion of the Sobol sequence, samples from a $k$-DPP, and uniform random samples (lower is better). These log-log plots show when $d=1$ that Sobol suffers from regular plateaus of increasing size, while when $d=2$ the $k$-DPP samples have lower average dispersion and lower variance.
\label{fig:dispersion}}
\end{figure*}
\section{Method}
We begin by reviewing DPPs and $k$-DPPs.
Let $\mathcal{B}$ be a domain from which we would like to sample a finite subset. (In our use of DPPs, this is the set of hyperparameter assignments.) In general, $\mathcal{B}$ could be discrete or continuous; here we assume it is discrete with $N$ values, and we define $\mathcal{Y}=\{1,\ldots,N\}$ to be a a set which indexes $\mathcal{B}$ (this index set will be particularly useful in Algorithm \ref{alg:discrete_mcmc}). In Section \ref{sec:new_mcmc} we address when $\mathcal{B}$ has continuous dimensions.
A DPP defines a probability distribution over $2^\mathcal{Y}$ (all subsets of $\mathcal{Y}$) with the property that two elements of $\mathcal{Y}$ are more (less) likely to both be chosen the more dissimilar (similar) they are. Let random variable $\boldsymbol{Y}$ range over finite subsets of $\mathcal{Y}$.
There are several ways to define the parameters of a DPP. We focus on $\mathbf{L}$-ensembles, which define the probability that a specific subset is drawn (i.e., $P(\boldsymbol{Y} = \mathcal{A})$ for some $\mathcal{A} \subset \mathcal{Y}$) as:
\begin{align}
P(\boldsymbol{Y} = \mathcal{A}) = \frac{\text{det}(\mathbf{L}_\mathcal{A})}{\text{det}(\mathbf{L}+I)}.
\end{align}
As shown in \cite{dpps_for_ml}, this definition of $\mathbf{L}$ admits a decomposition to terms representing the \emph{quality} and \emph{diversity} of the elements of $\mathcal{Y}$. For any $y_i, y_j \in \mathcal{Y}$, let:
\begin{align}
\mathbf{L}_{i,j}=q_iq_j\mathcal{K}(\boldsymbol{\phi}_i,\boldsymbol{\phi}_j),
\end{align}
where $q_i > 0$ is the quality of $y_i$, $\boldsymbol{\phi}_i \in \mathbb{R}^d$ is a featurized representation of $y_i$, and $\mathcal{K}: \mathbb{R}^d \times \mathbb{R}^d \to [0,1]$ is a similarity kernel (e.g. cosine distance). (We will discuss how to featurize hyperparameter settings in Section~\ref{se:construction}.)
Here, we fix all $q_i = 1$; in future work, closed loop methods might make use of $q_i$ to encode evidence about the quality of particular hyperparameter settings to adapt the DPP's distribution over time.
\subsection{Sampling from a k-DPP}
DPPs have support over all subsets of $\mathcal{Y}$, including $\emptyset$ and $\mathcal{Y}$ itself. In many practical settings, one may have a fixed budget that allows running the training algorithm $k$ times, so we require precisely $k$ elements of $\mathcal{Y}$ for evaluation. $k$-DPPs are distributions over subsets of $\mathcal{Y}$ of size $k$. Thus,
\begin{align}
P(\boldsymbol{Y}=\mathcal{A} \mid |\boldsymbol{Y}| = k)= \frac{\text{det}(\mathbf{L}_\mathcal{A})}{\sum_{\mathcal{A}^\prime \subset \mathcal{Y}, |\mathcal{A}'| = k }\text{det}(\mathbf{L}_{\mathcal{A}^\prime})}.
\end{align}
Sampling from $k$-DPPs has been well-studied. When the base set $\mathcal{B}$ is a set of discrete items, exact sampling algorithms are known which run in $\mathcal{O}(Nk^3)$ \cite{dpps_for_ml}. When the base set is a continuous hyperrectangle, a recent exact sampling algorithm was introduced, based on a connection with Gaussian processes (GPs), which runs in $\mathcal{O}(dk^2 + k^3)$ \cite{gp_dpp}. We are unaware of previous work which allows for sampling from $k$-DPPs defined over any other base sets.
\subsection{Sampling k-DPPs defined over arbitrary base sets} \label{sec:new_mcmc}
\citet{dpp_discrete_mcmc} present a Metropolis-Hastings algorithm (included here as Algorithm~\ref{alg:discrete_mcmc}) which is a simple and fast alternative to the exact sampling procedures described above.
However, it is restricted to discrete domains. We propose a generalization of the MCMC algorithm which preserves relevant computations while allowing sampling from any base set from which we can draw uniform samples, including those with discrete dimensions, continuous dimensions, some continuous and some discrete dimensions, or even (conditional) tree structures (Algorithm~\ref{alg:mixed_mcmc}). To the best of our knowledge, this is the first algorithm which allows for sampling from a $k$-DPP defined over any space other than strictly continuous or strictly discrete, and thus the first algorithm to utilize the expressive capabilities of the posterior variance of a GP in these regimes.
\algrenewcommand\algorithmicrequire{\textbf{Input:}}
\algrenewcommand\algorithmicensure{\textbf{Output:}}
\begin{algorithm*}[htb]
\caption{Drawing a sample from a discrete $k$-DPP \citep{dpp_discrete_mcmc} }
\label{alg:discrete_mcmc}
\begin{algorithmic}[1]
\Require{$\mathbf{L}$, a symmetric, $N\times N$ matrix where $\mathbf{L}_{i,j}=q_iq_j\mathcal{K}(\boldsymbol{\phi}_i,\boldsymbol{\phi}_j)$ which defines a DPP over a finite base set of items $\mathcal{B}$, and $\mathcal{Y}=\{1,\ldots,N\}$, where $\mathcal{Y}_i$ indexes a row or column of $\mathbf{L}$}
\Ensure{$\mathcal{B}_\mathbf{Y}$ (the points in $\mathcal{B}$ indexed by $\mathbf{Y}$)}
\State Initialize $\mathbf{Y}$ to $k$ elements sampled from $\mathcal{Y}$ uniformly
\While{not mixed}
\State uniformly sample $u\in \mathbf{Y}, v\in \mathcal{Y}\setminus \mathbf{Y}$
\State set $\mathbf{Y}^\prime=\mathbf{Y}\cup \{v\}\setminus \{u\}$
\State $p \gets \frac{1}{2}min(1,\frac{\text{det}(\mathbf{L}_{\mathbf{Y}^\prime})} {\text{det}(\mathbf{L}_{\mathbf{Y}})})$
\State with probability $p$: $\mathbf{Y} = \mathbf{Y}^\prime$
\EndWhile
\State Return $\mathcal{B}_\mathbf{Y}$
\end{algorithmic}
\end{algorithm*}
Algorithm~\ref{alg:discrete_mcmc} proceeds as follows: First, initialize a set $\mathbf{Y}$ with $k$ indices of $\mathbf{L}$, drawn uniformly. Then, at each iteration, sample two indices of $\mathbf{L}$ (one within and one outside of the set $\mathbf{Y}$), and with some probability replace the item in $\mathbf{Y}$ with the other.
When we have continuous dimensions in the base set, however, we can't define the matrix $\mathbf{L}$, so sampling indices from it is not possible. We propose Algorithm~\ref{alg:mixed_mcmc}, which samples points directly from the base set $\mathcal{B}$ instead (assuming continuous dimensions are bounded), and computes only the principal minors of $\mathbf{L}$ needed for the relevant computations on the fly.
\begin{algorithm*}[htb]
\caption{Drawing a sample from a $k$-DPP defined over a space with continuous and discrete dimensions}
\label{alg:mixed_mcmc}
\begin{algorithmic}[1]
\Require{A base set $\mathcal{B}$ with some continuous and some discrete dimensions, a quality function $\boldsymbol{\Psi}:\mathbf{Y}_i \to q_i$, a feature function $\boldsymbol{\Phi}:\mathbf{Y}_i \to \boldsymbol{\phi}_i$}
\Ensure{$\boldsymbol{\beta}$, a set of $k$ points in $\mathcal{B}$}
\State Initialize $\boldsymbol{\beta}$ to $k$ points sampled from $\mathcal{B}$ uniformly
\While{not mixed}
\State uniformly sample $u\in \boldsymbol{\beta}, v\in \mathcal{B}\setminus \boldsymbol{\beta}$
\State set $\boldsymbol{\beta}^\prime=\boldsymbol{\beta}\cup \{v\}\setminus \{u\}$
\State compute the quality score for each item, $q_i=\boldsymbol{\Psi}(\boldsymbol{\beta}_i),\forall i$, and $q_i^\prime = \boldsymbol{\Psi} (\boldsymbol{\beta}_i^\prime),\forall i$
\State construct $\mathbf{L}_{\boldsymbol{\beta}}=[ q_i q_j \mathcal{K}( \boldsymbol{\Phi} (\boldsymbol{\beta}_i), \boldsymbol{\Phi} (\boldsymbol{\beta}_j))], \forall i,j$
\State construct $\mathbf{L}_{\boldsymbol{\beta}^\prime}=[q_i^\prime q_j^\prime \mathcal{K}(\boldsymbol{\Phi}(\boldsymbol{\beta}_i^\prime), \boldsymbol{\Phi}(\boldsymbol{\beta}_j^\prime))], \forall i,j$
\State $p \gets \frac{1}{2}min(1,\frac{\text{det}(\mathbf{L}_{\boldsymbol{\beta}^\prime})} {\text{det}(\mathbf{L}_{\boldsymbol{\beta}})})$
\State with probability $p$: $\boldsymbol{\beta} = \boldsymbol{\beta}^\prime$
\EndWhile
\State Return $\boldsymbol{\beta}$
\end{algorithmic}
\end{algorithm*}
Even in the case where the dimensions of $\mathcal{B}$ are discrete, Algorithm \ref{alg:mixed_mcmc} requires less computation and space than Algorithm \ref{alg:discrete_mcmc} (assuming the quality and similarity scores are stored once computed, and retrieved when needed). Previous analyses claimed that Algorithm \ref{alg:discrete_mcmc} should mix after $\mathcal{O}(N\log(N))$ steps. There are $\mathcal{O}(N^2)$ computations required to compute the full matrix $L$, and at each iteration we will compute at most $O(k)$ new elements of $L$, so even in the worst case we will save space and computation whenever $k\log(N)<N$. In expectation, we will save significantly more.
\subsection{Constructing $\mathbf{L}$ for hyperparameter optimization} \label{se:construction}
Let $\boldsymbol{\phi}_i$ be a feature vector for $y_i \in \mathcal{Y}$, a modular encoding of the attribute-value mapping assigning values to different hyperparameters, in which fixed segments of the vector are assigned to each hyperparameter attribute (e.g., the dropout rate, the choice of nonlinearity, etc.).
For a hyperparameter that takes a numerical value in range $[h_{\text{min}}, h_{\text{max}}]$, we encode value $h$ using one dimension ($j$) of $\boldsymbol{\phi}$ and project into the range $[0,1]$:
\begin{align}
\mathbf{\boldsymbol{\phi}}[j] &= \frac{h - h_{\text{min}}}{h_{\text{max}} - h_{\text{min}}}
\end{align}
This rescaling prevents hyperparameters with greater dynamic range from dominating the similarity calculations. A categorical-valued hyperparameter variable that takes $m$ values is given $m$ elements of $\boldsymbol{\phi}$ and a one-hot encoding. Ordinal-valued hyperparameters can be encoded using a unary encoding. (For example, an ordinal variable which can take three values would be encoded with [1,0,0], [1,1,0], and [1,1,1].) Additional information about the distance between the values can be incorporated, if it's available. In this work, we then compute similarity using an RBF kernel, $\mathcal{K}=\exp\left(-\frac{||\boldsymbol{\phi}_i-\boldsymbol{\phi}_j||^2}{2\sigma^2}\right)$, and hence label our approach $k$-DPP-RBF. Values for $\sigma^2$ lead to models with different properties; when $\sigma^2$ is small, points that are spread out interact little with one another, and when $\sigma^2$ is large, the increased repulsion between the points encourages them to be as far apart as possible.
\subsection{Tree-structured hyperparameters}
Many real-world hyperparameter search spaces are tree-structured. For example, the number of layers in a neural network is a hyperparameter, and each additional layer adds at least one new hyperparameter which ought to be tuned (the number of nodes in that layer). For a binary hyperparameter like whether or not to use regularization, we use a one-hot encoding. When this hyperparameter is ``on,'' we set the associated regularization strength as above, and when it is ``off'' we set it to zero. Intuitively, with all other hyperparameter settings equal, this causes the off-setting to be closest to the least strong regularization. One can also treat higher-level design decisions as hyperparameters \citep{hyperopt_sklearn}, such as whether to train a logistic regression classifier, a convolutional neural network, or a recurrent neural network. In this construction, the type of model would be a categorical variable (and thus get a one-hot encoding), and all child hyperparameters for an ``off'' model setting (such as the convergence tolerance for logistic regression, when training a recurrent neural network) would be set to zero.
\begin{figure*}[h]
\centering
\includegraphics[width=\linewidth]{three_lr.pdf}
\caption{Average best-found model accuracy by iteration when training a convolutional neural network on three hyperparameter search spaces (defined in Section~\ref{sec:learn_rate_exp}), averaged across 50 trials of hyperparameter optimization, with $k=20$.
\label{fig:three_learning_rate_acc}}
\end{figure*}
\section{Hyperparameter Optimization Experiments}
In this section we present our hyperparameter optimization experiments. Our experiments consider a setting where hyperparameters have a large effect on performance: a convolutional neural network for text classification \citep{cnn_for_text}. The task is binary sentiment analysis on the Stanford sentiment treebank \citep{stanford_sentiment}. On this balanced dataset, random guessing leads to 50\% accuracy. We use the CNN-non-static model from \citet{cnn_for_text}, with skip-gram \citep{word2vec} vectors. The model architecture consists of a convolutional layer, a max-over-time pooling layer, then a fully connected layer leading to a softmax. All $k$-DPP samples are drawn using Algorithm \ref{alg:mixed_mcmc}.
\subsection{Simple tree-structured space}\label{sec:learn_rate_exp}
We begin with a search over three continuous hyperparameters and one binary hyperparameter, with a simple tree structure: the binary hyperparameter indicates whether or not the model will use $L_2$ regularization, and one of the continuous hyperparameters is the regularization strength. We assume a budget of $k=20$ evaluations by training the convolutional neural net. $L_2$ regularization strengths in the range $[e^{-5}, e^{-1}]$ (or no regularization) and dropout rates in $[0.0, 0.7]$ are considered. We consider three increasingly ``easy'' ranges for the learning rate:
\begin{itemize}
\item Hard: $[e^{-5}, e^5]$, where the majority of the range leads to accuracy no better than chance.
\item Medium: $[e^{-5}, e^{-1}]$, where half of the range leads to accuracy no better than chance.
\item Easy: $[e^{-10}, e^{-3}]$, where the entire range leads to models that beat chance.
\end{itemize}
Figure~\ref{fig:three_learning_rate_acc} shows the accuracy (averaged over 50 runs) of the best model found after exploring 1, 2, \ldots, $k$ hyperparameter settings. We see that $k$-DPP-RBF finds better models with fewer iterations necessary than the other approaches, especially in the most difficult case. Figure~\ref{fig:three_learning_rate_acc} compares the sampling methods against a Bayesian optimization technique using a tree-structured Parzen estimator \citep[BO-TPE;][]{bo_algos}. This technique evaluates points sequentially, allowing the model to choose the next point based on how well previous points performed (a closed loop approach). It is state-of-the-art on tree-structured search spaces (though its sequential nature limits parallelization). Surprisingly, we find it performs the worst, even though it takes advantage of additional information. We hypothesize that the exploration/exploitation tradeoff in BO-TPE causes it to commit to more local search before exploring the space fully, thus not finding hard-to-reach global optima.
Note that when considering points sampled uniformly or from a DPP, the order of the $k$ hyperparameter settings in one trial is arbitrary (though this is not the case with BO-TPE as it is an iterative algorithm).
In all cases the variance of the best of the $k$ points is lower than when sampled uniformly, and the differences in the plots are all significant with $p<0.01$.
\subsection{Optimizing within ranges known to be good}\label{sec:known_good}
\citet{sensitivity} analyzed the stability of convolutional neural networks for sentence classification with respect to a large set of hyperparameters, and found a set of six which they claimed had the largest impact: the number of kernels, the difference in size between the kernels, the size of each kernel, dropout, regularization strength, and the number of filters. We optimized over their prescribed ``Stable'' ranges for three open loop methods and one closed loop method; average accuracies with 95 percent confidence intervals from 50 trials of hyperparameter optimization are shown in Figure~\ref{fig:known_good}, across $k= 5,10,15,20$ iterations. We find that even when optimizing over a space for which all values lead to good models, $k$-DPP-RBF outperforms the other methods.
Our experiments reveal that, while the hyperparameters proposed by \citet{sensitivity}, can have an effect, the learning rate, which they do not analyze, is at least as impactful.
\begin{figure}[t]
\centering
\includegraphics[width=250pt]{known_good_range.pdf}
\caption{Average best-found model accuracy by iteration when training a convolutional neural network on the ``Stable'' search space (defined in Section~\ref{sec:known_good}), averaged across 50 trials of hyperparameter optimization, with $k=5,10,15,20$, with 95 percent confidence intervals. The $k$-DPP-RBF outperforms uniform sampling, TPE, and the Sobol sequence.
\label{fig:known_good}}
\end{figure}
\subsection{Wall clock time comparison with Spearmint}
Here we compare our approach against Spearmint \citep{practical_bo}, perhaps the most popular Bayesian optimization package. Figure \ref{fig:wall_time} shows wall clock time and accuracy for 25 runs on the ``Stable'' search space of four hyperparameter optimization approaches: $k$-DPP-RBF (with $k=20$), batch Spearmint with 2 iterations of batch size 10, batch Spearmint with 10 iterations of batch size 2, and sequential Spearmint\footnote{When in the fully parallel, open loop setting, Spearmint simply returns the Sobol sequence.}. Each point in the plot is one hyperparameter assignment evaluation. The vertical lines represent how long, on average, it takes to find the best result in one run. We see that all evaluations for $k$-DPP-RBF finish quickly, while even the fastest batch method (2 batches of size 10) takes nearly twice as long on average to find a good result. The final average best-found accuracies are 82.61 for $k$-DPP-RBF, 82.65 for Spearmint with 2 batches of size 10, 82.7 for Spearmint with 10 batches of size 2, and 82.76 for sequential Spearmint. Thus, we find it takes on average more than ten times as long for sequential Spearmint to find its best solution, for a gain of only 0.15 percent accuracy.
\begin{figure}[t]
\centering
\includegraphics[width=250pt]{wall_clock_time.pdf}
\caption{Wall clock time (in seconds, x-axis) for 25 hyperparameter trials of hyperparameter optimization (each with $k=20$) on the ``Stable'' search space define in Section~\ref{sec:known_good}. The vertical lines represent the average time it takes too find the best hyperparameter assignment in a trial.
\label{fig:wall_time}}
\end{figure}
\section{Conclusions}
We have explored open loop hyperparameter optimization built on sampling from a $k$-DPP. We described how to define a $k$-DPP over hyperparameter search spaces, and showed that $k$-DPPs retain the attractive parallelization capabilities of random search. In synthetic experiments, we showed $k$-DPP samples perform well on a number of important metrics, even for large values of $k$. In hyperprameter optimization experiments, we see $k$-DPP-RBF outperform other open loop methods. Additionally, we see that sequential methods, even when using more than ten times as much wall clock time, gain less than 0.16 percent accuracy on a particular hyperparameter optimization problem. An open-source implementation of our method is available.
\section{Submission of conference papers to ICLR 2019}
ICLR requires electronic submissions, processed by
\url{https://openreview.net/}. See ICLR's website for more instructions.
If your paper is ultimately accepted, the statement {\tt
{\textbackslash}iclrfinalcopy} should be inserted to adjust the
format to the camera ready requirements.
The format for the submissions is a variant of the NIPS format.
Please read carefully the instructions below, and follow them
faithfully.
\subsection{Style}
Papers to be submitted to ICLR 2019 must be prepared according to the
instructions presented here.
Authors are required to use the ICLR \LaTeX{} style files obtainable at the
ICLR website. Please make sure you use the current files and
not previous versions. Tweaking the style files may be grounds for rejection.
\subsection{Retrieval of style files}
The style files for ICLR and other conference information are available on the World Wide Web at
\begin{center}
\url{http://www.iclr.cc/}
\end{center}
The file \verb+iclr2019_conference.pdf+ contains these
instructions and illustrates the
various formatting requirements your ICLR paper must satisfy.
Submissions must be made using \LaTeX{} and the style files
\verb+iclr2019_conference.sty+ and \verb+iclr2019_conference.bst+ (to be used with \LaTeX{}2e). The file
\verb+iclr2019_conference.tex+ may be used as a ``shell'' for writing your paper. All you
have to do is replace the author, title, abstract, and text of the paper with
your own.
The formatting instructions contained in these style files are summarized in
sections \ref{gen_inst}, \ref{headings}, and \ref{others} below.
\section{General formatting instructions}
\label{gen_inst}
The text must be confined within a rectangle 5.5~inches (33~picas) wide and
9~inches (54~picas) long. The left margin is 1.5~inch (9~picas).
Use 10~point type with a vertical spacing of 11~points. Times New Roman is the
preferred typeface throughout. Paragraphs are separated by 1/2~line space,
with no indentation.
Paper title is 17~point, in small caps and left-aligned.
All pages should start at 1~inch (6~picas) from the top of the page.
Authors' names are
set in boldface, and each name is placed above its corresponding
address. The lead author's name is to be listed first, and
the co-authors' names are set to follow. Authors sharing the
same address can be on the same line.
Please pay special attention to the instructions in section \ref{others}
regarding figures, tables, acknowledgments, and references.
\section{Headings: first level}
\label{headings}
First level headings are in small caps,
flush left and in point size 12. One line space before the first level
heading and 1/2~line space after the first level heading.
\subsection{Headings: second level}
Second level headings are in small caps,
flush left and in point size 10. One line space before the second level
heading and 1/2~line space after the second level heading.
\subsubsection{Headings: third level}
Third level headings are in small caps,
flush left and in point size 10. One line space before the third level
heading and 1/2~line space after the third level heading.
\section{Citations, figures, tables, references}
\label{others}
These instructions apply to everyone, regardless of the formatter being used.
\subsection{Citations within the text}
Citations within the text should be based on the \texttt{natbib} package
and include the authors' last names and year (with the ``et~al.'' construct
for more than two authors). When the authors or the publication are
included in the sentence, the citation should not be in parenthesis (as
in ``See \citet{Hinton06} for more information.''). Otherwise, the citation
should be in parenthesis (as in ``Deep learning shows promise to make progress towards AI~\citep{Bengio+chapter2007}.'').
The corresponding references are to be listed in alphabetical order of
authors, in the \textsc{References} section. As to the format of the
references themselves, any style is acceptable as long as it is used
consistently.
\subsection{Footnotes}
Indicate footnotes with a number\footnote{Sample of the first footnote} in the
text. Place the footnotes at the bottom of the page on which they appear.
Precede the footnote with a horizontal rule of 2~inches
(12~picas).\footnote{Sample of the second footnote}
\subsection{Figures}
All artwork must be neat, clean, and legible. Lines should be dark
enough for purposes of reproduction; art work should not be
hand-drawn. The figure number and caption always appear after the
figure. Place one line space before the figure caption, and one line
space after the figure. The figure caption is lower case (except for
first word and proper nouns); figures are numbered consecutively.
Make sure the figure caption does not get separated from the figure.
Leave sufficient space to avoid splitting the figure and figure caption.
You may use color figures.
However, it is best for the
figure captions and the paper body to make sense if the paper is printed
either in black/white or in color.
\begin{figure}[h]
\begin{center}
\fbox{\rule[-.5cm]{0cm}{4cm} \rule[-.5cm]{4cm}{0cm}}
\end{center}
\caption{Sample figure caption.}
\end{figure}
\subsection{Tables}
All tables must be centered, neat, clean and legible. Do not use hand-drawn
tables. The table number and title always appear before the table. See
Table~\ref{sample-table}.
Place one line space before the table title, one line space after the table
title, and one line space after the table. The table title must be lower case
(except for first word and proper nouns); tables are numbered consecutively.
\begin{table}[t]
\caption{Sample table title}
\label{sample-table}
\begin{center}
\begin{tabular}{ll}
\multicolumn{1}{c}{\bf PART} &\multicolumn{1}{c}{\bf DESCRIPTION}
\\ \hline \\
Dendrite &Input terminal \\
Axon &Output terminal \\
Soma &Cell body (contains cell nucleus) \\
\end{tabular}
\end{center}
\end{table}
\section{Default Notation}
In an attempt to encourage standardized notation, we have included the
notation file from the textbook, \textit{Deep Learning}
\cite{goodfellow2016deep} available at
\url{https://github.com/goodfeli/dlbook_notation/}. Use of this style
is not required and can be disabled by commenting out
\texttt{math\_commands.tex}.
\centerline{\bf Numbers and Arrays}
\bgroup
\def1.5{1.5}
\begin{tabular}{p{1in}p{3.25in}}
$\displaystyle a$ & A scalar (integer or real)\\
$\displaystyle {\bm{a}}$ & A vector\\
$\displaystyle {\bm{A}}$ & A matrix\\
$\displaystyle {\tens{A}}$ & A tensor\\
$\displaystyle {\bm{I}}_n$ & Identity matrix with $n$ rows and $n$ columns\\
$\displaystyle {\bm{I}}$ & Identity matrix with dimensionality implied by context\\
$\displaystyle {\bm{e}}^{(i)}$ & Standard basis vector $[0,\dots,0,1,0,\dots,0]$ with a 1 at position $i$\\
$\displaystyle \text{diag}({\bm{a}})$ & A square, diagonal matrix with diagonal entries given by ${\bm{a}}$\\
$\displaystyle {\textnormal{a}}$ & A scalar random variable\\
$\displaystyle {\mathbf{a}}$ & A vector-valued random variable\\
$\displaystyle {\mathbf{A}}$ & A matrix-valued random variable\\
\end{tabular}
\egroup
\vspace{0.25cm}
\centerline{\bf Sets and Graphs}
\bgroup
\def1.5{1.5}
\begin{tabular}{p{1.25in}p{3.25in}}
$\displaystyle {\mathbb{A}}$ & A set\\
$\displaystyle \mathbb{R}$ & The set of real numbers \\
$\displaystyle \{0, 1\}$ & The set containing 0 and 1 \\
$\displaystyle \{0, 1, \dots, n \}$ & The set of all integers between $0$ and $n$\\
$\displaystyle [a, b]$ & The real interval including $a$ and $b$\\
$\displaystyle (a, b]$ & The real interval excluding $a$ but including $b$\\
$\displaystyle {\mathbb{A}} \backslash {\mathbb{B}}$ & Set subtraction, i.e., the set containing the elements of ${\mathbb{A}}$ that are not in ${\mathbb{B}}$\\
$\displaystyle {\mathcal{G}}$ & A graph\\
$\displaystyle \parents_{\mathcal{G}}({\textnormal{x}}_i)$ & The parents of ${\textnormal{x}}_i$ in ${\mathcal{G}}$
\end{tabular}
\vspace{0.25cm}
\centerline{\bf Indexing}
\bgroup
\def1.5{1.5}
\begin{tabular}{p{1.25in}p{3.25in}}
$\displaystyle {a}_i$ & Element $i$ of vector ${\bm{a}}$, with indexing starting at 1 \\
$\displaystyle {a}_{-i}$ & All elements of vector ${\bm{a}}$ except for element $i$ \\
$\displaystyle {A}_{i,j}$ & Element $i, j$ of matrix ${\bm{A}}$ \\
$\displaystyle {\bm{A}}_{i, :}$ & Row $i$ of matrix ${\bm{A}}$ \\
$\displaystyle {\bm{A}}_{:, i}$ & Column $i$ of matrix ${\bm{A}}$ \\
$\displaystyle {\etens{A}}_{i, j, k}$ & Element $(i, j, k)$ of a 3-D tensor ${\tens{A}}$\\
$\displaystyle {\tens{A}}_{:, :, i}$ & 2-D slice of a 3-D tensor\\
$\displaystyle {\textnormal{a}}_i$ & Element $i$ of the random vector ${\mathbf{a}}$ \\
\end{tabular}
\egroup
\vspace{0.25cm}
\centerline{\bf Calculus}
\bgroup
\def1.5{1.5}
\begin{tabular}{p{1.25in}p{3.25in}}
$\displaystyle\frac{d y} {d x}$ & Derivative of $y$ with respect to $x$\\ [2ex]
$\displaystyle \frac{\partial y} {\partial x} $ & Partial derivative of $y$ with respect to $x$ \\
$\displaystyle \nabla_{\bm{x}} y $ & Gradient of $y$ with respect to ${\bm{x}}$ \\
$\displaystyle \nabla_{\bm{X}} y $ & Matrix derivatives of $y$ with respect to ${\bm{X}}$ \\
$\displaystyle \nabla_{\tens{X}} y $ & Tensor containing derivatives of $y$ with respect to ${\tens{X}}$ \\
$\displaystyle \frac{\partial f}{\partial {\bm{x}}} $ & Jacobian matrix ${\bm{J}} \in \mathbb{R}^{m\times n}$ of $f: \mathbb{R}^n \rightarrow \mathbb{R}^m$\\
$\displaystyle \nabla_{\bm{x}}^2 f({\bm{x}})\text{ or }{\bm{H}}( f)({\bm{x}})$ & The Hessian matrix of $f$ at input point ${\bm{x}}$\\
$\displaystyle \int f({\bm{x}}) d{\bm{x}} $ & Definite integral over the entire domain of ${\bm{x}}$ \\
$\displaystyle \int_{\mathbb{S}} f({\bm{x}}) d{\bm{x}}$ & Definite integral with respect to ${\bm{x}}$ over the set ${\mathbb{S}}$ \\
\end{tabular}
\egroup
\vspace{0.25cm}
\centerline{\bf Probability and Information Theory}
\bgroup
\def1.5{1.5}
\begin{tabular}{p{1.25in}p{3.25in}}
$\displaystyle P({\textnormal{a}})$ & A probability distribution over a discrete variable\\
$\displaystyle p({\textnormal{a}})$ & A probability distribution over a continuous variable, or over
a variable whose type has not been specified\\
$\displaystyle {\textnormal{a}} \sim P$ & Random variable ${\textnormal{a}}$ has distribution $P$\\% so thing on left of \sim should always be a random variable, with name beginning with \r
$\displaystyle \mathbb{E}_{{\textnormal{x}}\sim P} [ f(x) ]\text{ or } \mathbb{E} f(x)$ & Expectation of $f(x)$ with respect to $P({\textnormal{x}})$ \\
$\displaystyle \mathrm{Var}(f(x)) $ & Variance of $f(x)$ under $P({\textnormal{x}})$ \\
$\displaystyle \mathrm{Cov}(f(x),g(x)) $ & Covariance of $f(x)$ and $g(x)$ under $P({\textnormal{x}})$\\
$\displaystyle H({\textnormal{x}}) $ & Shannon entropy of the random variable ${\textnormal{x}}$\\
$\displaystyle D_{\mathrm{KL}} ( P \Vert Q ) $ & Kullback-Leibler divergence of P and Q \\
$\displaystyle \mathcal{N} ( {\bm{x}} ; {\bm{\mu}} , {\bm{\Sigma}})$ & Gaussian distribution %
over ${\bm{x}}$ with mean ${\bm{\mu}}$ and covariance ${\bm{\Sigma}}$ \\
\end{tabular}
\egroup
\vspace{0.25cm}
\centerline{\bf Functions}
\bgroup
\def1.5{1.5}
\begin{tabular}{p{1.25in}p{3.25in}}
$\displaystyle f: {\mathbb{A}} \rightarrow {\mathbb{B}}$ & The function $f$ with domain ${\mathbb{A}}$ and range ${\mathbb{B}}$\\
$\displaystyle f \circ g $ & Composition of the functions $f$ and $g$ \\
$\displaystyle f({\bm{x}} ; {\bm{\theta}}) $ & A function of ${\bm{x}}$ parametrized by ${\bm{\theta}}$.
(Sometimes we write $f({\bm{x}})$ and omit the argument ${\bm{\theta}}$ to lighten notation) \\
$\displaystyle \log x$ & Natural logarithm of $x$ \\
$\displaystyle \sigma(x)$ & Logistic sigmoid, $\displaystyle \frac{1} {1 + \exp(-x)}$ \\
$\displaystyle \zeta(x)$ & Softplus, $\log(1 + \exp(x))$ \\
$\displaystyle || {\bm{x}} ||_p $ & $L^p$ norm of ${\bm{x}}$ \\
$\displaystyle || {\bm{x}} || $ & $L^2$ norm of ${\bm{x}}$ \\
$\displaystyle x^+$ & Positive part of $x$, i.e., $\max(0,x)$\\
$\displaystyle \bm{1}_\mathrm{condition}$ & is 1 if the condition is true, 0 otherwise\\
\end{tabular}
\egroup
\vspace{0.25cm}
\section{Final instructions}
Do not change any aspects of the formatting parameters in the style files.
In particular, do not modify the width or length of the rectangle the text
should fit into, and do not change font sizes (except perhaps in the
\textsc{References} section; see below). Please note that pages should be
numbered.
\section{Preparing PostScript or PDF files}
Please prepare PostScript or PDF files with paper size ``US Letter'', and
not, for example, ``A4''. The -t
letter option on dvips will produce US Letter files.
Consider directly generating PDF files using \verb+pdflatex+
(especially if you are a MiKTeX user).
PDF figures must be substituted for EPS figures, however.
Otherwise, please generate your PostScript and PDF files with the following commands:
\begin{verbatim}
dvips mypaper.dvi -t letter -Ppdf -G0 -o mypaper.ps
ps2pdf mypaper.ps mypaper.pdf
\end{verbatim}
\subsection{Margins in LaTeX}
Most of the margin problems come from figures positioned by hand using
\verb+\special+ or other commands. We suggest using the command
\verb+\includegraphics+
from the graphicx package. Always specify the figure width as a multiple of
the line width as in the example below using .eps graphics
\begin{verbatim}
\usepackage[dvips]{graphicx} ...
\includegraphics[width=0.8\linewidth]{myfile.eps}
\end{verbatim}
or
\begin{verbatim}
\usepackage[pdftex]{graphicx} ...
\includegraphics[width=0.8\linewidth]{myfile.pdf}
\end{verbatim}
for .pdf graphics.
See section~4.4 in the graphics bundle documentation (\url{http://www.ctan.org/tex-archive/macros/latex/required/graphics/grfguide.ps})
A number of width problems arise when LaTeX cannot properly hyphenate a
line. Please give LaTeX hyphenation hints using the \verb+\-+ command.
\subsubsection*{Acknowledgments}
Use unnumbered third level headings for the acknowledgments. All
acknowledgments, including those to funding agencies, go at the end of the paper.
| {'timestamp': '2019-05-10T02:05:47', 'yymm': '1706', 'arxiv_id': '1706.01566', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01566'} | arxiv |
\section{Introduction}\label{sec:introduction}}
\section{Introduction}
\label{sec:introduction}
\IEEEPARstart{S}{oftware} testing \cite{ammann2008introduction} is an important activity used for verification and validation by observing the software, executed using a set of test inputs. In practice, engineers are creating these inputs based on different test goals and test design techniques (e.g., specification-based, random, combinatorial, code coverage-based). These techniques have so far been performed manually or semi-automatically with respect to distinct software development activities (i.e, unit and integration testing). With the emerging use of large complex software products, the traditional way of testing software has changed; engineers need to deliver high-quality software while devoting less time for properly testing the software.
In practice, test suites are still created manually by handcrafting them using specific test design techniques and domain-specific experience. Although the automatic or semi-automatic creation of test suites has been the focus of a great deal of research, manual testing is still widely used \cite{andersson2002verification,beer2008role} in the software development industry. However, over the past few decades, several test design techniques \cite{ammann2008introduction} have been proposed for the creation of test suites with less effort. Combinatorial testing \cite{cohen1996combinatorial} is a technique that creates test inputs based on combinations among the input values. Pairwise testing is an approach to combinatorial testing that generates a test suite which covers each combination of value pairs at least once. There is some evidence\cite{borazjany2012combinatorial, hagar2015introducing} suggesting that pairwise testing is efficient and effective at detecting software faults. However, even if pairwise techniques have been found useful and applicable in industrial applications, the experimental evidence regarding its effectiveness in practice is still limited.
In this paper we compare pairwise testing and manual testing performed by industrial engineers on industrial software created using the {{\sc IEC 61131-3}} programming language \cite{international3iec} that runs on Programmable Logic Controllers (PLCs). The paper makes the following contributions:
\begin{itemize}
\item Empirical evidence showing that pairwise testing achieves marginally lower levels of code coverage while in the same time using more tests cases on average than manual testing performed by industrial engineers.
\item Results showing that manual testing is not significantly better at finding faults than pairwise testing. Our paper suggests that pairwise testing is just as good in fault detection as manual testing for 64\% of the programs considered.
\item A discussion of the implications of these results for test engineers and researchers.
\end{itemize}
\section{Background}
\label{sec:background}
This paper describes a case study evaluating pairwise testing when used on PLC industrial programs implemented in the IEC 61131-3 FBD language. In this section, we provide a background on PLC industrial software and pairwise testing. According to Ammann and Offutt \cite{ammann2008introduction}, a test case is a set of inputs, expected outputs and actual outputs executed on the specified program. A test suite is a set of ordered test cases. Throughout the paper, we will use the terms test case and test suite in this way.
\subsection{Programmable Logic Controllers}
\label{subsec:plc}
A Programmable Logic Controller (PLC) is a computer system containing a processor, a memory, and a communication bus. PLCs \cite{lewis1998programming} have a programmable memory for storing the software used for expressing logical behaviour, timing and input/output control, networking and data processing. Safety-critical industrial systems implemented using PLCs are used in many applications \cite{parnas1990evaluation} such as transportation, robotics, nuclear and pharmaceutical. Software running on a PLC execute in a loop called scan cycle, in which the iteration follows the “read-execute-write” semantics. The PLC reads the input signals, computes the logical behaviour without interruption and updates its output signals \cite{donandt1989improving}.
\begin{figure}
\includegraphics[width=\columnwidth]{figures/new_fbd.pdf}
\caption{A PLC program with seven inputs and three outputs written
using the FBD IEC 61131-3 programming language.}
\label{figure:fbd}
\end{figure}
Programming a PLC differs from general-purpose computers; the PLC software follows a standardized programming paradigm: the IEC (International Electronical Commission) 61131-3 standard \cite{international3iec}. IEC 61131-3 is a popular programming language standard for PLCs used in industrial practice. As shown in Figure \ref{figure:fbd}, computational blocks in an IEC 61131-3 program can be represented in a Function Block Diagram (FBD). This program contains
predefined logical and/or stateful blocks (i.e., OR, RS, TOF, GE, AND and TON in Figure \ref{figure:fbd}) and signals (i.e., connections) between blocks representing the whole behavior of an FBD program. PLC software contains a particular type of blocks named timers that are used to activate or deactivate an output signal after a specific time interval ~\cite{lewis1998programming}. A timer block (e.g., TON and TOF in Figure \ref{figure:fbd}) keeps track of the number of times its input is either true or false and outputs different signals. The IEC 61131-3 standard contains four other programming languages: Instruction List (IL), Structured Text (ST), Ladder Diagram (LD) and Sequential Function Chart (SFC)~\cite{bolton2015programmable}. For more details on PLC programming and FBDs we refer the reader to the work of John et al. \cite{john2010iec}.
\subsection{Pairwise Testing}
\label{subsec:auto}
The process of test generation is that of finding suitable test inputs
using a certain test goal that guides the search in an algorithmic way \cite{ammann2008introduction}. Many algorithms and techniques \cite{orso2014software} for test generation have been proposed. One such technique is combinatorial testing which is used to reveal faults
caused by interactions between input parameters inside a software program. Such techniques design test cases by combining different input parameters based on a combinatorial strategy. Grindal et al. \cite{grindal2006evaluation} surveyed several strategies used for combinatorial testing (e.g., each-used, pair-wise, t-wise, base choice). One of the most commonly used strategy is pairwise (also known as two-way) testing in which each combination for all possible pairs of input parameters are covered by at least one test case. Several empirical studies \cite{borazjany2012combinatorial, hagar2015introducing,li2016applying,grindal2006evaluation} on the use of combinatorial testing for industrial software have been reported and showed that pairwise testing is a very effective technique. In this paper we seek to investigate the use of pairwise testing for industrial control software and compare this technique with manual testing performed by industrial engineers.
\section{Related Work}
Most studies concerning pairwise testing and related to the work included in this paper have focused on how to generate tests as quickly as possible, measure the code coverage score and/or compare with other combinatorial criteria \cite{grindal2006evaluation} or with random tests \cite{ghandehari2014empirical,schroeder2004comparing}. For example, Cohen et al.~\cite{cohen1996combinatorial} found that pairwise generated test suites can achieve 90\% block code coverage. These test suites where generated by the AETG tool. The same tool was used by Burr and Young~\cite{burr1998combinatorial} in a different study. In this paper, pairwise testing achieved 93\% block coverage on average. In addition, Vilkomir and Anderson~\cite{vilkomir2015relationship} showed that pairwise test suites could achieve 77\% MC/DC code coverage.
Other studies \cite{cohen1994automatic,dalal1998model,sampath2012improving} have reported the use of pairwise testing on real systems and how it can help in the detection of additional bugs when compared to standard test techniques. On the other hand, a few other studies compared manual with pairwise testing \cite{ellims2008effectiveness,ellims2007aetg} and the results suggest that pairwise testing is not able to detect more faults than manually created tests. These results encouraged our interest in investigating on a larger case study how manual testing performed by industrial engineers compares to pairwise testing for industrial software systems. Is there any compelling evidence on how pairwise test suites compare with rigorously handcrafted test suites in terms of test effectiveness?
\begin{figure*}[!ht]
\vspace{-30mm}
\centering
\includegraphics[width=0.65\linewidth]{figures/new_design.pdf}
\caption[Methodology overview]{Overview of the experimental method used to perform the case study. For each program in the Train Control Management System (TCMS), test suites are created manually by industrial engineers, generated by {\ctt} for pairwise testing, and executed on both the original and the mutated programs in order to collect scores for code coverage, mutation and number of tests.}
\label{figure:methodology}
\end{figure*}
\section{Method}
\label{sec:method}
The goal of this paper is to study the comparison between manual test suites created by industrial engineers and automatically generated test suites using a generation tool for pairwise testing in terms of efficiency and effectiveness of testing. To achieve this goal, we designed a case study (mirrored in Figure \ref{figure:methodology}) using industrial software programs from an already developed train control management system to answer the following research questions:
\begin{itemize}
\item {\it RQ1: Are pairwise generated test suites able to cover more code than test suites manually created by industrial engineers?}
\item {\it RQ2: Are pairwise generated test suites able to detect more faults than test suites manually created by industrial engineers?}
\item {\it RQ3: Is the size of pairwise generated test suites smaller than those manually created by industrial engineers?}
\end{itemize}
For each selected program, we executed the test suites produced by both manual testing and pairwise testing and collected the following measures: branch coverage in terms of achieved code coverage, the number of generated test cases and the mutation score as a proxy for fault detection. In order to calculate the mutation score, each test suite was executed on the mutated versions of the original program to determine whether it detects the injected fault.
This section describes the design of our case study, including the subject programs, the evaluation metrics and the test generation and selection.
\subsection{Subject Programs}
\label{subsec:sut}
Our case study uses an industrial safety-critical system developed by Bombardier Transportation Sweden AB, a large-scale company developing and manufacturing railway equipment. The system is a train control management software ({\sc TCMS}) that has been in development for several years and is tested according to safety standards and regulations. TCMS is a control system containing both software and hardware components in charge of the safety-related functionality of the train and is used by Bombardier Transportation Sweden AB for the control and communication functions in high speed trains. These functions are developed as software programs for PLCs using the Function Block Diagram (FBD) {{\sc IEC 61131-3}} graphical programming language \cite{international3iec}. Programs in TCMS are developed in a graphical development environment, compiled into PLC code and saved in standardized PLCOpen XML \footnote{http://www.plcopen.org/} containing structural and behavioural declarations.
We selected the subject programs for our case study by investigating the TCMS programs provided by Bombardier Transportation Sweden AB. We identified 53 programs and excluded eight programs due to the following reasons: one program contained only one input parameter, for another program the test generation got a memory exception, while for the six remaining programs the test execution failed due to wrong parameter ranges that resulted in an execution exception. Our final set of subjects contains 45 programs. These programs contain nine input parameters and 1076 Lines of XML Source Code (LOC) on average per program. The studied programs were already thoroughly manually tested and are currently used in an operational train.
\subsection{Test Case Creation}
\label{subsec:testcase}
We used manual test suites created by industrial engineers working at Bombardier Transportation Sweden AB. These manual test suites were obtained by using a post-mortem analysis of the data provided. In testing these programs, engineers perform testing according to specific safety standards and regulations. Specification-based testing is used by engineers to manually create test suites as this is mandated by the EN50128 standard \cite{en200150128}. The test suites collected in this study were based on functional requirement specifications written in a natural language.
In addition, we generate pairwise test suites using {\ctt} \cite{peter_2017_439253}. {\ctt} is the only available combinatorial test suite generation tool for {{\sc IEC 61131-3}} control software. {\ctt} is open source
software and is available at https://github.com/CharByte/SEAFOX \footnote{For more details on the {\ctt} tool we refer the reader to the work of Charbachi and Eklund \cite{thesischa}.}.
{\ctt} supports the generation of test suites using pairwise, base choice and random strategies. For pairwise generation, {\ctt} uses the IPOG algorithm as well as a first pick tie breaker\cite{lei2008ipog}. {\ctt} was used in this study as it supports as input a standard PLCOpen XML implementation of the programs.
A developer using {\ctt} can automatically generate test suites needed for a given {{\sc IEC 61131-3}} program after manually providing the input parameter range information based on the defined behaviour written in the specification.
In order to collect realistic data, we asked one test engineer from Bombardier Transportation, responsible for testing {{\sc IEC 61131-3}} software used in this study, to identify the range values for each input parameters and constraints. We used these predetermined input parameter ranges for each program variable for generating pairwise test suites using {\ctt} in order to maintain the same input model as the one used to create manual test suites.
\subsection{Evaluation Measurements}
\label{subsec:measurements}
In this section, we present how the case study is conducted with respect to each research question. We first discuss the evaluation measurements used for efficiency and effectiveness of testing.
\subsubsection*{Code Coverage} We use code coverage criteria to assess the test suites thoroughness \cite{ammann2008introduction} and answer RQ1. These coverage criteria are used to evaluate the extent to which the program has been exercised by a certain test suite. In this study, code coverage is directly measured using the branch coverage criterion. For the programs selected in this study the EN50128 safety standard \cite{en200150128} involves achieving high branch coverage. A test suite achieves 100\% branch coverage if executing the program causes each branch in the {{\sc IEC 61131-3}} program to have the value \emph{true} and \emph{false} at least once. A branch coverage score was obtained for each generated test suite using our own tool implementation based on the PLC execution framework provided by Bombardier Transportation Sweden AB.
\subsubsection*{Fault Detection} Ideally, in order to measure fault detection, real faulty versions of the programs are required. In our case, the data provided did not contain any information about what faults occurred during the testing of these programs. To overcome this issue and answer RQ2, we used mutation analysis by generating faulty versions of the original programs. Mutation analysis is a method of automatically creating artificial faulty versions of a program in order to examine the fault detection ability of a test suite \cite{ammann2008introduction}. A \textit{mutant} is a different version of the original program containing a small syntactical change. For example, in an {{\sc IEC 61131-3}} program, a mutant is created by replacing a constant value with another one, negating a signal or changing the type of a computational block. If the execution of the resulting mutant on a test is producing a different output as the execution of the original program, the test suite \textit{detects} the mutant. The mutation score is computed using an output-only verdict (i.e., using the expected values for all of the program outputs) against the set of mutants. The fault detection capability of each test suite was calculated as the ratio of mutants detected to the total number of mutants. Just et al. \cite{just2014mutants} provided compelling experimental evidence that the mutation score is a proxy for real fault detection.
In the creation of mutants we used common type of faults in {{\sc IEC 61131-3}} software \cite{oh2005software} as a basis for establishing the following mutation operators:
\begin{itemize}
\item {\it Logic Block Replacement}. Replacing a logical block with another block from the same category (e.g., an OR block is replaced by an AND block).
\item {\it Comparison Block Replacement}. Replacing a comparison block with another block from the same category (e.g., a Greater-Or-Equal (GE) block is replaced by a Greater-Than (GT) block).
\item {\it Arithmetic Block Replacement}. Replacing an arithmetic block with another block from the same category (e.g., replacing a maximum calculation block (MAX) with a minimum calculation block (MIN)).
\item {\it Negation Insertion}. Negating an input or output connection (e.g., an output boolean connection is negated).
\item {\it Value Replacement}. Replacing a value of a constant variable connected to a block (e.g., a constant variable is replaced by its boundary values).
\item {\it Timer Block Replacement}. Replacing a timer block with another block from the same function category (e.g., a Timer-On (TON) block is replaced by a Timer-Off (TOF) block).
\end{itemize}
Each of the mutation operators were applied to each program element. In total, for all of the selected programs, 1597 mutants were generated (i.e., 35 mutants on average per program). A mutant was considered detected by a test suite if the output from the mutated program differed from that of the original program. A mutation score was obtained for each generated test using our own tool implementation.
\begin{figure*}[tbp]
\centering\resizebox{\textwidth}{!}{
\includegraphics[width=0.3\textwidth]{figures/code_coverage_noRand}
\includegraphics[width=0.3\textwidth]{figures/mutation_score_noRand}
\includegraphics[width=0.3\textwidth]{figures/size_testsuite_log}
}
\vspace*{-1cm}
\caption[Box plots]{Code Coverage, mutation score and number of test cases comparison between manually handcrafted test suites (Manual) and test suites generated using pairwise testing (Pairwise); boxes span from 1st to 3rd quartile with black middle lines marking the median and the whiskers extending up to 1.5x the inter-quartile range; the circle symbols represent the outliers.}
\label{figure:boxplots}
\end{figure*}
\begin{figure*}[tbp]
\centering
\resizebox{\textwidth}{!}{
\includegraphics[height=4cm]{figures/pie_code}
\hspace{0.7cm}
\includegraphics[height=4cm]{figures/pie_mutation}
\hspace{0.8cm}
\includegraphics[height=4cm]{figures/pie_tests}
}
\caption[Manual and Pairwise test suite comparison]{Charts of number of tests, code coverage and mutation scores depicting how each technique (M stands for manual testing and P is short for pairwise testing) compared to the other for each measure. M$>$P indicates that manual testing achieved a higher measurement score, M$<$P shows how many times manual testing achieved a lower measurement score and M$=$P shows when both techniques achieve the same measurement score.
\label{figure:caseEval}
\end{figure*}
\subsubsection*{Number of Tests} In an ideal situation, the cost of testing is measured by taking into account direct and indirect type of cost, by measuring directly the test suite creation, the test suite execution and the checking of test suite results. However, since this is a case study using programs for which the development was performed a few years back, this kind of cost data was not available. To answer RQ3, we used the number of created test cases as a proxy for efficiency as we assume that all human costs are depended on the number of tests. The higher the number of tests, the higher are the respective testing costs. For example, a complex program will require more effort for test creation, execution and checking of the results.
\section{Experimental Results}
\label{sec:results}
In this section, we quantitatively answer the three research questions posed in Section \ref{sec:method}. We collected the data to answer these research questions by generating test suites for pairwise testing using {\ctt}; collecting manual test suites created by experienced industrial engineers; measuring their code coverage; and measuring their effectiveness in terms of mutation score. The overall results of this study are summarized in the form of boxplots in Figure \ref{figure:boxplots}. In Tables \ref{table:codeCoverage}, \ref{table:mutationScore} and \ref{table:testsuiteSize} we present the code coverage scores, mutation scores and the number of tests in each test suite by listing the standard deviation, mean, median, minimum and maximum values. In addition, statistical analysis was performed using the R statistical software \footnote{https://www.r-project.org/}. We assume that the collected data is drawn from an unknown distribution. In order to evaluate if there is any statistical difference between manual and pairwise testing we use a Wilcoxon-Man-Whitney U-test\cite{howell2012statistical}, a non-parametric hypothesis test used for checking if two data samples are randomly obtained from identical populations. We also use the Vargha-Delaney test (also known as the standardized effect size) to calculate the statistical significance. The Vargha-Delaney $\hat{A}$-measure is also "\textit{a measure of stochastic superiority}"\cite{vargha2000critique} and is used to measure the difference between two populations. The test result is denoted as $\hat{A}$, and simply specifies the amount of times population A is expected to be better than population B\cite{neumann2015transformed}. Its significance is determined when the effect size is above 0.7 or below 0.2.
\subsection{Code Coverage}
\label{subsec:code}
RQ1 asked if pairwise testing achieves better code coverage scores than manual testing. The coverage scores achieved by pairwise testing are ranging between 50\% and 100\% while for manual testing these are varying between 63\% and 100\%. As shown in Table \ref{table:codeCoverage}, the use of manual testing achieves on average 97\% branch coverage (3\% on average higher than pairwise testing). Results for all programs (in Table \ref{table:statisticalAnalysis}) show that differences in code coverage between manual and pairwise testing are statistically significant with a p-value of 0.04 but their effect is not strong (i.e., an effect size of 0.6).
\input{tables/codeCoverage}
As seen in Figure \ref{figure:caseEval}, for 62\% of the programs considered, pairwise performs equally good as manual testing; for 29\% of the programs manual testing performed better in terms of achieved code coverage while for 9\% of the programs pairwise testing covers more code than manual testing.
The results for all programs were surprising: test suites created using pairwise testing achieved relatively high code coverage (94\% on average). This shows that, for the programs studied in this experiment, pairwise testing achieves high branch coverage. This is likely due to the complexity of the studied programs. It is possible that more complex software would yield a greater code coverage difference between manual and pairwise test suites.
Overall, as shown in Figure \ref{figure:caseEval}, we confirm that pairwise test suites achieve just as good or better code coverage scores as manual testing for 71\% of programs considered in this study. This can be explained by the fact that pairwise testing if properly used is quite good at covering the logical behaviour of the code.
\begin{mdframed}[style=style1]
{\it Answer RQ1: Code coverage scores achieved by pairwise test suites are slightly lower than the ones created manually by industrial engineers.}
\end{mdframed}
\input{tables/mutationScore}
\subsection{Fault Detection}
\label{subsec:fault}
To answer RQ2, we first computed the mutation score of each manual and pairwise test suites. Figure \ref{figure:boxplots} shows box plots of our results for fault detection in terms of mutation score. Table \ref{table:mutationScore} summarizes statistics for these test suites. For all programs the fault detection scores obtained by manually written test suites are higher on average with 7\% than those achieved by pairwise testing. However, there is no statistically significant difference at 0.05; as the p-value is 0.67 and the effect size is 0.53 in Table \ref{table:statisticalAnalysis}. A larger sample size would be needed to obtain more confidence in our results. Interestingly, as show in Figure \ref{figure:caseEval}, our results suggest that fault detection scores achieved by manual testing are not significantly better at finding faults than pairwise testing. It seems that test suites generated using pairwise testing are just as good in terms of fault detection as manual test suites for 64\% of the cases considered in this study. For 42\% of the programs, pairwise testing performs as well as manual testing while for 36\% of the programs manual testing performed better in terms of fault detection.
The difference in effectiveness between manual and pairwise could be due to other factors such as the number of test cases and the test design techniques used to manually create test suites (e.g., testing the timed behavior of the PLC software).
\begin{mdframed}[style=style1]
{\it Answer RQ2: Pairwise testing is able to produce comparable results to manual testing in terms of fault detection. However, manual testing produced better mutation scores on average.}
\end{mdframed}
\subsection{Number of Tests}
\label{subsec:size}
\input{tables/testsuiteSize}
This section aims to answer RQ3 regarding the relative cost of performing manual testing versus pairwise testing. Analysing the cost in this study is directly related to the number of test cases giving a picture of the effort needed per created test suite. Based on the results highlighted in Figure \ref{figure:boxplots}, the use of pairwise testing results in very inconsistent number of tests created, compared to manual testing which seems to create tests with more diverse number of steps than pairwise testing. Examining Table \ref{table:testsuiteSize}, we see a different pattern: less number of tests on average are manually created by industrial engineers (13 test cases on average in a test suite) than when using pairwise testing (21 test cases on average in a test suite). As seen in Figure \ref{figure:caseEval}, for 44\% of the programs considered, pairwise test suites produced equally or larger test suites than the manual ones, leading to 55\% where pairwise produced fewer. Table \ref{table:statisticalAnalysis} shows an interesting pattern in the statistical analysis: the standardized effect size being 0.53, with p-value being higher than the traditional statistical significance limit of 0.05. Results are not strong in terms of effect size and we did not obtain any statistical difference for the number of tests.
The results for all programs matched our expectations: manual tests are handcrafted by experienced industrial engineers that can create very diverse tests. It is possible that more complex software would yield greater number of tests differences between tests written manually and pairwise testing.
\begin{mdframed}[style=style1]
{\it Answer RQ3: The use of pairwise testing results in more number of tests created on average than the use of manual testing. Even so, pairwise testing produced more cases with less tests created compared to manual testing, resulting in very inconsistent results.}
\end{mdframed}
\input{tables/statisticalAnalysis}
\section{Discussion}
\label{sec:discussion}
The goal of this work was to compare pairwise testing with manual testing performed by industrial engineers in terms of code coverage, fault detection and the number of created test cases. We found out that pairwise testing achieves high code coverage, but slightly lower scores than manual testing. In addition, we found the fault detection scores for pairwise testing to be lower on average than the ones written manually by industrial engineers. Interestingly, pairwise testing achieves equally good or better fault detection scores than manual testing for 64\% of the programs considered, which might indicate that for more than half of the programs the fault detection scores for pairwise testing are a good predictor of test effectiveness. This is reinforced by the mutation score box plot in Figure \ref{figure:boxplots}: the median mutation score for pairwise testing is 95\%. This in combination with the achieved high code coverage, suggests that pairwise testing can cover as much code as manual testing performed by industrial engineers, but this is not entirely reflected in its fault detection capability. The fault detection rate between manual and pairwise testing was found, in some of the published studies \cite{ellims2008effectiveness,ellims2007aetg} to be similar to our results. Interestingly enough, our results indicate that pairwise test suites might be even better in some cases in terms of fault detection than manual test suites. However, a larger pool of programs and tests is needed to statistically confirm this hypothesis.
The mean value for fault detection of 81\% for pairwise testing is right in line with the proportion of 2-way faults seen in other domains \cite{ kuhn20132combinatorial}. It is interesting to note here that the fault distribution for PLC industrial control software is similar to other types of software.
As part of our study, we used the number of tests to estimate the test efficiency in terms of creation, execution and result checking. While the cost of creating and executing a test for pairwise testing can be low compared to manual testing, the cost of checking the result is usually human intensive. Practically, the higher the number of test cases, the higher the cost of checking the test result. Our study suggests that pairwise test suites, while inconsistent, are longer on average in terms of created test steps (number of tests) than manual test suites. By considering generating optimized or shorter test suites, one could improve the cost of performing pairwise testing.
The idea of using pairwise testing in practice stands as a significant progress in the development of automatic test generation approaches. This progress implies, to some extent, that pairwise testing should be at least as effective and more efficient than manual testing for it to be considered ready to be used as a replacement to the manual effort of creating tests. The overall result, from this case study, is that pairwise testing alone is not better than manual testing. However, pairwise testing or stronger combinatorial criteria are capable of at least aiding an engineer in testing of industrial software. Our observations showed that experienced engineers are very effective at generating the right choice of values and considering the timing of the input parameters. Industrial PLC software typically have a complex and time-dependent behaviour. This behaviour require inputs to retain and change a sequence of inputs for some time in order to trigger a certain logical event. Several manual test suites collected in this case study contained that kind of test cases. The engineers creating these test suites had years of experience in developing and testing this type of software, including good knowledge of what combinatorial interactions are needed to cover the code and detect faults. As it turns out, pairwise testing is not particularly useful for some of the programs considered in this study. By considering generating more complex (stronger t-wise) and time-depended tests, one could improve both the achieved code coverage as well as the fault detection capability.
\section{Threats to Validity}
\label{sec:validity}
There are many tools (e.g., ACTS \cite{yu2013acts}, AETG\cite{cohen1997aetg}, TCG\cite{tung2000automating}) for automatically generating tests using pairwise testing and these may produce different results. The use of these tools in this study is complicated by the modelling of the input space for a PLC program. Hence, we choose a tool specifically developed for testing PLC industrial programs. For more details on the comparison between {\ctt} and ACTS, we refer the reader to the work of Charbachi and Eklund \cite{thesischa}. {\ctt} is using the IPOG algorithm. This algorithm continually expands the test suite to fit the input parameters with the use of vertical and horizontal extension. {\ctt} currently uses a first element tie breaker which was chosen when a clean-cut best choice for tie breaking was absent \cite{huang2014tie}. This choice of a tie breaker might affect the effectiveness of the generated tests.
Another threat to the validity of this study is also related to the use of the {\ctt} tool. Vertical extension \cite{lei2007ipog} is a step which adds new tests, if needed, to the test set produced by horizontal growth when there are no modifiable test cases to cover a specific pair. The IPOG algorithm, in this case, creates a new test case, thus expanding the size of the test suite by making the test case to cover the specific pair and keeping all the other parameters modifiable. This is done to reduce the need of further vertical extensions and can be used to avoid creating a new test case. However, when trying to execute a test suite, these values are syntactically illegal and need to be changed. {\ctt} currently handles this by randomising the modifiable values to a default option for each parameter. A more accurate option for each parameter would be needed to obtain more confidence in the test suite effectiveness.
The data collected is based on a study in one company using one industrial system containing 45 programs and manual test suites created by industrial engineers. We argue that even if the number of programs can be considered relatively small, reporting a case study using industrial artefacts can be representative.
Since this case study was performed post-mortem, the cost information was not available. We used the number of test cases as a valid proxy measure and a more detailed cost model should be used to obtain more accurate results.
\section{Conclusion}
\label{sec:conclusions}
In this paper, we studied the comparison between pairwise testing and manual testing in terms of branch coverage, mutation score and number of created test cases. From the 45 PLC industrial programs we studied, we drew the following conclusions:
\begin{itemize}
\item The use of pairwise testing results in high branch coverage and mutation scores for the majority of the programs considered.
\item The results of this paper support the claim that pairwise testing is not quite as effective (i.e., achieved branch coverage and fault detection) and efficient (in terms of number of tests created) as manual testing.
\item The use of pairwise testing results in similar or better fault detection scores than the use of manual testing for 64\% of the programs.
\end{itemize}
The results imply that pairwise testing can achieve high branch coverage, but slightly lower scores than manual testing.
In summary, our results suggests that pairwise testing can perform in some cases comparably with manual testing performed by industrial engineers. This is a significant experimental evidence on the progress of pairwise testing that needs to be further studied; we need to consider the cost of using pairwise testing in practice. In addition, pairwise testing is only one type of combination strategy and we would need to evaluate the use of stronger criteria such as t-wise (with $t>2$) testing.
\ifCLASSOPTIONcompsoc
\section*{Acknowledgments}
\else
\section*{Acknowledgment}
\fi
This research was supported by the Swedish Research Council (VR) through the “Adequacy-based testing of extra-functional properties of embedded systems” project and by VINNOVA and ECSEL (EU's Horizon 2020) under grant agreement No 737494. The authors would like to thank Bombardier Transportation AB for the valuable assistance in the planning and execution of this work.
\ifCLASSOPTIONcaptionsoff
\newpage
\fi
\balance
\bibliographystyle{IEEEtran}
\section{Introduction}
This demo file is intended to serve as a ``starter file''
for IEEE Computer Society conference 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.
\ifCLASSOPTIONcompsoc
\section*{Acknowledgments}
\else
\section*{Acknowledgment}
\fi
The authors would like to thank...
\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
| {'timestamp': '2017-06-07T02:04:07', 'yymm': '1706', 'arxiv_id': '1706.01636', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01636'} | arxiv |
\section{Purpose}
\label{sec:intro}
Volume calculation of lung lesions from Computed Tomography (CT) images plays a vital role in the evaluation of the level of lung disease. An efficient and accuracy method for volume measurement can provide reliable information for clinical diagnosis, which helps doctors to evaluate the state of patients and make appropriate therapies. Furthermore, doctors can estimate the timeliness and treatment effect of drugs with the help of the volume of lung lesions~\cite{Wang2014Direct}.
However, many previous studies about the volume calculation for lesions tissue or organ from CT or MRI images are based on the diameters of lung lesions which roughly expresses the size, or based on 3D model reconstruction and surface triangulation which are not efficient and sometimes fail to build a perfect 3D model due to the high complexity of medical images~\cite{Punithakumar2010Detection}.
Monte Carlo method (MC) is very useful tool for physical and mathematical problems, especially in optimization, numerical integration~\cite{Afshin2014Regional}. Quasi-Monte Carlo methods (qMC) (also called low-discrepancy sequences), which were proposed to generate random points with better uniformity and lower discrepancy, are often considered as a replacement of MC. Some qMC methods have already been used for computing the volume~\cite{Zhen2014Direct}.
In this paper, to accurately and directly calculate the volume of lung lesions, we introduce the low-discrepancy sequences to compute volume. In our study, the Halton low-discrepancy sequences are generated to calculate the area of each CT slice and the volume are obtained by accumulating these slices' area with a smooth formula. Experiments are conducted to evaluate our method compared with other methods.
\section{Method}
MC method is a simple and efficient numerical method based on random sampling. However, in \cite{davies1998low}, Davies \emph{et al.} pointed out that MC method is subject to errors and in particular all parts of space can not guarantee the equal sampling. Therefore, the sequence of Monte Carlo is not entirely uniform and it may lead to inaccuracy results. Fig \ref{fig:compare}(a) illustrates the distribution of pseudorandom number tends to be lumped.
To generate more uniform sequences, low-discrepancy sequences are proposed. Compared with MC method, quasi-Monte Carlo method solves numerical problems using low-discrepancy sequences. The distribution of the Halton sequence is more uniformly as shown in Fig \ref{fig:compare}(b). Low-discrepancy sequences also have lower statistical errors. Low-discrepancy sequences have theoretical error bound O($N^{-1}$$(logN)^{D}$) compared with pseudorandom sequences O($N^{-1/2}$) \cite{davies1998low}, where $N$ is the number of samples and $D$ denotes the dimensions. In this paper, we employ Halton sequences to generate quasi-random numbers. The Halton sequences are constructed according to a deterministic method that uses a prime number as its base. The sequence is implemented easily and has a very uniform distribution on low dimension.
\begin{figure}[H]
\centering
\subfigure[pseudorandom number sequence]{\includegraphics[height=1.7in,width=2.2in]{mcscatter.eps}}\hspace{0.7cm}
\subfigure[Halton sequence]{\includegraphics[height=1.7in,width=2.2in]{haltonscatter.eps}}
\caption{2-D plots of 1000 points generated respectively by (a) the pseudo-random number sequence, and (b) the Halton sequence.}\label{fig:compare}
\end{figure}
\textbf{Lesion Segmentation and Volume Calculation}. Our previous segmentation work \cite{wang20143d} is introduced to obtain the segmented results. The procedure of volume calculation has five steps: (1) building reference coordinate system in every slice of CT scanning image; (2) generating a certain number of random points in each slice using Halton low-discrepancy sequences; (3) finding out the number of random points who are inside the lung lesion region; (4) calculating the area ($S_i$) of the lung lesion region for each slice by the proportion of random points to all random points, the area can be calculated by ${S_i} \approx \frac{m}{N}{S_N}$ where $m$ means the number of points inside the lung lesion, $N$ represents the number of all points generated, and $S_N$ is the area of each slice; and (5) calculating the volume of lung lesion using the formula of the frustum model as:
${\rm{V}} = \sum\limits_{i = 0}^{z - 1} {\frac{{({S_i} + {S_{i + 1}} + \sqrt {{S_i}{S_{i + 1}}} ) \times h}}{3}}$, where $S_i$ and $S_{i+1}$ define the areas of lesions in the $i$th slice and the $(i+1)$th slice, and $h$ denotes the slice thickness. Fig \ref{fig:volumepoints} illustrates the random points generated by Halton sequence in 3D in the CT lung scans.
\begin{figure}[H]
\centering
\includegraphics[width=2in]{volume_point.eps}\\
\caption{The distribution of Halton sequence in the 3D CT lung scans.}\label{fig:volumepoints}
\end{figure}
\section{Experimental Results}
\label{sec:sections}
In this section, experiments are conducted on two kinds of CT data sets. The data was acquired at the 174 Hospital's CT room in Xiamen. The first data set is regular model, including cube, cuboid, and cylinder. See \ref{fig:RegularModels} for an illustration of the parameters of regular models, and we can calculate volumes of each model easily. Next, the CT scan data of each model was obtained using CT scanner in the CT room. And then the data can be used on our experiment. Table \ref{fig:regular} shows volumes of three regular models, which obviously demonstrates the result of three methods compared with ground truth volume. It has also shown that our method provides more accurate and precise results.
\begin{figure}[H]
\centering
\includegraphics[width=2in]{RegularModels.eps}\\
\caption{Illustration of regular models' parameters.}\label{fig:RegularModels}
\end{figure}
The second data set is manual tumor delineation of different size of lung lesions. Therefore, the data sets are divided into three groups: small, medium and large lung lesions. Each group has three data sets. The ground truth of each data set is provided by the experienced doctors who manually tag the CT lesion in each slice. The binary image of each slice is got using two value ($-4.0$ standing for background and $4.0$ indicating the lung lesion). This can guarantee the accurate segmentation of the lung lesion at the most extent. In order to evaluate our method, our results are compared with the Monte Carlo method and the method named LSTK using a discretized version of the divergence theorem described by Alyassin et al.\cite{alyassin1994evaluation}. Our experiments were run in Visual Studio 2010 using MicroSoft Windows 8.1 platform on a CPU of Intel 3.50GHz core i3-4150 with 4GB of RAM. In our proposed method, the dimension was set as $5$ to generate $5$ columns of low-discrepancy value and we chose the first and the fifth column (dimension) of the sequences.
We define the relative error $E$ as the evaluation criteria by the following formula:
\[E = \frac{{\left| {ComputedVolume - TrueVolume} \right|}}{{TrueVolume}}\]
\begin{table*}[ht]
\centering
\begin{tabular}{l|ccccccccc}
\hline
\hline
Dataset &True Volume &LSTK (-0.5) &MC (10000) &Ours (10000)\\ \hline
Cube &512.000 &516.356(0.85\%) &510.732(0.25\%) &512.790(\textbf{0.15\%})\\
Cuboid &231.000 &232.898(0.82\%) &230.177(0.36\%) &230.788(\textbf{0.09\%})\\
Cylinder &424.115 &427.033(0.69\%) &421.189(0.69\%) &425.106(\textbf{0.23\%})\\
\hline
\end{tabular}
\caption{The results of three regular models' volume calculation of three methods compared to ground truth volume. The value of each volume is in $cm^3$. MC and our method use 10000 random points. LSTK uses the iso-surface threshold $-0.5$ at its best. The relative error of each volume calculation is shown in brackets after the volume value.}
\label{fig:regular}
\end{table*}
Table \ref{fig:table} shows the results of volume calculation and its corresponding relative errors for all methods. It is demonstrated that the results of LSTK have a lower accuracy and MC method's results is unstable. However, our method achieve more accurate results greatly closed to the true volume at most cases and more stable than MC method.
We also analyze the accuracy of volume calculation when increase the random points for the MC method and our proposed method.
Fig.~\ref{fig:RegularPoints} illustrates the results of obtained of three regular models, the relative error versus the number of points used for volume measurement using the logs to base 10. For each graph, the theoretical error is plotted, which is compared to the actual relative error using our method. In the Fig.~\ref{fig:RE}, we compare the two methods among the three typical cases.
As is shown in the Fig.~\ref{fig:RegularPoints} and Fig.~\ref{fig:RE}. It is illustrated that our proposed method has lower relative errors in all cases compared with MC method. Because for our method, fewer number of points is supposed to achieve a given accuracy.
\begin{figure*}[ht]
\centering
\subfigure[cube]{\includegraphics[height=1in,width=2in]{cube_points.eps}}
\subfigure[cuboid]{\includegraphics[height=1in,width=2in]{cuboid_points.eps}}
\subfigure[cylinder]{\includegraphics[height=1in,width=2in]{cylinder_points.eps}}
\caption{The relative error analysis of calculating the volume of three regular objects for MC and our proposed method.}\label{fig:RegularPoints}
\end{figure*}
\begin{figure*}[ht]
\centering
\subfigure[small case (case 3)]{\includegraphics[height=1in,width=2in]{case3.eps}}
\subfigure[medium cases (case 6)]{\includegraphics[height=1in,width=2in]{case6.eps}}
\subfigure[large cases (case 9)]{\includegraphics[height=1in,width=2in]{case9.eps}}
\caption{The relative error analysis of calculating the lung lesion volume in three cases for MC and our proposed method.}\label{fig:RE}
\end{figure*}
\begin{table*}[ht]
\centering
\begin{tabular}{l|ccccccccc}
\hline
\hline
Dataset &True Volume &LSTK (-0.5) &MC (10000) &Ours (10000)\\ \hline
Small(case1) &425.182 &432.334(1.68\%) &417.224(1.87\%) &419.995(\textbf{1.22\%})\\
Small(case2) &1417.62 &1433.16(1.10\%) &1436.13(1.31\%) &1415.85(\textbf{0.13\%})\\
Small(case3) &1533.52 &1551.76(1.19\%) &1505.83(1.81\%) &1537.21(\textbf{0.24\%})\\
Medium(case4) &3444.63 &3489.74(1.31\%) &3518.6(2.15\%) &3415.86(\textbf{0.84\%})\\
Medium(case5) &5234.59 &5305.19(1.35\%) &5165.49(1.32\%) &5186.13(\textbf{0.93\%})\\
Medium(case6) &6820.19 &6898.35(1.15\%) &6836.36(0.24\%) &6782.16(\textbf{0.56\%})\\
Large(case7) &9277.13 &9352.53(0.81\%) &9296.87(0.21\%) &9260.66(\textbf{0.18\%})\\
Large(case8) &9415.15 &9533.36(1.26\%) &9179.48(2.50\%) &9338.65(\textbf{0.81\%})\\
Large(case9) &13634.1 &13758.1(0.91\%) &13635.1(\textbf{0.01\%}) &13577.4(0.42\%)\\
\hline
\end{tabular}
\caption{The results of volume calculation of three methods compared to ground truth volume. The value of each volume is in $mm^3$. MC and our method use 10000 random points. LSTK uses the iso-surface threshold $-0.5$ at its best. The relative error of each volume calculation is shown in brackets after the volume value.}
\label{fig:table}
\end{table*}
Comparing the MC method and ours, the graph above give a distinct analysis. Taking a different look, Table \ref{fig:table} shows the relative efficiency three regular models and nine cases for the two method. To achieve 1\% accuracy, the number of points approximately needed is shown in the table, and the ratio of MC method and our method is computed.
\begin{table*}[ht]
\centering
\begin{tabular}{l|ccccccccc}
\hline
\hline
Dataset &MC &Ours &Ratio \\ \hline
Cylinder &350 &100 &3.2 \\
Cuboid &720 &100 &7.2 \\
Cube &590 &100 &5.9 \\
Small(case1) &1040 &120 &8.7 \\
Small(case2) &6680 &160 &41.8 \\
Small(case3) &420 &260 &1.6 \\
Medium(case4) &1100 &330 &3.3 \\
Medium(case5) &370 &170 &2.2 \\
Medium(case6) &1350 &110 &12.3 \\
Large(case7) &8610 &110 &78.3 \\
Large(case8) &9110 &10 &911 \\
Large(case9) &230 &110 &2.1 \\
\hline
\end{tabular}
\caption{The number of points approximately needed to achieve an accuracy of 1\%.}
\label{fig:table}
\end{table*}
\section{Discussion and Conclusion}
In this study, the Halton low-discrepancy sequence is applied to calculate the volume for CT lung lesions. Compared with LSTK, the proposed method can calculate volume without reconstructing 3D model of lung lesions and surface triangulating. The proposed method can also generate more uniform random points compared with MC method. The experimental results are demonstrated that our proposed method can achieve more accurate results compared with LSTK and MC method and more stable than MC method.
In our near future study, we will improve the random points selection strategy for volume calculation since the more number of points selected, the more time costs in calculation.
\section*{Acknowledgement}
This work was supported by National Natural Science Foundation of China (Grant No. 61671399, 61327001), Research Fund for the Doctoral Program of Higher Education (20130121120045) and by the Fundamental Research Funds for the Central Universities (20720150110).
| {'timestamp': '2017-06-07T02:04:16', 'yymm': '1706', 'arxiv_id': '1706.01644', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01644'} | arxiv |
\section{Introduction}
Multi-Task Learning (MTL) aims to enhance the overall generalization performance by learning multiple related tasks simultaneously.
It has been extensively studied from various points of view~\cite{Caruana97,Evgeniou05,WATR2010,qi2010semi}.
As an example, the common tastes of users (i.e., tasks) with respect to movies (i.e., instances) can be harnessed into a movie recommender system using MTL~\cite{pan2010transfer}.
Most MTL methods run under the offline learning setting where the training data for each task is available beforehand.
However, offline learning methods are generally inefficient, since they suffer from a high training cost and poor scalability.
This is especially true when it comes to the large-scale streaming data.
As a remedy, MTL has been studied under the online setting, in which the model runs over a sequence of data by processing them one by one~\cite{anderson2008theory}.
After updating the model in each round, the current input will be discarded.
As a result, online learning algorithms are efficient and scalable, and have been successfully applied to a number of MTL applications~\cite{Saha,lugosi2009online,ruvolo2014online,attenberg2009collaborative,yang2016learning}.
In this paper, we investigate MTL under the online setting.
Existing online MTL methods assume that all tasks are related with each other and simply constrain their relationships via a presumed structure~\cite{Saha,CavallantiCG10}.
However, such a constraint may be too restrictive and rarely hold in the real-life applications, as the personalized tasks with individual traits often exist~\cite{gong2012robust}.
We attempt to address this drawback through a creative formulation of online MTL that consists of two components:
the first component captures a low-rank \emph{correlative} structure over the related tasks,
while the second one represents the \emph{personalized} patterns of individual tasks.
Specifically, our algorithm learns a weight matrix which is decomposed into two components as aforementioned.
A nuclear norm regularization is imposed on the first component to induce a low-rank \emph{correlative} structure of the related tasks.
A group lasso penalty is applied onto the second component of all individual tasks to identify the outliers.
Next, we apply an online projected gradient scheme to solve this non-smooth problem with a closed-form solution for the \emph{correlative} and \emph{personalized} components.
This gives our algorithm two advantages: 1) it is efficient to make predictions and update models in a real-time manner; 2) it can achieve a good trade-off between the common and personalized structures.
We provide a theoretical evaluation for our algorithm by giving a proof that our algorithm can achieve a sub-linear regret compared to the best linear model in hindsight.
Although our algorithm achieves good performance, it may not accurately approximate a low-rank matrix: the nuclear norm is essentially the $l_1$ norm of singular values, known for being biased in estimation since large singular values are detrimental to the approximation. To address this issue, we use a log-determinant function to approximate the matrix rank, that is able to reduce the contributions of large singular values while keeping those of small singular values close to zero. To solve this non-convex optimization problem, a proximal gradient algorithm is derived to adaptively learn such a low-rank structure with a closed-form solution.
In addition, we prove that there is a unique root of the refined objective under a proper parameter setting.
Finally, we conduct comparative experiments against a variety of state-of-the-art techniques on three real-world datasets.
Empirically, the refined algorithm with the log-determinant function achieves better performance than that with the nuclear norm due to a better low-rank approximation.
The rest of this paper is organized as follows.
Section 2 introduces related work.
The problem setting and the proposed algorithm with analysis are presented in Section 3 and Section 4, respectively.
Section 5 provides experimental results.
Section 6 concludes this paper.
\section{Related Work}
In this section, we briefly introduce works related to MTL in the offline and online settings, followed by the low-rank matrix approximation.
\subsection*{Multi-Task Learning}
Conventional offline or batch MTL algorithms can be broadly classified into the following two categories: \emph{explicit} parameter sharing and \emph{implicit} parameter sharing.
In the first category, all tasks can be made to share some common parameters explicitly.
Such common parameters include hidden units in neural networks~\cite{baxter2000model}, prior in hierarchical Bayesian models~\cite{bakker2003task,yu2005learning}, feature mapping matrix~\cite{AndoZ05} and classification weight~\cite{Evgeniou04}.
On the other side, the shared structure can be estimated in an implicit way by imposing a low rank subspace~\cite{pong2010trace,negahban2011estimation}, e.g. Trace-norm Regularized Multi-task Learning (TRML)~\cite{zhou2012mutal} captured a common low-dimensional subspace of task relationship with a trace-norm regularization; or a common set of features~\cite{argyriou2008convex,yang2009heterogeneous}, e.g. Multi-Task Feature Learning (MTFL)~\cite{ArgyriouEP06} learned a common feature across the tasks in an unsupervised manner. Besides, \cite{AbernethyBR07} and \cite{Agarwal} proposed a few experts to learn the task relatedness on the entire task set. These MTL techniques have been successfully used in the real-world applications, e.g. multi-view action recognition~\cite{yan2014multitask}, spam detection~\cite{haideceptive}, head pose estimation~\cite{yan2016multi}, etc.
Compared to the offline learning, online learning techniques are more efficient and suitable to handle massive and sequential data~\cite{yang2015min,conf/icml/ZhaoHJY11,yang2016efficient}. An early work ~\cite{Dekel,DekelLS06}, Online Multi-Task Learning (OMTL), studied online learning of multiple tasks in parallel. It exploited the task structure by using a global loss function. Another work \cite{LiCHLJ11} proposed a collaborative online framework, Confidence-weighted Collaborative Online Multi-task Learning (CW-COL), which learned the take relativeness via combining the individual and global variations of online Passive-Aggressive (PA) algorithms~\cite{Crammer}.
Instead of fixing the task relationship via a presumed structure~\cite{CavallantiCG10}, a recent Online Multi-Task Learning approach introduced an adaptive interaction matrix which quantified the task relevance with LogDet Divergence (OMTLLOG) and von-Neumann Divergence (OMTLVON)~\cite{Saha}, respectively. Most Recently, \cite{crammer2012learning} proposed an algorithm, Shared Hypothesis model (SHAMO), which used a K-means-like procedure to cluster different tasks in order to learn the shared hypotheses.
Similar to SHAMO, \cite{murugesan2016adaptive} proposed an Online Smoothed Multi-Task Learning with Exponential updates (OSMTL-e). It jointly learned both the per-task model parameters and the inter-task relationships in an online MTL setting.
The algorithm presented in this paper differs from existing ones in that it can learn both a common structure among the correlative tasks and the individual structure of outlier tasks.
\subsection*{Low-Rank Matrix Approximation}
In many areas (e.g. machine learning, signal and image processing), high-dimensional data are commonly used. Apart from being uniformly distributed, high-dimensional data often lie on the low-dimensional structures. Recovering the low-dimensional subspace can well preserve and reveal the latent structure of the data. For example, face images of an individual under different lighting conditions span a low-dimensional subspace from an ambient high-dimensional space \cite{basri2003lambertian}. To learn low-dimensional subspaces, recently proposed methods, such as Low-Rank Representation (LRR) \cite{liu2013robust} and Low-Rank Subspace and Clustering (LRSC) \cite{favaro2011closed}, usually depended on the nuclear norm as a convex rank approximation function to seek low-rank subspaces. Unlike the rank function that treats them equally, the nuclear norm simply adds all nonzero singular value together, where the large values may contribute exclusively to the approximation, rendering it much deviated from the true rank. To resolve this problem, we propose a log-determinant function to approximate the rank function, which is able to reduce the contributions of large singular values while keeping those of small singular values close to zero. To the best of our knowledge, this is the first work that exploits a log-determinant function to learn a low-rank structure of task relationship in the online MTL problem.
\section{Problem Setting}
In this section, we first describe our notations, followed by the problem setting of online MTL.
\subsection{Notations}
Lowercase letters are used as scalars, lowercase bold letters as vectors, uppercase letters as elements of a matrix, and bold-face uppercase letters as matrices.
$\x_i$ and $X_{ij}$ denote the $i$-th column and the $(i,j)$-th element of a matrix $\mathbf{X}$, respectively.
Euclidean and Frobenius norms are denoted by $\|\cdot\|$ and $\|\cdot\|_F$, respectively.
In particular, for every $q,p \geq 1$, we define the $(q,p)$-norm of $\mathbf{A} \in \mathbb{R}^{d\times m}$ as $\|\mathbf{A}\|_{q,p} = (\sum_{i=1}^m\|\a_i\|_q^p)^{\frac{1}{p}}$.
When the function $f(\w)$ is differentiable, we denote its gradient by $\nabla f(\w)$.
\subsection{Problem Setting}
According to the online MTL setting, we are faced with $m$ different but related classification problems, also known as tasks.
Each task has a sequential instance-label pairs, i.e., $\{(\x_t^i,y_t^i)\}_{1\leq t \leq T}^{1\leq i\leq m}$, where $\x_t^i \in \mathbb{R}^d$ is a feature vector drawn from a single feature space shared by all tasks, and $y_t^i \in \{\pm 1\}$.
The algorithm maintains $m$ separate models in parallel, one for each of the $m$ tasks.
At the round $t$, $m$ instances $\{\x_t^1,\ldots,\x_t^m\}$ are presented at one time.
Given the $i$-th task instance $\x_t^i$, the algorithm predicts its label using a linear model $\z_t^i$, i.e., $\hat{y}_t^i = \textrm{sign}(\hat{p}_t^i)$, where $\hat{p}_t^i = \z_t^{i\top}\x_t^i$ and $\z_t^i$ is the weight parameter of the round $t$.
The true label $y_t^i$ is not revealed until then.
A hinge-loss function is applied to evaluate the prediction,
\bqs
f_t^i(\z_t^i) = [1 - y^i_t \hat{p}_t^i]_+= [1 - y^i_t\z_t^i\cdot\x^i_t]_{+},
\eqs
where $[a]_{+} = \max\{0,a\}$.
The cumulative loss over all $m$ tasks at the round $t$ is defined as
\bqs
F_t(Z_t) = \sum_{i=1}^m f_t^i(\z_t^i),
\eqs
where $Z_t = [\z_t^1,\ldots,\z_t^m] \in \mathbb{R}^{d\times m}$ is the weight matrix for all tasks.
Inspired by the Regularized Loss Minimization (RLM) in which one minimizes an empirical loss plus a regularization term jointly~\cite{shalev2011stochastic}, we formulate our online MTL to minimize the regret compared to the best linear model in hindsight,
\bqs\label{RegretStatic}\notag
R_\phi \triangleq \sum_{t=1}^T [F_t(Z_t) + g(Z_t)] - \inf_{Z\in\Omega}\sum_{t=1}^T [F_t(Z) + g(Z)],
\eqs
where $\Omega\subset\mathbb{R}^d$ is a closed convex subset and the regularizer $g:\Omega\rightarrow\mathbb{R}$ is a convex regularization function that constraints $\Omega$ into simple sets, e.g. hyperplanes, balls, bound constraints, etc.
For instance, $g(Z) = \|Z\|_1$ constrains $Z$ into a sparse matrix.
\vspace{-0.01in}
\begin{figure
\centering
\caption{Learning Personalized and Low-rank Structures from Multiple Tasks}\label{Flow-Chart}
\subfigure {\includegraphics[width=0.52\textwidth,height=5.1cm]{figures_flow_2.eps}}
\end{figure}
\section{Algorithm}
We propose to solve the regret $R_\phi$ by two steps: 1) to learn the correlative and personalized patterns over multiple tasks; 2) to achieve an optimal solution for the regret $R_\phi$.
\subsection{Correlative and Personalized Structures}
We propose a novel formulation for online MTL that incorporates two components, as illustrated in Fig. \ref{Flow-Chart}. The first component captures a low-rank \emph{common} structure $U$ over the similar tasks, where one model (or pattern) can be shared cross the related tasks. As outlier tasks often exist in real-world scenarios, the second one, $V$, identifies the \emph{personalized} patterns specific to individual tasks. Thus, incorporation of two structures $U$ and $V$ could make the final model $W$ more robust and reliable.
To learn both correlative and personalized structures from multiple tasks, we decompose the weight matrix $Z$ into two components: \emph{correlative} matrix $U$ and \emph{personalized} matrix $V$, and define a new weight matrix,
\bqs
\label{decompositionW}
\Omega = \{W | W = \begin{bmatrix} U \\ V \end{bmatrix}, U\in\mathbb{R}^{d\times m}, V\in\mathbb{R}^{d\times m}\},
\eqs
where $\w^{i} = \begin{bmatrix} \u^{i} \\ \v^{i} \end{bmatrix}\in\mathbb{R}^{2d}$ is the $i$-th column of the weight matrix $W = [\w^{1},\ldots,\w^{m}]\in\mathbb{R}^{2d\times m}$.
Denoted by matrix $Z$ the summation of $U$ and $V$, we obtain
\bqs
\label{decomposeZ}
Z = U + V = \begin{bmatrix} I_d, I_d \end{bmatrix}W,
\eqs
where $I_d\in\mathbb{R}^{d\times d}$ is an identity matrix.
Given an instance $(\x^{i}_{t},y^{i}_{t})$ , the algorithm makes prediction based on both the correlative and personalized parameters,
\bqs
\hat{p}_t^i & = \z_t^{i}\cdot\x_t^i \overset{(\ref{decomposeZ})} {=} (\begin{bmatrix} I_d , I_d \end{bmatrix} \w^{i}_t) \cdot \x_t^i \\
& = (\u_t^i+\v_t^i)^{\top}\x_t^i,
\eqs
with the corresponding loss function,
\bqs
\notag
f_t^i(\z^i_t) = f_t^i(\begin{bmatrix} I_d, I_d \end{bmatrix}\w^{i}_t) = [1 - y^{i}_t(\u^{i}_t+\v^{i}_t)^{\top}\x^{i}_t]_{+}.
\eqs
We thus can reformat the cumulative loss function with respect to $W$,
\bqs
\label{LossFunctionW}
L_t(W_t) = F_t(Z_t) \overset{(\ref{decomposeZ})} {=} F_t(\begin{bmatrix} I_d, I_d \end{bmatrix}W_t).
\eqs
We impose a regularizer on $U$ and $V$, respectively,
\bqs
\label{RegularizerW}
& r(W) = g(\begin{bmatrix} I_d, I_d \end{bmatrix}W) \triangleq \lambda_1 r(U) + \lambda_2 r(V),
\eqs
where $\lambda_1$ and $\lambda_2$ are non-negative trade-off parameters.
Substituting Eq. (\ref{LossFunctionW}) and (\ref{RegularizerW}) into the regret $R_\phi$, it can be formatted as
\bqs
\label{RegretStaticW}
R_\phi \triangleq \sum_{t=1}^T [L_t(W_t) + r(W_t)] - \inf_{W\in\Omega}\sum_{t=1}^T [L_t(W) + r(W)],
\eqs
where $\phi_t(W) = L_t(W) + r(W)$ is a non-smooth convex function.
We next show how to achieve an optimal solution to the reformatted regret (\ref{RegretStaticW}).
\subsection{Online Task Relationship Learning}
Inspired by~\cite{bertsekas1999nonlinear}, we can solve the regret (\ref{RegretStaticW}) by a subgradient projection,
\bqs
\label{subgradient-projection}
\displaystyle{\mathop{\mathrm{argmin}}_{W\in\Omega}} \; \|W - (W_t - \eta\nabla\phi_t(W_t))\|_F,
\eqs
where $\eta > 0$ is the learning rate.
In the following lemma, we show that the problem (\ref{subgradient-projection}) can be turned into a linearized version of the proximal algorithm~\cite{rockafellar1976monotone}.
To do so, we first introduce a Bregman-like distance function~\cite{bregman1967relaxation},
\bqs
\notag
B_\psi(W,W_t) = \psi(W) - \psi(W_t) - \langle W-W_t,\nabla \psi(W_t)\rangle,
\eqs
where $\psi$ is a differentiable and convex function.
\begin{lemma}
\label{Lemma_Linearization}
Assume $\psi(\cdot)=\frac{1}{2}\|\cdot\|_F^2$, then using first-order Taylor expansion of $\phi_t(W_t)$, the algorithm (\ref{subgradient-projection}) is equivalent to a linearized form with a step-size parameter $\eta > 0$,
\bqs
\notag
\label{linearization_projection}
W_{t+1} = \displaystyle{\mathop{\mathrm{argmin}}_{W\in\Omega}} \; \langle \nabla\phi_t(W_t),W - W_t\rangle + \frac{1}{\eta}B_\psi(W,W_t).
\eqs
\end{lemma}
\noindent
Instead of balancing this trade-off individually for each of the multiple tasks, we balance it for all the tasks jointly.
However, the subgradient of a composite function, i.e. $\nabla\phi_t(W_t) = \nabla L_t(W_t) + \nabla r(W_t)$ cannot lead to a desirable effect, since we should constrain the projected gradient (i.e. $W_t - \eta\nabla\phi_t(W_t)$) into a restricted set.
To address this issue, we refine the optimization function by adding a regularizer on $W$,
\bqs
\label{optimal_solution}
W_{t+1} \triangleq \displaystyle{\mathop{\mathrm{argmin}}_{W\in\Omega}} \;
& \langle \nabla L_t(W_t),W - W_t\rangle \\
& + \frac{1}{\eta}B_\psi(W,W_t) + r(W).
\eqs
Note that the formulation (\ref{optimal_solution}) is different from the Mirror Descent (MD) algorithm~\cite{beck2003mirror}, since we do not \emph{linearize} the regularizer $r(W)$.
Given that $W = \begin{bmatrix} U^{\top}, V^{\top} \end{bmatrix}^{\top}$, we show that the problem (\ref{optimal_solution}) can be presented with $U$ and $V$ in the lemma below.
\begin{lemma}
Assume that $\psi(W) = \frac{1}{2}\|W\|^2_F$ and $W = \begin{bmatrix} U \\ V \end{bmatrix}$, the problem (\ref{optimal_solution}) turns into an equivalent form in terms of $U$ and $V$,
\bqs
\label{OMTL-LRO_solution}
& (U_{t+1},V_{t+1}) \triangleq \displaystyle{\mathop{\mathrm{argmin}}_{U,V\in\Omega}} \; \lambda_1r(U) + \lambda_2r(V) \\
& + \frac{1}{2\eta_1}\|U - U_t\|^2_F + \frac{1}{2\eta_2}\|V - V_t\|^2_F \\
& + \langle\nabla_{U}L_t(U_t), U - U_t\rangle + \langle\nabla_{V}L_t(V_t), V - V_t\rangle,
\eqs
where the parameters $\eta_1$ and $\eta_2$ control previous learned knowledge retained by $U$ and $V$.
\end{lemma}
\begin{proof}
Assume that $\psi(W) = \frac{1}{2}\|W\|^2_F$, we obtain:
\bqs\notag
\label{B_psi_UV}
B_\psi(W,W_t) & = \frac{1}{2}\|W\|^2_F - \frac{1}{2}\|W_t\|^2_F - \langle W - W_t, W_t\rangle \\
& = \frac{1}{2}\|W - W_t\|^2_F \\
& \overset{(\ref{decompositionW})} {=} \frac{1}{2}\|U - U_t\|^2_F + \frac{1}{2}\|V - V_t\|^2_F.
\eqs
The linearized gradient form can be rewritten as:
\bqs\notag
\label{Linear_UV}
& \langle \nabla L_t(W_t),W - W_t \rangle
\overset{(\ref{decompositionW})} {=} \langle \begin{bmatrix} \nabla_{U}L_t(U_t) \\ \nabla_{V}L_t(V_t) \end{bmatrix} , \begin{bmatrix} U - U_t \\ V - V_t \end{bmatrix} \rangle \\
& = \langle\nabla_{U}L_t(U_t), U - U_t\rangle + \langle\nabla_{V}L_t(V_t), V - V_t\rangle.
\eqs
Substituting above two inferences and (\ref{RegularizerW}) into problem (\ref{optimal_solution}), we complete this proof.
\end{proof}
We next introduce the regularization $r(U)$ and $r(V)$, and then present how to optimize this non-smooth convex problem with a closed-form solution.
\subsection{Regularization}
As mentioned above, restricting task relatedness to a presumed structure via a single weight matrix~\cite{Saha} is too strict and not always plausible in practical applications.
To overcome this problem, we thus impose a regularizer on $U$ and $V$ as follows,
\bqs\label{regularization-UV}
r(U) = \|U\|_{*} & & r(V) = \|V\|_{2,1}.
\eqs
A nuclear norm~\cite{pong2010trace} is imposed on $U$ (i.e., $\|U\|_{*}$) to represent multiple tasks ($\u_i,i\in[1,m]$) by a small number (i.e. $n$) of the basis ($n\ll m$).
Intuitively, a model performing well on one task is likely to perform well on the similar tasks.
Thus, we expect that the best model can be shared across several related tasks.
However, the assumption that all tasks are correlated may not hold in real applications.
Thus, we impose the $l_{(2,1)}$-norm~\cite{kim2010tree} on $V$ (i.e., $\|V\|_{2,1}$), which favors a few non-zero columns in the matrix $V$ to capture the personalized tasks.
Note that our algorithm with the regularization terms above is able to detect personalized patterns, unlike the algorithms~\cite{AbernethyBR07,Agarwal,chen2012learning}.
Although prior work~\cite{gong2012robust} considers detecting the personalized task, it was designed for the offline setting, which is different from our algorithm since we learn the personalized pattern adaptively with online techniques.
\subsubsection{Optimization}
Although the composite problem (\ref{OMTL-LRO_solution}) can be solved by~\cite{vandenberghe1996semidefinite}, the composite function with linear constraints has not been investigated to solve the MTL problem.
We employ a projected gradient scheme~\cite{boyd2004convex,boyd2011distributed} to optimize this problem with both smooth and non-smooth terms.
Specifically, by substituting (\ref{regularization-UV}) into (\ref{OMTL-LRO_solution}) and omitting the terms unrelated to $U$ and $V$, the problem can be rewritten as a projected gradient schema,
\bqs
\notag
(U_{t+1},V_{t+1}) = \; & \displaystyle{\mathop{\mathrm{argmin}}_{U,V\in\Omega}} \;
\frac{1}{2\eta_1}\|U - \hat{U}_t\|_F^2 + \lambda_1\|U\|_* \\
& + \frac{1}{2\eta_2}\|V - \hat{V}_t\|_F^2 + \lambda_2\|V\|_{2,1}.
\eqs
where
\bqs
\notag
\hat{U}_t = U_t - \eta_1\nabla_U L_t(U_t), & & \hat{V}_t = V_t - \eta_2\nabla_V L_t(V_t).
\eqs
Due to the decomposability of the objective function above, the solution for $U$ and $V$ can be optimized separately,
\bqs
\label{OptimalU}
U_{t+1} = \displaystyle{\mathop{\mathrm{argmin}}_{U\in\Omega}} \; \frac{1}{2\eta_1}\|U - \hat{U}_t\|_F^2 + \lambda_1\|U\|_{*}.
\eqs
\bqs
\label{OptimalV}
V_{t+1} = \displaystyle{\mathop{\mathrm{argmin}}_{V\in\Omega}} \; \frac{1}{2\eta_2}\|V - \hat{V}_t\|_F^2 + \lambda_2\|V\|_{2,1}.
\eqs
This has two advantages: 1) there is a closed-form solution for each update; 2) the update for the $U$ and $V$ can be performed in parallel.
\noindent
\textbf{Computation of U:}
\noindent
Inspired by~\cite{boyd2004convex}, we show that the optimal solution to (\ref{OptimalU}) can be obtained via solving a simple convex optimization problem in the following theorem.
\begin{thm}\label{them_U}
Denote by the eigendecomposition of $\hat{U}_t = P\hat{\Sigma} Q^{\top}\in\mathbb{R}^{d\times m}$ where $r = $\textrm{rank}$(\hat{U}_t)$, $P\in\mathbb{R}^{d\times r}$, $Q\in\mathbb{R}^{m\times r}$, and $\hat{\Sigma}=$\textrm{diag}$(\hat{\sigma}_1,\ldots,\hat{\sigma}_r)\in\mathbb{R}^{r\times r}$.
Let $\{\sigma_i\}_{i=1}^r, \sigma_i \geq 0$ be the solution of the following problem,
\bqs
\label{OptimalSigma}
\min_{\{\sigma_i\}_{i=1}^r} & \frac{1}{2\eta_1}\sum_{i=1}^r(\sigma_i - \hat{\sigma}_i)^2 + \lambda_1 \sum_{i=1}^r \sigma_i.
\eqs
It is easy to obtain the optimal solution for (\ref{OptimalSigma}): $\sigma_i^* = [\hat{\sigma}_i - \eta_1\lambda_1]_{+}$ for $i\in[1,r]$.
Assume that $\Sigma^{*} =$diag$(\sigma_1^*,\ldots,\sigma_r^*)\in\mathbb{R}^{r\times r}$, the optimal solution to Eq. (\ref{OptimalU}) is given by,
\bqs
\label{OptimalSolutionU}
U^* = P\Sigma^{*} Q^{\top},
\eqs
\end{thm}
\noindent
\textbf{Computation of V:}
\noindent
We rewrite (\ref{OptimalV}) by solving an optimization problem for each column,
\bqs
\label{optimizationV1}
\min_{\v_i\in\mathbb{R}^d} \sum_{i=1}^m \frac{1}{2\eta_2}\|\v_i - \hat{\v}_i\|^2 + \lambda_2\sum_{i=1}^m\|\v_i\|_2.
\eqs
where $\hat{\v}_i\in\mathbb{R}^{d}$ denotes the $i$-th column of $\hat{V}_t= V_t - \eta_2\nabla_V L_t(V_t) = [\hat{\v}_1,\ldots,\hat{\v}_m]$.
The optimal operator problem (\ref{optimizationV1}) above admits a closed-form solution with time complexity of $O(dm)$~\cite{tibshirani1996regression},
\bqs
\label{OptimalSolutionV}
\v^{i}_{t+1} = \max(0,1 - \frac{\eta_2\lambda_2}{\|\hat{\v}^{i}_t\|_2})\hat{\v}^{i}_t, \quad \forall i\in[1,m].
\eqs
We observe that $\v^i$ would be retained if $\|\hat{\v}^{i}\|_2 > \eta_2\lambda_2$, otherwise, it decays to $\textbf{0}$.
Hence, we infer that only the personalized patterns among the tasks, which differs from the low-rank common structures and thus cannot be captured by $U$, would be retained in $V$.
The two quantities $V_t$ and $U_t$ can be updated according to a closed-form solution on each round $t$. A mistake-driven strategy is used to update the model.
Finally, this algorithm, which we call Robust Online Multi-tasks learning under Correlative and persOnalized structures with NuClear norm term (ROMCO-NuCl), is presented in Alg. \ref{ROMCO-NuCl}.
\begin{algorithm}[t]
\caption{ROMCO-NuCl} \label{ROMCO-NuCl}
\begin{algorithmic}[1]
\STATE {\bf Input}: a sequence of instances $(\x^{i}_t,y^{i}_t,), \forall t\in[1,T]$, and the parameter $\eta_1$, $\eta_2$, $\lambda_1$ and $\lambda_2$.
\STATE {\bf Initialize}: $\u_{0}^i = \mathbf{0}, \v_{0}^i = \mathbf{0}$ for $\forall i\in[1,m]$;
\FOR{$t=1,\ldots, T$}
\FOR{$i=1,\ldots, m$}
\STATE Receive instance pair ($\x^{i}_t$ $y^{i}_t$);
\STATE Predict $\hat{y}_t^{i} = \sign[(\u^{i}_t + \v^{i}_t)\cdot\x_t^{i}]$;
\STATE Compute the loss function $f_t^i(\w_t^{i})$;
\ENDFOR
\IF {$\exists i\in[1,m], f_t^i(\w_t^i) > 0$}
\STATE Update $U_{t+1}$ with Eq.~(\ref{OptimalSolutionU});
\STATE Update $V_{t+1}$ with Eq.~(\ref{OptimalSolutionV});
\ELSE
\STATE $U_{t+1} = U_{t}$ and $V_{t+1} = V_{t}$;
\ENDIF
\ENDFOR
\STATE {\bf Output}: $\w^{i}_T$ for $i\in[1,m]$
\end{algorithmic}
\end{algorithm}
\subsection{Log-Determinant Function}
\vspace{-0.01in}
\begin{figure
\centering
\caption{The rank, nuclear norm and log-determinant objectives in the scalar case}\label{Rank-Value-Comparison}
\subfigure {\includegraphics[width=0.52\textwidth,height=5.3cm]{Rank-Value-Comparison.eps}}
\end{figure}
\vspace{-0.0in}
While the nuclear norm has been theoretically proven to be the tightest convex approximation to the rank function, it is usually difficult to theoretically prove whether the nuclear norm near-optimally approximates the rank function, e.g., the incoherence property \cite{candes2009exact}\cite{candes2010power}.
In addition, the nuclear norm may not accurately approximate the rank function in practice, since the matrix "rank" regards all nonzero singular values to have equal contributions, i.e., regarding all positive singular values as ''1", as shown by the red line in Fig. \ref{Rank-Value-Comparison}; while the nuclear norm, as shown by the yellow star line in Fig. \ref{Rank-Value-Comparison}, treats the nonzero singular values differently, i.e., it simply adds all nonzero values together, thus the larger singular values make more contribution to the approximation.
To solve this issue, we introduce a log-determinant function as follows,
\begin{definition}
Let $\sigma_i$ ($i=1,2,\ldots,n$) be the singular values of the matrix $U$,
\bqs\label{log_determinant}\notag
r^{ld}(U) = \log\det\left(I + U^{\top}U\right) = \sum_{i=1}^n \log\left(1 + \sigma_i^2\right).
\eqs
\begin{itemize}
\item When $\sigma_i = 0$, the term $\log(1+\sigma_i^2) = 0$, which is the same as the true rank function;
\item When $0 < \sigma_i < 1$, $\log(1 + \sigma_i^2) < \sigma_i$, implying that those small singular values can be reduced further;
\item For those large singular values $\sigma_i > 1$, $\log(1 + \sigma_i^2) \ll \sigma_i$, which is a significant reduce over large singular values.
\end{itemize}
\end{definition}
In this case, $r^{ld}(U)$ approximates the rank function better than the nuclear norm by significantly reducing the weights of large singular values, meanwhile regarding those very small singular values as noise, as presented with the blue circle line in Fig. \ref{Rank-Value-Comparison}.
\subsubsection{Optimal Solution}
Replacing the nuclear norm $\|\cdot\|_*$ with the log-determinant function $r^{ld}(U)$, the minimization of $U$ is reduced to the following problem:
\bqs\label{log_determinant_Objective}
U_{t+1} = \arg\min_{U} \frac{1}{2\eta_1}\|U - \hat{U}_t\|_F^2 + \lambda_1r^{ld}(U).
\eqs
To solve the objective function above,
we show that the optimal solution could be obtained by solving the roots of a cubic equation in the following theorem.
\begin{thm}
Let $\hat{U}_t = P\hat{\Sigma} Q^{\top}\in\mathbb{R}^{d\times m}$ where $\hat{\Sigma}=$\textrm{diag}$(\hat{\sigma}_1,\ldots,\hat{\sigma}_r)\in\mathbb{R}^{r\times r}$ and $r = $\textrm{rank}$(\hat{U}_t)$. Let $\{\sigma_i\}_{i=1}^r, \sigma_i \geq 0$ be the solution of the following problem,
\bqs
\label{OptimalSigma_log}
\min_{\{\sigma_i\}_{i=1}^r} \sum_{i=1}^r\left[\frac{1}{2\eta_1}(\sigma_i - \hat{\sigma}_i)^2 + \lambda_1\log(1+\sigma_i^2)\right].
\eqs
Then the optimal solution to Eq. (\ref{log_determinant_Objective}), similar to Thm. \ref{them_U}, is given by
$U^* = P\Sigma^{*} Q^{\top}$, where $\Sigma^{*} =$diag$(\sigma_1^*,\ldots,\sigma_r^*)\in\mathbb{R}^{r\times r}$ and $\sigma_i^*$ is the optimal solution of (\ref{OptimalSigma_log}) .
To obtain the solution, the problem is reduced to solving the derivative of Eq. (\ref{OptimalSigma_log}) for each $\{\sigma_i\}_{i=1}^r \geq 0$ with $\rho = \eta_1\lambda_1$,
\bqs\label{derivate_objective}
\frac{1}{\rho}\sigma_i^3 - \frac{1}{\rho}\hat{\sigma}_i\sigma_i^2 + (\frac{1}{\rho} + 2)\sigma_i - \frac{1}{\rho}\hat{\sigma}_i = 0.
\eqs
\end{thm}
\noindent
\begin{algorithm}[t]
\caption{ROMCO-LogD} \label{LogD_ROMCO}
\begin{algorithmic}[1]
\STATE {\bf Input}: a sequence of instances $(\x^{i}_t,y^{i}_t,), \forall t\in[1,T]$, and the parameter $\eta_1$, $\eta_2$, $\lambda_1$ and $\lambda_2$.
\STATE {\bf Initialize}: $\u_{0}^i = \mathbf{0}, \v_{0}^i = \mathbf{0}$ for $\forall i\in[1,m]$;
\FOR{$t=1,\ldots, T$}
\FOR{$i=1,\ldots, m$}
\STATE Receive instance pair ($\x^{i}_t$ $y^{i}_t$);
\STATE Predict $\hat{y}_t^{i} = \sign[(\u^{i}_t + \v^{i}_t)\cdot\x_t^{i}]$;
\STATE Compute the loss function $f_t^i(\w_t^{i})$;
\ENDFOR
\IF {$\exists i\in[1,m], f_t^i(\w_t^i) > 0$}
\STATE Update $U_{t+1}$ by solving Eq. (\ref{derivate_objective});
\STATE Update $V_{t+1}$ with Eq. (\ref{OptimalSolutionV});
\ELSE
\STATE $U_{t+1} = U_{t}$ and $V_{t+1} = V_{t}$;
\ENDIF
\ENDFOR
\STATE {\bf Output}: $\w^{i}_T$ for $i\in[1,m]$
\end{algorithmic}
\end{algorithm}
In general, the equation (\ref{derivate_objective}) has three roots. The details of root computation is given in Appendix.
In addition, in the following proposition, we prove that a unique positive root for (\ref{derivate_objective}) can be obtained in a certain parameter setting.
\begin{proposition}\label{Proposition1}
Assume that $\Theta(\sigma_i) = \frac{1}{2\rho}(\sigma_i - \hat{\sigma}_i)^2 + \log(1+\sigma_i^2)$ with $\rho = \eta_1\lambda_1$, when $\hat{\sigma}_i = 0$, $ \sigma_i = 0$, under the condition that $\hat{\sigma}_i > 0$ and $\frac{1}{\rho} > 1/4$, $\sigma_i$ located in $(0, \hat{\sigma}_i)$ is the unique positive root in cubic Eq. (\ref{derivate_objective}).
\end{proposition}
\begin{proof}
We need to minimize Eq. (\ref{OptimalSigma_log}) under the constraint of $\sigma_i \geq 0$. The derivative of $\Theta(\sigma_i)$ is
\bqs\notag
\Theta^{\prime}(\sigma_i) = \frac{2\sigma_i}{1 + \sigma_i^2} + \frac{1}{\rho}(\sigma_i - \hat{\sigma}_i),
\eqs
and the second derivative is
\bqs\notag
\Theta^{\prime\prime}(\sigma_i) = \frac{\frac{1}{\rho}\sigma_i^4 + (\frac{2}{\rho} - 2)\sigma_i^2 + (2 + \frac{1}{\rho})}{(1+\sigma_i^2)^2}.
\eqs
\emph{Case 1}: If $\hat{\sigma}_i = 0$, because $\sigma_i \geq 0$, we have $\Theta^{\prime}(\sigma_i) \geq 0$. That is, $\Theta(\sigma_i)$ is nondecreasing for any $\sigma_i \geq 0$ and strictly increasing with $\sigma_i > 0$. Thus, the minimizer of $\Theta(\sigma_i)$ is $\sigma_i^* = 0$.\\
\emph{Case 2}: If $\hat{\sigma}_i > 0$, then the roots exist only in a region of $(0,\hat{\sigma}_i)$ to let $\Theta^{\prime}(\sigma_i) = 0$, since $\Theta^{\prime}(\sigma_i)$ is monotonic with $\sigma_i$, and $\Theta^{\prime}(0) = -\frac{1}{\rho}\hat{\sigma}_i < 0$ while $\Theta^{\prime}(\hat{\sigma}_i) > 0$.
\begin{itemize}
\item If $\frac{1}{\rho} > 1/4$, then $\Theta^{\prime\prime}(\sigma_i) > 0$ since $\frac{1}{\rho}\sigma_i^4 + (\frac{2}{\rho} - 2)\sigma_i^2 + (2 + \frac{1}{\rho}) > 0$. In this case, $\Theta(\sigma_i)$ is a strictly convex function with a unique root in $(0,\hat{\sigma}_i)$. Thus, the proposition is proven.
\item If $0 < \frac{1}{\rho} \leq 1/4$, we determine the minimizer in the following way: Denote the set of positive roots of Eq. (\ref{derivate_objective}) by $\Omega_+$. By the first-order necessary optimality condition, the minimizer needs to be chosen from $\{0\}\cup\Omega_+$, that is, $\sigma^*_i = \arg\min_{\sigma_i\in\{0\}\cup\Omega_+}\Theta(\sigma_i)$.
\end{itemize}
\noindent
In our experiments, we initialize $\frac{1}{\rho} = 1$ and increase its value in each iteration. Therefore, when $\hat{\sigma}_i > 0$, the minimizer $\sigma^*_i\in(0, \hat{\sigma}_i)$ is the unique positive root of (\ref{derivate_objective}); when $\hat{\sigma}_i = 0$, $\sigma^*_i = 0$.
\end{proof}
We are ready to present the algorithm: RMOCO with Log-Determinant function for rank approximation, namely ROMCO-LogD, which also exploits a mistake-driven update rule. We summarize ROMCO-LogD in Alg. \ref{LogD_ROMCO}. To the best of our knowledge, this is the first work that proposes a log-determinant function to learn a low-rank structure of task relationship in the online MTL problem. In the next section, we will theoretically analyze the performance of the proposed online MTL algorithms ROMCO-NuCl/LogD.
\section{Theoretical Analysis}
We next evaluate the performance of our online algorithm ROMCO-NuCl/LogD in terms of the regret bound.
We first show the regret bound of the algorithm (\ref{optimal_solution}) and its equivalent form in the following lemma, which is essentially the same as Theorem 2 in the paper~\cite{duchi2010composite}:
\begin{lemma}
\label{General-Regret}
Let $\{W_t\}$ be updated according to (\ref{optimal_solution}).
Assume that $B_\psi(\cdot,\cdot)$ is $\alpha$-strongly convex w.r.t. a norm $\|\cdot\|_p$ and its convex conjugate $\|\cdot\|_q$ with $\frac{1}{p} + \frac{1}{q} = 1$, then for any $W^{*}\in\Omega$,
\bqs
\label{general_regret}\notag
R_\phi \leq \frac{1}{\eta}B_\psi(W^{*},W_1) + r(W_1) + \frac{\eta}{2\alpha}\sum_{t=1}^{T}\|\nabla L_t(W_t)\|_{q}^2.
\eqs
\end{lemma}
\begin{Remark}
We show that the above regret is $O(\sqrt{T})$ with respect to the best linear model in hindsight.
Suppose that the functions $F_t$ are Lipschitz continuous, then $\exists G_{q}$ such that $\max_t\|\nabla L_t(W_t)\|_{q} \leq G_{q}$.
Then we obtain:
\bqs
\notag
R_\phi \leq \frac{1}{\eta}B_\psi(W^{*}, W_1) + r(W_1) + \frac{T\eta}{2\alpha}G_{q}^2.
\eqs
We also assume that $r(W_1) = 0$.
Then by setting $\eta = \sqrt{2\alpha B_\psi(W^{*},W_1)}/(\sqrt{T}G_{q})$, we have $R_\phi \leq \sqrt{2TB_\psi(W^{*},W_1)}G_{q}/\sqrt{\alpha}$.
Given that $G_{q}$ is constant, setting $\eta \propto 1/\sqrt{T}$, we have $R_\phi = O(\sqrt{T})$.
\end{Remark}
\begin{lemma}
\label{ProjectionEqua}
The general optimization problem (\ref{optimal_solution}) is equivalent to the two step process of setting:
\bqs
\notag
& \tilde{W}_t = \displaystyle{\mathop{\mathrm{argmin}}_{W\in\Omega}} \; \frac{1}{\eta}B_\psi(W,W_t) + \langle\nabla L_t(W_t), W \rangle, \\
& W_{t+1} = \displaystyle{\mathop{\mathrm{argmin}}_{W\in\Omega}} \; \frac{1}{\eta}\{B_\psi(W,\tilde{W}_t) + r(W) \}.
\eqs
\end{lemma}
\begin{proof}
The optimal solution to the first step satisfies
$\nabla\psi(\tilde{W}_t) - \nabla\psi(W_t) + \eta\nabla L_t(W_t) = 0$, so that
\bqs
\label{FirstStep}
\nabla\psi(\tilde{W}_t) = \nabla\psi(W_t) - \eta\nabla L_t(W_t).
\eqs
Then look at the optimal solution for the second step.
For some $r'(W_{t+1})\in \partial r(W_{t+1})$, we have
\bqs
\label{SecondStep}
\nabla\psi(W_{t+1}) - \nabla\psi(\tilde{W}_t) + \eta r'(W_{t+1}) = 0.
\eqs
Substituting Eq.~(\ref{FirstStep}) into Eq.~(\ref{SecondStep}), we obtain
\bqs
\notag
\frac{1}{\eta}(\nabla\psi(W_{t+1}) - \nabla\psi(W_t)) + \nabla L_t(W_t) + r'(W_{t+1}) = 0,
\eqs
which satisfies the optimal solution to the one-step update of (\ref{optimal_solution}).
\end{proof}
We next show that ROMCO can achieve a sub-linear regret in the following theory.
\begin{thm}
\label{Strong-Regret}
The algorithm ROMCO (Alg.~\ref{ROMCO-NuCl} and Alg. \ref{LogD_ROMCO}) runs over a sequence of instances for each of the $m$ tasks.
Assume that $r(0) = 0$, i.e., $W_1 = 0$ and $\max_t \|\nabla L_t(W_t)\| \leq G_2$, $U, V \in \mathbb{R}^{d\times m}$, then the following inequality holds for all $W^{*}\in\Omega$,
\bqs
\label{boundAlgorithm}\notag
R_\phi \leq \frac{1}{2\eta}\|W^{*}\|^2_F + T\eta G_{2}^2 = O(G_2\|W^{*}\|\sqrt{T}).
\eqs
\end{thm}
\begin{proof}
Let $\psi(\cdot)=\frac{1}{2}\|\cdot\|^2_F$, according to Lemma \ref{ProjectionEqua}, the solutions in subgradient projection (\ref{OptimalU}) and~\eqref{OptimalV} are equivalent to the one in form of the general optimization (\ref{optimal_solution}).
Based on Lemma \ref{General-Regret}, for any $U^{*}\in\Omega$,
\bqs
\notag
R_\phi \leq \frac{1}{\eta}B_\psi(W^{*}, W_1) + r(W_1) + \frac{\eta}{2\alpha}\sum_{t=1}^{T}\|\nabla L_t(W_t)\|^2_q.
\eqs
Because that $\psi(\cdot)=\frac{1}{2}\|\cdot\|^2_F$ (i.e., $p=q=2$), $\|\nabla L_t(W_t)\| \leq G_2$.
Assuming $W_1 = 0$, we obtain $r(W_1) = 0$ and $B_\psi(W^{*}, W_1)=\frac{1}{2}\|W^{*}\|_F^2$.
Thus,
\bqs
\notag
R_\phi \leq \frac{1}{2\eta}\|W^{*}\|^2_F + \frac{T\eta}{2}G_{2}^2.
\eqs
By setting $\eta = \frac{\|W^*\|}{\sqrt{T}G_2}$, we have $R_\phi = O(G_2\|W^{*}\|\sqrt{T})$.
\end{proof}
\section{Experimental Results}
We evaluate the performance of our algorithm on three real-world datasets.
We start by introducing the experimental data and benchmark setup, followed by discussions on the results of three practical applications.
\subsection{Data and Benchmark Setup}
\begin{table}[t]
\centering
\caption{Statistics of three datasets}
\label{statistic_data}
\scriptsize
\begin{tabular}[2.1\textwidth]{|c|c|c|c|} \hline
& Spam Email & MHC-I & EachMovie \\ \hline
\#Tasks & 4 & 12 & 30 \\ \hline
\#Sample & 7068 & 18664 & 6000 \\ \hline
\#Dimesion & 1458 & 400 & 1783 \\ \hline
\#MaxSample & 4129 & 3793 & 200 \\ \hline
\#MinSample & 710 & 415 & 200 \\ \hline
\end{tabular}
\end{table}
\subsubsection{Experimental Datasets and Baseline}
We used three real-world datasets to evaluate our algorithm: \emph{Spam Email}\footnote{http://labs-repos.iit.demokritos.gr/skel/i-config/},
\emph{Human MHC-I}\footnote{http://web.cs.iastate.edu/~honavar/ailab/} and \emph{EachMovie} \footnote{http://goldberg.berkeley.edu/jester-data/}.
Table~\ref{statistic_data} summarizes the statistics of three datasets.
Each of the datasets can be converted to a list of binary-labeled instances, on which binary classifiers could be built for the applications of the three real-world scenarios: Personalized Spam Email Filtering, MHC-I Binding Prediction, and Movie Recommender System.
We compared two versions of the ROMCO algorithms with two batch learning methods: multi-task feature learning (\emph{MTFL})~\cite{ArgyriouEP06} and trace-norm regularized multi-task learning (\emph{TRML}) \cite{zhou2012mutal}, as well as six online learning algorithms: online multi-task learning (\emph{OMTL}) \cite{DekelLS06}, online passive-aggressive algorithm (\emph{PA}) \cite{Crammer}, confidence-weighted online collaborative multi-task learning (\emph{CW-COL}) \cite{LiCHLJ11} and three recently proposed online multi-task learning algorithms: \emph{OMTLVON}, \emph{OMTLLOG} \cite{Saha} and \emph{OSMTL-e} \cite{murugesan2016adaptive}. Due to the expensive computational cost in the batch models, we modified the setting of MTFL and TRML to handle online data by periodically retraining them after observing 100 samples. All parameters for MTFL and TRML were set by default values. To further examine the effectiveness of the PA algorithm, we deployed two variations of this algorithm as described below:
\emph{PA-Global} learns a single classification model from data of all tasks;
\emph{PA-Unique} trains a personalized classifier for each task using its own data.
The parameter C was set to 1 for all related baselines and the ROMCO algorithms. Other parameters for CW-COL, OMTLVON(OMTLLOG) and OSMTL-e were tuned with a grid search on a held-out random shuffle.
The four parameters, $\eta_1$, $\eta_2$, $\lambda_1$ and $\lambda_2$ for ROMCO-NuCl/LogD, were tuned by the grid search $\{10^{-6}$,\ldots,$10^{0}\}$ on a held-out random shuffle.
\begin{table*}[t]
\centering
\caption{Cumulative error rate (\%) and F1-measure (\%) with their standard deviation in the parenthesis on the Spam Email Dataset}
\label{email_comparison_result}
\scriptsize
\begin{tabular}[2.1\textwidth] {|c|c|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{Algorithm} & \multicolumn{2}{|c|}{\emph{User1}} & \multicolumn{2}{|c|}{\emph{User2}} & \multicolumn{2}{|c|}{\emph{User3}} & \multicolumn{2}{|c|}{\emph{User4}} \\
\cline{2-9}
& Error Rate & \tabincell{c}{Legit F1} & Error Rate & \tabincell{c}{Legit F1} & Error Rate & \tabincell{c}{Legit F1} & Error Rate & \tabincell{c}{Legit F1} \\
\hline\hline
MTFL & 13.16(1.21) & 88.61(1.06) & 8.72(0.58) & 94.67(0.38) & 14.84(0.91)& 86.70(0.88) & 16.87(0.78) & 83.59(0.77) \\ \hline
TRML & 17.71(0.99) & 84.61(0.88) & 12.45(0.94) & 92.24(0.65) & 13.89(0.73)& 87.57(0.66) & 20.78(1.08) & 79.67(1.09) \\ \hline
PA-Global & 6.15(0.45) & 94.54(0.41) & 8.59(0.82) & 94.72(0.51) & 4.12(0.30) & 96.33(0.27) & 9.75(0.61) & 90.20(0.64) \\ \hline
PA-Unqiue & 5.05(0.49) & 95.51(0.44) & 8.28(0.85) & 94.91(0.52) & 3.67(0.36) & 96.73(0.32) & 8.43(0.86) & 91.52(0.89) \\ \hline
CW-COL & 5.10(0.61) & 95.45(0.55) & \textbf{6.58(0.60)} & \textbf{95.91(0.38)} & 4.14(0.12) & 96.29(0.10) & 7.95(0.73) & 92.08(0.73) \\ \hline
OMTL & 5.00(0.48) & 95.55(0.43) & 8.01(0.77) & 95.07(0.48) & 3.55(0.29) & 96.84(0.26) & 8.24(0.73) & 91.71(0.75) \\ \hline
OSMTL-e & 7.34(0.69) & 93.46(0.59) & 10.25(0.89) & 93.61(0.57) & 5.86(0.69) & 94.74(0.61) & 10.42(1.18) & 89.68(1.07) \\ \hline
OMTLVON & 18.88(5.70) & 85.55(3.70) & 19.76(0.10) & 89.04(0.06) & 3.54(0.30) & 96.85(0.29) & 10.54(2.47) & 89.52(2.97) \\ \hline
OMTLLOG & 4.81(0.36) & 95.73(0.32) & 7.58(0.65) & 95.36(0.39) & 2.91(0.18) & 97.41(0.16) & 7.16(0.53) & 92.87(0.51) \\ \hline \hline
\textbf{ROMCO-NuCl} & 4.12(0.50) & 96.34(0.44) & 7.06(0.49) & 95.68(0.30) & 2.87(0.42) & 97.43(0.38) & 6.85(0.68) & 93.23(0.66) \\ \hline
\textbf{ROMCO-LogD} & \textbf{4.00(0.42)} & \textbf{96.45(0.37)} & 7.31(0.45) & 95.55(0.27) & \textbf{2.74(0.16)} & \textbf{97.56(0.14)} & \textbf{6.68(0.44)} & \textbf{93.40(0.43)} \\ \hline
\end{tabular}
\end{table*}
\vspace{-0.05in}
\subsubsection{Evaluation Metric}
We evaluated the performance of the aforementioned algorithms by two metrics:
1) Cumulative error rate: the ratio of predicted errors over a sequence of instances.
It reflects the prediction accuracy of online learners.
2) F1-measure: the harmonic mean of precision and recall.
It is suitable for evaluating the learner's performance on class-imbalanced datasets.
We followed the method of \cite{yang2015aggressive} by randomly shuffling the ordering of samples for each dataset and repeating the experiment 10 times with new shuffles. The average results and its standard deviation are reported below.
\begin{table}[t]
\centering
\caption{Run-time (in seconds) for each algorithm}
\label{running_time}
\scriptsize
\begin{tabular}[2.1\textwidth]{|c|c|c|c|c|} \hline
Algorithm & Spam Email & MHC-I & EachMovie \\ \hline
TRML & 73.553 & 361.42 & 391.218 \\ \hline
MTFL & 78.012 & 198.90 & 302.170 \\ \hline
PA-Global & 0.423 & 1.79 & 23.337 \\ \hline
PA-Unique & 0.340 & 1.53 & 26.681 \\ \hline
CW-COL & 0.86 & 4.35 & 31.002 \\ \hline
OMTL & 26.428 & 40.314 & 85.105 \\ \hline
OSMTL-e & 0.360 & 2.327 & 11.43 \\ \hline
OMTLVON & 1.230 & 1.785 & 21.586 \\ \hline
OMTLLOG & 1.145 & 1.371 & 20.232 \\ \hline \hline
\textbf{ROMCO-NuCl} & 11.49 & 4.88 & 33.235 \\ \hline
\textbf{ROMCO-LogD} & 10.59 & 5.352 & 28.716 \\ \hline
\end{tabular}
\label{tab3}
\end{table}
\vspace{-0.01in}
\subsection{Spam Email Filtering}
\vspace{-0.05in}
\begin{figure*}[t]
\centering
\caption{Cumulative error rate on the Email Spam dataset along the entire online learning process}
\label{EmailSpam-figure}
\subfigure {\includegraphics[width=0.2435\textwidth,height=4.4cm]{Email-Spam-Error-logD-T1-new-1.eps}}
\subfigure {\includegraphics[width=0.2435\textwidth,height=4.4cm]{Email-Spam-Error-logD-T2-new-1.eps}}
\hfil
\subfigure {\includegraphics[width=0.2435\textwidth,height=4.4cm]{Email-Spam-Error-logD-T3-new-1.eps}}
\subfigure {\includegraphics[width=0.2435\textwidth,height=4.4cm]{Email-Spam-Error-logD-T4-new-1.eps}}
\end{figure*}
We applied online multi-task learning to build effective personalized spam filters.
The task is to classify each new incoming email massage into two categories: \emph{legitimate} or \emph{spam}.
We used a dataset hosted by the Internet Content Filtering Group.
The dataset contains 7068 emails collected from mailboxes of four users (denoted by \emph{user1}, \emph{user2}, \emph{user3}, \emph{user4}). Basically, the set of all emails received by a user was not specifically generated for that user.
However, the characteristic of each user's email could be said to match user's interest.
Each mail entry was converted to a word document vector using the TF-IDF (term frequency-inverse document frequency) representation.
Since the email dataset had no time-stamp, each email list was shuffled into a random sequence. The cumulative error rate and
F1-measure results of 10 shuffles are listed in Table \ref{email_comparison_result}. In addition, the cumulative error rate for the four specific users along the learning process is presented in Fig. \ref{EmailSpam-figure}. We also report each algorithm's run-time, i.e., the time consumed by both training and test phase during the complete online learning process in Table \ref{running_time}. From these results, we can make several observations.
First, the proposed ROMCO-NuCl/LogD outperform other online learners in terms of the error rate and F1-measure.
In particular, in accordance to the results from the four specific users, learning tasks collaboratively with both the common and personalized structures consistently beats both the global model and the personalized model.
Second, the performance of the proposed online multi-task learning methods are better than that of the two batch learning algorithms (MTFL and TRML). It should be noted that compared to online learners which update models based only on the current
samples, batch learning methods have the advantage of keeping a substantial amount of recent training samples, at the cost
of storage space and higher complexity. In fact, the proposed ROMCO-NuCL/LogD are more efficient than the batch incremental methods,
e.g., it could be more than 100 times faster than batch MTFL in large-sized dataset (28.72 secs versus 302.17 secs in EachMovie as shown in Table \ref{running_time}). ROMCO-NuCL/LogD do not store recent training samples. They only use the current training sample and a simple rule to update the model. In contrast, batch learning algorithms need to keep a certain number of recent training samples in memory,
learning to extra burden on storage and complexity. In addition, both MTFL and TRML need to solve an optimization problem in
an iterative manner. For practical applications involving hundreds of millions of users and features, the batch learning algorithms are no longer feasible, while online learners remain highly efficient and scalable.
We also observed that ROMCO-NuCL/LogD are slightly slower than CW-COL, OMTLVON/LOG and OSMTL-e. This is expected as ROMCO-NuCL/LogD have to update two component weight matrices. However, the extra computational cost is worth considering the significant improvement over the two measurements achieved by using the two components.
\vspace{-0.05in}
\subsection{MHC-I Binding Prediction}
\begin{table}[t]
\centering
\caption{Cumulative error rate (\%) and F1-measure (\%) and its Standard Deviation in the parenthesis on the MHC-I Dataset Results over 12 Tasks}
\label{Bio-table}
\scriptsize
\begin{tabular}[2.1\textwidth] {|c|c|c|c|}
\hline
\multirow{2}{*}{Algorithm} & \multirow{2}{*}{Error Rate} & Positive Class & Negative Class \\
& & F1-measure & F1-measure \\
\hline\hline
MTFL & 43.84(6.05) & 51.04(10.12) & 59.12(7.35) \\ \hline
TRML & 44.26(5.98) & 50.50(9.97) & 58.80(7.40) \\ \hline
PA-Global & 44.70(2.68) & 45.44(9.86) & 61.28(3.17) \\ \hline
PA-Unqiue & 41.62(3.95) & 51.08(10.23) & 63.02(2.89) \\ \hline
CW-COL & 41.32(4.46) & 50.89(10.70) & 63.59(3.08) \\ \hline
OMTL & 41.56(3.97) & 51.13(10.25) & 63.08(2.89) \\ \hline
OSMTL-e & 42.78(0.65) & 50.48(0.43) & 61.59(0.96) \\ \hline
OMTLVON & 38.13(5.03) & 54.73(10.44) & 66.39(4.02) \\ \hline
OMTLLOG & 38.08(5.16) & 54.83(10.56) & 66.40(4.13) \\ \hline \hline
\textbf{ROMCO-NuCl} & 38.09(5.32) & 55.03(10.53) & 66.34(4.09) \\ \hline
\textbf{ROMCO-LogD} & \textbf{37.91(4.97)} & \textbf{55.09(10.10)} & \textbf{66.55(4.14)} \\ \hline
\end{tabular}
\end{table}
\begin{figure*}[t]
\centering
\caption{Cumulative error rate on the 12 tasks of MHC-I dataset along the entire online learning process}
\label{Bio-figure}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-1-logD-new-1.eps}}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-2-logD-new-1.eps}}
\hfil
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-3-logD-new-1.eps}}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-4-logD-new-1.eps}}
\hfil
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-5-logD-new-1.eps}}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-6-logD-new-1.eps}}
\hfil
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-7-logD-new-1.eps}}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-8-logD-new-1.eps}}
\hfil
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-9-logD-new-1.eps}}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-10-logD-new-1.eps}}
\hfil
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-11-logD-new-1.eps}}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.4cm]{MHC-I-12-logD-new-1.eps}}
\end{figure*}
Computational methods have been widely used in bioinformatics to build models to infer properties from biological data~\cite{yang2014ensemble,yang2014ldsplit}. In this experiment, we evaluated several methods to predict peptide binding to human MHC (major histocom-patibility complex) class I molecules. It is known that peptide binding to human MHC-I molecules plays a crucial role in the immune system. The prediction of such binding has valuable application in vaccine designs, the diagnosis and treatment of cancer, etc. Recent
work has demonstrated that there exists common information between related molecules (alleles) and such information can be
leveraged to improve the peptide MHC-I binding prediction.
We used a binary-labeled MHC-I dataset.
The data consists of 18664 peptide sequences for 12 human MHC-I molecules.
Each peptide sequence was converted to a 400 dimensional feature vector following~\cite{LiCHLJ11}.
The goal is to determine whether a peptide sequence (instance) binds to a MHC-I molecule (task) or not, i.e., \emph{binder} or \emph{non-binder}.
We reported the average cumulative error rate and F1-measure of 12 tasks in Table \ref{Bio-table}. To make a clear comparison
between the proposed ROMCO-NuCL/LogD and baselines, we showed the variation of their cumulative error rate along the entire online learning process averaged over the 10 runs in Fig. \ref{Bio-figure}.
From these results, we first observed that the permutations of the dataset have little influence on the performance of each method,
as indicated by the small standard deviation values in Table \ref{Bio-table}. Note that the majority of the dataset belongs to the negative class, thus predicting more
examples as the majority class decreases the overall error rate, but also degrades the accuracy of the minority positive class.
The consistently good performance achieved by the proposed ROMCO-NuCL/LogD in terms of the error rate and F1-measures of both classes further demonstrates effectiveness of our algorithms over imbalanced datasets. Moreover, among the six online models, learning related tasks jointly still achieves better performance than learning the tasks individually, as shown by the improvement of ROMCO and OMTL models over the PA-Unique model.
\begin{figure}[t]
\centering
\caption{Average error rate and F1-measure on the EachMovie dataset over 30 tasks along the entire online learning process}\label{EachMovie_figure}
\subfigure {\includegraphics[width=0.24\textwidth,height=4.5cm]{Movie-Error-logD-new-1.eps}}
\subfigure {\includegraphics[width=0.24\textwidth,height=4.5cm]{Movie-F-measure-logD-new-1.eps}}
\end{figure}
\begin{table}[t]
\centering
\caption{Average Cumulative Error rate (\%) and F1-measure(\%) with their standard deviation in the parenthesis over 30 tasks of EachMovie Dataset Results}
\label{EachMovie-table}
\scriptsize
\begin{tabular}[2.1\textwidth] {|c|c|c|c|}
\hline
\multirow{2}{*}{Algorithm} & \multirow{2}{*}{Error Rate} & Positive Class & Negative Class \\
& & F1-measure & F1-measure \\
\hline\hline
MTFL & 27.51(12.25) & 79.18(12.87) & 36.06(14.85) \\ \hline
TRML & 26.58(11.82) & 79.89(12.49) & 37.64(15.05) \\ \hline
PA-Global & 31.80(5.87) & 74.43(8.61) & 47.96(14.47) \\ \hline
PA-Unqiue & 19.68(7.39) & 82.97(9.35) & 57.80(21.05) \\ \hline
CW-COL & 25.45(6.96) & 78.89(9.30) & 53.95(16.71) \\ \hline
OMTL & 19.44(7.28) & 83.18(9.29) & 57.77(21.39) \\ \hline
OSMTL-e & 20.73(7.15) & 82.31(9.04) & \textbf{58.76(18.71)} \\ \hline
OMTLVON & 18.61(7.29) & 84.45(8.64) & 55.92(23.94) \\ \hline
OMTLLOG & 18.61(7.29) & 84.45(8.64) & 55.92(23.94) \\ \hline \hline
\textbf{ROMCO-NuCl} & 19.14(7.20) & 83.46(9.25) & 58.27(21.17) \\ \hline
\textbf{ROMCO-LogD} & \textbf{18.21(6.71)} & \textbf{84.63(8.41)} & 55.53(25.02) \\ \hline
\end{tabular}
\end{table}
\vspace{-0.05in}
\subsection{Movie Recommender System}
\begin{figure*}
\centering
\caption{Sensitivity analysis on the effect of the parameter $\lambda_1$ and $\lambda_2$ in terms of the error rate}\label{Sensitivity_Figure}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.6cm]{sensitivity_EmailSpam_lemda1_LogD_1.eps}}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.6cm]{sensitivity_EmailSpam_lemda2_LogD_1.eps}}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.6cm]{sensitivity_MHC-I_lemda1_LogD_1.eps}}
\subfigure {\includegraphics[width=0.2445\textwidth,height=4.6cm]{sensitivity_MHC-I_lemda2_LogD_1.eps}}
\end{figure*}
In recent years, recommender systems have achieved great success in many real-world applications.
The goal is to predict users' preferences on targeted products, i.e., given partially observed user-movie rating entries
in the underlying (ratings) matrix, we would like to infer their preference for unrated movies.
We used a dataset hosted by the DEC System Research Center that collected the EachMovie recommendation data for 18 months.
During that time, 72916 users entered a total of 2811983 numeric ratings for 1628 different movies.
We randomly selected 30 users (tasks) who viewed exactly 200 movies with their rating as the target classes.
Given each of the 30 users, we then randomly selected 1783 users who viewed the same 200 movies and used their ratings as the features of the movies.
The six possible ratings (i.e., $\{1,\ldots,6\}$) were converted into binary classes (i.e., \emph{like} or \emph{dislike}) based on the rating order.
Table~\ref{EachMovie-table} shows the comparison results in terms of the average cumulative error rate and F1-measure.
Fig.~\ref{EachMovie_figure} depicts the detailed the cumulative error rate along the entire online learning process over the averaged 30 tasks of the EachMovie dataset.
From these results, we can make several conclusions.
First, it can be seen that the proposed ROMCO-NuCl/LogD outperform other baselines: ROMCO-NuCl/LogD always provide smaller error rates and higher F1-measures compared to other baselines.
It shows that our algorithms can maintain a high quality of prediction accuracy.
We believe that the promising result is generally due to two reasons: First, the \emph{personalized} and \emph{correlative} patterns are effective to discover the personalized tasks and task relativeness, and these patterns are successfully captured in three real-world datasets.
Second, once an error occurs in at least one task, ROMCO-NuCl/LogD would update the entire task matrix.
That would benefit other related tasks with few learning instances since the shared subspaces would be updated accordingly.
Next, we observed that ROMCO-LogD is better than ROMCO-NuCl in Fig. ~\ref{EachMovie_figure} in terms of the error rate and F1-measure. This is expected because compared to the nuclear norm, ROMCO-LogD is able to achieve better rank approximation with the log-determinant function, i.e., it reduces the contribution of large singular values while approximating the small singular values into zeros.
\subsection{Effect of the Regularization Parameters}
\vspace{-0.05in}
We used Spam Email and Human MHC-I datasets as the cases for parameter sensitivity analysis.
In the Spam Email dataset, by fixing $\lambda_2=0.0001$ as well as varying the value of $\lambda_1$ in the tuning set, i.e., $[10^{-6},\ldots,10^0]$, we studied how the parameter $\lambda_1$ affects the classification performance of ; by fixing $\lambda_1=0.0001$ as well as varying the value of $\lambda_2$ in tuning set of $[10^{-7},\ldots,10]$, we study how the parameter affects the performance of ROMCO-NuCl/LogD.
Similarly, in the Human MHC-I dataset, we studied the pair of $(\lambda_1,\lambda_2)$ by fixing $\lambda_2=0.0001$ with the tuning set of $\lambda_1$ $[10^{-5},\ldots,10^0]$ and by fixing $\lambda_1=1$ with tuning set of $\lambda_2$ $[10^{-6},\ldots,10^0]$.
In Fig.~\ref{Sensitivity_Figure}, we show the classification performance of ROMCO in terms of the error rate for each pair of $(\lambda_1,\lambda_2)$.
From Fig.~\ref{Sensitivity_Figure}, we observed that the performance is worse with an increment of either $\lambda_1$ or $\lambda_2$ over the Spam Email dataset.
It indicates a weak relativeness among the tasks and many personalized tasks existing in the Email dataset.
In Human MHC-I, the poor performance is triggered by a small value of $\lambda_1$ or a large value of $\lambda_2$.
Compared with the Email data, MHC-I contains fewer personalized tasks, meanwhile most tasks are closely related and well represented by a low-dimensional subspace.
\vspace{-0.1in}
\section{Conclusion}
We proposed an online MTL method that can identify sparse personalized patterns for outlier tasks, meanwhile capture a shared low-rank subspace for correlative tasks. As an online technique, the algorithm can achieve a low prediction error rate via leveraging previously learned knowledge. As a multi-task approach, it can balance this trade-off by learning all the tasks jointly. In addition, we proposed a log-determinant function to approximate the rank of the matrix, which, in turn, achieves better performance than the one with the nuclear norm. We show that it is able to achieve a sub-linear regret bound with respect to the best linear model in hindsight, which can be regarded as a theoretical support for the proposed algorithm. Meanwhile, the empirical results demonstrate that our algorithms outperform other state-of-the-art techniques on three real-world applications. In future work, online active learning could be applied in the MTL scenario in order to save the labelling cost.
\section*{Appendix}
\subsection*{root computation of the Log-Determinant function}
To solve the log-determinant function, we set the derivative of Eq. (\ref{OptimalSigma_log}) for each $\{\sigma_i\}_{i=1}^r \geq 0$ to zero with $\rho = \eta_1\lambda_1$,
\bqs\notag
\frac{1}{\rho}\sigma_i^3 - \frac{1}{\rho}\hat{\sigma}_i\sigma_i^2 + (\frac{1}{\rho} + 2)\sigma_i - \frac{1}{\rho}\hat{\sigma}_i = 0.
\eqs
Assume that $a = \frac{1}{\rho}$, $b = - \frac{1}{\rho}\hat{\sigma}_i$, $c = \frac{1}{\rho} + 2$ and $d = - \frac{1}{\rho}\hat{\sigma}_i$, we define that
$\Delta = \alpha^2 + \beta^3$, where
\bqs\notag
\alpha = \frac{bc}{6a^2} - \frac{b^3}{27a^3} - \frac{d}{2a}, & & \beta = \frac{c}{3a} - \frac{b^2}{9a^2}.
\eqs
Then the three possible roots of the above cubic equation include one real root and two complex roots,
\bqs\notag
\sigma_i^{(1)} = & -\frac{b}{3a} + \sqrt[3]{\alpha + \sqrt{\Delta}} + \sqrt[3]{\alpha - \sqrt{\Delta}}, \\
\sigma_i^{(2)} = & -\frac{b}{3a} + \frac{\sqrt{3}i - 1}{2}\sqrt[3]{\alpha + \sqrt{\Delta}} - \frac{\sqrt{3}i + 1}{2}\sqrt[3]{\alpha - \sqrt{\Delta}}, \\
\sigma_i^{(3)} = & -\frac{b}{3a} - \frac{\sqrt{3}i + 1}{2}\sqrt[3]{\alpha + \sqrt{\Delta}} + \frac{\sqrt{3}i - 1}{2}\sqrt[3]{\alpha - \sqrt{\Delta}}.
\eqs
According to the $\Delta$, three different scenarios of roots are as follows,
\begin{itemize}
\item if $\Delta > 0$, the equation has a real root and a conjugate pair of complex roots
\item if $\Delta = 0$, the equation has three real roots:
\begin{enumerate}
\item when $\alpha^2 = \beta^3 = 0$, there are three equal real roots;
\item when $\alpha^2 = - \beta^3 \neq 0$, there are two equal real roots.
\end{enumerate}
\item if $\Delta < 0$, there are three unequal real roots.
\end{itemize}
{
\bibliographystyle{IEEEtran}
| {'timestamp': '2017-06-07T02:08:00', 'yymm': '1706', 'arxiv_id': '1706.01824', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01824'} | arxiv |
\section{Exploratory Analysis}\label{sec:streetstyle_analysis}
A key goal of our work is to take automatic predictions from machine
learning and derive statistics from which we can find trends. Some of
these may be commonsense trends that validate the approach, while
others may be unexpected. This section describes several ways to
explore our fashion data, and presents insights one can derive through
this exploratory data analysis.
\subsection{Analyzing trends}
\noindent{\bf Color.} How does color vary over time?
Figure~\ref{fig:streetstyle_color} shows plots of the frequency of
appearance (across the entire world) of several colors over time.
White and black clothing, for example, exhibit a highly periodic
trend; white is at its maximum ($>20\%$ frequency) in September,
whereas black is nearly reversed, much more common in January.
However, if we break down these plots per city, we find that cities in
the Southern Hemisphere flip this pattern, suggesting a correlation
between season and clothing color.
Figure~\ref{fig:streetstyle_color_cities} shows such plots for two
cities, along with a visualization of all pairs of cities correlated
by their white color temporal profiles, with cities reordered by
latitude to highlight this seasonal effect. Cities in the same
hemisphere tend to be highly correlated with one another, while cities
in opposite hemispheres are highly negatively correlated. In the
United States, there is an oft-cited rule that one should not wear
white after the Labor Day holiday (early September). Does this rule
comport with actual observed behavior? Using our method, we can
extract meaningful data that supports the claim that there is a
significant decrease in white clothing that begins mid-September,
shortly after Labor Day, shown in
Figure~\ref{fig:streetstyle_labor_day}.
\begin{figure}[tp]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/major_color_global.pdf}
\caption{{\bf Mean major color score for several different colors.} The means are
computed by aggregating measurements per 1 week intervals and error bars
indicate 95\%\ confidence interval. Colors such as brown and black are
popular in the winter whereas colors such as blue and white are popular in the
summer. Colors such as gray are trending up year over year whereas red, orange
and purple are trending down.\label{fig:streetstyle_color}}
\end{center}
\end{figure}
\begin{figure}[t]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/major_color_cities.pdf}\\
\includegraphics[width=\columnwidth]{streetstyle/figures/white_corr.pdf}
\caption{Top: Mean major color frequency for the color white for two
cities highlighting flipped behavior between the Northern and
Southern Hemisphere. Means are computed by aggregating measurements
per 1 week intervals and error bars indicate a
95\%\ confidence interval. Bottom: Pearson's correlation
coefficients for the mean prediction score of the color white across
all pairs of major world cities. Cities have been ordered by
latitude to highlight the relationship between the northern and
southern hemispheres and their relationship to the seasonal trend of
the color white.}\label{fig:streetstyle_color_cities}
\end{center}
\end{figure}
\begin{figure}[t]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/nyc_white.pdf}
\caption{{\bf Mean frequency for the color white in NYC.} Means are
computed by aggregating measurements per 1 week intervals and error
bars indicate a 95\%\ confidence interval. Dashed lines mark
Labor Day.}\label{fig:streetstyle_labor_day}
\end{center}
\end{figure}
\begin{figure}[t]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/china_red.pdf}
\caption{{\bf Mean frequency for the color red in China.} Means are
computed by aggregating measurements per 1 week intervals and error
bars indicate a 95\%\ confidence interval. Dashed lines mark
Chinese New Year.}\label{fig:streetstyle_chinese_new_year}
\end{center}
\end{figure}
Other colors exhibit interesting, but more subtle trends. The color
red is much less periodic, and appears to have been experiencing a
downward trend, down approximately 1\%\ since a few years
ago. There are also several spikes in frequency that appear each year,
including one small spike near the end of each October and a much
larger spike near the end of each December---that is, near Halloween
and Christmas. We examined our style clusters and found one that
contained images with red clothing and had spikes at the same two
times of the year. This cluster was not just red, but red hats. An
assortment of winter knit beanies and red jacket hoods were present,
but what stood out were a large assortment of Santa hats as well as an
unexpected assortment of red Halloween costumes with red hats or
hoods. It appears that red hats are uncommon enough that when they do
appear they are highly correlated with the exceptional sorts of
costumes worn on these two holidays. Finally, the Chinese New Year
sees a similar spike in the color red in 2015 and 2016, as shown in
Figure~\ref{fig:streetstyle_chinese_new_year} (frequency of red
clothing in China).
\begin{figure}[tp]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/usa_scarves.pdf}
\caption{{\bf Scarf trends in the USA.} Our Instagram-based
measurements are compared to Google Trends. Instagram measurements
are derived from mean scarf frequency aggregated by week with error
bars indicating a 95\%\ confidence interval. Google Trends
signal is per-week ``q=scarf, geo=US'' query volume normalized by
total query volume.\label{fig:streetstyle_scarf}}
\end{center}
\end{figure}
\smallskip \noindent{\bf Clothing types.} We can also explore more
functional clothing attributes. For example, we know people wear
scarves in cold weather, so one would expect to see a seasonal trend
in this attribute. Figure~\ref{fig:streetstyle_scarf} shows such a
trend for visual occurrence of scarves in the United States.
Moreover, we can also compare with a secondary source of information
to estimate this signal, Google
Trends.\footnote{\url{https://www.google.com/trends/explore\#q=scarf\&geo=US}}
Google Trends provides historical trend data for Google Search
queries. By comparing these two signals, we can make several
observations. First, the shapes of the signals are similar. Both
feature a sudden attack and decay rather than a purely sinusoidal
shape. This correlation increases our confidence that our vision-based
signal is measuring something reasonable. Second, the onset of the
signal derived from Google Trends tends to come prior to the onset
from the Instagram photos. One explanation for this behavior is that
people are searching for scarves on Google in order to purchase them
and Instagram allows us to measure when they are actually wearing
them. Third, while Google Trends suggests that scarves are in a
significant downward annual trend, the Instagram results serve to
constrast this trend (scarves are {\em up} in the winter of
2014-2015). While more study would be needed to determine the cause of
such a phenomenon, this comparison illustrates the utility of our
approach for devising new hypotheses for follow-up investigation. The
visual data and the Google search data combine to give us a richer
sense of what is happening in the world, and allow us to formulate new
views about the underlying human behavior.
\begin{figure}[tp]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/wearing_jacket__Yes_map.png}
\caption{{\bf Mean jacket frequency per country.} Countries with $\ge$
1,000 photos included (other countries shown in
gray).}\label{fig:streetstyle_jackets}
\end{center}
\end{figure}
\begin{figure}[tp]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/wearing_hat__Yes_map.png}\\
\includegraphics[width=0.75\columnwidth]{streetstyle/figures/oman_hats.jpg}\\
\caption{Top: Mean hat frequency per country. Countries with $\ge$ 1,000 photos
included (other countries shown in gray). Bottom: Several top-ranked examples
of hats in Oman. While not strictly hats, it is clear that the classifier has
learned to identify more generally, head coverings.
}\label{fig:streetstyle_hats}
\end{center}
\end{figure}
So far we have focused on temporal trends, but we can also explore
geographic trends. Can we validate our attribute classifications
using prior knowledge of climate and weather-related clothing? For
example, where in the world do people wear jackets?
Figure~\ref{fig:streetstyle_jackets} shows the percentage of detected
people who are wearing jackets, broken down by country. This map
accords with intuition. Countries further north tend to feature more
jackets. In South America, more jackets are found as you go further
west (e.g., in Boliva or Colombia)---winter clothes will tend to be
worn more often at higher elevation (in this case in the Andes) than
at lower elevations.
What about more unexpected geographic trends? Where in the world are
people wearing hats? Figure~\ref{fig:streetstyle_hats} shows the
percentage of photos per country that contain people wearing hats.
Once again, people wear hats in colder places, but interestingly in
Oman, hats are evidently extremely popular.
Figure~\ref{fig:streetstyle_hats} shows several examples of images
from Oman that are highly ranked as wearing hats. In particular, the
kuma and massar are popular in Oman, as they are an important element
of the men's national dress.
\subsection{Visualizing styles}\label{sec:vis_styles}
We also wish to visualize commonly occuring combinations of
attributes, or ``styles.'' To visualize styles, we use the method in
Section~\ref{subsec:clusters} to compute style clusters from the
embedded photos. Figure~\ref{fig:streetstyle_gmm_clusters} shows
several such clusters, in no particular order. Given these clusters,
then for every photo in our dataset, we compute the style cluster
centroid to which it is closest. We can then perform additional
analyses using these style clusters, such as plotting the frequency of
visual occurrence of each cluster across space and time to mine for
styles that are well localized in one or both.
\begin{figure*}[tbp]
\begin{center}
\includegraphics[width=\textwidth]{streetstyle/figures/city_entropy_clusters.jpg}
\caption{{\bf Style clusters sorted by entropy across cities.}
Clusters that are more distinctive for given cities are ranked
higher. Each cluster contains thousands of people so we visually
summarize them by the people closest to the cluster center (left),
and the histogram of all people in the cluster across each city
(right).\label{fig:streetstyle_rank_cities}}
\end{center}
\end{figure*}
\begin{figure*}[p]
\centering
\begin{tabular}{c}
\includegraphics[width=0.95\textwidth]{streetstyle/figures/top_citymonth.jpg}\\
Top five clusters sorted by space-time entropy.\\ \\
\includegraphics[width=0.95\textwidth]{streetstyle/figures/bottom_citymonth.jpg}\\
Bottom five clusters sorted by space-time entropy.
\end{tabular}
\caption{{\bf Style clusters sorted by space-time entropy.} Each
cluster contains thousands of people so we visually summarize them
by the people closest to the cluster center (left), the average
image of the 200 people closest to the center (middle), and the
space-time histogram of all people in the cluster (right). The
histogram lists 36 cities along the X-axis and months along the
Y-axis. These histograms exhibit several types of patterns: vertical
stripes (e.g., rows 1 and 2) indicate that the cluster appears in
specific cities throughout the year. Horizontal stripes correspond
to specific months or seasons. (Note that summer and winter months
will be reversed in the Southern Hemisphere.) For example, the fifth
row is a winter fashion. A single bright spot can correspond to a
special event (e.g., the soccer jerseys evident in row 3).
}\label{fig:sorted_clusters}
\end{figure*}
This raw visualization of style clusters is not particularly easy to
explore, as there are hundreds of such clusters. Therefore, it is
useful to define a ranking function to help surface the most
interesting signals. One way to rank clusters is according to entropy
over the different cities in the dataset---high-entropy clusters will
tend to be specific to a few cities, while low-entropy clusters tend
to be universal. Figure~\ref{fig:streetstyle_rank_cities} shows the
top clusters for such a ranking. This ranking helps provide a sense
of how geography affects clothing: headscarves are common in, for
instance, Jakarta and Cairo, cities in Europe tend to have a higher
percentage of winter clothing than other countries, etc.
Figure~\ref{fig:sorted_clusters} shows a set of top and bottom ranked
clusters according to entropy computed across both city and month, as
well as an average image of people in each cluster. This method for
ordering clusters is very revealing:
\begin{packed_item}
\item Regional clothing is very evident as distinct vertical
structures in the histogram. The {\em gele} (Nigerian head-tie) is
very distinctive of Lagos, Nigeria.
\item Yellow sports jerseys are incredibly well-concentrated at a
specific time and place (Bogota, Colombia, during the World Cup).
\item Certain styles are common around the world and throughout the
year. For instance, blue collared shirts, plaid shirts, and black
t-shirts.
\end{packed_item}
\begin{figure}[h]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/cluster5.pdf}
\caption{High-ranking spatio-temporal cluster illustrating that yellow
t-shirts with graphic patterns were very popular for a very short
period of time, June-July 2014, in specifically Bogotá, Karachi, Rio
de Janeiro, and São Paulo.\label{fig:streetstyle_cluster4}}
\end{center}
\end{figure}
\begin{figure}[h]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/cluster7.pdf}
\caption{High-ranking spatio-temporal cluster illustrating that black polo
shirts with glasses are popular in Singapore and throughout the Indian
subcontinent.\label{fig:streetstyle_cluster6}}
\end{center}
\end{figure}
Figures~\ref{fig:streetstyle_cluster4} and
\ref{fig:streetstyle_cluster6} illustrate two other interesting top
ranked clusters. Figure~\ref{fig:streetstyle_cluster4} shows that
clusters can capture styles that become extremely popular at a very
specific time and place, and is a variant of the yellow jersey cluster
above. In this case, June and July 2014 capture the 2014 World Cup,
and the contents of these clusters contain many examples of soccer
fans wearing team colors. Finally,
Figure~\ref{fig:streetstyle_cluster6} shows that a style that one
might consider commonplace (black polo shirts with glasses) can be
much more popular throughout a specific region (in this case the
Indian subcontinent).
\section{Conclusions and Discussion}\label{sec:streetstyle_conclusion}
In this work we presented a framework for analyzing clothing, style,
and fashion across the world using millions of photos. Towards that
end, we developed {\sc{StreetStyle-27k}}\xspace, a large-scale, worldwide dataset of
people in the wild with clothing annotations, and used this dataset to
enable the analysis of a massive 15 million person photo corpus
through the application of CNNs. Our work illustrates the use of
machine learning and big data to perform visual discovery at scale.
\smallskip \noindent{\bf Limitations.} CNN-based embeddings are a very
powerful approach for organizing imagery in a high-dimensional feature
space. Furthermore, unsupervised methods such as GMMs can be used to
further explore this space. However, there is a limit to the
granularity of styles that we obtain. For instance, we do not learn a
clean separation between eyeglasses and sunglasses, as those were not
labeled as distinct attributes, and our style embedding does not
separate those two categories. One way to discover finer-grained
styles would be to incorporate active learning, where users are asked
to rank similarity of styles. Another would be to apply
weakly-supervised learning using the spatio-temporal metadata directly
in the embedding objective function rather than using it for post hoc
analysis. Finally, our method is limited to analyzing the upper body
of the person. As computer vision techniques for human pose
estimation mature, it would be useful to revisit this design to
normalize articulated pose for full body analysis.
\smallskip \noindent{\bf Future work.} There are many areas for future
work. We would like to more thoroughly study dataset bias. Our current
dataset measures a particular population, in a particular context
(Instagram users and the photos they take). We plan to extend to
additional image sources and compare trends across them, but also to
study aspects such as: can we distinguish between the (posed) subject
of a photo and people who may be incidentally in the background? Does
that make a difference in the measurements? Can we identify and take
into account differences between tourists and locals? Are there
certain types of people that tend to be missing from such data? Do our
face detection algorithms themselves exhibit bias? We would also like
to take other difficult areas of computer vision, such as pose
estimation, and characterize them in a way that makes them amenable to
measurement at scale.
Ultimately, we would like to apply automatic data exploration
algorithms to derive, explain, and analyze the significance of
insights from machine learning (e.g., see the ``Automatic
Statistician''~\cite{lloyd:aaai:2014}). It would be also be
interesting to combine visual data with other types of information,
such as temperature, weather, and textual information on social media
to explore new types of as-yet unseen connections. The combination of
big data, machine learning, computer vision, and automated analysis
algorithms, would make for a very powerful analysis tool more broadly
in visual discovery of fashion and many other areas.
\section{Data}\label{sec:streetstyle_data} Out dataset consists of three key
parts: (1) photos, (2) the people in those photos, and (3) the
clothing attributes of those people.
\smallskip \noindent{\bf Photos.} The photos we use in our analysis
were acquired via Instagram, a popular mobile photography social
network. We chose Instagram due to the sheer volume of uploads---an
advertised 95 million photos/videos per
day\footnote{\url{http://time.com/4375747/instagram-500-million-users/}}---as
well as their providing a public photo search
API.\footnote{\url{https://www.instagram.com/developer/}} Users can
query this API to retrieve images that have been uploaded within a 5
kilometer radius of a specified latitude and longitude and within 5
days of a specified date.
\begin{figure}[tp]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/person_detections_map.pdf}
\caption{{\bf Geo-spatial distribution of images collected from Instagram}
(after filtering for images of people). Images were collected
according to two distributions: a set of the world cities (yellow
dots), and a distribution over the entire Earth (blue). The shade of
blue shows the number of photos downloaded from a particular region
(according to a logarithmic
scale).}\label{fig:streetstyle_distribution}
\end{center}
\end{figure}
\input{streetstyle/cities}
How should we sample photos geographically? To answer this question,
we consider two types of experiments we wish to conduct: (1) a
comparison of major world population centers,
and (2) a nation-, continent-, or world-wide analysis of styles and
trends. To sample photos for goal (1) (analysis of urban centers), we
made a list of 44 major cities spanning six continents, each with a
lat/long approximating the city center, shown as yellow dots in
Figure~\ref{fig:streetstyle_distribution}. The complete list of cities
is shown in Table~\ref{tab:streetstyle_cities}.
For each city, we sampled photos centered on those coordinates from
Instagram.
To sample photos for goal (2) (globally distributed photos), we used
the Flickr 100M photo dataset~\cite{thomee:arxiv:2015} to derive a
distribution of photo uploads over the globe. In particular, we
extracted the approximately 48 million geotags from Flickr 100M, and
used these geotags to compute a geographic distribution from which to
sample photos from Instagram. This distribution (after filtering by
person detection, as discussed below) is shown in blue in
Figure~\ref{fig:streetstyle_distribution}.
For both sampling strategies, we uniformly sampled a 5-day window from
June 2013---the earliest date Instagram provided results---until June
2016. For each photo, we record its geolocation and timestamp. In
total, we retrieved over 100 million photos.
\smallskip \noindent {\bf People.} To find people in photos, we ran
two out-of-the-box vision algorithms on each downloaded photo, one
to detect and localize faces, and the second to estimate the
visibility of the rest of the body. To detect faces, we used the API
provided by Face++.\footnote{\url{http://www.faceplusplus.com/}} The
output of the Face++ detector is a bounding box for the face, as well
as facial landmark keypoints. We use the face bounding box to
geometrically align people in our analysis algorithms. To determine
body visibility, we use the Deformable Part
Model~\cite{felzenszwalb:pami:2010,girshick:code:2012} and the
provided person detector trained on
VOC2010~\cite{everingham:site:voc2010}.
\begin{figure}[tp]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/crop_examples.jpg}
\caption{Left: Given an approximate person detection and a precise
face localization, we generate a crop with canonical position and
scaling to capture the head and torso of the person. Right: Example
people from our dataset.}\label{fig:streetstyle_crop}
\end{center}
\end{figure}
Given a set of faces and visible bodies in a photo, we pair them up
using a simple distance-based heuristic. For each face, we compute a
canonical image crop based on the position and scale of the detected
face, illustrated in Figure~\ref{fig:streetstyle_crop}. If the crop
extends beyond the visible body bounding box, we discard the
detection.
In total, out of the more than 100 million photos we retrieved from
Instagram, 37.7 million had at least one successful person
detection. For our work, we chose to keep detections with at least the
face and torso visible. We do not analyze the lower part of the body
since the legs are often occluded in online photos. After generating
canonical crops from the face detections and filtering on face and
torso visibility, we gathered a total of 14.5 million images of
people.
\begin{table}
\begin{center}
\resizebox{\columnwidth}{!}{\begin{tabular}{|c|c|c|} \hline & {\bf No}
& {\bf Yes} \\
\hline Wearing Jacket & 18078 & 7113 \\ Collar Presence & 16774 & 7299 \\
Wearing Scarf & 23979 & 1452\\ Wearing Necktie & 24843 & 827\\ Wearing Hat &
23279 & 2255\\ Wearing Glasses & 22058 & 3401\\ Multiple Layers & 15921 & 8829\\
&&\\ &&\\ &&\\ &&\\ &&\\ &&\\ &&\\ \hline
\end{tabular}
{\hskip 0.1cm}
\begin{tabular}{|c|}
\hline {\bf Major} \\ {\bf Color} \\ \hline Black (6545) \\ White (4461) \\ 2+ colors (2439)
\\ Blue (2419) \\ Gray (1345)\\ Red (1131)\\ Pink (649)\\ Green (526)\\ Yellow
(441)\\ Brown (386)\\ Purple (170)\\ Orange (162)\\ Cyan (33)\\ \hline
\end{tabular}
\begin{tabular}{|c|}
\hline {\bf Clothing} \\ {\bf Category} \\ \hline Shirt (4666) \\ Outerwear (4580) \\
T-shirt (4580) \\ Dress (2558) \\ Tank top (1348) \\ Suit (1143) \\ Sweater
(874) \\ \hline \hline {\bf Sleeve} \\ {\bf Length} \\ \hline Long sleeve (13410) \\ Short
sleeve (7145) \\ No sleeve (3520) \\ \\ \hline
\end{tabular}
\begin{tabular}{|c|}
\hline {\bf Neckline} \\ {\bf Shape} \\ \hline Round (9799) \\ Folded (8119) \\ V-shape
(2017) \\ \hline \hline {\bf Clothing} \\ {\bf Pattern} \\ \hline Solid (15933) \\ Graphics
(3832) \\ Striped (1069) \\ Floral (885) \\ Plaid (532) \\ Spotted (241)\\ \\ \\
\hline
\end{tabular}
}
\caption{{\bf Fashion attributes in our dataset}, along with the number of
MTurk annotations collected for each attribute. Left: Binary
attributes. Right: Attributes with three or more
values.}\label{table:streetstyle_attributes}
\end{center}
\end{table}
\smallskip \noindent{\bf Clothing annotations.} For each person in our
corpus of images, we want to extract fashion information. To do so, we
first collect annotations related to fashion and style for a subset of
the data, which we later use to learn attribute classifiers that can
be applied to the entire corpus. Example attributes include: {\em What
kind of pattern appears on this shirt? What is the neckline? What
is the pattern? Is this person wearing a hat?} We created a list
of several clothing attributes we wished to study a priori, such as
clothing type, pattern, and color. We also surveyed prior work on
clothing attribute recognition and created a consolidated list of
attributes that we observed to be frequent and identifiable in our
imagery. We began with several of the attributes presented by Chen
{\em et~al.}~\cite{chen:eccv:2012} and made a few adjustments to more clearly
articulate neckline type as in the work of Di
{\em et~al.}~\cite{di:cvprw:2013}. Finally, we added a few attributes of our
own, including \emph{wearing-hat} and \emph{wearing-jacket}, as well
as an attribute indicating whether or not more than one layer of
clothing is visible (e.g., a suit jacket over a shirt or an open
jacket showing a t-shirt
underneath). Table~\ref{table:streetstyle_attributes} shows our full
list of attributes.
We annotated a 27K-person subset of our person image corpus with these
attributes using Amazon Mechanical Turk. Each Mechanical Turk user
was given a list of 40 photos, presented one-by-one, and asked to
select one of several predefined attribute labels. In addition, the
user could indicate that the person detection was faulty in one of
several ways, such as containing more than one person or containing no
person at all. Each set of 40 photos contained two photos with known
ground truth label as sentinels. If a worker failed at least five
sentinels and their sentinel failure rate was above 20\%, we
prevented them from performing any more work for our tasks.
Compensation for a single attribute on a set of 40 photos was 0.10
USD. Average wage was approximately 4 USD / hour. An attribute for
an image was labeled by five separate workers, and a different set of
five workers labeled each attribute for an image. A label was
accepted if 3 / 5 workers agreed, otherwise it was excluded from the
data. In total these annotations cost approximately 4K USD. We refer
to our annotated dataset as {\sc{StreetStyle-27k}}\xspace.
\smallskip \noindent{\bf Dataset bias and limitations.} Any dataset
has inherent bias, and it is important to be cognizant of these biases
when drawing conclusions from the data. Instagram is a mobile social
network, so participants are more likely to be in regions where
broadband mobile Internet is available, and where access to Instagram
is not censored or blocked. In some areas, people might be more
likely to upload to a competitor service than to Instagram. People of
certain ages might be more or less likely to upload to any social
network. Cultural norms can affect who, when, where, and what people
photograph. The face detector we use is an off-the-shelf component
for which no reported statistics regarding bias for age, gender, and
race are made available. The person detector has also not been
evaluated to determine bias in these factors either. These factors
impact who will and will not be properly added to our dataset, which
could introduce bias. As vision methods mature, analyses for such bias
will become increasingly important.
\section{Introduction} \label{sec:streetstyle_intro}
Our age of big data presents us with the compelling opportunity to use
all available information to measure the world in ways that were never
before possible. Large amounts of data---for instance, OCRed scans of
centuries worth of books---coupled with tools for exploring this data
have yielded powerful new mechanisms for scientists to study our
history, culture, and behavior~\cite{michel:science:2010}. This
opportunity is magnified by the massive scale at which humans are
generating cultural artifacts on social media, and by the increasing
power of machine learning techniques. For instance, by applying
natural language processing to millions of Twitter messages, we can
discover relationships between time of day and mood that leverage
sample sizes much larger than those of any traditional
study~\cite{golder:science:2011}.
To date, most of these new kinds of big data analyses have been
limited to structured data, such as user interactions on social
networks, or to textual data, such as books and tweets. However, a
tremendous cache of unstructured visual information about our world is
locked in images, particularly in images of people, including the
billions of photos uploaded to photo-sharing services each
day. Imagine a future anthropologist with access to trillions of
photos of people---taken over centuries and across the world---and
equipped with effective tools for analyzing these photos to derive
insights. What kinds of new questions can be answered? This problem
area of {\em data-driven visual discovery} is still new, but is
beginning to gain attention in computer vision and
graphics~\cite{doersch:siggraph:2012,wang:iccvw:2013,zhu:siggraph:2014,ginosar:iccvw:2015,gebru:arxiv:2017}.
Our work takes a step towards this vision by analyzing geo-spatial
trends in fashion style across tens of millions of images from social
media.
In this paper, we focus on clothing, as it is a critical aspect of the
visual world and of our daily lives. Individuals make fashion choices
based on many factors, including geography, weather, culture, and
personal preference. The ability to analyze and predict trends in
fashion is valuable for many applications, including analytics for
fashion designers, retailers, advertisers, and manufacturers. This
kind of analysis is currently done manually by analysts by, for
instance, collecting and inspecting photographs from relevant
locations and times.
We aim to extract meaningful insights about the geo-spatial and
temporal distributions of clothing, fashion, and style around the
world through social media analysis at scale. We do so through the
combination of (1) millions of photos spanning the world---photos
uploaded to social media services by everyday users, (2) a new
dataset, {\sc{StreetStyle-27k}}\xspace, consisting of a subset of these images
annotated with fashion attributes, and (3) powerful machine learning
methods based on deep learning that leverage our dataset. We explore
two kinds of machine learning methods: supervised learning methods
that are trained on our annotated dataset to predict clothing
attributes in new images, followed by unsupervised clustering methods
that can automatically detect visual correlations in our data (such as
particular types of headwear, as in Figure~\ref{fig:teaser}(b), top
row).
These machine learning methods allow us to measure clothing features
across millions of photos, and then to use these measurements to
produce analyses in the form of trend reports and map-based
visualizations, enabling new types of visual insight. For instance,
our framework can help answer questions such as:
\begin{packed_item}
\item How is the frequency of scarf use in the US changing over time?
(Figure~\ref{fig:streetstyle_scarf})
\item What styles are most specific to particular regions of the world
or time of the year? Conversely, which styles are popular across the
world? (Figures~\ref{fig:streetstyle_rank_cities} and
\ref{fig:sorted_clusters})
\item For a given city, such as Los Angeles, what styles are most
characteristic of that city (popular in LA, but rare elsewhere)?
(Figures~\ref{fig:teaser}(c) and \ref{fig:streetstyle_rank_cities}.
\end{packed_item}
Our approach also demonstrates the utility of machine learning methods
for vastly simplifying the process of making real-world measurements
from large-scale visual data.
In summary, our work makes the following contributions:
\begin{packed_enum}
\item {\sc{StreetStyle-27k}}\xspace, an annotated dataset of people containing 27K
images, each with 12 clothing attributes, to be made publicly
available,
\item a methodology for analyzing millions of photos to produce a
visual clothing embedding (shown in Figure~\ref{fig:teaser}(a)),
then using this embedding to predict clothing attributes in new
photos,
\item the use of unsupervised clustering methods to automatically
predict visual correlations between clothing attributes (in the form
of {\em style clusters}, Figure~\ref{fig:teaser}(b)), and
\item a first-of-its-kind analysis of global and per-city fashion
choices and trends using our machine learning methods.
\end{packed_enum}
We provide additional visualizations of our results at
\url{http://streetstyle.cs.cornell.edu}.
\section{Machine Learning Methodology}\label{sec:streetstyle_method}
To make measurements across the millions of photos in our dataset, we
wish to generalize labeled data from {\sc{StreetStyle-27k}}\xspace to the entire
corpus. For instance, to measure instances of glasses across the
world, we want to use all of the {\em wearing-glasses} annotations as
training data and predict the {\em wearing-glasses} attribute in
millions of unlabeled images. To do so we use Convolutional Neural
Networks (CNNs)~\cite{krizhevsky:nips:2012}. A CNN maps an input
(e.g., the pixels of an image), to an output (e.g., a binary label
representing whether or not the person is wearing glasses), by
automatically learning a rich hierarchy of internal image features
given training data. In this section, we describe the architecture of
our particular CNN, how we trained it using our labeled attribute
dataset, and how we evaluated the classifier's performance on the
clothing attribute prediction task. We then discuss how and when it
is appropriate to generate predictions from this CNN across millions
of photos and use these predictions to estimate real-world fashion
statistics.
\subsection{Learning attributes} A key design decision in creating a CNN is
defining its network architecture, or how the various types of
internal image processing layers are composed. The penultimate layer
of a typical CNN outputs a multi-dimensional (e.g., 1024-D) feature
vector, which is followed by a ``linear layer'' (matrix product)
operation that outputs one or more prediction scores (e.g., values
indicating the probability of a set of attributes of interest, such as
{\em wearing-glasses}). The base architecture for our CNN is the
``GoogLeNet'' architecture~\cite{szegedy:cvpr:2015}. While several
excellent alternatives exist (such as VGG~\cite{simonyan:arxiv:2014}),
GoogLeNet offers a good tradeoff between accuracy on tasks such as
image classification~\cite{russakovsky:ijcv:2015} and speed. As with
other moderate-sized datasets (fewer than 1 million training
examples), it is difficult to train a CNN on our attribute prediction
task from scratch without overfitting. Instead, we start with a CNN
pretrained on image classification (on ImageNet ILSVRC2012) and
fine-tune the CNN on our data. After ImageNet training, we discard
the last linear layer of the network to expose the 1024-dimensional
feature output and then append several $1024\times N_i$ linear layers
in parallel where $N_i$ is the number of class labels for attribute
$i$ (for instance, $N_i = 2$ for a binary attribute such as {\em
wearing-glasses}, and $N_i = 3$ for neckline shape as we consider
three possible shapes).
\smallskip \noindent{\bf Training details.} We train the CNN as
follows. For each attribute, we use stratified sampling to first
select an attribute label and then a particular example image with
that label. This sampling strategy counteracts the implicit imbalance
within each attribute (e.g., wearing a hat is much less common than
not wearing a hat). We do this 32 times to build a single mini-batch
of images. Using this mini-batch, we apply the forward and backward
passes of the CNN to compute the parameter gradient with respect to
the cross-entropy loss. We do this for each attribute, accumulating
the gradients. Then we use stochastic gradient descent with momentum
$= 0.9$, learning rate $= 10^{-2}$, and weight decay $= 10^{-4}$ to
update the parameters of the CNN. We fine-tune the CNN for 6,000
iterations ($\times 12$ attributes) after which the mean class
accuracy on a validation set stopped increasing. 80\%\ of
{\sc{StreetStyle-27k}}\xspace\ was used for training, 10\%\ was used as
validation to determine when to stop training as well as for the
additional analysis in this section, and 10\%\ was used as a
test set for a final evaluation of the attribute classification task.
\begin{table}[t]
\begin{center}
\resizebox{\columnwidth}{!}{\begin{tabular}{|c|c|c|c|} \hline {\bf
Attribute} &
\begin{tabular}{@{}c@{}}{\bf Our CNN} \\(acc. / mean class. acc.)\end{tabular} &
{\bf Random guessing}& {\bf Majority guessing} \\ \hline \hline wearing jacket & 0.869 /
0.848 &0.5 / 0.5 & 0.698 / 0.5 \\ clothing category & 0.661 / 0.627 &0.142 /
0.142 & 0.241 / 0.142 \\ sleeve length &0.794 / 0.788 & 0.333 / 0.333 & 0.573 /
0.333 \\ neckline shape & 0.831 / 0.766 &0.333 / 0.333 & 0.481 / 0.333 \\ collar
presence & 0.869 / 0.868 & 0.5 / 0.5 & 0.701 / 0.5 \\ wearing scarf & 0.944 /
0.772 & 0.5 / 0.5 & 0.926 / 0.5 \\ wearing necktie & 0.979 / 0.826 & 0.5 / 0.5 &
0.956 / 0.5\\ clothing pattern & 0.853 / 0.772 & 0.166 / 0.166 & 0.717 / 0.166
\\ major color & 0.688 / 0.568 & 0.077 / 0.077 & 0.197 / 0.077 \\ wearing hat &
0.959 / 0.917 & 0.5 / 0.5 & 0.904 / 0.5\\ wearing glasses & 0.982 / 0.945 & 0.5
/ 0.5 & 0.863 / 0.5 \\ multiple layers & 0.830 / 0.823 & 0.5 / 0.5 & 0.619 /
0.5\\ \hline
\end{tabular}}
\caption{{\bf Test set performance for the trained CNN.} Since each
attribute has an unbalanced set of test examples, we report both
accuracy and mean classification accuracy. For reference, we also
include baseline performance scores for random guessing and majority
class guessing.}\label{table:streetstyle_accuracy}
\end{center}
\end{table}
\begin{figure}[t]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/confusion.pdf}
\caption{{\bf Confusion matrices for each clothing attribute.} Given class
labels are vertical and predicted class labels are horizontal. Each
row has been normalized such that a cell indicates the probability
of a classification given some true
label.\label{fig:streetstyle_confusion}}
\end{center}
\end{figure}
Table~\ref{table:streetstyle_accuracy} summarizes the accuracy and
mean class accuracy of our learned classifiers for each attribute on
the held-out test set. Figure~\ref{fig:streetstyle_confusion} shows a
set of confusion matrices, one per attribute, illustrating which
attributes tend to get confused for one another (e.g., spotted shirts
can be mistaken for floral shirts). While the classifiers perform
quite well in general (e.g., {\em wearing-hat} has an accuracy over
90\%), even state-of-the-art CNNs make mistakes, and so all of
the classifiers have an inherent error level. We now discuss how we
take this error into account when using these classifiers.
\subsection{Measuring attributes at scale} Our aim is not just to build a
classifier for each clothing attribute and maximize some performance
criterion on a test set, but to take that learned classifier, apply it
to a much larger corpus of images spanning years worth of the world's
photos, and provide a tool for discovering interesting trends.
However, the classifiers are not perfect, and any real-world
measurement is going to have some noise. While it is inevitable that
a classifier will have some non-zero variance, the hope is that the
estimation is unbiased, that is, as we increase the sample size, a
computed statistic, such as the detected percentage of people wearing
hats in photos, will converge on the true percentage of people wearing
hats. However, by examining the confusion matrices in
Figure~\ref{fig:streetstyle_confusion} it becomes clear that this will
not be the case. For example, the proportion of images featuring
people wearing neckties is much less than 50\%. For this
attribute, the classifier predicts \textbf{No} correctly
99\%\ of the time, but \textbf{Yes} correctly only
65\%\ of the time. Therefore, the estimate of the percentage of
people wearing neckties in photos will be biased towards \textbf{No}.
\begin{figure*}[h]
\begin{center}
\includegraphics[width=\textwidth]{streetstyle/figures/calibration.pdf}
\caption{{\bf Reliability curves for several clothing attributes.} A
well-calibrated reliability curve has fraction of positives equal to
mean predicted value. Neural networks tend to produce
well-calibrated probabilities, but significant improvement is made
using Isotonic regression for additional
calibration.\label{fig:streetstyle_reliability}}
\end{center}
\end{figure*}
One way to mitigate this bias is to calibrate the scores of a
classifier using a function that models the posterior probability of
the classification being correct given the classification score.
There are several methods for this type of calibration, including
Platt scaling (an application of logistic
regression)~\cite{platt:book:1999} and isotonic regression. Others
have noted that neural networks tend not to require calibration as
severely as classifiers such as SVMs and boosted decision
trees~\cite{niculescu:icml:2005}. Nevertheless, we found that our
networks benefited from calibration by applying isotonic regression to
our validation set. Figure~\ref{fig:streetstyle_reliability} shows
the generalization performance of calibration for several attribute
labels. Note that after isotonic regression, the curves are very
close to the identify function ($y=x$), which means that these curves
are properly calibrated.
In our experiments, half of the validation set was used for training the
regressor and the other half was used to generate reliability curves.
Isotonic regression typically requires more data to avoid overfitting,
yet is more flexible when the calibration required is not sigmoidal,
an underlying assumption of Platt scaling. The generalization shows
that these estimates do not exhibit severe overfitting and therefore
we opt to use isotonic regression trained on the entire validation set
to calibrate the scores.
\subsection{Visually consistent style clusters} \label{subsec:clusters}
\begin{figure}[tp]
\begin{center}
\includegraphics[width=\columnwidth]{streetstyle/figures/tsne.pdf}
\caption{{\bf t-SNE visualization of our learned fashion feature
space.} The style embedding is 1024-dimensional and is visualized
in 2D here. Several combinations of attributes are highlighted.
For example, white shirts with text, plaid shirts, black v-neck
shirts, etc., are styles discoverable in this embedding. Zoom to see
detail.} \label{fig:tsne}
\end{center}
\end{figure}
\begin{figure*}[tp]
\begin{center}
\includegraphics[width=\textwidth]{streetstyle/figures/gmm_clusters.jpg}
\caption{{\bf Visualization of 12 style clusters}, showing images
closest to the centroid of each cluster. Clusters are shown in no
particular order. Each style cluster reveals a visual theme as a
combination of attributes, such as ``white graphic tees and
glasses'' (top-left cluster). \label{fig:streetstyle_gmm_clusters}}
\end{center}
\end{figure*}
The predicted attributes are immediately useful in plotting and
analyzing trends, such as ``how is the proportion of people wearing
black in Los Angeles changing over time?'' as we demonstrate in
Section~\ref{sec:streetstyle_analysis}. However, we would like to
analyze clothing styles beyond these attributes in a number of ways:
\begin{packed_item}
\item Identify common, visually correlated combinations of these basic
attributes (e.g., {\em blue sweater with jacket and wool hat}).
\item Identify styles that appear more frequently in one city versus
another or more frequently during particular periods of time.
\item Identify finer-grained, visually coherent versions of these
elements (e.g., sports jerseys in a particular style).
\end{packed_item}
To achieve these goals, we use clustering to identify recurring {\em
visual themes} in the embedded space of people. Recall that the
penultimate layer of our network is a 1024-dimensional feature space
where distinct fashion attributes are linearly
separable. Figure~\ref{fig:tsne} shows a visualization of this feature
space projected to 2D using t-SNE~\cite{maaten:jmlr:2008}. Within this
1024-D feature space, people images are organized according to visual
fashion attributes, through the mechanism of training on our
{\sc{StreetStyle-27k}}\xspace dataset. The ideas is that by clustering images in this
1024-D embedded feature space, we can discover and reveal visual
themes such as those described above. We refer to such clusters as
{\bf style clusters}.
Once we identify style clusters, we can further characterize cities
and times in terms of these clusters---for instance, we might discover
that some clusters are heavily correlated with one or two particular
cities,
as we explore in Section~\ref{sec:streetstyle_analysis}.
Figure~\ref{fig:streetstyle_gmm_clusters} shows an example of several
style clusters found by our approach.
To find style clusters, we ran a clustering algorithm on a subset of
the full dataset, for efficiency and to achieve balance between
different times and regions of the world. In particular, we divided
our images into bins by city and by week (e.g., Paris in week 26 of
2015). For bins with fewer than $N$ images, we selected all images,
and for bins with more than $N$ images, we randomly selected $N$
images. For our experiments, we set $N = 4000$, for a total of 5.4M
sample images for clustering in total.
For each cropped person image in this set, we compute its 1024-D CNN
feature vector and $L_2$ normalize this vector. We run PCA on these
normalized vectors, and project onto the top principal components that
retain 90\%\ of the variance in the vectors (in our case, 165
dimensions). To cluster these vectors, we used a Gaussian mixture
model (GMM) of 400 components with diagonal covariance matrices. Each
person is assigned to the mixture component (style cluster) which
maximizes the posterior probability. The people assigned to a cluster
are then sorted by their Euclidean distance from the cluster center,
as depicted in Figure~\ref{fig:streetstyle_gmm_clusters}. Although
more clusters would increase the likelihood of the data under the
model, it would also lead to smaller clusters, and so we selected 400
as a compromise between retaining large clusters and maximizing the
likelihood of the data.
The resulting 400 style clusters have sizes ranging from 1K to
115K. Each style cluster tends to represent some combination of our
chosen attributes, and together form a global visual vocabulary for
fashion. We assign further meaning to these clusters by ranking them
and ranking the people within each cluster, as we demonstrate in
Section~\ref{sec:vis_styles}, with many such ranked clusters shown in
Figures~\ref{fig:streetstyle_rank_cities} and
\ref{fig:sorted_clusters}.
\section{Related Work}\label{sec:streetstyle_related}
\noindent{\bf Visual discovery.} Researchers are beginning to mine
world-wide imagery to (1) discover visual trends and (2) measure
aspects of the world over space and time. Much of this work has looked
at {\em places}. Doersch~{\em et~al.}\ pioneered the idea of {\em
computational geography} and explored the distinctive visual
characteristics of cities through Street View
imagery~\shortcite{doersch:siggraph:2012}, driven by weakly supervised
methods for finding discriminative
elements~\cite{singh:eccv:2012,doersch:nips:2013}. Such visual
characteristics can also be correlated to other properties of cities,
such as perceived
safety~\cite{arietta:tvcg:2014,naik:cvprw:2014,dubey:eccv;2016}. These
correlations can then be used to automatically predict such properties
across a city simply from ground level images. Beyond analyses of
cities, computer vision techniques have been used to answer questions
such as ``is there snow in this photo?'' or ``are there clouds in this
webcam?'' which in turn can be used at scale to estimate maps of snow
or cloud cover over large regions of the
world~\cite{zhang:www:2012,murdock:iccv:2015}.
Other work has used large image collections to study people, including
explorations of how people move through
cities~\cite{crandall:www:2009}, the relationship between facial
appearance and
geolocation/time~\cite{islam:eurosip:2015,salem:wacv:2016}, analysis
of expressions and styles over a century in high school yearbook
photos~\cite{ginosar:iccvw:2015}, and tools for discovering visual
patterns that distinguish two
populations~\cite{matzen:iccv:2015}. Finally, Gebru {\em et~al.}\ study
demographics across the US by detecting and analyzing cars (along with
their makes and models) in Street View
imagery~\shortcite{gebru:arxiv:2017}. Compared to this prior work, we
focus on a different domain, fashion and style, and apply our work to
a much broader sample of people by using worldwide images on social
media.
\smallskip \noindent{\bf Visual understanding of clothing.} Clothing
is a rich, complex visual domain from the standpoint of computer
vision, because clothing analysis combines a detailed attribute-level
understanding with social context. We build on previous work that
describes people in terms of clothing and other fashion attributes,
such as ``wearing glasses,'' or ``short sleeves,'' and recognizes
these attributes in new
images~\cite{chen:eccv:2012,bourdev:iccv:2011,bossard:accv:2013,zhang:cvpr:2014}.
Beyond classifying attributes, other work also produces full
pixel-level clothing
segmentations~\cite{yamaguchi:cvpr:2012,yamaguchi:iccv:2013,yang:cvpr:2014},
or recognizes specific (or similar) products rather than general
attributes~\cite{di:cvprw:2013,vittayakorn:wacv:2015,kiapour:iccv:2015}.
Other work categorizes clothing in terms of explicit, named
styles. For instance, Kiapor~{\em et~al.}\ used a game to analyze coarse
fashion styles such as ``hipster'' and ``goth'' to build inter-style
classifiers (i.e., is this photo goth or hipster?) and intra-style
ranking functions (i.e., how hipster is this person's
fashion?)~\shortcite{kiapour:eccv:2014}. In our work, we train
classifiers using coarse-grained attributes, but then leverage this
training to organize images visually in order to perform more
fine-grained clustering.
\smallskip \noindent{\bf Clothing trends.} Spatial and temporal
fashion trends have been explored in computer vision, but usally on
small samples sizes and with limited statistical analysis.
Hidayati~{\em et~al.}\ analyze catwalk images from NYC fashion shows to find
style trends in high-end fashion~\shortcite{hidayati:acmmm:2014}.
Simo-Serra~{\em et~al.}\ analyzed \url{chictopia.com} to study correlations
between fashionability and other attributes such as wealth, as well as
temporal trends (e.g., a sudden spike in popularity of heels in
Manila)~\shortcite{simoserra:cvpr:2015}. \cite{vittayakorn:wacv:2015}
showed that seasonal trends related to styles such as ``floral'',
``pastel'', and ``neon'' can be found using fashion classifiers, with
the peak occurring in the springtime. \cite{he:www:2016} modeled
per-user fashion taste over time and found certain styles had a
resurgence in the late 2000s. However, these trends were not
evaluated for statistical significance, and so it is challenging to
conclusively distinguish signal from noise. We argue that without the
massive amounts of data we advocate, it is difficult to establish such
significance.
\smallskip \noindent{\bf Clothing datasets.} Most previous clothing style
datasets have been very limited in scale, and biased towards images of the
fashion-conscious. For example, several efforts have made use of
fashion-centric social networking sites such as \url{fashionista.com} and
\url{chictopia.com}~\cite{yang:cvpr:2014,simoserra:cvpr:2015,yamaguchi:bvmc:2015,yamaguchi:cvpr:2012,yamaguchi:iccv:2013}.
These sites enable users to upload photos and annotate articles of clothing for
the express purpose of modeling their style. Other work draws on online clothing
retailers such as Amazon, eBay, and ModShop to build similar
datasets~\cite{liu:acmmm:2012,di:cvprw:2013,kiapour:iccv:2015}. Images from
these websites are relatively clean and organized according to tags,
facilitating the creation of annotated datasets on the scale of hundreds of
thousands of people~\cite{chen:eccv:2012,bossard:accv:2013}. However, our goal
is to measure spatio-temporal trends over the entire world from real-world
images, and to obtain highly certain statistics, so very large data is
key---100K images is insufficient, once the data is sliced in time and space.
Furthermore, fashion sites are designed to engage the fashion-conscious, whereas
our goal is to analyze the world's populace at large. Our approach is to build
a massive dataset from photos on social media, which can be gathered at larger
scale and are more representative of everyday fashions (hence the name {\it
StreetStyle}). However, these images are also much more noisy and are often not
tagged according to clothing. Therefore, we annotate a small subset of our large
dataset manually, and use machine learning to generalize the result to the rest
of the dataset.
| {'timestamp': '2017-06-07T02:08:59', 'yymm': '1706', 'arxiv_id': '1706.01869', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01869'} | arxiv |
\section{Introduction}
Cognitive radio networks (CRNs) have shown great promise in alleviating the acute shortage of spectrum. In such networks, secondary (unlicensed) users are allowed to share the spectrum of the primary (licensed) users. Underlay CRNs in particular, have been shown to result in great improvement in spectral utilization efficiency. In these networks, the secondary transmitters transmit simultaneously with the primary transmitters in the same frequency band, but with powers carefully constrained to limit interference to the primary receiver below a specified interference temperature limit.
\par In the recent years, the use of energy harvesting (EH) is being studied to prolong battery life of nodes. Although energy can be harvested from natural sources, it is wireless EH that shows the greatest promise. In particular, the possibility of simultaneous wireless information and power transfer has spurred research interest in this area. Since practical circuits cannot simultaneously harvest energy and perform information processing, time-switching and power-splitting relaying protocols have been proposed \cite{Nasir2013}. In the former, the relay is first charged by the source for a fraction of the signalling interval prior to two-hop relaying. In the latter, the received signal is split into two parts, with a fraction (referred to as the power-splitting parameter $\rho$) being used for energy harvesting, while the rest is used for information processing. It is well known that optimization of this parameter is crucial to maximize throughput.
\par While the use of EH relays in CRNs is well motivated, analysis of performance of such networks has attracted attention only over the past few years
\cite{Janghel2014,Liu2015,Bhowmick2016,Yang2015,Miridakis2016,Wang2016,He2016,Janghel2016}.
Two types of EH methodologies have been proposed in the context of CRNs In the first type, energy is harvested from the primary signal \cite{Janghel2014,Liu2015,Bhowmick2016,Miridakis2016,
Wang2016,He2016}. Note that \cite{Bhowmick2016,Miridakis2016} use the interweave cognitive radio principles, \cite{Janghel2014,Liu2015,Janghel2016} use the underlay signalling mode, while \cite{Wang2016,He2016} use overlay principles. In the second type, which is of primary interest in this paper, energy is harvested from the secondary source \cite{Yang2015,Janghel2016} (this requires secondary EH nodes to be in close proximity to the secondary transmitter). Under these circumstances, even in the non-cognitive context, the importance of considering the direct channel from source to destination in addition to the signal relayed by the EH relay has been recognized by only a few authors \cite{Lee2017,Van2016}. In {\em all existing literature} on two-hop EH relaying in underlay CRNs \cite{Liu2015,Yang2015,Janghel2016}, the direct channel from source to destination has been ignored. In underlay cognitive radio, powers used at secondary transmitters is a random quantity. For this reason, the secondary nodes need to be in close proximity to each other to ensure any reasonable quality of service in the secondary links. In underlay signalling with EH relays, the nodes need to be even closer since energy harvested is typically small. Ignoring the direct channel from source to destination is therefore not reasonable in such situations. In this paper, we demonstrate this fact.
\par The contributions of this paper are as follows:
\begin{enumerate}
\item We derive closed-form expressions for the throughput of an incremental relaying scheme in which the destination combines the signal relayed by the EH relay with the direct signal from the source.
\item Using approximated throughput expressions, we derive an expression for the power-splitting parameter that maximizes throughput.
\item We demonstrate that relaying with an EH relay results in larger throughput than direct signalling only when the destination combines the direct and relayed signals.
\end{enumerate}
{\em Notations}: $\E_{\C}(\cdot)$ denotes the expectation over the condition/conditions $\C$. $\exp(\lambda)$ represents the exponential distribution with parameter $\lambda$, and ${\cal CN}(0,a)$ denotes the circular normal distribution with mean $0$ and variance $a$. $E_1(\cdot)$ and $\text{Ei}(\cdot)$ represent the exponential integrals defined in \cite[5.1.1]{Abramowitz1964} and \cite[5.1.2]{Abramowitz1964} respectively.
\section{System Model}\label{sec:system_model}
\par We consider a two-hop decode-and-forward (DF) relay network as depicted in Fig.~\ref{fig:sys_model}.
\begin{figure}[h]
\vspace*{-0.3cm}
\centering
\includegraphics[width=0.5\textwidth]{system_model.eps}
\caption{System Model}
\label{fig:sys_model}
\vspace*{-0.3cm}
\end{figure}
The primary network consists of the primary transmitter (not depicted in the figure) and the primary receiver P. The secondary network (SN) consists of three nodes - a source (S), a relay (R) and a destination (D). Each node equipped with one antenna. Denote the channel between S and R by $h_{sr}\sim {\cal CN}(0,\lambda_{sr}^{-1})$, and that between the R and D by $h_{rd}\sim {\cal CN}(0,\lambda_{rd}^{-1})$. Similarly, denote the channel between S and P by $g_{sp}\sim {\cal CN}(0,\lambda_{sp}^{-1})$, and that between R and P by $g_{rp}\sim {\cal CN}(0,\lambda_{rp}^{-1})$. We assume that R is equipped with a super-capacitor, and acts as an EH node with EH factor $\eta$. The energy harvested in the first phase is used by R to relay the signal to D. As in most literature on underlay CRN, we neglect the primary signal at R and D. This is reasonable because of the large distance between the primary transmitter and the secondary nodes \cite{Tourki2013} (this assumption has been justified on information theoretic grounds \cite{Jovicic2009}). All the channels are reversible and quasi-static.
\section{Transmission Protocol}\label{sec:transmission_protocol}
We assume fixed-rate transmission at rate $R_s$ by all nodes. Signalling based on the incremental protocol is completed in two time-slots as depicted in Fig.\ref{fig:transmission_schemeInc}. Message transmission is based on the incremental relaying protocol \cite{Ikki2011}, and EH is based on the power-splitting protocol \cite{Nasir2013}.
\begin{figure}[h]
\centering
\includegraphics[width=0.48\textwidth]{transmission_schemeInc.eps}
\caption{Transmission scheme for incremental relaying}
\label{fig:transmission_schemeInc}
\end{figure}
\par In the first transmission time-slot, S transmits information symbols to D and R as depicted in Fig.\ref{fig:transmission_schemeInc}. R harvests energy from this signal using power splitting, and attempts to decode the information symbols. Meanwhile, D attempts to decode the symbols. If successful, it sends feedback to the source and the relay\footnote{We assume that feedback time is extremely small and can be neglected in the analysis without loss of generality.}. The relay discards the decoded symbols, and the source re-transmits a new block of symbols to D as depicted in Fig.\ref{fig:transmission_schemeInc}a\footnote{The relay does not harvest energy in this phase. Energy stored in the super-capacitor is assumed to be lost since it lacks the ability to store charge over long intervals.}. Else, R relays the symbols using the energy harvested, and D combines the signals in the first and the second time-slots as depicted in Fig.\ref{fig:transmission_schemeInc}b.
\par In the first time-slot, S transmits a message signal $x$ with power $P_s$ in underlay mode to R and D. In PS-EH case, a component $y_{d_1}$ of the received signal with $\rho$ fraction of the power is utilized for EH, while the remaining signal with fraction $1-\rho$ of the power is used to decode the symbols. Clearly, $y_r$ at R and and $y_{d_1}$ at D in the first phase are given by:
\begin{IEEEeqnarray}{rcl}
y_r &=& \sqrt{(1-\rho) P_{s}}\,x\,|h_{sr}|^2+n_{r}\;\quad\text{and}\label{eq:yr_PS}\\
y_{d_1} &= &\sqrt{P_{s}}\,x\, |h_{sd}|^2+n_{d_{1}} \label{eq:yd1_PS}
\end{IEEEeqnarray}
respectively, where $n_r,n_{d_1}\sim{\cal CN}\left(0,N_o\right)$ are noise samples at R and D. Clearly, the SNR $\Gamma_{d_1}$ at D in the first time-slot is $\frac{P_s|h_{sd}|^2}{N_o}$. Energy harvested at R is $\eta \rho\,P_s |h_{sr}|^2/2$ (ignoring noise) so that the power available for relaying is given by:
\begin{equation}
^hP_{r}=\rho\,\eta P_s |h_{sr}|^2 = \beta\,P_s |h_{sr}|^2\,,\label{eq:Prh-PS}
\end{equation}
where $\beta= \eta\, \rho$.
Let $I$ denote the interference temperature limit. In order to ensure that the interference caused to primary receiver P is limited to $I$, the power $P_s$ at S is chosen to be:
\begin{equation}
P_s= {I}/{|g_{sp}|^2}\,.\label{eq:PsOnlyInterference}
\end{equation}
We consider only the peak interference constraint at S, and ignore the peak power constraint for the following reason:
\begin{enumerate}
\item It is well known that performance of CRNs exhibits an outage floor, and does not improve with increase in peak power (it is in this low outage and high throughput region that CRNs are typically operated) \cite{Lee2011,Duong2012} (and references therein). In this paper, we discuss optimization of PS EH parameter, which is of interest in this high throughput regime.
\item Since performance of CRNs is typically limited by interference, and sufficient peak power is typically available, this assumption is quite reasonable.
\end{enumerate}
\par In the second time-slot, R is used to forward the decoded symbol $\hat{x}$ to D. In order to ensure that the interference at P is constrained to $I$, the total transmit power $ P_{r} $ at R is chosen to be:
\begin{equation}
P_{r} = \min\left(^hP_{r}, \frac{I}{|g_{rp}|^2} \right). \label{eq:Pr_PS}
\end{equation}
Received signal $y_{d_2}$ at D can be expressed as
\begin{equation}
y_{d_2} = \sqrt{P_{r}}\, \hat{x}\,h_{rd}+n_{d_2}\;, \label{eq:yd2_PS}
\end{equation}
where $n_{d_2}\sim{\cal CN}\left(0,N_o\right)$ is the additive white Gaussian noise sample. We assume that D uses MRC to combine the signals obtained in the first phase (\ref{eq:yd1_PS}) and second phase (\ref{eq:yd2_PS}).
Signal-to-noise ratios (SNRs) at R and D are expressed using (\ref{eq:yr_PS}), (\ref{eq:yd1_PS}) and (\ref{eq:yd2_PS}) as:
\begin{IEEEeqnarray}{rcl}
\Gamma_{r} &=&\frac{(1-\rho)P_s|h_{sr}|^2}{N_o}\qquad \text{and} \label{eq:SNR_rps}\\
\Gamma_{d} &=& \underbrace{\frac{P_s|h_{sd}|^2}{N_o}}_{\Gamma_{d_1}}+\underbrace{\frac{P_{r}|h_{rd}|^2}{N_o}}_{\Gamma_{d_2}}.\label{eq:SNR_dps}
\end{IEEEeqnarray}
\section{Performance Analysis}\label{sec:perfromance}
In this section, we analyze throughput performance of the described incremental relaying protocol. When $\Gamma_{d_1}\geq\gamma_{th}$, the direct link is successful, so that rate achieved is $R_s$. When $\Gamma_{d_1}<\gamma_{th}$, and the relay can decode successfully ($\Gamma_r\geq\gamma_{th}$), and the SNR at the destination after combining is sufficient ($\Gamma_d=\Gamma_{d_1}+\Gamma_{d_2}\geq \gamma_{th}$), signalling is completed in two hops (rate $R_s/2$). Clearly, throughput $\tau$ is given by:
{\begin{IEEEeqnarray}{rcl}
\tau&=& 0.5\,R_s\underbrace{\Pr\left(\Gamma_{d_1} < \gamma_{th},\, \Gamma_{r}\geq\gamma_{th},\, \Gamma_{d_1}+\Gamma_{d_2}\geq\gamma_{th}\right)}_{q_1}\nonumber\\
&&\hspace{1.5in}+\underbrace{\ R_s\Pr(\Gamma_{d_1}\geq\gamma_{th})}_{q_2}\,,\label{eq:tauIn}
\end{IEEEeqnarray}}
where $\gamma_{th}=2^{R_s}-1$. We note that $q_1$, the probability that the relayed link is successful while the direct link is not successful, can alternatively be represented as:
\begin{IEEEeqnarray}{rcl}
q_1&=&1-\Big(\underbrace{\Pr\left(\Gamma_r< \gamma_{th}\right)}_{p_1}+\underbrace{\Pr\left(\Gamma_{d_1}\geq\gamma_{th},\Gamma_r \geq\gamma_{th} \right)}_{p_2}\nonumber\\
&&\hspace{0.8in}+\underbrace{\Pr\left(\Gamma_d< \gamma_{th},\;\Gamma_r \geq \gamma_{th}\right)}_{p_3}\Big).\label{eq:q}
\end{IEEEeqnarray}
We evaluate each of the terms in what follows. From \eqref{eq:SNR_rps}, $p_1$ can be evaluated as:
\begin{eqnarray}
p_1=\Pr\left(\Gamma_r< \gamma_{th}\right) = \Pr\left(\frac{(1-\rho) P_s|h_{sr}|^2}{N_o}< \gamma_{th}\right). \label{eq:p1}
\end{eqnarray}
Using $P_s=I/|g_{sp}|^{2}$, it can be shown that:
\begin{equation}
p_1=1-\frac{1}{1+{\lambda_{sr}\psi}/({\lambda_{sp}(1-\rho)})},\label{eq:p1Final}
\end{equation}
where $\psi=\frac{\gamma_{th}}{I/N_o}$.
Similarly, $q_2$ is given by:
\begin{eqnarray}
q_2=\Pr(\Gamma_{d_1}\geq\gamma_{th})=\frac{1}{1+{\lambda_{sd} \psi}/{\lambda_{sp}}}.\label{eq:q2}
\end{eqnarray}
We note that $\Gamma_r$ and $\Gamma_{d_1}$ are not independent due to their dependence on the random variable $P_s=I/|g_{sp}|^{2}$. By first conditioning on $|g_{sp}|^{2}$, exploiting the independence of $\Gamma_{r\big||g_{sp}|^2}$ and $\Gamma_{d\big||g_{sp}|^{2}}$, and then averaging over $|g_{sp}|^{2}$, we can show that $p_2$ can be written as:
\begin{IEEEeqnarray*}{rcl}
p_2& =& \int_{0}^{\infty} \lambda_{sp} e^{\lambda_{sp}|g_{sp}|^2} \int_{\psi |g_{sp}|^2}^{\infty} \lambda_{sd} e^{-\lambda_{sd} |h_{sd}|^2} \int_{\frac{\psi|g_{sp}|^2}{(1-\rho)}}^{\infty}\lambda_{sr} \nonumber\\
&&\hspace*{2cm}e^{-\lambda_{sr}|h_{sr}|^2} d|h_{sr}|^2 d|h_{sd}|^2 d|g_{sp}|^2. \nonumber
\end{IEEEeqnarray*}
After integrating over $|h_{sr}|^2$ and $|h_{sd}|^2$, $p_2$ can be expressed in terms of $|g_{sp}|^{2}$ as:
\begin{equation*}
p_2=\int_{0}^{\infty} \lambda_{sp} e^{\lambda_{sp}|g_{sp}|^2} e^{-\lambda_{sd}\psi |g_{sp}|^2-\frac{\lambda_{sr} \psi |g_{sp}|^2}{(1-\rho)}}d |g_{sp}|^2. \nonumber
\end{equation*}
Now after averaging over $|g_{sp}|^2$, the resultant expression can be found out to be:
\begin{eqnarray}
p_2=\frac{1}{1+ \frac{\psi}{\lambda_{sp}}\left(\lambda_{sd}+\frac{\lambda_{sr}}{(1-\rho)}\right)}.\label{eq:p2Final}
\end{eqnarray}
An approximate closed-form expression for $p_3$ is derived in Appendix-A. The final expression is presented in \eqref{eq:p3_Final}.
\setcounter{equation}{14}
\begin{figure*}[t!]
\begin{IEEEeqnarray}{rcl}
&&p_3\approx t \Bigg(\left(\frac{a}{c+\lambda_{sp}}\right)^2\frac{ \lambda_{sp} \lambda_{sr}}{ (a+b+d \lambda_{sp})} e^{\frac{a \lambda_{sr}}{c+\lambda_{sp}}} \left(E_1\left(\frac{a \lambda_{sr}}{c+\lambda_{sp}}\right)-E_1\left(\frac{a \lambda_{sr}}{c+\lambda_{sp}}+a s\right)\right)+\frac{d^2 \lambda_{sp} \lambda_{sr}}{a+b+d \lambda_{sp}} e^{s (-(a+b))-d (\lambda_{sp} s+\lambda_{sr})} \nonumber\\
&&\times(\text{Ei}(d (\lambda_{sr}+\lambda_{sp} s))-\text{Ei}(d \lambda_{sr}+b s+d \lambda_{sp} s))-\frac{\lambda_{sr} (a+b)^2e^{\frac{\lambda_{sr} (a+b)}{\lambda_{sp}}}}{\lambda_{sp} (a+b+d \lambda_{sp})} \left(E_1\left(\frac{(a+b) \lambda_{sr}}{\lambda_{sp}}\right)-E_1\left(\frac{(a+b) \lambda_{sr}}{\lambda_{sp}}+(a+b) s\right)\right)\nonumber\\
&&-\frac{\lambda_{sr} e^{s (-(a+b))}}{\lambda_{sp} s+\lambda_{sr}}+\frac{\lambda_{sp} \lambda_{sr} e^{-a s}}{(c+\lambda_{sp}) (c s+\lambda_{sp} s+\lambda_{sr})}+\frac{c}{c+\lambda_{sp}}\Bigg)+\frac{b^2 \lambda_{sr}}{\lambda_{sp} (b+d \lambda_{sp})} e^{\frac{b \lambda_{sr}}{\lambda_{sp}}} \left(E_1\left(\frac{b \lambda_{sr}}{\lambda_{sp}}\right)-E_1\left(\frac{b (\lambda_{sr}+\lambda_{sp} s)}{\lambda_{sp}}\right)\right)\nonumber\\
&&-\frac{d^2 \lambda_{sp} \lambda_{sr}}{b+d \lambda_{sp}} e^{-b s-d (\lambda_{sp} s+\lambda_{sr})} (\text{Ei}(d (\lambda_{sr}+\lambda_{sp} s))-\text{Ei}(d \lambda_{sr}+b s+d \lambda_{sp} s))+\frac{\lambda_{sr} e^{-b s}}{\lambda_{sp} s+\lambda_{sr}}+\frac{c \lambda_{sp} s^2}{(\lambda_{sp} s+\lambda_{sr}) (c s+\lambda_{sp} s+\lambda_{sr})}\nonumber\\
&&-\frac{\lambda_{sp} \lambda_{sr}}{(c+\lambda_{sp}) (c s+\lambda_{sp} s+\lambda_{sr})}-\frac{c}{c+\lambda_{sp}}\,,
\label{eq:p3_Final}\\
&& {\normalsize\text{where $a=\frac{\lambda_{rp}}{\beta}$, $b=\frac{\psi \lambda_{rd} }{\beta}$, $c={\psi\lambda_{sd}}$, $d=\frac{\lambda_{rd}}{\beta \lambda_{sd}}$, and $s=\frac{(1-\rho)}{\psi}$.\label{eq:param}}}
\end{IEEEeqnarray}
\hrulefill
\vspace*{-0.5cm}
\end{figure*}
\setcounter{equation}{16}
Resultant expression of $\tau$ can be found out by substituting for $p_1$, $p_2$, $p_3$ and $q_2$ into \eqref{eq:tauIn}.\\
\subsection{Value of EH-factor for optimal throughput}
Throughput $\tau$ is small for $\rho=0$ (no energy harvested at the relay) and $\rho=1$ (no decoding is possible at the relay). In both these cases, the relayed signal is not available. When $0<\rho<1$, the throughput is larger since the relayed signal is not always in outage. It is clear that the
following optimal value of EH parameter ($\rho^{*}$) that maximizes throughput is of interest:
\begin{eqnarray}
\rho^* = \arg\displaystyle\max_{\rho} \quad \tau \label{eq:rhoOptimum}.
\end{eqnarray}
It is difficult to find an exact solution for $\rho^*$ since the lengthy expression for $\tau$ contains several nonlinear functions.
\par To obtain an expression for $\tau$ in a simplified form (say $\tau_{sim}$), we use the high-SNR approximation $\left({I\lambda_{sp}}/{N_o}\gg\gamma_{th}\right)$ and also neglect the R-P link\footnote{We note that the R-P link is ignored only for the simplified analysis to obtain insights into the optimum power-splitting parameter. The relay needs to apply power control as in any other underlay system. We note that all computer simulations are performed with the interference channel from relay to primary receiver.}. We show through simulations in Fig. \ref{fig:TauVsRho} of Section~\ref{sec:simulations} that throughput of a practical system that imposes the peak interference constraint at the relay is indistinguishable from one that neglects it. In other words, SN performance does not depend (or at best very loosely depends) on the statistical parameter ($\lambda_{rp}$) of the R-P channel for most practical range of parameters. Intuitively, this is because of the fact that the harvested energy is very small (less than $I/|g_{rp}|^2$) with very high probability.
\par From the above discussion, throughput can be represented in most simplified form as given in \eqref{eq:TauSimplified} (please refer the Appendix-B for derivation).
\begin{figure*}[t!]
\begin{eqnarray}
\tau_{sim}\approx0.5R_s\left(1-\left(\frac{1}{\left(1+\frac{\lambda_{sp}}{\lambda_{sd}\psi}\right)\left(1+\frac{\eta \lambda_{sp} \rho}{\psi \lambda_{rd} \lambda_{sr} }\right)}+\frac{1}{\frac{\lambda_{rd} \lambda_{sp} (1-\rho)}{\eta \rho \lambda_{sr} \psi}}+\frac{1}{\frac{\psi \lambda_{sd} }{ \lambda_{sp}}+1}\right)\right) + R_s q_2\label{eq:TauSimplified}
\end{eqnarray}
\hrulefill
\vspace*{-0.4cm}
\end{figure*}
We omit proof of concavity due to space constraints. Solving
$\frac{d\tau_{sim}}{d\rho}=0$.
results in a quadratic equation which has two roots, out of which the one between $0$ to $1$ is given by\footnote{Since $\lambda_{sr}\ll\lambda_{sd}$, it can be shown that $\rhoˆ{*}\in [0,1]$.}:
\begin{equation}
\rho^* \approx \frac{1-\sqrt{\left(1+\frac{\lambda_{sp}}{\lambda_{sd}\psi}\right)}\frac{ \psi \lambda_{sr}\,}{ \lambda_{sp}}}{1+\sqrt{\left(1+\frac{\lambda_{sp}}{\lambda_{sd}\psi}\right)}\frac{ \eta}{\lambda_{rd}}}.\label{eq:OptRho}
\end{equation}
\par As a special case, value of $\rho$ which maximizes the throughput if the S-D link ignored \footnote{In this case, there is no involvement of direct path and a case of two-hop transmission between nodes S to D via R.} (i.e $\lambda_{sd}\rightarrow\infty$) becomes:
\begin{eqnarray}
\rho^*_{nd} \approx \lim\limits_{d_{sd}\rightarrow\infty} \rho^* = \frac{1-\frac{ \psi \lambda_{sr} \,}{ \lambda_{sp}}}{1+\frac{ \eta}{\lambda_{rd}}},\label{eq:OptRhoWSD}
\end{eqnarray}
where subscript $nd$ is used to emphasize the fact that no direct path is present. In this case, the throughput is derived from \eqref{eq:tauIn} by using $\lambda_{sd}\rightarrow\infty$, and given by:
\begin{eqnarray}
\tau_{nd} = \lim\limits_{\lambda_{sd}\rightarrow\infty} \, \tau.\label{eq:TauWSD}
\end{eqnarray}
\section{Simulation Results}\label{sec:simulations}\
In this section, we validate the derived expressions by computer simulations. The normalized S-R, R-D, and S-D distances are assumed to be $1.2$, $1.8$ and $3$ respectively. The normalized S-P and R-P distances are assumed to be $3$. Path loss exponent $\epsilon$ is assumed to be $4$. We assume $\eta = 0.7$ and $I/N_o=6$ dB unless stated otherwise.
\begin{figure}[h]
\vspace*{-0.3cm}
\centering
\includegraphics[width=0.5\textwidth]{TauVsRho.eps}
\caption{Throughput vs. $\rho$ for different $d_{sr}$}
\label{fig:TauVsRho}
\vspace*{-0.25cm}
\end{figure}
\par The importance of optimizing $\rho$ for maximizing throughput is clearly brought out in Fig.\ref{fig:TauVsRho} (concavity is clear from the plots). The graph depicts a plot of $\tau$ versus $\rho$ for $R_s=3$ bpcu for different $d_{sr}$.
\begin{figure}[h]
\vspace*{-0.3cm}
\centering
\includegraphics[width=0.5\textwidth]{TauVsRsConf.eps}
\caption{Throughput vs. $R_s$ for different I}
\label{fig:TauVsRsConf}
\vspace*{-0.5cm}
\end{figure}
\par The value of $\rho^*$ indicated by \eqref{eq:OptRho} for $d_{sr}$ of $1.2$, and $1.7$ are $0.87$ and $0.62$ respectively, which are in close agreement with simulations. Similarly, in the absence of the direct link, $\rho^*_{nd}$ of $0.89$ and $0.68$ are indicated by (\ref{eq:OptRhoWSD}), which are in close agreement with simulations. We note that $\rho^*_{nd}>\rho^*$, as can be intuitively expected. It is clear that a) incremental relaying results in higher throughput than relay-less signalling from S to D, b) two-hop relaying that ignores the S-D link results in throughput that is quite poor as compared to direct S-D signalling without the relay, and c) a smaller $d_{sr}$ results in larger throughput, especially for large $\rho$ (note that $d_{sr}+d_{rd}=d_{sd}$ so that a smaller $d_{sr}$ implies a larger $d_{rd}$).
\par In Fig.\ref{fig:TauVsRsConf}, throughput is plotted versus $R_s$ for two different values of $I$. For each point, the optimum value of $\rho^{*}$ is computed and used. The superiority of incremental relaying over direct point-to-point transmission is apparent. Moreover, the gap between the two is higher for larger value of $I$. This happens because relayed signalling has a higher chance of non-outage for larger value of $I$.
It be observed that an optimum value of $R_s$ exists which maximizes throughput. It is apparent from ~\eqref{eq:tauIn}, that throughput is limited by $R_s$ when it is small, and by outage when $R_s$ is large. The optimum value needs to be obtained by numerical search.
\section{Conclusion} \label{sec:conclusion}
In this paper, we derived a closed-form expression for the throughput performance of an underlay two-hop network with a power-splitting based energy harvesting relay. We present a closed-form expression for the throughput maximizing power-splitting parameter.
\vspace{-0.5cm}
\section*{Appendix}
\vspace{-0.5cm}
\setcounter{equation}{25}
\begin{figure*}[t!]
\begin{IEEEeqnarray}{rcl}
p_3\Big|_{|h_{sr}|^2} &=& \frac{\lambda_{sp}}{\lambda_{rd}-\beta |h_{sr}|^2 \lambda_{sd}} \Big(\frac{\lambda_{rd} \lambda_{sd} \psi}{\lambda_{sd} \lambda_{sp} \psi+\lambda_{sp}^2}-\beta |h_{sr}|^2 \lambda_{sd} \Big(\frac{1}{\lambda_{sp}}-\beta |h_{sr}|^2 \Big(t \Big(\frac{1}{\beta |h_{sr}|^2 (\lambda_{sd} \psi+\lambda_{sp})+\lambda_{rp}}\nonumber\\
&&-\frac{1}{\beta |h_{sr}|^2 \lambda_{sp}+\lambda_{rd} \psi+\lambda_{rp}}\Big)+\frac{1}{\beta |h_{sr}|^2 \lambda_{sp}+\lambda_{rd} \psi}\Big)\Big)\Big)\label{eq:p3_hsr}
\end{IEEEeqnarray}
\vspace*{-0.6cm}
\hrulefill
\end{figure*}
\setcounter{equation}{27}
\begin{figure*}[t!]
{
\begin{IEEEeqnarray}{rcl}
p^{d_{rp}\rightarrow\infty}_{3}&=&\frac{\left({\lambda_{sr} \psi}/{\beta}\right)^2}{\lambda_{sp} \left(\frac{\lambda_{rd} \lambda_{sp}}{\beta \lambda_{sd}}+\frac{\lambda_{rd} \psi}{\beta}\right)} \left(\lambda_{sr} e^{\frac{\lambda_{rd} \lambda_{sr} \psi}{\beta \lambda_{sp}}} \left(E_1\left(\frac{\lambda_{rd} \lambda_{sr} \psi}{\beta \lambda_{sp}}\right)-E_1\left(\frac{\lambda_{rd} \psi}{\beta \lambda_{sp}} \left(\lambda_{sr}+\frac{\lambda_{sp} (1-\rho)}{\psi}\right)\right)\right)\right)\label{eq:p3_WithoutLRP}\\
&&-\frac{\lambda_{sr} \psi \left(1-e^{-\frac{\lambda_{rd} (1-\rho)}{\beta}}\right)}{\lambda_{sp} (1-\rho)+\lambda_{sr} \psi} -\frac{\lambda_{sp} \lambda_{sr}}{\frac{\lambda_{rd} \lambda_{sp}}{\beta \lambda_{sd}}+\frac{\lambda_{rd} \psi}{\beta}} \left(\frac{\lambda_{rd}}{\beta \lambda_{sd}}\right)^2 e^{-\frac{\lambda_{rd}}{\beta \lambda_{sd}} \left(\frac{\lambda_{sp} (1-\rho)}{\psi}+\lambda_{sr}\right)-\frac{\lambda_{rd} (1-\rho)}{\beta}}\nonumber\\
&&\times \left(\text{Ei}\left(\frac{\lambda_{rd}}{\beta \lambda_{sd}} \left(\lambda_{sr}+\frac{\lambda_{sp} (1-\rho)}{\psi}\right)\right)-\text{Ei}\left(\frac{\lambda_{rd}}{\beta \lambda_{sd}} \left(\lambda_{sr}+\frac{\lambda_{sp} (1-\rho)}{\psi}\right)+\frac{\lambda_{rd} (1-\rho)}{\beta}\right)\right)\nonumber
\end{IEEEeqnarray}}
\hrulefill
\vspace*{-0.4cm}
\end{figure*}
\setcounter{equation}{29}
\begin{figure*}[t!]
\begin{eqnarray}
\tau_{sim} = 0.5R_s\left(1-\left(\frac{1}{\left(1+\frac{\lambda_{sp}}{\lambda_{sd}\psi}\right)\left(1+\frac{\eta \lambda_{sp} \rho}{\psi \lambda_{rd} \lambda_{sr} }\right)}+\frac{1}{\left(\frac{\lambda_{rd}}{\eta \rho}+1\right) \left(\frac{ \lambda_{sp} (1-\rho)}{\psi \lambda_{sr} }+1\right)}+\frac{1}{\frac{\psi}{ \lambda_{sp}} \left(\lambda_{sd}+\frac{\lambda_{sr}}{1-\rho}\right)+1}\right)\right)\label{eq:TauApproxApp1}
\end{eqnarray}
\hrulefill
\vspace*{-0.4cm}
\end{figure*}
\setcounter{equation}{21}
\subsection{Derivation of $p_3$}\label{eq:p3Derivation}
In this Appendix, we derive an expression for $p_3$.
To this end, we first define $X$ as:
\begin{eqnarray}
X\triangleq \min\left(^hP, \frac{I}{|g_{rp}|^2}\right)|h_{rd}|^2 \label{eq:X}
\end{eqnarray}
Its Cumulative distribution function (CDF) conditioned on $^hP$ can be derived as:
\begin{equation}
\hspace{-0.04in}F_{X\big|_{^hP}}\hspace*{-0.3cm}(x)=1-e^{\frac{\lambda_{rd}x}{\beta\,P_s\,|h_{sr}|^2}}\Big(1-e^{-\frac{\lambda_{rp}I}{\beta\,P_s\,|h_{sr}|^2}}\Big(\frac{\frac{\lambda_{rd} x}{I\lambda_{rp}}}{1+\frac{\lambda_{rd}x}{I\lambda_{rp}}}\Big)\Big)\label{eq:CDFofX}
\end{equation}
From \eqref{eq:q}, $p_3$ can be expressed as:
{\small\begin{IEEEeqnarray*}{rcl}
p_3=\Pr\Big(\frac{P_s |h_{sd}|^2}{N_o}+\frac{X\big|_{P_s|h_{sr}|^2}}{N_o}\leq \gamma_{th},\frac{(1-\rho) P_s |h_{sr}|^2}{N_o} > \gamma_{th}\Big).\nonumber
\end{IEEEeqnarray*}}
We derive $p_3$ by successive averaging over each random variable and keeping other r.vs. in terms of condition. We first average w.r.t. $X$ by using \eqref{eq:CDFofX} to get:
\begin{IEEEeqnarray*}{rcl}
\hspace{-0.1in}p_3&=&\E_{\C_1 }\left[ F_{X\big|{^hP}}\left(\gamma_{th}-\frac{P_s |h_{sd}|^2}{N_o}\right)\right]\nonumber\\
&=&\E_{\C_1 }\Big[1-e^{-\frac{\lambda_{rd}}{\beta\,P_s\,|h_{sr}|^2}\left(\gamma_{th}-\frac{P_s |h_{sd}|^2}{N_o}\right)}\Big(1-e^{-\frac{\lambda_{rp}I}{\beta\,P_s\,|h_{sr}|^2}}\nonumber\\
&&\hspace{0.75in}\times\Big(1-\frac{1}{1+\frac{\lambda_{rd}}{I\lambda_{rp}}\left(\gamma_{th}-\frac{P_s |h_{sd}|^2}{N_o}\right)}\Big)\Big)\Big]\,,
\end{IEEEeqnarray*}
where the condition $\C_1=\{\frac{(1-\rho) P_s |h_{sr}|^2}{N_o}>\gamma_{th},\, \frac{P_s |h_{sd}|^2}{N_o}\leq\gamma_{th}\}$.
Unfortunately, averaging the above with respect to random variables $|h_{sr}|^2$ and $|g_{sp}|^2$ results in intractable expressions. We need to make use of the following fact: $1\gg\frac{\lambda_{rd}}{I\lambda_{rp}}\left(\gamma_{th}N_o-P_s |h_{sd}|^2\right)$ (since $P_s |h_{sd}|^2/N_o <\gamma_{th}$ and $I\lambda_{rp}\gg\lambda_{rd}$). Hence for tractability, $\frac{\lambda_{rd}}{I\lambda_{rp}}\left(\gamma_{th}N_o-P_s |h_{sd}|^2\right)$ can be replaced by its mean i.e. $\frac{\lambda_{rd}}{I\lambda_{rp}}\left(\gamma_{th}N_o-\E_{P_s|h_{sd}|^2\leq \gamma_{th}}(P_s |h_{sd}|^2)\right)$. $\E_{P_s|h_{sd}|^2\leq \gamma_{th}}(P_s |h_{sd}|^2)$ can be derived as:
{\small\begin{equation}
\E_{\C_2}(P_s |h_{sd}|^2)=\frac{I \lambda_{sp}}{\lambda_{sd}} \Big(\log \Big(\frac{\gamma_{th} \lambda_{sd} N_o}{I \lambda_{sp}}+1\Big)+\frac{\frac{\gamma_{th} \lambda_{sd} N_o}{I \lambda_{sp}}}{\frac{\gamma_{th} \lambda_{sd} N_o}{I \lambda_{sp}}+1}\Big),\label{eq:EC2}
\end{equation}}
where $\C_2=\{P_s|h_{sd}|^2\leq N_o \gamma_{th}\}$.
Now, $p_3$ can further represented in approximated form as:
\begin{IEEEeqnarray}{rcl}
p_3&\approx&\E_{\C_1}\Big[1+t e^{-\frac{\lambda_{rd} (\gamma_{th} N_o-|h_{sd}|^2 P_s)}{\beta |h_{sr}|^2 P_s}-\frac{I \lambda_{rp}}{\beta |h_{sr}|^2 P_s}}\nonumber\\
&&\hspace*{2cm}-e^{-\frac{\lambda_{rd} (\gamma_{th} N_o-|h_{sd}|^2 P_s)}{\beta |h_{sr}|^2 P_s}}\Big], \label{eq:p3hSR}
\end{IEEEeqnarray}
where $t=1-1/({1+\frac{\lambda_{rd}}{I\lambda_{rp}}\left(\gamma_{th} N_o-\E_{\C_2}\left[P_s|h_{sd}|^2\right]\right)})$. The above approximation is tight for $\lambda_{rd}<<I\lambda_{rp}$. This is true for general system settings in underlay-CRN.
\par Now averaging the above expression over $|h_{sr}|^{2}$ and using the expression for $P_s$ in \eqref{eq:PsOnlyInterference}, results in the following expression for $p_3$:
\begin{IEEEeqnarray*}{rcl}
&&p_3\approx\E_{\C_3}\Big[\frac{\lambda_{rd} \left(1-e^{-\frac{\gamma_{th} \lambda_{sd} N_o}{P_s}}\right)}{\lambda_{rd}-\beta |h_{sr}|^2 \lambda_{sd}}-\frac{(\beta |h_{sr}|^2 \lambda_{sd})}{\lambda_{rd}-\beta |h_{sr}|^2 \lambda_{sd}}\Big(1+\nonumber \\
&&t e^{-\frac{\gamma_{th} \lambda_{rd} N_o+I \lambda_{rp}}{\beta |h_{sr}|^2 P_s}}-t e^{-\frac{\beta \gamma_{th} |h_{sr}|^2 \lambda_{sd} N_o+I \lambda_{rp}}{\beta |h_{sr}|^2 P_s}}-e^{-\frac{\gamma_{th} \lambda_{rd} N_o}{\beta |h_{sr}|^2 P_s}}\Big)\Big]\,,\nonumber
\end{IEEEeqnarray*}
where condition $\C_3=\{\frac{(1-\rho) |h_{sr}|^2}{\psi}>|g_{sp}|^2\}$. Now let $\psi = \frac{\gamma_{th}}{I/N_o}$ , $p_3$ becomes:
\begin{IEEEeqnarray*}{rcl}
p_3\approx&\E_{\C_3}&\Big[\frac{\lambda_{rd} \left(1-e^{-{|g_{sp}|^2\gamma_{th} \lambda_{sd} \psi }}\right)}{\lambda_{rd}-\beta |h_{sr}|^2 \lambda_{sd}}-\frac{(\beta |h_{sr}|^2 \lambda_{sd})}{\lambda_{rd}-\beta |h_{sr}|^2 \lambda_{sd}}\Big(1\nonumber \\
&&+t e^{-\frac{|g_{sp}|^2}{\beta |h_{sr}|^2}(\lambda_{rd}\psi+\lambda_{rp})}-t e^{-|g_{sp}|^2\left(\psi\lambda_{sd}+\frac{\lambda_{rp}}{\beta|h_{sr}|^2}\right)}\nonumber\\
&&-e^{-\frac{|g_{sp}|^2 \lambda_{rd} \psi}{\beta |h_{sr}|^2 }}\Big)\Big]\nonumber
\end{IEEEeqnarray*}
\par Now averaging the above equation over $|g_{sp}|^2$ and then using some straightforward manipulations, the resultant expression is presented in \eqref{eq:p3_hsr}. From \eqref{eq:p3_hsr}, $p_3$ is now expressed as:
\setcounter{equation}{26}
\begin{equation}
p_3 = \int_{0}^{\infty} p_3\big|_{|h_{sr}|^2} \lambda_{sr} e^{-\lambda_{sr} |h_{sr}|^2} d|h_{sr}|^2
\end{equation}
The above integral can be simplified using the integral presented in \cite[5.1.1]{Abramowitz1964}:
{\begin{IEEEeqnarray*}{rcl}
\int_r^s \frac{e^{-p x}}{q x+1} \, dx = \frac{e^{\frac{p}{q}}}{q} \left(E_1\left(\frac{(q r +1)p}{q}\right)-E_1\left(\frac{(q s +1)p}{q}\right)\right)\nonumber.
\end{IEEEeqnarray*}}
We omit the manipulations due to space limitations and present the approximated $p_3$ as in \eqref{eq:p3_Final} (top of page-4).
\subsection{Derivation of $\tau_{sim}$} \label{AppB:ApproxP3}
\par In the expression for $p_3$ in \eqref{eq:p3_Final}, $t=1-1/({1+\frac{\lambda_{rd}}{I\lambda_{rp}}\left(\gamma_{th} N_o-\E_{\C_2}\left[P_s|h_{sd}|^2\right]\right)})$ as defined in \eqref{eq:p3hSR}, with $\E_{\C_2}\left[P_s|h_{sd}|^2\right]$ given by \eqref{eq:EC2}. Clearly, $t=0$ when $\lambda_{rp}\rightarrow\infty$, which enables us to simplify $p_3$. Resultant expression is given in \eqref{eq:p3_WithoutLRP} (second equation on the top of the next page).
\par Further simplification is possible when $\frac{I\lambda_{sp}}{N_o}\gg\gamma_{th}$, which is the commonly encountered situation. In this case, the arguments of $e^{-x}\text{Ei}(x)$ and $e^{x} E_1(x)$ terms in $p_3$ increase and decrease respectively. Using the fact that $e^{-x}\text{Ei}(x)\rightarrow 0$ for $x\rightarrow\infty$ (here $x\propto\frac{\lambda_{sp}}{\psi}$), the term associated with $\text{Ei}(x)$ vanishes from the expression for $p_3$. We further use the fact that $E_1(x)\gg E_1((x+A))$, for $A>0$ when $A$ is very large (as it is in this case since $(1-\rho) I\lambda_{sp}/(\gamma_{th} N_o)>0$) . The term with $e^x E_1((x+A))$ can be neglected in the high SNR region. From~\eqref{eq:p3_WithoutLRP}, the resultant approximated expression can be written as:
\setcounter{equation}{28}
{\small\begin{align}
p^{d_{rp}\rightarrow\infty}_{3}\overset{A\gg0}{\approx}&\left(\frac{\psi \lambda_{rd} }{\beta \lambda_{sp}}\right)^2\frac{(\lambda_{sp} \lambda_{sr} )}{\frac{\psi \lambda_{rd} }{\beta}+\frac{\lambda_{rd} \lambda_{sp}}{\beta \lambda_{sd}}}e^{\frac{\psi \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}} E_1\left(\frac{\psi \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}\right)\nonumber\\
&+\frac{\lambda_{sr} }{\frac{\lambda_{sp} (1-\rho)}{\psi }+\lambda_{sr} } \left( e^{-\frac{ \lambda_{rd} (1-\rho)}{\beta}}-1\right). \label{eq:p3_HSNR}
\end{align}}
By using the following very tight lower and upper bounds $e^{x}E_1(x)\geq ({1+x})^{-1}$ and
$e^{-{\lambda_{rd} (1-\rho)}/{\rho}}\leq({1+{\lambda_{rd} (1-\rho)}/{\rho}})^{-1}$
respectively into \eqref{eq:p3_HSNR}, and from \eqref{eq:p1Final}, \eqref{eq:p2Final} and \eqref{eq:q2}, $\tau$ can be approximated as $\tau_{sim}$ in \eqref{eq:TauApproxApp1}.
\par It is worth noting that the above approximation is valid for $\frac{I\lambda_{sp}}{N_o}\gg\gamma_{th}$. However, it continues to follow the throughput $\tau$ in other cases. To get a closed form expression, we further approximate the above by utilizing the fact $\frac{\lambda_{rd}}{\eta\rho}\gg 1-\frac{\lambda_{rd}}{\eta}$ (since $\eta, \rho\leq 1$) and $\frac{I \lambda_{sp} (1-\rho)}{\gamma_{th} N_o\lambda_{sr}}\gg1$ except when $\rho\approx1$ and represented in \eqref{eq:TauSimplified} (top of the page-4). Please note that $\rho\approx1$ is unlikely, since it results in outage of the relayed link.
\vspace*{-0.15cm}
\bibliographystyle{ieeetr}
| {'timestamp': '2017-09-04T02:05:16', 'yymm': '1706', 'arxiv_id': '1706.01734', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01734'} | arxiv |
\section{Introduction}
\label{sec:intro}
Recent progress in unmanned aerial vehicle (UAV) technology has led to exponential growth in the use of drones with onboard sensing. Originally designed for military applications, camera-equipped UAVs are now commonplace in domains such as commercial surveillance, photography, disaster management, product delivery, and mapping \cite{colomina2014unmanned}. An essential step toward better utilization of aerial videos and autonomous drones is real-time localization of the vehicle and accurate mapping of the observed world. Localization relying solely on onboard inertial and GPS measurements, however, cannot achieve pixel-level accuracy due to error accumulation, latency, and relatively coarse precision; furthermore, onboard sensing can be unreliable in GPS-denied environments. Visual simultaneous localization and mapping (SLAM) attempts to address these challenges using camera images to augment or replace other sensors.
Our proposed method, nicknamed \textit{Global-Local Airborne Mapping} (GLAM), approaches large-scale visual SLAM by partitioning the camera's video stream into small local \textit{submaps} created using point features, epipolar geometry between keyframes, point triangulation, and incremental bundle adjustment (BA). Submaps are aligned globally using a graph-based least squares optimization that minimizes the distance between corresponding 3D points. Small temporal overlap ensures that sequential submaps observe common scene content and hence provides correspondences for alignment, while restricting submap size to a small number of frames mitigates drift accumulation. Associations between non-overlapping submaps, for instance due to loop closures, are detected via fast bag-of-visual-words recognition. This paper demonstrates that such a system can run in near real-time on videos of the scale of a hundred thousand frames.
\section{Related Work}
Monocular SLAM is a long-researched subject that has seen evolution from filter based \cite{thrun2005probabilistic, davison2007monoslam} to keyframe based \cite{strasdat2012visual, resch2015scalablesfm} approaches.
PTAM \cite{klein07parallel}, originally developed for augmented reality applications, was one of the first widely used and practical real-time SLAM systems, but was limitated in terms of scale and robustness. Subsequent research improved upon this point feature and bundle adjustment methods \cite{strasdat2010scale, resch2015scalablesfm}. More sophisticated monocular SLAM approaches like DTAM \cite{newcombe2011dtam} and LSD-SLAM \cite{engel12iros} perform semi-dense reconstruction by optimizing directly on image intensities rather than discrete features. SVO \cite{Forster2014ICRA} is a semi-direct approach monocular SLAM approach designed specifically for Micro Aerial Vehicles (MAVs); although SVO operates at very high frame rates, it does not perform loop closure and has been evaluated only on small datasets. ORB-SLAM \cite{mur2015orb} is a recent feature-based approach that has shown good performance on a wide variety of datasets, but largely untested for large aerial datasets.
City-scale 3D reconstruction has received some attention in the structure-from-motion research community \cite{musialski2013survey}. Pollefeys \textit{et al.} \cite{pollefeys2008detailed} reconstruct parts of a city from a hundred thousand frames using INS and metadata to simplify the computation. Agarwal \textit{et al.} \cite{agarwal2011building} and Heinly \textit{et al.} \cite{heinly2015_reconstructing_the_world} perform city and world scale reconstruction respectively from large collections of photographs utilizing cloud computing. Google Earth provides 3D models of a few selected cities, but the technology behind its reconstructions is largely unknown. Leotta \textit{et al.}\cite{leotta2016open} have published open-source software for aerial SfM focused on videos of a scale of a thousand frames but do not address scaling beyond that.
Real-time reconstruction of a city from aerial videos using purely visual data has remained largely unexplored in the literature: traditional visual SLAM approaches do not address the challenges of very long image sequences and large-scale maps, while structure-from-motion methods require substantial offline computation and/or information from additional sensors. Our system incorporates elements of both visual SLAM and large-scale 3D reconstruction, demonstrating fast and accurate city-scale mapping on aerial videos nearly 90,000 frames in length on a single consumer grade computer.
\begin{figure*}
\begin{center}
\includegraphics[width=1.0\linewidth]{GLAM_WACV.png}
\end{center}
\caption{\textbf{GLAM} system overview, showing the main steps performed by submap creation and submap alignment threads.}
\label{fig:overview}
\end{figure*}
\section{Proposed Approach}
Like many existing real-time SLAM systems, we adopt a multi-threaded strategy for computational efficiency, partitioning the problem into tasks that run in parallel. However, rather than defining the tasks as \textit{tracking} and \textit{mapping} \cite{klein07parallel, Forster2014ICRA, mur2015orb}, we define tasks as \textit{local submap creation} and \textit{global submap alignment}. Figure \ref{fig:overview} shows an overview of GLAM's building blocks.
The submap creation thread operates similarly to previous point features and keyframe based approaches \cite{klein07parallel, mur2015orb, strasdat2010scale} that extract point features from video frames, determine relative pose, triangulate points, and perform incremental bundle adjustment. Building the Hessian matrix for incremental bundle adjustment is the most computationally expensive step \cite{sibley2009adaptive}: as the number of frames processed increases, the cost of building the Hessian at every BA iteration becomes prohibitive for real-time operation. We therefore limit each submap to a small number of keyframes in order to maintain a relatively consistent and bounded processing rate.
Each submap consists of a set of 3D landmarks. The submap alignment thread creates and optimizes a pose-graph to determine the set of 7-DoF similarity transformations, one per submap, that minimizes the distances between corresponding landmarks. In contrast to existing approaches that close loops by creating a global database of keyframes (e.g.\, \cite{mur2015orb}), our approach closes loops by building a visual vocabulary of submaps.
GLAM has been evaluated on both synthetic and real datasets. The former are created by simulating drone flight trajectories over an aerial LIDAR point cloud \cite{rigis}, while the latter consists of a large continuous aerial video (labeled ``Downtown'') with nearly $90,000$ 1-megapixel frames captured at $30$ fps.
The main contribution of this paper is a novel visual SLAM pipeline that (1) partitions work into parallel threads of fast local submap creation and large-scale global submap alignment; (2) has the ability to close large loops (3) reconstructs accurate city-size maps from aerial videos; and (4) operates in near real-time at the scale of a hundred thousand images.
\subsection{Local Submap Creation}
The following sections describe keyframe-based submap creation in greater detail. The central idea of keyframe-based SLAM is to use only frames that have sufficiently distinct information for 3D reconstruction. Each video frame is processed in sequence, with keyframes created periodically to reduce redundancy and improve efficiency---only the keyframes are used in intra-submap bundle adjustment.
\textbf{Feature Extraction.} Point features are extracted from each video frame. We use SIFT features \cite{lowe2004distinctive} throughout our system due to their proven robustness to viewpoint, scale and orientation changes. SIFT extraction and matching can be slow, so we use a GPU implementation \cite{wu2007siftgpu} for greater efficiency.
\textbf{Tracking.}
Existing 3D landmarks are projected into the current frame using the pose of the previous frame, since inter-frame motion is assumed to be small. Points that fall outside the frame or that were originally viewed from a substantially different angle are removed. The SIFT descriptors of the remaining points are then matched to those of the current image features to obtain initial 2D-3D correspondences. The 3D pose of the current frame is then estimated using Perspective-n-Point (PnP) localization \cite{lepetit2009epnp} embedded in a RANSAC outer loop.
PnP can fail if the video is discontinuous or if the viewpoint has changed drastically between frames. If the number of PnP inliers is too low, the submap is terminated at the previous frame and a new submap is initiated at the current frame.
\textbf{Keyframes.}
As new parts of the world come into view, the number of PnP inliers continually decreases. When this number falls below a threshold $\tau_{resection}$, the system adds a new keyframe and triangulates new 3D points. Selection of $\tau_{resection}$ is key in ensuring a balance between speed and stability: a high value causes frequent keyframe additions and thus slows the overall system, while a low value reduces visual overlap between keyframes and may lead to unstable or failed bundle adjustment.
To improve stability further, an additional keyframe is chosen halfway between the previous keyframe and the current frame. This \textit{middle} keyframe's pose is initialized to its PnP estimate, and its 2D PnP inliers are added as observations of their counterpart 3D landmarks for BA. Geometrically consistent 2D matches are obtained between the middle keyframe and the current frame via RANSAC-based essential matrix estimation, and these matches are triangulated using the PnP pose estimates to form new 3D landmarks and corresponding 2D observations for BA. The SIFT descriptor from the \textit{middle} keyframe is assigned to each landmark.
Since the triangulation of new landmarks does not take into account the landmarks that have already been constructed, a subset may be duplicated. Therefore, any new landmark whose descriptor matches any existing landmark is removed. The current frame is finally added as a keyframe and its pose and observations are added to BA.
This selection strategy depends on neither physical nor temporal distance between keyframes; instead, keyframes are added only when sufficient new visual information is available, allowing the system to process videos acquired at arbitrary speed. In the Downtown dataset, for instance, the system selected keyframes spaced roughly 25 to 100 frames apart.
\begin{figure*}
\setlength{\tabcolsep}{1pt}
\begin{tabular}{llll}
\includegraphics[width=4.3cm]{005000.jpg}
\includegraphics[width=4.3cm]{022000.jpg}
\includegraphics[width=4.3cm]{024000.jpg}
\includegraphics[width=4.3cm]{079000.jpg}
\\
\includegraphics[width=4.3cm]{037000.jpg}
\includegraphics[width=4.3cm]{049500.jpg}
\includegraphics[width=4.3cm]{066000.jpg}
\includegraphics[width=4.3cm]{054000.jpg}
\\
\end{tabular}
\caption{\textbf{Example images from the Downtown dataset.} A few scenes from the dataset showing challenging views with illumination changes, planar regions, high 3D relief, and water.}
\label{fig:frames}
\end{figure*}
\textbf{Incremental Bundle Adjustment.}
Similar to PTAM \cite{klein07parallel} and ORB-SLAM \cite{mur2015orb}, GLAM runs BA every time a new keyframe is added, optimizing the poses of all keyframes and the positions of all landmarks while holding fixed the intrinsic camera parameters. Different libraries including g2o \cite{kuemmerle11icra} and ceres-solver \cite{agarwal2013ceres} were evaluated, but pba \cite{wu2011multicore} performed best due to its specialization for BA problems.
\textbf{Bootstrapping}. When a new submap is initiated, no keyframes or 3D landmarks yet exist, so a strategy different from the steady-state process described above must be employed to establish initial geometry. The first frame of the submap becomes the first keyframe, with its pose fixed at the origin. Features from subsequent frames are matched against those of the first keyframe to find epipolar geometry via RANSAC-based essential matrix estimation \cite{Hartley00}. The current frame becomes the second keyframe if the number of RANSAC inliers falls below $\tau_{stereo}$ or if the average triangulation angle exceeds $\alpha_{stereo}$. (for the experiments described in this paper, we used $\tau_{stereo} = 1000$ and $\alpha_{stereo} = 30^{\circ}$). The inlier correspondences are triangulated to form the initial 3D landmarks.
\textbf{Completion.} A submap is sucessfully completed when the number of keyframes exceeds a threshold. We found that 20 keyframes were generally sufficient to form a stable reconstruction and minimize internal loop closures. Upon completion, all frames are re-localized to the final landmark set via PnP, which requires only that 3D-2D matches and not features to be recomputed. The next submap is initiated to have a degree of overlap (in our experiments, 10\%) with the current submap so that the two share a set of 3D points for alignment.
\textbf{Outlier filtering.}
Incorrectly matched point features lead to outliers that can dramatically affect bundle adjustment accuracy. Our system therefore filters outliers at several stages. First, after every bundle adjustment step, any point whose reprojection error exceeds a threshold is removed. Some incorrect matches may exhibit small reprojection error, such as when triangulation rays are nearly parallel and the reconstructed landmark is very far from the rest of the scene. To remove these points, the \textit{k} (30) nearest neighbours of each point are computed using a kd-tree, and a point is removed if its average distance from its neighbours is more than 2 standard deviations. Finally, upon submap completion, any point with large reprojection error in all frames is removed.
\textbf{Focal length estimation.}
Use of accurate camera intrinsics is instrumental in full-scale reconstruction, since there is no single rectifying transformation for incorrect intrinsics. The published focal length of 1800 for the lens used to collect the Downtown dataset was imprecise and led to reconstruction failures. We therefore included per-keyframe focal length in PBA optimization, observing that the median over all frames' estimated focal length converged to 1751 as the number of frames increased, as shown in Figure \ref{fig:focal}.
\begin{figure}[t]
\begin{tabular}{cc}
\includegraphics[width=8.2cm]{focal_orig.png}\\
(a)\\
\includegraphics[width=8.2cm]{focal2_orig.png}\\
(b)\\
\end{tabular}
\caption{\textbf{Estimation of focal length and radial distortion.} (a) Focal length of a new keyframe after it is added to bundle adjustment. (b) Median focal length of all keyframes after adding a new keyframe to bundle adjustment.}
\label{fig:focal}
\end{figure}
\subsection{Global Submap Alignment}
As local submaps are created, a parallel thread uses them as the unit of processing for full map reconstruction. This thread discovers correspondences between submaps, including loop closures, and optimizes pose and structure globally and efficiently.
\textbf{Submap matching.}
Although temporally adjacent submaps are known to be associated with one another by construction, it is required to discover visual links between submaps that view common scene content, regardless of the time at which they were created. This forms a connectivity graph in which submaps constitute nodes and commonly observed points constitute edges.
A naive implementation would identify visual links through brute-force search over every possible pair of submaps. This requires $O(n^2)$ time for $n$ submaps, making the process computationally intractable as $n$ grows. To form a connectivity graph efficiently, we employ a bag-of-words technique. A vocabulary tree is created offline using randomly-sampled SIFT descriptors drawn from aerial images; a series of k-means clustering operations partition the descriptors into a tree of visual words \cite{nister2006scalable}. As each submap is completed, its landmarks' SIFT descriptors are added to a database formed over the tree, and visual words are incrementally associated with the submap via an inverted index. The set of landmark descriptors in this submap is then used to query the database, which returns a ranked set of matching submaps and their weighted match scores. This mechanism reduces the complexity of submap matching from quadratic to linear time, as shown in Figure \ref{fig:realanalysis}.
The result is a graph whose edges represent potential visual matches based on an unordered bag of indexed visual words with no geometric constraints. Some graph edges may be incorrect, sharing a number of similar-looking features but not actually viewing common areas of the scene (e.g.\, due to repeated urban structures such as windows). The geometric consistency of correspondences is verified by estimating a closed form similarity transform between 3D landmarks in a RANSAC loop, accounting for both pose and scale differences. Edges with too few inliers are removed, as are all outlier landmark correspondences.
\begin{figure}
\begin{center}
{\includegraphics[width=6.0cm]{submap-graph2.png}}
\end{center}
\caption{\textbf{Representation of a submap pose-graph.} The nodes $S_1$, $S_2$, $S_3$,... represent a 7 DoF Sim(3) transformation for each submap. The nodes $l_1$, $l_2$, $l_3$,... represent a location in $\mathbb{R}^3$ for each 3D landmark point. An edge between a submap and 3D point represents the observation of the point in the submap. The nodes $p_1$, $p_2$, $p_3$,... are scale prior nodes for every submap that prevent collapse to zero scale during optimization. }
\label{fig:submapgraph}
\end{figure}
\textbf{Submap pose-graph}
After establishing temporal and spatial correspondences between submaps, the next step is to create a pose-graph and optimize the pose of the submaps such that the 3D distance between corresponding points is minimized (Figure \ref{fig:submapgraph}). Scale-drift \cite{strasdat2010scale} within submaps is addressed implicitly by the keyframe addition strategy, while scale-drift across submaps is adressed by using a 7 DoF similarity transform to represent each submap's pose.
The distance between corresponding 3D points of the submaps is minimized by using non-linear Gauss-Newton (GN) optimization \cite{Hartley00}, which involves finding a Jacobian w.r.t. to all free parameters. In this case, the 7 DoF pose of a submap and the $\mathbb{R}^3$ location of a landmark are the free parameters of the cost function. Differentiating the cost function w.r.t. the Lie group elements \textit{(R,s,t)} yields the Lie algebra space sim(3) \cite{eade2014lie}. sim(3) is a 7 dimensional vector space ($\omega$, $\sigma$, $\mu$), where $\omega$, $\sigma$ and $\mu$ respresent the Lie algebra components of rotation, translation and scale respectively.
Given a set of submaps $S$ and landmarks $L$, a 7 DoF similarity transform $(R, s, t)$ is associated with every submap $i$ and represented in the pose-graph with a Sim(3) node. A world point $X_j$ is represented with a $\mathbb{R}^3$ node in the pose-graph. If submap $i$ observes 3D point $X_j$, it is represented by edge $x_{ij}$ in the pose-graph.
Scale is constrained by multiplication of a small constant $\lambda_{a}$ ($<$1) with the Lie algebra of scale, $\mu_i$.
The scale prior prevents the solver from converging to a trivial solution, i.e zero scale.
The resulting cost function is:
\begin{equation}
f(S,L) = \sum_{i \in S} \sum_{j \in L} ||s_i R_i x_{ij} + t_i - X_j||^2 + \sum_{i \in S}|| \lambda_{a} \mu_{i} ||^2
\end{equation}
Initially, the scale prior used was $\sum_{i \in S} ||c - s_{i}||^2$, where c was a small constant, typically 1. When added to the remaining cost function, this scale prior prevented the trivial solution by evaluating to a non-zero value. However, it is an invalid operation since it is subtracting the Lie group $s_{i}$ from 1, and addition / subtraction operations are undefined for Lie groups. Hence, a valid scale prior instead constraints the scale by multiplying the Lie Algebra of scale $\mu$ with a small constant $\lambda$. This scale prior has a similar effect on the overall cost function at $\mu$ equals zero. It was also observed experimentally that a cost function with the former scale prior resulted in submaps that didn't align properly to each other but the latter scale prior fixed those alignment issues.
Every step of a GN optimization updates the sim(3) vector of each submap vertex with a $\upsilon_{up}$ vector. If $\upsilon$ and $G$ are the Lie algebra and Lie group of the current state of a Sim(3) vertex, then the vector update $\upsilon_{up}$ is applied as follows:
\begin{align}
G_{up} &= exp(\upsilon_{up}) \\
\upsilon &= log(G_{up} * exp(\upsilon)) \\
G &= G_{up} * G
\end{align}
The g2o \cite{kuemmerle11icra} framework is used to form and optimize the factor graph via Levenberg-Marquardt (LM), with robustness added via Huber loss \cite{Hartley00}. Preconditioned conjugate gradient is used to efficiently solve the sparse linear system of equations arising at each step of LM, and analytic Jacobians were dervied to further speed up the computation. and are as follows:
\begin{align}
\frac{\partial{y}}{\partial{R}} = -y_{\times}, \hspace{2mm}
\frac{\partial{y}}{\partial{t}} = I, \hspace{2mm}
\frac{\partial{y}}{\partial{s}} = y
\end{align}
where,
\begin{align}
y = (y_1, y_2, y_3) = f(S,L)
\\
y_{\times} =
\begin{bmatrix}
0 & -y_3 & y_2 \\
y_3 & 0 & -y_1 \\
-y_2 & y1 & 0
\end{bmatrix}
\end{align}
\begin{figure*}
\begin{center}
\begin{tabular}{cc}
\includegraphics[width=.5\textwidth]{google-earth.png}&
\includegraphics[width=.5\textwidth]{google-earth2.png}\\(a) & (b)\\
\includegraphics[width=.4\textwidth]{synthRI.png}&
\includegraphics[width=.4\textwidth]{synth1_3.png}
\\(c) & (d)\\
\end{tabular}
\end{center}
\caption{\textbf{Synthetic datasets.} (a) Two camera trajectories and viewing direction trajectories drawn in green and red respectively in Google Earth. (b) LIDAR points and the synthetic camera and viewing direction trajectories of synthetic dataset synth1. (c), (d) 3D reconstruction of synth1 using GLAM. The cameras from each submap are represented with a different colour. Results from datasets synth2 and synth3 are shown in the supplementary material.}
\label{fig:synthfig}
\end{figure*}
\section{Experiments}
We evaluated GLAM on both synthetic and real datasets. Our experiments demonstrate centimeter level accuracy on synthetic datasets, and accuracy comparable to VisualSFM \cite{wu2011visualsfm} on real datasets, while providing a much faster run-time.
\subsection{Synthetic Data}
We created synthetic datasets using Google Earth to simulate camera trajectories and using a LIDAR point cloud \cite{rigis} to serve as ground truth for simulated image projections. The results of 3D reconstruction on three such datasets is shown in Figure \ref{fig:synthfig} and summarized in Table \ref{tab:synthetic}.
\begin{table}[!htb]
\begin{center}
\begin{tabular}{|l|c|c|c|c| }
\hline
& Frames & Submaps & Points & RMSE(cm)\\
\hline
synth1 & 1100 & 14 & 239727 & 0.3 \\ \hline
synth2 & 3408 & 15 & 328337 & 3.4 \\ \hline
synth3 & 40000 & 53 & 505000 & 0.6 \\
\hline
\end{tabular}
\end{center}
\caption{\textbf{Results on synthetic datasets.} Comparison of reconstructed maps to ground truth demonstrates errors on the order of centimeters and millimeters. The number of points in synth3 was made intentionally smaller than those in synth1 and synth2. Figures of the reconstruction from the three synthetic datasets can be found in the supplmentary material.}
\label{tab:synthetic}
\end{table}
\begin{figure*}
\setlength{\tabcolsep}{.16667em}
\begin{tabular}{ccc}
\includegraphics[width=5.7cm]{frame_BA_submap.png}&
\includegraphics[width=5.7cm]{results_plot2_2.png}&
\includegraphics[width=5.7cm]{results_plot3.png}\\
(a)&(b)&(c)
\end{tabular}
\caption{\textbf{Analysis of the system on the Downtown dataset.} (a) The final bundle adjustment reprojection error within each submap (blue) remains bounded as new submaps are created every few thousand frames (red). (b) Submap creation time (green) also remains bounded, while submap alignment time (red) increases linearly but maintains acceptable latency for real-time operation. Spikes in the red curve are due to convergence failure when the graph has multiple disconnected components that are resolved later when missing correspondences are established. (c) At 88,000 frames, the total number of 3D points in the map are 1.7 million but the number of vertices and edges in the submap pose-graph are just 64k and 146k respectively, which allows an optimization of the full graph in real-time. A naive method that does incremental bundle adjustment with g2o on all the points in the dataset would have to potentially deal with BA on 1.7 million points, which would make each step of bundle adjustment infeasible in real-time and the required memory would potentially not fit on a single consumer-grade machine.}
\label{fig:realanalysis}
\end{figure*}
\subsection{Real Data}
The Downtown dataset (Figure \ref{fig:frames}) is a video of 88,100 frames shot over Providence, USA. We applied GLAM to the entire video; Figure \ref{fig:realanalysis} illustrates runtime performance and scale, and Figure \ref{fig:realresults} visualizes the reconstruction results. The average run-time for submap creation is 5.8 fps, while the latency of the submap alignment and reconstruction thread is typically a few seconds.
We registered the landmark cloud reconstructed in the first 5,000 frames to a LIDAR point cloud of the same area using ICP \cite{besl1992method} to quantify accuracy with respect to ground truth. We also compared performance with VisualSFM \cite{wu2011visualsfm}, run on every $10^{th}$ frame of the first 5,000 frames (Table \ref{tab:realresults}).
\begin{figure*}
\begin{tabular}{ccc}
\includegraphics[width=8.2cm]{downtown_cameras.png}&
\includegraphics[width=8.2cm]{downtown_points4.png}\\
(a)&(b)\\
\includegraphics[width=8.2cm, angle=0]{downtown_points2.png}&
\includegraphics[width=8.2cm]{earth2.jpg}\\
(c)&(d)
\end{tabular}
\caption{ \textbf{Final results.} (a), (b) GLAM created 93 submaps for the full Downtown sequence, but 6 submaps failed in early stages due to bad frames. The above figure shows the 87 successful submaps aligned over the Downtown dataset. The cameras of each submap are represented with a different color. (c) The reconstructed 3D point cloud. (d) Google Earth image of Providence Downtown.}
\label{fig:realresults}
\end{figure*}
\begin{table}[!htb]
\begin{center}
\begin{tabular}{|l|c|c| }
\hline
& RMSE & Runtime\\
\hline
Visual SFM & \textbf{2.88 m} & 3.96 hrs \\ \hline
GLAM & 2.93 m & \textbf{11.79 min} \\ \hline
\end{tabular}
\label{tab:realresults}
\end{center}
\caption{\textbf{Comparison with Visual SFM.} ICP results on the first 5k frames of Downtown datset. GLAM is much faster than Visual SFM with comparable accuracy. Note that the LIDAR points are quantized to one meter spacing.}
\end{table}
\section{Conclusion}
This paper introduces a new visual SLAM system that can process long videos in near real-time on a single computer. Local submaps are constructed using incremental bundle adjustment over keyframes, and the global scene is reconstructed using factor graph optimization over submaps rather than keyframes, which allows closure of large loops. Submap creation has constant runtime complexity throughout, while submap alignment time increases linearly at a low rate, indicating that the system can be run on even larger datasets while maintaining acceptable latency.
The system's main performance bottleneck is currently SIFT feature extraction and matching. Future work will focus on improving run time by using binary descriptors. We also plan to investigate reducing the total number of constraints, incorporation of global averaging techniques, testing the approach on even larger datasets, and applying the system to terrestrial videos.
\section{Acknowledgements}
The authors would like to thank Vishal Jain his helpful advice and guidance on different parts of the project. This research is based upon work partly supported by Air Force Research Laboratory(AFRL) under contract number FA8650-14-C-1826. This document is approved for public release via 88ABW-2017-2724.
{\small
\bibliographystyle{ieee}
| {'timestamp': '2018-06-08T02:07:51', 'yymm': '1706', 'arxiv_id': '1706.01580', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01580'} | arxiv |
\section{Introduction}
\label{sec:intro}
The normal assumption is the basis of statistical analyses in several
fields, such as medicine and health sciences. Indeed, under this
assumption, standard parametric estimation and testing procedures are
simple and most efficient. However, it is well known that these
procedures are not robust when the normal distribution is just an
approximate parametric model or in the presence of outliers in the
observed data. A challenging example, characterised by the possible presence of outliers,
is given by the study of \cite{tramentozzi2016} discussed in Section 2, which focuses on
the role of a protein in the production of immunoglobines and cytokines. In particular,
the study concerns repeated measures of moderate sample size, for which it is shown that the classical Bayesian analysis through the normal Linear Mixed Model (LMM) is strongly influenced by outliers. In this case, it may be preferable to base inference on procedures that are more resistant, which specifically take into account the fact that the assumed models is only approximate. In order to produce statistical procedures that are stable
with respect to small changes in the data or to small model departures,
robust statistical methods can be considered.
The concept of robustness has been widely discussed in the frequentist literature; see, for instance, \cite{hampel1986,tsou1995robust,lavine1995on} and \cite{markatou1998wieg}. On the other hand, Bayesian robustness literature is also well developed, most of which is focused on sensitivity with respect to the prior distribution; we mention here the overviews in \cite{berger1994overview}, \cite{rios2000robust} and \cite{rios2005robust}. Recently, Bayesian robustness with respect to model misspecification have attracted considerable attention. For instance, \cite{lazar03}, \cite{greco2008robust} and \cite{vcr2010} discuss approaches based on robust pseudo-likelihood functions, i.e.\ the quasi-likelihood and the empirical likelihood, derived from robust $M$-estimation functions, as replacement of the genuine likelihood in Bayes' formula. \cite{lewis2014bayesian} discuss an approach for building posterior distributions from robust $M$-estimators using constrained Markov chain Monte Carlo (MCMC) methods. Approaches based on tilted likelihoods can be found in \cite{miller2015robust}, \cite{watson2016approximate} and \cite{grunwald2014inconsistency}, among others. Finally, approaches based on model embedding through heavy-tailed distributions or on weighted likelihoods are discussed by \cite{andrade2006bayesian} and \cite{agostinelli2013}, respectively.
However, the aforementioned approaches are not without limitations. In particular, robust posterior distributions derived from robust estimating functions have two drawbacks: the empirical likelihood is not computable for very small sample sizes and for moderate sample sizes appears to have always heavy tails; posterior distributions based on the quasi-likelihood can be easily obtained only for scalar parameters. The restricted likelihood approach of \cite{lewis2014bayesian}, as well as the previous approaches based on estimating equations can be computationally cumbersome with robust $M$-estimating functions in the context of LMM (see Sect.~\ref{sec:application}). The solution of embedding in a larger structure has the cost of eliciting a prior distribution for the extra parameters introduced in the analysis. Moreover, the statistical procedures derived under an embedded model are not necessarily robust in a broad sense, since the larger model may still be too restricted in the space of all distributions. Finally, the tilted and the weighted likelihood approaches refer to concepts of robustness that are not directly related to the one considered in this paper.
Concretely, we focus on the robustness approach based on the influence function ($IF$), extensively discussed in book-length treatments by \cite{huber1981robust}, \cite{hampel1986} and \cite{huber2009robust}, and on the derivation of robust posterior distributions that condition on, generally insufficient, statistics with bounded $IF$. Such a conditioning is performed by appealing to the well-developed frequentist robust $M$-estimation theory, i.e. unbiased $M$-estimating equations with bounded $IF$, which provides estimators that target the parameter of interest and satisfy the usual asymptotical properties such as unbiasedness and normality. $M$-estimating functions are general unbiased estimating functions that include as special case the score function and scoring rules \citep[see, e.g., ][and references therein]{dawid2014theory}. To overcome the previous difficulties with current approaches to Bayesian robustness based on unbiased estimating equations, we propose an alternative method based on Approximate Bayesian Computation (ABC) \citep[see, e.g.,][]{pritchard1999population}. The typical motivation for the use of ABC is the intractability of the likelihood. Here, instead, we couple ABC with robust unbiased $M$-estimating functions. The idea can be seen as an extension of the results of \cite{ruli2016approximate} to Bayesian robustness with respect to misspecification. The method is easy to implement and computationally efficient, even when the $M$-estimating functions are cumbersome to evaluate for different parameter values. Theoretical properties, implementation details and simulations results are discussed.
Section 2 describes a motivating dataset on the glucose regulated protein94 (\texttt{GRP94}). Section 3 sets the necessary background. Section 4 describes the proposed method and its theoretical properties. Section 5 investigates the properties of the proposed method in the context of LMM through simulations and applies it to the \texttt{GRP94} dataset. Concluding remarks are given in Section 6.
\section{The \texttt{GRP94} dataset}
\label{sec:amotiv}
The \texttt{GRP94} dataset \citep{tramentozzi2016} concerns the measurement of glucose-regulated protein94 in plasma or other biological fluids and the study of its role as a tumour antigen, i.e. its ability to alter the production of immunoglobines (IgGs) and inflammatory cytokines in the peripheral blood mononuclear cells (PBMCs) of tumour patients. The study involved 28 patients admitted to the division of General Surgery of the Civil Hospital of Padova for ablation of primary, solid cancer of the gastro-intestinal tract. For each patient, gender, age (expressed in years), type and stage of tumour (ordinal scales of four levels) are given. Patient with ID 15 was removed from the study afterwards, for clinical reasons. Patients' plasma and PBMCs were challenged with GRP94 complexes and the level of IgG and of the cytokines: interferon$\gamma$ (IFN$\gamma$), interleukin 6 (IL-6), interleukin 10 (IL-10) and tumour necrosis factor $\alpha$ (TNF$\alpha$) were measured. Owing to time and cost constraints, for patients IDs 17, 27 and 28 only the IgG were measured. The following five treatments were considered: GRP94 at the dose of either 10 ng/ml or 100 ng/ml, GRP94 in complex with IgG (\texttt{GRP94+IgG}) at the doses 10 ng/ml or 100 ng/ml and IgG a the dose 100 ng/ml. Finally, baseline measurements of IgG and of the aforementioned cytokines were taken from untreated PMBCs. Although fresh patient's plasma and PMBCs are taken for each treatment and patient, the resulting measures are likely to be correlated since plasma and PMBCs are taken from the same patient. Hence, a LMM is a suitable model for this data. Using paired Mann-Whitney tests \cite{tramentozzi2016} showed that GRP94 in complex with IgG at the higher dose can significantly inhibit the production of IgG and stimulate the secretion of IL-6 and TNF$\alpha$ from PBMCs of cancer patients. In addition, some of the differences between treatments were significant for a specific gender; see \cite{tramentozzi2016} for full details.
Another feature of these data is the presence of extreme observations, both at baseline and challenged PMBCs-based measurements, as it can be seen from the strip plots in Figure \ref{fig:eda01}. Such extreme observations induce high variability on the response measurements, especially for IFN$\gamma$, IL-6, IL-10 and TNF$\alpha$. Hence, one must be cautious when fitting a LMM to such data; see Section~\ref{sec:application} for the complete analysis of the \texttt{GRP94} data.
\begin{figure}[t!]
\centering
\includegraphics[width=1.0\textwidth]{figures/eda01.eps}
\caption{Strip plots of IgG, IFN$\gamma$, IL-6, IL-10 and TNF$\alpha$ (in logarithmic scale) measured from PBMCs at baseline and after challenging with complexes of GRP94 and IgG. Values on the horizontal axis are (arbitrarily) ordered according to patient ID. Patient ID 5 was removed from the study and cytokines' measurements for patients with ID 17, 27 and 28 are missing.}
\label{fig:eda01}
\end{figure}
\section{Background}
\label{sec:background}
The present section provides an overview on concepts and methods that are needed to make the paper as much self-contained as possible. In particular, Section 3.1 gives background on robust $M$-estimation, Section 3.2 provides an overview on pseudo-likelihoods and Section 3.3 gives background on ABC.
\subsection{Robust $M$-Estimation}
\label{ssec:robustm}
Let $y = (y_1,\ldots , y_n)$ be a random sample of size $n$, having independent and identically distributed components, according to a distribution function $F_\theta =F(y;\theta)$, with $\theta \in \Theta \subseteq {\rm I}\negthinspace {\rm R}^d$, $d \geq 1$. Let $L(\theta;y)$ be the likelihood function based on model $F_\theta$.
Let $\Psi_\theta = \Psi(y;\theta)= \sum_{i=1}^n \psi(y_i;\theta)$ be an unbiased estimating function for $\theta$, i.e.\ such that $E_\theta (\psi(Y; \theta)) = 0$ for every $\theta$, with $\psi(\cdot)$ known function and with $E_\theta(\cdot)$ expectation with respect to $F_\theta$. Typically, $\Psi_\theta$ can be written as
\[
\Psi_\theta = b(\theta)^\T a(y, \theta) - c(\theta)\,,\label{eq:typicalPsi}
\]
where $a(\cdot,\cdot)$ and $c(\cdot)$ are known vector-valued functions and $b(\theta)$ may be a known vector- or matrix-valued function of suitable dimensions. The function $c(\cdot)$ is typically a consistency correction, i.e. it ensures that $E_\theta(\Psi_\theta)=0$. Most of the robust M-estimating functions can be recast in this form.
A general $M$-estimator (see, e.g., \citealp{hampel1986}, \citealp{huber2009robust}) is defined as the root $\tilde\theta$ of the estimating equation
$$
\Psi_\theta = 0
\ .
$$
The class of $M$-estimators is wide and includes a variety of well-known estimators. For example, it includes the maximum likelihood estimator (MLE), the maximum composite likelihood estimator \citep[see, e.g.,][and references therein]{ruli2016approximate} and the scoring rule estimator (see \citealp{basu1998robust}, \citealp{dawid2016minimum}, and references therein).
Under broad conditions assumed throughout this paper (see, e.g., \citealp{hampel1986}, \citealp{huber2009robust}), an $M$-estimator is consistent and approximately normal with mean $\theta$ and variance
\begin{eqnarray}
K (\theta) = H(\theta)^{-1} J(\theta) H(\theta)^{-\T}
\ ,
\label{var}
\end{eqnarray}
where $H(\theta) = -E_\theta (\partial \Psi_\theta/\partial \theta^{\T})$ and $J(\theta) = E_\theta(\Psi_\theta \Psi_\theta^{\T} )$ are the sensitivity and the variability matrices, respectively. The matrix $G(\theta)=K(\theta)^{-1}$ is known as the Godambe information and the form of $K(\theta)$ is due to the failure of the information identity since, in general, $H(\theta) \neq J(\theta)$.
The $IF$ of the estimator $\tilde\theta$ is given by
$$
IF (x;\tilde\theta,F_\theta) = H(\theta)^{-1} \psi (x;\theta)
\ ,
$$
and it measures the effect on the estimator $\tilde\theta$ of an infinitesimal contamination at the point $x$, standardised by the mass of the contamination. The supremum of the $IF$, i.e. the gross-error sensitivity, measures the worst influence on $\tilde\theta$ and a desirable robustness property for a statistical procedure is that the gross-error sensitivity is finite, i.e. that the $IF$ is bounded (B-robustness). Note that the $IF$ of the MLE is proportional to the score function; therefore, in general, MLE has unbounded $IF$, i.e. is not B-robust. On the contrary, if $\psi(x; \theta)$ is bounded, then the corresponding $M$-estimator $\tilde\theta$ is B-robust \citep{hampel1986}. Finally, note that the $IF$ can also be used to evaluate the asymptotic covariance matrix of $\tilde\theta$, since $K (\theta)=E_\theta (IF(x;\tilde\theta,F_\theta) IF(x;\tilde\theta,F_\theta)^{\T})$.
\subsection{Pseudo-likelihoods from unbiased estimating functions}
\label{ssec:pseudolik}
In general, there is not a unique function which has first derivative equal to $\Psi_\theta$, and many efforts have been made in order to derive pseudo-likelihood functions for $\theta$ based on $\Psi_\theta$. Pseudo-likelihoods are functions of the parameter $\theta$ and the data, with properties similar to a genuine likelihood function. Here we focus on three possible pseudo-likelihoods derived from $\Psi_\theta$.
A first pseudo-likelihood may be defined in terms of the conditional density of $\tilde{\theta}$ given $\theta$. In particular, assume that the joint density of $y$ is parametrized in terms of $\theta$ and a nuisance parameter $\lambda$ as
\[
f(y;\theta,\lambda) = g(\tilde{\theta};\theta)
h(y|\tilde{\theta};\theta,\lambda)\,.
\]
Then $g(\tilde\theta;\theta)$ is a pseudo-likelihood for $\theta$ and its use is justified provided the information contained in $h(y|\tilde{\theta};\theta,\lambda)$ about $\theta$, when $\lambda$ is unknown, is small or irrelevant \citep{davison1992bootstrap}.
In practice $g(\tilde{\theta};\theta)$ is unknown, but an approximation can be obtained via the bootstrap method (\citealp[see, e.g.,][]{davison1992bootstrap,boos1986bootstrap}, \citealp{rubin1981bayesian}), or by saddle-point approximations \citep[see, e.g.,][and references therein]{ronchetti1994empirical}. The restricted likelihood method of \cite{lewis2014bayesian} can be seen as a simulation-based approximation of $g(\tilde\theta;\theta)$.
Other pseudo-likelihoods, such as the quasi-likelihood \citep{mccullagh,adimari2002quasi,adimari2002quasim} and the empirical likelihood \citep{owen2001empirical} provide other means of building pseudo-likelihood function directly from $\Psi_\theta$.
The quasi-likelihood is defined as
$$
L_Q(\theta) = \exp \left( \int_k^\theta A(t) \Psi(y;t) \, dt \right)
\ ,
$$
where the matrix $A(\theta)$ is such that $A(\theta)^{\T} = J(\theta)^{-1} H(\theta)$ and $k$ is an arbitrary constant. When $d = 1$, $L_Q(\theta)$ is usually easy to derive, but when $d > 1$ the integrals is path-dependent. The adjustment $\Psi_\theta^a = A(\theta) \Psi(y;\theta)$ of $\Psi_\theta$ is necessary in order to recover the information identity, and thus the correct curvature (see, e.g., \citealp{pacesalvan97}, Chap.\ 4). Since $|A(\theta)| \neq 0$, $\Psi_\theta^a=0$ leads to the same solution $\tilde\theta$ of the original estimating equation $\Psi_\theta=0$ and the robustness properties of $\tilde\theta$ do not depend on $A(\theta)$ because this matrix does not change its $IF$.
The empirical likelihood $L_E(\theta)$ is defined through the empirical likelihood ratio statistic $W_E(\theta)=- 2 \log R (\theta)$, with $R (\theta)=\max_{p_i} \prod_{i=1}^n n p_i$, where the $p_i$ weights satisfy $p_i \geq 0$, $\sum_{i=1}^n p_i=1$ and $\sum_{i=1}^n \psi(y_i;\theta)p_i=0$. A Lagrangian argument leads to
$$
W_E (\theta) = 2 \sum_{i=1}^n \log ( 1+\eta^{\T} \psi(y_i;\theta) )\,,
$$
if $\theta=0$ is inside the convex hull of $\psi(y_1; \theta),\ldots , \psi(y_n; \theta)$; otherwise, it is adequate to set $W_E(\theta)=+\infty$. The Lagrangian multiplier $\eta = \eta(\theta)$ satisfies $\sum_{i=1}^n \psi(y_i ; \theta)/(1 + \eta^{\T} \psi(y_i ; \theta)) = 0$.
\cite{davison1992bootstrap} show that, under suitable regularity conditions, the bootstrap likelihood is asymptotically equivalent to first-order to the empirical likelihood $L_E(\theta)$. Moreover, under standard regularity conditions, it can also be shown that the quasi-likelihood ratio statistic $W_Q(\theta)$ and $W_E(\theta)$ are equivalent to the first term of their Taylor expansions. Lastly, \cite{monti1993relationship} investigate connections between $L_E(\theta)$ and saddlepoint pseudo-likelihoods in the case of $M$-estimating functions.
In the Bayesian framework, the use of $L_Q(\theta)$ in place of the proper likelihood has been discussed by \cite{greco2008robust} and \cite{vcr2010}, while the use of $L_E(\theta)$ has been discussed by \cite{lazar03}, though not for robustness purposes, and by \cite{greco2008robust}. Since $L_Q(\theta)$ and $L_E(\theta)$, as well as the bootstrap and the saddle-point likelihoods, share most of the properties of the genuine likelihood, they can be used as a replacement of the latter in the Bayes' formula \citep{ventura2016pseudo} which, in the case of robust estimating functions, leads to the robust posterior distribution
\begin{equation}
\pi_R(\theta|y) \propto \pi(\theta) \, L_R(\theta)
\ ,
\label{postR}
\end{equation}
where $\pi(\theta)$ is a prior distribution for $\theta$ and $L_R(\theta)$ is a pseudo-likelihood based on a robust $\Psi_\theta$, i.e. $L_Q(\theta)$, $L_E(\theta)$.
The approach based on robust posterior distributions (\ref{postR}) derived from robust $M$-estimating functions has two main drawbacks: the empirical likelihood is not computable for very small values of the sample size and for moderate sample sizes appears to have always heavy tails \citep[see, e.g.,][]{adimari2002quasi,greco2008robust}; the posterior distribution based on the quasi-likelihood can be easily obtained only for scalar parameters. Lastly, efficient use of bootstrap, empirical saddle-point and of restricted likelihood methods requires $M$-estimating functions that are easy to evaluate at different parameter values, which is generally not the case, especially in the context of this paper.
\subsection{Approximate Bayesian Computation}
\label{ssec:approximate}
Given a prior $\pi(\theta)$ and assuming that simulation from $F_\theta$, at a given $\theta$, is possible, the ABC method (\citealp{tavare1997inferring}, \citealp{pritchard1999population}) can provide an approximation of the posterior distribution $\pi(\theta|y)$, by means, for instance, of the accept-reject ABC algorithm (see Algorithm~\ref{alg:abc-ar} and \citealp{tavare1997inferring}). The latter
\begin{algorithm}
\caption[]{\label{alg:abc-ar} ABC accept-reject algorithm.}
\SetAlgoLined
\For {$i = 1 \to m$}{
\Repeat{$\rho(y, y^{*})\leq\epsilon$}{
draw $\theta^*\,\sim\,\pi(\cdot)$\;
draw $y^*\,\sim\, F_{\theta^*}$
}
set $\theta^{(i)}=\theta^{*}$
}
\end{algorithm}
samples from the joint distribution
$$
\pi_{\epsilon}(\theta,y^*|y) = \frac{ \pi(\theta)f(y^*;\theta)\mathbb{I}_{A_{\epsilon,y}(y^*)} }{ \int_{A_{\epsilon,y} \times\Theta }\pi(\theta)f(y^*;\theta)\,dy^* d\theta}
\ ,
$$
where $\mathbb{I}_{A_{\epsilon,y}(y^*)}$ is the indicator function of the set
$A_{\epsilon,y}(y^*) = \{y^*:\,\rho(y^*,y)\leq\epsilon\}$, $\rho(\cdot)$ is a given distance and $\varepsilon>0$ is a fixed tolerance level. The ABC method provides an approximation of the posterior distribution $\pi(\theta|y)$, given by
\[
\pi_{\epsilon}(\theta|y) = \int \pi_{\epsilon}(\theta,y^*|y)\,dy^*
\,.
\]
If $\epsilon\to 0$, then $\pi_{\epsilon}(\theta|y) \to \pi(\theta|y)$ \citep{blum2010approximate}. The threshold $\epsilon$ is generally set to the $\alpha$th quantile of the distance among the simulated and observed data, with $\alpha$ {being} typically very small \citep[see, e.g.,][]{beaumont2002approximate}.
In practice, the distance among the raw data can be rather noisy and a dimensional reduction of $y$ and $y^*$ is often necessary \citep[see, e.g,][]{beaumont2002approximate,fearnhead2012constructing}. This can be performed by considering a low-dimensional set of summary statistics $t(\cdot) = (t_1(\cdot), \ldots,t_q(\cdot))$, for some $q<n$, such as the mean, the median, quantiles etc. If $t(\cdot)$ is sufficient, then the ABC posterior $\pi_\epsilon(\theta|t(y))$ converges to the exact posterior as $\epsilon\to0$ \citep[see][Appendix A]{soubeyrand2013}. However, sufficient statistics are generally available only for models belonging to the exponential families.
The choice of the summary statistic is therefore a crucial point of ABC and this issue has been widely discussed in the statistical literature. In particular, \citet[][Sect. 3.1]{ruli2016approximate} show that, when a full computable likelihood is available, the standardised score function evaluated at the observed MLE $\hat\theta$, is an ideal summary statistic in ABC for a general model. This ideal summary statistic is given by
\begin{equation}
\eta(y;\hat\theta) = B(\hat\theta)^{-1} \ell_\theta(\hat\theta;y)
\ ,
\label{score}
\end{equation}
where $\ell_\theta(\theta;y)=\partial \log L(\theta;y)/\partial \theta$ is the score function and $B(\theta)$ is the square root of the expected information $i(\theta)$, i.e. is such that that $i(\theta)=B(\theta) B(\theta)^{\T}$. When considering the Mahalanobis distance we have
$$
\rho(\eta(y;\hat\theta),\eta(y^*;\hat\theta)) = \ell_\theta(\hat\theta;y^*)^{\T} i(\hat\theta)^{-1} \, \ell_\theta(\hat\theta;y^*)
\ ,
$$
which is the score test statistic computed at $\hat\theta$, based on data $y^*$.
In situations in which the likelihood function is intractable, and a composite likelihood is available, \citet[][Sect. 3.2]{ruli2016approximate} show that the corresponding (suitably standardised) composite score function can be used as a summary statistic in ABC. The resulting ABC procedure is shown to be invariant to reparameterisations and it automatically adjusts the curvature of the composite likelihood and of the corresponding posterior distribution. Lastly, note that in practice the ABC accept-reject algorithm is computationally inefficient and more advanced algorithms, such as ABC coupled with MCMC (ABC-MCMC) \citep{marjoram2003markov}, are preferred.
\section{Robust ABC Bayesian inference}
\label{sec:bayesian}
\subsection{Methodology}
\label{ssec:method}
One possibility to perform robust Bayesian inference is to resort to a pseudo-posterior distribution of the form \eqref{postR}. However, as discussed in Section \ref{ssec:pseudolik}, this approach has several limitations. A further computational limitation is that robust estimating equations $\Psi_\theta$ typically involve consistency corrections which are often intractable functions of $\theta$, defined as suitable expectations under the assumed model. See Section \ref{ssec:atoy} for a simple illustrative example.
Here we propose an alternative method for computing posterior distributions based on robust $M$-estimating functions. The method resorts to the ABC machinery in which a standardised version of $\Psi_\theta$ is used as summary statistic. The idea is an extension of \cite{ruli2016approximate} to the context of general unbiased estimating functions, though from a different perspective.
The rescaled $M$-estimating function is
\begin{equation}
\tilde\eta_R(y^{*}) = \eta_R(y^{*};\tilde\theta) = B_R(\tilde\theta)^{-1} \Psi(y^{*};\tilde\theta)
\ ,
\label{etar}
\end{equation}
where $B_R(\theta)$ is such that $J(\theta)=B_R(\theta) B_R(\theta)^{\T}$ and $\tilde\theta=\tilde\theta(y)$ is based on the observed sample $y$.
To generate posterior samples we propose to use the ABC algorithm with an MCMC kernel (see Algorithm~\ref{alg:abc-mcmc}), similar to Algorithm 2 of \cite{fearnhead2012constructing}; see also \cite{marjoram2003markov}. In Algorithm 2, $K_h(\cdot)$ denotes a density kernel with bandwidth $h$. The latter controls discrepancy between the observed and simulated summary statistics; in particular, the lower is $h$ the lower is the discrepancy.
\vspace{0.2cm}
\IncMargin{1em}
\begin{algorithm}[H]
\SetAlgoLined
\KwResult{A Markov dependent sample $(\theta^{(1)},\ldots,\theta^{(m)})$ from $\pi_{ABC}^R(\theta|\tilde\theta)$}
\KwData{a starting value $\theta^{(0)}$, a proposal density $q(\cdot|\cdot)$}
\For {$i = 1 \to m$}{
draw $\theta^*\,\sim\,q(\cdot|\theta^{(i-1)})$\\
draw $y^*\,\sim\, F_{\theta^*}$\\
draw $u\sim U(0,1)$\\
\eIf{u $\leq\frac{K_h(\tilde\eta_R(y^{*}))}{K_h(\tilde\eta_R(y^{(i-1)}))}\frac{\pi(\theta^{*})q(\theta^{(i-1)}|\theta^{*})}{\pi(\theta^{(i-1})q(\theta^{*}|\theta^{(i-1)})}$}{
set $(\theta^{(i)},\tilde\eta_R^{{(i)}})=(\theta^{*},\tilde{\eta}_R(y^{*}))$
}{
set $(\theta^{(i)},\tilde\eta_R^{(i)})\, =\, (\theta^{(i-1)},\tilde\eta_R(y^{(i-1)}))$
}
}
\caption[]{\label{alg:abc-mcmc} ABC-R algorithm with MCMC.}
\end{algorithm}
\DecMargin{1.em}
\vspace{0.2cm}
The proposed method via Algorithm~\ref{alg:abc-mcmc}
gives Markov-dependent samples from the ABC-R posterior
\begin{eqnarray}
\pi_{ABC}^R(\theta|\tilde\theta) = \frac{\int_{\mathcal{Y}^*} \pi(\theta) \, f(y^*;\theta)K_h(\tilde\eta_R(y^*))\,dy^*}{\int_{\mathcal{Y}^*\times\Theta} \pi(\theta) \, f(y^*;\theta)K_h(\tilde\eta_R(y^*))\,dy^*d\theta}
\ .
\label{postABCR}
\end{eqnarray}
Using similar arguments to \citet[][Appendix A]{soubeyrand2013}, it can be shown that, for $h \to 0$, $\pi_{ABC}^R(\theta|\tilde\theta)$ converges to $\pi(\theta|\tilde{\theta})$ pointwise \citep[see also][]{blum2010approximate}, in the sense that $\pi_{ABC}^R(\theta|\tilde\theta)$ and $\pi(\theta|\tilde{\theta})$
are equivalent for sufficiently small $h$. Since in general (\ref{etar}) is not sufficient, then $\pi(\theta|\tilde\theta)$ may differ from $\pi(\theta|y)$ and information is lost by using (\ref{etar}) instead of $y$. However such a loss of efficiency pays off in terms of robustness in the inference about $\theta$.
Posteriors conditional on partial information have been extensively discussed in the literature (\citealp[see, e.g.,][and reference therein]{doksum1990}). \cite{soubeyrand2015weak} study the properties of the ABC posterior when the summary statistic is the MLE or the pseudo-MLE derived from a simplified parametric model. However, they do not treat the case with the summary statistic given by an estimating function. Indeed, an alternative version of the ABC-R algorithm could be based on $\tilde{\theta}$ used as the summary statistic and a, possibly rescaled, distance among the observed and the simulated statistic as in \cite{soubeyrand2015weak}. Apparently, these two versions of ABC, namely the one based on $\tilde{\theta}$ and that based on (\ref{etar}) seem to be treated in the literature as two separate approaches (see, e.g., \citealp{gleim2013, drovandi2015}). However, both methods use essentially the same statistic $\tilde{\theta}$, but through different distance metrics. In addition, for small tolerances $\epsilon$ and $h$, these two distances converge to zero, and both methods give a posterior distribution conditional on the same statistic $\tilde{\theta}$.
Indeed, let $\tilde{\theta}$ be the summary statistic of the usual ABC posterior and let the tolerance threshold $\epsilon$ be sufficiently small and consider the random draw $\theta^{*}$ and its corresponding simulated summary statistics $\tilde\theta^{*}$ taken with the ABC algorithm. Then, by construction $\tilde\theta^{*}$ will be close to $\tilde{\theta}$.
This implies that also $\tilde\eta_R(y^*) = \eta_R(y^*;\tilde{\theta})$ will be close to $\eta_R(y^*;\tilde{\theta}^*)=0$, and hence $\theta^{*}$ is also a sample from the ABC-R posterior which uses the summary statistic $\tilde\eta_R$.
The use of $\tilde{\theta}$ as summary statistic in ABC requires the solution of $\Psi_\theta=0$ at each iteration, which is clearly computationally cumbersome. Therefore, this alternative approach will not be pursued further. Moreover, the proposed approach, besides sharing the same invariance properties stated by \cite{ruli2016approximate}, i.e. invariance with respect to both monotonic transformation of the data or with respect to reparametrisations, has the advantage of avoiding some computational problems related to the evaluation of $\Psi_\theta$ as shown by the following lemma.
\begin{lemma}
The ABC-R algorithm does not require repeated evaluations of the consistency correction involved $c(\theta)$ in $\Psi_\theta$ as given by \eqref{eq:typicalPsi}.
\end{lemma}
\begin{proof}[Proof.]
Let $\tilde{\theta}$ be the solution of $\Psi_\theta = 0$, with $\Psi_\theta$ of the form \eqref{eq:typicalPsi}. Then, for a given simulated $y^*$ at $\theta^*$, we have
\begin{align*}
\tilde\eta_R(y^*) & = B_R(\tilde{\theta})^{-1}(\Psi(y;\tilde\theta)-\Psi(y^*;\tilde\theta))\\ & = \,\,b(\tilde\theta)^\T\{a(y, \tilde\theta) - a(y^*, \tilde\theta)\}\,.
\end{align*}
This implies that $c(\theta)$, as also $b(\theta)$, is computed only once, at $\tilde{\theta}$.
\end{proof}
\subsection{Theoretical properties}
\label{ssec:theoretical}
Theorem~\ref{th:theo1} below shows that the proposed method gives a robust approximate posterior distribution with the correct curvature, even though $\Psi_\theta$, unlike the full score function, does not satisfy the information identity.
\begin{theorem}\label{th:theo1}
The ABC-R algorithm with rescaled $M$-estimating function $\eta_R(y)$, as $h \to 0$, leads to an approximate posterior distribution with the correct curvature and is also invariant to reparameterisations.
\end{theorem}
\begin{proof}
The proof follows from Theorem 3.2 of Ruli {\em et al.} (2016), by substituting the composite estimating equation with the more general $M$-estimating function $\Psi_\theta$.
\end{proof}
The ABC-R algorithm delivers thus a robust approximate posterior distribution which does not need calibration. This is not the case with (\ref{postR}) for which a calibration is typically required.
The following Theorem~\ref{th:theo2} shows that the proposed ABC approximate posterior distribution is asymptotically normal. In the theorem, the regularity assumptions of \cite{soubeyrand2015weak} are assumed, as well as the Euclidean distance in the ABC-R algorithm. Under these assumptions the density of $\tilde\theta$ is, for large $n$, equivalent to the normal density with mean vector equal to $\theta$ and covariance matrix equal to $K(\theta)$, and the density of $\Psi_\theta$ is, for large $n$, equivalent to the normal density with zero mean vector and covariance matrix equal to $J(\theta)$.
\begin{theorem}\label{th:theo2}
Consider the ABC-R algorithm that samples from the posterior $\pi_{R}^{ABC}(\theta|\tilde{\theta})$. Assume that when $h\to 0$, $\pi_{R}^{ABC}(\theta|\tilde\theta)$ converges pointwise to $\pi_R(\theta|\tilde\theta)$. Moreover, when $n \to \infty$ and $h \to 0$, the posterior $\pi_{R}^{ABC}(\theta|\tilde{\theta})$ is asymptotically equivalent to the density of the normal distribution with mean vector $\tilde\theta$ and covariance matrix $K(\tilde\theta)$:
\begin{eqnarray}
\pi_{R}^{ABC}(\theta|\tilde\theta) \, \dot{\sim} \, N_d (\tilde\theta,K(\tilde\theta))
\ , \quad \mathrm{for} \, \, h \to 0
\ .
\end{eqnarray}
\end{theorem}
\begin{proof}[Proof.]
The proof follows from Lemma 2 and Theorem 1 in \cite{soubeyrand2015weak} and from the asymptotic relation between the Wald-type statistic and the score-type statistic, i.e.
$$
\tilde\eta_R(y)^{\T} \, \tilde\eta_R(y) = \Psi_\theta^{\T} J(\theta)^{-1} \Psi_\theta =
(\tilde\theta - \theta)^{\T} K(\theta)^{-1} (\tilde\theta - \theta) + o_p(1)
\ .
$$
\end{proof}
In view of Theorem~\ref{th:theo2}, the resulting point estimates and credible sets converge to their frequentist analogues.
If $\psi(y;\theta)$ is bounded in $y$, i.e.\ if the estimator $\tilde\theta$ is B-robust, then the ABC-R posterior is resistant with respect to slight violations of the model assumptions. The advantage of the ABC-R posterior with respect to a robust posterior distribution of the form (\ref{postR}) is that the former allows to easily deal with multidimensional parameters, and thus avoids the difficulties of the quasi-likelihood. Moreover, it is computable also for very small sample sizes, provided $\tilde\theta$ is finite, and thus avoids the numerical instabilities of the empirical likelihood.
\begin{theorem}
If $\psi(y;\theta)$ is bounded in $y$, i.e.\ if the estimator $\tilde\theta$ is B-robust, then asymptotically the posterior mode, as well as posterior moments, of $\pi_{R}^{ABC}(\theta|\tilde{\theta})$ have bounded IF.
\end{theorem}
\begin{proof}[Proof.]
From Theorem~\ref{th:theo2}, the asymptotic posterior mode of $\pi_{R}^{ABC}(\theta|\tilde\theta)$ is $\tilde\theta$, which is $B$-robust. Moreover, following results in \cite{greco2008robust}, it can be shown that asymptotic posterior moments have bounded $IF$ if and only if the posterior mode has bounded $IF$.
\end{proof}
Notice that the ABC method can be seen as inherently robust since the resulting posterior conditions on a user-specified subset of the data instead of on the full data, as in the classical Bayesian setting. Nevertheless, through the ABC-R method we are able to obtain a B-robust posterior, that is a posterior having summaries with a bounded influence function.
\subsection{Implementation details}
\label{ssec:implementation}
Provided simulation from $F_\theta$ is fast, the main demanding requirement of the proposed method is essentially the computation of the observed $\tilde{\theta}$ and the scaling matrix $B_R(\theta)$ evaluated at $\tilde{\theta}$.
The ABC-R Algorithm~\ref{alg:abc-mcmc} involves a kernel density $K_h(\cdot)$, which is governed by the bandwidth $h$ and a proposal density $q(\cdot\vert\cdot)$. Given that, for large sample sizes,
$$
\tilde{\eta}_R (y) \sim N_d(0_d, I_d)\,,
$$
where $0_d$ is a $d$-vector of zeros and $I_d$ is the identity matrix of order $d$, it is reasonable to replace $K_h(\cdot)$ with the multivariate normal density centred at zero and with covariance matrix $hI_d$. To choose the bandwidth $h$ we consider several pilot runs of the ABC-R algorithm for a grid of $h$ values, and select the value of $h$ that delivers approximately 1\% acceptance ratio \citep[as done, for instance, by][]{fearnhead2012constructing}.
Contrary to other ABC-MCMC settings in which the proposal requires pilot runs \citep[see,][for building proposal distributions in ABC]{cabras2015}, in our case a scaling matrix for the proposal $q(\cdot|\cdot)$ can be readily build, almost effortlessly, by using the usual sandwich formula \eqref{var} \citep[see also][]{ruli2016approximate} evaluated at $\tilde\theta$. Even in cases in which $H(\theta)$ and $J(\theta)$ are not analytically available, they can be straightforwardly estimated via simulation. Indeed, in our experience, 100-500 samples from the model $F_\theta$, with $\theta =\tilde\theta$, give estimates with reasonably low Monte Carlo variability \citep[see also][]{cattelan2015empirical}. Throughout the examples considered we use the multivariate $t$-density with 5 degrees of freedom as the proposal density $q(\cdot|\cdot)$ and the ABC-R is always started from $\tilde{\theta}$. An \texttt{R} implementation of the proposed method for linear mixed effects models is also provided through the \texttt{robustBLME} package available on \texttt{CRAN}.
As a final remark, we note that robust estimating functions are available for many models of practical interest; see, among others, \cite{rousseeuw2003robust}, \cite{heritier2011}, \cite{huber2009robust}, \cite{farcomeni2012overview} and \cite{farcomeni2015robust} and references therein. Therefore, it is straightforward to exted the application of the proposed method in such model settings.
\subsection{An illustrative example}
\label{ssec:atoy}
We consider an example in which we compare the numerical properties of the ABC-R posterior, with the classical posterior based on the assumed model and the pseudo-posterior \eqref{postR} based on the empirical likelihood. Scenarios with data simulated either from the assumed model or from a slightly misspecified model are considered.
Let $F_\theta$ be a location-scale distribution with location $\mu$ and scale $\sigma>0$, and let $\theta = (\mu, \sigma)$. $M$-estimation through Huber's estimating function is a standard choice for the robust estimation of location and scale parameters. The $M$-estimating function is
\[
\Psi_\theta = (\Psi_{\mu}, \Psi_{\sigma})
\,,\]
with
\begin{eqnarray}
\Psi_\mu = \sum_{i=1}^n \psi_{c_1}(z_i)\,\quad\text{and}\quad
\Psi_\sigma = \sum_{i=1}^{n}\left(\psi_{c_2}(z_i)^2 - k(c_2)\right)
\ ,
\label{huber}
\end{eqnarray}
where $z_i = (y_i-\mu)/\sigma$, $i=1,\ldots,n$, $\psi_{c_1}(z) = \min(1;c_1/|z|)$ is the Huber $\psi$-function, $c_1>0$ and $c_2>0$ are scalar parameters which control the desired degree of robustness of $\tilde{\theta}$, and $k(\cdot)$ is a known function.
As an example let $F_\theta$ be the normal distribution $N(\mu, \sigma^2)$ and assume $\mu$ and $\sigma$ a priori independent with $\mu\sim N(0,10^2)$ and $\sigma\sim \text{halfCauchy}(5)$, where $\text{halfCauchy}(a)$ is the half Cauchy distribution with scale parameter equal to $a$. We consider random samples of sizes $n=\{15, 30\}$ drawn from either the normal distribution with $\theta=(0,1)$ and from a contaminated model. The latter is given by $F_\epsilon = (1-\epsilon)N(0,1) + \epsilon N(0, \sigma_1^2)$, with $\sigma_1^2>0$. For illustration purposes, we set the contamination to 10\%, i.e. $\epsilon=0.1$, and we set $\sigma_1^2=10$. Moreover, we assume $c_1=1.345$ and $c_2=2.07$, which imply that $\tilde{\mu}$ and $\tilde{\sigma}$ are, respectively, 5\% and 10\% less efficient than the corresponding MLE under the central (normal) model. In the simulation study we compute the genuine posterior distribution, e.g. the posterior based on the likelihood function of the normal model, the pseudo-posterior (\ref{postR}) based on the empirical likelihood (EL) and the ABC-R posterior.
The genuine and the EL posteriors are computed by numerical integration. The ABC-R posterior is obtained using Algorithm~\ref{alg:abc-mcmc} (Section~\ref{ssec:implementation}). From the posterior distributions illustrated in Figure~\ref{fig:fig1} we note that, when the data come from the central model (panels (a)-(b)), i.e. for $\epsilon=0$, all the posteriors are in reasonable agreement, even if the EL posterior behaves slightly worse, especially the marginal posterior of $\sigma$ with $n=15$. When the data are contaminated (panels (c)-(d)), the genuine posterior is less trustworthy as the bulk of the posterior drifts away from the true parameter value (vertical and horizontal straight lines). This is not the case however for the ABC-R posterior which remains centered around the true parameter value. The behavior of the EL posterior is less clear-cut here. In particular, it seems to have bimodal shape with the dominant mode laying around the true value and the secondary mode being located distantly. Consequently, the EL posterior has higher spread than the ABC-R posterior.
\begin{figure}[ht!]
\includegraphics[scale=0.65, angle=-90]{figures/full15}
\includegraphics[scale=0.65, angle=-90]{figures/full30}\\
\includegraphics[scale=0.65, angle=-90]{figures/cont15}
\includegraphics[scale=0.65, angle=-90]{figures/cont30}\\
\vspace{-0.2cm}
\caption{First row: genuine (continued), EL (blue dashed) and ABC-R posteriors (shaded image and histogram) for the normal model, when the data come from the central model $N(0,1)$ with (a) $n=15$ and (b) $n=30$. Second row: genuine, EL and ABC-R posteriors for the normal model, when the data come from the contaminated model with $\epsilon=0.1$, (c) $n=15$ and (d) and $n=30$.
\label{fig:fig1}
\vspace{-0.5cm}
\end{figure}
\vspace{1.2cm}
\noindent{\bf Sensitivity analysis}\\
To assess the robustness of the ABC-R posterior, we consider a sensitivity analysis. We simulate a sample $y$ of size $n=31$ from the central model and the contaminated data are given by $y^c = (y_{(j)},y_{(n/2)}+c)$, $j=1,\ldots,n/2-1,n/2+1,\ldots,n$, where $y_{(j)}$ denotes the $j$th ordered value of $y$ and $c$ a contamination scalar with possible values $\{-15,-14,\ldots,15\}.$ The results of the sensitivity analysis, illustrated by means of violin plots in Figure~\ref{fig:fig2}, highlight that the posterior median (the symbol "$\circ$") of the genuine posterior (panel (c)) is substantially driven by $c$. The $y$-axis is left free in order to enhance the of readability of the plot. On the other hand, the ABC-R and the EL posteriors are more resistant. For all the posteriors, the behavior of the posterior median reflects the behavior of the influence function of the posterior mode. Finally, the EL posterior under contamination is much more dispersed than the ABC-R posterior. Hence, even in an example as simple as this, robust inference based on the ABC-R posterior appears to be more precise than inference based on the EL posterior.
\begin{figure}[ht!]
\includegraphics[scale=0.8, angle=-90]{figures/sanalysisLS}
\vspace{-0.2cm}
\caption{Marginal ABC-R (a), EL (b) and genuine (c) posteriors for $\mu$ (left columns) and $\sigma$ (right) represented by means of violin plots for each $y^c$ generated under each value of $c=\{-15,-14,\ldots,15\}$. For each violin plot, the central circle represents the posterior median. The horizontal lines are the corresponding posterior median under $y^c$ with $c=0$.
\label{fig:fig2}
\vspace{-0.5cm}
\end{figure}
\clearpage
\section{Application to LMM}
\label{sec:application}
\subsection{Classical and Robust Estimation of LMM}
\label{ssec:classical}
The linear mixed model is a popular framework for analysing datasets in the context of hierarchical, longitudinal or repeated measures. A general formulation of LMM is by the following regression equation
\begin{equation}
y = X\alpha + \sum_{i= 1}^{c-1} Z_i\beta_i + \varepsilon\,,
\label{eq:model}
\end{equation}
where $y$ is a $n$-vector of the response observations; $X$ and $Z_i$ are known $n\times q$ and $n\times p_i$ design matrices respectively; $\alpha$ is a $q$-vector of unknown fixed effects; the $\beta_i$ are $p_i$-vectors of unobserved random effects $(1\leq i \leq c-1)$; and $\varepsilon$ is an $n$-vector of unobserved errors. The $p_i$ levels of each random effect $\beta_i$ are assumed to be independent with mean zero and variance $\sigma_i^2$. Moreover, each random error $\varepsilon_i$ is assumed to be independent with mean zero and variance $\sigma_c^2$ and $\beta_1,\ldots,\beta_{c-1}$ and $\varepsilon$ are assumed to be independent.
In this paper we focus on the classical normal LMM, which assumes that $\varepsilon \sim N_n(0_n,\sigma_c^2I_n)$ and $\beta_i \sim N(0, \sigma_i^2)$, $i=1, \dots, c-1$. Obviously, the validity and performance of this LMM
requires strict adherence to the model assumption, which is usually chosen
because it simplifies the analyses and not because it fits exactly the
data at hand. The robust procedure discussed in this paper specifically
takes into account the fact that the normal model is only approximate and
then it produces statistical analyses that are stable with respect to
outliers, deviations from the model or model misspecifications.
Under \eqref{eq:model} and the aforementioned assumptions, it follows that $Y$ is multivariate normal with $$E(Y) = X\alpha\quad \text{and} \quad \text{var}(Y) = V = \sum_{i = 1}^{c-1}\sigma_{i}^2Z_iZ_i^\T\,,$$ where $Z_{c} = I_n$. We assume that the set of $d = q + c$ unknown parameters $\theta = (\alpha, \sigma^2) = (\alpha, \sigma_{1}^2,\ldots,\sigma_{c}^2)$ is identifiable.
Although the $n$ observations $y$ are not independent, if the random effects are nested, then independent subgroups of observations can be found. Indeed, in many situations, $y$ can be split into $g$ independent groups of observations $y_j$, $j = 1, \ldots,g$. In this case the log-likelihood function is
\begin{equation}
\ell(\theta) = (-1/2)\sum_{j = 1}^g \left\{\log\vert V_j\vert + (y_j-X_j\alpha)^\T V_j^{-1}(y_j - X_j\alpha)\right\}\,,\label{eq:lmmlik}
\end{equation}
where $(y_1,\ldots,y_g)$, $X$ and $V$ are partitioned conformably.
Classical Bayesian inference for $\theta$ is based on the posterior distribution $\pi(\theta|y)\propto \exp\{\ell(\theta)\} \, \pi(\theta)$, where $\pi(\theta)$ is a prior distribution for $\theta$. However, $\ell(\theta)$ in the Gaussian LMM \eqref{eq:lmmlik} can be very sensitive to model deviations. This is because in the LMM framework a strict adherence to the multivariate normal model is required, and even a mild deviation from this model can have a great impact on the inferential results (\citealp{richardson1995robust}, \citealp{richardson1997bounded}, \citealp{copt2006high}); see also results of the simulation study in Section~\ref{ssec:simulation}.
There is a rich variety of robust inferential procedures for LMM in the presence of model misspecification: $M$-estimators \citep[see, e.g.,][and references therein]{richardson1995robust,richardson1997bounded, welsh1997approaches}, $S$-estimators \citep{copt2006high}, $MM$-estimators \citep{copt2006robust} and multivariate $t$ distributions \citep[see, e.g.,][]{lange1989robust}. The $M$-, $S$- and $MM$-estimation in the LMM framework provide robust estimators derived from estimating equations which are unbiased under the central model. In particular, $S$- and $MM$-estimators provide robust estimators with high breakdown point, but they are generally available only for balanced designs. Robustness and efficiency in $M$-, $S$- and $MM$-type estimators is guided by tuning constants which in practice are fixed by choosing the desired amount of robustness or, equivalently, by setting the desired loss of efficiency with respect to the MLE \citep[see also][]{basu1998robust}. The multivariate $t$ framework deals with robustness by replacing the normal model with the multivariate $t$, but at the cost of introducing the degrees of freedom as an additional unknown parameter.
Here we focus on robust inference in LMM through the $M$-estimation approach as pioneered by \cite{richardson1995robust}, \cite{richardson1997bounded} and \cite{welsh1997approaches} and extend it to the Bayesian framework through the ABC-R method. The aforementioned M-estimation approach is very general as it can deal with a wide variety of situations; for instance it can deal with unbalanced designs and robustness with respect to the design matrix \citep[see][for further details]{richardson1997bounded}.
Motivated by the \texttt{GRP94} dataset of Section~\ref{sec:amotiv}, in the present work we focus on robustness with respect to the response variable. Following \cite{welsh1997approaches} \citep[and][]{richardson1997bounded}, we focus on bounded of M-estimating functions of the form
\begin{dgroup}
\begin{dmath}
X^\T V^{-1/2}\psi_{c_1}\left(V^{-1/2}(y-X\alpha)\right)=0\,,
\label{eq:richalpha}\\
\end{dmath}
\begin{dmath}
(1/2)\left\{
\psi_{c_2}\left(V^{-1/2}(y-X\alpha)\right)^\T V^{-1/2} Z_iZ_i^\T V^{-1/2} \\
\times \psi_{c_2}\left(V^{-1/2}(y-X\alpha)\right)
- \text{tr}(CPZ_iZ_i^\T)\right\}=0 \condition{for $i = 1,\ldots,c$}
\label{eq:richsigma}
\end{dmath}
\end{dgroup}
where $C = E(\psi_{c_2}(R)\psi_{c_2}(R)^\T)$, with $R = V^{-1/2}(Y-X\alpha)$, $P = V^{-1} - V^{-1}X(X^\T V^{-1}X)^{-1}X^\T V^{-1}$ and $\text{tr}(\cdot)$ is the trace operator. The function $\text{tr}(CPZ_iZ_i)$ is a correction factor needed to ensure consistency at the Gaussian model for each $i=1,\ldots,c$.
\cite{welsh1997approaches} call \eqref{eq:richalpha}-\eqref{eq:richsigma} robust REML II estimating equations as they are bounded versions of restricted likelihood equations \citep{patterson1971recovery}. \cite{richardson1997bounded} shows that the estimator of $\theta$ given by the solution of \eqref{eq:richalpha}-\eqref{eq:richsigma} is asymptotically normal with mean the true parameter $\theta$ and variance matrix of the form \eqref{var}.
\subsection{Simulation study}
\label{ssec:simulation}
Let us consider the following two-component nested model
\begin{equation}
y_{ij} = \mu + \alpha_j + \beta_i + \varepsilon_{ij}\,,\label{eq:modsim}
\end{equation}
where $\mu$ is the grand mean; $\alpha_j$ are the fixed effects, constrained such that $\sum_{j=1}^q \alpha_j=0$; $\beta_i\sim N(0,\sigma_1^2)$ are the random effects and $\varepsilon_{ij}\sim N(0,\sigma_2^2)$ is the residual term, for $j = 1,\ldots,q$ and $i = 1,\ldots,g$. This model is a particular case of \eqref{eq:model}, with $c = 2$, a single random effect $\beta = \beta_1$ with $p_1 = g$ levels and $Z_1$ being the unit diagonal matrix. Furthermore, the covariate is a categorical variable with $q$ levels hence the design matrix is given by $q-1$ dummy variables.
We asses bias and efficiency of the proposed method via simulations with 500 Monte Carlo replications. For each Monte Carlo replication, the true values for the variance components $(\sigma_1^2,\sigma^2_2)$ and those of $\alpha$ are drawn uniformly in $(1,10)\times(1,10)$ and $(-5,5)$, respectively. With these parameter values, two datasets each of size $g$ are generated: one from the central model and one from the contaminated model $F_\epsilon = (1-\epsilon)N(X_i^\T\alpha,V_i) + \epsilon N(X_i^\T\alpha, 15V_i)$, with $\epsilon = 0.10$. We consider $q = \{3, 5, 7\}$ and $g = \{30, 50, 70\}$. Prior distributions are $\alpha\sim N_q(0,10^2I_q)$ and $(\sigma_1^2,\sigma^2_2) \sim \text{halfCauchy}(7)\times\text{halfCauchy}(7)$. For each scenario, we fit model \eqref{eq:modsim} in the classical Bayesian way, using an adaptive random walk Metropolis-Hastings algorithm. The same model is fitted by the ABC-R method using the estimating equations \eqref{eq:richalpha}-\eqref{eq:richsigma}. As in \cite{richardson1995robust}, we set $c_1 = 1.345$ and $c_2 = 2.07$. To find $\tilde{\theta}$, we solve \eqref{eq:richalpha}-\eqref{eq:richsigma} iteratively until convergence, as suggested by \cite{richardson1995robust}. The classical REML estimate, computed by the \texttt{lmer} function of the \texttt{lme4} package \citep{bates2015fitting}, is used as starting value. In our experiments, the convergence of the solution is quite rapid, i.e. $\tilde{\theta}$ stabilises within 10 to 15 iterations.
We assess the component-wise bias of the posterior median $\tilde\theta_m$ by the modulus of $\tilde{\theta}_m-\theta_0$ in logarithmic scale, where $\theta_0$ is the true value. Moreover, the efficiency of the classical Bayesian estimator relative to the ABC-R estimator is assessed through the index $MD_{MCMC}/MD_{ABC}$, where $MD = \text{med}(\tilde{\theta}_m-\theta_0)$. A similar index is used also by \cite{richardson1995robust} \citep[see also][]{copt2006high}. In addition, for each Monte Carlo replication we compute the Euclidean distance of $\tilde\theta_m$ from $\theta_0$, which can be considered as a global measure of bias. Contrary to \cite{richardson1995robust}, we consider a different $\theta_0$ for each Monte Carlo replication. For this reason, instead of just summarising the distribution of bias and efficiency by simple statistics we find it more informative to depict them graphically. The bias and efficiency of the classical Bayesian posterior and of the ABC-R posterior for the 500 replications are illustrated in Figures~\ref{fig:fig3} and \ref{fig:fig4}, respectively.
\begin{figure}[t!]
\centering
\includegraphics[width=1.\textwidth, height = 1.1\textwidth]{figures/bias.eps}
\caption{Bias of the ABC-R and classical (\texttt{MCMC}) Bayesian estimation of LMM under either the central (\texttt{Full}) or the contaminated model (\texttt{Mix}) for varying $n$ and $q$. Rows refer to a parameter or combination of parameters (row \texttt{all\_par}); columns within each cell refer to different vales of $q$; e.g. the last two rows (starting from top) have only two boxplots since $\alpha_6$ and $\alpha_7$ are available only with $q = 7$.}
\label{fig:fig3}
\end{figure}
\begin{figure}[ht!]
\centering
\includegraphics[width=1.\textwidth, height = 1.1\textwidth]{figures/efficiency.eps}
\caption{Efficiency of the ABC-R compared to the classical Bayesian estimation of LMM under the central (\texttt{Full}) and the contaminated models (\texttt{Mix}) for varying $n$ and $q$. Rows refer to a parameter and columns within each cell refer to different vales of $q$; e.g. the last two rows (starting from top) have only two boxplots since $\alpha_6$ and $\alpha_7$ are available only with $q = 7$.}
\label{fig:fig4}
\end{figure}
Under the central model, inference with the ABC-R and the classical Bayesian posteriors is roughly similar, i.e.\ both bias (component-wise and global) and efficiency compare equally well across the two methods. This holds for both the fixed effects $\alpha$ and for the variance components $(\sigma_1^2,\sigma^2_2)$. The latters present more bias than the formers. Under the contaminated model, we notice important differences among ABC-R and the classical Bayesian estimation. In particular, $\tilde{\theta}_m$ based on ABC-R is less biased, both globally and on a component by component basis, and more efficient. The gain in efficiency is particularly evident for the variance components.
\subsection{Effects of GRP94-based complexes on IgG and cytokines}
\label{sec:antitumour}
We fit the two-component nested LMM \eqref{eq:modsim} with ABC-R using estimating equations \eqref{eq:richalpha}-\eqref{eq:richsigma} to each of the five response variables: IgG, IFN$\gamma$, IL-6, IL-10 and TNF$\alpha$. Since all measures are positive and some of them are highly skewed, a logarithmic transformation is used in order to alleviate distributional skewness. Furthermore, since \cite{tramentozzi2016} highlight a possible gender effect (especially with respect to the cytokines) we check for gender effects by including an interaction with gender. In the multivariate form, the model with interaction can be written as
\begin{equation}
y_{i} = X_{i}^\T\alpha + X_i^\T\times\text{w}_i\gamma +\beta_i{1}_6 + \varepsilon_{i}\,,\quad i = 1,\ldots, g\label{eq:modinteract}
\end{equation}
where $X_i$ is the matrix of covariates for the $i$th unit, w$_i$ is a dummy variable for gender, $\gamma$ is the fixed effect of the treatment-gender interaction, ${1_6}$ is the unit vector of dimension 6. The number of statistical units $g$ is equal to 27 for the response IgG and 24 for the other response variables. Notice that the interaction model \eqref{eq:modinteract} has $12$ unknown fixed effects $(\alpha,\gamma)$.
As there is no extra-experimental information, we use relatively diffused priors. In particular, we assume $\alpha_j\sim N(0,100)$ and $\gamma_j\sim N(0,100)$, for $j = 1,\ldots,6$. For the variance components, following the recommendation of \cite{gelman2006prior}, we assume $\sigma_{1}^2\sim \text{halfCauchy}(7)$ and $\sigma_{2}^2\sim \text{halfCauchy}(7)$ in both models.
ABC-R posterior samples are drawn using Algorithm~\ref{alg:abc-mcmc} and following the implementation details of Section~\ref{ssec:implementation}. For comparison purposes, we fit also a classical Bayesian LMM with the aforementioned prior; an adaptive random walk Metropolis-Hastings algorithm is used for sampling from this posterior. Figure~\ref{fig:lmmfit} compares the ABC-R and the classical posterior for a subset of the fixed effects of models \eqref{eq:modsim} and \eqref{eq:modinteract} by means of kernel density estimations. The parameters shown are those referring to the treatments based on GRP94 at the dose of 10 ng/ml (\texttt{GRP94\_10}), GRP94 at the dose of 100 ng/ml (\texttt{GRP94\_100}) and GRP94 in complex with IgG at the dose of 100 ng/ml (\texttt{GRP94+IgG\_100}), which according to \cite{tramentozzi2016} are the most prominent. In Figure~\ref{fig:lmmfit}, panels (a1) to (e1) report the marginal posteriors of the fixed effects of \eqref{eq:modsim} (with \texttt{baseline} being the reference category), fitted to the five response variables, respectively; panels (a2) to (e2) give those of \eqref{eq:modinteract} (with \texttt{baseline} and \texttt{female} being the reference categories). Numbers within parenthesis in the plot sub titles give the evidence in favour of the null hypothesis H$_0$ that the parameter is equal to zero, computed under the Full Bayesian Significance Testing (FBST) setting of \cite{pereira2008can}; inside the parenthesis, the first (last) value from left refers to the ABC-R (classical) posterior.
The FBST in favour of $H_0$ has been
proposed by \citep{pereira1999evidence} as an intuitive measure of
evidence, defined as the posterior probability related to the less
probable points of the parametric space. It favours the null hypothesis
whenever it is large and it is based on a specific loss function and thus the
decision made under this procedure is the action that minimises the
corresponding posterior risk \citep[see][and references therein]{pereira2008can}. The FBST solves the drawback of the usual
Bayesian procedure for testing based on the Bayes factor (BF), that is, when the null hypothesis is precise and improper or vague priors are assumed, the BF can be undetermined and it can lead to the so-called Jeffreys-Lindleys paradox.
In panel (a1), the first plot from left reports the marginal distributions of the expected difference in terms of IgG between treatment \texttt{GRP94_10} and baseline. It shows that such a treatment is quite different from baseline measurements, because under the classical Bayesian LMM the evidence is zero to three decimal places, wheres under the ABC-R posterior the evidence is as low as 0.002. In what follows, evidences greater than 0.15 are treated as not worth mentioning and are therefore omitted. From the plots we can conclude the following.
\begin{figure}[ht!]
\includegraphics[width =1\columnwidth, height = 1\columnwidth]{figures/part1.eps}
\end{figure}
\begin{figure}[ht!]
\includegraphics[width =1\columnwidth,height=0.7\columnwidth]{figures/part2.eps}
\vspace{0.3cm}
\caption{Comparison of robust (ABC) and full (MCMC) posterior distributions of the fixed effects of the LMM \eqref{eq:modsim}-\eqref{eq:modinteract}, fitted to: $\log$ IgG (panels (a1)-(a2)), $\log$(INF$\gamma$+1) ((b1)-(b2)), $\log$ IL-6 ((c1)-(c2)), $\log$ IL-10 ((d1)-(d2)) and $\log$ TNF$\alpha$ ((e1)-(e2)). At each row, the left block refers to the posterior of the marginal effects of the treatments against the baseline and the right block refers to the interactions of the treatments with gender (with \texttt{baseline} and \texttt{female} being the reference categories). Numbers within refer to the evidence in favour of the null hypothesis H$_0$ that the parameter is equal to zero, computed under the Full Bayesian Significance Testing (FBST) setting of \cite{pereira2008can}; inside the parenthesis, the first (last) value from left refers to the ABC-R (classical) posterior. Dashed vertical lines corresponds to $\tilde{\theta}$.}
\label{fig:lmmfit}
\end{figure}
\clearpage
\noindent{\bf IgG.} There is a high posterior probability that the marginal treatments are different from the baseline, since the evidence of H$_0$ is rather low. However, the interaction with gender seem not to be supported. Although the density plots reveal some qualitative differences between the classical and the proposed robust Bayesian LMM, the evidences in favour of H$_0$ according to these posteriors, are rather low and in reasonable agreement, hence the message they convey is the same.\\
\noindent{\bf IFN$\gamma$.} No marginal nor interaction effects seem to be supported by the data for this variable according to both the classical and the proposed robust method.\\
\noindent{\bf IL-6.} The classical Bayesian LMM suggests that there is a marginal effect of \texttt{GRP94\_10} and of \texttt{GRP94\_100} as in both cases the evidence is low, i.e. less than 0.05. Furthermore, there is also evidence of an interaction effect of the latter with gender. However, on the basis of the ABC-R posterior, only \texttt{GRP94\_100} shows a marginal effect with respect to the baseline and no interaction effects are worth mentioning. These apparently contradictory results can be explained by the presence of few patients with extreme observations (see Figure~\ref{fig:eda01}) which seem to drive the classical LMM posterior but not the ABC-R posterior.\\
\noindent{\bf IL-10 and TNF$\alpha$.} For both these variables we notice both marginal and interaction effects of \texttt{GRP94\_100} under the classical Bayesian LMM. However, such effects disappear under the robust ABC-R procedure, which again signals that the classical LMM posterior is driven by few extreme observations (see Sect.~\ref{sec:amotiv}).
\section{Final remarks} %
\label{sec:final}
Former approaches on the use of robust unbiased estimating functions in Bayesian inference have been focused mainly on the quasi- and the empirical likelihoods as replacement of the full likelihood in Bayes' formula \citep[see, e.g.,][]{greco2008robust}. However, quasi-likelihood is available only for scalar parameters of interest while empirical likelihood can be unstable for small sample sizes.
In this respect, the present work offers a contribution by providing an alternative approach for building posterior distributions from robust estimating functions using simulated data from the central model and comparing them with the one actually observed, in an ABC fashion. Such a comparison is done through the chosen robust estimating function and this permits us to condition upon a robust subset of the data.
The method shares some limitations of the ABC setting. Firstly, a tolerance threshold has to be chosen. We fix this tolerance in order to give a pre-specified but small acceptance ratio, as frequently done in the ABC literature. Secondly, Bayesian hypothesis testing via BFs or posterior model probabilities is generally infeasible since the ABC model selection algorithm \citep{robert2011lack} requires ad hoc summary statistics \citep{marin2014relevant}, which are generally very difficult to find. The full Bayesian significance testing setting \citep{pereira2008can} is another practical and theoretically sound approach to Bayesian testing. Furthermore, it is easy to implement since for testing scalar parameters it requires only marginal posterior densities, which can be readily build by, say, kernel density estimation.
Motivated by the \texttt{GRP94} dataset, we considered only two-component nested LMM, but more complex models can be fitted since the estimating equations \eqref{eq:richalpha}-\eqref{eq:richsigma} are very general \citep[see][]{richardson1997bounded}. For instance, it is possible to deal with models with many random effects or even with robustness with respect to the design matrix. Moreover, the proposed ABC-R method works with any unbiased estimating equations, hence $S$- and $MM$-estimating functions can be readily used.
\section*{Acknowledgement}
This work was partially supported by University of Padova (Progetti di Ricerca di Ateneo 2015, \texttt{CPDA153257}) and by PRIN 2015 (grant \texttt{2015EASZFS\_003}).
| {'timestamp': '2017-06-07T02:06:37', 'yymm': '1706', 'arxiv_id': '1706.01752', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01752'} | arxiv |
\section{Introduction}\label{sec:intro}\input{tcns-text/intro}
\section{Problem Formulation}\label{sec:pf}\input{tcns-text/pf}
\section{Localization of a Single Target}\label{sec:st}\input{tcns-text/single}
\section{Localization of Multiple Targets}\label{sec:mt}\input{tcns-text/multi}
\section{Optimal Planning and Resource Allocation for Multiple Robots}\label{sec:many}\input{tcns-text/many}
\section{Numerical Simulations}\label{sec:sim}\input{tcns-text/sims}
\section{Experiments}
\label{sec:exp}
\input{tcns-text/exp}
\section{Conclusion}\label{sec:conc}\input{tcns-text/con}
\bibliographystyle{ieeetr}
\subsection{Noise Modeling}
In this paper, we assume that individual measurements are subject to a known zero mean Normal noise distribution $\bbnu \sim \normal{\bb0, \bbQ}$.
In what follows, we estimate $\bbQ$ so that this assumption holds for the stereo rigs used in our laboratory experiments.
This is critical for a variety of reasons:
\begin{itemize}
\item If the mean of $\bbnu$ is biased, then the KF will not converge to the ground truth.
\item If $\bbQ$ is an under approximation to the actual covariance of $\bbnu$, then the KF will become inconsistent and will not converge to the ground truth, if it converges at all.
\item If our choice of $\bbQ$ is too conservative, it may not be informative enough to be useful in the decision process at the core of the controller.
\end{itemize}
Making things even more difficult, we want to test the system in relatively extreme conditions, particularly at long ranges, when triangulation error distributions are known to be heavy tailed, biased away from zero, and highly asymmetric \cite{freundlich15cvpr}.
In our experiments we make use of the physics of stereo vision \cite{ma2012invitation}.
In particular, following \cite{matthies87} we assume that pixel error are Gaussian, and we propagate them to the localization estimates via triangulation equations, which we can use to give us an accurate distribution for $\bbnu$.
Specifically, if the robot registers a correspondence in the left (L) and right (R) cameras at pixel coordinates $[x_L, x_R, y]^\top$, then the coordinates of the 3-D point that generated the match are
\begin{equation}\label{eq:triangulate}
\mat{X\\Y\\Z}
= \frac{b}{d} \mat{\frac{1}{2}(x_L+x_R) \\ y \\ f},
\end{equation}
where $f$ is the focal distance, $b$ is the stereo baseline, $d = x_L - x_R$ is the disparity.
Let $\bbJ$ denote the Jacobian of \eqref{eq:triangulate}.
If the error in $[x_L, x_R, y]^\top$ has covariance matrix $\bbP,$ then the error covariance of $[X,Y,Z]^\top$ is $\bbJ \bbP \bbJ^\top.$
Moreover, if $\bbt$ and $\bbT$ are the translation vector and rotation matrix from the coordinate frame of the camera to a fixed coordinate frame, then the covariance of $\bbnu$ is $\bbT \bbJ \bbP \bbJ^\top \bbT^\top.$
With this noise propagation formula in mind, we now study errors in the observed pixels.
For this we follow a data-driven approach that we have recently developed in \cite{freundlich16nbv}.
Using a set of $n=600$ pairs of training images for each robot at various ranges and viewing angles, we obtain a regression that maps pixel observations $[x_L, x_R, y]^\top$ to a corrected tuple of pixels $[x_L^c, x_R^c, y^c]^\top$ such that the error in the corrected tuple is zero mean.
For every image pair, we project the ground truth landmark onto the image planes using the inverse mapping of \eqref{eq:triangulate}, giving us $\ell = 1, \dots, n$ individual output vectors $\bbY_\ell$, which we stack into an $n \times 3$ matrix of outputs $\bbY$.
The ground truth data for this training set includes a marker placed on top of the ping pong ball, and the pose information of the stereo rig, captured by a $\bbt $ and $\bbT .$
We then compute five features and, because the data are not centered, include one constant, for each raw pixel tuple according to the model
\begin{equation}\label{eq:model}
\bbX_\ell = \left[
1,\, y_\ell,\, d_\ell,\, x_{{L, \ell}}+ x_{{R, \ell}},\, y d_\ell, \frac{ x_{{L, \ell}}+ x_{{R, \ell}}}{d_\ell}
\right].
\end{equation}
These features are taken from the constituent terms in the nonlinear equation \eqref{eq:triangulate}
Stacking the $\bbX_\ell$ into an $n \times 6$ matrix, we have a linear model $\bbY = \bbX \bbbeta + \bbepsilon,$ where $\bbbeta$ is a $6 \times 3$ matrix of coefficients and $\bbepsilon$ is an $n \times 3$ matrix of zero-mean Normal errors.
We experimentally verified that the rows of $\bbepsilon$ are roughly Gaussian, as can be seen in the right panel of Fig.~\ref{fig:px_errors}.
We refer to the raw pixels as \emph{uncorrected}.
The associated error vectors (computed with respect to the uncorrected pixels and the projected ground truth) $\bbepsilon_\ell^\text{uc}$ for $\ell = 1, \dots, n$ are plotted in the left panel of Fig~\ref{fig:px_errors}.
In the scatter plot it can be seen that the mean error is nonzero, contributing average bias to individual measurements.
Also note the apparent skew of the error distribution in the vertical ($y$) direction.
Applying the ordinary least squares estimator, the maximum likelihood estimate of the coefficient matrix is $\hat{\bbbeta} = (\bbX^\top \bbX)^{-1} \bbX^\top \bbY.$
Using $\hat{\bbbeta},$ the residual covariance in the pixel measurements for the two robots, named ${{\rm r1}} \; \and \; {{\rm r2}}$, we obtained are
\agn*{
\bbP_{\rm r1} = \mat{
0.13& 0.09& 0.02\\
0.09& 0.13& -0.03\\
0.02& -0.03& 0.28}\!\!,
\bbP_{\rm r2} = \mat{
0.22& 0.16& 0.04\\
0.16& 0.23& 0.03\\
0.04& 0.03& 0.74}.
}
Note that the standard deviation of the $y$ pixel value, corresponding to the variances in the lower right entries of the above matrices, is 0.53 and 0.86 pixels, respectively.
This corresponds to errors in the height of the ping pong ball center in vertical coordinates.
The right panel of Fig.~\ref{fig:px_errors} shows the residual errors in the training set $\bbepsilon_\ell$ for $\ell = 1, \dots, n$ for the corrected vector $X \hat{\bbbeta}$ on ${\rm r1}$.
For prediction, if ${\rm r1}$ makes a new observation $(x^*_{L}, x^*_{R}, y^*)$, it forms a $1 \times 6$ vector $\bbX^*$.
Then, ${\rm r1}$ calculates the corrected pixels $[x_L^c, x_R^c, y^c]^\top = \bbX^* \hat{\bbbeta},$ which are subject to zero mean Normal errors.
Using the corrected pixels, ${\rm r1}$ triangulates the relative location of the target via \eqref{eq:triangulate}, propagates $\bbP_{\rm r1}$ via the Jacobian $\bbJ,$ rotates and translates the estimates to global coordinates, and thus the assumptions that the error terms $\bbnu$ are zero mean with covariance $\bbQ= \bbT \bbJ \bbP_{\rm r1} \bbJ^\top \bbT^\top$ are approximately satisfied.
The case for ${\rm r2}$ is analogous.
\begin{figure}[t]
\centering
\begin{tabular}{c c}
\includegraphics[height=4cm]{figures/scat-uncorrected.pdf}
&
\includegraphics[height=4cm]{figures/scat-corrected.pdf}
\end{tabular}
\caption{Scatter plots of the residual errors $\bbepsilon_\ell^\text{uc}$ (left panel) and $\bbepsilon_\ell$ (right panel) for the training data for ${\rm r1}$
The plots for ${\rm r2}$ are similar.
}
\label{fig:px_errors}
\end{figure}
Finally, note that the regression takes place in three dimensions, whereas the algorithm is designed only for two dimensions.
For planning purposes, we consider only the components of $\bbQ$ that lie on the plane of the workspace, i.e., we do not use the third row and column for planning.
Of course, the experiments take place in three dimensions, so we need to use the full covariance matrices in the Kalman Filters.
Note that the algorithm proposed in this paper could be implemented in 3D at the expense of increasing the pose and covariance spaces accordingly.
\subsection{Literature Review}\label{sec:lit_review}
A typical approach to active state estimation is to employ gradient descent methods to generate sensor trajectories and sequences of associated state observations that minimize an information theoretic objective of interest, such as the trace of the covariance matrix.
This is the approach followed, e.g., in mobile target tracking \cite{chung06,freundlich13cdc}, sparse landmark localization \cite{freundlich15acc, freundlich13icra,vanderhook15}, and active SLAM \cite{carrillo15,atanasov15,agha15}.
Recently, \cite{carrillo15} have shown that information-theoretic objectives may fail even to be monotonic in many active sensing tasks, removing performance guarantees for greedy control.
When planning multiple observations, the robot may need to reason over the combinatorial set of future probability distributions (pdfs), efficiently represent them, and solve Bellman's equation.
This is known as the ``belief representation problem.''
This problem, in the context of information acquisition, has received a great deal of attention recently, both when the robot state is observable\cite{ryan2010particle,adurthi14,atanasov14,hollinger14sampling,LeNy09trajectory} and when it is only partially observable\cite{atanasov14nonmyopic,spaan14,agha2014firm,agha15,kurniawati2016online,seiler15,bai14,omidshafiei15,oliehoek16}.
The most widely used approach is to grow a tree with a prior distribution of the hidden states at the root, sampling in this way several sequences of possible future observations to obtain the set of reachable belief states at the leaves.
Once the tree has been constructed, one simply selects the leaf with the lowest cost and traces it back to the root to obtain the optimal policy.
The horizon length can be set \emph{a priori} \cite{ryan2010particle,adurthi14,atanasov14,atanasov14nonmyopic} or, e.g., defined implicitly by a budget \cite{hollinger14sampling}.
\input{tcns-text/exploration}
Two approaches that are fundamentally different from choosing a dynamic programming horizon are
\begin{inlinelist}
\item to represent the reachable belief space with a finite set in a clever way, typically by making an assumption about the family of distributions of the hidden states\cite{spaan14,freundlich15acc,atanasov14,agha2014firm,vanderhook15,LeNy09trajectory}, or
\item to avoid this representation problem altogether by working in policy space \cite{kurniawati2016online,seiler15,bai14}.
\end{inlinelist}
With respect to the latter, \cite{bai14} defines a \emph{generalized policy graph}, which nonetheless relies on belief space sampling.
In fact, some kind of sampling is at the core of all point-based approaches stemming from the seminal paper \cite{kurniawati08}.
Non-myopic active sensing for teams of decentralized robots often leads to decentralized Partially Observable Markov Decision Process POMDPs (dec-POMDPs) \cite{omidshafiei15, oliehoek16}.
To our knowledge, decentralization in this context refers to the execution of the planner, as its computation is always done offline at a central location due to the non-separable nature of the value function.
Recently, \cite{atanasov16} used sequential planning for decentralized active SLAM.
Common in the vast majority of approaches discussed above is that mobile sensor planning relies on sampling-based strategies, e.g., forward search, for partially \cite{atanasov14nonmyopic,spaan14,agha2014firm,agha15,omidshafiei15, oliehoek16,kurniawati2016online,seiler15,bai14,spaan14}
and fully observable \cite{atanasov14,LeNy09trajectory} robots, or belief space sampling in the policy domain \cite{kurniawati2016online,seiler15,bai14}.
Sampling-based approaches will typically run into scalability issues due to one or more of the following reasons:
\begin{inlinelist}
\item sparsity of information in the environment, which forces longer planning horizons,
\item high dimensional unknowns, which make observation sampling inefficient, or
\item large teams of robots, which significantly increase the size of the action space.
\end{inlinelist}
To design an algorithm that avoids these pitfalls, in this paper we introduce a hierarchical approach
that decomposes the set of $M$ states into $P\ll M$ clusters, designs optimal controllers for each cluster, and then allocates those controllers among the $N$ robots. Specifically, for every hidden state that needs to be estimated,
we define a local Dynamic Program (DP) in the joint state-space
of robot positions and state uncertainties that determines
robot paths and associated sequences of state observations that
collectively minimize the estimation uncertainty. Then, we divide the
collection of hidden states into clusters based on a prior belief
of their geographic locations, and, for each cluster, we define a
second DP that determines how far along the local optimal trajectories
the robot should travel before transitioning to estimating
the next hidden state within the cluster. Finally, a distributed
assignment algorithm is used to dynamically allocate controllers
to the robot team from the set of optimal control policies for every
cluster.
\input{tcns-text/tsp-complex}
We are not aware of any other non myopic method in the literature that can handle as many hidden states and robot sensors.
We also illustrate these claims with experiments on real robots, which are a contribution in and of themselves as the first to demonstrate experimental multi-robot active sensing using stereo vision.
The paper is organized as follows: In Section~\ref{sec:pf}, we formulate the distributed state estimation problem addressed in this paper.
In Sections~\ref{sec:st} and \ref{sec:mt} we propose a local and a cluster DP to obtain controllers that are optimal at the cluster level.
Section \ref{sec:many} presents the distributed auction mechanism that can efficiently allocate clusters to the robots in real-time.
In Section~\ref{sec:sim}, we simulate large robot teams carrying stereo vision rigs that localize hundreds of sparse landmarks.
In Section~\ref{sec:exp}, we report experiments on a team of two robots localizing eight landmarks.
\subsection{Distributed Auction Mechanism}\label{sec:auctions}
In this section we propose a distributed auction method to dynamically and sequentially allocate clusters to robots as they move to localize the whole scene.
\input{tcns-text/auction}
Specifically, let $s=1,2,\dots$ denote a sequence of time instants when the robots communicate with each other, that is in general different from the times $k$ when the robots move, and let $\ccalN_i^s \triangleq \big\{j \mid \|\bbz_i^s-\bbz_j^s\|<\Delta\big\}$ denote the set of neighbors of robot $i$ at time $s$, where $\Delta>0$ denotes a given communication range. Moreover, assume that every robot $i$ carries two lists: the list of `free' clusters $\ccalI_{i,f}^s$ and the list of `taken' clusters $\ccalI_{i,t}^s$, so that $\ccalI_{i,f}^s \cup \ccalI_{i,t}^s = \set{1, \dots, P}$ and $\ccalI_{i,f}^s \cap \ccalI_{i,t}^s = \emptyset$ for all time $s$.
Initially, $\ccalI_{i,f}^0 = \set{1, \dots, P}$ and $\ccalI_{i,t}^0 = \emptyset$. The list of `free' clusters contains clusters that are available to robot $i$, meaning that robot $i$ can select from those clusters a cluster to visit next. On the other hand, the list of `taken' clusters contains clusters that have been selected by other robots and are, therefore, not available to robot $i$. During operation, robot $i$ coordinates with its neighbors $j \in \ccalN_i^s$ to update its list of `taken' and `free' clusters by $\ccalI_{i,t}^{s+1}=\cup_{j \in \ccalN_i^s } \ccalI_{j,t}^s$ and $\ccalI_{i,f}^{s+1}=\{1,\dots,P\}\setminus \ccalI_{i,t}^{s+1}$, respectively. In other words, with every communication round, robot $i$ removes {\blue from} its list of free clusters those clusters that are considered taken by other robots.
Given the list of `free' clusters $\ccalI_{i,f}^s$ at time $s$, robot $i$ can select any cluster from that list to be the next cluster $c_{i,\text{next}}$ to visit. To minimize the total distance travelled by the robots, we propose a greedy approach where robots select a cluster that is the closest to their current location. In particular, we define
\begin{align}\label{eq:cnext}
&c_{i,\text{next}}^{s+1} = \! \begin{cases}
\argmin_{c \in \ccalI_{i,f}^s} d_{p,j_p}^\text{busy}(\ell^s, c) &\text{if }m_i^s = \text{`busy'} \\
\argmin_{c \in \ccalI_{i,f}^s} d^\text{trans} (\bbz_i^s,c) &\text{if }m_i^s = \text{`transit'}
\end{cases}
\\
&
\label{eq:busy}
d_{p,j_p}^{\text{busy}}(\ell^s, c) \triangleq (L_{p,j_p} \! - \! \ell^s) + \! \! \min_{\bbp\in\partial\ccalZ_c} \|\bbxi_{p,j_p}(L_{p,j_p}) \! - \! \bbp\|\\
&\text{and }
\label{eq:trans}
d^{\text{trans}}(\bbz_i^s, c) \triangleq \min_{\bbp\in\partial\ccalZ_c} \|\bbz_i^s-\bbp\|,
\end{align}
In \eqref{eq:busy} and \eqref{eq:trans}, $d_{p,j_p}^{\text{busy}}(\ell^s, c)$ and $d^{\text{trans}}(\bbz_i^s, c)$ are the distances that robot $i$ needs to travel in order to reach a new cluster $c$ from its current location $\bbz_i^s$ while in modes `busy' and `transit', respectively, and $\ell^s=\bbxi_{p,j_p}^{-1}(\bbz_i^s)\in[0,L_{p,j_p}]$, as in \eqref{eq:busynav}. When robot $i$ selects a new cluster $c_{i,\text{next}}^{s}$, then it also updates its lists of `free' and `taken' clusters by removing $c_{i,\text{next}}^{s}$ form $\ccalI_{i,f}^s$ and adding it to $\ccalI_{i,t}^s$.
Every time $c_{i,\text{next}}$ is updated, robot $i$ also places a bid that indicates how important the selection of the new cluster is. The bids are inversely proportional to the distance robot $i$ needs to travel to reach the new cluster, so that nearby clusters have higher value. Specifically, bids are placed according to
\begin{align}\label{eq:bids}
b_i^{s+1} &= \begin{cases}
\max_{c \in \ccalI_{i,f}^s} \left(1+d_{p,j_p}^\text{busy}(\ell^s, c) \right)^{-1} &\text{if }m_i^s = \text{`busy'}, \\
\max_{c \in \ccalI_{i,f}^s} \Big(1+d^\text{trans} (\bbz_i^s,c) \Big)^{-1} &\text{if }m_i^s = \text{`transit'}
\end{cases}.
\end{align}
If at some point in time there exist neighbors $j\in\ccalN_i^s$ of robot $i$ so that $c_{j,\text{next}}^s = c_{i,\text{next}}^s$, then these robots set up a local auction and compare their bids to resolve the underlying conflict. If $b_i^s>b_j^s$ for all $j\in\ccalN_i^s$ for which $c_{j,\text{next}}^s = c_{i,\text{next}}^s$, then robot $i$ wins the auction and maintains the same next cluster and bid, i.e., $c_{i,\text{next}}^{s+1} = c_{i,\text{next}}^s$ and $b_i^{s+1}=b_i^s$. The robots that lose the auction update their set of `free' clusters by removing cluster $c_{j,\text{next}}^s$, i.e., $\ccalI_{j,f}^s=\ccalI_{j,f}^s\setminus \{c_{j,\text{next}}^s\}$, and select a new next cluster and bid according to \eqref{eq:cnext} and \eqref{eq:bids}. If $\ccalI_{i,f}^s=\emptyset$, i.e., if there are no other available clusters for robot $i$, we set $c_{i,\text{next}}^{s+1} = \textrm{`depot'}$, effectively controlling the robot to return to a depot after it has completed its current (final) task.
\begin{figure*}[t]
\begin{center}
\includegraphics[width=11cm]{figures/automoton}
\caption{
A diagram representing the controller for the $i$-th robot.
The two blocks, Navigation and Coordination, synchronize whenever the updates denoted by $\alpha$ and $\beta$ are triggered.
Functions \emph{transit} and \emph{busy} are defined in \eqref{eq:transitnav} and \eqref{eq:busynav}.
}
\label{fig:automaton}
\end{center}
\vspace{-0.5cm}
\end{figure*}
Fig~\ref{fig:automaton} illustrates the integrated, hybrid, controller.
The labels $\alpha$ and $\beta$ mark events that need to be synchronized across the navigation and coordination control blocks.
In particular, transitions labeled by the letter $\alpha$ are triggered by the navigation block and generate synchronous transitions in the coordination block aimed to produce new bids or update the next cluster that the robot needs to visit.
Similarly, transitions labeled by the letter $\beta$ are triggered by the coordination block when new bids are computed or the next cluster that the robot needs to visit is updated and they generate synchronous transitions in the navigation block aimed to guide the robot its new assigned cluster.
Note that while the $k$ and $s$ time indices used for the navigation and coordination blocks, respectively, can in general be different, the transitions labeled by the letters $\alpha$ and $\beta$ can generate transitions in these blocks that can be off-clock.
For example, a transition at time $k$ in the navigation block labeled by $\alpha$ will generate a transition in the coordination block at a time instant $k\neq s$.
\subsection{Active sensing of a single target}\label{sec:st_results}
The local pose space $\ccalW$ for the single target case is made up of concentric spherical shells with randomly distributed viewpoints on each.
There were 177 total views in $\ccalW$ at six equally spaced radii between 20 and 40 units from the landmark.
To discretize the covariance space $\ccalC$, we set $1 = \max \set{\lambda \in \ccalL} \triangleq \beta $.
In total, the number of possible principal eigenvalues was $N_\ccalL = 6$.
We also use $N_\ccalA = 3$ condition numbers.
We set the number of principal eigenvectors for covariances with $\beta$ as the principal eigenvalue to $N_{\ccalT_\lambda} = 98.$
This means $\ccalT_\beta$ has 98 unit vectors.
The number of samples at other principal eigenvectors $\set{\lambda \in \ccalL \mid \lambda \neq \beta}$ was $
\ceil{
\frac{\lambda}{\beta}
N_{\ccalT_\beta}
}.$
For the logspace discretizations, we set $\kappa_\ccalL=9,$ and $\kappa_\ccalA=3.$
Stereo vision is used as the sensing model; see Appendix~\ref{app:noise}.
The discount factor $\gamma$ was 0.99.
The value of the uncertainty reduction gain $\rho$ is very important, since it controls the tradeoff between traveling cost and uncertainty reduction due to more images.
Fig.~\ref{fig:error} shows the sensitivity of the total reward gained and the two opposing objectives that comprise it as they depend on $\rho$.
Fig.~\ref{fig:rho999} shows example an optimal trajectory in both pose and covariance space with $\rho=0.999.$
\begin{figure}[t]
\centering
\includegraphics[width=8cm]{figures/compare.pdf}
\caption{Showing the effect of the uncertainty gain parameter $\rho$ on the total reward, uncertainty reduction, and total distance traveled by the sensor in the single landmark localization simulations.
Lines are drawn to guide the eye
}
\label{fig:error}
\vspace{-0.0cm}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[width=2in]{figures/local2.pdf}
\caption{Showing an optimal trajectory through both pose (top panel) and covariance (bottom six panels) space for $\rho = 0.999.$
The indices in the top panel correspond to the time indices in the bottom panel.
Covariance states are shown as 50\% confidence regions.
Robot starts at $\square$ and ends at $\triangle.$
All units in stereo baselines and axis directions equally scaled
}
\label{fig:rho999}
\vspace{-0.0cm}
\end{figure}
In these simulations, we approximate error distributions as state-dependent white noise using the equations given in Appendix~\ref{app:noise}.
White noise is uncorrelated in time, thus, under standard KF assumptions, two observations from the same vantage point will reduce variance by Lemma~\ref{lem:fusion}.
This is why, in the figures, there are more intermediate covariance ellipsoids than steps in the robot trajectories; it is sometimes optimal to remain stationary and take multiple observations.
In real scenarios, noise is seldom well-approximated as white, and duplicate observations will exacerbate bias.
We account for such hidden biases in these simulations by using a real model of stereo vision that is subject to the nonlinear effects of quantization on the image plane; see Appendix~\ref{app:noise}.
Interestingly, the presence of such noise reveals a secondary benefit of sensor mobility:
mobile sensors avoid by default duplicate observations that would plague a static sensor.
Although our controller does not explicitly encourage motion for this reason, a basic heuristic adjustment that does would be simple to implement by, e.g., removing the action ``remain stationary.''
\begin{table}
\centering
\caption{Comparison to Heuristics for Single Landmark}
\label{tab:heur}
\begin{tabular}{| c | c c c c c |}
\hline
Method & optimal & closer & static & circle & random \\ \hline
Reward (m)& 3.15 & 2.75 & 1.31 & 1.66 & 2.74 \\ \hline
\end{tabular}
\end{table}
Table~\ref{tab:heur} compares the total reward gained by a robot starting from the same initial condition under the optimal policy with $\rho=0.999$ found by our (optimal) local controller with some heuristic policies.
The heuristics we chose for comparison were a policy that drives closer to the hidden state (closer), one that circles around the source (circle), one that remains still (static), and one that acts randomly (random).
The fact that that `random' performs about as well as `closer' suggests that a sophisticated controller is needed in order to beat `random.'
Our `optimal' policy obtains 115\% of the reward of the `closer' and `random' policies.
Also note that the `static' and `circle' policies perform very poorly in comparison to the others.
This is because they stay at a constant depth with respect to the landmark.
In triangulation with stereo vision, there is significant bias in the viewing direction, causing poor localization performance given multiple observations at constant depth.
\subsection{Active sensing of Target Clusters}\label{sec:mt_results}
\begin{figure}
\centering
\begin{tabular}{c}
\includegraphics[width=7cm]{figures/clustercompare.pdf}
\\
\includegraphics[width=7cm]{figures/clustercompareerror.pdf}
\end{tabular}
\caption{
Top panel:
Showing trajectories generated by our hierarchical controller and by the method in \cite{atanasov14}.
The trajectories start at the $\square$ and end at the $\triangle$.
The number {\bf k} indicates the number of observations taken.
Bottom Panel: plotting the sum of errors in all landmarks versus the number of observations required found over 100 simulations of observations taken along the trajectories in the top panel.
The midlines represent the empirical mean and error bars represent the standard deviation of the sum of error vectors over the 100 simulations.
All units in meters
}
\label{fig:cluster}
\vspace{-0.0cm}
\end{figure}
We present simulations of the proposed distributed estimation method for a single robot observing a cluster of sparse landmarks.
For the landmarks, we model a famous group of sculptures called the Queens of France and Famous Women, which can be found in the Luxembourg Garden, Paris, France.
The Luxembourg Garden is actually home to hundreds of sculptures, and the Queens of France and Famous Women is a cluster that surrounds a large pool (octagon in Fig.~\ref{fig:cluster}) that is adjacent to the Luxembourg Palace (large rectangle in Fig.~\ref{fig:cluster}).
We chose a subset of eight queens as individual sparse landmarks to comprise a cluster of statues.
The task of the robot in this scenario is to exactly localize each statue to create a precise spatial map of the sculpture garden.
For these simulations, we used a discount factor and gain of 0.999.
We use the same hemispherical pose state-spaces as in Section~\ref{sec:st_results} for each local DP.
We also compare the trajectories generated by our cluster DP with a state-of-the-art algorithm \cite{atanasov14}.
The method in \cite{atanasov14}, called $\epsilon$-$\delta$ Reduced Value Iteration (${\epsilon\text{-}\delta\text{RVI}}$), grows a tree in belief space that computes an optimal sensor trajectory, i.e., it applies the most widely used approach to the same problem that we solve under similar assumptions.
In our implementation of ${\epsilon\text{-}\delta\text{RVI}}$, planning horizons greater than 12 caused our simulation, run on Macbook Air\texttrademark with 4 GB of RAM, to run out of memory.
Because of the sparsity of the scene, 12 step lookahead was sometimes not enough to plan future landmarks to visit.
Therefore, if the robot following ${\epsilon\text{-}\delta\text{RVI}}$ finishes observing a landmark to the threshold, it greedily selects a new landmark.
The top panel in Fig.~\ref{fig:cluster} displays four snapshots of two different trajectories: one produced by the cluster DP optimal policy and one produced using ${\epsilon\text{-}\delta\text{RVI}}$.
The bottom panel of Fig.~\ref{fig:cluster} shows the result of the KF output of 100 simulations of observations taken along the trajectories in the top panel.
The empirical standard deviations for each error vector are also drawn on the figure.
Both methods perform similarly, with our method requiring slightly less observations.
The important distinction, however, is that for every new initial condition, any tree-based planner, including ${\epsilon\text{-}\delta\text{RVI}}$, needs to be run again, whereas we can reuse our optimal policy for any initial condition.
This is important in the next section, as it allows allocation of clusters dynamically in the multi-robot team from a variety of initial conditions along the cluster boundaries.
In other words, our method allows us to compute an \emph{optimal policy}, rather than a single \emph{optimal trajectory}.
\subsection{Multiple Robots and Multiple Clusters}
\begin{figure}[t]
\centering
\includegraphics[width=7cm]{figures/many2.pdf}
\caption{
Cooperative active sensing for 100 sparse landmarks and 15 clusters using 8 robots.
Top panel: Targets are denoted by circles, and clusters are shaded grey.
Squares represent the initial locations of the robots at the bottom of the panel.
Bottom panel: cluster assignment result from the online distributed auction for each of the eight robots.
Colors correspond to robot trajectories in the top panel.
Note that at time 150, the orange robot loses an auction for cluster 3 to the cyan robot, and selects a different cluster 7.
}
\label{fig:mmt}
\end{figure}
We present simulations of the proposed distributed estimation framework for multi-robot multi-target active localization in Fig.~\ref{fig:mmt}.
For these simulations, we uniformly randomly generated targets in a rectangle in $\reals^2.$
The communication range of the robots was set to 1500 m.
\input{tcns-text/clustering}
\subsection{The Uncertainty State-Space and Transition Function}\label{sec:cog}
In this section, we discretize ${\rm Sym}_{++}(n,\reals)$ to design the finite set $\ccalC.$
We emphasize that optimally sampling bounded subsets of ${\rm Sym}(n,\reals)$ is an interesting and deep problem \cite{hardin2004discretizing}, and we do not provide a general framework.
Our method works well for representing a specific bounded region of ${\rm Sym}(n , \reals),$ which we call the \emph{reachable covariance matrices} for the problem described herein.
\begin{figure}[t]
\centering
\begin{tabular}{c c}
\includegraphics[width=2.6cm]{actions4.pdf}
&
\includegraphics[width=3.5cm]{figures/charges.pdf}
\\
(a) & (b)
\end{tabular}
\caption{
(a) An illustration of the state-space and transition for a local DP where $\ccalW$ is a NWSE grid and actions are to take an image and move north, south, east, west, or remain stationary.
Red lines are drawn to represent each action, showing the transition of the state both in $\ccalW$ and in $\ccalC$.
The vertical axis represents the discrete nature three dimensional $\ccalC$ using colored regions, which are each represented by a single matrix in $\ccalC$.
(b) A fifty point discretization of $\mbR\mbP^{2}$ is represented by allowing 100 simulated charges confined to the 2-sphere $\mbS^2$ to come to equilibrium and discarding the points below an arbitrary equator.
Charges are red dots, and the net electric force on each is plotted in blue.
}
\label{fig:discrete_actions}
\vspace{-0.5cm}
\end{figure}
We begin by the following lemmas; proofs are omitted due to space limitations.
\begin{lem}\label{lem:pre-fusion}
Let $\bbI$ denote the $n \times n$ identity matrix and let $\bbC \in {\rm Sym}_{++}(n,\reals)$. Then, $\bbI-(\bbI+\bbC)^{-1} \in {\rm Sym}_{++}(n,\reals)$.
\end{lem}
\begin{lem}[Lemma 2.7, \cite{trace_ineq}] \label{lem:fusion}
Let $n \in \mbN$.
If $\bbA,\bbB \in {\rm Sym}_{++}(n,\reals)$, then
$
{\bf tr} \left( \bbA^{-1} +\bbB^{-1} \right)^{-1} < {\bf tr} \bbA.
$
\end{lem}
The first implication of Lemma~\ref{lem:fusion} is that the trace of the largest instantaneous covariance bounds the maximum eigenvalue of the reachable covariance matrices.
Define this bound as
\input{tcns-text/eig}
Lemma~\ref{lem:fusion} also implies that the trace is decreasing with additional independent measurements.
Therefore, the set of reachable covariances is bounded.
Lemma ~\ref{lem:fusion} and the resulting bound can be used to obtain a discretization of the set of possible maximum eigenvalues for the reachable covariance matrices.
In particular, we define the logspace set of maximum eigenvalues
\begin{equation} \label{eq:mu}
\ccalL \triangleq \set{ {\lambda_\text{max}} e^{\kappa_{\ccalL} \left( i-N_{\ccalL} \right)/N_{\ccalL}} \mid i=1, \dots ,N_{\ccalL} }\subset \reals_{++},
\end{equation}
where $N_{\ccalL}$ is the cardinality of $\ccalL$ and $\kappa_{\ccalL}$ is a sampling gain that controls how clustered the samples are toward zero.
Note that ${\lambda_\text{max}}$ is the maximal element of $\ccalL$.
In \eqref{eq:mu}, we sample in logspace as a heuristic; we have found empirically that the maximum eigenvalues of the filtered covariance matrices accumulate near zero.
To obtain a scalable discretization of the space of covariance matrices ${\rm Sym}_{++}(n , \reals),$ we assume that $\lambda_\text{max} (\bbSigma)$ and its corresponding eigenvector are more important than any one of the other eigenvalues and eigenvectors.
In particular, we assume that, in comparison to $\lambda_\text{max},$
the other eigenvalues are roughly equal,
thus all other eigenvalues can be parameterized by a number in the half open interval $\alpha \in (0,1] \subset \reals$ such that $\lambda_i \approx \alpha \lambda_\text{max}$ for all $i = 2, \dots, n.$
This choice alleviates the need to independently consider all possible combinations of eigenvectors corresponding to the nonprincipal eigenvalues.
Define the set of ratios, which can be thought of as the set of possible inverse condition numbers, as
\begin{equation} \label{eq:ratiovec}
{\ccalA } \triangleq \set{ e^{\kappa_{\ccalA } \left( i-N_{\ccalA } \right)/N_{\ccalA }} \mid i =1, \dots, N_{\ccalA } }\subset (0,1].
\end{equation}
In \eqref{eq:ratiovec}, $N_{\ccalA }$ is the number of eigenvalue ratios we sample and $\kappa_{\ccalA }$ is a sampling gain that controls the ellipticity of the confidence region associated with $(\lambda,\alpha) \in \ccalL\times\ccalA.$
Again, the logspace discretization is a heuristic based on experience; KF error covariance matrices produced using robotic sensors are typically cigar-shaped, i.e., dominated by uncertainty in the direction of the principal eigenvector.
The set of possible principal eigenvectors is equivalent to the set of lines passing through the origin, known as the real projective space $\mbR \mbP^{n-1}\!\!\!\!\!.\;$
Let $N_\ccalT$ be the number of samples needed to capture these possible directions for the principal eigenvalue.
Because $\mbR \mbP^{n-1}$can be formed by identifying antipodal points on any sphere, this problem can be approximately solved by placing $2N_\ccalT$ point charges on a sphere of radius $\sqrt{{\lambda_\text{max}}},$ allowing them to move until the ``electrostatic forces'' among them come to equilibrium, cutting the sphere along any equator, discarding one of the hemispheres, and saving the unit directions to each ``charge'' location on the other hemisphere.
It is straightforward to build such a simulation, and for brevity we do not provide the specifics here.
The result for 100 charges on the unit 2-sphere is shown in Fig.~\ref{fig:discrete_actions}~(b).
To force the sampling density to be consistent, defined in terms of the surface area of the sphere used in the simulation, we create a set of sets $\set{\ccalT_\lambda \mid \lambda \in \ccalL}$; each element $\ccalT_\lambda$ is the set of unit vectors produced by the simulation using $\sqrt{\lambda}$ as the radius of the sphere.
The number of elements in the largest, i.e., the set with the most elements, of these sets $\ccalT_{\lambda_\text{max}}$ is set to a user-specified number $N_{\ccalT_{\lambda_\text{max}}}$.
The remaining sets $\set{ \ccalT_\lambda \mid \lambda \in \ccalL}$ correspond to the other $N_{\ccalL} -1$ possible principal eigenvalues and, since ${\lambda_\text{max}}$ is the maximal element of $\ccalL,$ the sets $\set{\ccalT_\lambda \mid \lambda \neq {\lambda_\text{max}}}$ must have fewer elements than $\ccalT_{\lambda_\text{max}}$ so that the sampling density is the same.
In particular, for some $\lambda \in \ccalL,$ the set $ \ccalT_\lambda$ has
$
\ceil{
\frac{\lambda}{{\lambda_\text{max}}}
N_{\ccalT_{\lambda_\text{max}}}
}$ elements, where the ceiling function is used to ensure that the number of elements in $\ccalT_\lambda$ is positive.
Using the sets $\ccalL, \ccalA,$ and $ \set{\ccalT_\lambda\mid \lambda \in \ccalL},$ we can create a discretization of ${\rm Sym}_{++} (n, \reals)$.
The result, interpreted geometrically, is $N_\ccalL$ concentric sets of cigar-shaped confidence ellipsoids with a variety of major diameters, defined by $\lambda \in \ccalL,$ ellipticities $\alpha \in \ccalA,$ and orientations $\bbu \in \ccalT_\lambda.$
The full covariance space can thus be described with a map $f \colon \reals^{2+n} \to {\rm Sym} (n, \reals)$ given by
\begin{equation}\label{eq:covmap}
f(\lambda, \alpha,\bbu)= \lambda \mat{\bbu & *}
\mat{1 & \bb0 \\ \bb0 & \alpha\bbI_{n-1}} \mat{\bbu & *}^\top,
\end{equation}
where $*$ is any basis completion for $\reals^n$, and $\bbI_{n-1}$ is the identity matrix.
The function $f$ essentially builds a covariance matrix from the parameters supplied by $\ccalA$ and $\set{(\lambda, \ccalT_\lambda) \mid \lambda \in \ccalL}.$
\input{tcns-text/cov-set.tex}
\noindent The $\bb0$ covariance is an artificial state that we include in $\ccalC $ to denote that no more uncertainty remains in the variable being estimated, i.e., estimation is complete to the user-specified tolerance, defined as $\frac{1}{2} \min \set{\lambda \in \ccalL}.$
The projection operator $\mathsf{\Pi}_{\ccalC }$ guarantees that the fusion of the current covariance state $\bbSigma_k$ and the new measurement covariance $\bbQ_k$ is a member of $\ccalC.$
In particular, for some $\bbSigma \in {\rm Sym}_{++} (n ,\reals),\mathsf{\Pi}_{\ccalC}$ first computes the principal eigenvalue $\lambda_\text{max}$ and its corresponding normalized eigenvector $\bbu_\text{max}$.
Then, it rounds $\lambda_\text{max}$ to the closest element in $\ccalL \cup \set{0}.$
Call this map $\mathsf{\Pi}_\ccalL : {\rm Sym}(n,\reals) \to \ccalL \cup\set{0}.$
If $\mathsf{\Pi}_\ccalL(\bbSigma)$ is nonzero,
there will be some $\lambda ' \in \ccalL$ that is closest to $\lambda_\text{max},$
and $\mathsf{\Pi}_\ccalC$ then finds the element $\bbu' \in \ccalT_{\lambda'}$ that forms the largest magnitude inner product with $\bbu_\text{max}.$
Call this map $\mathsf{\Pi}_{\ccalT_{\lambda'}} : {\rm Sym}(n,\reals) \to \mbS^{n-1},$
where $\mbS^{n-1} = \set{\bbu \in \reals^n \mid \left\langle\bbu,\bbu \right\rangle =1}.$
In particular,
$
\bbu' =
\mathsf{\Pi}_{\ccalT_{\lambda'}}(\bbSigma) \triangleq \max_{\bbu \in \ccalT_{\lambda'}} \abs{\left\langle\bbu, \bbu_\text{max} \right\rangle }.
$
Finally, $\mathsf{\Pi}_\ccalC$ computes the ratio of $\lambda_\text{min}(\bbSigma)$ with $\lambda_\text{max}(\bbSigma)$ and finds the closest element $\alpha' \in \ccalA$ to that ratio.
Call this map $\mathsf{\Pi}_\ccalA : {\rm Sym}_{++}(n ,\reals) \to (0,1].$
By this construction, it holds that $(\alpha', \lambda', \bbu') \in \ccalA \times \bigcup\nolimits_{\lambda \in \ccalL}
\left( \lambda \times \ccalT_\lambda \right),$
so that its image of this triplet under $f$ from \eqref{eq:covmap} is guaranteed to be a matrix in $\ccalC$.
In particular, the projection map is given by
$
\mathsf{\Pi}_\ccalC (\bbSigma) = f
\left(
\mathsf{\Pi}_{\ccalL } \left(\bbSigma \right),
\mathsf{\Pi}_{\ccalA} \left(\bbSigma\right),
\mathsf{\Pi}_{\ccalT_{\mathsf{\Pi}_{\ccalL } \left(\bbSigma \right)}}(\bbSigma)
\right),
$
\subsection{Procedure}
\begin{figure}[t]
\centering
\includegraphics[width=7cm]{figures/experiment-above.pdf}
\caption{Overhead photograph of the experimental setup
}
\label{fig:above}
\end{figure}
Fig.~\ref{fig:above} shows the experimental setup for the multi robot, multi landmark localization experiment.
We place eight colored ping pong balls in a square workspace of about 2 m side length for the multi robot, multi landmark localization experiment.
We use three types of local workspaces: section, semicircle, and full circular polar grids.
To avoid collisions between robots and ping pong balls and avoid overlapping local workspaces, the minimum and maximum radii were set to 30 and 50 cm for all local workspaces, respectively.
The available poses within each local workspace were located at five equally spaced radii between these two extrema.
The polar grids were also divided into increments of 15$^\circ$.
We set the covariance space parameters to $N_{\ccalL}=10,N_{\ccalA}=3, \kappa_\ccalL=10,$ and $ \kappa_\ccalA=7.$
We set $N_{\ccalT}$ to be twice the number of viewing angles in the local workspaces
For these experiments, we set $\rho=10^{-2}$ and $\gamma=0.9$.
In `transit' mode, a potential field algorithm guides the robots to the next local workspace and avoids collisions with landmarks.
All navigation and waypoint tracking relies on a PID controller using the next waypoint as the set point.
In the experiment, robots generally came within 2 cm of their target waypoints.
The servo guided the stereo cameras toward the estimate of the target locations with accuracy of $\pm 1^\circ$.
Cooperation of ${{\rm r1}}$ and ${{\rm r2}}$ relies on robots updating individual ROS topics and checking neighbors' ROS topics.
The ROS topic for a given robot contains that robot's current bid value and the subtask at which the bid is directed.
\begin{figure}[t]
\centering
\includegraphics[width=6cm]{figures/exp-errs.pdf}
\caption{
Plotting the filtered target localization error in meters for ${\rm r1}$ (a) and ${\rm r2}$ (b).
The horizontal axis is the number of observations for each. This means that each robot took 28 observations total, localizing four targets each.
}
\label{fig:exptraj-err}
\end{figure}
The filtered estimates generated by observations along the paths followed by the robots in one run of the experiments are compared with the ground truth locations of the ping pong balls in Fig.~\ref{fig:exptraj-err}.
The filtered errors are computed as the Euclidean distances between filtered estimates and the ground truth locations of the ping pong balls.
We note that any non-decreasing aspects of these plots are attributed to stochasticity in the dataset, and the fact that we are only approximating the true noise distribution with a data-driven Gaussian.
Note that, due to the relatively constrained space in our lab, the robots are not able to move as freely as in the simulations, which, in addition to unmodeled noise, is responsible for the smaller error reduction in Fig.~\ref{fig:exptraj-err} compared to the simulations.
| {'timestamp': '2018-01-16T02:07:09', 'yymm': '1706', 'arxiv_id': '1706.01918', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01918'} | arxiv |
\section{Introduction}
It is believed that betting house always makes money in long run irrespective of their short term loss or gain. In this paper, we make an attempt to understand this phenomenon with the concept of simple `expectation' and `variance' of probability theory. First, we will discuss what is \textbf{fair game}. Let's consider a simple game of English Premier League (EPL) where Manchester United (ManU) is playing against Liverpool. Suppose a betting house offers a game that if ManU wins with probability 0.606, then the player will receive \$0.65 from the betting house. On the other hand, if ManU loses with probability 0.394 then the player has to pay \$1 to the betting house.
Now player's revenue scheme $R_p$ is defined as follows:
\begin{eqnarray*}
R_{p}=\bigg\{\begin{array}{cc}
0.65 & \mbox{with probability }0.606,\\
-1 & \mbox{with probability }0.394,
\end{array}
\end{eqnarray*}
and player's expected revenue is
$$
E(R_p)=0.65\times 0.606 - 0.394=0.
$$
More about expectation and moments can be found in [1,2]. Now, we will look at the revenue scheme and expected revenue for the betting house for the same game.
\begin{eqnarray*}
R_{b}=\bigg\{\begin{array}{cc}
-0.65 & \mbox{with probability }0.606,\\
1 & \mbox{with probability }0.394.
\end{array}
\end{eqnarray*}
Expected revenue for betting house is,
$$
E(R_b)=-0.65\times 0.606 + 0.394=0.
$$
If we compare $R_p$ and $R_b$, then we can see player's loss is the gain of the betting house and vice-versa.
This type of game is known as `zero-sum' game. Also, $E(R_b)=E(R_p)=0$ means if the player and betting house play this game several times, then `on-average' neither betting house nor the player will make or lose money. This is called `fair-game.'
Now we know that the betting house has an establishment cost and most of the time these betting houses are the for-profit organization. Here the question is how they are making money. An easy way of doing it, if the betting house pays the player less than what they suppose to pay. That means, in the fair game, if they think to pay the player \$0.65, but to make money, they will pay the player less than \$0.65. For example, if they pay the player \$0.6 then the revenue scheme for the betting house is,
\begin{eqnarray*}
R_{b}=\bigg\{\begin{array}{cc}
-0.6 & \mbox{with probability }0.606,\\
1 & \mbox{with probability }0.394,
\end{array}
\end{eqnarray*}
and the expected revenue for betting house is,
$$
E(R_b)=-0.6\times 0.606 + 0.394=0.0304.
$$
It means if the player and betting house play this game several times, the on-average betting house will make \$0.03 or 3 cents from the player and the player will lose the same amount because it is a zero-sum game. So to earn money, in the long run, the betting house offers the player less than what is fair. Rest of the paper is organized as follows. In section \ref{sec_betting_strategy_prob_th}, we present the strategy of betting houses using probability theory. In section \ref{sec_strategy_league_football_match}, we discuss the strategy for league football match. In section \ref{sec_data_analysis}, we presented the data analysis and showed how imputed cost of a betting house could be estimated numerically.
\section{Betting Strategy with Probability Theory}\label{sec_betting_strategy_prob_th}
In this section, we present the strategy of the betting house. Suppose $A$ is an event with $P(A)=p$. If $A$ happens then, the betting house will pay \$$r$. Otherwise, the betting house will receive \$1. So the revenue scheme for the betting house is
$$
R_{b}=\bigg\{
\begin{array}{cc}
-r & \mbox{with probability }p,\\
1 & \mbox{with probability }(1-p),
\end{array}
$$
and the expected revenue for betting house is,
$$
E(R_b)=-rp+(1-p).
$$
Now this game is fair game if $E(R_b)=0$, that is $r=\frac{1}{p}-1$,
and $\frac{1}{p}$ is known as `\emph{decimal odds}'. The variance of the revenue scheme is generally considered as risk of a game. So for a fair game $Var(R_b)=E(R_b^2)-[E(R_b)]^2=E(R_b^2)$. Now
\begin{eqnarray*}
E(R_b^2)&=& p \Big(\frac{1}{p}-1\Big)^2+ (1-p)\\
&=& (1-p)\Big[\frac{1-p}{p}+1\Big]\\
&=&\frac{1-p}{p}=\frac{1}{p}-1=r.
\end{eqnarray*}
Interestingly, for the fair game, $r$ is the amount which betting house pays for each dollar they receive. It turns out that $r$ is also the measure of risk for the same strategy as $Var(R_b)=r$, which is known as `\emph{fractional odds}.' To make a profit, in the long run, betting house pays \$$(r-\epsilon)$, where $\epsilon>0$. The revenue scheme is
$$
R_{b}=\bigg\{
\begin{array}{cc}
-\{(\frac{1}{p}-1)-\epsilon\} & \mbox{with probability }p,\\
1 & \mbox{with probability }(1-p),
\end{array}
$$
and the expected revenue of betting house is,
\begin{eqnarray*}
E(R_b)&=&-(\frac{1}{p}-1)p+\epsilon p+ (1-p)\\
&=&-(1-p)+\epsilon p + (1-p)\\
&=&\epsilon p.
\end{eqnarray*}
After simplification $Var(R_{b})=E(R_b^2)-[E(R_b)]^2= r(1-p\epsilon)^2$.
\section{Strategy for League Football Match}\label{sec_strategy_league_football_match}
There are three mutually exclusive outcomes in a league football match. The outcomes are (i) Hometeam win, (ii) Away team win, (iii) Draw. Let us consider the EPL match between ManU Vs.
Liverpool, where ManU is Hometeam. Suppose for this match betting house calculates the probabilities 0.6, 0.15 and 0.25 for three outcomes, namely Hometeam wins, Away team wins and draw respectively. The corresponding decimal odds are $1/0.6=1.66$, $1/0.15=6.66$ and $1/0.25=4.00$.
In the previous section, we noticed that the betting house would never reveal these fair odds. They will always announce odds which are less than the fair value so that they can stay in profit. For instance, if the betting house offers odds of 1.57, 6.57 and 3.87 against the respective events of Hometeam wins, Away team wins and draw, then the revised revenue scheme for ManU to win the match with announced odds of 1.57 is,
$$
R_{b}^H=\bigg\{
\begin{array}{cc}
-(1.57-1) & \mbox{with probability }0.6,\\
1 & \mbox{with probability }0.4.
\end{array}
$$
The expected revenue for the betting house is,
$$
E(R_b^H)=-0.57\times 0.6 + 0.4=0.058.
$$
Similarly, the revised revenue scheme for the Liverpool to win the match with announce odds of 6.57 is,
$$
R_{b}^A=\bigg\{
\begin{array}{cc}
-(6.57-1) & \mbox{with probability }0.15,\\
1 & \mbox{with probability }0.85,
\end{array}
$$
and the expected revenue for betting house is,
$$
E(R_b^A)= -5.57\times 0.15 + 0.85=0.0145.
$$
Likewise, the revised revenue scheme that match will be draw with announce odds of 3.87 is,
$$
R_{b}^D=\bigg\{
\begin{array}{cc}
-(3.87-1) & \mbox{with probability }0.25,\\
1 & \mbox{with probability }0.75,
\end{array}
$$
and the expected revenue for betting house is,
$$
E(R_b^D)= -2.87\times 0.25 + 0.75=.0325.
$$
Expected revenue of betting house for all events are positive. Mathematically, we can show when the announce odds are converted to probabilities; they usually add up to more than 1 to keep the house on benefit.
Let us assume, $\Big(\frac{1}{P_H}-\epsilon\Big)=\frac{1}{P_{H}^*},$ $\Big(\frac{1}{P_A}-\epsilon\Big)=\frac{1}{P_{A}^*}$ and $\Big(\frac{1}{P_D}-\epsilon\Big)=\frac{1}{P_{D}^*}$
Therefore,
\begin{eqnarray*}
\frac{1-\epsilon P_H}{P_H}=\frac{1}{P_H^*}\\
\frac{P_H}{1-\epsilon P_H}={P_H^*}\\
{P_H}<{P_H^*}
\end{eqnarray*}
In the same way we can show ${P_A}<{P_A^*}$ and ${P_D}<{P_D^*}$. Now adding both sides we can conclude,
${P_H}+{P_A}+{P_D}<{P_H^*}+{P_A^*}+{P_D^*}$.
Of course probabilities of a fair game sums up to 1 i.e. ${P_H}+{P_A}+{P_D}=1$, hence evidently ${P_H^*}+{P_A^*}+{P_D^*}>1$.
\section{Data Analysis}\label{sec_data_analysis}
Let us discuss the former analysis above with EPL data. Data is accessible on \textbf{http://www.football-data.co.uk/englandm.php}. In the table (\ref{table_B365}) we present the decimal odds of 10 different EPL matches from the popular betting house Bet365. First three columns, `B365H', `B365D' and `B365A' represent the decimal odds (i.e. $1/p$) of three events that are (i) home team wins, (ii) draw and (iii) away team wins; from the betting house Bet365. It is visible that total probability of the three mutually exclusive events of a given match is greater than one which violates the thumb rule that probabilities add up to one. It is inevitable that sum of the probabilities will be greater than one from our results described in the previous section. However, if there are two betting houses, we can say that one house is offering better odds to the players if its sum of probabilities is closer to one.
Let us consider a match held on 8th August 2015, between Bournemouth and Aston Villa where the former team is Hometeam and later one is Away team. We look at the betting houses for this match, the following table \ref{table_compare_odds} (for the six betting houses, namely Bet365 (B365), Bet\&Win (BW), Interwetten (IW), Ladbrokes (LB), William Hill (WH), VC Bet (VC) ). Here we can compare the announce odds whichever is near to 1 that betting the house is offering fair. As per the table \ref{table_compare_odds}, B365 is offering fair odds compared with others. The betting house Interwetten is offering worst odds for this match.
\subsection{Imputed Cost of a Betting House}
We can show different ways of calculating Imputed cost of the betting house. Here we are using additive model for the same. In this model, revenue of betting house is described as,
$$
R_{b}=\bigg\{
\begin{array}{cc}
-\{(\frac{1}{p}-1)-\epsilon\} & \mbox{with probability }p,\\
1 & \mbox{with probability }(1-p).
\end{array}
$$
As discussed earlier, to make a profit, betting houses will always offer an amount which is less than what they suppose to pay. Here $\epsilon$ is that profitable amount. Suppose the betting houses announce odds are ${P_{H}^*}$, ${P_{A}^*}$ and ${P_{D}^*}$ respectively for Hometeam, Away team and Draw of a match. These announce odds can be defined as below:
$$\Big(\frac{1}{P_H}-\epsilon\Big)=\frac{1}{P_{H}^*},~~
\Big(\frac{1}{P_A}-\epsilon\Big)=\frac{1}{P_{A}^*},~~
\Big(\frac{1}{P_D}-\epsilon\Big)=\frac{1}{P_{D}^*}$$
Now we all know that probabilities of three mutually exclusive events add up to 1 for fair game, i.e. $P_{H}+P_{A}+P_{D}=1$. But ${P_{H}^*}+{P_{A}^*}+{P_{D}^*}>1$. Let us say $\delta$ is the difference between sum of these two probabilities. Then
\begin{eqnarray*}
&&{P_H^*}+{P_A^*}+{P_D^*}-({P_H}+{P_A}+{P_D})=\delta\\
&\Rightarrow
&{P_H^*}+{P_A^*}+{P_D^*}-(\frac {P_H^*}{1+\epsilon P_H^*}+\frac {P_A^*}{1+\epsilon P_A^*}+ \frac {P_D^*}{1+\epsilon P_D^*})=\delta\\
&\Rightarrow
&{P_H^*}-\frac {P_H^*}{1+\epsilon P_H^*}+{P_A^*}-\frac {P_A^*}{1+\epsilon P_A^*}+{P_D^*}-\frac {P_D^*}{1+\epsilon P_D^*}=\delta\\
&\Rightarrow
&{P_H^*}(1-\frac{1}{1+\epsilon{P_H^*}})+{P_A^*}(1-\frac{1}{1+\epsilon{P_A^*}})+{P_D^*}(1-\frac{1}{1+\epsilon {P_D^*}})=\delta\\
&\Rightarrow
&\frac {\epsilon (P_H^*)^2}{1+\epsilon P_H^*} + \frac {\epsilon (P_A^*)^2}{1+\epsilon P_A^*} + \frac {\epsilon (P_D^*)^2}{1+\epsilon P_D^*}= \delta.
\end{eqnarray*}
Clearly we can estimate $\epsilon$ from the above equation as ${P_H^*},{P_A^*},{P_D^*}$ and $\delta$ are already known to us. Let us solve the equation for $\epsilon$ using the given EPL data. Considering the first match for B365 betting house where $\{P_H^*\}=0.50$, $\{P_A^*\}$=0.25, $\{P_D^*\}$=0.28 and $\delta$=1.03-1=0.03. Now solving the above equation with the help of this numerical values,
\begin{eqnarray*}
&\epsilon(\frac {0.50^2}{1+\epsilon (0.50)} + \frac {0.25^2}{1+\epsilon (0.25)} + \frac {0.28^2}{1+\epsilon (0.28)})=0.03.
\end{eqnarray*}
Here we can see the equation is cubic in $\epsilon$. Instead solving analytically which is complicated, we are introducing \texttt{R} programming to optimise $\epsilon$.
Therefore calculate the value of $\epsilon$ is 0.065 or following the revenue model we can say \$0.065 per dollar is the profitable amount for the betting house.
\subsection{Comparative study of Imputed cost among different betting houses: }
Let us consider the result presented in Table (\ref{table_imputed_cost}) and figure (\ref{fig_imputed_cost}).
\begin{enumerate}
\item All betting houses are limited to \$0.10 seems like there is some regulatory policy
\item For $95\%$ of the matches B365 charges between \$.04 to \$.06.
\item For majority games and approximately for all matches BW and IW respectively charge \$0.10.
\item Same behavior we can see for LB also.
\item But VC never charges greater than \$.09. Moreover, for majority matches, they charge between \$.04 to \$.06.
\item B365 and VC has similar kind of behavior.
\end{enumerate}
\section{Conclusion}
In this paper, we presented how the strategy of the betting houses can be explained with the probability odds. From the real data, it is visible that for all betting houses considered here, the sum of the probability for the win, loss, and draw of a match are greater than one. We also presented how the cost of a game can be imputed numerically. Therefore, with this understanding, one realizes how the betting houses are consistently making money and accordingly decides whether to invest one's money on the betting house.
| {'timestamp': '2017-06-07T02:03:40', 'yymm': '1706', 'arxiv_id': '1706.01625', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01625'} | arxiv |
\section{Introduction}
The goal of face alignment is to localize a set of predefined facial landmarks (eye corners, mouth corners etc.) in an image of a face. Face alignment is an important component of many computer vision applications, such as face verification \cite{DeepFace}, facial emotion recognition \cite{FacialAffect}, human-computer interaction \cite{HCI} and facial motion capture \cite{Animation}.
Most of the face alignment methods introduced in the recent years are based on shape indexed features \cite{SDM, LBF, ESR, CFSS, MDM}. In these approaches image features, such as SIFT \cite{SDM, CFSS} or learned features \cite{LBF, MDM}, are extracted from image patches extracted around each of the landmarks. The features are then used to iteratively refine the estimates of landmark locations. While those approaches can be successfully applied to face alignment in many photos, their performance on the most challenging datasets~\cite{300-W} leaves room for improvement~\cite{ESR, SDM, CFSS, MDM}. We believe that this is due to the fact that for the most difficult images the features extracted at disjoint patches do not provide enough information and can lead the method into a local minimum.
In this work, we address the above shortcoming by proposing a novel face alignment method which we dub Deep Alignment Network (DAN). It is based on a multi-stage neural network where each stage refines the landmark positions estimated at the previous stage, iteratively improving the landmark locations. The input to each stage of our algorithm (except the first stage) are a face image normalized to a canonical pose and an image learned from the dense layer of the previous stage. To make use of the entire face image during the process of face alignment, we additionally input at each stage a {\it landmark heatmap}, which is a key element of our system.
A landmark heatmap is an image with high intensity values around landmark locations where intensity decreases with the distance from the nearest landmark. The convolutional neural network can use the heatmaps to infer the current estimates of landmark locations in the image and thus refine them. An example of a landmark heatmap can be seen in Figure~\ref{fig:diagram1} which shows an outline of our method. By using landmark heatmaps, our DAN algorithm is able to reduce the failure rate on the 300W public test set by a large margin of 72\% with respect to the state of the art.
\begin{figure*}[tb]
\centering
\includegraphics[width=0.9\textwidth]{./scheme/scheme_general_v3.png}
\caption{A diagram showing an outline of the proposed method. Each stage of the neural network refines the landmark location estimates produced by the previous stage, starting with an initial estimate $S_0$. The connection layers form a link between the consecutive stages of the network by producing the landmark heatmaps $H_t$, feature images $F_t$ and a transform $T_t$ which is used to warp the input image to a canonical pose. By introducing landmark heatmaps and feature images we can transmit crucial information, including the landmark location estimates, between the stages of our method. }
\label{fig:diagram1}
\end{figure*}
To summarize, the three main contributions of this work are the following:
\begin{enumerate}
\item We introduce landmark heatmaps which transfer the information about current landmark location estimates between the stages of our method. This improvement allows our method to make use of the entire image of a face, instead of local patches, and avoid falling into local minima.
\item The resulting robust face alignment method we propose in this paper reduces the failure rate by 60\% on the 300W private test set \cite{300-W} and 72\% on the 300-W public test set \cite{300-W} compared to the state of the art.
\item Finally, we publish both the source code of our implementation of the proposed method and the models used in the experiments.
\end{enumerate}
The remainder of the paper is organized in the following manner. In section \ref{related} we give an overview of the related work. In section \ref{DAN} we provide a detailed description of the proposed method. Finally, in section \ref{experiments} we perform an evaluation of DAN and compare it to the state of the art.
\section{Related work} \label{related}
Face alignment has a long history, starting with the early Active Appearance Models \cite{AAM, AAM-revisited}, moving to Constrained Local Models \cite{CLM1, CLM2} and recently shifting to methods based on Cascaded Shape Regression (CSR) \cite{SDM, ESR, LBF, cGPRT, KRFWS, MIX, Trees} and deep learning \cite{Zhou2013, Fan2016, MDM, RAR, Bulat16}.
In CSR based methods, the face alignment begins with an initial estimate of the landmark locations which is then refined in an iterative manner. The initial shape $S_0$ is typically an average face shape placed in the bounding box returned by the face detector\cite{ESR, SDM, LBF, MDM}. Each CSR iteration is characterized by the following equation:
\begin{equation}
S_{t+1}=S_t + r_t(\phi(I, S_{t})),
\end{equation}
where $S_t$ is the estimate of landmark locations at iteration $t$, $r_t$ is a regression function which returns the update to $S_t$ given a feature $\phi$ extracted from image $I$ at the landmark locations.
The main differences between the variety of CSR based methods introduced in the literature lie in the choice of the feature extraction method $\phi$ and the regression method $r_t$. For instance, Supervised Descent Method (SDM) \cite{SDM} uses SIFT \cite{SIFT} features and a simple linear regressor. LBF \cite{LBF} takes advantage of sparse features generated from binary trees and intensity differences of individual pixels. LBF uses Support Vector Regression \cite{SVR} for regression which, combined with the sparse features, leads to a very efficient method running at up to 3000 fps.
Coarse to Fine Shape Searching (CFSS) \cite{CFSS}, similarly to SDM, uses SIFT features extracted at landmark locations. However the regression step of CSR is replaced with a search over the space of possible face shapes which goes from coarse to fine over several iterations. This reduces the probability of falling into a local minimum and thus improves convergence.
MIX \cite{MIX} also uses SIFT for feature extraction, while regression is performed using a mixture of experts, where each expert is specialized in a certain part of the space of face shapes. Moreover MIX, warps the input image before each iteration so that the current estimate of the face shape matches a predefined canonical face shape.
Mnemonic Descent Method (MDM) \cite{MDM} fuses the feature extraction and regression steps of CSR into a single Recurrent Neural Network that is trained end-to-end. MDM also introduces memory into the process which allows information to be passed between CSR iterations.
While all of the above mentioned methods perform face alignment based only on local patches, there are some methods \cite{Zhou2013,Fan2016} that estimate initial landmark positions using the entire face image and use local patches for refinement. In contrast, DAN localizes the landmarks based on the entire face image at all of its stages.
The use of heatmaps for face alignment related tasks precedes the proposed method. One method that uses heatmaps is \cite{Bulat16}, where a neural network outputs predictions in the form of a heatmap. In contrast, the proposed method uses heatmaps solely as a means for transferring information between stages.
The development of novel methods contributes greatly in advancing face alignment. However it cannot be overlooked that the publication of several large scale datasets of annotated face images \cite{300-W, Reannotation} also had a crucial role in both improving the state of the art and the comparability of face alignment methods.
\section{Deep Alignment Network} \label{DAN}
In this section, we describe our method, which we call the Deep Alignment Network (DAN). DAN is inspired by the Cascade Shape Regression (CSR) framework, just like CSR our method starts with an initial estimate of the face shape $S_0$ which is refined over several iterations. However, in DAN we substitute each CSR iteration with a single stage of a deep neural network which performs both feature extraction and regression. The major difference between DAN and approaches based on CSR is that DAN extracts features from the entire face image rather than the patches around landmark locations. This is achieved by introducing additional input to each stage, namely a landmark heatmap which indicates the current estimates of the landmark positions within the global face image and transmits this information between the stages of our algorithm. An outline of the proposed method is shown in Figure \ref{fig:diagram1}.
Therefore, each stage of DAN takes three inputs: the input image $I$ which has been warped so that the current landmark estimates are aligned with the canonical shape $S_0$, a landmark heatmap $H_t$ and a feature image $F_t$ which is generated from a dense layer connected to the penultimate layer of the previous stage $t-1$. The first stage only takes the input image as the initial landmarks are always assumed to be the average face shape $S_0$ located in the middle of the image.
A single stage of DAN consists of a feed-forward neural network which performs landmark location estimation and \textit{connection layers} that generate the input for the next stage. The details of the feed-forward network are described in subsection \ref{sec:feed-forward}. The connection layers consist of the Transform Estimation layer, the Image Transform layer, Landmark Transform layer, Heatmap Generation layer and Feature Generation layer. The structure of the connection layers is shown in Figure \ref{fig:diagramconnection}.
\begin{figure}[tb]
\centering
\includegraphics[width=0.9\linewidth]{./scheme/scheme_connection.png}
\caption{A diagram showing an outline of the connection layers. The landmark locations estimated by the current stage $S_{t}$ are first used to estimate the normalizing transform $T_{t+1}$ and its inverse $T^{-1}_{t+1}$. $T_{t+1}$ is subsequently used to transform the input image $I$ and $S_{t}$. The transformed shape $T_{t+1}(S_t)$ is then used to generate the landmark heatmap $H_{t+1}$. The feature image $F_{t+1}$ is generated using the fc1 dense layer of the current stage $t$.}
\label{fig:diagramconnection}
\end{figure}
The transform estimation layer generates the transform $T_{t+1}$, where $t$ is the number of the stage. The transformation is used to warp the input image $I$ and the current landmark estimates $S_{t}$ so that $S_{t}$ is close to the canonical shape $S_0$. The transformed landmarks $T_{t+1}(S_{t})$ are passed to the heatmap generation layer. The inverse transform $T^{-1}_{t+1}$ is used to map the output landmarks of the consecutive stage back into the original coordinate system.
The details of the Transform Estimation, Image Transform and Landmark Transforms layer are described in subsection \ref{sec:normalization}. The Heatmap Generation and Feature Image layers are described in sections \ref{sec:heatmap}, \ref{sec:feature}. Section \ref{sec:training} details the training procedure.
\begin{table}
\centering
\caption{ Structure of the feed-forward part of a Deep Alignment Network stage. The kernels are described as height $\times$ width $\times$ depth, stride.} \label{tab:feed-forward}
\begin{tabular}{| c | c | c | c |}
\hline
Name & Shape-in & Shape-out & Kernel \\
\hline
conv1a & 112$\times$112$\times$1 & 112$\times$112$\times$64 & 3$\times$3$\times$1,1\\
\hline
conv1b & 112$\times$112$\times$64 & 112$\times$112$\times$64 & 3$\times$3$\times$64,1\\
\hline
pool1 & 112$\times$112$\times$64 & 56$\times$56$\times$64 & 2$\times$2$\times$1,2\\
\hline
conv2a & 56$\times$56$\times$64 & 56$\times$56$\times$128 & 3$\times$3$\times$64,1\\
\hline
conv2b & 56$\times$56$\times$128 & 56$\times$56$\times$128 & 3$\times$3$\times$128,1\\
\hline
pool2 & 56$\times$56$\times$128 & 28$\times$28$\times$128 & 2$\times$2$\times$1,2\\
\hline
conv3a & 28$\times$28$\times$128 & 28$\times$28$\times$256 & 3$\times$3$\times$128,1\\
\hline
conv3b & 28$\times$28$\times$256 & 28$\times$28$\times$256 & 3$\times$3$\times$256,1\\
\hline
pool3 & 28$\times$28$\times$256 & 14$\times$14$\times$256 & 2$\times$2$\times$1,2\\
\hline
conv4a & 14$\times$14$\times$256 & 14$\times$14$\times$512 & 3$\times$3$\times$256,1\\
\hline
conv4b & 14$\times$14$\times$512 & 14$\times$14$\times$512 & 3$\times$3$\times$512,1\\
\hline
pool4 & 14$\times$14$\times$512 & 7$\times$7$\times$512 & 2$\times$2$\times$1,2\\
\hline
fc1 & 7$\times$7$\times$512 & 1$\times$1$\times$256 & -\\
\hline
fc2 & 1$\times$1$\times$256 & 1$\times$1$\times$136 & -\\
\hline
\end{tabular}
\end{table}
\subsection{Feed-forward neural network} \label{sec:feed-forward}
The structure of the feed-forward part of each stage is shown in Table \ref{tab:feed-forward}. With the exception of max pooling layers and the output layer, every layer takes advantage of batch normalization and uses Rectified Linear Units (ReLU) for activations. A dropout \cite{dropout} layer is added before the first fully connected layer. The last layer outputs the update $\Delta S_t$ to the current estimate of the landmark positions.
The overall shape of the feed-forwad network was inspired by the network used in \cite{VGG} for the ImageNet ILSVRC 2014 competition.
\begin{figure}
\centering
\includegraphics[width=0.24\linewidth]{./afterStage1/0004a.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0004b.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0004c.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0004d.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0087a.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0087b.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0087c.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0087d.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0123a.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0123b.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0123c.png}
\includegraphics[width=0.24\linewidth]{./afterStage1/0123d.png}
\caption{Selected images from the IBUG dataset and intermediate results after 1 stage of DAN. The columns show: the input image $I$, the input image normalized to canonical shape using transform $T_2$, the landmark heatmap showing $T_2(S_1)$, the corresponding feature image.}
\label{fig:afterStage1}
\end{figure}
\subsection{Normalization to canonical shape} \label{sec:normalization}
In DAN the input image $I$ is transformed for each stage so that the current estimates of the landmarks are aligned with the canonical face shape $S_0$. This normalization step allows the further stages of DAN to be invariant to a given family of transforms. This in turn simplifies the alignment task and improves accuracy.
The Transform Estimation layer of our network is responsible for estimating the parameters of transform $T_{t+1}$ at the output of stage $t$. As input the layer takes the output of the current stage $S_{t}$. Once $T_{t+1}$ is estimated the Image Transform and the Landmark Transform layers transform the image $I$ and landmarks $S_{t}$ to the canonical pose. The image is transformed using bilinear interpolation. Note that for the first stage of DAN the normalization step is not necessary since the input shape is always the average face shape $S_0$, which is also the canonical face shape.
Since the input image is transformed, the output of every stage has to be transformed back to match the original image, the output of any DAN stage is thus:
\begin{equation}
S_t = T^{-1}_t(T_t(S_{t-1}) + \Delta S_t),
\end{equation}
where $\Delta S_t$ is the output of the last layer of stage $t$ and $T^{-1}_t$ is the inverse of transform $T_t$
A similar normalization step has been previously proposed in \cite{MIX} with the use of affine transforms. In our implementation we chose to use similarity transforms as they do not cause non-uniform scaling and skewing of the output image. Figure \ref{fig:afterStage1} shows examples of images before and after the transformation.
\subsection{Landmark heatmap} \label{sec:heatmap}
The landmark heatmap is an image where the intensity is highest in the locations of landmarks and it decreases with the distance to the closest landmark. Thanks to the use of landmark heatmaps the Convolutional Neural Network can infer the landmark locations estimated by the previous stage. In consequence DAN can perform face alignment based on entire facial images.
At the input to a DAN stage the landmark heatmap is created based on the landmark estimates produced by the previous stage and transformed to the canonical pose: $T_t(S_{t-1})$. The heatmap is generated using the following equation:
\begin{equation}
H(x,y)=\frac{1}{1 + \min_{s_i \in T_t(S_{t-1})} ||(x, y) - s_i||},
\end{equation}
where $H$ is the heatmap image and $s_i$ is the i-th landmark of $T_t(S_{t-1})$. In our implementation the heatmap values are only calculated in a circle of radius 16 around each landmark to improve performance. Note that similarly to normalization, this step is not necessary at the input of the first stage, since the input shape is always assumed to be $S_0$, which would result in an identical heatmap for any input.
An example of a face image and a corresponding landmark heatmap is shown in Figure \ref{fig:afterStage1}.
\subsection{Feature image layer} \label{sec:feature}
The feature image layer $F_t$ is an image created from a dense layer connected to the fc1 layer (see Table \ref{tab:feed-forward}) of the previous stage $t-1$. Such a connection allows any information learned by the preceding stage to be transferred to the consecutive stage. This naturally complements the heatmap which transfers the knowledge about landmark locations learned by the previous stage.
The feature image layer is a dense layer which has 3136 units with ReLU activations. The output of this dense layer is reshaped to a 56$\times$56 2D layer and upscaled to 112$\times$112, which is the input shape of DAN stages. We use the smaller 56$\times$56 image rather than 112$\times$112 since it showed similar results in our experiments, with considerably less parameters. Figure \ref{fig:afterStage1} shows an example of a feature image.
\subsection{Training procedure} \label{sec:training}
The stages of DAN are trained sequentially. The first stage is trained by itself until the validation error stops improving. Subsequently the connection layers and the second stage are added and trained. This procedure is repeated until further stages stop reducing the validation error.
While many face alignment methods \cite{ESR, SDM, LBF} learn a model that minimizes the Sum of Squared Errors of the landmark locations, DAN minimizes the landmark location error normalized by the distance between the pupils:
\begin{equation} \label{interpupil}
\min_{\Delta S_t} \frac{||T^{-1}_t(T_t(S_{t-1}) + \Delta S_t) - S^*||}{d_{ipd}},
\end{equation}
where $S^*$ is a vector of ground truth landmark locations, $T_t$ is the transform that normalizes the input image and shape for stage $t$ and $d_{ipd}$ is the distance between the pupils of $S^*$. The use of this error is motivated by the fact that it is a far more common \cite{SDM,LBF,CFSS} benchmark for face alignment methods than the Sum of Squared Errors.
Thanks to the fact that all of the layers used in DAN are differentiable DAN can also be trained end-to-end. In order to evaluate end-to-end training in DAN we have experimented with several approaches. Pre-training the first stage for several epochs followed by training of the entire network yielded similar accuracy to the proposed approach but the training was significantly longer. Training the entire network from scratch yielded results significantly inferior to the proposed approach.
While we did not manage to obtain improved results with end-to-end training we believe that it is possible with a better training strategy. We leave the creation of such a strategy for future work.
\section{Experiments} \label{experiments}
In this section we perform an extensive evaluation of the proposed method on several public datasets as well as the test set of the Menpo challenge \cite{Menpo} to which we have submitted our method. The following paragraphs detail the datasets, error measures and implementation. Section \ref{sec:comparison} compares our method with the state of the art, while section \ref{sec:menpo} shows our results in the Menpo challenge. Section \ref{sec:further} discusses the influence of the number of stages on the performance of DAN.
\paragraph*{Datasets}
In order to evaluate our method we perform experiments on the data released for the 300W competition \cite{300-W} and the recently introduced Menpo challenge \cite{Menpo} dataset.
The 300W competition data is a compilation of images from five datasets: LFPW \cite{LFPW}, HELEN \cite{HELEN}, AFW \cite{AFW}, IBUG \cite{300-W} and 300W private test set \cite{300-W}. The last dataset was originally used for evaluating competition entries and at that time was private to the organizers of the competition, hence the name. Each image in the dataset is annotated with 68 landmarks \cite{Reannotation} and accompanied by a bounding box generated by a face detector. We follow the most established approach \cite{LBF,CFSS,KRFWS,RAR} and divide the 300-W competition data into training and testing parts. The training part consists of the AFW dataset as well as training subsets of LFPW and HELEN, which results in a total of 3148 images. The test data consists of the remaining datasets: IBUG, 300W private test set, test sets of LFPW, HELEN. In order to facilitate comparison with previous methods we split this test data into four subsets:
\begin{itemize}
\item the \textit{common subset} which consists of the test subsets of LFPW and HELEN (554 images),
\item the \textit{challenging subset} which consists of the IBUG dataset (135 images),
\item the \textit{300W public test set} which consists of the test subsets of LFPW and HELEN as well as the IBUG dataset (689 images),
\item the \textit{300W private test set} (600 images).
\end{itemize}
The annotation for the images in the 300W public test set were originally published for the 300W competition as part of its training set. We use them for testing as it became a common practice to do so in the recent years \cite{LBF, CFSS, RAR, cGPRT, KRFWS}.
The Menpo challenge dataset consists of semi-frontal and profile face image datasets. In our experiments we only use the semi-frontal dataset. The dataset consists of training and testing subsets containing 6679 and 5335 images respectively. The training subset consists of images from the FDDB \cite{FDDB} and AFLW \cite{AFLW} datasets. The image were annotated with the same set of 68 landmarks as the 300W competition data but no face detector bounding boxes. The annotations of the test subset have not been released.
\paragraph*{Error measures}
Several measures of face alignment error for an individual face image have been recently introduced:
\begin{itemize}
\item the mean distance between the localized landmarks and the ground truth landmarks divided by the inter-ocular distance (the distance between the outer eye corners) \cite{CFSS, LBF, RAR},
\item the mean distance between the localized landmarks and the ground truth landmarks divided by the inter-pupil distance (the distance between the eye centers) \cite{MDM, 300-W},
\item the mean distance between the localized landmarks and the ground truth landmarks divided by the diagonal of the bounding box \cite{Menpo}.
\end{itemize}
In our work, we report our results using all of the above measures.
For evaluating our method on the test datasets we use three metrics: the mean error, the area under the cumulative error distribution curve (AUC$_\alpha$) and the failure rate.
Similarly to \cite{MIX, MDM}, we calculate AUC$_\alpha$ as the area under the cumulative distribution curve calculated up to a threshold $\alpha$, then divided by that threshold. As a result the range of the AUC$_\alpha$ values is always 0 to 1. Following \cite{MDM}, we consider each image with an inter-ocular normalized error of 0.08 or greater as failure and use the same threshold for AUC$_{0.08}$. In all the experiments we test on the full set of 68 landmarks.
\paragraph*{Implementation}
We train two models, DAN which is trained on the training subset of the 300W competition data and DAN-Menpo which is trained on both the above mentioned dataset and the Menpo challenge training set. Data augmentation is performed by mirroring around the Y axis as well as random translation, rotation and scaling, all sampled from normal distributions. During data augmentation a total of 10 images are created from each input image in the training set.
Both models (DAN and DAN-Menpo) consist of two stages. Training is performed using Theano 0.9.0 \cite{Theano} and Lasagne 0.2 \cite{Lasagne}. For optimization we use Adam stochastic optimization \cite{Adam} with an initial step size of 0.001 and mini batch size of 64. For validation we use a random subset of 100 images from the training set.
The Python implementation runs at 73 fps for images processed in parallel and at 45 fps for images processed sequentially on a GeForce GTX 1070 GPU. We believe that the processing speed can be further improved by optimizing the implementation of some of our custom layers, most notably the Image Transform layer.
To enable reproducible research, we release the source code of our implementation as well as the models used in the experiments\footnote{\url{https://github.com/MarekKowalski/DeepAlignmentNetwork}}. The published implementation also contains an example of face tracking with the proposed method.
\subsection{Comparison with state-of-the-art} \label{sec:comparison}
We compare the DAN model with state-of-the-art methods on all of the test sets of the 300W competition data. We also show results for the DAN-Menpo model but do not perform comparison since at the moment there are no published methods that use this dataset for training. For each test set we initialize our method using the face detector bounding boxes provided with the datasets.
Tables \ref{tab:public1} and \ref{tab:public2} show the mean error, AUC$_{0.08}$ and the failure rate of the proposed method and other methods on the \textit{300W public test set}. Table \ref{tab:private} shows the mean error, the AUC$_{0.08}$ and failure rate on the \textit{300W private test set}.
All of the experiments performed on the two most difficult test subsets (the \textit{challenging subset} and the \textit{300W private test set}) show state-of-the-art results, including:
\begin{itemize}
\item a failure rate reduction of 60\% on the \textit{300W private test set},
\item a failure rate reduction of 72\% on the \textit{300W public test set},
\item a 9\% improvement of the mean error on the \textit{challenging subset}.
\end{itemize}
This shows that the proposed DAN is particularly suited for handling difficult face images with a high degree of occlusion and variation in pose and illumination.
\begin{table}[tb]
\caption{Mean error of face alignment methods on the 300W public test set and its subsets. All values are shown as percentage of the normalization metric.} \label{tab:public1}
\begin{tabularx}{\linewidth}{ >{\centering\arraybackslash}X c c c c }
\Xhline{4\arrayrulewidth}
Method & \makecell{Common \\ subset} & \makecell{Challenging \\ subset} & Full set \\
\hline
\multicolumn{4}{c}{inter-pupil normalization} \\
\hline
ESR \cite{ESR} & 5.28 & 17.00 & 7.58\\
SDM \cite{SDM} & 5.60 & 15.40 & 7.52\\
LBF \cite{LBF} & 4.95 & 11.98 & 6.32\\
cGPRT \cite{cGPRT} & - & - & 5.71\\
CFSS \cite{CFSS} & 4.73 & 9.98 & 5.76\\
Kowalski et al. \cite{KRFWS} & 4.62 & 9.48 & 5.57\\
RAR \cite{RAR} & \textbf{4.12} & 8.35 & 4.94\\
\hline
\textbf{DAN} & 4.42& \textbf{7.57} & 5.03 & \\
\textbf{DAN-Menpo} & 4.29 & \textbf{7.05} & \textbf{4.83} & \\
\hline
\multicolumn{4}{c}{inter-ocular normalization} \\
\hline
MDM \cite{MDM} & - & - & 4.05\\
Kowalski et al. \cite{KRFWS} & 3.34 & 6.56 & 3.97\\
\hline
\textbf{DAN} & \textbf{3.19} & \textbf{5.24} & \textbf{3.59} & \\
\textbf{DAN-Menpo} & \textbf{3.09} & \textbf{4.88} & \textbf{3.44} & \\
\hline
\multicolumn{4}{c}{bounding box diagonal normalization} \\
\hline
\textbf{DAN} & \textbf{1.35} & \textbf{2.00} & \textbf{1.48} & \\
\textbf{DAN-Menpo} & \textbf{1.31} & \textbf{1.87} & \textbf{1.42} & \\
\Xhline{4\arrayrulewidth}
\end{tabularx}
\end{table}
\begin{table}[tb]
\caption{AUC and failure rate of face alignment methods on the 300W public test set. } \label{tab:public2}
\begin{tabularx}{\linewidth}{ >{\centering\arraybackslash}X c c c c }
\Xhline{4\arrayrulewidth}
Method & AUC$_{0.08}$ & Failure (\%) \\
\hline
\multicolumn{3}{c}{inter-ocular normalization} \\
\hline
ESR \cite{ESR} & 43.12 & 10.45\\
SDM \cite{SDM} & 42.94 & 10.89\\
CFSS \cite{CFSS} & 49.87 & 5.08\\
MDM \cite{MDM} & 52.12 & 4.21\\
\hline
\textbf{DAN} & \textbf{55.33} & \textbf{1.16} & \\
\textbf{DAN-Menpo} & \textbf{57.07} & \textbf{0.58} & \\
\Xhline{4\arrayrulewidth}
\end{tabularx}
\end{table}
\begin{table}[tb]
\caption{Results of face alignment methods on the 300W private test set. Mean error is shown as percentage of the inter-ocular distance.} \label{tab:private}
\begin{tabularx}{\linewidth}{ >{\centering\arraybackslash}X c c c c }
\Xhline{4\arrayrulewidth}
Method & Mean error & AUC$_{0.08}$ & Failure (\%) \\
\hline
\multicolumn{4}{c}{inter-ocular normalization} \\
\hline
ESR \cite{ESR} & - & 32.35 & 17.00\\
CFSS \cite{CFSS} & - & 39.81 & 12.30\\
MDM \cite{MDM} & 5.05 & 45.32 & 6.80\\
\hline
\textbf{DAN} & \textbf{4.30} & \textbf{47.00} & \textbf{2.67} & \\
\textbf{DAN-Menpo} & \textbf{3.97} & \textbf{50.84} & \textbf{1.83} & \\
\Xhline{4\arrayrulewidth}
\end{tabularx}
\end{table}
\begin{figure}[!htb]
\centering
\includegraphics[width=0.325\linewidth]{./ibug_imgs/121.jpg}
\includegraphics[width=0.325\linewidth]{./ibug_imgs/035.jpg}
\includegraphics[width=0.325\linewidth]{./ibug_imgs/011.jpg}
\includegraphics[width=0.325\linewidth]{./ibug_imgs/101.jpg}
\includegraphics[width=0.325\linewidth]{./ibug_imgs/045.jpg}
\includegraphics[width=0.325\linewidth]{./ibug_imgs/034.jpg}
\includegraphics[width=0.325\linewidth]{./ibug_imgs/041.jpg}
\includegraphics[width=0.325\linewidth]{./ibug_imgs/122.jpg}
\includegraphics[width=0.325\linewidth]{./ibug_imgs/127.jpg}
\caption{ The 9 \textit{worst} results on the challenging subset (IBUG dataset) in terms of inter-ocular error produced by the DAN model. Only the first 7 images have an error of more than 0.08 inter-ocular distance and can be considered failures. }
\label{fig:ibug_worst}
\end{figure}
\begin{figure*}[!htb]
\centering
\includegraphics[width=0.16\textwidth]{./menpo_examples/10670.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/11251.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/11914.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/12268.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/3398.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/5876.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/3456.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/6310.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/7218.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/7220.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/9385.png}
\includegraphics[width=0.16\textwidth]{./menpo_examples/9794.png}
\caption{ Results of our submission to the Menpo challenge on some of the difficult images of the Menpo test set. The blue squares denote the initialization bounding boxes. The images were cropped to better visualize the results, in the original images the bounding boxes are always located in the center. } \label{fig:menpo_examples}
\end{figure*}
\subsection{Results on the Menpo challenge test set} \label{sec:menpo}
In order to evaluate the proposed method on the Menpo challenge test dataset we have submitted our results to the challenge and received the error scores from the challenge organizers. The Menpo test data differs from the other datasets we used in that it does not include any bounding boxes which could be used to initialize face alignment. For that reason we have decided to use a two step face alignment procedure, where the first step serves as an initialization for the second step.
The first step performs face alignment using a square initialization bounding box placed in the middle of the image with a size set to a percentage of image height. The second step takes the result of the first step, transforms the landmarks and the image to the canonical face shape and creates a bounding box around the transformed landmarks. The transformed image and bounding box are used as input to face alignment. An inverse transform is later applied to get landmark coordinates for the original image.
In order to determine the optimal size of the bounding boxes in the first step we ran DAN on a small subset of the Menpo test set for several bounding box sizes. The optimal size was determined using a method that would estimate the face alignment error of a given set of landmarks and an image. Said method extracts HOG \cite{HOG} features at each of the landmarks and uses a linear model to estimate the error. The method was trained on the 300W training set using ridge regression. The chosen bounding box size was 46\% of the image height.
Figure \ref{fig:Menpo} and Table \ref{tab:Menpo} show the CED curve, mean error, $AUC_{0.03}$ and failure rate for the DAN-Menpo model on the Menpo test set. In all cases the errors are calculated using the diagonal of the bounding box normalization, used by the challenge organizers. For the AUC and the failure rate we have chosen a threshold of 0.03 of the bounding box diagonal as it is approximately equivalent to 0.08 of the interocular distance used in the previous chapter.
Figure \ref{fig:menpo_examples} shows examples of images from the Menpo test set and corresponding results produced by our method. Note that even though DAN was trained primarily on semi-frontal images it can handle fully profile images as well.
\begin{figure}[!htb]
\centering
\includegraphics[width=\linewidth]{./ced/ced.png}
\caption{The Cumulative Error Distribution curve for the DAN-Menpo model on the Menpo test set. The Point-to-Point error is shown as percentage of the bounding box diagonal.}
\label{fig:Menpo}
\end{figure}
\begin{table}[tb]
\caption{Results of the proposed method on the semi-frontal subset of the Menpo test set. Mean error is shown as percentage of the bounding box diagonal.} \label{tab:Menpo}
\begin{tabularx}{\linewidth}{ >{\centering\arraybackslash}X c c c c }
\Xhline{4\arrayrulewidth}
Method & Mean error & AUC$_{0.03}$ & Failure (\%) \\
\hline
\multicolumn{4}{c}{bounding box diagonal normalization} \\
\hline
\textbf{DAN-Menpo} & \textbf{1.38} & \textbf{56.20} & \textbf{1.74} & \\
\Xhline{4\arrayrulewidth}
\end{tabularx}
\end{table}
\subsection{Further evaluation} \label{sec:further}
In this subsection we evaluate several DAN models with a varying number of stages on the 300W private test set. All of the models were trained identically to the DAN model from section \ref{sec:comparison}.
Table \ref{tab:stage_number} shows the results of our evaluation. The addition of the second stage increases the AUC$_{0.08}$ by 20\% while the mean error and failure rate are reduced by 14\% and 56\% respectively. The addition of a third stage does not bring significant benefit in any of the metrics.
\begin{table}[tb]
\caption{Results of the proposed method with a varying number of stages on the 300W private test set. Mean error is shown as percentage of the inter-ocular distance.} \label{tab:stage_number}
\begin{tabularx}{\linewidth}{ >{\centering\arraybackslash}X c c c c }
\Xhline{4\arrayrulewidth}
\# of stages & Mean error & AUC$_{0.08}$ & Failure (\%) \\
\hline
\multicolumn{4}{c}{inter-ocular normalization} \\
\hline
1 & 5.02 & 39.04 & 6.17 & \\
2 & 4.30 & 47.00 & 2.67 & \\
3 & 4.32 & 47.08 & 2.67 & \\
\Xhline{4\arrayrulewidth}
\end{tabularx}
\end{table}
\section{Conclusions}
In this paper, we introduced the Deep Alignment Network - a robust face alignment method based on convolutional neural networks. Contrary to the recently proposed face alignment methods, DAN performs face alignment based on entire face images, which makes it highly robust to large variations in both initialization and head pose. Using entire face images instead of local patches extracted around landmarks is possible thanks to the use of novel landmark heatmaps which transmit the information about landmark locations between DAN stages. Extensive evaluation performed on two challenging, publicly available datasets shows that the proposed method improves the state-of-the-art failure rate by a significant margin of over 70\%.
Future research includes investigation of new strategies for training DAN in an end-to-end manner. We also plan to introduce learning into the estimation of the transform $T_t$ that normalizes the shapes and images between stages.
\section{Acknowledgements}
The work presented in this article was supported by The National Centre for Research and Development grant number DOB-BIO7/18/02/2015. The results obtained in this work were a basis for developing the software for the grant sponsor, which is different from the software published with this paper.
We thank NVIDIA for donating a Titan X Pascal GPU which was used to train the proposed neural network.
{\small
\bibliographystyle{ieee}
| {'timestamp': '2017-08-11T02:03:44', 'yymm': '1706', 'arxiv_id': '1706.01789', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01789'} | arxiv |
\section{Introduction}\label{sec:intro}
The explosive growth of mobile traffic demand is the driving force
behind the development of signal processing and communication technologies to
significantly upgrade the high-end experiences of
communication such as high throughput, high reliability, and ubiquitous access.
It is widely believed that interference-limited techniques such as
coordinated multipoint transmission (CoMP) \cite{GH10,JYH12}, which treat interference as noise
cannot meet the edge throughput requirements for 5G \cite{Anetal14}. Dirty-paper coding (DPC) \cite{WeingartenIT06}, under which the interference is successively mitigated, can improve both the edge and sum throughput but is difficult to implement in practice and remains only as a theoretical concept due to its high computational complexity. Nonorthogonal multiple access (NOMA)
has been recently recognized as an essential enabling technology for 5G systems \cite{DingMag16} due to its potential
to improve the edge throughput \cite{Saietal13}.
In NOMA, a base station (BS) transmits a signal superposition to all users. The users are paired so that
in each pair there is one with a better channel condition and another with a poorer channel condition \cite{Benjebbour14}.
The messages intended for each pair of users are sequentially decoded as follows. First,
the message for the user with the poorer channel condition is decoded by
both users. The message for the user with the better channel condition is then successively decoded
by this user after canceling the interference from the other user \cite{DingTVT15}. Thus, while the throughput
at the users with poorer channel condition remains the same as that in interference-limited techniques, the throughput
at the users with better channel condition is clearly improved, leading to a higher system throughput.
Multi-input multi-output (MIMO) is widely known for its enormous potential in improving the capacity of wireless communication systems without requiring extra bandwidth or power. NOMA for MIMO communication
(MIMO-NOMA) in single-cell systems for achieving higher throughput has been investigated in \cite{DingTWC16,DSP16}, and an extension to multi-cell cases has been considered in \cite{ShinComL16}. In multi-cell systems, the effects of inter-cell interference are acute and unpredictable, limiting the quality-of-service (QoS) for cell-edge users. It is therefore challenging to realize the benefit that NOMA may bring to multi-cell systems.
\subsection{Related Works}
In this subsection we discuss the state-of-the-art of signal processing techniques
for NOMA downlink transmission. NOMA was mostly studied for single-cell
multi-input single-output (MISO) systems known as MISO-NOMA, where the multiple-antenna BS
broadcasts signal superpositions to single-antenna users. Under the assumption on low QoS requirement for
the near user (with a good channel condition) and high QoS requirement for the far user (with a poor channel condition) in
a two-user MISO-NOMA, \cite{Choi15} proposed a heuristic computational procedure with neither convergence nor
optimality guaranteed for the beamforming power minimization. Under
similar users' QoS requirements in a $2K$-user MISO-NOMA, it used a particular zero-forcing beamformer
to cancel the inter-pair interference, so the problem of $2K$-user MISO-NOMA beamforming is decomposed
into $K$ independent subproblems of two-user MISO-NOMA beamforming. A closed-form solution
for minimization of beamforming power in two-user MISO-NOMA subject to natural users' QoS requirements
was obtained in \cite{ChenCL16,ChenTSP16,ChenAC16}. In \cite{HDRK16}, users performed
successive interference cancellation (SIC) based on the channel gain differences.
Its proposed algorithm for beamforming is of high computational complexity.
Regarding MIMO-NOMA, \cite{DingTWC16} and \cite{DSP16} derived the outage probability experienced
by users in zero-forcing postcoding or signal alignment. Power allocation for achieving the ergodic capacity of
two-user MIMO NOMA was considered in \cite{SunWCL15} and \cite{ChoiTWC16}.
User-pairing to enhance the throughput of users of poor channel condition was proposed in \cite{LuiCL16}.
\cite{ShinComL16} proposed two interference alignment based coordinated beamforming
for a two-cell MIMO-NOMA, where the interference at all cell-center users and edge-center users is canceled.
\subsection{Motivation and Contributions }
The paper considers the problem of designing linear precoders/beamformers at the BSs for MIMO-NOMA multi-cell systems
to maximize their sum throughput while simultaneously meeting the users' QoS requirements.
In general, such a design problem is very complicated as
the objective function is nonlinear and nonsmooth, and the QoS constraints are highly nonconvex, for which
even finding a feasible point is already challenging.
The main contributions of the paper are three-fold:
\begin{itemize}
\item For MIMO-NOMA, two path-following optimization algorithms are proposed for computation, which
at least converge to a locally optimal solution.
At each iteration, the first algorithm invokes a convex quadratic program while the second
algorithm invokes a semi-definite program (SDP). Both these convex programs are of moderate dimension so
their computation is very efficient.
\item Another path-following algorithm tailored for MISO-NOMA is proposed, which explores much simpler structures of
the throughput functions in MISO systems for more efficient computation.
\item The provided numerical results show the essential performance improvements of NOMA based systems compared to
the conventional systems. The capability of NOMA to improve both edge and sum throughput is revealed.
\end{itemize}
\subsection{ Paper Organization and Notation}
The rest of the paper is organized as follows. Section~\ref{sec:sys_model} presents the system model and formulates the problem. A convex quadratic programming based path-following algorithm for the MIMO-NOMA problem is developed in Section~\ref{sec:CQBI}, while another
SDP based path-following algorithm is developed in Section~\ref{SDPBI}. Section~\ref{sec:TL} devotes to computation for MISO-NOMA problem. Numerical results are provided in Section~\ref{sec:simulation}, and Section~\ref{sec:conclusion} concludes the paper.
\textit{Notation.} Bold-faced upper-case letters are used for matrices, bold-faced lower-case letters
are used for vectors, and lower-case letters are used for for scalars.
$\mathbf{I}_n$ is the identity matrix of size $n\times n$.
$\mathbf{X}^{H}$, $\mathbf{X}^{T}$, and $\mathbf{X}^{*}$ are the Hermitian transpose, normal transpose, and conjugate of a matrix $\mathbf{X}$, respectively. The inner product $\langle{\mathbf{X}, \mathbf{Y}}\rangle$ of matrices $\mathbf{X}$ and $\mathbf{Y}$
is defined as $\textrm{trace}(\mathbf{X}^H \mathbf{Y})$. Denote by $\langle \mathbf{A}\rangle$ the trace of a matrix $\mathbf{A}$, and by $|\mathbf{A}|$ its determinant. $\|\cdot\|$ stands for matrix's Frobenius norm
or vector's Euclidean norm.
For Hermitian symmetric matrices $\mathbf{A}\succeq \mathbf{0}$ ($\mathbf{A}\succ \mathbf{0}$, resp.) means that
$\mathbf{A}$ is a positive semidefinite (positive definite, resp.) matrix. Accordingly
$\mathbf{A} \succeq \mathbf{B}$ ($\mathbf{A} \succ \mathbf{B}$, resp.) means
$\mathbf{A}-\mathbf{B}\succeq \mathbf{0}$ ($\mathbf{A}-\mathbf{B}\succ \mathbf{0}$, resp.).
$\mathbb{C}$ is the set of all complex numbers, and $\emptyset$ is an empty set. $\Re\{x\}$ denotes the real part of a complex number $x$. $\mathbf{x}\sim\mathcal{CN}(\boldsymbol{\eta},\boldsymbol{Z})$ means that $\mathbf{x}$ is a random vector following a complex circular Gaussian distribution with mean $\boldsymbol{\eta}$ and covariance matrix $\boldsymbol{Z}$. $\nabla_{\mathbf{x}}f(\mathbf{x})$ is the gradient of function $f(\cdot)$ with respect to its variable $\mathbf{x}$. $\mathbb{E}\{\cdot\}$ denotes the expectation operator.
\section{System Model and Problem Formulation}\label{sec:sys_model}
This section presents a system model for signal superposition in MIMO-NOMA multi-cell systems
and formulates an optimization problem for the precoder design. Relations
to CoMP and DPC are also briefly clarified.
\subsection{Signal Processing Model}
\begin{figure}[t]
\centering
\includegraphics[width=0.6\textwidth,trim={0.5cm 0.0cm -4.5cm -0.0cm}]{Systemmodel.eps}
\caption{An illustration of the cell of interest in a NOMA system serving $2K$ users.}
\label{fig:SM:1}
\end{figure}
Consider a downlink system consisting of $N$ cells, where
the BS of each cell is equipped with $N_t$ antennas to serve $2K$ users
(UEs) within its cell as illustrated in Fig.~\ref{fig:SM:1}. Each UE is equipped with $N_r$ antennas. In each cell, there are $K$ near UEs
(cell-center UEs), which are located inside the circular area with radius $r_n$ and the BS at its center,
and $K$ far UEs (cell-edge UEs), which are located within the ring area with inner radius $r_n$ and
outer radius $r_o$. $K$ far UEs in each cell are not only in poorer
channel conditions than other $K$ near UEs but also are under
more intensified inter-cell interference from adjacent cells.
Upon denoting $\mathcal{I} \triangleq \{1, 2, \cdots, N\}$ and $\mathcal{J} \triangleq \{1, 2, \cdots, 2K\}$,
the $j$-th UE in the $i$-th cell is referred to as UE $(i,j)\in \mathcal{S}\triangleq \mathcal{I}\times\mathcal{J}$.
The cell-center UEs are UE $(i,j)$, $j\in\mathcal{K}_1\triangleq\{1,\cdots, K\}$ while the cell-edge UEs are
UE $(i,j)$, $j\in\mathcal{K}_2\triangleq\{K+1,\cdots, 2K\}$. Thus the set of cell-center UEs and the set of cell-edge UEs
are $\mathcal{S}_1\triangleq \mathcal{I}\times \mathcal{K}_1$ and $\mathcal{S}_2\triangleq \mathcal{I}\times \mathcal{K}_2$,
respectively. In NOMA each
cell-center UE $(i,j)\in\mathcal{S}_1$ is randomly paired with cell-edge UE $(i,p(j))\in \mathcal{S}_2$ of the same cell to create
a virtual cluster.\footnote{Using more sophisticated user-pairing strategies may improve the performance of MIMO-NOMA networks (see e.g. \cite{DingTVT15,LuiCL16}) but it is beyond the scope of this paper.} The signal superpositions are precoded at the BSs prior to being transmitted to the UEs. Specifically, the message intended for UE $(i,j)$ is
$\mathbf{s}_{i,j} \in \mathbb{C}^L$ with $\mathbb{E}\{\mathbf{s}_{i,j}(\mathbf{s}_{i,j})^H\}=\mathbf{I}_L$, which
is precoded by
matrix $\mathbf{V}_{i,j}\in \mathbb{C}^{N_t\times L}$, where $L$ is the number of concurrent data streams and $L \leq \min\{N_t,N_r\}$.
For notational convenience, let us define
$\mathbf{V} \triangleq [\mathbf{V}_{i,j}]_{(i,j)\in\mathcal{S}}$. The received signals at UE $(i,j)$ and UE $(i,p(j))$ are expressed as
\begin{IEEEeqnarray}{rCl}
\mathbf{y}_{i,j} &=& \mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\mathbf{s}_{i,j}+\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)}\mathbf{s}_{i,p(j)} \nonumber\\
& & + \displaystyle\sum_{(s,l)\in {\cal S}\setminus \{(i,j), (i,p(j)) \}} \mathbf{H}_{s,i,j}\mathbf{V}_{s,l} \mathbf{s}_{s,l} + \mathbf{n}_{i,j},\label{eq:yij}
\end{IEEEeqnarray}
and
\begin{IEEEeqnarray}{rCl}
&& \mathbf{y}_{i,p(j)} = \mathbf{H}_{i,i,p(j)}\mathbf{V}_{i,p(j)}\mathbf{s}_{i,p(j)}+\mathbf{H}_{i,i,p(j)}\mathbf{V}_{i,j}\mathbf{s}_{i,j}\nonumber\\
&&\qquad + \displaystyle\sum_{(s,l)\in {\cal S}\setminus \{(i,j), (i,p(j)) \}} \mathbf{H}_{s,i,p(j)}\mathbf{V}_{s,l} \mathbf{s}_{s,l} + \mathbf{n}_{i,p(j)}\quad\label{eq:yipj}
\end{IEEEeqnarray}
where $\mathbf{H}_{s,i,j} \in\mathbb{C}^{N_r \times N_t}$ is the MIMO channel from the BS $s\in\mathcal{I}$ to UE $(i,j)\in\mathcal{S}$. The entries of the additive noise $\mathbf{n}_{i,j}\in\mathbb{C}^{N_r}$ are independent and identically
distributed (i.i.d.) noise samples with zero mean and variance $\sigma^2$.
The covariances of $\mathbf{y}_{i,j}$ and $\mathbf{y}_{i,p(j)}$ are thus
\begin{equation}\label{eqLMij}
{\mathbf{\mathcal{ M}}}_{i,j}(\mathbf{V})= \displaystyle\sum_{(s,l)\in{\cal S}}\mathbf{H}_{s,i,j}\mathbf{V}_{s,l}\mathbf{V}_{s,l}^H \mathbf{H}_{s,i,j}^H + \sigma^2\mathbf{I}_{N_r},
\end{equation}
and
\begin{equation}\label{eqLMipj}
{\mathbf{\mathcal{ M}}}_{i,p(j)}(\mathbf{V})= \displaystyle\sum_{(s,l)\in{\cal S}}\mathbf{H}_{s,i,p(j)}\mathbf{V}_{s,l}\mathbf{V}_{s,l}^H \mathbf{H}_{s,i,p(j)}^H + \sigma^2\mathbf{I}_{N_r}.
\end{equation}
The purpose of the paper is to design complex-valued precoding matrices $\mathbf{V}_{i,j}$ to maximize the overall
spectral efficiency under a given pairing for NOMA. The MIMO channel states $\mathbf{H}_{s,i,j}$
are assumed unchanged during message transmission but may change independently from one message to another
and are perfectly known at all nodes \cite{Choi15,HDRK16,DSP16}.
\subsection{Problem Formulation}
In NOMA, the message $\mathbf{s}_{i,p(j)}$ intended for the cell-edge UE $(i,p(j))$ is decoded by both UE $(i, p(j))$ and
UE $(i,j)$. Then message $\mathbf{s}_{i,j}$ intended for the cell-center UE $(i,j)$ is decoded by itself only.
The cell-edge UE $(i,p(j))$ decodes its own message $\mathbf{s}_{i,p(j)}$ with the achievable rate
\begin{IEEEeqnarray}{rCl}\label{eq:Rijj}
&& {\cal R}_{i,p(j)}^{p(j)}(\mathbf{V}) = \ln\Bigl| \mathbf{I}_L + \nonumber\\
&&\quad (\mathbf{V}_{i,p(j)})^H\mathbf{H}_{i,i,p(j)}^H
{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V})^{-1}\mathbf{H}_{i,i,p(j)}\mathbf{V}_{i, p(j)} \Bigl| \qquad
\end{IEEEeqnarray}
where ${\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V})$ is defined by
\begin{IEEEeqnarray}{rCl}\label{eq:Mij}
&&{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V}) \nonumber\\
&&\ \triangleq {\mathbf{\mathcal{ M}}}_{i,p(j)}(\mathbf{V}) - \mathbf{H}_{i,i,p(j)}\mathbf{V}_{i,p(j)}(\mathbf{V}_{i,p(j)})^H\mathbf{H}_{i,i,p(j)}^H \nonumber\\
&&\ =\displaystyle\sum_{(s,l)\in{\cal S}\setminus\{(i,p(j)) \}}\mathbf{H}_{s,i,p(j)}\mathbf{V}_{s,l}\mathbf{V}_{s,l}^H \mathbf{H}_{s,i,p(j)}^H + \sigma^2\mathbf{I}_{N_r}.\quad\,
\end{IEEEeqnarray}
On the other hand, the cell-center UE $(i,j)$ decodes the message $\mathbf{s}_{i,p(j)}$ with the achievable rate
\begin{IEEEeqnarray}{rCl}\label{eq:Rijpj}
&&{\cal R}_{i,p(j)}^j(\mathbf{V}) = \nonumber\\
&&\ \; \ln\Bigl|\mathbf{I}_L + (\mathbf{V}_{i,p(j)})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V})^{-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)}\Bigl|\quad
\end{IEEEeqnarray}
where
\begin{IEEEeqnarray}{rCl}\label{eq:Mijpj}
&&{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}) \triangleq {\mathbf{\mathcal{ M}}}_{i,j}(\mathbf{V}) - \mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)}(\mathbf{V}_{i,p(j)})^H\mathbf{H}_{i,i,j}^H\quad\nonumber\\
&&\qquad=\displaystyle\ds\sum_{(s,l)\in{\cal S}\setminus\{(i,p(j))\}}\mathbf{H}_{s,i,j}\mathbf{V}_{s,l}\mathbf{V}_{s,l}^H \mathbf{H}_{s,i,j}^H + \sigma^2\mathbf{I}_{N_r}.
\end{IEEEeqnarray}
Hence, the throughput by decoding the message $\mathbf{s}_{i,p(j)}$ by UEs $(i,p(j))$ and $(i,j)$ is
\begin{equation}\label{noma1}
{\cal R}_{i,p(j)}=\min \Bigl\{{\cal R}^{j}_{i,p(j)}(\mathbf{V}), {\cal R}^{p(j)}_{i,p(j)}(\mathbf{V})\Bigr\}.
\end{equation}
Next, the throughput by decoding the message $\mathbf{s}_{i,j}$
by the cell-center UE $(i,j)$ after decoding the message $\mathbf{s}_{i,p(j)}$ is
\begin{equation}\label{noma2}
{\cal R}_{i,j}(\mathbf{V}) = \ln\Bigl| \mathbf{I}_L + (\mathbf{V}_{i,j})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V})^{-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i,j} \Bigl|
\end{equation}
where
\begin{IEEEeqnarray}{rCl}\label{eq:Mipjpj}
&& {\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V}) \triangleq {\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}) - \mathbf{H}_{i,i,j}\mathbf{V}_{i,j}(\mathbf{V}_{i,j})^H\mathbf{H}_{i,i,j}^H \nonumber\qquad\quad\\
&& =\displaystyle\ds\sum_{(s,l)\in{\cal S}\setminus\{(i,p(j)),(i,j)\}}\mathbf{H}_{s,i,j}\mathbf{V}_{s,l}\mathbf{V}_{s,l}^H \mathbf{H}_{s,i,j}^H + \sigma^2\mathbf{I}_{N_r}.
\end{IEEEeqnarray}
Our goal is to maximize the total sum throughput of the system under QoS for each individual UE and
power budget at each BS, which is mathematically formulated as
\begin{IEEEeqnarray}{rCl}\label{Rmtgor}
&&\underset{\mathbf{V}}{{\mathrm{maximize}}}\; \mathcal{P}(\mathbf{V})\triangleq\sum_{i=1}^N\sum_{j=1}^K\Bigl({\cal R}_{i,j}(\mathbf{V})+{\cal R}_{i,p(j)}(\mathbf{V})\Bigr)\qquad \IEEEyessubnumber\label{Rmtgora}\\
&&{\mathrm{subject\ to}}\; {\cal R}_{i,j}(\mathbf{V}) \geq r_{i,j},\ \forall i \in\mathcal{I},\ \forall j\in\mathcal{K}_1, \IEEEyessubnumber\label{Rmtgorb}\\
&&\qquad\qquad\; {\cal R}_{i,p(j)}(\mathbf{V}) \geq r_{i,p(j)},\, \forall i \in\mathcal{I},\, \forall j\in\mathcal{K}_2, \IEEEyessubnumber\label{Rmtgorc}\\
&&\qquad\qquad\; \sum_{j\in {\cal J}} \Bigl\langle \mathbf{V}_{i,j}\mathbf{V}_{i,j}^H \Bigl\rangle \le P^{\max}_{i},\ \forall i \in\mathcal{I}\IEEEyessubnumber\label{Rmtgord}
\end{IEEEeqnarray}
where $P^{\max}_i$ in \eqref{Rmtgord} is the transmit power budget of BS $i$. The QoS constraints
\eqref{Rmtgorc} and \eqref{Rmtgord} set a minimum throughput requirement $r_{i,j}$ at the UE $(i,j)$ and $r_{i,p(j)}$ at the UE $(i,p(j))$.
\subsection{Relations to CoMP and DPC}
In CoMP \cite{GH10,JYH12}, the problem of maximizing the sum throughput under QoS constraints is formulated as \cite{TTN16}
\begin{IEEEeqnarray}{rCl}\label{CoMPobj}
&&\underset{\mathbf{V}}{{\mathrm{maximize}}}\;\ \mathcal{P}^{\mathrm{CoMP}}(\mathbf{V})\triangleq\sum_{i=1}^N\sum_{j=1}^{2K}{\cal R}_{i,j}^{'}(\mathbf{V})\IEEEyessubnumber\label{CoMPa}\\
&&{\mathrm{subject\ to}}\;\ {\cal R}_{i,j}^{'}(\mathbf{V}) \geq r_{i,j},\ \forall i \in\mathcal{I},\ \forall j\in\mathcal{J}, \IEEEyessubnumber\label{CoMPb}\qquad\\
&&\qquad\qquad\quad \sum_{j\in {\cal J}} \Bigl\langle \mathbf{V}_{i,j}\mathbf{V}_{i,j}^H \Bigl\rangle \le P^{\max}_{i},\ \forall i \in\mathcal{I}\IEEEyessubnumber\label{CoMPc}
\end{IEEEeqnarray}
where ${\cal R}_{i,j}^{'}(\mathbf{V})$ is given by
\begin{equation}\label{eq:Rij:CoMP}
{\cal R}_{i,j}^{'}(\mathbf{V}) = \ln\Bigl|\mathbf{I}_L + (\mathbf{V}_{i,j})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{j}(\mathbf{V})^{-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\Bigl|
\end{equation}
with
\begin{equation}
\begin{array}{lll}
{\mathbf{\mathcal{ M}}}_{i,j}^{j}(\mathbf{V}) \triangleq \displaystyle\ds\sum_{(s,l)\in{\cal S}\setminus\{(i,j)\}}\mathbf{H}_{s,i,j}\mathbf{V}_{s,l}\mathbf{V}_{s,l}^H \mathbf{H}_{s,i,j}^H + \sigma^2\mathbf{I}_{N_r}.
\end{array}
\end{equation}
Compared ${\cal R}_{i,j}^{'}(\mathbf{V})$ defined by $(\ref{eq:Rij:CoMP})$ to
${\cal R}_{i,p(j)}(\mathbf{V})$ and ${\cal R}_{i,j}(\mathbf{V})$ defined by (\ref{noma1}) and (\ref{noma2}) one can see that
\begin{IEEEeqnarray}{rCl}
{\cal R}_{i,p(j)}^{'}(\mathbf{V})&=&{\cal R}^{p(j)}_{i,p(j)}(\mathbf{V})\label{com1}\\
&\geq&\min \Bigl\{{\cal R}^{j}_{i,p(j)}(\mathbf{V}), {\cal R}^{p(j)}_{i,p(j)}(\mathbf{V})\Bigr\}\label{com2}\\
&=& {\cal R}_{i,p(j)},\ \forall j\in\mathcal{K}_2,\label{com3}
\end{IEEEeqnarray}
and
\begin{equation}
{\cal R}_{i,j}^{'}(\mathbf{V})\leq {\cal R}_{i,j}(\mathbf{V}),\ \forall j\in\mathcal{K}_1,\label{com4}
\end{equation}
i.e., under the same precoder $\mathbf{V}$, the throughput at cell-edge UEs is higher with CoMP while
that at cell-center UEs is higher with NOMA. Thus, under the same precoder, NOMA does not need to perform better
than CoMP in terms of the total throughput. The preference of NOMA now critically depends on its performance at its
optimal precoder, which is sought in the next sections.
On the other hand, DPC at the BS $i$ with encoding order from UE $(i,2K)$ to UE $(i,1)$
enables UE $(i,j)$ view the massages intended for UEs $(i,j')$, $j'>j$ as non-causually known and
thus cancel them from its received signal.
Hence, the throughput by decoding the message $\mathbf{s}_{i,j}$ for UE $(i,j)$ is defined by
\begin{equation}\label{DPC1}
{\cal R}_{i,j}^{''}(\mathbf{V}) = \ln\Bigl|\mathbf{I}_L + (\mathbf{V}_{i,j})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{i}(\mathbf{V})^{-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i,j} \Bigl|
\end{equation}
where
\begin{IEEEeqnarray}{rCl}\label{eq:DPC2}
{\mathbf{\mathcal{ M}}}_{i,j}^{i}(\mathbf{V}) &\triangleq& \displaystyle\ds\sum_{s \neq i}^{N}\sum_{l = 1}^{2K}\mathbf{H}_{s,i,j}\mathbf{V}_{s,l}\mathbf{V}_{s,l}^H \mathbf{H}_{s,i,j}^H \nonumber\\
&+&\; \sum_{k=1}^{j-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i,k}\mathbf{V}_{i,k}^H\mathbf{H}_{i,i,j}^H + \sigma^2\mathbf{I}_{N_r}.\quad
\end{IEEEeqnarray}
The problem of maximizing the sum throughput under QoS constraints is formulated as
\begin{IEEEeqnarray}{rCl}\label{DPCobj}
&&\underset{\mathbf{V}}{{\mathrm{maximize}}}\;\ \mathcal{P}^{\mathrm{DPC}}(\mathbf{V})\triangleq\sum_{i=1}^N\sum_{j=1}^{2K}{\cal R}_{i,j}^{''}(\mathbf{V})\IEEEyessubnumber\label{DPCa}\\
&&{\mathrm{subject\ to}}\;\ {\cal R}_{i,j}^{''}(\mathbf{V}) \geq r_{i,j},\ \forall i \in\mathcal{I},\ \forall j\in\mathcal{J}, \IEEEyessubnumber\label{DPCb}\qquad\\
&&\qquad\qquad\quad \sum_{j\in {\cal J}} \Bigl\langle \mathbf{V}_{i,j}\mathbf{V}_{i,j}^H \Bigl\rangle \le P^{\max}_{i},\ \forall i \in\mathcal{I}.\IEEEyessubnumber\label{DPCc}
\end{IEEEeqnarray}
Apparently, under DPC the intra-cell interference from UEs of better channel
condition is canceled in decoding the messages intended for UEs of poorer channel condition resulting in much better
edge throughput compared with CoMP. NOMA is advantageous over DPC in terms of ease of implementation.
By increasing the QoSs' requirement in
(\ref{Rmtgorb}), (\ref{CoMPb}) and (\ref{DPCb}), we will see that the NOMA's sum throughput is fully superior over CoMP's one and catches up DPC's one.
\section{Convex Quadratic Based Iterations}\label{sec:CQBI}
Note that the QoS constraints \eqref{Rmtgorb} and \eqref{Rmtgorc} in \eqref{Rmtgor},
and \eqref{CoMPb} in \eqref{CoMPobj} are set beforehand, which are dependent on the UEs' throughput requirements but
independent on their channel condition. In maximizing the sum throughput objective \eqref{CoMPa}, most of CoMP techniques
(see e.g. \cite{CACC08}) are unable to address the QoS constraints \eqref{CoMPb}. Without setting such QoS constraints,
the UEs of poor channel condition are easily disconnected from the service because
it is well known that almost all of transmit power will be
allocated to a very few UEs of the best channel conditions in maximizing the sum throughput, causing almost zero throughput at other UEs. The weighted sum throughput maximization is only an ad hoc way to
balance the UEs' throughput. Alternatively, the throughput satisfaction can be effectively handled via maximizing the
users' worst throughput but the latter involves optimization of a nonsmooth objective function, for which these techniques are powerless. Both QoS constrained sum throughput maximization problem \eqref{CoMPobj} and UEs' worst throughput maximization
problem could be addressed very recently in \cite{TTN16}.
Although the optimization problem \eqref{Rmtgor} is different from \eqref{CoMPobj} and \eqref{DPCobj}, all functions appearing in the former
have a similar structure to that appearing in the latter. Therefore, a systematic approach to solve the latter is expected
to be applicable to the former. In this section, we adopt the approach of \cite{TTN16} to address \eqref{Rmtgor}. Unlike
\cite{Cetal15}, which aims at expressing the nonsmooth function ${\cal R}_{i,p(j)}(\mathbf{V})$ in \eqref{noma1} and then
the nonsmooth objective function in \eqref{Rmtgorb} as d.c. (\underline{d}ifference of two \underline{c}onvex functions)
by using the universality of d.c. functions \cite{Tuybook} and leads to d.c. iterations \cite{KTN12} of high computational complexity, we will see now that each below iteration invokes only a simple convex quadratic
program of low computational complexity.
Suppose that $\mathbf{V}^{(\kappa)}\triangleq [\mathbf{V}^{(\kappa)}_{i,j}]_{(i,j)\in\mathcal{S}}$ is a feasible
point found at the $(\kappa-1)$-th iteration. Define the following
quadratic functions in $\mathbf{V}$:
\begin{IEEEeqnarray}{rCl}
&&{\cal R}^{j,(\kappa)}_{i,p(j)}(\mathbf{V})
\triangleq a_{i,p(j)}^{j,(\kappa)}+2\Re\Bigl\{\bigl\langle{\cal A}_{i,p(j)}^{j,(\kappa)},\mathbf{V}_{i,p(j)}\bigl\rangle
\Bigl\}\nonumber\\
&&\quad -\,\Bigl\langle{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}-{\mathbf{\mathcal{ M}}}_{i,j}(\mathbf{V}^{(\kappa)})^{-1},{\mathbf{\mathcal{ M}}}_{i,j}(\mathbf{V})\Bigl\rangle,
\nonumber\\
&&{\cal R}^{p(j),(\kappa)}_{i,p(j)}(\mathbf{V}) \triangleq
a_{i,p(j)}^{p(j),(\kappa)}
+2\Re\Bigl\{\bigl\langle {\cal A}_{i, p(j)}^{p(j),(\kappa)},\mathbf{V}_{i, p(j)}\bigl\rangle
\Bigl\}\nonumber\\
&&\quad-\,\Bigl\langle {\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}-{\mathbf{\mathcal{ M}}}_{i,p(j)}(\mathbf{V}^{(\kappa)})^{-1},
{\mathbf{\mathcal{ M}}}_{i,p(j)}(\mathbf{V})\Bigl\rangle,\label{eq:qdt} \nonumber \\
&&{\cal R}^{(\kappa)}_{i,j}(\mathbf{V}) \triangleq a_{i,j}^{(\kappa)}
+2\Re\Bigl\{\bigl\langle{\cal A}_{i,j}^{(\kappa)},\mathbf{V}_{i,j}\bigl\rangle\Bigl\}\nonumber \\
&&\quad-\,\Bigl\langle {\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V}^{(\kappa)})^{-1}-{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1},
{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V})\Bigl\rangle
\end{IEEEeqnarray}
where $a_{i,p(j)}^{j,(\kappa)}$, $a_{i,p(j)}^{p(j),(\kappa)}$, $a_{i,j}^{(\kappa)}$ are given as
\begin{IEEEeqnarray}{rCl}
a_{i,p(j)}^{j,(\kappa)} &\triangleq& {\cal R}^{j}_{i,p(j)}(\mathbf{V}^{(\kappa)}) - \Bigl\langle (\mathbf{V}_{i,p(j)}^{(\kappa)})^H \mathbf{H}_{i,i,j}^H\nonumber\\
&&\quad \times{\mathbf{\mathcal{ M}}}_{i,j}(\mathbf{V}^{(\kappa)})^{-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)}^{(\kappa)}\Bigl\rangle\, < 0,\nonumber\\
a_{i,p(j)}^{p(j),(\kappa)} &\triangleq& {\cal R}^{p(j)}_{i,p(j)}(\mathbf{V}^{(\kappa)}) - \Bigl\langle(\mathbf{V}_{i,p(j)}^{(\kappa)})^H\mathbf{H}_{i,i,p(j)}^H \nonumber\\
&&\quad \times {\mathbf{\mathcal{ M}}}_{i,p(j)}(\mathbf{V}^{(\kappa)})^{-1}\mathbf{H}_{i,i,p(j)}\mathbf{V}_{i,p(j)}^{(\kappa)}\Bigl\rangle\, < 0,\nonumber\quad\\
a_{i,j}^{(\kappa)} &\triangleq& {\cal R}_{i,j}(\mathbf{V}^{(\kappa)}) - \Bigl\langle (\mathbf{V}_{i,j}^{(\kappa)})^H\mathbf{H}_{i,i,j}^H \nonumber \\
&&\quad \times{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}^{(\kappa)}\Bigl\rangle\, < 0,
\end{IEEEeqnarray}
and ${\cal A}_{i,p(j)}^{j,(\kappa)}$, ${\cal A}_{i,p(j)}^{p(j),(\kappa)}$, ${\cal A}_{i,j}^{(\kappa)}$ are given as
\begin{IEEEeqnarray}{rCl}
{\cal A}_{i,p(j)}^{j,(\kappa)}&\triangleq& \mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}(\mathbf{V}^{(\kappa)})^{-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)}^{(\kappa)},\nonumber\\
{\cal A}_{i,p(j)}^{p(j),(\kappa)}&\triangleq&\mathbf{H}_{i,i,p(j)}^H{\mathbf{\mathcal{ M}}}_{i,p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,p(j)}\mathbf{V}_{i,p(j)}^{(\kappa)},\nonumber \qquad\\
{\cal A}_{i,j}^{(\kappa)}&\triangleq&\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}^{(\kappa)}.
\end{IEEEeqnarray}
Note that all functions in (\ref{eq:qdt}) are concave due
to \eqref{eq:Mij}, \eqref{eq:Mijpj}, and \eqref{eq:Mipjpj}:
\begin{IEEEeqnarray}{rCl}
{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}-{\mathbf{\mathcal{ M}}}_{i,p(j)}(\mathbf{V}^{(\kappa)})^{-1}&\succeq& \mathbf{0},\nonumber \\
{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}-{\mathbf{\mathcal{ M}}}_{i,j}(\mathbf{V}^{(\kappa)})^{-1}
&\succeq& \mathbf{0},\nonumber \\
{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V}^{(\kappa)})^{-1}-{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1} &\succeq& \mathbf{0}.\nonumber
\end{IEEEeqnarray}
The following result shows that the complicated function defined by \eqref{noma1} and \eqref{noma2}
is lower bounded by concave quadratic functions.
\par\medskip\noindent
\begin{myth}\label{basicth} For ${\cal R}^{(\kappa)}_{i,p(j)}(\mathbf{V}) \triangleq \min\Bigl\{{\cal R}^{j,(\kappa)}_{i,p(j)}(\mathbf{V}),$ $
{\cal R}^{p(j),(\kappa)}_{i,p(j)}(\mathbf{V})\Bigl\}$ it is true that
\begin{IEEEeqnarray}{rCl}\label{main}
{\cal R}_{i,p(j)}(\mathbf{V}^{(\kappa)})&=&{\cal R}^{(\kappa)}_{i,p(j)}(\mathbf{V}^{(\kappa)})\quad\mbox{and}\quad \nonumber \\
{\cal R}_{i,p(j)}(\mathbf{V})&\geq& {\cal R}^{(\kappa)}_{i,p(j)}(\mathbf{V}), \ \forall\, \mathbf{V},
\end{IEEEeqnarray}
and
\begin{IEEEeqnarray}{rCl}\label{mainbound}
{\cal R}_{i,j}(\mathbf{V}^{(\kappa)}) &=& {\cal R}^{(\kappa)}_{i,j}(\mathbf{V}^{(\kappa)})\quad\mbox{and}\quad \nonumber \\
{\cal R}_{i,j}(\mathbf{V}) &\geq& {\cal R}^{(\kappa)}_{i,j}(\mathbf{V}), \ \forall\, \mathbf{V}.
\end{IEEEeqnarray}
\end{myth}
\begin{IEEEproof}
See \cite[Appendix B]{TTN16}.
\end{IEEEproof}\par\medskip\noindent
Based on these results, at the $\kappa$-th iteration, the following convex program, which is
an inner approximation for the nonconvex optimization problem \eqref{Rmtgor}, is solved to generate the next feasible point
$\mathbf{V}^{(\kappa+1)}$:
\begin{IEEEeqnarray}{rCl}\label{RmtgFWA}
&& \displaystyle\underset{\mathbf{V}}{\max} \quad \mathcal{P}^{(\kappa)}(\mathbf{V}) \triangleq\sum_{i=1}^N\sum_{j=1}^K \Bigl({\cal R}_{i,j}^{(\kappa)}(\mathbf{V})+{\cal R}_{i,p(j)}^{(\kappa)}(\mathbf{V}) \Bigr)\IEEEyessubnumber\label{RmtgFWA:a}\qquad \\
&& {\mathrm{subject\ to}} \ \
{\cal R}_{i,j}^{(\kappa)}(\mathbf{V})\geq r_{i,j},\ \forall i\in\mathcal{I},\ \forall j\in\mathcal{K}_1,\IEEEyessubnumber\label{RmtgFWA:b}\\
&&\qquad\qquad\quad {\cal R}^{(\kappa)}_{i,p(j)}(\mathbf{V})\geq r_{i,p(j)}, \ \forall i\in\mathcal{I},\ \forall j\in\mathcal{K}_2,\IEEEyessubnumber\label{RmtgFWA:c}\\
&&\qquad\qquad\quad \eqref{Rmtgord}.\IEEEyessubnumber\label{RmtgFWA:d}
\end{IEEEeqnarray}
A pseudo-code of this quadratic programing (QP)-based path-following
procedure is given by Algorithm~\ref{alg_SCALE_FW}.
Note that $\mathbf{V}^{(\kappa)}$ is also feasible for \eqref{RmtgFWA} with $\mathcal{P}(\mathbf{V}^{(\kappa)})=
\mathcal{P}^{(\kappa)}(\mathbf{V}^{(\kappa)})$ by the equalities in \eqref{main} and \eqref{mainbound}.
It is then true
that $\mathcal{P}^{(\kappa)}(\mathbf{V}^{(\kappa+1)})>\mathcal{P}^{(\kappa)}(\mathbf{V}^{(\kappa)})=\mathcal{P}(\mathbf{V}^{(\kappa)})$ whenever
$\mathbf{V}^{(\kappa+1)}\neq \mathbf{V}^{(\kappa)}$. Together with $\mathcal{P}(\mathbf{V}^{(\kappa+1)})\geq
\mathcal{P}^{(\kappa)}(\mathbf{V}^{(\kappa)})$ and according to the inequalities in \eqref{main} and \eqref{mainbound}, we have
$\mathcal{P}(\mathbf{V}^{(\kappa+1)})>\mathcal{P}(\mathbf{V}^{(\kappa)})$, i.e., the optimal solution
$\mathbf{V}^{(\kappa+1)}$ of the convex quadratic problem \eqref{RmtgFWA} is a better point for the
nonconvex nonsmooth optimization problem \eqref{Rmtgor} than $\mathbf{V}^{(\kappa)}$.
Therefore, once initialized from an feasible point $\mathbf{V}^{(0)})$, the sequence $\{\mathbf{V}^{(\kappa)}\}$ obtained by solving \eqref{RmtgFWA} is of improved feasible points for \eqref{Rmtgor}. By following the same arguments as those in \cite[Proposition 1]{TTN16}, we can prove that
Algorithm~\ref{alg_SCALE_FW} converges to a Karush-Kuh-Tucker (KKT) point of \eqref{Rmtgor}.
\begin{algorithm}[t]
\begin{algorithmic}[1]
\protect\caption{QP-based path-following algorithm for the STM \eqref{Rmtgor} in MIMO-NOMA}
\label{alg_SCALE_FW}
\global\long\def\textbf{Initialization:}{\textbf{Initialization:}}
\REQUIRE Set $\kappa:=0$ and solve \eqref{kiter1} to generate an initial feasible point $\mathbf{V}^{(0)}$ for constraints
\eqref{Rmtgorb}-\eqref{Rmtgord}.
\REPEAT
\STATE Solve the convex quadratic program \eqref{RmtgFWA} to obtain the optimal solution: $\mathbf{V}^{\star}$.
\STATE Update\ \ $\mathbf{V}^{(\kappa+1)}:= \mathbf{V}^{\star}.$
\STATE Set $\kappa:=\kappa+1.$
\UNTIL Convergence\\
\end{algorithmic} \end{algorithm}
\textit{Generation of the initial points}: A feasible point for constraints \eqref{Rmtgorb}-\eqref{Rmtgord}
for initializing Algorithm~\ref{alg_SCALE_FW} is found via the following problem of QoS feasibility
\begin{IEEEeqnarray}{rCl}\label{qos}
&&\displaystyle\max_{\mathbf{V}} \underset{(i,j)\in\mathcal{S}}{\min}\min \Biggl\{\frac{{\cal R}_{i,j}(\mathbf{V})}{r_{i,j}},
\frac{{\cal R}_{i,p(j)}(\mathbf{V})}{r_{i,p(j)}}\Biggr\}\IEEEyessubnumber\label{qosa}\\
&&{\mathrm{subject\ to}}\quad \eqref{Rmtgord}.\IEEEyessubnumber\label{qosb}
\end{IEEEeqnarray}
Initialized from a feasible point $\mathbf{V}^{(0)}$ for the convex constraint
\eqref{Rmtgord}, the following iterations are invoked
\begin{IEEEeqnarray}{rCl}\label{kiter1}
&&\max_{\mathbf{V}} \underset{(i,j)\in\mathcal{S}}{\min}\min \Biggl\{\frac{{\cal R}^{(\kappa)}_{i,j}(\mathbf{V})}{r_{i,j}},
\frac{{\cal R}^{(\kappa)}_{i,p(j)}(\mathbf{V})}{r_{i,p(j)}}\Biggr\} \IEEEyessubnumber\\
&& {\mathrm{subject\ to}}\quad \eqref{Rmtgord}\IEEEyessubnumber
\end{IEEEeqnarray}
till reaching a value more than or equal to $1$ in satisfying \eqref{Rmtgorb}-\eqref{Rmtgord}.
\textit{Complexity Analysis}:
Problem \eqref{RmtgFWA} is convex quadratic with
$m_{\text{QP}}=N(1+3K)$ quadratic constraints and $n=KN(2N_tL+1)$ real decision variables. Its
computational complexity is $\mathcal{O}(n^2m_{\text{QP}}^{2.5}+m_{\text{QP}}^{3.5})$.
\section{Semi-Definite Programming Based Iterations}\label{SDPBI}
To further improve the convergence speed of solving \eqref{Rmtgor}, we need explore more partial convex structures of
functions \eqref{noma1} and \eqref{noma2}. In this section, we propose a novel
SDP-based path-following algorithm for \eqref{Rmtgor}. To this end, we will use the following matrix inequalities:
\begin{eqnarray}
\mathbf{V}^H\mathbf{X}^{-1}\mathbf{V} &\succeq& \bar{\boldsymbol{V}}^H\bar{\boldsymbol{X}}^{-1}\mathbf{V}+
\mathbf{V}^H\bar{\boldsymbol{X}}^{-1}\bar{\boldsymbol{V}} \nonumber\\
&& -\; \bar{\boldsymbol{V}}^H\bar{\boldsymbol{X}}^{-1}\mathbf{X}\bar{\boldsymbol{X}}^{-1}\bar{\boldsymbol{V}}, \nonumber\\
&&\forall\ \mathbf{V}, \bar{\boldsymbol{V}}, \mathbf{X}\succ \mathbf{0} , \bar{\boldsymbol{X}}\succ \mathbf{0} , \label{in1}
\end{eqnarray}
and
\begin{eqnarray}
\ln|\mathbf{X}|&\geq& \ln|\bar{\boldsymbol{X}}|-\bigl\langle \bar{\boldsymbol{X}}, \mathbf{X}^{-1}-\bar{\boldsymbol{X}}^{-1}\bigl\rangle, \nonumber\\
&&\forall\ \mathbf{X}\succ \mathbf{0} , \bar{\boldsymbol{X}}\succ \mathbf{0},\label{in2}
\end{eqnarray}
whose proofs are given by Appendix A and Appendix B.
Let us treat the rate function ${\cal R}_{i,p(j)}^j(\mathbf{V})$ from (\ref{eq:Rijpj}) first.
Applying (\ref{in1}) yields
\begin{IEEEeqnarray}{rCl}
\mathbf{V}_{i,p(j)}^H\mathbf{H}_{i,i,j}^H
{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V})^{-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i, p(j)} \succeq \widetilde{{\cal Q}}^{j,(\kappa)}_{i,p(j)}(\mathbf{V}) \label{lmi1} \qquad
\end{IEEEeqnarray}
for
\begin{IEEEeqnarray}{rCl}
\widetilde{\mathbf{{\cal Q}}}^{j,(\kappa)}_{i,p(j)}(\mathbf{V})&& \triangleq(\mathbf{V}^{(\kappa)}_{i,p(j)})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)} \nonumber\\
&&+\,(\mathbf{V}_{i,p(j)})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,p(j)}\nonumber\\
&&-\,(\mathbf{V}^{(\kappa)}_{i,p(j)})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}) \nonumber \\
&&\times {\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,p(j)},\label{map1}
\end{IEEEeqnarray}
which also satisfies
\begin{IEEEeqnarray}{rCl}\label{match1}
&&\widetilde{\mathbf{{\cal Q}}}^{j,(\kappa)}_{i,p(j)}(\mathbf{V}^{(\kappa)})= \nonumber\\
&&\qquad \; (\mathbf{V}_{i,p(j)}^{(\kappa)})^H\mathbf{H}_{i,i,j}^H
{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i, p(j)}^{(\kappa)}.\qquad
\end{IEEEeqnarray}
For
${\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V})$ defined from (\ref{eq:Mijpj}), applying (\ref{in1}) again yields
\begin{eqnarray}
{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}) & \succeq & {\cal L}_{i,j}^{p(j),(\kappa)}(\mathbf{V})+\sigma^2\mathbf{I}_{N_r}\label{lmi1a}
\end{eqnarray}
over the trust region
\begin{equation}\label{tr1}
{\cal L}_{i,j}^{p(j),(\kappa)}(\mathbf{V})\succeq \mathbf{0},
\end{equation}
for the linear mapping
\begin{eqnarray}
{\cal L}_{i,j}^{p(j),(\kappa)}(\mathbf{V})\triangleq \displaystyle\sum_{(s,l)\in{\cal S}\setminus\{(i,p(j))\}}\mathbf{H}_{s,i,j}
\Bigl[\mathbf{V}_{s,l}(\mathbf{V}_{s,l}^{(\kappa)})^H \nonumber\\
+\; \mathbf{V}_{s,l}^{(\kappa)}\mathbf{V}_{s,l}^H
-\mathbf{V}_{s,l}^{(\kappa)}(\mathbf{V}_{s,l}^{(\kappa)})^H\Bigl] \mathbf{H}_{s,i,j}^H.\label{linear1}
\end{eqnarray}
It follows from (\ref{lmi1}) that
\begin{equation}\label{lmi1.1}
\widetilde{{\cal Q}}^{j,(\kappa)}_{i,p(j)}(\mathbf{V})\preceq {\cal Q}^{j,(\kappa)}_{i,p(j)}(\mathbf{V})
\end{equation}
for
\begin{IEEEeqnarray}{rCl}
&&{\cal Q}^{j,(\kappa)}_{i,p(j)}(\mathbf{V})\triangleq \mathbf{V}_{i,p(j)}^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,p(j)}\nonumber\\
&&\qquad+\, (\mathbf{V}^{(\kappa)}_{i,p(j)})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)} \nonumber\\
&&\qquad-\,(\mathbf{V}^{(\kappa)}_{i,p(j)})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\Bigl[{\cal L}_{i,j}^{p(j),(\kappa)}(\mathbf{V})\nonumber \qquad \\
&&\qquad +\, \sigma^2\mathbf{I}_{N_r}\Bigr] {\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,p(j)}.\label{map1:1}
\end{IEEEeqnarray}
Therefore,
\begin{IEEEeqnarray}{rCl}
&& {\cal R}_{i,p(j)}^j(\mathbf{V}) \nonumber\\
&&= \ln\Bigl|\mathbf{I}_L + (\mathbf{V}_{i,p(j)})^H\mathbf{H}_{i,i,j}^H
{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V})^{-1}\mathbf{H}_{i,i,j}\mathbf{V}_{i, p(j)}\Bigl|\nonumber \quad\\
&&\geq\ln\Bigl|\mathbf{I}_L +\widetilde{{\cal Q}}^{j,(\kappa)}_{i,p(j)}(\mathbf{V}) \Bigl|\label{lmi2}\\
&&\geq{\cal R}_{i,p(j)}^j(\mathbf{V}^{(\kappa)})+L \nonumber\\
&&\quad -\; \Bigl\langle \mathbf{I}_L +\widetilde{{\cal Q}}^{j,(\kappa)}_{i,p(j)}(\mathbf{V}^{(\kappa)}),\Bigl(\mathbf{I}_L+ \widetilde{{\cal Q}}^{j,(\kappa)}_{i,p(j)}(\mathbf{V})\Bigl)^{-1} \Bigr\rangle\label{l1.0} \\
&&\geq\widetilde{{\cal R}}_{i,p(j)}^{j, (\kappa)}(\mathbf{V})\label{l1}
\end{IEEEeqnarray}
for
\begin{IEEEeqnarray}{rCl}
&&\widetilde{{\cal R}}_{i,p(j)}^{j, (\kappa)}(\mathbf{V})
\triangleq{\cal R}_{i,p(j)}^j(\mathbf{V}^{(\kappa)})+L \nonumber\\
&&\qquad -\; \Bigl\langle \mathbf{I}_L +(\mathbf{V}_{i,p(j)}^{(\kappa)})^H\mathbf{H}_{i,i,j}^H
{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}\nonumber \qquad\\
&&\qquad\qquad \times \mathbf{H}_{i,i,j}\mathbf{V}_{i, p(j)}^{(\kappa)}
,\Bigl(\mathbf{I}_L+ {\cal Q}^{j,(\kappa)}_{i,p(j)}(\mathbf{V})\Bigl)^{-1} \Bigr\rangle,\label{l1.1}
\end{IEEEeqnarray}
which is a concave function. Inequality (\ref{lmi2}) follows from (\ref{lmi1}) and the condition
\[
\ln|\mathbf{I}_L+\mathbf{X}|\geq \ln|\mathbf{I}_L+\mathbf{Y}|,\ \forall\ \mathbf{X}\succeq\mathbf{Y}\succeq \mathbf{0}.
\]
Inequality (\ref{l1.0}) follows by applying (\ref{in2}) and using equality
\[
\ln\bigl|\mathbf{I}_L +\widetilde{{\cal Q}}^{j,(\kappa)}_{i,p(j)}(\mathbf{V}^{(\kappa)}) \bigl|=
{\cal R}_{i,p(j)}^j(\mathbf{V}^{(\kappa)}).
\]
Inequality (\ref{l1}) follows from inequality (\ref{lmi1}), equality (\ref{match1}), and the condition
\[
\Bigl\langle \mathbf{M},\mathbf{X}^{-1}\Bigl\rangle \geq \Bigl\langle \mathbf{M},\mathbf{Y}^{-1}\Bigl\rangle, \ \forall\ \mathbf{M}\succeq \mathbf{0},
\mathbf{Y}\succeq \mathbf{X}\succ \mathbf{0}.
\]
Analogously, the rate function ${\cal R}_{i,p(j)}^{p(j)}(\mathbf{V})$ and throughput function ${\cal R}_{i,j}(\mathbf{V})$
defined from (\ref{eq:Rijj}) and (\ref{noma2}) are lower bounded by
\begin{IEEEeqnarray}{rCl}\label{eq:Ripjpj}
{\cal R}_{i,p(j)}^{p(j)}(\mathbf{V})&\geq& \widetilde{{\cal R}}_{i,p(j)}^{p(j), (\kappa)}(\mathbf{V})\label{l2}
\end{IEEEeqnarray}
over the trust region
\begin{equation}\label{tr2}
{\cal L}_{i,p(j)}^{p(j),(\kappa)}(\mathbf{V})\succeq \mathbf{0},
\end{equation}
and
\begin{IEEEeqnarray}{rCl}\label{eq:Rij}
{\cal R}_{i,j}(\mathbf{V})&\geq&\widetilde{{\cal R}}_{i,j}^{(\kappa)}(\mathbf{V})
\end{IEEEeqnarray}
over the trust region
\begin{equation}\label{tr3}
{\cal L}_{i,j}^{p,(\kappa)}(\mathbf{V})\succeq \mathbf{0},
\end{equation}
for linear mappings
\begin{IEEEeqnarray}{rCl}\label{linear2}
&&{\cal L}_{i,p(j)}^{p(j),(\kappa)}(\mathbf{V}) \triangleq \displaystyle\sum_{(s,l)\in{\cal S}\setminus\{(i,p(j)) \}}\mathbf{H}_{s,i,p(j)}\Bigl[\mathbf{V}_{s,l}(\mathbf{V}_{s,l}^{(\kappa)})^H \nonumber\\
&&\qquad\qquad\quad +\; \mathbf{V}_{s,l}^{(\kappa)}\mathbf{V}_{s,l}^H-
\mathbf{V}_{s,l}^{(\kappa)}(\mathbf{V}_{s,l}^{(\kappa)})^H\Bigl]\mathbf{H}_{s,i,p(j)}^H
\end{IEEEeqnarray}
and
\begin{IEEEeqnarray}{rCl}\label{linear3}
&&{\cal L}_{i,j}^{p,(\kappa)}(\mathbf{V}) \triangleq \displaystyle\ds\sum_{(s,l)\in{\cal S}\setminus\{(i,p(j)),(i,j)\}}\mathbf{H}_{s,i,j}\Bigl[\mathbf{V}_{s,l}(\mathbf{V}_{s,l}^{(\kappa)})^H \nonumber\\
&&\qquad\qquad\quad +\; \mathbf{V}_{s,l}^{(\kappa)}\mathbf{V}_{s,l}^H-\mathbf{V}_{s,l}^{(\kappa)}(\mathbf{V}_{s,l}^{(\kappa)})^H\Bigl] \mathbf{H}_{s,i,j}^H,
\end{IEEEeqnarray}
and for concave functions
\begin{IEEEeqnarray}{rCl}
&&\widetilde{{\cal R}}_{i,p(j)}^{p(j), (\kappa)}(\mathbf{V})
\triangleq {\cal R}_{i,p(j)}^{p(j)}(\mathbf{V}^{(\kappa)})
+ L \nonumber\\
&&\qquad -\Bigl\langle \mathbf{I}_L +(\mathbf{V}^{(\kappa)}_{i,p(j)})^H\mathbf{H}_{i,i,p(j)}^H
{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}\nonumber\\
&&\qquad \times \mathbf{H}_{i,i,p(j)}\mathbf{V}_{i, p(j)}^{(\kappa)}
,\Bigl(\mathbf{I}_L +{\cal Q}_{i,p(j)}^{p(j), (\kappa)}(\mathbf{V})\Bigl)^{-1}
\Bigr\rangle\label{l2:2}
\end{IEEEeqnarray}
and
\begin{IEEEeqnarray}{rCl}
&&\widetilde{{\cal R}}_{i,j}^{(\kappa)}(\mathbf{V}) \triangleq
{\cal R}_{i,j}^{(\kappa)}(\mathbf{V}^{(\kappa)})
+ L \nonumber\\
&&\qquad - \; \Bigl\langle \mathbf{I}_L +(\mathbf{V}^{(\kappa)}_{i,j})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}^{(\kappa)}, \nonumber\\
&& \qquad\qquad \Bigl(\mathbf{I}_L +{\cal Q}^{(\kappa)}_{i,j}(\mathbf{V})\Bigl)^{-1}\Bigr\rangle\label{l3},
\end{IEEEeqnarray}
with
\begin{IEEEeqnarray}{rCl}
&&{\cal Q}_{i,p(j)}^{p(j), (\kappa)}(\mathbf{V})\triangleq \nonumber\\
&&\quad (\mathbf{V}^{(\kappa)}_{i,p(j)})^H\mathbf{H}_{i,i,p(j)}^H
{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}\mathbf{H}_{i,i,p(j)}\mathbf{V}_{i, p(j)} \nonumber\\
&&\quad +\, (\mathbf{V}_{i,p(j)})^H\mathbf{H}_{i,i,p(j)}^H
{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}\mathbf{H}_{i,i,p(j)}\mathbf{V}^{(\kappa)}_{i, p(j)} \nonumber\\
&&\quad -\, (\mathbf{V}^{(\kappa)}_{i,p(j)})^H\mathbf{H}_{i,i,p(j)}^H
{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\Bigl[{\cal L}_{i,p(j)}^{p(j),(\kappa)}(\mathbf{V}) \nonumber \quad \\
&&\quad +\; \sigma^2\mathbf{I}_{N_r}\Bigr]
{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,p(j)}\mathbf{V}^{(\kappa)}_{i, p(j)} \label{map2}\quad\
\end{IEEEeqnarray}
and
\begin{IEEEeqnarray}{rCl}
{\cal Q}^{(\kappa)}_{i,j}(\mathbf{V})&\triangleq& (\mathbf{V}^{(\kappa)}_{i,j})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}_{i,j} \nonumber\\
&+&\;(\mathbf{V}_{i,j})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,j}\nonumber\\
&-&\,(\mathbf{V}^{(\kappa)}_{i,j})^H\mathbf{H}_{i,i,j}^H{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V}^{(\kappa)})^{-1}
\Bigl[{\cal L}_{i,j}^{p,(\kappa)}(\mathbf{V}) \nonumber\\
&+&\; \sigma^2\mathbf{I}_{N_r}\Bigr]{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V}^{(\kappa)})^{-1}
\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,j}.\label{map3}
\end{IEEEeqnarray}
We also define
\begin{equation}\label{l4}
\widetilde{{\cal R}}^{(\kappa)}_{i,p(j)}(\mathbf{V})\triangleq \min\Bigl\{\widetilde{{\cal R}}^{j,(\kappa)}_{i,p(j)}(\mathbf{V}),
\widetilde{{\cal R}}^{p(j),(\kappa)}_{i,p(j)}(\mathbf{V})\Bigl\}.
\end{equation}
In summary, at the $\kappa$-th iteration, the following SDP, which is an inner approximation of \eqref{Rmtgor}, is solved
to generate the next feasible point $\mathbf{V}^{(\kappa+1)}$:
\begin{IEEEeqnarray}{rCl}\label{sdp1}
&& \displaystyle\underset{\mathbf{V}}{\max} \ \, \mathcal{\widetilde{P}}^{(\kappa)}(\mathbf{V}) \triangleq\sum_{i=1}^N\sum_{j=1}^K \Bigl(\widetilde{{\cal R}}_{i,j}^{(\kappa)}(\mathbf{V}) + \widetilde{{\cal R}}^{(\kappa)}_{i,p(j)}(\mathbf{V}) \Bigr)\IEEEyessubnumber\label{sdp1:a}\qquad\\
&& {\mathrm{subject\ to}} \
\widetilde{{\cal R}}_{i,j}^{(\kappa)}(\mathbf{V})\geq r_{i,j},\ \forall i\in\mathcal{I},\ \forall j\in\mathcal{K}_1,\IEEEyessubnumber\label{sdp1:b}\\
&& \qquad\qquad\quad \widetilde{{\cal R}}^{(\kappa)}_{i,p(j)}(\mathbf{V}) \geq r_{i,p(j)}, \; \forall i\in\mathcal{I},\; \forall j\in\mathcal{K}_2,\IEEEyessubnumber\label{sdp1:c}\\
&&\qquad\qquad\quad \eqref{Rmtgord}, \eqref{tr1}, \eqref{tr2}, \eqref{tr3}.\IEEEyessubnumber\label{sdp1:d}
\end{IEEEeqnarray}
The proposed Algorithm~\ref{alg_SDP_FW}
generates a sequence $\{\mathbf{V}^{(\kappa)}\}$ of improved points of \eqref{Rmtgor}, which also converges to a KKT point.
\begin{algorithm}[t]
\begin{algorithmic}[1]
\protect\caption{SDP-based path-following algorithm for the STM \eqref{Rmtgor} in MIMO-NOMA}
\label{alg_SDP_FW}
\global\long\def\textbf{Initialization:}{\textbf{Initialization:}}
\REQUIRE Set $\kappa:=0$ and solve \eqref{kiter2} to generate an initial feasible point $\mathbf{V}^{(0)}$ for constraints
\eqref{Rmtgorb}-\eqref{Rmtgord}.
\REPEAT
\STATE Solve the semi-definite program \eqref{sdp1} to obtain the optimal solution: $\mathbf{V}^{\star}$.
\STATE Update\ \ $\mathbf{V}^{(\kappa+1)}:= \mathbf{V}^{\star}.$
\STATE Set $\kappa:=\kappa+1.$
\UNTIL Convergence\\
\end{algorithmic} \end{algorithm}
A feasible point $\mathbf{V}^{(0)}$ for the constraints \eqref{Rmtgorb}-\eqref{Rmtgord} to initialize Algorithm \ref{alg_SDP_FW}
can be found by invoking the iterations
\begin{IEEEeqnarray}{rCl}\label{kiter2}
&&\max_{\mathbf{V}} \underset{(i,j)\in\mathcal{S}}{\min}\min \Biggl\{\frac{\widetilde{{\cal R}}^{(\kappa)}_{i,j}(\mathbf{V})}{r_{i,j}},
\frac{\widetilde{{\cal R}}^{(\kappa)}_{i,p(j)}(\mathbf{V})}{r_{i,p(j)}}\Biggl\}\ \IEEEyessubnumber\\
&&{\mathrm{subject\ to}}\quad \eqref{Rmtgord},
\eqref{tr1}, \eqref{tr2}, \eqref{tr3} \IEEEyessubnumber
\end{IEEEeqnarray}
to reach a value more than or equal to $1$ in satisfying \eqref{Rmtgorb}-\eqref{Rmtgord}.
\textit{Complexity analysis:} The SDP \eqref{sdp1} involves $N(1+3K)$ quadratic constraints, $3NK$ semi-definite
constraints with $N_r$ rows and $n=KN(2N_tL+1)$ real decision variables. For $m_{\text{SDP}}\triangleq N(1+3K)+3NKN_r$,
its computational complexity is $\mathcal{O}(n^2m_{\text{SDP}}^{2.5}+m_{\text{SDP}}^{3.5})$, which is seen higher than that of
the convex quadratic problem \eqref{RmtgFWA}.
\section{Tailored algorithm for MISO-NOMA}\label{sec:TL}
In this case, all channels are row vectors ($\mathbf{H}_{s,i,j}\in\mathbb{C}^{1\times N_t}$)
and $s_{i,j}\in\mathbb{C}$ ($L=1$).
As observed first time in \cite{WES06}, for
\begin{equation}\label{varch}
\bar{\mathbf{V}}_{i,j}=e^{-\jmath {\sf arg}(\mathbf{H}_{i,i,j}\mathbf{V}_{i,j})}\mathbf{V}_{i,j}
\end{equation}
one has
$|\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}|=\mathbf{H}_{i,i,j}\bar{\mathbf{V}}_{i,j}=\Re\{ \mathbf{H}_{i,i,j}\bar{\mathbf{V}}_{i,j}\}\geq 0$ and
$|\mathbf{H}_{i',i,j'}\mathbf{V}_{i,j}|=|\mathbf{H}_{i',i,j'}\bar{\mathbf{V}}_{i,j}|$ for $(i',j')\neq (i,j)$. Therefore,
without loss of generality we can replace
\[
\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\mathbf{V}_{i,j}^H\mathbf{H}_{i,i,j}^H = \bigl|\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\bigr|^2, \ j=1,\dots, 2K
\]
by
\[
\bigl(\Re\{\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\}\bigr)^2, \ j=1,\dots, 2K
\]
with
\begin{equation}\label{positivereal}
\Re\{\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\}\geq 0, \ j=1,\dots, 2K
\end{equation}
(including $p(j)$ for $j=K+1,...,2K$).
Accordingly, write
\[
{\mathbf{\mathcal{ M}}}_{i,j}(\mathbf{V})= \displaystyle\sum_{(s,l)\in{\cal S}}\bigl|\mathbf{H}_{s,i,j}\mathbf{V}_{s,l}\bigr|^2+ \sigma^2.
\]
Then the message $\mathbf{s}_{i,p(j)}$ intended for cell-edge UE $(i,p(j))$ is decoded by the cell-center UE $(i,j)$
with the achievable rate
\begin{equation}\label{t1}
r_{i,p(j)}^j(\mathbf{V}) = \ln\Biggl(1 + \frac{\bigl|\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)}\bigr|^2}{{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V})}\Biggr),
\end{equation}
and is decoded by the cell-edge UE $(i,p(j))$ itself with the achievable rate
\begin{equation}\label{t2}
r_{i,p(j)}^{p(j)}(\mathbf{V}) = \ln\Biggl( 1 +
\frac{\bigl(\Re\{ \mathbf{H}_{i,i,p(j)}\mathbf{V}_{i, p(j)}\}\bigr)^2}{{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V})} \Biggl)
\end{equation}
where
\begin{IEEEeqnarray}{rCl}
{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}) & \triangleq& {\mathbf{\mathcal{ M}}}_{i,j}(\mathbf{V}) - \bigl|\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)}\bigr|^2 \nonumber\\
&=&\displaystyle\ds\sum_{(s,l)\in{\cal S}\setminus\{(i,p(j))\}}
\bigl|\mathbf{H}_{s,i,j}\mathbf{V}_{s,l}\bigl|^2 + \sigma^2, \nonumber
\end{IEEEeqnarray}
and
\begin{IEEEeqnarray}{rCl}
{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V})& \triangleq& {\mathbf{\mathcal{ M}}}_{i,p(j)}(\mathbf{V}) - \bigl|\mathbf{H}_{i,i,p(j)}\mathbf{V}_{i,p(j)}\bigl|^2 \nonumber\\
&=&\displaystyle\sum_{(s,l)\in{\cal S}\setminus\{(i,p(j)) \}}
\bigl|\mathbf{H}_{s,i,p(j)}\mathbf{V}_{s,l}\bigl|^2 + \sigma^2.\nonumber
\end{IEEEeqnarray}
Also, the message $\mathbf{s}_{i,j}$ intended for the cell-center UE $(i,j)$ is successively decoded by UE $(i,j)$ itself
with the throughput
\begin{equation}\label{t3}
r_{i,j}(\mathbf{V}) = \ln\Biggr( 1 + \frac{\bigl(\Re\{\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\}\bigr)^2}{ {\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V})} \Biggr)
\end{equation}
where
\begin{IEEEeqnarray}{rCl}
{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V}) & \triangleq & {\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}) - \bigl|\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\bigl|^2 \nonumber\\
&=&\displaystyle\ds\sum_{(s,l)\in{\cal S}\setminus\{(i,p(j)),(i,j)\}}\bigl|\mathbf{H}_{s,i,j}\mathbf{V}_{s,l}\bigl|^2 + \sigma^2. \nonumber\nonumber
\end{IEEEeqnarray}
For $r_{i,p(j)}(\mathbf{V}) \triangleq \min\bigl\{r^j_{i,p(j)}(\mathbf{V}), r^{p(j)}_{i,p(j)}(\mathbf{V})\bigl\}$, the problem (\ref{Rmtgor}) in this case is
\begin{IEEEeqnarray}{rCl}\label{beam1}
&&\underset{\mathbf{V}}{{\mathrm{maximize}}}\ \mathcal{P}(\mathbf{V})\triangleq\sum_{i=1}^N\sum_{j=1}^K\Bigr(r_{i,j}(\mathbf{V})+ r_{i,p(j)}(\mathbf{V})
\Bigl)\quad \IEEEyessubnumber\label{beam1a} \quad\\
&& {\mathrm{subject\ to}} \
r_{i,j}(\mathbf{V}) \geq r_{i,j}, \ \forall i\in\mathcal{I},\ \forall j\in\mathcal{K}_1, \IEEEyessubnumber\label{beam1b} \\
&&\qquad\qquad\ r^{p(j)}_{i,p(j)}(\mathbf{V}) \geq r_{i,p(j)}, \ \forall i\in\mathcal{I},\ \forall j\in\mathcal{K}_2, \IEEEyessubnumber\label{beam1c}\\
&&\qquad\qquad\ r^{j}_{i,p(j)}(\mathbf{V}) \geq r_{i,p(j)}, \ \forall i\in\mathcal{I},\ \forall j\in\mathcal{K}_2, \IEEEyessubnumber\label{beam1d}\\
&&\qquad\qquad\ \sum_{j\in {\cal J}} \|\mathbf{V}_{i,j}\|^2 \le P^{\max}_{i}, \forall i \in\mathcal{I}. \IEEEyessubnumber\label{beam1e}
\end{IEEEeqnarray}
Due to the above transforms (\ref{t2}) and (\ref{t3}) under condition (\ref{positivereal}), the nonconvex
constraints (\ref{beam1b}) and (\ref{beam1c}) are expressed by the second-order cone (SOC) constraints
\begin{IEEEeqnarray}{rCl}
\Re\bigl\{\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\bigr\} &\geq& \sqrt{e^{r_{i,j}}-1}\sqrt{{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V})}, \nonumber\\
&& \ \forall i\in\mathcal{I},\ \forall j\in\mathcal{K}_1, \label{beam1be} \\
\Re\bigl\{ \mathbf{H}_{i,i,p(j)}\mathbf{V}_{i, p(j)} \bigl\} &\geq&
\sqrt{e^{r_{i,p(j)}}-1}\sqrt{{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V})}, \qquad \nonumber\\
&& \ \forall i\in\mathcal{I},\ \forall j\in\mathcal{K}_2\label{beam1ce}
\end{IEEEeqnarray}
but the constraint (\ref{beam1d}) remains to be nonconvex.
To approximate functions in (\ref{beam1a}) we use the inequality
\begin{equation}\label{zf8}
\ln(1+z)\geq a(\bar{z})-b(\bar{z})\frac{1}{z},\quad
\forall\ z>0, \bar{z}>0
\end{equation}
with
\begin{equation}\label{zf9}
0<a(\bar{z}) \triangleq \ln(1+\bar{z})+\displaystyle\frac{\bar{z}}{\bar{z}+1},\
0<b(\bar{z}) \triangleq \frac{\bar{z}^2}{\bar{z}+1},
\end{equation}
whose proof is provided by Appendix~C.
Applying (\ref{zf8}) for
$\bar{z}=z^{j, (\kappa)}_{i,p(j)}\triangleq |\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,p(j)}|^2/{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V}^{(\kappa)})$ and
$z= |\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)}|^2/{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V})$ yields
\begin{IEEEeqnarray}{rCl}
&&r^{j}_{i,p(j)}(\mathbf{V})\geq a\bigl(z_{i,p(j)}^{j,(\kappa)}\bigl)-b\bigl(z_{i,p(j)}^{j,(\kappa)}\bigl)\displaystyle\frac{{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V})}{\bigl|\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)}\bigr|^2} \nonumber\\
&&\qquad\qquad\ \geq r^{j, (\kappa)}_{i,p(j)}(\mathbf{V}) \nonumber\\
&&\qquad\qquad\ \triangleq a\bigl(z_{i,p(j)}^{j,(\kappa)}\bigl)-
b\bigl(z_{i,p(j)}^{j,(\kappa)}\bigl)
\displaystyle\frac{{\mathbf{\mathcal{ M}}}_{i,j}^{p(j)}(\mathbf{V})}{\varphi_{i,p(j)}^{j,(\kappa)}(\mathbf{V})} \qquad
\end{IEEEeqnarray}
over the trust region
\begin{IEEEeqnarray}{rCl}\label{trb1}
\varphi_{i,p(j)}^{j,(\kappa)}(\mathbf{V}) \triangleq
2\Re\bigl\{\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,p(j)}
(\mathbf{H}_{i,i,j}\mathbf{V}_{i,p(j)})^*\bigr\} && \nonumber\\
-\ \bigl|\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,p(j)}\bigl|^2 &&\; > 0.\qquad
\end{IEEEeqnarray}
Analogously,
\begin{IEEEeqnarray}{rCl}
r^{p(j)}_{i,p(j)}(\mathbf{V})&\geq&r^{p(j), (\kappa)}_{i,p(j)}(\mathbf{V}) \nonumber\\
&\triangleq&a\bigl(z_{i,p(j)}^{p(j),(\kappa)}\bigl) -
b\bigl(z_{i,p(j)}^{p(j),(\kappa)}\bigl)\displaystyle\frac{{\mathbf{\mathcal{ M}}}_{i,p(j)}^{p(j)}(\mathbf{V})}
{\varphi_{i,p(j)}^{p(j),(\kappa)}(\mathbf{V})}\qquad
\end{IEEEeqnarray}
with
\begin{IEEEeqnarray}{rCl}
\varphi_{i,p(j)}^{p(j),(\kappa)}(\mathbf{V}) \triangleq&& \Re\bigl\{\mathbf{H}_{i,i,p(j)}\mathbf{V}^{(\kappa)}_{i,p(j)}\bigl\}
\Bigl(2\Re\bigl\{\mathbf{H}_{i,i,p(j)}\mathbf{V}_{i,p(j)}\bigl\} \nonumber \\
&& -\ \Re\bigl\{\mathbf{H}_{i,i,p(j)}\mathbf{V}^{(\kappa)}_{i,p(j)}\bigl\}\Bigl) \nonumber
\end{IEEEeqnarray}
over the trust region
\begin{equation}\label{trb2}
2\Re\bigl\{\mathbf{H}_{i,i,p(j)}\mathbf{V}_{i,p(j)}\bigl\}-\Re\bigl\{\mathbf{H}_{i,i,p(j)}\mathbf{V}^{(\kappa)}_{i,p(j)}\bigl\}\; > 0,
\end{equation}
and
\begin{IEEEeqnarray}{rCl}
r_{i,j}(\mathbf{V})&\geq& r^{(\kappa)}_{i,p(j)}(\mathbf{V}) \nonumber\\
&\triangleq&a(z_{i,j}^{(\kappa)})-
b(z_{i,j}^{(\kappa)})\displaystyle\frac{{\mathbf{\mathcal{ M}}}_{i,j}^{p}(\mathbf{V})}{ \varphi_{i,j}^{(\kappa)}(\mathbf{V})}
\end{IEEEeqnarray}
with
\begin{IEEEeqnarray}{rCl}
\varphi_{i,j}^{(\kappa)}(\mathbf{V}) \triangleq&&\ \Re\bigl\{\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,j}\bigl\}
\Bigl(2\Re\bigl\{\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\bigl\} \nonumber\\
&&-\ \Re\bigl\{\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,j}\bigl\}\Bigl) \nonumber
\end{IEEEeqnarray}
over the trust region
\begin{equation}\label{trb3}
2\Re\bigl\{\mathbf{H}_{i,i,j}\mathbf{V}_{i,j}\bigl\}-\Re\bigl\{\mathbf{H}_{i,i,j}\mathbf{V}^{(\kappa)}_{i,j}\bigl\} > 0.
\end{equation}
In Algorithm \ref{alg_Tailored_FW}, we propose an QP-based path-following algorithm to solve problem (\ref{beam1}). At
the $\kappa$-th iteration it solves the following SOC program to generate the next feasible point $\mathbf{V}^{(\kappa+1)}$:
\begin{IEEEeqnarray}{rCl}\label{beamk}
&& \underset{\mathbf{V}}{\max} \quad \mathcal{P}^{(\kappa)}(\mathbf{V}) \triangleq\sum_{i=1}^N\sum_{j=1}^K \Bigl(r_{i,j}^{(\kappa)}(\mathbf{V})+r_{i,p(j)}^{(\kappa)}(\mathbf{V}) \Bigl) \IEEEyessubnumber \qquad\\
&& {\mathrm{subject\ to}}\ r^{j,(\kappa)}_{i,p(j)}(\mathbf{V})\geq r_{i,p(j)}, \ \forall i\in\mathcal{I},\ \forall j\in\mathcal{K}_2, \IEEEyessubnumber \\
&&\qquad\qquad\ \eqref{beam1e}, (\ref{beam1be}), (\ref{beam1ce}), (\ref{trb1}), (\ref{trb2}), (\ref{trb3}) \IEEEyessubnumber
\end{IEEEeqnarray}
where $r_{i,p(j)}^{(\kappa)}(\mathbf{V}) \triangleq \min\Bigl\{r^{j, (\kappa)}_{i,p(j)}(\mathbf{V}), r^{p(j), (\kappa)}_{i,p(j)}(\mathbf{V})\Bigr\}$.
\begin{algorithm}[t]
\caption{Tailored QP-based path-following algorithm for the
STM \eqref{beam1} in MISO-NOMA}\label{alg_Tailored_FW}
\begin{algorithmic}
\STATE \textbf{Initialization}: Initialize a feasible point $\mathbf{V}^{(0)}$ for constraints in (\ref{beam1}).
\STATE \textbf{$\kappa$-th iteration}: Solve the convex quadratic program (\ref{beamk}) to find the optimal solution $\mathbf{V}^{\star}$. If $\bigr|\bigl({\cal P}(\mathbf{V}^{\star}) - \mathcal{P}(\mathbf{V}^{(\kappa)})\bigr) \big/ \mathcal{P}(\mathbf{V}^{(\kappa)}) \bigl| \le \epsilon$, terminate. Otherwise, set $\kappa :=\kappa+1, \mathbf{V}^{(\kappa)}:=\mathbf{V}^{\star}$ and continue.
\end{algorithmic}
\end{algorithm}
To find a feasible point for constraints in (\ref{beam1}) for initializing Algorithm \ref{alg_Tailored_FW},
initialized by a feasible point $\mathbf{V}^{(0)}$ for
the convex constraints (\ref{beam1e}), (\ref{beam1be}), and (\ref{beam1ce}), the following SOC based iterations
\begin{IEEEeqnarray}{rCl}\label{beami}
&&\max_{\mathbf{V}} \min_{(i,j)\in\mathcal{S}_2}\ \Biggl\{\frac{r^{j,(\kappa)}_{i,p(j)}
(\mathbf{V})}{r_{i,p(j)}}\Biggr\} \quad \IEEEyessubnumber\\
&&{\mathrm{subject\ to}}\quad
\eqref{beam1e}, (\ref{beam1be}), (\ref{beam1ce}), (\ref{trb1})\IEEEyessubnumber
\end{IEEEeqnarray}
are invoked for reaching a value more or equal to $1$ in satisfying constraints in (\ref{beam1}).
\textit{Complexity analysis:} The SOC program \eqref{beamk} involves $m_{\text{SOC}}=N(1+6K)$ quadratic or
SOC constraints and $n=KN(2N_tL+1)$ real decision variables. Its computational complexity is $\mathcal{O}(n^2m_{\text{SOC}}^{2.5}+m_{\text{SOC}}^{3.5})$, which is seen higher than that of
the convex quadratic problem \eqref{RmtgFWA}.
\section{Numerical Results}\label{sec:simulation}
In this section we use numerical examples to evaluate the performance of the proposed algorithms.
A system topology shown in Fig. \ref{fig:SM:RatePerUE} is set up. There are
$N=3$ macro cells and $4$ UEs per cell with two cell-center UEs and two cell-edge UEs, which are
located near to the boundaries with the two adjacent cells. Unless stated otherwise, $N_t = 4$ and $N_r = 2$
are set for MIMO-NOMA, for which $L=N_r$ is set. Thus, the precoder-matrices $\mathbf{V}_{i,j}$ are of dimension $N_t\times N_r$.
The channel matrix between a BS and a UE at a distance $d$ (in kilometres) is generated as $\mathbf{H}=\sqrt{10^{-\sigma_{\mathsf{PL}}/10}}\tilde{\mathbf{H}}$ \cite{ETSI}. Here, $\sigma_{\mathsf{PL}}$ is the path loss (PL) in dB and the entries of $\tilde{\mathbf{H}}$ are independent and identically distributed complex Gaussian variables with zero mean and unit variance. Without loss of generality, the requirement thresholds for
all UEs are set as $r_{i,j} = r_{i,p(j)}\equiv \bar{\mathsf{R}}$ and the same
power budget $P^{\max}_i = P^{\max},\, \forall i\in\mathcal{I}$ is given to all BSs.
For the ease of reference, the other parameters given in Table \ref{parameter} including $\bar{\mathsf{R}}$
are used. The error tolerance in the proposed Algorithms is set to $\epsilon=10^{-3}$. The numerical results are obtained using the parser YALMIP \cite{L04}. The achieved sum throughput results are divided by $\ln(2)$ to arrive at the unit of bps/channel-use.
Each simulation is run $100$ times and the result are averaged to arrive at the final figures.
\begin{figure}[t]
\centering
\includegraphics[width=0.45\textwidth,trim={0cm 0.0cm -0cm -0cm}]{Simulation1.eps}
\caption{MIMO-NOMA multi-cell system.}
\label{fig:SM:RatePerUE}
\end{figure}
\begin{table}[t]
\caption{SIMULATION PARAMETERS}
\label{parameter}
\centering
{\setlength{\tabcolsep}{0.695em}
\setlength{\extrarowheight}{0.6em}
\begin{tabular}{l|l}
\hline
Parameters & Value \\
\hline\hline
Carrier frequency/ Bandwidth & 2 [GHz]/ 20 [MHz] \\
Noise power density & -174 [dBm/Hz] \\
Path loss from the BS to a UE, $\sigma_{\mathsf{PL}}$ & 128.1 + 37.6$\log_{10}(d)$ [dB]\\
Shadowing standard deviation & 8 [dB] \\
Radius of each cell, $r_o$ & 500 [m]\\
Coverage of near UEs, $r_n$ & 150 [m]\\
Distance between BS and nearest UE & $>$ 10 [m]\\
Threshold $\bar{\mathsf{R}}$ & 1 [bps/Hz] \\
\hline
\end{tabular}}
\end{table}
\subsection{Algorithms' Convergence}
\begin{figure}
\begin{center}
\begin{subfigure}[MIMO-NOMA networks.]{
\includegraphics[width=0.49\textwidth]{ConvergenceRate_MIMO.eps}}
\label{fig:a}
\end{subfigure}
\begin{subfigure}[MISO-NOMA networks.]{
\includegraphics[width=0.49\textwidth]{ConvergenceRate_MISO.eps}}
\label{fig:b}
\end{subfigure}
\caption{Convergence pattern for $P^{\max} = 30$ dBm.}\label{fig:Convergencebehavior:Iteration}
\end{center}
\end{figure}
Fig.~\ref{fig:Convergencebehavior:Iteration} shows the typical convergence behavior of the proposed algorithms for a given set of channel realizations that are randomly generated for the two cases.
According to Fig.~\ref{fig:Convergencebehavior:Iteration}(a), both Algorithm~\ref{alg_SCALE_FW} and \ref{alg_SDP_FW}
for MIMO-NOMA reach the almost optimal value of sum throughput in $18$ and $13$ iterations.
As expected, Algorithm~\ref{alg_SDP_FW} converges faster than Algorithm~\ref{alg_SCALE_FW}.
On the other hand, according to Fig.~\ref{fig:Convergencebehavior:Iteration}(b), Algorithm~\ref{alg_Tailored_FW} for NOMA-MISO
converges very fast reaching the optimal value in 6 iterations.
\subsection{Numerical Results for MIMO-NOMA}
\begin{figure}
\begin{center}
\begin{subfigure}[Sum throughput versus $P^{\max}$.]{
\includegraphics[width=0.48\textwidth]{NOMA_MIMO_Pmax.eps}}
\label{fig:SRMMIMO:Pmax}
\end{subfigure}
\begin{subfigure}[Sum throughput versus $\bar{\mathsf{R}}$ with $P^{\max} = 30$ dBm.]{
\includegraphics[width=0.48\textwidth]{NOMA_MIMO_Rbar.eps}}
\label{fig:SRMMIMO:Rbar}
\end{subfigure}
\caption{Sum throughput of MIMO-NOMA, (a) versus the transmit power at the BSs and (b) versus the throughput threshold ($N = 3, K = 2, N_t = 4$, and $N_r = 2$).}\label{fig:SRMMIMO:PmaxRbar}
\end{center}
\end{figure}
\begin{table}[t]
\centering
\caption{Achieved User Throughput (bps/Hz) in Multi-user MIMO Multi-cell Systems for $\bar{\mathsf{R}} = 0$ bps/Hz}
\label{Table:RateperUENoQoS}
{\setlength{\tabcolsep}{0.50em}
\setlength{\extrarowheight}{0.65em}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\multicolumn{1}{|c|}{\multirow{2}{*}{}} & \multicolumn{3}{c|}{Throughput per UE} & \multicolumn{3}{c|}{ST per cell} \\ \cline{2-7}
\multicolumn{1}{|c|}{} & NOMA & CoMP & DPC & \multicolumn{1}{c|}{NOMA} & \multicolumn{1}{c|}{CoMP} & \multicolumn{1}{c|}{DPC} \\ \hline
UE (1,1) & 6.36 & 8.27 & 9.43 & \multirow{4}{*}{18.48} & \multirow{4}{*}{19.11} & \multirow{4}{*}{22.54} \\ \cline{1-4}
UE (1,2) & 7.13 & 9.39 & 7.86 & & & \\ \cline{1-4}
UE (1,3) & 1.39 & 1.07 & 3.27 & & & \\ \cline{1-4}
UE (1,4) & 3.60 & 0.38 & 1.98 & & & \\ \hline
UE (2,1) & 5.96 & 9.70 & 10.76 & \multirow{4}{*}{18.50} & \multirow{4}{*}{23.35} & \multirow{4}{*}{24.01} \\ \cline{1-4}
UE (2,2) & 7.02 & 7.87 & 8.93 & & & \\ \cline{1-4}
UE (2,3) & 3.59 & 2.19 & 2.69 & & & \\ \cline{1-4}
UE (2,4) & 1.93 & 3.59 & 1.63 & & & \\ \hline
UE (3,1) & 5.04 & 7.62 & 10.06 & \multirow{4}{*}{21.27} & \multirow{4}{*}{19.25} & \multirow{4}{*}{22.62} \\ \cline{1-4}
UE (3,2) & 7.30 & 8.44 & 8.24 & & & \\ \cline{1-4}
UE (3,3) & 4.40 & 0.63 & 2.86 & & & \\ \cline{1-4}
UE (3,4) & 4.53 & 2.56 & 1.46 & & & \\ \hline
\multicolumn{4}{|c|}{Total ST} & \underline{\textbf{58.25}} & \underline{\textbf{61.71}} & \underline{\textbf{69.17}} \\ \hline
\end{tabular}}
\end{table}
For the ease of reference, the result achieved by \eqref{CoMPobj} is labeled by ``Conventional MIMO-CoMP'' whereas
that achieved by \eqref{Rmtgor} is labeled by ``Proposed MIMO-NOMA.'' Fig.~\ref{fig:SRMMIMO:PmaxRbar}(a) plots
the sum throughput versus the power budget $P^{\max}$ under setting $\bar{\sf R} = \{0,1\} $ bps/Hz.
For $\bar{\sf R}=0$ bps/Hz, i.e. there is no UEs' QoS requirement imposed, CoMP slightly outperforms
MIMO-NOMA by achieving throughput concentrated at the cell-center UEs of good conditions.
Table~\ref{Table:RateperUENoQoS} details the UEs's throughput distribution for $P^{\max}=30$ dBm.
The high ratio $9.39/0.38=24.7$ between the best UE throughput and the worst UE throughput (BWR) implies that CoMP would
perform wobbly in the QoS maximization problem (\ref{qos}) (with $r_{i,j}\equiv 1$), which also expresses the
system ability to offer the uniform service to UEs. BWR for MIMO-NOMA is $5.1=7.13/1.39$ so it is expected to outperform
CoMP in maximizing (\ref{qos}). The low throughput $1.46$ bps/Hz
at UE $(3,4)$ by DPC is a result of a strong interference from an adjacent cell, which cannot be mitigated by DPC.
For $\bar{\sf R}=1$ bps/Hz, MIMO-NOMA of course offers a higher sum throughput than
CoMP, where the BSs are seen spending a nearly full power budget
$P^{\max}$ in gaining the sum throughput. Increasing $P^{\max}$ also leads to a remarkable gain
in sum throughput by NOMA compared with CoMP. The sum throughput by the former also catches up
that by DPC. The gain of MIMO-NOMA is a result of canceling interference from intra-cluster interference, as shown in \eqref{eq:Mipjpj}. The cell-center UEs in CoMP experience intra-cluster interference that becomes stronger when transmit power increases.
The plot of sum throughput versus QoS requirement threshold $\bar{\mathsf{R}}\in[0.6,\,2.4]$ bps/Hz is shown by Fig.~\ref{fig:SRMMIMO:PmaxRbar}(b) for $P^{\max} = 30$ dBm. The sum throughput are nearly flat for $\bar{\mathsf{R}} \leq 1.2$ bps/Hz and are degraded after that.
The BSs in CoMP must allocate much more power to serve cell-edge UEs when QoS threshold increases. As a result,
the system sum throughput is dropped quickly.
In contrast, the sum throughput of MIMO-NOMA is still slightly sensitive to QoS requirement threshold
because BSs can tune the power allocation in meeting cell-edge UEs' QoS requirements
whenever the cell-center UEs' QoS requirement is easily met.
\begin{figure}
\begin{center}
\begin{subfigure}[Sum throughput versus $K$ with $N_t = 4$.]{
\includegraphics[width=0.48\textwidth]{NOMA_MIMO_K.eps}}
\label{fig:SRMMIMO:K}
\end{subfigure}
\begin{subfigure}[Sum throughput versus $N_t$ with $K = 2$.]{
\includegraphics[width=0.48\textwidth]{NOMA_MIMO_Nt.eps}}
\label{fig:SRMMIMO:N}
\end{subfigure}
\caption{Sum throughput of the MIMO-NOMA, (a) versus the number of clusters per cell and (b) versus the number of transit antennas at the BS ($N = 3, N_r = 2$, and $P^{\max} = 30$ dBm).}\label{fig:SRMMIMO:KN}
\end{center}
\end{figure}
Fig.~\ref{fig:SRMMIMO:KN} shows the impact of the number of UEs per cell and the number of transmit antennas at the BS on the performance of the system. Fig.~\ref{fig:SRMMIMO:KN}(a) shows that MIMO-NOMA can deliver an
acceptable sum throughput for large $K$. Again, MIMO-NOMA outperforms CoMP in all $K$.
The sum throughput of the both systems decreases from a certain value of $K$
where there is not much degree-of-freedom (DoF) for leveraging multi-user diversity. Interestingly, MIMO-NOMA achieves its best
sum throughput for $K=3$ (6 UEs) while CoMP is peaked at $K=2$ (4 UEs).
Of course, these numbers are not magic and can be changed in other settings. Fig.~\ref{fig:SRMMIMO:KN}(b)
plots the sum throughput vs the number $N_t$ of antennas at the BSs.
\begin{table}[t]
\centering
\caption{Achieved User Throughput (bps/Hz) in Multi-user MIMO Multi-cell Systems}
\label{Table:RateperUE}
{\setlength{\tabcolsep}{0.45em}
\setlength{\extrarowheight}{0.65em}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{} & \multicolumn{2}{c|}{Throughput per UE} & \multicolumn{2}{c|}{ST per cell} & \multicolumn{2}{c|}{Total ST} \\ \cline{2-7}
& CoMP & NOMA & CoMP & NOMA & CoMP &NOMA \\ \hline
UE (1,1) &8.37&7.83& \multirow{4}{*}{20.68} & \multirow{4}{*}{27.16} & \multirow{12}{*}{\underline{\textbf{59.63}}} & \multirow{12}{*}{\underline{\textbf{77.23}}} \\ \cline{1-3}
UE (1,2) &8.74&7.62& & & & \\ \cline{1-3}
UE (1,3) &2.32&5.12& & & & \\ \cline{1-3}
UE (1,4) &1.25&6.59& & & & \\ \cline{1-5}
UE (2,1) &7.81&7.56& \multirow{4}{*}{18.76} & \multirow{4}{*}{24.34} & & \\ \cline{1-3}
UE (2,2) &6.31&6.24& & & & \\ \cline{1-3}
UE (2,3) &3.13&5.78& & & & \\ \cline{1-3}
UE (2,4) &1.51&4.76& & & & \\ \cline{1-5}
UE (3,1) &9.01&8.86& \multirow{4}{*}{20.19} & \multirow{4}{*}{25.73} & & \\ \cline{1-3}
UE (3,2) &6.25&6.92& & & & \\ \cline{1-3}
UE (3,3) &1.89&6.33& & & & \\ \cline{1-3}
UE (3,4) &3.04&3.62& & & & \\ \hline
\end{tabular}}
\end{table}
Table~\ref{Table:RateperUE} details the throughput at UEs under setting $N_t=6$ and $P^{\max}=30$ dBm.
Under the same QoS requirement threshold for UEs, the CoMP's throughput is mostly contributed
by the cell-center UEs, i.e. CoMP still tends to punish the cell-edge UEs, who are in poor channel condition.
Raising the QoS requirement for the cell-edge UEs to counter this discrimination would lead to the risk of
CoMP service feasibility. In contrast, in maximizing the system's throughput, MIMO-NOMA offers
much fairer and balanced services without contrasting the QoS requirement thresholds so it is very suitable for new
quality-of-experience (QoE) services for cell-edge UEs.
\begin{figure}
\begin{center}
\begin{subfigure}[CDF versus sum throughput for $P^{\max} = 15$ dBm.]{
\includegraphics[width=0.48\textwidth]{CDF_MIMO15dBm.eps}}
\label{fig:CDF:b}
\end{subfigure}
\begin{subfigure}[CDF versus sum throughput for $P^{\max} = 30$ dBm.]{
\includegraphics[width=0.48\textwidth]{CDF_MIMO30dBm.eps}}
\label{fig:CDF:a}
\end{subfigure}
\caption{CDF of the sum throughput (a) for $P^{\max} = 30$ dBm and (b) for $P^{\max} = 15$ dBm with $N = 2, K = 4, N_t = 5$, and $ N_r = 4$.}\label{fig:CDFMIMO}
\end{center}
\end{figure}
By Fig.~\ref{fig:CDFMIMO},
the system's throughput achieved by the proposed precoder design is compared to that achieved by
signal alignment MIMO-NOMA (SA MIMO-NOMA) \cite{DSP16} and interfering channel alignment CoMP MIMO-NOMA (ICA-CoMP MIMO-NOMA) \cite{ShinComL16} in the two-cell scenario with $K = 4$ users, $N_t = 5$, while $ N_r = 4$ is set to make the signal
and channel alignment feasible. In SA MIMO-NOMA, the inter-cluster interference is canceled
by detection vectors based SA technique at the UEs and zero-forcing (ZF) based precoder matrix at the BSs. In ICA-CoMP MIMO-NOMA,
a receive beamformer is constructed at the cell-edge UEs to align the interfering channels, and then a transmit beamformer based on the null space at the BS is designed to ensure zero inter-cell and inter-cluster interference. For the cell-center UEs, a ZF decoder is designed to cancel the inter-cluster interference only. To ensure a fair comparison, it is additionally
assumed that the cell-center UEs do not experience inter-cell interference as
they are far away from the neighboring cell in practice \cite{ShinComL16}.
The two different settings of $P^{\max}$ = (15 dBm, 30 dBm), according to 3GPP TR 36.942 v.9.0.1 with a 46-dBm
maximum transmit power for the 20 MHz bandwidth are under consideration.
Fig.~\ref{fig:CDFMIMO} plots the cumulative distribution function (CDF) of the sum throughput. As expected, MIMO-NOMA outperforms both ICA-CoMP MIMO-NOMA and SA MIMO-NOMA. Specifically,
by controlling the interference to the cell-edge UEs more efficiently, MIMO-NOMA reaches
1.5 bps/Hz and 5.9 bps/Hz higher than the ICA-CoMP MIMO-NOMA and SA MIMO-NOMA, respectively, in about $60\%$ of the simulated trials with $P^{\max}$ = 15 dBm (see Fig.~\ref{fig:CDFMIMO}(a)). With $P^{\max}$ = 30 dBm, it is even more essential (see Fig.~\ref{fig:CDFMIMO}(b)).
\subsection{Numerical Results for MISO-NOMA}
\begin{figure}[t]
\centering
\includegraphics[width=0.48\textwidth,trim={0cm 0.0cm -0cm -0cm}]{NOMA_MISO_Nt.eps}
\caption{Average sum throughput of the MISO-NOMA versus the number of transit antennas at the BS ($N = 3, K = 2$, and $P^{\max} = 30$ {dBm}).}
\label{fig:SRMMISO:N}
\end{figure}
\begin{figure}[t]
\centering
\includegraphics[width=0.48\textwidth,trim={0cm 0.0cm -0cm -0cm}]{CDF_MISO.eps}
\caption{CDF of the sum throughput for two different settings of the transmit power ($N = 3, K = 2, N_t = 6$, and $ N_r = 1$).}
\label{fig:SRMMISO:CDF}
\end{figure}
The performance of MISO-NOMA achieved by \eqref{beam1} is compared to that achieved
by the two-stage beamforming in \cite{Choi15}. The key idea of the two-stage beamforming
is that ZF beamforming is employed at the BS first to cancel the inter-pair interference and
then SIC is used for each pair of UEs. The optimal solution for two-stage beamforming can be easily found by using Algorithm~\ref{alg_Tailored_FW}.
Fig.~\ref{fig:SRMMISO:N} plots the total sum throughput vs. the number of transmit antennas at the BS
under setting $N=3$, $K=2$ and $P^{\max} = 30$ dBm. Note that two-stage beamforming requires $N_t\geq 2(K-1) + 2=4$.
Unsurprisingly, MISO-NOMA achieves a better sum throughput than the two-stage beamforming.
Two-stage beamforming achieves closer performance to MISO-NOMA as the number $N_t$
of transmit antennas increases, providing more degrees of freedom to leverage multi-user diversity.
Fig.~\ref{fig:SRMMISO:CDF} plots the CDF of the sum throughput at $N_t = 6$.
The performance gap is narrower at a higher power budget.
\subsection{Comparison for Different Cluster Sizes}
\begin{figure}
\begin{center}
\begin{subfigure}[Simulation setup considered in Fig.~\ref{fig:SRM3UE}(b) and Fig.~\ref{fig:SRM3UE}(c) with $r_n = 100 $ m, $r_m = 250 $ m, and $r_o = 500 $ m.]{
\includegraphics[width=0.35\textwidth]{Simulationlayout_3UE.eps}}
\label{fig:SRM3UE:a}
\end{subfigure}
\begin{subfigure}[Average sum throughput of the MIMO-NOMA versus $\bar{\mathsf{R}}$ for $N_r = 2$.]{
\includegraphics[width=0.47\textwidth]{SRM_clustersizeMIMO.eps}}
\label{fig:SRM3UE:b}
\end{subfigure}
\begin{subfigure}[Average sum throughput of the MISO-NOMA versus $\bar{\mathsf{R}}$ for $N_r = 1$.]{
\includegraphics[width=0.47\textwidth]{SRM_clustersizeMISO.eps}}
\label{fig:SRM3UE:c}
\end{subfigure}
\caption{Average sum throughput (b) for the MIMO-NOMA, and (c) for the MISO-NOMA with different cluster sizes ($N_t = 12$ and $P^{\max} = 30$ dBm).}\label{fig:SRM3UE}
\end{center}
\end{figure}
As the last numerical example, we investigate the system performance
in a single-cell scenario of more than two UEs grouped to create a virtual cluster for NOMA. There are 6 UEs in total,
which are randomly placed in three different areas, as shown by Fig.~\ref{fig:SRM3UE}(a). Two cell-center UEs
are located inside the disc of radius $r_n$ = 100 m, two cell-middle UEs
are located inside the ring of inner radius $100$ m and outer radius $250$ m, and
two cell-edge UEs are located inside the ring of inner radius $250$ m and outer radius $500$ m.
Different cluster sizes are considered: two UEs per cluster, three UEs per cluster, and six UEs per cluster.
For two-UE-per-cluster, a cell-center UE is randomly paired with a cell-middle UE, while the other
is randomly paired with a cell-edge UE. The unpaired cell-middle UE and cell-edge are then paired to create the third cluster.
There are two scenarios in grouping for three-UE-per-cluster.
\begin{itemize}
\item scenario-1 (\textit{more distinct channel conditions}): each cluster consists of a cell-center UE, a cell-middle UE
and a cell-edge UE;
\item scenario-2 (\textit{less distinct channel conditions}): each cluster consists of a cell-center UE.
\end{itemize}
The order of decoding messages for UEs in the same cluster of size three is as follows:
the message for a cell-edge UE is decoded by all UEs, the message for a cell-middle UE is decoded by itself and the third
UE by canceling the previously decoded message for the cell-edge UE from the intra-cluster,
and the message for the third UE is decoded by itself only by canceling all previously decoded messages from the
intra-cluster interference. Analogously, the messages for UEs $(1,1)$, $(1,2)$, $(1,3)$, $(1,4)$, $(1,5)$ and $(1,6)$
are successively decoded and canceled from the intra-cell interference in the case of six-UE-per-cluster, i.e. all UEs
of the same cell have NOMA.
The proposed algorithms are easily adapted for solution of the corresponding sum throughput maximization problems.
Fig.~\ref{fig:SRM3UE}(b) and Fig.~\ref{fig:SRM3UE}(c) plot the sum throughput
achieved by different clustering versus throughput threshold for MIMO-NOMA and MISO-NOMA
under setting $N_t = 12$ and $P^{\max} = 30$ dBm.
In general, the sum throughput achieved by the three-UE-per-cluster and six-UE-per-cluster based schemes are
dropped less than that achieved by two-UE-per-cluster based one when the threshold
$\bar{\mathsf{R}}$ raises. Specifically, in Fig.~\ref{fig:SRM3UE}(b), the sum throughput
of the three-UE scenario 2 and six-UE are worse than the two-UE for $\bar{\mathsf{R}} < 2.4$ bps/Hz and vice versa. The BS will allocate a much higher transmit power to the UE of the worst channel condition
in the three-UE and six-UE schemes than in the two-UE scheme to meet the QoS constraints. In other words, the cell-edge UEs' throughput is significantly improved in larger cluster sizes.
Notably, the sum throughput by three-UE scenario 1 catches up that by DPC
for larger $\bar{\mathsf{R}}$ in both Fig.~\ref{fig:SRM3UE}(b) and Fig.~\ref{fig:SRM3UE}(c).
In addition, six-UE scheme cannot provide a good sum throughput since large UEs per cluster may have error propagation in SIC leading to drastically reduce NOMA performance. Another interesting observation
is that the sum throughput of the three-UE scenario 1 outperforms that of the other schemes. Recalling that NOMA is more efficient by exploiting their channel condition differences, i.e. 3-UE scenario 1 with more distinct channel conditions. Consequently, a larger cluster size is recommended for more distinct channel conditions while a smaller cluster size is recommended for less distinct channel conditions.
\section{Conclusions}\label{sec:conclusion}
We have addressed the problem of sum throughput maximization in NOMA based systems
by proposing new path-following optimization algorithms. Numerical examples with realistic parameters have confirmed
their fast convergence to an optimal solution. They reveal that NOMA not only helps
increase the cell-edge UEs' throughput substantially but also achieves much higher total sum throughput.
The appropriate size of UE cluster with more distinctive channel gains has also been shown to achieve
remarkable gains in NOMA systems.
\section*{Appendix A: Proof for inequality (\ref{in1})}
By \cite[Appendix B]{RTKN14}
\begin{IEEEeqnarray}{rCl}
\bigl(\alpha \mathbf{V}_1+\beta\mathbf{V}_2\bigr)^H\bigl(\alpha\mathbf{X}_1+\beta\mathbf{X}_2\bigl)^{-1}\bigl(\alpha \mathbf{V}_1+\beta\mathbf{V}_2\bigl)
\preceq&& \nonumber\qquad\\
\alpha \mathbf{V}_1^H\mathbf{X}_1^{-1}\mathbf{V}_1+
\beta\mathbf{V}_2^H\mathbf{X}_2^{-1}\mathbf{V}_2&&
\end{IEEEeqnarray}
for all $\alpha\geq 0$, $\beta\geq 0$, $\alpha+\beta=1$ and $\mathbf{V}_1$, $\mathbf{V}_2$, $\mathbf{X}_1\succ \mathbf{0} $,
$\mathbf{X}_2\succ \mathbf{0} $. This means for all $\mathbf{x}$, function
\begin{IEEEeqnarray}{rCl}
f(\mathbf{V},\mathbf{X})=\mathbf{x}^H\mathbf{V}^H\mathbf{X}^{-1}\mathbf{V}\mathbf{x}
\end{IEEEeqnarray}
is convex. Then, for all $\mathbf{V}$, $\bar{\mathbf{V}}$, $\mathbf{X}\succ \mathbf{0} $,
$\bar{\mathbf{X}}\succ \mathbf{0} $ it is true that \cite{Tuybook}
\begin{IEEEeqnarray}{rCl}
f(\mathbf{V},\mathbf{X})&\geq& f(\bar{\mathbf{V}},\bar{\mathbf{X}}) + \bigl\langle \nabla f(\bar{\mathbf{V}},\bar{\mathbf{X}}),
(\mathbf{V},\mathbf{X})-(\bar{\mathbf{V}},\bar{\mathbf{X}})\bigl\rangle \nonumber\\
&=&\mathbf{x}^H\Bigl[\bar{\boldsymbol{V}}^H\bar{\boldsymbol{X}}^{-1}\mathbf{V}+
\mathbf{V}^H\bar{\boldsymbol{X}}^{-1}\bar{\boldsymbol{V}} \nonumber\\
&&\qquad\quad -\; \bar{\boldsymbol{V}}^H\bar{\boldsymbol{X}}^{-1}\mathbf{X}\bar{\boldsymbol{X}}^{-1}\bar{\boldsymbol{V}} \Bigl]\mathbf{x},
\end{IEEEeqnarray}
i.e.
\begin{IEEEeqnarray}{rCl}
\mathbf{x}^H\mathbf{V}^H\mathbf{X}^{-1}\mathbf{V}\mathbf{x}\geq \mathbf{x}^H\Bigr[\bar{\boldsymbol{V}}^H\bar{\boldsymbol{X}}^{-1}\mathbf{V}+
\mathbf{V}^H\bar{\boldsymbol{X}}^{-1}\bar{\boldsymbol{V}} \nonumber\\ -
\bar{\boldsymbol{V}}^H\bar{\boldsymbol{X}}^{-1}\mathbf{X}\bar{\boldsymbol{X}}^{-1}\bar{\boldsymbol{V}} \Bigl]\mathbf{x},\
\forall\mathbf{x}\
\end{IEEEeqnarray}
proving (\ref{in1}).
\section*{Appendix B: Proof for inequality (\ref{in2})}
Since function $\ln|\mathbf{X}|$ is concave on $\mathbf{X}\succ \mathbf{0} $, it is true that
\cite{Tuybook}
\begin{IEEEeqnarray}{rCl}
-\ln|\mathbf{A}|\geq -\ln|\mathbf{B}| - \bigl\langle \mathbf{B}^{-1},\mathbf{A}-\mathbf{B}\bigr\rangle, \nonumber\\
\forall\ \mathbf{A}\succ \mathbf{0}, \mathbf{B}\succ \mathbf{0}
\end{IEEEeqnarray}
or equivalently
\begin{IEEEeqnarray}{rCl}
\ln|\mathbf{A}^{-1}|\geq \ln|\mathbf{B}^{-1}| - \bigl\langle \mathbf{B}^{-1},\mathbf{A}-\mathbf{B} \bigl\rangle,\;\nonumber\\
\forall\ \mathbf{A}\succ \mathbf{0}, \mathbf{B}\succ \mathbf{0}. \label{proof28}
\end{IEEEeqnarray}
Then (\ref{in2}) follows by substituting $\mathbf{X}=\mathbf{A}^{-1}$ and $\bar{\mathbf{X}}=\mathbf{B}^{-1}$ into \eqref{proof28}.
\section*{Appendix C: Proof for inequality (\ref{zf8})}
By \cite[Th. 6]{Taetal16} function $\ln (1+x^{-1})$ is convex on $x>0$ so for all $x>0$ and $\bar{x}>0$, it is true that
\cite{Tuybook}
\begin{equation}\label{proof61}
\ln\bigl(1+x^{-1}\bigl) \geq \ln \bigl(1+\bar{x}^{-1}\bigl) + \bigl[(1+\bar{x})^{-1}-\bar{x}^{-1}\bigr](x-\bar{x}).
\end{equation}
Inequality (\ref{zf8}) then follows by substituting $z=x^{-1}$ and $\bar{z}=\bar{x}^{-1}$ into \eqref{proof61}.
\bibliographystyle{IEEEtran}
\balance
| {'timestamp': '2017-06-07T02:06:28', 'yymm': '1706', 'arxiv_id': '1706.01741', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01741'} | arxiv |
\section{Introduction}
The need for search often arises from a person's need to achieve a goal, or a task such as booking travels, buying a house, etc., which would lead to search processes that are often lengthy, iterative, and are characterized by distinct stages and shifting goals. ~\cite{jones2008beyond}. Thus, identifying and representing these tasks properly is highly important for devising search systems that can help end users complete their tasks. It has previously been shown that these task representations can be used to provide users with better query suggestions \cite{hassan2014supporting}, offer improved personalization \cite{mehrotra2015terms,white2013enhancing}, provide better recommendations \cite{zhang2015task}, help in satisfaction prediction \cite{wang2014modeling} and search result re-ranking. Moreover, accurate representations of tasks could also be highly useful in aptly placing the user in the task-subtask space to contextually target the user in terms of better recommendations and advertisements, developing task specific ranking of documents, and developing task based evaluation metrics to model user satisfaction. Given the wide range of applications these tasks representations can be used for, significant amount of research has been devoted to task extraction and representation \cite{lucchese2013discovering,hua2013identifying,kotov2011modeling,jones2008beyond,li2014identifying}.
Task extraction is quite a challenging problem as search engines can be used to achieve very different tasks, and each task can be defined at different levels of granularity. A major limitation in existing task-extraction methods lies in their treatment of search tasks as flat structure-less clusters which inherently lack insights about the presence or demarcation of subtasks associated with individual search tasks. In reality, often search tasks tend to be hierarchical in nature. For example, a search task like planning a wedding involves subtasks like searching for dresses, browsing different hairstyles, looking for invitation card templates, finding planners, among others. Each of these subtasks (1) could themselves be composed of multiple subtasks, and (2) would warrant issuing different queries by users to accomplish them. Hence, in order to obtain more accurate representations of tasks, new methodologies for constructing hierarchies of tasks are needed.
As part of the proposed research, we consider the challenge of extracting hierarchies of search tasks and their associated subtasks from a search log given just the log data without the need of any manual annotation of any sort. In a recent poster we showed that Bayesian nonparametrics have the potential to extract a hierarchical representation of tasks~\cite{mehrotra2015towards}; we extend this model further to form more accurate representations of tasks.
We present an efficient Bayesian nonparametric model for discovering hierarchies and propose a tree based nonparametric model to discover this rich hierarchical structure of tasks/subtasks embedded in search logs. Most existing hierarchical clustering techniques result in binary tree structures with each node decomposed into two child nodes. Given that a complex task could be composed of an arbitrary number of subtasks, these techniques cannot directly be used to construct accurate representations of tasks. In contrast, our model is capable of identifying task structures that can be composed of an arbitrary number of children. We make use of a number of evaluation methodologies to evaluate the efficacy of the proposed task extraction methodology, including quantitative and qualitative analyses along with crowdsourced judgment studies specifically catered to evaluating the quality of the extracted task hierarchies. We contend that the techniques presented expand the scope for better recommendations and search personalization and opens up new avenues for recommendations specifically targeting users based on the tasks they involve in.
\section{Related Work}
Web search logs provide explicit clues about the information seeking behavior of users and have been extensively studied to improve search experiences of users. We cover several areas of related work and discuss how our work relates to and extends prior work.
\subsection{Task Extraction}
There has been a large body of work focused on the problem of segmenting and organizing query logs into semantically coherent structures. Many such methods use the idea of a \textit{timeout} cutoff between queries, where two consecutive queries are considered as two different sessions or tasks if the time interval between them exceeds a certain threshold \cite{catledge1995characterizing,he2002combining,silverstein1999analysis}. Often a 30-minute timeout is used to segment sessions.
However, experimental results of these methods indicate that the timeouts are of limited utility in predicting whether two queries belong to the same task, and unsuitable for identifying session boundaries.
More recent studies suggest that users often seek to complete multiple search tasks within a single search session \cite{mehrotra2016characterizing,lucchese2011identifying} with over 50\% of search sessions having more than 2 tasks \cite{mehrotra2016characterizing}. At the same time, certain tasks require significantly more effort, time and sessions to complete with almost 60\% of complex information gathering tasks continued across sessions \cite{agichtein2012search,ma2008exploring}. There have been attempts to extract in-session tasks \cite{jones2008beyond,lucchese2011identifying,spink2005multitasking}, and cross-session tasks \cite{kotov2011modeling,wang2013learning} from query sequences based on classification and clustering methods, as well as supporting users in accomplishing these tasks \cite{hassan2014supporting}. Prior work on identifying search-tasks focuses on task extraction from search sessions with the objective of segmenting a search session into disjoint sets of queries where each set represents a different task \cite{lucchese2013discovering,hua2013identifying}.
Kotov et al. \cite{kotov2011modeling} and Agichtein et al. \cite{agichtein2012search} studied the problem of cross-session task extraction via binary same-task classification, and found different types of tasks demonstrate different life spans. While such task extraction methods are good at linking a new query to an on-going task, often these query links form long chains which result in a task cluster containing queries from many potentially different tasks. With the realization that sessions are not enough to represent tasks, recent work has started exploring cross-section task extraction, which often results in complex non-homogeneous clusters of queries solving a number of related yet different tasks. Unfortunately, pairwise predictions alone cannot generate the partition of tasks efficiently and even with post-processing, the final task partitions obtained are not expressive enough to demarcate subtasks \cite{liao2012evaluating}. Finally, authors in \cite{li2014identifying} model query temporal patterns using a special class of point process called Hawkes processes, and combine topic model with Hawkes processes for simultaneously identifying and labeling search tasks.
Jones et al. \cite{jones2008beyond} was the first work to consider the fact that there may be multiple subtasks associated with a user's information need and that these subtasks could be interleaved across different sessions. However, their method only focuses on the queries submitted by a single user and attempts to segment them based on whether they fall under the same information need. Hence, they only consider solving the task boundary identification and same task identification problem and cannot be used directly for task extraction. Our work alleviates the same user assumption and considers queries across different users for task extraction. Finally, in a recent poster \cite{mehrotra2015towards}, we proposed the idea of extracting task hierarchies and presented a basic tree extraction algorithm. Our current work extends the preliminary model in a number of dimensions including novel model of query affinities and task coherence based pruning strategy, which we observe gives substantial improvement in results. Unlike past work, we also present detailed derivation and evaluation of the extracted hierarchy and application on task extraction.
\subsection{Supporting Complex Search Tasks}
There has been a significant amount of work on task continuation assistance \cite{morris2008searchbar,agichtein2012search}, building task tours and trails \cite{o2010tweetmotif,singla2010studying}, query suggestions \cite{baeza2005query,jones2006generating,mei2008query}, predicting next search action \cite{cao2009towards} and notes taking when accomplishing complex tasks \cite{donato2010you}. The quality of most of these methods depends on forming accurate representations of tasks, which is the problem we are addressing in this paper.
\subsection{Hierarchical Models}
Rich hierarchies are common in data across many domains, hence quite a few hierarchical clustering techniques have been proposed. The traditional methods for hierarchically clustering data are bottom-up agglomerative algorithms. Probabilistic methods of learning hierarchies have also been proposed \cite{blundell2013bayesian,liu2012automatic} along with hierarchical clustering based methods \cite{heller2005bayesian,chuang2002towards}. Most algorithms for hierarchical clustering construct binary tree representations of data, where leaf nodes correspond to data points and internal nodes correspond to clusters. There are several limitations to existing hierarchy construction algorithms. The algorithms provide no guide to choosing the correct number of clusters or the level at which to prune the tree. It is often difficult to know which distance metric to choose. Additionally and more importantly, restriction of the hypothesis space to binary trees alone is undesirable in many situations - indeed, a task can have any number of subtasks, not necessarily two. Past work has also considered constructing task-specific taxonomies from document collections \cite{yang2012constructing}, browsing hierarchy construction \cite{yang2015browsing}, generating hierarchical summaries \cite{lawrie2003generating}. While most of these techniques work in supervised settings on document collections, our work instead focused on short text queries and offers an unsupervised method of constructing task hierarchies.
Finally, Bayesian Rose Trees and their extensions have been proposed \cite{segal2002probabilistic,blundell2012bayesian,blundell2013bayesian} to model arbitrary branching trees. These algorithms naively cast relationships between objects as binary (0-1) associations while the query-query relationships in general are much richer in content and structure.
We consider a number of such existing methods as baselines and the various advantages of the proposed approach is highlighted in the evaluation section wherein the proposed approach in addition to being more expressive, performs better than state-of-the-art task extraction and hierarchical methods.
\begin{table}[t!]
\centering
\resizebox{!}{!}
{
\begin{tabular}{ll}
\textbf{Symbol} & \textbf{Description}\\
$n_T$ & number of children of tree T\\
$ab|c$ & partition of set $\lbrace a,b,c\rbrace$ into disjoint sets $\lbrace a,b\rbrace$,$\lbrace c\rbrace$\\
ch(T) & children of T\\
$\phi(T)$ & partition of tree T\\
$p(D_m|T_m)$ & likelihood of data $D_m$ given the tree $T_m$\\
$\pi_{T_m}$ & mixing proportions of partition of tree $T$\\
$f(D_m)$ & marginal probability of the data $D_m$\\
$\mathbb{H}(T)$ & set of all partitions of queries $Q = leaves(T)$\\
$f(Q)$ & task affinity function for set of queries Q\\
$r_{q_i,q_j}^k$ & the k-th inter-query affinity between $q_i$ \& $q_j$
\end{tabular}
}
\caption{Table of symbols}
\label{symbols}
\end{table}
\section{Defining Search Tasks}
Jones et al.~\cite{jones2008beyond} was one of the first papers to point out the importance of task representations, where they defined a search task as:
\theoremstyle{definition}
\begin{definition}{}
A \textit{search task} is an atomic information need resulting in one or more queries.
\end{definition}
Ahmed et al.~\cite{hassan2014supporting} later extended this definition to a more generic one, which can also capture task structures that could possibly consist of related subtasks, each of which could be complex tasks themselves or may finally split down into simpler tasks or atomic informational needs. Following Ahmed \textit{et al.}~\cite{hassan2014supporting}, a complex search task can then be defined as:
\theoremstyle{definition}
\begin{definition}{}
A \textit{complex search task} is a multi-aspect or a multi-step information need consisting of a set of related subtasks, each of which might recursively be complex.
\end{definition}\label{ComplexTask}
The definition of complex tasks is much more generic, and captures all possible search tasks, that can be either complex or atomic (non-complex). Throughout this paper we adopt the definition provided in Definition~\ref{ComplexTask}.2 as the definition for a search task.
Hence, by definition a search task has a hierarchical nature, where each task can consist of an arbitrary number of, possibly complex subtasks. An effective task extraction system should be capable of accurately identifying and representing such hierarchical structures.
\begin{table*}[t!]
\centering
{
\begin{tabular}{c|c}
\hline
\multicolumn {2}{c}{\textbf{Query-Term Based Affinity ($r^1$)}} \\
\hline
cosine & cosine similarity between the term sets of the queries\\
\hline
edit & norm edit distance between query strings\\
\hline
Jac & Jaccard coeff between the term sets of the queries\\
\hline
Term & proportion of common terms between the queries\\
\hline
\multicolumn {2}{c}{\textbf{URL Based Affinity ($r^2$)}} \\
\hline
Min-edit-U & Minimum edit distance between all URL pairs from the queries\\
\hline
Avg-edit-U & Average edit distance between all URL pairs from the queries\\
\hline
Jac-U-min & Minimum Jaccard coefficient between all URL pairs from the queries\\
\hline
Jac-U-avg & Average Jaccard coefficient between all URL pairs from the queries\\
\hline
\multicolumn {2}{c}{\textbf{Session/User Based Affinity ($r^3$)}} \\
\hline
Same-U & if the two queries belong to the same user\\
\hline
Same-S & if the two queries belong to the same session\\
\hline
\multicolumn {2}{c}{\textbf{Embedding Based Affinity ($r^4$)}} \\
\hline
Embedding & cosine distance between embedding vectors of the two queries\\
\hline
\end{tabular}
}
\caption{Query-Query Affinities.\label{tab:affinity}}
\end{table*}
\section{Constructing Task Hierarchies}
While hierarchical clustering are widely used for clustering, they construct binary trees which may not be the best model to describe data's intrinsic structure in many applications, for example, the task-subtask structure in our case. To remedy this, multi-branch trees are developed. Currently there are few algorithms which generate multi-branch hierarchies. Blundel \textit{et al.}~\cite{blundell2012bayesian,blundell2013bayesian} adopt a simple, deterministic, agglomerative approach called BRTs (Bayesian Rose Trees) for constructing multi-branch hierarchies. In this work, we adapt BRT as a basic algorithm and extend it for constructing task hierarchies. We next describe the major steps of BRT approach.
\begin{figure}[!]
\centering
\includegraphics[width=0.45\textwidth]{joining.png}
\vspace{-2mm}
\caption{The different ways of merging trees which allows us to obtain tree structures which best explain the task-subtask structure.}\label{fig4}
\vspace{-2mm}
\end{figure}
\subsection{Bayesian Rose Trees}
BRTs~\cite{blundell2012bayesian,blundell2013bayesian} are based on a greedy probabilistic agglomerative approach to construct multi-branch hierarchies. In the beginning,
each data point is regarded as a tree on its own: $T_i = \{x_i\}$ where $x_i$ is the feature vector of i-th data. For each step, the algorithm selects two trees $T_i$ and $T_j$ and merges them into a new tree $T_m$. Unlike binary hierarchical clustering, BRT uses three possible merging operations, as shown in Figure \ref{fig4}:
\begin{itemize}
\item \textbf{Join}: $T_m = {T_i, T_j}$, such that the tree $T_m$ has two children now
\item \textbf{Absorb}: $T_m = {children(T_i) \cup T_j}$, i.e., the children of one tree gets absorbed into the other tree forming an absorbed tree with $>$2 children
\item \textbf{Collapse}: $T_m = {children(T_i) \cup children(T_j)}$, all the children of both the subtrees get combined together at the same level.
\end{itemize}
Specifically, in each step, the algorithm greedily finds two trees $T_i$ and $T_j$ to merge which maximize the ratio of probability:
\begin{equation}
\frac{p(D_{m}|T_m)}{p(D_{i}|T_i)p(D_{j}|T_j)}
\end{equation}
where $p(D_m|T_m)$ is the likelihood of data $D_m$ given the tree $T_m$, $D_m$ is all the leaf data of $T_m$, and $D_m = D_i \cup D_j$
. The probability $p(D_m|T_m)$ is recursively defined on the children of $T_m$:
\begin{equation}
p(D_m | T_m) = \pi_{T_m} f(D_m) + (1 - \pi_{T_m}) \prod_{T_i \in ch(T_m)} p(D_i|T_i)
\end{equation}
where $f(D_m)$ is the marginal probability of the data $D_m$ and $\pi_{T_m}$ is the "\textit{mixing proportion}". Intuitively, $\pi_{T_m}$
is the prior probability that all the data in $T_m$ is kept in one cluster instead of partitioned into sub-trees. In BRT\cite{blundell2012bayesian}, $\pi_{T_m}$ is defined as:
\begin{equation}
\pi_{T_m} = 1 - (1 - \gamma)^{n_{T_m}-1}
\end{equation}
where $n_{T_m}$ is the number of children of $T_m$, and $0 \geq \gamma \leq 1$ is the hyperparameter to control the model. A larger $\gamma$ leads to coarser partitions and a smaller $\gamma$ leads to finer partitions. Table \ref{symbols} provides an overview of notations \& symbols used throughout the paper.
\subsection{Building Task Hierarchies}
We next describe our task hierarchy construction approach built on top of Bayesian Rose Trees. A tree node in our setting is comprised of a group of queries which potentially compose a search task, i.e. these are the set of queries that people tend to issue in order to achieve the task represented in the tree node.
We define the task-subtask hierarchy recursively: T is a task if either T contains all the queries at its node (an atomic search task) or if T splits into children trees as $T = \{T_1,T_2,...,T_{n_T}\}$ where each of the children trees ($T_i$) are disjoint set of queries corresponding to the $n_T$ subtasks associated with task $T$. This allows us to consider trees as a nested collection of sets of queries defining our task-subtask hierarchical relation.
To form nested hierarchies, we first need to model the query data. This corresponds to defining the marginal distribution of the data $f(D_m)$ as defined in Equation 2. The marginal distribution of the query data ($f(D_m)$) helps us encapsulate insights about task level interdependencies among queries, which aid in constructing better task representations. The original BRT approach \cite{blundell2012bayesian} assumes that the data can be modeled by a set of binary features that follow the Bernoulli distribution. In other words, features (that represent the relationship/similarities between data points) are not weighted and can only be binary. Binary (0/1) relationships are too simplistic to model inter-query relationships; as a result, this major assumption fails to capture the semantic relationships between queries and is not suited for modeling query-task relations. To this end, we propose a novel query affinity model and to alleviate the binary feature assumption imposed by BRT, we propose a conjugate model of query affinities, which we describe next.
\subsection{Conjugate Model of Query Affinities}
\label{taskaffinity}
A tree node in our setting is comprised of a group of queries which \textit{potentially} belong to the same search task. The likelihood of a tree should encapsulate information about the different relationships which exists between queries. Our goal here is to make use of the rich information associated with queries and their result set available to compute the likelihood of a set of queries to belong to the same task. In order to do so, we propose a query affinity model which makes use of a number of different inter-query affinities to determine the tree likelihood function.
We next describe the technique used to compute four broad categories of inter-query affinity and later describe the Gamma-Poisson conjugate model which makes use of these affinities to compute the marginal distribution of the data. \\
\noindent\textbf{Query-term based Affinity ($r^1$):}\\
Search queries catering to the same or similar informational needs tend to have similar query terms. We make use of this insight and capture query level affinities between a pair of queries. We make use of cosine similarity between the query term sets, the normalized edit distances between queries and the Jaccard Coefficient between query term sets.\\% We use the summation of all the pairwise similarities between two queries as defined in Query-term part of Table \ref{tab:affinity} as the Query-term based affinity.
\noindent\textbf{URL-based Affinity ($r^2$):}\\
Users tackling similar tasks tend to issue queries (possibly different) which return similar URLs, thus encoding the URL level similarity between pairs of queries into the query affinity model helps in capturing another task-specific similarity between queries. Any query pair having high URL level similarity increase the possibility of the query pair originating from similar informational needs. We capture a number of URL-based signals including minimum and average edit distances between URL domains and jaccard coefficient between URLs.\\% We use the summation of all the pairwise similarities between two queries as defined in URL-based part of \ref{tab:affinity} as the URL-based affinity.\\
\noindent\textbf{User/Session based Affinity ($r^3$):}\\
It is often the case that users issue related queries within a session so as to satisfy their informational need. We leverage this insight by making use of session level information (as a 0/1 binary feature) and user-level information (as a 0/1 binary feature) in our affinity model to identify queries issued in the same session and by the same user accordingly.\\% We sum both user and session information between two queries and assign it as the User/Session based affinity.\\
\noindent\textbf{Query Embedding based Affinity ($r^4$):}\\
Word embeddings capture lexico-semantic regularities in language, such that words with similar syntactic and semantic properties are found to be close to each other in the embedding space. We leverage this insight and propose a query-query affinity metric based on such embeddings. We train a skip-gram word embeddings model where a query term is used as an input to a log-linear classifier with continuous projection layer and words within a certain window before and after the words are predicted. To obtain a query's vector representation, we average the vector representations of each of its query terms and compute the cosine similarity between two queries' vector representations to quantify the embedding based affinity ($r^4$).
Table \ref{tab:affinity} summarizes all features considered to compute these affinities. Our goal is to capture information from all four affinities when defining the likelihood of the tree. We assume that the global affinity among a group of queries can be decomposed into a product of independent terms, each of which represent one of the four affinities from the query-group. For each query group $Q$, we take the normalized sum of the affinities from all pairs of queries in the group $Q$ to form each of the affinity component ($r^k$, k={1,2,3,4}).
Poisson models have been shown as effective query generation models for information retrieval tasks \cite{mei2007study}. While these affinities could be used with a lot of distributions, in the interest of computational efficiency and to avoid approximate solutions, our model will use a hierarchical Gamma-Poisson distribution to encode the query-query affinities. We incorporate the gamma-Poisson conjugate distribution in our model under the assumptions that the query affinities are discretized and for a group of queries $Q$, the affinities can be decomposed to a product of independent terms, each of which represents contributions from the four different affinity types. Finally, for a tree ($T_m$) consisting of the data ($D_m$), i.e. the set of queries $Q$, we define the marginal likelihood as:
\begin{equation}
f(D_m) = f(Q) = \prod_{k=1}^{k=4} p \bigg( \sum_{i \in 1 \cdots |Q|}\sum_{j \in 1 \cdots |Q|}r^k_{q_i,q_j} | \alpha_k, \beta_k\bigg)
\end{equation}
where $\alpha_k$ \& $\beta_k$ are respectively the shape parameter \& the rate parameter of the four different affinities. Making use of the Poisson-Gamma conjugacy, the probability term in the above product can be written as:
\begin{equation}
p(r|\alpha,\beta) = \int_\lambda p(r|\lambda) p(\lambda|\alpha,\beta)d\lambda
\end{equation}
\begin{equation}
= \Bigg\{ \frac{\Gamma (\alpha +r)}{r!\,\Gamma(\alpha)}\Bigg( \frac{\beta}{\beta +1}\Bigg)^\alpha \Bigg(\frac{1}{\beta +1}\Bigg)^r \Bigg\}
\end{equation}
where $\lambda$ is the Poisson mean rate parameter which gets eliminated from computations because of the Gamma-Poisson conjugacy and where $r$, $\alpha$ \& $\beta$ get replaced by affinity class specific values.
\subsection{Task Coherence based Pruning}
\label{sec:pruning}
The search task extraction algorithm described above provides us a way of constructing a task hierarchy wherein as we go down the tree, nodes comprising of complex multi-aspect tasks split up to provide finer tasks which ideally should model user's fine grained information needs. One key problem with the hierarchy construction algorithm is the continuous splitting of nodes which results in singleton queries occupying the leave nodes. While splitting of nodes which represent complex tasks is important, the nodes representing simple search task queries corresponding to atomic informational needs should not be further split into children nodes. Our goal in this section is to provide a way of quantifying the task complexity of a particular node so as to prevent splitting up nodes representing atomic search task into further subsets of query nodes.
\subsubsection{Identifying Atomic Tasks
We wish to identify nodes capturing search subtasks which represent atomic informational need. In order to do so, we introduce the notion of \textit{Task Coherence}:
\theoremstyle{definition}
\begin{definition}{}
\textit{Task Coherence} is a measure indicating the atomicity of the information need associated with the task. It is captured by the semantic closeness of the queries associated with the task.
\end{definition}\label{TaskCoherence}
By measuring Task Coherence, we intend to capture the semantic variability of queries within this task in an attempt to identify how complex or atomic a task is. For example, a tree node corresponding to a complex task like planning a vacation would involve queries from varied informational needs including flights, hotels, getaways, etc; while a tree node corresponding to a finer task representing an atomic informational need like finding discount coupons would involve less varied queries - all of which would be about discount coupons. Traditional research in topic modelling has looked into automatic evaluation of topic coherence \cite{newman2010automatic} via Pointwise Mutual Information. We leverage the same insights to capture task coherence.
\subsubsection{Pointwise Mutual Information}
PMI has been studied variously in the context of collocation extraction \cite{pecina2010lexical} and is one measure of the statistical independence of observing two words in close proximity. We wish to compute PMI scores for each node of the tree. A tree node in our discussion so far has been represented by a collection of search queries. We split queries into terms and obtain a set of terms corresponding to each node, and calculate a node's PMI scores using the node's set of query terms.
More specifically, the PMI of a given pair of query terms ($w_1$ \& $w_2$) is given by:
\begin{equation}
PMI(w_1,w_2) = log \frac{p(w_1,w_2)}{p(w_1)p(w_2)}
\end{equation}
where the probabilities are determined from the empirical statistics of some full standard collection. We employ the AOL log query set for this and treat two query terms as co-occurring if both terms occur in the same session. For a given task node ($Q$), we measure task coherence as the average of PMI scores for all pairs of the search terms associated with the task node:
\begin{equation}
PMI-Score(Q) = \frac{1}{|w|} \sum^{|w|}_{i=1} \sum^{|w|}_{j=1} PMI(w_i,w_j)
\end{equation}
where $|w|$ represents the total number of unique search terms associated with task node $Q$. The node's PMI-Score is used as the final measure of task coherence for the task represented via the corresponding node.
\subsubsection{Tree Pruning}
We use the task coherence score associated with each node of the task hierarchy constructed, and prune lower level nodes of the tree to avoid aggressive node splitting. The overall motivation here is to avoid splitting nodes which represent simple search tasks associated with atomic informational needs. We scan through all levels of the search task hierarchy obtained by the algorithm described above and for each node compute its task coherence score. If the task coherence score exceeds a specific threshold, it implies that all the queries in this particular node are aimed at solving the same or very similar informational need and hence, we prune off the sub-tree rooted at this particular node and ignore all further splits of this node.
\subsection{Algorithmic Overview}
We summarize the overall algorithm to construct the hierarchy by outlining the steps. The problem is treated as one of greedy model selection: each tree T is a different model, and we wish to find the model that best explains the search log data in terms of task-subtask structure.\\
\noindent\textbf{Step 1: Forrest Initialization}:\\
The tree is built in a bottom-up greedy agglomerative fashion, starting from a forest consisting of n (=$|Q|$) trivial trees, each corresponding to exactly one vertex. The algorithm maintains a forest F of trees, the likelihood $p(i) = p(D_{i}|T_i)$ of each tree $T_i \in F$ and the different query affinities. Each iteration then merges two of the trees in the forest. At each iteration, each vertex in the network is a leaf of exactly one tree in the forest. At each iteration a pair of trees in the forest F is chosen to be merged, resulting in forest $F*$.\\
\noindent\textbf{Step 2: Merging Trees}:\\
At each iteration, the best potential merge, say of trees X and Y resulting in tree I, is picked off the heap. Binary trees do not fit into representing search tasks since a task is likely to be composed of more than two subtasks. As a result, following \cite{blundell2013bayesian} we consider three possible mergers of two trees $T_i$ and $T_j$ into $T_m$. $T_m$ may be formed by joining $T_i$ and $T_j$ together using a new node, giving $T_m = \lbrace T_i, T_j\rbrace$. Alternatively $T_m$ may be formed by absorbing $T_i$ as a child of $T_j$, yielding $T_m = \lbrace T_j\rbrace \bigcup ch(T_i)$, or vice-versa, $T_m = \lbrace T_i\rbrace \bigcup ch(T_j)$. We explain the different possible merge operations in Figure \ref{fig4}. We obtain arbitrary shaped sub-trees (without restricting to binary tress) which are better at representing the varied task-subtask structures as observed in search logs with the structures themselves learnt from log data. Such expressive nature of our approach differentiates it from traditional agglomerative clustering approaches which necessarily result in binary trees.\\
\noindent\textbf{Step 3: Model Selection}:\\
Which pair of trees to merge, and how to merge these trees, is determined by considering which pair and type of merger yields the largest Bayes factor improvement over the current model. If the trees $T_i$ and $T_j$ are merged to form the tree M, then the Bayes factor score is:
\begin{equation}
SCORE(M;I,J) = \frac{p(D_{M}|F*)}{p(D_{M}|F)}
\end{equation}
\begin{equation}
\hspace{4mm} = \frac{p(D_{M}|M)}{p(D_{i}|T_i)p(D_{j}|T_j)}
\end{equation}
where $p(D_{i}|T_i)$ and $p(D_{j}|T_j)$ are given by the dynamic programming equation mentioned above. After a successful merge, the statistics associated with the new tree are updated. Finally, potential mergers of the new tree with other trees in the forest are considered and added onto the heap.
The algorithm finishes when no further merging results in improvement in the Bayes Factor score. Note that the Bayes factor score is based on data local to the merge - i.e., by considering the probability of the connectivity data only among the leaves of the newly merged tree. This permits efficient local computations and makes the assumption that local community structure should depend only on the local connectivity structure.\\
\noindent\textbf{Step 4: Tree Pruning}:\\
After constructing the entire hierarchy, we perform the post-hoc tree pruning procedure described in Section \ref{sec:pruning} wherein we identify atomic task nodes via their task coherence estimates and prune all child nodes of the identified atomic nodes.
\section{Experimental Evaluation}
We perform a number of experiments to evaluate the proposed task-subtask extraction method. First, we compare its performance with existing state-of-the-art task extraction systems on a manually labelled ground-truth dataset and report superior performance (\ref{exp1}). Second, we perform a detailed crowd-sourced evaluation of extracted tasks and additionally validate the hierarchy using human labeled judgments (\ref{exp2}). Third, we show a direct application of the extracted tasks by using the task hierarchy constructed for term prediction (\ref{exp3}).\\% Finally, we present a qualitative analysis of a sample hierarchy extracted (\ref{qualitative}).\\
\noindent\textbf{Parameter Setting:}\\
Unless stated otherwise, we made use of the best performing hyperparameters for the baselines as reported by the authors. The query affinities in the proposed approach were computed from the specific query collection used in the dataset used for each of the three experiments reported below. While hyperparmeter optimization is beyond the scope of this work, we experimented with a range of the shape and inverse scale hyperparameters ($\alpha$, $\beta$) used for the Poison Gamma conjugate model and used the ones which performed best on the validation set for the search task identification results reported in the next section. Additionally, for the tree pruning threshold, we empirically found that a threshold of 0.8 gave the best performance on our toy hierarchies, and was used for all future experiments.
\subsection{Search Task Identification}
\label{exp1}
\noindent To justify the effectiveness of the proposed model in identifying search tasks in query logs, we employ a commonly used AOL data subset with search tasks annotated which is a standard test dataset for evaluating task extraction systems.
We used the task extraction dataset as provided by Lucchese \textit{et al.}\cite{lucchese2011identifying}. The dataset comprises of a sample of 1000 user sessions for which human assessors were asked to manually identify the optimal task-based query sessions, thus producing a ground-truth that can be used for evaluating automatic task-based session discovery methods. For further details on the dataset and the dataset access links, readers are directed to Lucchese \textit{et al.}\cite{lucchese2011identifying}.
We compare our performance with a number of search task identification approaches:
\begin{itemize}
\item \textbf{Bestlink-SVM} \cite{wang2013learning}: This method identified search task using a semi-supervised clustering model based on the latent structural SVM framework.
\item \textbf{QC-HTC/QC-WCC} \cite{lucchese2011identifying}: This series of methods viewed search task identification as the problem of best approximating the manually annotated tasks, and proposed both clustering and heuristic algorithms to solve the problem
\item \textbf{LDA-Hawkes} \cite{li2014identifying}: a probabilistic method for identifying and labeling search tasks that model query temporal patterns using a special class of point process called Hawkes processes, and combine topic model with Hawkes processes for simultaneously identifying and labeling search tasks.
\item \textbf{LDA Time-Window(TW)}: This model assumes queries belong to the same search task only if they lie in a fixed or flexible time window, and uses LDA to cluster queries into topics based on the query co-occurrences within the same time window. We tested time windows of various sizes and report results on the best performing window size.
\end{itemize}
\subsubsection{Metrics}
A commonly used evaluation metric for search task extraction is the pairwise F-measure computed based on pairwise precision/recall \cite{jones2008beyond,kotov2011modeling} defined as,
\begin{equation}
p_{pair} = \frac{\Sigma_{i\le j} \delta(y(q_i),y(q_j))\delta(\hat{y}(q_i),\hat{y}(q_j))}{\delta(\hat{y}(q_i),\hat{y}(q_j))}
\end{equation}
\begin{equation}
r_{pair} = \frac{\Sigma_{i\le j} \delta(y(q_i),y(q_j))\delta(\hat{y}(q_i),\hat{y}(q_j))}{\delta(y(q_i),y(q_j))}
\end{equation}
where $p_{pair}$ evaluates how many pairs of queries predicted in the same task, i.e., $\delta(\hat{y}(q_i),\hat{y}(q_j) = 1$, are actually annotated as in the same task, i.e., $\delta(y(q_i),y(q_j)) = 1$ and $r_{pair}$ evaluates how many pairs annotated as in the same task are recovered by the algorithm.
Thus, globally F-measure evaluates the extent to which a task contains only queries of a particular annotated task and all queries of that task. Given $p_{pair}$ and $r_{pair}$, the F-measure is computed as:$F_1 = \frac{2\times p_{pair}\times r_{pair}}{p_{pair} + r_{pair}}$.
\subsubsection{Results \& Discussion}
Figure \ref{fig5} compares the proposed model with alternative probabilistic models and state-of-the-art task identification approaches by F1 score. To make fair comparisons, we consider the last level of the pruned tree constructed as task clusters when computing pairwise precision/recall values. It is important to note that the labelled dataset has only flat tasks extracted on a per user basis; as a result, this dataset is not ideal for making fair comparisons of the proposed hierarchy extraction method with baselines. Nevertheless, the proposed approach manages to outperform existing task extraction baselines while having much greater expressive powers and providing the subdivision of tasks into subtasks. LDA-TW performs the worst since its assumptions on query relationship within the same search task are too strong. The advantage over QC-HTC and QC-WCC demonstrates that appropriate usage of query affinity information can even better reflect the semantic relationship between queries, rather than exploiting it in some collaborative knowledge.
\begin{figure}[t!]
\centering
\includegraphics[width=0.5\textwidth]{Fscore4.pdf}
\caption{F1 score results on AOL tagged dataset}\label{fig5}
\end{figure}
\begin{table*}[t]
\centering
\resizebox{0.8\textwidth}{!}
{
\begin{tabular}{c|c|c|c|c|c}
& \multicolumn {4}{c}{\textbf{Task Relatedness}} \\
\hline
& \textbf{Proposed} & \textbf{LDA-TW} & \textbf{QC-WCC} & \textbf{LDA-Hawkes} & \textbf{QC-HTC}\\
\hline
Task Related & \textbf{72\%*} & 47\% & 60\% & 67\% & 61\%\\
\hline
Somewhat Related & 20\% & 14\% & 15\% & 13\% & 5\% \\
\hline
Unrelated & \textbf{10\%} & 23\% & 25\% & 20\% & 34\%\\
\hline
\end{tabular}
}
\caption{Performance on Task Relatedness. The results highlighted with * signify statistically significant difference between the proposed approach and best performing baseline using $\chi^2$ test with $p\leq 0.05$.\label{tab:relate}}
\end{table*}
\begin{table}[t!]
\centering
\resizebox{0.5\textwidth}{!}
{
\begin{tabular}{c|c|c|c|c|c}
& \multicolumn {4}{c}{\textbf{Subtask Validity}} \\
\hline
& \textbf{Proposed} & \textbf{Jones} & \textbf{BHCD} & \textbf{BAC}\\%\multicolumn {3}{c}{Purity} & \multicolumn {3}{c}{NMI Scores} & \multicolumn {3}{c|}{PMI Scores}\\
\hline
Valid & \textbf{81\%*} & 69\% & 51\% & 49\%\\
\hline
Somewhat Valid & 8\% & 19\% & 17\% & 21\% \\
\hline
Not Valid & 11\% & 12\% & 32\% & 30\%\\
\hline
& \multicolumn {4}{c}{\textbf{Subtask Usefulness}} \\
\hline
Useful & \textbf{67\%*} & 52\% & 41\% & 43\%\\
\hline
Somewhat Useful & 8\% & 17\% & 19\% & 20\%\\
\hline
Not Useful & 25\% & 31\% & 40\% & 37\%\\
\hline
\end{tabular}
}
\caption{Performance on Subtask Validity and Subtask Usefulness. Results highlighted with * signify statistically significant difference between the proposed framework and best performing baseline using $\chi^2$ test with $p\leq 0.05$.\label{tab:valid}}
\end{table}
\subsection{Evaluating the Hierarchy}
\label{exp2}
While there are no gold standard datasets for evaluating hierarchies of tasks, we performed crowd-sourced assessments to assess the performance of our hierarchy extraction method. We separately evaluated the coherence and quality of the extracted hierarchies via two different set of judgements obtained via crowdsourcing.\\
\noindent\textbf{\textit{Evaluation Setup}}\\
For the judgment study, we make use of the AOL search logs and randomly sampled entire query history of frequent users who had more than 1000 search queries. The AOL log is a very large and long-term collection consisting of about 20 million of Web queries issued by more than 657000 users over 3 months. We run the task extraction algorithms on the entire set of queries of the sampled users and collect judgments to assess the quality of the tasks extracted. Judgments were provided by over 40 judges who were recruited from the Amazon Mechanical Turk crowdsourcing service. We restricted annotators to those based in the US because the logs came from searchers based in the US. We also used hidden quality control questions to filter out poor-quality judges. The judges were provided with detailed guidelines describing the notion of search tasks and subtasks and were provided with several examples to help them better understand the judgement task.\\
\noindent\textbf{\textit{Evaluating Task Coherence}}\\
In the first study, we evaluated the quality of the tasks extracted by the task extraction algorithms. In an ideal task extraction system, all the queries belonging to the same task cluster should ideally belong to the same task and hence have better task coherence. To this end, we evaluate the task coherence property of the tasks extracted by the different algorithms. For each of the baselines and the proposed algorithm, we select a task at random from the set of tasks extracted and randomly pick up two queries from the selected task. We then ask the human judges the following question:\\
\noindent\textbf{RQ1: Task Relatedness:} Are the given pairs of queries related to the same task? The possible options include (i) Task Related, (ii) Somewhat Task Related and (iii) Unrelated.\\
The task relatedness score provides an estimate of how coherent tasks are. Indeed, a task cluster containing queries from different tasks would score less in Task Relatedness score since if the task cluster is impure, there is a greater chance that the 2 randomly picked queries belong to different tasks and hence get judged Unrelated.\\% In addition to evaluating purity of the task clusters, we also evaluate the quality of the hierarchy constructed, as described below.
\noindent\textbf{\textit{Evaluating the hierarchy}}\\
While there are no gold standard dataset to evaluate hierarchies, in our second crowd-sourced judgment study, we evaluate the quality of the hierarchy extracted. A valid task-subtask hierarchy would have the parent task representing a higher level task with its children tasks representing more focused subtasks, each of which help the user achieve the overall task identified by the parent task.
We evaluate the correctness of the hierarchy by validating parent-child task-subtask relationships. More specifically, we randomly select a parent node from the hierarchy and then randomly select a child node from the set of its immediate child nodes. Given such parent-child node pairs, we randomly pick 5 queries from the parent node and randomly pick 2 queries from the child node. We then show the human judges these parent and child queries and ask the following questions:\\
\noindent\textbf{RQ2: Subtask Validity:} Consider the set of queries representing the search task and the pair of queries representing the subtask. How valid is this subtask given the overall task?\\
The possible judge options include (i) Valid Subtask, (ii) Somewhat valid and (iii) Invalid. Answering this question helps us in analyzing the correctness of the parent-child task-subtask pairs.\\
\noindent\textbf{RQ3: Subtask Usefulness:} Consider the set of queries representing the search task and the pair of queries representing the subtask. Is the subtask useful in completing the overall search task?
The possible judge options include (i) Useful, (ii) Somewhat Useful and (iii) Not Useful. This helps us in evaluating the usefulness of task-subtask pairs by finding the proportion of subtasks which help users in completing the overall task described by the parent node. Overall, the RQ2 and RQ3 help in evaluating the correctness and usefulness of the hierarchy extracted.\\
\noindent\textbf{\textit{Baselines}}\\
Since RQ1 evaluates task coherence without any notion of task-subtask structure, we compare against the top performing baselines from the task extraction setup described in section \ref{exp1}. On the other hand, RQ2 \& RQ3 help in answering questions about the quality of hierarchy constructed. To make fair comparisons while evaluating the hierarchies, we introduce additional hierarchy extraction baselines:
\begin{itemize}
\item \textbf{Jones Hierarchies} \cite{jones2008beyond}: A supervised learning approach for task boundary detection and same task identification. We train the classifier using the supervised Lucchese AOL task dataset and use it to extract tasks on the current dataset used in the judgment study.
\item \textbf{BHCD} \cite{blundell2013bayesian}: A state-of-the-art bayesian hierarchical community detection algorithm based on stochastic blockmodels and makes use of Beta-Bernoulli conjugate priors to define a network. We build a network of queries and apply BHCD algorithm to extract hierarchies of query communities.
\item \textbf{Bayesian Agglomerative Clustering (BAC)} \cite{heller2005bayesian}: A standard agglomerative hierarchical clustering model based on Dirichlet process mixtures.
\end{itemize}
\noindent\textbf{\textit{Results \& Discussion}}\\
For the first judgment study, each HIT is composed of 20 query pairs per approach being judged for task relatedness. We had three judges work on every HIT. Overall, per method we obtained judgments for 60 query pairs to evaluate the performance on task-relatedness. From among the three judges judging each query-pair, we followed majority voting mechanism to finalize the label for the instance. Table \ref{tab:relate} presents the proportions of query pairs judged as related. About 72\% of query pairs were judged task-related for the proposed approach with LDA-Hawkes performing second best with 67\%. Task relatedness measures how pure the task clusters obtained are, a higher score indicates that the queries belonging to the same task are indeed used for solving the same search task. The overall results indicate that the tasks extracted by the proposed task-subtask extraction algorithm are indeed better than those extracted by the baselines.
For the second judgment study used for evaluating the quality of the hierarchy, we show 10 pairs of parent-child questions in each HIT and ask the human annotators to judge the subtask validity and usefulness. Overall, per method we evaluate 300 such judgments resulting in over 1200 judgments and used maximum voting criterion from among the 3 judges to decide the final label for each instance. Table \ref{tab:valid} compares the performance of the proposed hierarchy extraction method against other hierarchical baselines. The identified subtask was found useful in 67\% cases with the best performing baseline being useful in 52\% of judged instances. This highlights that the extracted hierarchy is indeed composed of better subtasks which are found to be useful in completing the overall task depicted by the parent task. It is interesting to note that for BHCD and BAC baselines, most often the subtasks were found to be invalid and not useful.
Since the same parent-child task-subtask was judged for validity and usefulness, it is expected that the proportion of task-subtasks judged useful would be less than the ones judged valid. Indeed, as can be seen from the Table \ref{tab:valid}, the relative proportions of tasks-subtasks found useful is much less than those found valid.
\begin{figure}[t]
\centering
\includegraphics[width=0.5\textwidth]{TermPrediction3.pdf}
\caption{Term Prediction performance}\label{fig6}
\vspace{-4mm}
\end{figure}
\subsection{Term Prediction}
\label{exp3}
\noindent In addition to task extraction and user study based evaluation, we chose to follow an indirect evaluation approach based on \textit{Query Term Prediction} wherein given an initial set of queries, we predict future query terms the user may issue later in the session
This is in line with our goal of supporting users tackling complex search tasks since a task identification system which is capable of identifying "\emph{good}" search tasks will indeed perform better in predicting the set of future query terms.
To evaluate the performance of the proposed task extraction method, we primarily work with the TREC Session Track 2014 \cite{carterette2013overview} and AOL log data and constructed a new dataset consisting of user sessions from AOL logs concerned with Session Track queries. The session track data consists of over 1200 sessions while AOL logs consists of 20M search queries issued by over 657K users. We find the intersection of queries between the Session Track data and AOL logs to identify user sessions in AOL data trying to achieve similar task objectives. The Session Track dataset consists of 60 different \textbf{\textit{topics}}.
For each of these 60 topics, we separately find user sessions from the entire AOL logs which contain query overlaps with these topics. For each topic, we iterate through the entire AOL logs and select any user session which contains query overlap with the current topic. As a result, we obtain a total of 14030 user sessions which contain around 6.4M queries.
Given the initial queries from a user session and a set of tasks extracted from Session Track data, we leverage queries from the identified task to predict future query terms. For each Session Track topic, we construct a task hierarchy and use the constructed task hierarchy to predict future query terms in the associated user sessions. More specifically, for each topic, we split each user session into two parts: (i) task matching and (ii) held-out evaluation part. We use queries from the task matching part of user sessions to obtain the right node in the task hierarchy from which we then recommend query terms. We pick the tree node which has the highest cosine similarity score based on all the query terms under consideration. We evaluate based on the absolute recall scores - the average number of recommended query terms which match with the query terms in the held-out evaluation part of user sessions.
We baseline against the top performing task extraction baselines from Section \ref{exp1} as well as the top performing hierarchical algorithms from Section \ref{exp2}. To make fair comparisons, we consider nodes at the bottom most level of the pruned tree for task matching and term recommendation.
Figure \ref{fig6} compares the performance on term prediction against the considered baselines. We plot the average number of query terms predicted against the proportion of user session data used. The proposed method is able to better predict future query terms than a standard task extraction baseline as well as a very recent hierarchy construction algorithm.
\section{Conclusion}
Search task hierarchies provide us with a more naturalistic view of considering complex tasks and representing the embedded task-subtask relationships. In this paper we first motivated the need for considering hierarchies of search tasks \& subtasks and presented a novel bayesian nonparametric approach which extracts such hierarchies. We introduced a conjugate query affinity model to capture query affinities to help in task extraction. Finally, we propose the idea of Task Coherence and use it to identify atomic tasks. Our experiments demonstrated the benefits of considering search task hierarchies. Importantly, we were able to demonstrate competitive performance while at the same time outputting a richer and more expressive model of search tasks. This expands the scope for better task recommendation, better search personalization and opens up new avenues for recommendations specifically targeting users based on the tasks they are involved in.
\bibliographystyle{ACM-Reference-Format}
| {'timestamp': '2017-06-08T02:03:14', 'yymm': '1706', 'arxiv_id': '1706.01574', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01574'} | arxiv |
\section{Experimental Setup}
\subsection{Arcade Learning Environment (ALE)}
\label{sec:setup-ale-appendix}
For ALE \citep{ale}, the network architecture as described in~\cite{dqn} is used. This consists of $3$ convolutional layers ($32$ filters of size $8\times8$ and stride $4$, $64$ filters of size $4\times4$ and stride $2$, $64$ filters of size $3\times3$ and stride $1$) followed by $1$ hidden layer with $512$ units followed by a linear output layer with one unit for each action. ReLUs are used in each layer, while layer normalization~\citep{layernorm} is used in the fully connected part of the network.
For parameter space noise, we also include a second head after the convolutional stack of layers. This head determines a policy network with the same architecture as the $Q$-value network, except for a softmax output layer. The target networks are updated every $10\,\mathrm{K}$~timesteps. The $Q$-value network is trained using the Adam optimizer \citep{adam} with a learning rate of $10^{-4}$ and a batch size of $32$.
The replay buffer can hold $1\,\mathrm{M}$~state transitions.
For the $\epsilon$-greedy baseline, we linearly anneal $\epsilon$ from $1$ to $0.1$ over the first $1\,\mathrm{M}$~timesteps.
For parameter space noise, we adaptively scale the noise to have a similar effect in action space (see \autoref{sec:adapt-dqn} for details), effectively ensuring that the maximum KL divergence between perturbed and non-perturbed $\pi$ is softly enforced.
The policy is perturbed at the beginning of each episode and the standard deviation is adapted as described in \autoref{sec:adapt} every $50$ timesteps.
Notice that we only perturb the policy head after the convolutional part of the network (i.e. the fully connected part, which is also why we only include layer normalization in this part of the network).
To avoid getting stuck (which can potentially happen for a perturbed policy), we also use $\epsilon$-greedy action selection with $\epsilon=0.01$.
In all cases, we perform $50\,\mathrm{K}$~random actions to collect initial data for the replay buffer before training starts.
We set $\gamma=0.99$, clip rewards to be in $[-1, 1]$, and clip gradients for the output layer of $Q$ to be within $[-1, 1]$.
For observations, each frame is down-sampled to $84\times84$ pixels, after which it is converted to grayscale.
The actual observation to the network consists of a concatenation of $4$ subsequent frames.
Additionally, we use up to $30$ noop actions at the beginning of the episode.
This setup is identical to what is described by~\cite{dqn}.
\subsection{Continuous Control}
\label{sec:setup-continuous-appendix}
For DDPG, we use a similar network architecture as described by~\cite{ddpg}:
both the actor and critic use $2$ hidden layers with $64$ ReLU units each.
For the critic, actions are not included until the second hidden layer.
Layer normalization~\citep{layernorm} is applied to all layers.
The target networks are soft-updated with $\tau=0.001$.
The critic is trained with a learning rate of $10^{-3}$ while the actor uses a learning rate of $10^{-4}$.
Both actor and critic are updated using the Adam optimizer~\citep{adam} with batch sizes of $128$.
The critic is regularized using an $L2$ penalty with $10^{-2}$.
The replay buffer holds $100\,\mathrm{K}$ state transitions and $\gamma=0.99$ is used.
Each observation dimension is normalized by an online estimate of the mean and variance.
For parameter space noise with DDPG, we adaptively scale the noise to be comparable to the respective action space noise (see \autoref{sec:adapt-ddpg}).
For dense environments, we use action space noise with $\sigma=0.2$ (and a comparable adaptive noise scale).
Sparse environments use an action space noise with $\sigma=0.6$ (and a comparable adaptive noise scale).
TRPO uses a step size of $\delta_\text{KL}=0.01$, a policy network of $2$ hidden layers with $32$ $\tanh$ units for the nonlocomotion tasks, and $2$ hidden layers of $64$ $\tanh$ units for the locomotion tasks. The Hessian calculation is subsampled with a factor of $0.1$, $\gamma=0.99$, and the batch size per epoch is set to $5\,\mathrm{K}$~timesteps. The baseline is a learned linear transformation of the observations.
The following environments from OpenAI Gym\footnote{\url{https://github.com/openai/gym}}~\citep{gym} are used:
\begin{itemize}
\item \emph{HalfCheetah} (${\S \subset \mathbb{R}^{17}}$, ${\mathcal{A} \subset \mathbb{R}^{6}}$),
\item \emph{Hopper} (${\S \subset \mathbb{R}^{11}}$, ${\mathcal{A} \subset \mathbb{R}^{3}}$),
\item \emph{InvertedDoublePendulum} (${\S \subset \mathbb{R}^{11}}$, ${\mathcal{A} \subset \mathbb{R}}$),
\item \emph{InvertedPendulum} (${\S \subset \mathbb{R}^{4}}$, ${\mathcal{A} \subset \mathbb{R}}$),
\item \emph{Reacher} (${\S \subset \mathbb{R}^{11}}$, ${\mathcal{A} \subset \mathbb{R}^{2}}$),
\item \emph{Swimmer} (${\S \subset \mathbb{R}^{8}}$, ${\mathcal{A} \subset \mathbb{R}^{2}}$), and
\item \emph{Walker2D} (${\S \subset \mathbb{R}^{17}}$, ${\mathcal{A} \subset \mathbb{R}^{6}}$).
\end{itemize}
For the sparse tasks, we use the following environments from rllab\footnote{\url{https://github.com/openai/rllab}} \citep{duan2016benchmarking}, modified as described by \cite{vime}:
\begin{itemize}
\item \emph{SparseCartpoleSwingup} (${\S \subset \mathbb{R}^{4}}$, ${\mathcal{A} \subset \mathbb{R}}$), which only yields a reward if the paddle is raised above a given threshold,
\item \emph{SparseHalfCheetah} (${\S \subset \mathbb{R}^{17}}$, ${\mathcal{A} \subset \mathbb{R}^{6}}$), which only yields a reward if the agent crosses a distance threshold,
\item \emph{SparseMountainCar} (${\S \subset \mathbb{R}^{2}}$, ${\mathcal{A} \subset \mathbb{R}}$), which only yields a reward if the agent drives up the hill,
\item \emph{SparseDoublePendulum} (${\S \subset \mathbb{R}^{6}}$, ${\mathcal{A} \subset \mathbb{R}}$), which only yields a reward if the agent reaches the upright position, and
\item \emph{SwimmerGather} (${\S \subset \mathbb{R}^{33}}$, ${\mathcal{A} \subset \mathbb{R}^{2}}$), which yields a positive or negative reward upon reaching targets.
\end{itemize}
\subsection{Chain Environment}
\label{sec:setup-chain-appendix}
We follow the state encoding proposed by~\cite{bootstrappeddqn} and use $\phi(s_t) = (\mathbbm{1}\{x \leq s_t\})$ as the observation, where $\mathbbm{1}$ denotes the indicator function.
DQN is used with a very simple network to approximate the $Q$-value function that consists of $2$ hidden layers with $16$ ReLU units.
Layer normalization~\citep{layernorm} is used for all hidden layers before applying the nonlinearity.
Each agent is then trained for up to $2\,\mathrm{K}$ episodes.
The chain length $N$ is varied and for each $N$ three different seeds are trained and evaluated.
After each episode, the performance of the current policy is evaluated by sampling a trajectory with noise disabled (in the case of bootstrapped DQN, majority voting over all heads is performed).
The problem is considered solved if one hundred subsequent trajectories achieve the optimal episode return.
\autoref{fig:chain-env} depicts the environment.
\begin{figure}[h]
\centering
\begin{tikzpicture}[->,>=stealth,auto,node distance=2.2cm,
thick,node/.style={circle,draw}, minimum width=1.2cm,
scale=0.8, every node/.style={scale=0.8}]
\node[node, fill=red!40, label={[red!40]left:$r=0.001$}] (s1) {\large$s_1$};
\node[node, right of=s1] (s2) {\large$s_2$};
\node[node, draw=none, right of=s2] (si) {\large$\ldots$};
\node[node, right of=si] (sN1) {\large$s_{N-1}$};
\node[node, fill=red, text=white, right of=sN1, label={[red]right:$r=1$}] (sN) {\large$s_N$};
\path[->] (s1) edge [loop above] ();
\path[->] (s1) edge [bend left] (s2);
\path[->] (s2) edge [bend left] (si);
\path[->] (si) edge [bend left] (sN1);
\path[->] (sN1) edge [bend left] (sN);
\path[->] (sN) edge [loop above] ();
\path[->] (s2) edge [bend left] (s1);
\path[->] (si) edge [bend left] (s2);
\path[->] (sN1) edge [bend left] (si);
\path[->] (sN) edge [bend left] (sN1);
\end{tikzpicture}
\caption{Simple and scalable environment to test for exploratory behavior~\citep{bootstrappeddqn}.}
\label{fig:chain-env}
\end{figure}
We compare adaptive parameter space noise DQN, bootstrapped DQN~\citep{bootstrappeddqn} (with $K=20$~heads and Bernoulli masking with $p=0.5$), and $\epsilon$-greedy DQN (with $\epsilon$ linearly annealed from $1.0$ to $0.1$ over the first one hundred episodes).
For adaptive parameter space noise, we only use a single head and perturb $Q$ directly, which works well in this setting.
Parameter space noise is adaptively scaled so that $\delta \approx 0.05$.
In all cases, $\gamma=0.999$, the replay buffer holds $100\,\mathrm{K}$ state transitions, learning starts after $5$ initial episodes, the target network is updated every $100$ timesteps, and the network is trained using the Adam optimizer~\citep{adam} with a learning rate of $10^{-3}$ and a batch size of $32$.
\FloatBarrier
\section{Parameter Space Noise for On-policy Methods}
\label{sec:on-policy-appendix}
Policy gradient methods optimize
$\mathbb{E}_{\tau \sim (\pi, p)} [ R(\tau) ]$. Given a stochastic policy $\pi_\theta(a|s)$ with $\theta \sim \mathcal{N}(\phi, \Sigma)$, the expected return can be expanded using likelihood ratios and the reparametrization trick~\citep{kingma2013auto} as
\begin{align}
\nabla_{\phi,\Sigma} \mathbb{E}_\tau [ R(\tau) ]
& = \nabla_{\phi,\Sigma} \mathbb{E}_{\theta \sim \mathcal{N}(\phi,\Sigma)} \left[ \sum_\tau p(\tau|\theta) R(\tau) \right] \\
& = \mathbb{E}_{\epsilon \sim \mathcal{N}(0,I)} \nabla_{\phi,\Sigma} \left[ \sum_\tau p(\tau|\phi + \epsilon \Sigma^{\frac{1}{2}}) R(\tau) \right] \\
& = \mathbb{E}_{\epsilon \sim \mathcal{N}(0,I),\tau} \left[ \sum_{t=0}^{T-1} \nabla_{\phi,\Sigma} \log \pi(a_t|s_t;\phi+\epsilon \Sigma^{\frac{1}{2}}) R_t(\tau) \right] \\
& \approx \frac{1}{N} \sum_{\epsilon^i,\tau^i} \left[ \sum_{t=0}^{T-1} \nabla_{\phi,\Sigma} \log \pi(a_t|s_t;\phi+\epsilon^i \Sigma^{\frac{1}{2}}) R_t(\tau^i)\right]
\end{align}
for $N$ samples $\epsilon^i \sim \mathcal{N}(0,I)$ and $\tau^i \sim (\pi_{\phi + \epsilon^i \Sigma^{\frac{1}{2}}}, p)$, with $R_t(\tau^i) = \sum_{t'=t}^{T} \gamma^{t'-t} r_{t'}^i$. This also allows us to subtract a variance-reducing baseline $b_t^i$, leading to
\begin{equation}
\nabla_{\phi,\Sigma} \mathbb{E}_\tau [ R(\tau) ] \approx \frac{1}{N} \sum_{\epsilon^i,\tau^i} \left[ \sum_{t=0}^{T-1} \nabla_{\phi,\Sigma} \log \pi(a_t|s_t;\phi+\epsilon^i \Sigma^{\frac{1}{2}}) (R_t(\tau^i) - b_t^i) \right].
\end{equation}
In our case, we set $\Sigma := \sigma^2 I$ and use our proposed adaption method to re-scale as appropriate.
\FloatBarrier
\section{Adaptive Scaling}
\label{sec:adapt}
Parameter space noise requires us to pick a suitable scale $\sigma$.
This can be problematic since the scale will highly depend on the specific network architecture, and is likely to vary over time as parameters become more sensitive as learning progresses.
Additionally, while it is easy to intuitively grasp the scale of action space noise, it is far harder to understand the scale in parameter space.
We propose a simple solution that resolves all aforementioned limitations in an easy and straightforward way.
This is achieved by adapting the scale of the parameter space noise over time, thus using a time-varying scale $\sigma_k$.
Furthermore, $\sigma_k$ is related to the action space variance that it induces, and updated accordingly.
Concretely, we use the following simple heuristic to update $\sigma_k$ every $K$ timesteps:
\begin{equation}
\sigma_{k+1} =
\begin{cases}
\alpha \sigma_k, & \text{if } d(\pi, \widetilde{\pi}) < \delta \\
\frac{1}{\alpha} \sigma_k, & \text{otherwise},
\end{cases}
\end{equation}
where $d(\cdot, \cdot)$ denotes some distance between the non-perturbed and perturbed policy (thus measuring in action space), $\alpha \in \mathbb{R}_{>0}$ is used to rescale $\sigma_k$, and $\delta \in \mathbb{R}_{>0}$ denotes some threshold value.
This idea is based on the Levenberg-Marquardt heuristic~\citep{ranganathan2004levenberg}.
The concrete distance measure and appropriate choice of $\delta$ depends on the policy representation.
In the following sections, we outline our choice of $d(\cdot, \cdot)$ for methods that do (DDPG and TRPO) and do not (DQN) use behavioral policies.
In our experiments, we always use $\alpha = 1.01$.
\subsection{A Distance Measure for DQN}
\label{sec:adapt-dqn}
For DQN, the policy is defined implicitly by the $Q$-value function.
Unfortunately, this means that a naïve distance measure between $Q$ and $\widetilde{Q}$ has pitfalls.
For example, assume that the perturbed policy has only changed the bias of the final layer, thus adding a constant value to each action's $Q$-value.
In this case, a naïve distance measure like the norm $\lVert{Q - \widetilde{Q}}\rVert_2$ would be nonzero, although the policies $\pi$ and $\widetilde{\pi}$ (implied by $Q$ and $\widetilde{Q}$, respectively) are exactly equal.
This equally applies to the case where DQN as two heads, one for $Q$ and one for $\pi$.
We therefore use a probabilistic formulation\footnote{It is important to note that we use this probabilistic formulation only for the sake of defining a well-behaved distance measure. The actual policy used for rollouts is still deterministic.} for both the non-perturbed and perturbed policies: ${\pi, \widetilde{\pi}: \S \times \mathcal{A} \mapsto [0, 1]}$ by applying the softmax function over predicted $Q$ values: ${\pi(s) = \exp{Q_i(s)} / {\sum_i{\exp{Q_i(s)}}}}$, where $Q_i(\cdot)$ denotes the $Q$-value of the $i$-th action.
$\widetilde{\pi}$ is defined analogously but uses the perturbed $
\widetilde{Q}$ instead (or the perturbed head for $\pi$).
Using this probabilistic formulation of the policies, we can now measure the distance in action space:
\begin{equation}
d(\pi, \widetilde{\pi}) = D_{\text{KL}}\infdivx{\pi}{\widetilde{\pi}},
\end{equation}
where $D_{\text{KL}}\infdivx{\cdot}{\cdot}$ denotes the Kullback-Leibler (KL) divergence.
This formulation effectively normalizes the $Q$-values and therefore does not suffer from the problem previously outlined.
We can further relate this distance measure to $\epsilon$-greedy action space noise, which allows us to fairly compare the two approaches and also avoids the need to pick an additional hyperparameter $\delta$.
More concretely, the KL divergence between a greedy policy $\pi(s, a) = 1$ for $a = \text{argmax}_{a'} Q(s, a')$ and $\pi(s, a) = 0$ otherwise and an $\epsilon$-greedy policy $\widehat{\pi}(s, a) = 1 - \epsilon + \frac{\epsilon}{|\mathcal{A}|}$ for $a = \text{argmax}_{a'} Q(s, a')$ and $\widehat{\pi}(s, a) = \frac{\epsilon}{|\mathcal{A}|}$ otherwise is ${D_{\text{KL}}\infdivx{\pi}{\widehat{\pi}} = -\log{(1 - \epsilon + \frac{\epsilon}{|\mathcal{A}|})}}$, where $|\mathcal{A}|$ denotes the number of actions (this follows immediately from the definition of the KL divergence for discrete probability distributions).
We can use this distance measure to relate action space noise and parameter space noise to have similar distances, by adaptively scaling $\sigma$ so that it matches the KL divergence between greedy and $\epsilon$-greedy policy, thus setting $\delta := -\log{(1 - \epsilon + \frac{\epsilon}{|\mathcal{A}|})}$.
\subsection{A Distance Measure for DDPG}
\label{sec:adapt-ddpg}
For DDPG, we relate noise induced by parameter space perturbations to noise induced by additive Gaussian noise.
To do so, we use the following distance measure between the non-perturbed and perturbed policy:
\begin{equation}
d(\pi, \widetilde{\pi}) = \sqrt{\frac{1}{N} \sum_{i=1}^{N}{\mathbb{E}_{s}\left[\left(\pi(s)_i - \widetilde{\pi}(s)_i\right)^2 \right]}},
\end{equation}
where $\mathbb{E}_s[\cdot]$ is estimated from a batch of states from the replay buffer and $N$ denotes the dimension of the action space (i.e. $\mathcal{A} \subset \mathbb{R}^N$).
It is easy to show that $d(\pi, \pi + \mathcal{N}(0, \sigma^2 I)) = \sigma$.
Setting $\delta:=\sigma$ as the adaptive parameter space threshold thus results in effective action space noise that has the same standard deviation as regular Gaussian action space noise.
\subsection{A Distance Measure for TRPO}
\label{sec:adapt-trpo}
In order to scale the noise for TRPO, we adapt the sampled noise vectors $\epsilon \sigma$ by computing a natural step $H^{-1} \epsilon \sigma$. We essentially compute a trust region around the noise direction to ensure that the perturbed policy $\widetilde{\pi}$ remains sufficiently close to the non-perturbed version via
\begin{eqnarray*}
E_{s\sim \rho_{\widetilde{\theta}}}[D_{\text{KL}}(\pi_{\widetilde{\theta}}(\cdot |s) \| \pi_{\theta}(\cdot|s))] \leq \delta_{\text{KL}}.
\end{eqnarray*}
Concretely, this is computed through the conjugate gradient algorithm, combined with a line search along the noise direction to ensure constraint conformation, as described in Appendix C of \cite{trpo}.
\FloatBarrier
\section{Additional Results on ALE}
\label{sec:results-ale-appendix}
\autoref{fig:atari-full} provide the learning curves for all 21 Atari games.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{figures/atari_full}
\caption{Median DQN returns for all ALE environment plotted over training steps.}
\label{fig:atari-full}
\end{figure}
\autoref{table:full-comparison} compares the final performance of ES after $1\,000\,\mathrm{M}$ frames to the final performance of DQN with $\epsilon$-greedy exploration and parameter space noise exploration after $40\,\mathrm{M}$ frames.
In all cases, the performance is estimated by running $10$ episodes with exploration disabled.
We use the numbers reported by~\cite{es} for ES and report the median return across three seeds for DQN.
\begin{table}[h]
\caption{Performance comparison between Evolution Strategies (ES) as reported by \cite{es}, DQN with $\epsilon$-greedy, and DQN with parameter space noise (this paper). ES was trained on $1\,000\,\mathrm{M}$, while DQN was trained on only $40\,\mathrm{M}$ frames.}
\label{table:full-comparison}
\centering
\begin{tabular}{lrrr}
\toprule
Game & ES & DQN w/ $\epsilon$-greedy & DQN w/ param noise \\
\midrule
Alien & 994.0 & 1535.0 & \textbf{2070.0} \\
Amidar & 112.0 & 281.0 & \textbf{403.5} \\
BankHeist & 225.0 & 510.0 & \textbf{805.0} \\
BeamRider & 744.0 & \textbf{8184.0} & 7884.0 \\
Breakout & 9.5 & \textbf{406.0} & 390.5 \\
Enduro & 95.0 & 1094 & \textbf{1672.5} \\
Freeway & 31.0 & \textbf{32.0} & 31.5 \\
Frostbite & 370.0 & 250.0 & \textbf{1310.0} \\
Gravitar & \textbf{805.0} & 300.0 & 250.0 \\
MontezumaRevenge & \textbf{0.0} & \textbf{0.0} & \textbf{0.0} \\
Pitfall & \textbf{0.0} & -73.0 & -100.0 \\
Pong & \textbf{21.0} & \textbf{21.0} & 20.0 \\
PrivateEye & 100.0 & \textbf{133.0} & 100.0 \\
Qbert & 147.5 & \textbf{7625.0} & 7525.0 \\
Seaquest & 1390.0 & 8335.0 & \textbf{8920.0} \\
Solaris & \textbf{2090.0} & 720.0 & 400.0 \\
SpaceInvaders & 678.5 & 1000.0 & \textbf{1205.0} \\
Tutankham & 130.3 & 109.5 & \textbf{181.0} \\
Venture & \textbf{760.0} & 0 & 0 \\
WizardOfWor & \textbf{3480.0} & 2350.0 & 1850.0 \\
Zaxxon & 6380.0 & \textbf{8100.0} & 8050.0 \\
\bottomrule
\end{tabular}
\end{table}
\FloatBarrier
\section{Additional Results on Continuous Control with Shaped Rewards}
\label{sec:results-continuous-appendix}
For completeness, we provide the plots for all evaluated environments with dense rewards.
The results are depicted in \autoref{fig:dense-full}.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{figures/dense_full}
\caption{Median DDPG returns for all evaluated environments with dense rewards plotted over epochs.}
\label{fig:dense-full}
\end{figure}
The results for \emph{InvertedPendulum} and \emph{InvertedDoublePendulum} are very noisy due to the fact that a small change in policy can easily degrade performance significantly, and thus hard to read.
Interestingly, adaptive parameter space noise achieves the most stable performance on \emph{InvertedDoublePendulum}.
Overall, performance is comparable to other exploration approaches.
Again, no noise in either the action nor the parameter space achieves comparable results, indicating that these environments combined with DDPG are not well-suited to test for exploration.
\FloatBarrier
\section{Additional Results on Continuous Control with Sparse Rewards}
\label{sec:results-sparse-appendix}
The performance of TRPO with noise scaled according to the parameter curvature, as defined in Section~\ref{sec:adapt-trpo} is shown in \autoref{fig:continuous-sparse-trpo-adapt}.
The TRPO baseline uses only action noise by using a policy network that outputs the mean of a Gaussian distribution, while the variance is learned. These results show that adding parameter space noise aids in either learning much more consistently on these challenging sparse environments.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{figures/trpo_curvature}
\caption{Median TRPO returns with three different environments with sparse rewards plotted over epochs.}
\label{fig:continuous-sparse-trpo-adapt}
\end{figure}
\subsection*{References}}
\DeclarePairedDelimiterX{\infdivx}[2]{(}{)}{%
#1\;\delimsize\|\;#2%
}
\newcommand{D_{\text{KL}}\infdivx}{D_{\text{KL}}\infdivx}
\usepackage{bm}
\usepackage{xcolor}
\renewcommand{\vec}[1]{\boldsymbol{#1}}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\renewcommand{\subsectionautorefname}{Section}
\renewcommand{\subsubsectionautorefname}{Section}
\renewcommand{\S}{\mathcal{S}}
\renewcommand{\O}{\mathcal{O}}
\newcommand{\mathcal{G}}{\mathcal{G}}
\newcommand{\mathcal{A}}{\mathcal{A}}
\newcommand{\mathcal{N}}{\mathcal{N}}
\renewcommand{\L}{\mathcal{L}}
\newcommand{\mathbb{R}}{\mathbb{R}}
\newcommand{\mathbb{E}}{\mathbb{E}}
\newcommand{\mathbbm{1}}{\mathbbm{1}}
\newcommand{\change}[1]{#1}
\title{Parameter Space Noise for Exploration}
\author{
Matthias Plappert$^{\dagger \ddagger}$, Rein Houthooft$^{\dagger}$, Prafulla Dhariwal$^{\dagger}$, Szymon Sidor$^{\dagger}$,\\
\textbf{Richard Y.\ Chen$^{\dagger}$, Xi Chen$^{\dagger\dagger}$, Tamim Asfour$^{\ddagger}$, Pieter Abbeel$^{\dagger\dagger}$, and Marcin Andrychowicz$^{\dagger}$}\\
$^{\dagger}$ OpenAI\\
$^{\ddagger}$ Karlsruhe Institute of Technology (KIT)\\
$^{\dagger\dagger}$ University of California, Berkeley \\
Correspondence to \texttt{[email protected]} \\
}
\begin{document}
\maketitle
\begin{abstract}
Deep reinforcement learning (RL) methods generally engage in exploratory behavior through noise injection in the action space. An alternative is to add noise directly to the agent's parameters, which can lead to more consistent exploration and a richer set of behaviors. Methods such as evolutionary strategies use parameter perturbations, but discard all temporal structure in the process and require significantly more samples. Combining parameter noise with traditional RL methods allows to combine the best of both worlds. We demonstrate that both off- and on-policy methods benefit from this approach through experimental comparison of DQN, DDPG, and TRPO on high-dimensional discrete action environments as well as continuous control tasks.
\end{abstract}
\input{sections/introduction}
\input{sections/background}
\input{sections/param_noise}
\input{sections/exp}
\input{sections/related_work}
\input{sections/conclusion}
\begingroup
\small
\bibliographystyle{iclr2018_conference}
\small
\section{Parameter Space Noise for Exploration}
This work considers policies that are realized as parameterized functions, which we denote as $\pi_{\theta}$, with $\theta$ being the parameter vector.
We represent policies as neural
networks but our technique can be applied to arbitrary parametric models.
To achieve structured exploration, we sample from a set of policies by applying additive Gaussian noise to the parameter vector of the current policy: $ \widetilde{\theta} = \theta + \mathcal{N}(0,\sigma^2 I)$.
Importantly, the perturbed policy is sampled at the beginning of each episode and kept fixed for the entire rollout.
For convenience and readability, we denote this perturbed policy as $\widetilde{\pi} := \pi_{\widetilde{\theta}}$ and analogously define $\pi := \pi_\theta$.
\paragraph{State-dependent exploration}
As pointed out by \cite{DBLP:conf/pkdd/RuckstiessFS08}, there is a crucial difference between action space noise and parameter space noise. Consider the continuous action space case. When using Gaussian action noise, actions are sampled according to some stochastic policy, generating ${a_t = \pi(s_t) + \mathcal{N}(0, \sigma^2 I)}$. Therefore, even for a \emph{fixed} state $s$, we will almost certainly obtain a different action whenever that state is sampled again in the rollout, since action space noise is completely \emph{independent} of the current state $s_t$ (notice that this is equally true for correlated action space noise). In contrast, if the parameters of the policy are perturbed at the beginning of each episode, we get $a_t = \widetilde{\pi}(s_t)$. In this case, the same action will be taken every time the same state $s_t$ is sampled in the rollout. This ensures consistency in actions, and directly introduces a dependence between the state and the exploratory action taken.
\paragraph{Perturbing deep neural networks}
It is not immediately obvious that deep neural networks, with potentially millions of parameters and complicated nonlinear interactions, can be perturbed in meaningful ways by applying spherical Gaussian noise.
However, as recently shown by~\cite{es}, a simple reparameterization of the network achieves exactly this.
More concretely, we use layer normalization~\citep{layernorm} between perturbed layers.\footnote{This is in contrast to~\cite{es}, who use virtual batch normalization, which we found to perform less consistently}
Due to this normalizing across activations within a layer, the same perturbation scale can be used across all layers, even though different layers may exhibit different sensitivities to noise.
\paragraph{Adaptive noise scaling}
Parameter space noise requires us to pick a suitable scale $\sigma$.
This can be problematic since the scale will strongly
depend on the specific network architecture, and is likely to vary over time as parameters become more sensitive to noise as learning progresses.
Additionally, while it is easy to intuitively grasp the scale of action space noise, it is far harder to understand the scale in parameter space.
We propose a simple solution that resolves all aforementioned limitations in an easy and straightforward way.
This is achieved by adapting the scale of the parameter space noise over time and relating it to the variance in action space that it induces.
More concretely, we can define a distance measure between perturbed and non-perturbed policy in action space and adaptively increase or decrease the parameter space noise depending on whether it is below or above a certain threshold:
\begin{equation}
\sigma_{k+1} =
\begin{cases}
\alpha \sigma_k & \text{if $d(\pi, \widetilde{\pi}) \leq \delta$,} \\
\frac{1}{\alpha} \sigma_k & \text{otherwise,}
\end{cases}
\end{equation}
where $\alpha \in \mathbb{R}_{>0}$ is a scaling factor and $\delta \in \mathbb{R}_{>0}$ a threshold value.
The concrete realization of $d(\cdot, \cdot)$ depends on the algorithm at hand and we describe appropriate distance measures for DQN, DDPG, and TRPO in \autoref{sec:adapt}.
\paragraph{Parameter space noise for off-policy methods}
In the off-policy case, parameter space noise can be applied straightforwardly since, by definition, data that was collected off-policy can be used. More concretely, we only perturb the policy for exploration and train the non-perturbed network on this data by replaying it.
\paragraph{Parameter space noise for on-policy methods}
Parameter noise can be incorporated in an on-policy setting, using an adapted policy gradient, as set forth by \cite{ruckstiess2008state}. Policy gradient methods optimize
$\mathbb{E}_{\tau \sim (\pi, p)} [ R(\tau) ]$.
Given a stochastic policy $\pi_\theta(a|s)$ with $\theta \sim \mathcal{N}(\phi, \Sigma)$, the expected return can be expanded using likelihood ratios and the re-parametrization trick~\citep{kingma2013auto} as
\begin{align}
\nabla_{\phi,\Sigma} \mathbb{E}_\tau [ R(\tau) ]
\approx \frac{1}{N} \sum_{\epsilon^i,\tau^i} \left[ \sum_{t=0}^{T-1} \nabla_{\phi,\Sigma} \log \pi(a_t|s_t;\phi+\epsilon^i \Sigma^{\frac{1}{2}}) R_t(\tau^i) \right]
\end{align}
for $N$ samples $\epsilon^i \sim \mathcal{N}(0,I)$ and $\tau^i \sim (\pi_{\phi + \epsilon^i \Sigma^{\frac{1}{2}}}, p)$ (see \autoref{sec:on-policy-appendix} for a full derivation). Rather than updating $\Sigma$ according to the previously derived policy gradient, we fix its value to $\sigma^2 I$ and scale it adaptively as described in \autoref{sec:adapt}.
\section{Background}
We consider the standard RL framework consisting of an agent interacting with an environment. To simplify the exposition we assume that the environment is fully observable.
An environment is modeled as a Markov decision process (MDP) and is defined by a set of states $\S$, a set of actions $\mathcal{A}$, a distribution over initial states $p(s_0)$, a reward function $r : \S \times \mathcal{A} \mapsto \mathbb{R}$, transition probabilities $p(s_{t+1}|s_t,a_t)$, a time horizon $T$, and a discount factor $\gamma \in [0,1)$.
We denote by $\pi_\theta$ a policy parametrized by $\theta$, which can be either deterministic, $\pi: \S \mapsto \mathcal{A}$, or stochastic, \change{$\pi: \S \mapsto \mathcal{P}(\mathcal{A})$}.
The agent's goal is to maximize the expected discounted return ${\eta(\pi_\theta)} = \mathbb{E}_\tau[\sum_{t=0}^T \gamma^t r(s_t, a_t)]$, where $\tau = (s_0, a_0, \ldots, s_T)$ denotes a trajectory with ${s_0 \sim p(s_0)}$, ${a_t \sim \pi_\theta(a_t | s_t)}$, and ${s_{t+1} \sim p(s_{t+1} | s_t, a_t)}$. Experimental evaluation is based on the undiscounted return $\mathbb{E}_\tau[\sum_{t=0}^T r(s_t, a_t)]$.\footnote{If $t=T$, we write $r(s_T, a_T)$ to denote the terminal reward, even though it has has no dependence on $a_T$, to simplify notation.}
\subsection{Off-policy Methods}
Off-policy RL methods allow learning based on data captured by arbitrary policies. This paper considers two popular off-policy algorithms, namely Deep Q-Networks (DQN, \cite{dqn}) and Deep Deterministic Policy Gradients (DDPG, \cite{ddpg}).
\paragraph{Deep Q-Networks (DQN)}
DQN uses a deep neural network as a function approximator to estimate the optimal $Q$-value function, which conforms to the Bellman optimality equation: $${Q(s_t, a_t) = r(s_t, a_t) + \gamma \max_{a' \in \mathcal{A}} Q(s_{t+1}, a')}.$$
The policy is implicitly defined by $Q$ as $\pi(s_t) = \text{argmax}_{a' \in \mathcal{A}}Q(s_t, a')$.
Typically, a stochastic $\epsilon$-greedy or Boltzmann policy~\citep{sutton1998introduction} is derived from the $Q$-value function to encourage exploration, which relies on sampling noise in the action space.
The $Q$-network predicts a $Q$-value for each action and is updated using off-policy data from a replay buffer.
\paragraph{Deep Deterministic Policy Gradients (DDPG)} DDPG is an actor-critic algorithm, applicable to continuous action spaces.
Similar to DQN, the critic estimates the $Q$-value function using off-policy data and the recursive Bellman equation:
$${Q(s_t, a_t) = r(s_t, a_t) + \gamma Q\left(s_{t+1}, \pi_\theta(s_{t+1})\right)},$$
where $\pi_\theta$ is the actor or policy.
The actor is trained to maximize the critic's estimated $Q$-values by back-propagating through both networks.
For exploration, DDPG uses a stochastic policy of the form $\widehat{\pi_\theta}(s_t) = \pi_\theta(s_t) + w$, where $w$ is either $w \sim \mathcal{N}(0, \sigma^2 I)$ (uncorrelated) or $w \sim \text{OU}(0, \sigma^2)$ (correlated).\footnote{$\text{OU}(\cdot, \cdot)$ denotes the Ornstein-Uhlenbeck process~\citep{uhlenbeck1930theory}.}
Again, exploration is realized through action space noise.
\subsection{On-policy Methods}
In contrast to off-policy algorithms, on-policy methods require updating function approximators according to the currently followed policy. In particular, we will consider Trust Region Policy Optimization (TRPO, \cite{schulman2015trust}), an extension of traditional policy gradient methods \citep{williams1992simple} using the natural gradient direction \citep{DBLP:journals/ijon/PetersS08,kakade2001natural}.
\paragraph{Trust Region Policy Optimization (TRPO)}
TRPO improves upon REINFORCE~\citep{williams1992simple} by computing an ascent direction that ensures a small change in the policy distribution. More specifically, TRPO solves the following constrained optimization problem:
\begin{eqnarray*}
&\textrm{maximize}_{\theta}& E_{s \sim \rho_{\theta'}, a \sim \pi_{\theta'}} \left[ \frac{\pi_\theta(a|s)}{\pi_\theta'(a|s)} A(s, a)\right]\cr
&\text{s.t.}& E_{s\sim \rho_{\theta'}}[D_{\text{KL}}(\pi_{\theta'}(\cdot |s) \| \pi_{\theta}(\cdot|s))] \leq \delta_{\text{KL}}
\end{eqnarray*}
where $\rho_\theta = \rho_{\pi_\theta}$ is the discounted state-visitation frequencies induced by $\pi_\theta$,
$A(s, a)$ denotes the advantage function estimated by the empirical return minus the baseline, and $\delta_{\text{KL}}$ is a step size parameter which controls how much the policy is allowed to change per iteration.
\section{Conclusion}
\change{In this work, we propose parameter space noise as a conceptually simple yet effective replacement for traditional action space noise like $\epsilon$-greedy and additive Gaussian noise.
This work shows that parameter perturbations can successfully be combined with contemporary on- and off-policy deep RL algorithms such as DQN, DDPG, and TRPO and often results in improved performance compared to action noise.
Experimental results further demonstrate that using parameter noise allows solving environments with very sparse rewards, in which action noise is unlikely to succeed.
Our results indicate that parameter space noise is a viable and interesting alternative to action space noise, which is still the \emph{de facto} standard in most reinforcement learning applications.
}
\section{Related Work}
\label{sec:related_work}
The problem of exploration in reinforcement has been studied extensively.
A range of algorithms~\citep{e3, rmax, ucrl} have been proposed that guarantee near-optimal solutions after a number of steps that are polynomial in the number of states, number of actions, and the horizon time.
However, in many real-world reinforcements learning problems both the state and action space are continuous and high dimensional so that, even with discretization, these algorithms become impractical. In the context of deep reinforcement learning, a large variety of techniques have been proposed to improve exploration
\citep{DBLP:journals/corr/StadieLA15, vime, tang2016exploration, bootstrappeddqn, countbasedexploration, intrisincmotivation, randomizedvaluefuncs}.
However, all are non-trivial to implement and are often computational expensive.
The idea of perturbing the parameters of a policy has been proposed by~\cite{DBLP:conf/pkdd/RuckstiessFS08} for policy gradient methods.
The authors show that this form of perturbation generally outperforms random exploration and evaluate their exploration strategy with the REINFORCE~\citep{DBLP:journals/ml/Williams92} and Natural Actor-Critic~\citep{DBLP:journals/ijon/PetersS08} algorithms.
However, their policies are relatively low-dimensional compared to modern deep architectures, they use environments with low-dimensional state spaces, and their contribution is strictly limited to the policy gradient case.
In contrast, our method is applied and evaluated for both on and off-policy setting, we use high-dimensional policies, and environments with large state spaces.
Our work is also closely related to evolution strategies (ES, \cite{eigen1973ingo, schwefel1977numerische}), and especially neural evolution strategies (NES, \cite{DBLP:conf/icml/YiWSS09, sun09, DBLP:conf/ppsn/GlasmachersSS10, DBLP:conf/gecco/GlasmachersSSWS10, DBLP:conf/gecco/SchaulGS11, DBLP:journals/jmlr/WierstraSGSPS14}).
In the context of policy optimization, our work is closely related to \cite{DBLP:conf/nips/KoberP08} and \cite{DBLP:journals/nn/SehnkeORGPS10}.
More recently, \cite{es} showed that ES can work for high-dimensional environments like Atari and OpenAI Gym continuous control problems.
However, ES generally disregards any temporal structure that may be present in trajectories and typically suffers from sample inefficiency.
Bootstrapped DQN~\citep{bootstrappeddqn} has been proposed to aid with more directed and consistent exploration by using a network with multiple heads, where one specific head is selected at the beginning of each episode.
In contrast, our approach perturbs the parameters of the network directly, thus achieving similar yet simpler (and as shown in \autoref{sec:param-space-exploration}, sometimes superior) exploration behavior.
Concurrently to our work, \cite{fortunato2017noisy} have proposed a similar approach that utilizes parameter perturbations for more efficient exploration.
\section{Introduction}
\label{sec:introduction}
Exploration remains a key challenge in contemporary deep reinforcement learning (RL). Its main purpose is to ensure that the agent's behavior does not converge prematurely to a local optimum. Enabling efficient and effective exploration is, however, not trivial since it is not directed by the reward function of the underlying Markov decision process (MDP). Although a plethora of methods have been proposed to tackle this challenge in high-dimensional and/or continuous-action MDPs, they often rely on complex additional structures such as counting tables \citep{tang2016exploration}, density modeling of the state space \citep{countbasedexploration}, learned dynamics models \citep{vime, achiam2017surprise, DBLP:journals/corr/StadieLA15}, or self-supervised curiosity~\citep{pathakICMl17curiosity}.
An orthogonal way of increasing the exploratory nature of these algorithms is through the addition of temporally-correlated noise, for example as done in bootstrapped DQN \citep{bootstrappeddqn}.
Along the same lines, it was shown that the addition of parameter noise leads to better exploration by obtaining a policy that exhibits a larger variety of behaviors \citep{sun09,es}. We discuss these related approaches in greater detail in Section~\ref{sec:related_work}. Their main limitation, however, is that they are either only proposed and evaluated for the on-policy setting with relatively small and shallow function approximators~\citep{DBLP:conf/pkdd/RuckstiessFS08} or disregard all temporal structure and gradient information~\citep{es, DBLP:conf/nips/KoberP08, DBLP:journals/nn/SehnkeORGPS10}.
This paper investigates how parameter space noise can be effectively combined with off-the-shelf deep RL algorithms such as DQN~\citep{dqn}, DDPG~\citep{ddpg}, and TRPO~\citep{trpo} to improve their exploratory behavior. Experiments show that this form of exploration is applicable to both high-dimensional discrete environments and continuous control tasks, using on- and off-policy methods. Our results indicate that parameter noise outperforms traditional action space noise-based baselines, especially in tasks where the reward signal is extremely sparse.
\section{Experiments}
This section answers the following questions:
\begin{enumerate}
\item[(i)] Do existing state-of-the-art RL algorithms benefit from incorporating parameter space noise?
\item[(ii)] Does parameter space noise aid in exploring sparse reward environments more effectively?
\item[(iii)] How does parameter space noise exploration compare against evolution strategies \change{for deep policies \citep{es}} with respect to sample efficiency?
\end{enumerate}
\change{Reference implementations of DQN and DDPG with adaptive parameter space noise are available online.\footnote{\url{https://github.com/openai/baselines}}}
\subsection{Comparing Parameter Space Noise to Action Space Noise}
\label{sec:param-space-alternative}
The added value of parameter space noise over action space noise is measured on both high-dimensional discrete-action environments and continuous control tasks. For the discrete environments, comparisons are made using DQN, while DDPG and TRPO are used on the continuous control tasks.
\paragraph{Discrete-action environments}
For discrete-action environments, we use the Arcade Learning Environment (ALE, \cite{ale}) benchmark along with a standard DQN implementation.
We compare a baseline DQN agent with $\epsilon$-greedy action noise against a version of DQN with parameter noise.
We linearly anneal $\epsilon$ from $1.0$ to $0.1$ over the first $1$ million timesteps.
For parameter noise, we adapt the scale using a simple heuristic that increases the scale if the KL divergence between perturbed and non-perturbed policy is less than the KL divergence between greedy and $\epsilon$-greedy policy and decreases it otherwise (see \autoref{sec:adapt-dqn} for details).
By using this approach, we achieve a fair comparison between action space noise and parameter space noise since the magnitude of the noise is similar and also avoid the introduction of an additional hyperparameter.
For parameter perturbation, we found it useful to reparametrize the network in terms of an explicit policy that represents the greedy policy $\pi$ implied by the $Q$-values, rather than perturbing the $Q$-function directly. To represent the policy $\pi(a|s)$, we add a single fully connected layer after the convolutional part of the network, followed by a softmax output layer. Thus, $\pi$ predicts a discrete probability distribution over actions, given a state.
We find that perturbing $\pi$ instead of $Q$ results in more meaningful changes since we now define an explicit behavioral policy.
In this setting, the $Q$-network is trained according to standard DQN practices.
The policy $\pi$ is trained by maximizing the probability
of outputting the greedy action accordingly to the current $Q$-network.
Essentially, the policy is trained to exhibit the same behavior as running greedy DQN.
To rule out this double-headed version of DQN alone exhibits significantly different behavior, we always compare our parameter space noise approach against two baselines, regular DQN and two-headed DQN, both with $\epsilon$-greedy exploration.
We furthermore randomly sample actions for the first $50$ thousand timesteps in all cases to fill the replay buffer before starting training.
Moreover, we found that parameter space noise performs better if it is combined with a bit of action space noise (we use a $\epsilon$-greedy behavioral policy with $\epsilon=0.01$ for the parameter space noise experiments).
Full experimental details are described in~\autoref{sec:setup-ale-appendix}.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{figures/atari}
\caption{Median DQN returns for several ALE environment plotted over training steps.}
\label{fig:atari}
\end{figure}
We chose 21 games of varying complexity, according to the taxonomy presented by \citep{bellemare2016unifying}. The learning curves are shown in \autoref{fig:atari} for a selection of games (see \autoref{sec:results-ale-appendix} for full results). Each agent is trained for $40\,\mathrm{M}$~frames. The overall performance is estimated by running each configuration with three different random seeds, and we plot the median return (line) as well as the interquartile range (shaded area).
Note that performance is evaluated on the exploratory policy since we are interested in its behavior especially.
Overall, our results show that parameter space noise often outperforms action space noise, especially on games that require consistency (e.g. Enduro, Freeway) and performs comparably on the remaining ones.
Additionally, learning progress usually starts much sooner when using parameter space noise.
Finally, we also compare against a double-headed version of DQN with $\epsilon$-greedy exploration to ensure that this change in architecture is not responsible for improved exploration, which our results confirm.
Full results are available in \autoref{sec:results-ale-appendix}.
\change{That being said, parameter space noise is unable to sufficiently explore in extremely challenging games like Montezuma's Revenge.
More sophisticated exploration methods like \cite{bellemare2016unifying} are likely necessary to successfully learn these games.
However, such methods often rely on some form of ``inner'' exploration method, which is usually traditional action space noise.
It would be interesting to evaluate the effect of parameter space noise when combined with exploration methods.
}
On a final note, proposed improvements to DQN like double DQN~\citep{hasselt2010double}, prioritized experience replay~\citep{schaul2015prioritized}, and dueling networks~\citep{wang2015dueling} are orthogonal to our improvements and would therefore likely improve results further.
We leave the experimental validation of this theory to future work.
\paragraph{Continuous control environments}
We now compare parameter noise with action noise on the continuous control environments implemented in OpenAI Gym~\citep{gym}.
We use DDPG~\citep{ddpg} as the RL algorithm for all environments with similar hyperparameters as outlined in the original paper except for
the fact that
layer normalization~\citep{layernorm} is applied after each layer before the nonlinearity, which we found to be useful in either case and especially important for parameter space noise.
We compare the performance of the following configurations:
\begin{enumerate*}[label=(\alph*)]
\item no noise at all,
\item uncorrelated additive Gaussian action space noise ($\sigma=0.2$),
\item correlated additive Gaussian action space noise (Ornstein–Uhlenbeck process~\citep{uhlenbeck1930theory} with $\sigma=0.2$), and
\item adaptive parameter space noise.
\end{enumerate*}
In the case of parameter space noise, we adapt the scale so that the resulting change in action space is comparable to our baselines with uncorrelated Gaussian action space noise (see \autoref{sec:adapt-ddpg} for full details).
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{figures/dense}
\caption{Median DDPG returns for continuous control environments plotted over epochs.}
\label{fig:continuous-dense}
\end{figure}
We evaluate the performance on several continuous control tasks.
\autoref{fig:continuous-dense} depicts the results for three exemplary environments.
Each agent is trained for $1\,\mathrm{M}$~timesteps, where $1$ epoch consists of $10$~thousand timesteps.
In order to make results comparable between configurations, we evaluate the performance of the agent every $10$~thousand steps by using no noise for $20$~episodes.
On \emph{HalfCheetah}, parameter space noise achieves significantly higher returns than all other configurations.
We find that, in this environment, all other exploration schemes quickly converge to a local optimum (in which the agent learns to flip on its back and then ``wiggles'' its way forward).
Parameter space noise behaves similarly initially but still explores other options and quickly learns to break out of this sub-optimal behavior.
Also notice that parameter space noise vastly outperforms correlated action space noise on this environment, clearly indicating that there is a significant difference between the two.
On the remaining two environments, parameter space noise performs on par with other exploration strategies.
Notice, however, that even if no noise is present, DDPG is capable of learning good policies.
We find that this is representative for the remaining environments (see \autoref{sec:results-continuous-appendix} for full results), which indicates that these environments do not require a lot of exploration to begin with due to their well-shaped reward function.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{figures/trpo_dense}
\caption{Median TRPO returns for continuous control environments plotted over epochs.}
\label{fig:trpo-dense}
\end{figure}
The results for TRPO are depicted in~\autoref{fig:trpo-dense}. Interestingly, in the \emph{Walker2D} environment, we see that adding parameter noise decreases the performance variance between seeds. This indicates that parameter noise aids in escaping local optima.
\subsection{Does Parameter Space Noise Explore Efficiently?}
\label{sec:param-space-exploration}
The environments in the previous section required relatively little exploration.
In this section, we evaluate whether parameter noise enables existing RL algorithms to learn on environments with very sparse rewards, where uncorrelated action noise generally fails \citep{bootstrappeddqn, achiam2017surprise}.
\paragraph{A scalable toy example}
We first evaluate parameter noise on a well-known toy problem, following the setup described by~\cite{bootstrappeddqn} as closely as possible.
The environment consists of a chain of $N$ states and the agent always starts in state $s_2$, from where it can either move left or right.
In state $s_1$, the agent receives a small reward of $r = 0.001$ and a larger reward $r = 1$ in state $s_N$.
Obviously, it is much easier to discover the small reward in $s_1$ than the large reward in $s_N$, with increasing difficulty as $N$ grows. The environment is described in greater detail in \autoref{sec:setup-chain-appendix}.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{figures/chain_plot}
\caption{Median number of episodes before considered solved for DQN with different exploration strategies. Green indicates that the problem was solved whereas blue indicates that no solution was found within $2\,\mathrm{K}$~episodes. Note that less number of episodes before solved is better.}
\label{fig:chain-plot}
\end{figure}
We compare adaptive parameter space noise DQN, bootstrapped DQN, and $\epsilon$-greedy DQN.
The chain length $N$ is varied and for each $N$ three different seeds are trained and evaluated.
After each episode, we evaluate the performance of the current policy by performing a rollout with all noise disabled (in the case of bootstrapped DQN, we perform majority voting over all heads).
The problem is considered solved if one hundred subsequent rollouts achieve the optimal return. We plot the median number of episodes before the problem is considered solved (we abort if the problem is still unsolved after $2$~thousand episodes).
Full experimental details are available in \autoref{sec:setup-chain-appendix}.
\autoref{fig:chain-plot} shows that parameter space noise clearly outperforms action space noise (which completely fails for moderately large $N$) and even outperforms the more computational expensive bootstrapped DQN.
\change{
However, it is important to note that this environment is extremely simple in the sense that the optimal strategy is to always go right.
In a case where the agent needs to select a different optimal action depending on the current state, parameter space noise would likely work less well since weight randomization of the policy is less likely to yield this behavior.
Our results thus only highlight the difference in exploration behavior compared to action space noise in this specific case.
In the general case, parameter space noise does not guarantee optimal exploration.
}
\paragraph{Continuous control with sparse rewards}
We now make the continuous control environments more challenging for exploration.
Instead of providing a reward at every timestep, we use environments that only yield a non-zero reward after significant progress towards a goal.
More concretely, we consider the following environments from rllab\footnote{\url{https://github.com/openai/rllab}}~\citep{duan2016benchmarking}, modified according to \cite{vime}:
\begin{enumerate*}[label=(\alph*)]
\item \emph{SparseCartpoleSwingup}, which only yields a reward if the paddle is raised above a given threshold,
\item \emph{SparseDoublePendulum}, which only yields a reward if the agent reaches the upright position, and
\item \emph{SparseHalfCheetah}, which only yields a reward if the agent crosses a target distance,
\item \emph{SparseMountainCar}, which only yields a reward if the agent drives up the hill,
\item \emph{SwimmerGather}, yields a positive or negative reward upon reaching targets.
\end{enumerate*}
For all tasks, we use a time horizon of $T=500$ steps before resetting.
\begin{figure}[h]
\centering
\includegraphics[width=\textwidth]{figures/sparse_06}
\caption{Median DDPG returns for environments with sparse rewards plotted over epochs.}
\label{fig:continuous-sparse}
\end{figure}
We consider both DDPG and TRPO to solve these environments (the exact experimental setup is described in \autoref{sec:setup-continuous-appendix}).
\autoref{fig:continuous-sparse} shows the performance of DDPG, while the results for TRPO have been moved to \autoref{sec:results-sparse-appendix}. The overall performance is estimated by running each configuration with five different random seeds, after which we plot the median return (line) as well as the interquartile range (shaded area).
For DDPG, \emph{SparseDoublePendulum} seems to be easy to solve in general, with even no noise finding a successful policy relatively quickly.
The results for \emph{SparseCartpoleSwingup} and \emph{SparseMountainCar} are more interesting: Here, only parameter space noise is capable of learning successful policies since all other forms of noise, including correlated action space noise, never find states with non-zero rewards.
For \emph{SparseHalfCheetah}, DDPG at least finds the non-zero reward but never learns a successful policy from that signal.
On the challenging \emph{SwimmerGather} task, all configurations of DDPG fail.
Our results clearly show that parameter space noise can be used to improve the exploration behavior of these off-the-shelf algorithms.
\change{
However, it is important to note that improvements in exploration are not guaranteed for the general case.
It is therefore necessary to evaluate the potential benefit of parameter space noise on a case-by-case basis.
}
\subsection{Is RL with Parameter Space Noise more Sample-efficient than ES?}
Evolution strategies (ES) are closely related to our approach since both explore by introducing noise in the parameter space, which can lead to improved exploration behavior~\citep{es}.\footnote{\change{To clarify, when we refer to ES in this context, we refer to the recent work by \cite{es}, which demonstrates that deep policy networks that learn from pixels can be trained using ES. We understand that there is a vast body of other work in this field (compare \autoref{sec:related_work}).}}
However, ES disregards temporal information and uses black-box optimization to train the neural network.
By combining parameter space noise with traditional RL algorithms, we can include temporal information as well rely on gradients computed by back-propagation for optimization while still benefiting from improved exploratory behavior.
We now compare ES and traditional RL with parameter space noise directly.
We compare performance on the $21$ ALE games that were used in \autoref{sec:param-space-alternative}.
The performance is estimated by running $10$ episodes for each seed using the final policy with exploration disabled and computing the median returns.
For ES, we use the results obtained by~\cite{es}, which were obtained after training on $1\,000\,\mathrm{M}$ frames.
For DQN, we use the same parameter space noise for exploration that was previously described and train on $40\,\mathrm{M}$ frames.
Even though DQN with parameter space noise has been exposed to $25$ times less data, it outperforms ES on $15$ out of $21$ Atari games (full results are available in \autoref{sec:results-ale-appendix}).
Combined with the previously described results, this demonstrates that parameter space noise combines the desirable exploration properties of ES with the sample efficiency of traditional RL.
\subsection*{References}}
\DeclarePairedDelimiterX{\infdivx}[2]{(}{)}{%
#1\;\delimsize\|\;#2%
}
\newcommand{D_{\text{KL}}\infdivx}{D_{\text{KL}}\infdivx}
\usepackage{bm}
\usepackage{xcolor}
\newcommand{\todo}[1]{\textcolor{red}{[TODO: #1]}}
\renewcommand{\vec}[1]{\boldsymbol{#1}}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\renewcommand{\S}{\mathcal{S}}
\renewcommand{\O}{\mathcal{O}}
\newcommand{\mathcal{G}}{\mathcal{G}}
\newcommand{\mathcal{A}}{\mathcal{A}}
\newcommand{\mathcal{N}}{\mathcal{N}}
\renewcommand{\L}{\mathcal{L}}
\newcommand{\mathbb{R}}{\mathbb{R}}
\newcommand{\mathbb{E}}{\mathbb{E}}
\newcommand{\mathbbm{1}}{\mathbbm{1}}
\title{Parameter Space Noise for Exploration: Supplementary Material}
\author{
Matthias Plappert\thanks{Work done while interning at OpenAI.}\phantom{\footnotesize 1}\textsuperscript{,}\thanks{Correspondence to \texttt{[email protected]}.} \\
Karlsruhe Institute of Technology \\
\And
Rein Houthooft \\
OpenAI \\
\And
Prafulla Dhariwal \\
OpenAI \\
\And
Marcin Andrychowicz \\
OpenAI \\
\And
Pieter Abbeel \\
UC Berkeley, OpenAI \\
}
\begin{document}
\maketitle
| {'timestamp': '2018-02-01T02:06:22', 'yymm': '1706', 'arxiv_id': '1706.01905', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01905'} | arxiv |
\section{One-way definability in the sweeping case}%
\label{sec:characterization-sweeping}
\reviewOne[inline]{From Part 5 onwards, a major point is that an output you can bound is an output you can guess, and a periodic output is an output you don't have to guess, as you can produce it "out of order". On your Figures (and any you might care to add during potential revisions), having a specific visual representation (if possible coherent throughout the paper) to differentiate path sections with empty, bounded, or periodic output will make your point way more intelligible.
}%
\felix[inline]{so this is just about uniformizing the figure for sweeping and for two way ?}%
In the previous section we have shown the implication \PR1 $\Rightarrow$ \PR2 for a functional sweeping
transducer $\cT$. Here we close the cycle by proving the implications \PR2 $\Rightarrow$ \PR3 and \PR3 $\Rightarrow$ \PR1.
In particular, we show how to derive the existence of successful runs admitting a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition
and construct a one-way transducer $\cT'$ that simulates $\cT$ on those runs.
This will basically prove Theorem~\ref{thm:main2} in the sweeping case.
\medskip
\subsection*{Run decomposition.}
We begin by giving the definition of $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition for a run $\rho$ of $\cT$.
Intuitively, a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition of $\rho$ identifies factors of $\rho$ that can be easily simulated
in a one-way manner. The definition below describes precisely the shape of these factors.
First we need to recall the notion of almost periodicity:
a word $w$ is \emph{almost periodic with bound $p$} if $w=w_0~w_1~w_2$
for some words $w_0,w_2$ of length at most $p$ and some word $w_1$
of period at most $p$.
We need to work with subsequences of the run $\rho$ that are induced by
particular sets of locations, not necessarily consecutive.
Recall that $\rho[\ell,\ell']$ denotes the factor of $\rho$
delimited by two locations $\ell\mathrel{\unlhd}\ell'$. Similarly, given any
set $Z$ of locations, we denote by $\rho|Z$ the subsequence of $\rho$
induced by $Z$. Note that, even though $\rho|Z$ might not be a valid
run
\label{rhoZ}
of the transducer, we can still refer to the number of transitions in it
and to the size of the produced output $\out{\rho|Z}$.
Formally, a transition in $\rho|Z$ is a transition from some $\ell$ to $\ell'$,
where both $\ell,\ell'$ belong to $Z$. The output $\out{\rho|Z}$ is the
concatenation of the outputs of the transitions of $\rho| Z$
(according to the order given by $\rho$).
\reviewOne[inline]{Fig. 5 is moderately informative... Figure 17 and 18 are a more inspiring illustration of the intuition behind diagonal and blocks. Their "restricted" counterpart could be simpler to represent.}%
\gabriele[inline]{done}%
\begin{defi}\label{def:factors-sweeping}
Consider a factor $\rho[\ell,\ell ']$ of a run $\rho$ of $\cT$,
where $\ell=(x,y)$, $\ell'=(x',y')$ are two locations with $x \le x'$.
We call $\rho[\ell,\ell']$
\begin{itemize}
\medskip
\item \parbox[t]{\dimexpr\textwidth-\leftmargin}
\vspace{-2.75mm}
\begin{wrapfigure}{r}{7.5cm}
\end{wrapfigure}
%
a \emph{floor} if $y=y'$ is even, namely, if $\rho[\ell,\ell']$
lies entirely on the same level and is rightward oriented;
}\noparbreak
\bigskip
\bigskip
\item \parbox[t]{\dimexpr\textwidth-\leftmargin}
\vspace{-2.75mm}
\begin{wrapfigure}{r}{7.5cm}
\vspace{-22mm}
\input{diagonal-sweeping}
\vspace{-4mm}
\end{wrapfigure}
%
a \emph{$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonal} if
there is a sequence
$\ell = \ell_0 \mathrel{\unlhd} \ell_1 \mathrel{\unlhd} \dots \mathrel{\unlhd} \ell_{2n+1} = \ell'$,
where each $\rho[\ell_{2i+1},\ell_{2i+2}]$ is a floor,
each $\rho[\ell_{2i}, \ell_{2i+1}]$ produces an output
of length at most $2{\boldsymbol{H}}} %h_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
and the position of each $\ell_{2i}$
is to the left of the position of $\ell_{2i+1}$;
}
\bigskip
\smallskip
\item \parbox[t]{\dimexpr\textwidth-\leftmargin}
\vspace{-2.75mm}
\begin{wrapfigure}{r}{7.5cm}
\vspace{-10mm}
\input{block-sweeping}
\vspace{-5mm}
\end{wrapfigure}
%
a \emph{$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block} if
the output produced by $\rho[\ell,\ell']$ is almost periodic with bound $2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
and the output produced by the subsequence $\rho|Z$,
where $Z=[\ell,\ell'] ~\setminus~ \big([x,x']\times[y,y']\big)$,
has length at most $2{\boldsymbol{H}}} %h_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
}
\vspace{8mm}
\end{itemize}
\end{defi}
Before continuing we give some intuition on the above definitions.
The simplest concept is that of floor, which is a rightward oriented factor of a run.
Diagonals are sequences of consecutive floors interleaved by factors that
produce small (bounded) outputs. We see an example of a diagonal
in Figure \ref{fig:diagonal-sweeping}, where we marked the important
locations and highlighted with thick arrows the two floors that form
the diagonal. The factors of the diagonal that are not floors are
represented instead by dotted arrows.
The third notion is that of a block.
An important constraint in the definition of a block
is that the produce output must be almost periodic, with small enough bound.
In Figure \ref{fig:block-sweeping}, the periodic output is represented by the
thick arrows, either solid or dotted, that go from location $\ell$ to
location $\ell'$.
In addition, the block must satisfy a constraint on the length of
the output produced by the subsequence $\rho|Z$, where
$Z=[\ell,\ell'] ~\setminus~ \big([x,x']\times[y,y']\big)$.
The latter set $Z$ consists of location that are either to the left
of the position of $\ell$ or to the right of the position of $\ell'$.
For example, in Figure \ref{fig:block-sweeping} the set $Z$ coincides
with the area outside the hatched rectangle. Accordingly, the portion
of the subsequence $\rho|Z$ is represented by the dotted bold arrows.
Diagonals and blocks are used as key objects to derive a notion of
decomposition for a run of a sweeping transducer. We formalize this
notion below.
\begin{defi}\label{def:decomposition-sweeping}
A \emph{$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition} of a run $\rho$ of $\cT$ is a factorization
$\prod_i\,\rho[\ell_i,\ell_{i+1}]$ of $\rho$ into $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonals and $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-blocks.
\end{defi}
\reviewOne[inline]{Fig.6 does not look like a fully factorized run: what happens for example, between the end of $D_1$ and $l_1$? Can a concrete example be devised? This works rather well in Part 8.}%
\gabriele{Improved the figure and the explanation}%
Figure~\ref{fig:decomposition-sweeping} gives an example of such a
decomposition.
\anca{dans Fig 7, les aretes de $B_2$ vont dans la
mauvaise direction}%
\gabriele{I have corrected this. Now the figure is a bit more regular (perhaps too much),
but at least conveys the correct information!}%
Each factor is either a diagonal $D_i$ or a block $B_i$.
Inside each factor we highlight by thick arrows the portions
of the run that can be simulated by a one-way transducer,
either because they are produced from left to right (thus forming diagonals)
or because they are periodic (thus forming blocks).
We also recall from Definition \ref{def:factors-sweeping}
that most of the output is produced inside the
hatched rectangles, since the output produced by a diagonal
or a block outside the corresponding blue or red hatched rectangle
has length at most $2{\hmax^2}} %{{h^2_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Finally, we observe that the locations delimiting the factors of the
decomposition are arranged following the natural order of positions and levels.
All together, this means that the output produced by a run that enjoys
a decomposition can be simulated in a one-way manner.
\input{decomposition-sweeping}
\medskip
\reviewOne[inline]{Part 5: In "From periodicity of inversions to existence of decompositions", the general proof structure in general and transition between lemmas in particular could be made more visually and conceptually explicit, as the global idea of the proof is difficult to grasp at first. A mini "road map" as made in Part 3 for the whole of Part 4 and 5 might be another way to help the reader through these rather intricate proofs.}%
\subsection*{From periodicity of inversions to existence of decompositions.}
Now that we set up the definition of $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition, we turn
towards proving the implication \PR2 $\Rightarrow$ \PR3 of Theorem \ref{thm:main2}.
In fact, we will prove a slightly stronger result than \PR2 $\Rightarrow$ \PR3,
which is stated further below.
Formally, when we say that a run \emph{$\rho$ satisfies \PR2} we mean
that for every inversion $(L_1,\ell_1,L_2,\ell_2)$ of $\rho$, the word
$\out{\tr{\ell_1}} ~ \out{\rho[\ell_1,\ell_2]} ~ \out{\tr{\ell_2}}$
has period $\gcd(|\out{\tr{\ell_1}}|, |\out{\tr{\ell_2}}|) \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
We aim at proving that every run that satisfies \PR2 enjoys a decomposition,
independently of whether other runs do or do not satisfy \PR2:
\begin{prop}\label{prop:decomposition-sweeping}
If $\rho$ is a run of $\cT$ that satisfies \PR2, then $\rho$ admits a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition.
\end{prop}
\felix{a few lines for the roadmap asked by the reviewer, but I don't think they're useful at all}%
\gabriele{I think it is good}%
Let us fix a run $\rho$ of $\cT$ and assume that it satisfies \PR2.
To show that $\rho$ admits a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition, we will identify
the blocks of the decomposition as equivalence classes of a suitable
relation based on inversions (cf.~Definition \ref{def:crossrel}).
Then, we will use combinatorial arguments (notably,
Lemmas \ref{lem:output-minimal-sweeping} and \ref{lem:overlapping})
to prove that the constructed blocks satisfy the desired properties.
Finally, we will show how the resulting equivalence classes form all
the necessary blocks of the decomposition, in the sense that the factors
in between those classes are diagonals.
We begin by introducing the equivalence relation by means of which we can
then identify the blocks of a decomposition of $\rho$.
\begin{defi}\label{def:crossrel}
Let $\ensuremath{\mathrel{\text{\sf S}}}$ be the relation that pairs every two locations $\ell,\ell'$ of $\rho$
whenever there is an inversion $(L_1,\ell_1,L_2,\ell_2)$ of $\rho$ such that
$\ell_1 \mathrel{\unlhd} \ell,\ell' \mathrel{\unlhd} \ell_2$, namely, whenever $\ell$ and $\ell'$
occur within the same inversion.
Let $\simeq$ be the reflexive and transitive closure of $\ensuremath{\mathrel{\text{\sf S}}}$.
\end{defi}
It is easy to see that every equivalence class of $\simeq$ is a convex
subset with respect to the run order on locations of $\rho$.
Moreover, every \emph{non-singleton} equivalence class of $\simeq$ is a
union of a series of inversions that are two-by-two overlapping.
One can refer to Figure~\ref{fig:overlapping}
for an intuitive account of what we mean by two-by-two overlapping: the thick
arrows represent factors of the run that lie entire inside an $\simeq$-equivalence class,
each inversion is identified by a pair of consecutive anchor points with the same
color. According to the run order, between every pair of anchor points with the
same color, there is at least one anchor point of different color: this means that
the inversions corresponding to the two colors are overlapping.
\reviewOne[inline]{Fig.7 might benefit from some $L_1$, $L_2$ appearing, to illustrate the point made in Claim 5.6
\felix[inline]{I don't agree}%
\olivier[inline]{I also disagree. Argued in review1-answer.txt.}%
}%
Formally, we say that an inversion $(L_1,\ell_1,L_2,\ell_2)$ \emph{covers}
a location $\ell$ when $\ell_1 \mathrel{\unlhd} \ell \mathrel{\unlhd} \ell_2$. We say that
two inversions $(L_1,\ell_1,L_2,\ell_2)$ and $(L_3,\ell_3,L_4,\ell_4)$
are \emph{overlapping} if $(L_1,\ell_1,L_2,\ell_2)$ covers $\ell_3$
and $(L_3,\ell_3,L_4,\ell_4)$ covers $\ell_2$ (or the other way around).
\input{overlapping}
The next lemma uses the fact that $\rho$ satisfies \PR2 to deduce that
the output produced inside every $\simeq$-equivalence class has
period at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$. Note that the proof below does not exploit
the fact that the transducer is sweeping.
\begin{lem}\label{lem:overlapping}
If $\rho$ satisfies \PR2 and $\ell\mathrel{\unlhd}\ell'$ are two locations of $\rho$
such that $\ell \simeq \ell'$, then the output $\out{\rho[\ell,\ell']}$
produced between these locations has period at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
\end{lem}
\begin{proof}
The claim for $\ell=\ell'$ holds trivially, so we assume that $\ell\mathrel{\lhd}\ell'$.
Since the $\simeq$-equivalence class that contains $\ell,\ell'$ is non-singleton,
we know that there is a series of inversions
\[
(L_0,\ell_0,L_1,\ell_1) \quad
(L_2,\ell_2,L_3,\ell_3) \quad
\dots\dots \quad
(L_{2k},\ell_{2k},L_{2k+1},\ell_{2k+1})
\]
that are two-by-two overlapping and such that
$\ell_0\mathrel{\unlhd}\ell\mathrel{\lhd}\ell'\mathrel{\unlhd}\ell_{2k+1}$.
Without loss of generality, we can assume that every
inversion $(L_{2i},\ell_{2i},L_{2i+1},\ell_{2i+1})$ is \emph{maximal}
in the following sense: there is no other inversion
$(\tilde L,\tilde\ell,\tilde L',\tilde\ell') \neq (L_{2i},\ell_{2i},L_{2i+1},\ell_{2i+1})$
such that $\tilde\ell \mathrel{\unlhd} \ell_{2i} \mathrel{\unlhd} \ell_{2i+1} \mathrel{\unlhd} \tilde\ell'$.
For the sake of brevity, let $v_i = \out{\tr{\ell_i}}$ and $p_i = | v_i |$.
Since $\rho$ satisfies \PR2 (recall Proposition~\ref{prop:periodicity-sweeping}), we know that, for all $i=0,\dots,n$, the word
\[
v_{2i} ~ \out{\rho[\ell_{2i},\ell_{2i+1}]} ~ v_{2i+1}
\]
has period that divides both $p_{2i}$ and $p_{2i+1}$ and is at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
In order to show that the period of $\out{\rho[\ell,\ell']}$ is also bounded
by $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, it suffices to prove the following claim by induction on $i$:
\reviewOne[inline]{Claim 5.6, end of page 18: making explicit what words you wish to use Fine-Wilf on might make for a more readable proof.
\olivier[inline]{answered in review1-answer.txt}%
}%
\begin{clm}
For all $i=0,\dots,k$, the word
$\outb{\rho[\ell_0,\ell_{2i+1}]} \: v_{2i+1}$
has period at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ that divides $p_{2i+1}$.
\end{clm}
The base case $i=0$ follows immediately from our hypothesis,
since $(L_0,\ell_0,L_1,\ell_1)$ is an inversion.
For the inductive step, we assume that the claim holds for $i<k$,
and we prove it for $i+1$. First of all, we factorize our word as follows:
\[
\outb{\rho[\ell_0,\ell_{2i+3}]} ~ v_{2i+3}
~=~
\rightward{ \underbracket[0.5pt]{ \phantom{
\outb{\rho[\ell_0,\ell_{2i+2}]} ~
\outb{\rho[\ell_{2i+2},\ell_{2i+1}]} ~ } }%
_{\text{period } p_{2i+1}} }
\outb{\rho[\ell_0,\ell_{2i+2}]}
\overbracket[0.5pt]{ ~ \outb{\rho[\ell_{2i+2},\ell_{2i+1}]} ~
\outb{\rho[\ell_{2i+1},\ell_{2i+3}]} ~
v_{2i+3} }%
^{\text{periods } p_{2i+2} \text{ and } p_{2i+3}}
.
\]
By the inductive hypothesis, the output produced between $\ell_0$
and $\ell_{2i+1}$, extended to the right with $v_{2i+1}$,
has period that divides $p_{2i+1}$.
Moreover, because $\rho$ satisfies \PR2 and
$(L_{2i+2},\ell_{2i+2},L_{2i+3},\ell_{2i+3})$ is an inversion,
the output produced between the locations
$\ell_{2i+2}$ and $\ell_{2i+3}$,
extended to the left with $v_{2i+2}$ and to the
right with $v_{2i+3}$, has period that divides both $p_{2i+2}$ and $p_{2i+3}$.
Note that this is not yet sufficient for applying Fine-Wilf's theorem,
since the common factor $\outb{\rho[\ell_{2i+2},\ell_{2i+1}]}$
might be too short (possibly just equal to $v_{2i+2}$).
The key argument here is to prove that the interval $[\ell_{2i+2},\ell_{2i+1}]$
is covered by an inversion
which is different from those that we considered above, namely,
i.e.~$(L_{2i+2},\ell_{2i+2},L_{2i+1},\ell_{2i+1})$. For example,
$[\ell_2,\ell_1]$ in
Figure~\ref{fig:overlapping} is covered by the inversion
$(L_2,\ell_2,L_1,\ell_1)$.
For this, we have to prove that the anchor points $\ell_{2i+2}$ and $\ell_{2i+1}$
are correctly ordered w.r.t.~$\mathrel{\unlhd}$ and the ordering of positions
(recall Definition~\ref{def:inversion-sweeping}).
First, we observe that $\ell_{2i+2} \mathrel{\unlhd} \ell_{2i+1}$, since
$(L_{2i},\ell_{2i},L_{2i+1},\ell_{2i+1})$ and $(L_{2i+2},\ell_{2i+2},L_{2i+3},\ell_{2i+3})$
are overlapping inversions.
Next, we prove that the position of $\ell_{2i+1}$ is strictly to the left of
the position of $\ell_{2i+2}$. By way of contradiction, suppose that this is
not the case, namely, $\ell_{2i+1}=(x_{2i+1},y_{2i+1})$, $\ell_{2i+2}=(x_{2i+2},y_{2i+2})$,
and $x_{2i+1} \ge x_{2i+2}$. Because $(L_{2i},\ell_{2i},L_{2i+1},\ell_{2i+1})$ and
$(L_{2i+2},\ell_{2i+2},L_{2i+3},\ell_{2i+3})$ are inversions,
we know that $\ell_{2i+3}$ is strictly to the left of $\ell_{2i+2}$
and $\ell_{2i+1}$ is strictly to the left of $\ell_{2i}$.
This implies that $\ell_{2i+3}$ is strictly to the left of $\ell_{2i}$,
and hence $(L_{2i},\ell_{2i},L_{2i+3},\ell_{2i+3})$ is also an inversion.
Moreover, recall that $\ell_{2i} \mathrel{\unlhd} \ell_{2i+2} \mathrel{\unlhd} \ell_{2i+1} \mathrel{\unlhd} \ell_{2i+3}$.
This contradicts the maximality of $(L_{2i},\ell_{2i},L_{2i+1},\ell_{2i+1})$,
which we assumed at the beginning of the proof.
Therefore, we must conclude that $\ell_{2i+1}$ is strictly to the left of $\ell_{2i+2}$.
Now that we know that $\ell_{2i+2} \mathrel{\unlhd} \ell_{2i+1}$ and that $\ell_{2i+1}$ is to the left of $\ell_{2i+2}$,
we derive the existence of the inversion $(L_{2i+2},\ell_{2i+2},L_{2i+1},\ell_{2i+1})$.
Again, because $\rho$ satisfies \PR2, we know that the word
$v_{2i+2} ~ \out{\rho[\ell_{2i+2},\ell_{2i+1}]} ~ v_{2i+1}$ has period at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$
that divides $p_{2i+2}$ and $p_{2i+1}$.
Summing up, we have:
\begin{enumerate}
\item $w_1 ~=~ \outb{\rho[\ell_0,\ell_{2i+1}]} ~ v_{2i+1}$ has period $p_{2i+1}$,
\item $w_2 ~=~ v_{2i+2} ~ \outb{\rho[\ell_{2i+2},\ell_{2i+1}]} ~ v_{2i+1}$
has period $p = \gcd(p_{2i+2},p_{2i+1})$,
\item $w_3 ~=~ v_{2i+2} ~ \outb{\rho[\ell_{2i+2},\ell_{2i+3}]} ~ v_{2i+3}$
has period $p' = \gcd(p_{2i+2},p_{2i+3})$.
\end{enumerate}
We are now ready to exploit our stronger variant of Fine-Wilf's theorem,
that is, Theorem~\ref{thm:fine-wilf}.
We begin with (1) and (2) above.
Let $w = \outb{\rho[\ell_{2i+2},\ell_{2i+1}]}~ v_{2i+1}$ be the common suffix of
$w_1$ and $w_2$. First note that since $p$ divides $p_{2i+2}$, the
word $w$ is also a prefix of $w_2$, thus we can write
$w_2=w\,w'_2$. Second, note that the length of $w$ is at least
$|v_{2i+1}| = p_{2i+1} = p_{2i+1} + p - \gcd(p_{2i+1},p)$. We can
apply now Theorem~\ref{thm:fine-wilf} to $w_1=w'_1\,w$ and
$w_2=w\,w'_2$ and obtain:
\begin{enumerate}
\setcounter{enumi}{3}
\item $w_4 ~=~ w'_1 \: w \: w'_2
~=~ \outb{\rho[\ell_0,\ell_{2i+2}]} ~ v_{2i+2} ~ \outb{\rho[\ell_{2i+2},\ell_{2i+1}]} ~ v_{2i+1}$
has period $p$.
\end{enumerate}
We apply next Theorem~\ref{thm:fine-wilf} to (2) and (3), namely, to
the words $w_2$ and $w_3$ with $v_{2i+2}$ as common factor. It is not
difficult to check that $|v_{2i+2}|=p_{2i+2} \ge p+p'-p''$ with
$p''=\gcd(p,p')$, using the definitions of $p$ and $p'$: we can
write $p_{2i+2}=p''rq=p''r'q'$ with $p=p''r$ and $p'=p''r'$. It suffices to check
that $p''rq+p''r'q' \ge 2(p''r + p''r'-p'')$, hence that $rq+r'q' \ge 2r+2r'-2$. This
is clear if $\min(q,q')>1$. Otherwise the inequality $p_{2i+2} \ge
p+p'-p''$ follows easily because $p=p''$ or $p'=p''$ holds. Hence we obtain
that $w_2$ and $w_3$ have both period $p''$.
Applying once more Theorem~\ref{thm:fine-wilf} to $w_3$ and $w_4$ with
$v_{2i+2}$ as common factor, yields period $p''$ for the word
\[
w_5 ~=~ \outb{\rho[\ell_0,\ell_{2i+2}]} ~ v_{2i+2} ~
\outb{\rho[\ell_{2i+2},\ell_{2i+3}]} ~ v_{2i+3}
\]
Finally, the periodicity is not affected when we remove
factors of length multiple than the period. In particular,
by removing the factor $v_{2i+2}$ from $w_5$,
we obtain the desired word
$\outb{\rho[\ell_0,\ell_{2i+3}]} ~ v_{2i+3}$, whose period
$p''$ divides $p_{2i+3}$. This proves the claim for the inductive step,
and completes the proof of the proposition.
\end{proof}
\medskip
The $\simeq$-classes considered so far cannot be directly used to
define the blocks in the desired decomposition of $\rho$, since the $x$-coordinates of their
endpoints might not be in the appropriate order. The next definition
takes care of this, by enlarging the $\simeq$-classes according to
$x$-coordinates of the anchor points in the equivalence class.
\bigskip\noindent
\begin{minipage}[l]{\textwidth-5.8cm}
\begin{defi}\label{def:bounding-box-sweeping}
Consider a non-singleton $\simeq$-equivalence class $K=[\ell,\ell']$.
Let $\an{K}$
be the restriction of $K$ to the anchor points occurring in some inversion,
and $X_{\an{K}} = \{x \::\: \exists y\: (x,y)\in \an{K}\}$
be the projection of $\an{K}$ on positions.
We define $\block{K}=[\tilde\ell,\tilde\ell']$, where
\begin{itemize}
\item $\tilde\ell$ is the latest location $(\tilde x,\tilde y) \mathrel{\unlhd} \ell$
such that $\tilde x = \min(X_{\an{K}})$,
\item $\tilde\ell'$ is the earliest location $(\tilde x,\tilde y) \mathrel{\unrhd} \ell'$
such that $\tilde x = \max(X_{\an{K}})$
\end{itemize}
(note that the locations $\tilde\ell,\tilde\ell'$ exist since $\ell,\ell'$
are anchor points in some inversion).
\end{defi}
\end{minipage}
\begin{minipage}[r]{5.7cm}
\input{block-construction-sweeping}
\end{minipage}
\smallskip
\begin{lem}\label{lem:bounding-box-sweeping}
If $K$ is a non-singleton $\simeq$-equivalence class,
then $\rho|\block{K}$ is a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block.
\end{lem}
\begin{proof}
Consider a non-singleton $\simeq$-class $K=[\ell,\ell']$ and let $\an{K}$, $X_{\an{K}}$, and
$\block{K}=[\tilde\ell,\tilde\ell']$
be as in Definition \ref{def:bounding-box-sweeping}.
The reader can refer to Figure \ref{fig:block-construction-sweeping}
to quickly recall the notation.
We need to verify that $\rho[\tilde\ell,\tilde\ell']$ is a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block
(cf.~Definition \ref{def:factors-sweeping}), namely, that:
\begin{itemize}
\item $\tilde\ell=(\tilde x,\tilde y)$, $\tilde\ell'=(\tilde x',\tilde y')$,
with $\tilde x \le \tilde x'$,
\item the output produced by $\rho[\tilde\ell,\tilde\ell']$
is almost periodic with bound $2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
\item the output produced by the subsequence $\rho|Z$,
where $Z=[\tilde\ell,\tilde\ell'] ~\setminus~
\big([\tilde x,\tilde x']\times[\tilde y,\tilde y']\big)$,
has length at most $2{\boldsymbol{H}}} %h_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
\end{itemize}
The first condition $\tilde x \le \tilde x'$ follows immediately from
the definition of $\tilde x$ and $\tilde x'$ as $\min(X_{\an{K}})$
and $\max(X_{\an{K}})$, respectively.
Next, we prove that the output produced by the factor
$\rho[\tilde\ell,\tilde\ell']$ is almost periodic with bound $2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By Definition \ref{def:bounding-box-sweeping}, we have
$\tilde\ell \mathrel{\unlhd} \ell \mathrel{\lhd} \ell' \mathrel{\unlhd} \tilde\ell'$,
and by Lemma \ref{lem:overlapping} we know that $\out{\rho[\ell,\ell']}$
is periodic with period at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ ($\le 2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$). So it suffices to show that
the lengths of the words $\out{\rho[\tilde\ell,\ell]}$ and
$\out{\rho[\ell',\tilde\ell']}$ are at most $2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
We shall focus on the former word, as the arguments for
the latter are similar.
First, we note that the factor $\rho[\tilde\ell,\ell]$
lies entirely to the right of position $\tilde x$, and
in particular, it starts at an even level $\tilde y$. This follows
from the definition of $\tilde\ell$, and whether $\ell$ itself is at
an odd/even level. In particular, the location $\ell$ is either at the same level as $\tilde\ell$,
or just one level above.
Now, suppose, by way of contradiction, that $|\out{\rho[\tilde\ell,\ell]}| > 2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
We head towards a contradiction by finding a location $\ell'' \mathrel{\lhd} \ell$
that is $\simeq$-equivalent to the first location $\ell$ of the $\simeq$-equivalence
class $K$.
Since the location $\ell$ is either at the same level as $\tilde\ell$,
or just above it,
the factor $\rho[\tilde\ell,\ell]$ is of the form $\alpha\,\beta$,
where $\alpha$ is rightward factor lying on the same level as $\tilde\ell$
and $\beta$ is either empty or a leftward factor on the next level.
Moreover, since $|\out{\rho[\tilde\ell,\ell]}| > 2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, we know that
either $|\out{\alpha}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ or $|\out{\beta}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Thus, Lemma \ref{lem:output-minimal-sweeping}
says that one of the two factors $\alpha,\beta$ is not output-minimal.
In particular, there is a loop $L_1$, strictly to the right of $\tilde x$,
that intercepts a subfactor $\gamma$ of $\rho[\tilde\ell,\ell]$,
with $\out{\gamma}$ non-empty and output-minimal.
Let $\ell''$ be the first location of the factor $\gamma$.
Clearly, $\ell''$ is an anchor point of $L$ and $\out{\tr{\ell''}}\neq\emptystr$.
Further recall that $\tilde x=\min(X_{\an{K}})$ is the leftmost position of
locations in the class $K=[\ell,\ell']$ that are also anchor points of inversions.
In particular, there is a loop $L_2$ with some anchor point
$\ell''_2=(\tilde x,y''_2)\in \an{K}$, and such that $\tr{\ell''}$ is
non-empty and output-minimal.
Since $\ell'' \mathrel{\lhd} \ell \mathrel{\unlhd} \ell''_2$
and the position of $\ell''$ is to the right of the position of $\ell''_2$,
we know that $(L_1,\ell'',L_2,\ell''_2)$ is also an inversion,
and hence $\ell'' \simeq \ell''_2 \simeq \ell$.
But since $\ell'' \mathrel{\lhd} \ell$, we get a contradiction with the
assumption that $\ell$ is the first location of a $\simeq$-class.
In this way we have shown that $|\out{\rho[\ell_1,\ell]}| \le 2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
It remains to show that the output produced
by the subsequence $\rho|Z$, where
$Z=[\tilde\ell,\tilde\ell'] ~\setminus~ \big([\tilde x,\tilde x']\times[\tilde y,\tilde y']\big)$,
has length at most $2{\boldsymbol{H}}} %h_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
For this it suffices to prove that
$|\out{\alpha}| \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ for every factor $\alpha$ of
$\rho[\tilde\ell, \tilde\ell']$ that lies
at a single level and either to the left of $\tilde x$ or to the right of $\tilde x'$.
By symmetry, we consider only one of the two types of factors.
Suppose, by way of contradiction, that there is a factor $\alpha$
at level $y''$, to the left of $\tilde x$,
and such that $|\out{\alpha}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By Lemma \ref{lem:output-minimal-sweeping} we know that
$\alpha$ is not output-minimal, so there is some loop
$L_2$ strictly to the left of $\tilde x$ that intercepts an
output-minimal subfactor
$\beta$ of $\alpha$ with non-empty output.
Let $\ell''$ be the first location of $\beta$. We know that
$\tilde\ell \mathrel{\lhd} \ell'' \mathrel{\unlhd} \tilde\ell'$. Since the level
$\tilde y$ is even, this means that the level of $\ell''$ is strictly
greater than $\tilde y$. Since we also know that $\ell$
is an anchor point of some inversion, we can take a suitable loop $L_1$
with anchor point $\ell$ and obtain that $(L_1,\ell,L_2,\ell'')$ is an
inversion, so $\ell'' \simeq \ell$. But
this contradicts the fact that $\tilde x$ is the leftmost position of
$\an{K}$.
We thus conclude that $|\out{\alpha}| \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, and this
completes the proof that $\rho|\block{K}$ is a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block.
\begin{comment}
We now prove that the output produce by the subsequence $\rho\mid Z$, where
$Z=[\ell_1,\ell_2]\setminus[x_1,x_2]\times[y_1,y_2]$, has length at most
$2 (y_2 - y_1)\cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax} \leq {\boldsymbol{H}}} %h_{\mathsf{max}}} \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax} $.
Suppose, by way of contradiction, that this is not the case, and
that $\big|\out{\rho\mid Z}\big| > 2(y_2 - y_1) \cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Since the set $Z$ spans across at most $y_2 - y_1$ levels and does not cover
the locations inside the ``bounding box'' $[x_1,x_2]\times[y_1,y_2]$,
we could find a factor $\alpha$ that produces an output longer than $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
that lies on a single level $y'$, and either to the left of $x_1$ or to the
right of $x_2$.
Suppose that this output is on the left (the right case is symmetric), and that $\alpha$ is a factor
on some level $y'\in\{y_1+1,\ldots,y_2\}$ that is intercepted by the interval
$I=[1,x_1]$ and that produces an output of length strictly greater than $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By the contrapositive of Lemma \ref{lemma:simple-loop}, the factor $\alpha$
is captured by some loop $L'=[x'_1,x'_2]$ that is {\sl strongly contained} in
$I=[1,x_1]$, namely, such that $1\le x'_1<x'_2<x_1$, and such that the output of $L'$ at level $y'$ is non-empty.
Let $\ell'=(x',y')$ be the anchor point of $L'$, where $x'=x'_1$ or $x'=x'_2$
depending on whether $y'$ is odd or even. Recall that, by the definition of $[K]$,
there is also a location $\ell=(x,y)$ that strictly precedes $\ell'$ along the
run and that belongs to $H$. This implies that $\ell$ is an, anchor point of some loop $L$.
Moreover, recall that $x'_1\le x'\le x'_2 < x_1$ and $x_1\le x\le x_2$, namely,
$\ell'$ is {\sl strictly to the left} of $\ell$ according to the ordering of
the $x$-coordinates. This shows that $(L,\ell,L',\ell')$ is also an inversion, and
hence $\ell'$ also belongs to $H$.
However, this contradicts the definition of $x_1$ as the minimum of the
$x$-coordinates of the locations in $H$.
A similar contradiction can be obtained in the case where the factor that produces an
output of length strictly greater than $ \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ lies at the right of $x_2$.
By the above arguments, we know that $\big|\out{\rho\mid Z}| \le 2 (y_2 - y_1)\cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax} \leq {\boldsymbol{H}}} %h_{\mathsf{max}}} \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
where $Z=[\ell_1,\ell_2]\setminus[x_1,x_2]\times[y_1,y_2]$, namely, that the second
condition of the definition of block is satisfied.
It remains to verify the first condition, that the output produced by
$\rho[\ell_1,\ell_2]$ is almost periodic with bound $2 \cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Let $\ell'_1$ and $\ell'_2$ be the first and the last locations of the
$\simeq$-equivalence class $K$ (note that $\ell_1\le \ell'_1\le \ell'_2\le\ell_2$).
Recall that Lemma \ref{lem:overlapping} already shows that the output produced between
$\ell'_1$ and $\ell'_2$ is periodic with period at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Thus, we just need to show that the prefix $\out{\rho[\ell_1,\ell'_1]}$ and
the suffix $\out{\rho[\ell'_2,\ell_2]}$ have length at most $2 \cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Suppose that the length of $\out{\rho[\ell_1,\ell'_1]}$ exceeds $ 2 \cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By the definition of $[K]$, the two locations $\ell_1$ and $\ell'_1$ would be either
on the same level, i.e.~$y_1$, or on adjacent levels, i.e.~$y_1$ and $y_1+1$.
In the following, we show that none of these cases can happen, thus reaching
a contradiction from the assumption $\big|\out{\rho[\ell_1,\ell'_1]}\big| > 2 \cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
If $\ell_1$ were on the same level as $\ell'_1$, then clearly the factor
$\out{\rho[\ell_1,\ell'_1]}$ would lie on a single level and to the right
of $x_1$, and would produce an output longer than $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Then, by using the contrapositive of Lemma \ref{lemma:simple-loop}, we could
find a loop $L'=[x'_1,x'_2]$ strongly contained in the interval $I=[x_1,n]$,
where $n$ is the rightmost position of the input, that captures the factor
$\out{\rho[\ell_1,\ell'_1]}$ with non-empty output.
We recall that $\ell'_1$ is the first location of the $\simeq$-equivalence
class $K$, and hence there is an inversion $(L'_1,\ell'_1,L'',\ell'')$, for some
location $\ell''$ that follows $\ell'_1$ along the run. We then define
$\ell=(x'_1,y_1)$ and we observe that this location is an anchor point
of $L'$ and it strictly precedes $\ell''$.
We thus get that $(L',\ell,L'',\ell'')$ is also an inversion. This, however,
is a contradiction because the inversion $(\ell,\ell'')$ intersects
the $\simeq$-equivalence class $K$, without being contained in it.
Let us now consider the second case, where $\ell_1$ is on level $y_1$ and
$\ell'_1$ is on level $y_1+1$.
Since $\rho[\ell_1,\ell'_1]$ spans across two levels and produces an
output longer than $ 2 \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, there is a factor
$\alpha$ of $\out{\rho[\ell_1,\ell'_1]}$ that lies entirely on a single
level -- either $y_1$ or $y_1+1$ -- and to the right of $x_1$, and
produces an output longer than $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Then, by reasoning as in the previous case, we can get a contradiction
by finding an inversion $(L,\ell,L'',\ell'')$ that intersects $K$ without
being contained in it.
We have just shown that $\big|\out{\rho[\ell_1,\ell'_1]}\big| \le 2 \cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By using symmetric arguments, we can also prove that
$\big|\out{\rho[\ell'_2,\ell_2]}\big| \le 2 \cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Finally, we recall that, by Lemma \ref{lem:overlapping}, the period of
$\out{\rho[\ell'_1,\ell'_2]}$ is smaller than $ \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
All together, this shows that the output produced between the
locations $\ell_1$ and $\ell_2$ is almost periodic with bound
$2 \cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ and hence $[K]=(\ell_1,\ell_2)$ is a block.
\end{comment}
\end{proof}
The next lemma shows that blocks do not overlap along the input axis:
\begin{lem}\label{lem:consecutive-blocks-sweeping}
Suppose that $K_1$ and $K_2$ are two different non-singleton $\simeq$-classes
such that $\ell \mathrel{\lhd} \ell'$ for all $\ell \in K_1$ and $\ell' \in K_2$.
Let $\block{K_1}=[\ell_1,\ell_2]$ and $\block{K_2}=[\ell_3,\ell_4]$,
with $\ell_2=(x_2,y_2)$ and $\ell_3=(x_3,y_3)$.
Then $x_2 < x_3$.
\end{lem}
\begin{proof}
Suppose by contradiction that $K_1$ and $K_2$ are as in the
statement, but $x_2 \ge x_3$.
By Definition \ref{def:bounding-box-sweeping},
$x_2=\max(X_{\an{K_1}})$ and $x_3=\min(X_{\an{K_2}})$.
This implies the existence of some inversions
$(L,\ell,L',\ell')$ and $(L'',\ell'',L''',\ell''')$
such that $\ell=(x_2,y)$ and $\ell'''=(x_3,y''')$.
Moreover, since $\ell \mathrel{\unlhd} \ell'''$ and $x_2 \ge x_3$,
we know that $(L,\ell,L''',\ell''')$ is also an inversion,
thus implying that $K_1=K_2$.
\end{proof}
For the sake of brevity, we call \emph{$\simeq$-block} any
factor of the form $\rho|\block{K}$ that is obtained by applying
Definition~\ref{def:bounding-box-sweeping} to a non-singleton $\simeq$-class $K$.
The results obtained so far imply that every location covered by an
inversion is also covered by an $\simeq$-block (Lemma \ref{lem:bounding-box-sweeping}),
and that the order of occurrence of $\simeq$-blocks is the same as the order of positions
(Lemma \ref{lem:consecutive-blocks-sweeping}).
So the $\simeq$-blocks can be used as factors for the $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition
of $\rho$ we are looking for. Below, we show that the remaining
factors of $\rho$, which do not overlap the $\simeq$-blocks, are $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonals.
This will complete the construction of a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition of $\rho$.
Formally, we say that a factor $\rho[\ell,\ell']$
\emph{overlaps} another factor $\rho[\ell'',\ell''']$ if
$[\ell,\ell'] \:\cap\: [\ell'',\ell'''] \neq \emptyset$,
$\ell' \neq \ell''$, and $\ell \neq \ell'''$.
\begin{lem}\label{lem:diagonal-sweeping}
Let $\rho[\ell,\ell']$ be a
factor of $\rho$,
with $\ell=(x,y)$, $\ell'=(x',y')$, and $x\le x'$,
that does not overlap any $\simeq$-block.
Then $\rho[\ell,\ell']$ is a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonal.
\end{lem}
\begin{proof}
Consider a factor $\rho[\ell,\ell']$, with $\ell=(x,y)$, $\ell'=(x',y')$,
and $x\le x'$, that does not overlap any $\simeq$-block.
We will focus on locations $\ell''$ with $\ell \mathrel{\unlhd} \ell''
\mathrel{\unlhd} \ell'$
that are anchor points of some loop with $\out{\tr{\ell''}}\neq\emptystr$.
We denote by $A$ the set of all such locations.
First, we show that the locations in $A$ are monotonic
\reviewOne[inline]{Monotonic$\to$Monotonous?
\olivier[inline]{we keep monotonic}%
}%
w.r.t.~the position order. Formally,
we prove that for all $\ell_1,\ell_2\in A$, if $\ell_1=(x_1,y_1) \mathrel{\unlhd} \ell_2=(x_2,y_2)$, then
$x_1 \le x_2$. Suppose that this were not the case, namely, that $A$ contained two anchor points
$\ell_1=(x_1,y_1)$ and $\ell_2=(x_2,y_2)$ with $\ell_1 \mathrel{\lhd} \ell_2$ and $x_1 > x_2$.
Let $L_1,L_2$ be the loops of $\ell_1,\ell_2$, respectively, and recall that
$\out{\tr{\ell_1}},\out{\tr{\ell_2}}\neq\emptystr$. This means that $(L_1,\ell_1,L_2,\ell_2)$
is an inversion, and hence $\ell_1 \simeq \ell_2$. But this contradicts the hypothesis that
$\rho[\ell,\ell']$ does not overlap any $\simeq$-block.
Next, we identify the floors of our diagonal. Let $y_0,y_1,\dots,y_{n-1}$ be all the {\sl even}
levels that have locations in $A$. For each $i=0,\dots,n-1$, let $\ell_{2i+1}$ (resp.~$\ell_{2i+2}$)
be the first (resp.~last) anchor point of $A$ at level $y_i$. Further let $\ell_0=\ell$ and $\ell_{2n+1}=\ell'$.
Clearly, each factor $\rho[\ell_{2i+1},\ell_{2i+2}]$ is a floor. Moreover, thanks to the previous
arguments, each location $\ell_{2i}$ is to the left of the location $\ell_{2i+1}$.
It remains to prove that each factor $\rho[\ell_{2i},\ell_{2i+1}]$ produces an
output of length at most $2{\boldsymbol{H}}} %h_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$. By construction, $A$ contains no anchor
point at an even level and strictly between $\ell_{2i}$ and $\ell_{2i+1}$.
By Lemma \ref{lem:output-minimal-sweeping} this means that the outputs produced
by subfactors of $\rho[\ell_{2i},\ell_{2i+1}]$ that lie entirely at an {\sl even}
level have length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Let us now consider the subfactors $\alpha$ of $\rho[\ell_{2i},\ell_{2i+1}]$
that lie entirely at an {\sl odd} level, and let us prove that they produce outputs
of length at most $2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$. Suppose that this is not the case, namely, that
$|\out{\alpha}| > 2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$. In this case we show that an inversion
would exist at this level. Formally, we can find two locations $\ell'' \mathrel{\lhd} \ell'''$
in $\alpha$ such that the prefix of $\alpha$ that ends at location $\ell''$ and the suffix
of $\alpha$ that starts at location $\ell'''$ produce outputs of
length greater than $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By Lemma \ref{lem:output-minimal-sweeping},
those two factors would not be output-minimal,
and hence $\alpha$ would contain disjoint loops $L_1,L_2$ with anchor points $\ell''_1,\ell''_2$
forming an inversion $(L_1,\ell''_1,L_2,\ell''_2)$. But this would imply that $\ell''_1,\ell''_2$
belong to the same non-singleton $\simeq$-equivalence class, which contradicts the hypothesis
that $\rho[\ell,\ell']$ does not overlap any $\simeq$-block.
We must conclude that the subfactors of $\rho[\ell_{2i},\ell_{2i+1}]$
produce outputs of length at most $2\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Overall, this shows that the output produced by each factor $\rho[\ell_{2i},\ell_{2i+1}]$
has length at most $2{\boldsymbol{H}}} %h_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
\end{proof}
\begin{comment}
LICS proof for the 2-way case
\begin{proof}
Suppose by contradiction that there is some $x\in[x_1,x_2]$
such that, for all locations $\ell=(x,y)$ between $\ell_1$ and $\ell_2$,
one of the following conditions holds:
\begin{enumerate}
\item $|\out{\rho\mid Z_\ell^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}}}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
where $Z_\ell^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}} = [\ell,\ell_2] \:\cap\: \big([0,x]\times\bbN\big)$,
\item $|\out{\rho\mid Z_\ell^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}}}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
where $Z_\ell^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}} = [\ell_1,\ell] \:\cap\: \big([x,\omega]\times\bbN\big)$.
\end{enumerate}
We claim first that for each condition above
there is some level $y$ at which it holds. Observe that for the
highest location $\ell$ of the run at position $x$, the set
$Z_\ell^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}}$ is empty, since the outgoing transition at $\ell$
is rightward. So condition 1 is trivially violated at $\ell$ as above, hence
condition 2 holds by the initial assumption. Symmetrically, condition
1 holds at the lowest location of the run at position $x$.
Let us now compare, for each condition, the levels where it holds.
Clearly, the lower the level of the location $\ell$,
the easier it is to satisfy condition 1, and symmetrically for condition 2.
So, let $\ell=(x,y)$ (resp.~$\ell'=(x,y')$) be the highest (resp.~lowest)
location at position $x$ that satisfies condition 1 (resp.~condition 2).
We claim that $y \ge y'$.
For this, we first observe that $y \ge y'-1$, since otherwise there would
exist a location $\ell=(x,y'')$, with $y < y'' < y'$, violating both conditions 1 and 2.
Moreover, $y$ must be odd, otherwise the transition departing from $\ell=(x,y)$
would be rightward oriented and the location $\ell''=(x,y+1)$ would still
satisfy condition 1, contradicting the fact that $\ell=(x,y)$ was chosen to
be the highest location.
For similar reasons, $y'$ must also be odd, otherwise there would be
a location $\ell''=(x,y'-1)$ that precedes $\ell'$ and satisfies condition 2.
But since $y \ge y'-1$ and both $y$ and $y'$ are odd, we need to have $y\ge y'$.
From the previous arguments we know that in fact $\ell=(x,y)$ satisfies both conditions
1 and 2. We can thus apply Theorem \ref{thm:simon2} to the sets
$Z_\ell^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}}$ and $Z_\ell^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}}$, deriving the existence of
two idempotent loops $L_1,L_2$ and two components $C_1,C_2$ of $L_1,L_2$,
respectively, such that
\begin{itemize}
\item $\max(L_2) < x < \min(L_1)$,
\item $\ell_1 \mathrel{\lhd} \an{C_1} \mathrel{\lhd} \ell \mathrel{\lhd} \an{C_2} \mathrel{\lhd} \ell_2$,
\item $\out{\tr{C_1}},\out{\tr{C_2}}\neq\emptystr$.
\end{itemize}
In particular, since $\an{C_1}$ is to the right of $\an{C_2}$ w.r.t.~the order
of positions, we know that $(L_1,C_1,L_2,C_2)$ is an inversion, and hence
$\an{C_1} \simeq \an{C_2}$. But this contradicts the assumption that
$\rho[\ell_1,\ell_2]$ does not overlap with any $\simeq$-block.
\end{proof}
\end{comment}
\begin{comment}
We consider the locations
that are not strictly covered by $\simeq$-blocks, formally, the
set $B = \{ \ell \:\mid\: \nexists\:(\ell_1,\ell_2)\text{ $\simeq$-block s.t.}~\ell_1<\ell<\ell_2\}$.
We equip $B$ with the natural ordering of locations induced by $\rho$.
We now consider some maximal convex subset $C$ of $B$.
Note that the left/right endpoint of $C$ coincides with the first/last
location of the run $\rho$ or with the right/left endpoint of some $\simeq$-block.
Below, we show how to decompose the subrun $\rho\mid C$ into a series of diagonals
and blocks. After this, we will be able to get a full decomposition of $\rho$ by
interleaving the $\simeq$- blocks that we defined above with the diagonals
and the blocks that decompose each subrun $\rho\mid C$.
Let $D_C$ be the set of locations $\ell=(x,y)$ of $C$ such that
there is some loop $L=[x,x']$, with $x'\ge x$, whose trace at level $y$
lies entirely inside $C$ and
produces non-empty output.
We remark that the set $D_C$ may be non-empty. To see this, one can
imagine the existence of two consecutive $\simeq$- blocks (e.g.~$R_1$
and $R_2$ in Figure~\ref{fig:decomposition}) and a loop between them
that produces non-empty output (e.g.~the factor $F_2$). In a more
general scenario, one can find several loops between two consecutive
$\simeq$- blocks that span across different levels.
We can observe however that all the locations in $D_C$ are on even levels.
Indeed, if this were not the case for some $\ell=(x,y) \in D_C$,
then we could select a minimal loop $L=[x_1,x_2]$ such that $x_1\le x\le x_2$
and $\out{\tr{\ell}} \neq \varepsilon$. Since $y$ is odd,
$\ell_1=(x_2,y)$ and $ \ell_2=(x_1,y)$ are anchor points of $L$, and hence $(\ell_1,\ell_2)$ is an inversion.
Since $\ell_1\le\ell\le\ell_2$ and all inversions are covered by
$\simeq$-blocks, there is a $\simeq$-block $(\ell'_1,\ell'_2)$ such
that $\ell'_1\le\ell\le\ell'_2$.
However, as $\ell'_1$ and $\ell'_2$ are at even levels,
$\ell$ must be different from these two locations, and
this would contradict the definition of $D_C$.
Using similar arguments, one can also show that the locations in $D_C$ are
arranged along a ``rising diagonal'', from lower left to upper right.
The above properties suggest that the locations in $D_C$ identify some
diagonals and blocks that form a decomposition of $\rho\mid C$.
The following lemma shows that this is indeed the case, namely, that
any two consecutive locations in $D_C$ form a diagonal or a block.
\begin{lem}\label{lemma:ladder}
Let $\ell_1=(x_1,y_1)$ and $\ell_2=(x_2,y_2)$ be two consecutive locations of $D_C$.
Then, $x_1\le x_2$ and $y_1\le y_2$ and the pair $(\ell_1,\ell_2)$ is a diagonal
or a block, depending on whether $y_1=y_2$ or $y_1<y_2$.
\end{lem}
\begin{proof}
Recall that all the locations in $D_C$ are on even levels, so the lemma holds in particular for $\ell_1$ and $\ell_2$
If $y_1=y_2$, then $(\ell_1,\ell_2)$ is clearly a floor.
So let us assume that $y_1 \neq y_1$.
The fact that $x_1\le x_2$ and $y_1 < y_2$ holds follows from the arguments
given in part of the body that just preceded the lemma.
The first three conditions of the definition of blockare also satisfied because
$\ell_1 $ and $\ell_2 $ are consecutive locations in $D_C$.
Below, we verify that the output produced by the factor $\rho[\ell_1,\ell_2]$
has length at most $(y_2 - y_1 +1)\cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Note that this will prove both the fourth and the fifth conditions:
for $Z=[\ell_1,\ell_2] \:\setminus\: [x_1,x_2]\times[y_1,y_2]$,
the subsequence $\rho\mid Z$ produces an output that is clearly
shorter than that of $\rho[\ell_1,\ell_2]$, and in addition we have
$(y_2 - y_1 + 1) < 2(y_2 - y_1)$.
Suppose, by way of contradiction, that $\out{\rho[\ell_1,\ell_2]} > (y_2 - y_1 +1)\cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Since between $\ell_1$ and $\ell_2$ there are $y_2-y_1+1$ levels,
there is a factor $\alpha$ of $\rho[\ell_1,\ell_2]$ that produces an output longer than
$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ and that lies on a single level $y$, for some $y_1 \leq y \leq y_2$.
The contrapositive of Lemma~\ref{lemma:simple-loop} implies that
the factor $\alpha$ is captured by some loop $L'=[x'_1,x'_2]$ such that
$x'_1 > x_1$ if $y=y_1$, and $x'_2 < y_2$ if $y=y_2$.
In particular, the location $\ell'=(x'_1,y)$ is an entry point of $L$ and it
belongs to $D_C$. We have just shown that there is $\ell'\in D_C$ such that
$\ell_1<\ell'<\ell_2$. However, this contradicts the hypothesis that $\ell_1$
and $\ell_2$ were consecutive locations in $D_C$.
We must conclude that the output produced by the infix $\rho[\ell_1,\ell_2]$
has length at most $(y_2- y_1 +1) \cdot \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, and hence $(\ell_1,\ell_2)$ is a block.
\end{proof}
\end{comment}
\smallskip
We have just shown how to construct a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition of the run $\rho$
that satisfies \PR2. This proves Proposition \ref{prop:decomposition-sweeping},
as well as the implication \PR2 $\Rightarrow $ \PR3 of Theorem \ref{thm:main2}.
\medskip
\subsection*{From existence of decompositions to an equivalent one-way transducer.}
We now focus on the last implication \PR3 $\Rightarrow $ \PR1 of Theorem \ref{thm:main2}.
More precisely, we show how to construct a one-way transducer $\cT'$ that simulates
the outputs produced by the successful runs of $\cT$ that admit $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decompositions.
In particular, $\cT'$ turns out to be equivalent to $\cT$ when $\cT$ is one-way definable.
Here we will only give a proof sketch of this construction (as there is no real difference between the sweeping and two-way cases) assuming that $\cT$ is a sweeping
transducer; a fully detailed construction of $\cT'$ from an arbitrary two-way transducer $\cT$
will be given in Section~\ref{sec:characterization-twoway} (Proposition \ref{prop:construction-twoway}),
together with a procedure for deciding one-way definability of $\cT$ (Proposition \ref{prop:complexity}).
\reviewOne[inline]{The structure of Prop 8.6 is all but indistinguishable visually/ This is made all the more aggravating by the fact that there is no corresponding proof in the sweeping case (merely the intuition sketched on Page 23.
\felix[inline]{added a sentence}
\olivier[inline]{answered in review1-answer.txt}%
}%
\begin{prop}\label{prop:construction-sweeping}
Given a functional sweeping transducer $\cT$
a one-way transducer $\cT'$ can be constructed in
$2\exptime$ such that the following hold:
\begin{enumerate}
\item $\cT' \subseteq \cT$,
\item $\dom(\cT')$ contains all words that induce successful runs of $\cT$
admitting $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-de\-com\-po\-si\-tions.
\end{enumerate}
In particular, $\cT'$ is equivalent to $\cT$ iff $\cT$ is one-way definable.
\end{prop}
\begin{proof}[Proof sketch.]
Given an input word $u$, the one-way transducer $\cT'$ needs to guess a successful run $\rho$ of $\cT$ on $u$
that admits a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition. This can be done by guessing the crossing sequences of $\rho$ at each
position,
together with a
sequence of locations $\ell_i$ that identify the factors of a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition of $\rho$.
To check the correctness of the decomposition, $\cT'$ also needs to guess a bounded amount of information
(words of bounded length) to reconstruct the outputs produced by the $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonals
and the $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-blocks. For example, while scanning a factor of the input underlying a diagonal, $\cT'$
can easily reproduce the outputs of the floors and the guessed outputs of factors between them.
In a similar way, while scanning a factor of the input underlying a block, $\cT'$ can simulate
the almost periodic output by guessing its repeating pattern and the bounded prefix and suffix
of it, and by emitting the correct amount of letters, as it is done in Example \ref{ex:running}.
In particular, one can verify that the capacity of $\cT'$ is linear in ${\boldsymbol{H}}} %h_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Moreover, because the guessed objects are of size linear in ${\boldsymbol{H}}} %h_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ and ${\boldsymbol{H}}} %h_{\mathsf{max}}}\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ is a
simple exponential in the size of $\cT$, the size of the one-way transducer $\cT'$ has
doubly exponential size in that of $\cT$.
\end{proof}
\section{The characterization in the two-way case}\label{sec:characterization-twoway}
In this section we generalize the characterization of one-way
definability of sweeping transducers to the general two-way case. As
usual, we fix through the rest of the section a successful run $\rho$
of $\cT$ on some input word $u$.
\medskip
\subsection*{From periodicity of inversions to existence of decompositions.}
We continue by proving the second implication \PR2 $\Rightarrow$ \PR3 of
Theorem \ref{thm:main2} in the two-way case. This requires showing the
existence of a suitable decomposition of a run $\rho$ that
\emph{satisfies} property \PR2. Recall that \PR2 says that for every inversion
$(L_1,\ell_1,L_2,\ell_2)$, the period of the word
$\out{\tr{\ell_1}} ~ \out{\rho[\ell_1,\ell_2]} ~ \out{\tr{\ell_2}}$
divides $\gcd(|\out{\tr{\ell_1}}|, |\out{\tr{\ell_2}}|) \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
The definitions underlying the decomposition of $\rho$ are similar
to those given in the sweeping case:
\begin{defi}\label{def:factors-twoway}
Let $\rho[\ell,\ell']$ be a factor of a run $\rho$ of $\cT$,
where $\ell=(x,y)$, $\ell'=(x',y')$, and $x\le x'$.
We call $\rho[\ell,\ell']$
\begin{itemize}
\medskip
\item \parbox[t]{\dimexpr\textwidth-\leftmargin}{
\vspace{-2.75mm}
\begin{wrapfigure}{r}{8cm}
\vspace{-6mm}
\input{diagonal-twoway}
\vspace{-5mm}
\end{wrapfigure}
%
a \emph{$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonal}
if for all $z\in[x,x']$, there is a location $\ell_z$ at position $z$
such that $\ell \mathrel{\unlhd} \ell_z \mathrel{\unlhd} \ell'$ and the words
$\out{\rho|Z_{\ell_z}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}}}$ and
$\out{\rho|Z_{\ell_z}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}}}$
have length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
where $Z_{\ell_z}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}} = [\ell_z,\ell'] \:\cap\: \big([0,z]\times\bbN\big)$
and $Z_{\ell_z}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}} = [\ell,\ell_z] \:\cap\: \big([z,\omega]\times\bbN\big)$;
}
\bigskip
\medskip
\item \parbox[t]{\dimexpr\textwidth-\leftmargin}{%
\vspace{-2.75mm}
\begin{wrapfigure}{r}{8cm}
\vspace{-6mm}
\input{block-twoway}
\vspace{-6mm}
\end{wrapfigure}
%
a \emph{$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block} if the word
$\out{\rho[\ell,\ell']}$ is almost periodic with bound $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
and
$\out{\rho|Z^{\shortleftarrow}}$ and
$\out{\rho|Z^{\shortrightarrow}}$ have length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
where $Z^{\shortleftarrow} = [\ell,\ell'] \:\cap\: \big([0,x]\times \bbN\big)$
and $Z^{\shortrightarrow} = [\ell,\ell'] \:\cap\: \big([x',\omega]\times \bbN\big)$.
}
\vspace{8mm}
\end{itemize}
\end{defi}
The definition of $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition is copied verbatim from the sweeping case,
but uses the new notions of $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonal and $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block:
\begin{defi}\label{def:decomposition-twoway}
A \emph{$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition} of a run $\rho$ of $\cT$ is a factorization
$\prod_i\,\rho[\ell_i,\ell_{i+1}]$ of $\rho$ into $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonals and $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-blocks.
\end{defi}
\noindent
To provide further intuition,
we consider the transduction of Example~\ref{ex:running}
and the two-way transducer $\cT$ that implements it in the most natural way.
Figure~\ref{fig:decomposition-twoway} shows an example of a run of $\cT$ on
an input of the form $u_1 \:\#\: u_2 \:\#\: u_3 \:\#\: u_4$, where
$u_2,\, u_4 \in (abc)^*$, $u_1,\,u_3\nin (abc)^*$, and $u_3$ has even length.
The factors of the run that produce long outputs are highlighted
by the bold arrows. The first and third factors of the decomposition,
i.e.~$\rho[\ell_1,\ell_2]$ and $\rho[\ell_3,\ell_4]$, are diagonals
(represented by the blue hatched areas); the second and fourth factors
$\rho[\ell_2,\ell_3]$ and $\rho[\ell_4,\ell_5]$ are blocks
(represented by the red hatched areas).
To identify the blocks of a possible decomposition of $\rho$,
we reuse the equivalence relation $\simeq$ introduced in Definition \ref{def:crossrel}.
Recall that this is the reflexive and transitive closure of the relation $\ensuremath{\mathrel{\text{\sf S}}}$
that groups any two locations $\ell,\ell'$ that occur between $\ell_1,\ell_2$, for some
inversion $(L_1,\ell_1,L_2,\ell_2)$.
The proof that the output produced inside each $\simeq$-equivalence class is periodic,
with period at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ (Lemma \ref{lem:overlapping}) carries over in the
two-way case without modifications.
Similarly, every $\simeq$-equivalence class can be extended to the left and to the
right by using Definition \ref{def:bounding-box-sweeping}, which
we report here verbatim for the sake of readability, together with an exemplifying figure.
\input{decomposition-twoway}
\bigskip\noindent
\begin{minipage}[l]{\textwidth-5.8cm}
\begin{defi}\label{def:bounding-box-twoway}
Consider a non-singleton $\simeq$-equivalence class $K=[\ell,\ell']$.
Let $\an{K}$
be the restriction of $K$ to the anchor points occurring in some inversion,
and $X_{\an{K}} = \{x \::\: \exists y\: (x,y)\in \an{K}\}$
be the projection of $\an{K}$ on positions.
We define $\block{K}=[\tilde\ell,\tilde\ell']$, where
\begin{itemize}
\item $\tilde\ell$ is the latest location $(\tilde x,\tilde y) \mathrel{\unlhd} \ell$
such that $\tilde x = \min(X_{\an{K}})$,
\item $\tilde\ell'$ is the earliest location $(\tilde x,\tilde y) \mathrel{\unrhd} \ell'$
such that $\tilde x = \max(X_{\an{K}})$
\end{itemize}
(note that the locations $\tilde\ell,\tilde\ell'$ exist since $\ell,\ell'$
are anchor points in some inversion).
\end{defi}
\end{minipage}
\begin{minipage}[r]{5.7cm}
\vspace{-2mm}
\input{block-construction-twoway}
\end{minipage}
\medskip
As usual, we call \emph{$\simeq$-block} any factor of $\rho$ of the form $\rho|\block{K}$
that is obtained by applying the above definition to a non-singleton $\simeq$-class $K$.
Lemma \ref{lem:bounding-box-sweeping}, which shows that $\simeq$-blocks can indeed
be used as $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-blocks in a decomposition of $\rho$, generalizes easily to the
two-way case:
\reviewOne[inline]{Most proofs are quite notation-heavy. A small figure to represent the positions and factors involved is a good thing to have. For example, Lemma 5.8 has Fig.5, but the corresponding (and slightly more involved) Lemme 8.4 hasn't. This seems like a worthwile investment for any long proof, or any time a huge number of notations are involved.
}%
\gabriele[inline]{I think the reviewer is referring to the lack of a figure for the previous definition,
exactly like for Definition 5.7. I put it.}%
\reviewTwo[inline]{
-p.37 l.21-22 the $\ell$ should be replaced with $\tilde{\ell}$
\olivier[inline]{I didn't find where}%
\felix[inline]{second and third line of the list of properties we will prove. I agree.}%
}%
\begin{lem}\label{lem:bounding-box-twoway}
If $K$ is a non-singleton $\simeq$-equivalence class,
then $\rho|\block{K}$ is a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block.
\end{lem}
\begin{proof}
The proof is similar to that of Lemma \ref{lem:bounding-box-sweeping}. The main
difference is that here we will bound the lengths of some outputs using
a Ramsey-type argument (Theorem \ref{thm:simon2}), instead of output-minimality
of factors (Lemma \ref{lem:output-minimal-sweeping}). To follow the various constructions
and arguments the reader can refer to Figure \ref{fig:block-construction-twoway}.
Let $K=[\ell,\ell']$, $\an{K}$, $X_{\an{K}}$, and $\block{K}=[\tilde\ell,\tilde\ell']$
be as in Definition \ref{def:bounding-box-twoway}, where
$\tilde\ell=(\tilde x,\tilde y)$, $\tilde\ell'=(\tilde x',\tilde y')$,
$\tilde x=\min(X_{\an{K}})$, and $\tilde x'=\max(X_{\an{K}})$.
We need to verify that $\rho|\block{K}$ is a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block, namely, that:
\begin{itemize}
\item $\tilde x \le \tilde x'$,
\item $\out{\rho[\tilde \ell,\tilde \ell']}$ is almost periodic with bound $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
\item $\out{\rho|Z^{\shortleftarrow}}$ and $\out{\rho|Z^{\shortrightarrow}}$ have length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
where $Z^{\shortleftarrow} = [\tilde \ell,\tilde \ell'] \:\cap\: \big([0,x]\times \bbN\big)$
and $Z^{\shortrightarrow} = [\tilde \ell,\tilde \ell'] \:\cap\: \big([x',\omega]\times \bbN\big)$.
\end{itemize}
The first condition $\tilde x \le \tilde x'$ follows immediately from
$\tilde x=\min(X_{\an{K}})$ and $\tilde x'=\max(X_{\an{K}})$.
Next, we prove that the output produced by the factor
$\rho[\tilde\ell,\tilde\ell']$ is almost periodic with bound $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By Definition \ref{def:bounding-box-twoway}, we have
$\tilde\ell \mathrel{\unlhd} \ell \mathrel{\lhd} \ell' \mathrel{\unlhd} \tilde\ell'$,
and by Lemma \ref{lem:overlapping}
we know that $\out{\rho[\ell,\ell']}$ is periodic with
period at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$. So it suffices to bound the length
of the words $\out{\rho[\tilde\ell,\ell]}$ and $\out{\rho[\ell',\tilde\ell']}$.
We shall focus on the former word, as the arguments for the latter
are similar.
First, we show that the factor $\rho[\tilde\ell,\ell]$
lies entirely to the right of position $\tilde x$
(in particular, it starts at an even level $\tilde y$).
Indeed, if this were not the case, there would exist another location
$\ell''=(\tilde x,\tilde y + 1)$, on the same position as $\tilde\ell$,
but at a higher level, such that $\tilde\ell \mathrel{\lhd} \ell'' \mathrel{\unlhd} \ell$.
But this would contradict Definition \ref{def:bounding-box-twoway}
($\tilde\ell$ is the \emph{latest} location $(x,y) \mathrel{\unlhd} \ell$
such that $x = \min(X_{\an{K}})$).
Suppose now that the length of $|\out{\rho[\tilde\ell,\ell]}| >
\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$. We head towards a contradiction by finding a location
$\ell'' \mathrel{\lhd} \ell$ that is $\simeq$-equivalent to the first
location $\ell$ of the $\simeq$-equivalence class $K$. Since the
factor $\rho[\tilde\ell,\ell]$ lies entirely to the right of position
$\tilde x$, it is intercepted by the interval $I=[\tilde x,\omega]$.
So $|\out{\rho[\tilde\ell,\ell]}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ is equivalent to saying
$|\out{\rho|Z}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, where $Z = [\tilde\ell,\ell] \:\cap\:
\big([\tilde x,\omega]\times\bbN\big)$. Then, Theorem
\ref{thm:simon2} implies the existence of an idempotent loop $L$ and
an anchor point $\ell''$ of $L$ such that
\begin{itemize}
\item $\min(L) > \tilde x$,
\item $\tilde\ell \mathrel{\lhd} \ell'' \mathrel{\lhd} \ell$,
\item $\out{\tr{\ell''}}\neq\emptystr$.
\end{itemize}
Further recall that $\tilde x=\min(X_{\an{K}})$ is the leftmost position of
locations in the class $K=[\ell,\ell']$ that are also anchor points of inversions.
In particular, there is an inversion $(L_1,\ell''_1,L_2,\ell''_2)$, with
$\ell''_2=(\tilde x,y''_2) \in K$.
Since $\ell'' \mathrel{\lhd} \ell \mathrel{\unlhd} \ell''_2$
and the position of $\ell''$ is to the right of the position of $\ell''_2$,
we know that $(L,\ell'',L_2,\ell''_2)$ is also an inversion,
and hence $\ell'' \simeq \ell''_2 \simeq \ell$.
But since $\ell'' \neq \ell$, we get a contradiction with the
assumption that $\ell$ is the first location of the $\simeq$-class $K$.
In this way we have shown that $|\out{\rho[\tilde\ell,\ell]}| \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
It remains to bound the lengths of the outputs produced
by the subsequences $\rho|Z^{\shortleftarrow}$ and $\rho|Z^{\shortrightarrow}$,
where $Z^{\shortleftarrow}=[\tilde\ell,\tilde\ell'] \:\cap\: \big([0,\tilde x]\times\bbN\big)$
and $Z^{\shortrightarrow}=[\tilde\ell,\tilde\ell'] \:\cap\: \big([\tilde x',\omega]\times\bbN\big)$.
As usual, we consider only one of the two symmetric cases.
Suppose, by way of contradiction, that $|\out{\rho|Z^{\shortleftarrow}}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By Theorem \ref{thm:simon2}, there exist an idempotent loop $L$
and an anchor point $\ell''$ of $L$ such that
\begin{itemize}
\item $\max(L) < \tilde x$,
\item $\tilde\ell \mathrel{\lhd} \ell'' \mathrel{\lhd} \tilde\ell'$,
\item $\out{\tr{\ell''}}\neq\emptystr$.
\end{itemize}
By following the same line of reasoning as before, we recall that
$\ell$ is the first location of the non-singleton class $K$.
From this we derive the existence an inversion $(L_1,\ell''_1,L_2,\ell''_2)$
where $\ell''_1 = \ell$.
We claim that $\ell \mathrel{\unlhd} \ell''$.
Indeed, if this were not the case, then, because $\ell''$ is strictly to the
left of $\tilde x$ and $\ell$ is to the right of $\tilde x$, there would exist
a location $\ell'''$ between $\ell''$ and $\ell$ that lies at position $\tilde x$.
But $\tilde\ell \mathrel{\lhd} \ell'' \mathrel{\unlhd} \ell''' \mathrel{\unlhd} \ell$ would
contradict the fact that $\tilde\ell$ is the {\sl latest} location before
$\ell$ that lies at the position $\tilde x$.
Now that we know that $\ell \mathrel{\unlhd} \ell''$ and that $\ell''$ is to the left of $\tilde x$,
we observe that $(L_1,\ell''_1,L,\ell'')$ is also an inversion, and hence $\ell''\in \an{K}$.
Since $\ell''$ is strictly to the left of $\tilde x$,
we get a contradiction with the definition of $\tilde x$ as leftmost
position of the locations in $\an{K}$.
So we conclude that $|\out{\rho|Z^{\shortleftarrow}}| \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
\end{proof}
The proof of Lemma \ref{lem:consecutive-blocks-sweeping}, which
shows that $\simeq$-blocks do not overlap along the input axis,
carries over in the two-way case, again without modifications.
Finally, we generalize Lemma \ref{lem:diagonal-sweeping} to the new
definition of diagonal, which completes the construction of a
$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition for the run $\rho$:
\begin{lem}\label{lem:diagonal-twoway}
Let $\rho[\ell,\ell']$ be a
factor of $\rho$,
with $\ell=(x,y)$, $\ell'=(x',y')$, and $x\le x'$,
that does not overlap any $\simeq$-block.
Then $\rho[\ell,\ell']$ is a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonal.
\end{lem}
\begin{proof}
Suppose by way of contradiction that there is some $z \in [x,x']$
such that, for all locations $\ell''$ at position $z$ and between $\ell$ and $\ell'$,
one of the two conditions holds:
\begin{enumerate}
\item $|\out{\rho|Z_{\ell''}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}}}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
where $Z_{\ell''}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}} = [\ell'',\ell'] \:\cap\: \big([0,z]\times\bbN\big)$,
\item $|\out{\rho|Z_{\ell''}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}}}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
where $Z_{\ell''}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}} = [\ell,\ell''] \:\cap\: \big([z,\omega]\times\bbN\big)$.
\end{enumerate}
First, we claim that \emph{each} of the two conditions above are satisfied at
some locations $\ell''\in [\ell,\ell']$ at position $z$.
Consider the highest even level $y''$
such that $\ell''=(z,y'') \in[\ell,\ell']$
(use Figure \ref{fig:diagonal-twoway} as a reference).
Since $z\le x'$, the outgoing transition at $\ell''$ is rightward oriented,
and the set $Z_{\ell''}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}}$ is empty. This means that
condition (1) is trivially violated at $\ell''$,
and hence condition (2) holds at $\ell''$ by the initial assumption.
Symmetrically, condition (1) holds at the location $\ell''=(z,y'')$,
where $y''$ is the lowest even level with $\ell'' \in[\ell,\ell']$
Let us now compare the levels where the above conditions hold.
Clearly, the lower the level of location $\ell''$,
the easier it is to satisfy condition (1), and symmetrically for condition (2).
So, let $\ell^+=(z,y^+)$ (resp.~$\ell^-=(z,y^-)$) be the highest (resp.~lowest)
location in $[\ell,\ell']$ at position $z$ that satisfies
condition (1) (resp.~condition (2)).
We claim that $y^+ \ge y^-$.
For this, we first observe that $y^+ \ge y^- - 1$, since otherwise there
would exist a location $\ell''=(z,y'')$, with $y^+ < y'' < y^-$, that
violates both conditions (1) and (2).
Moreover, $y^+$ must be odd, otherwise the transition departing from
$\ell^+ = (z,y^+)$ would be rightward oriented and the location $\ell'' = (z,y^+ + 1)$
would still satisfy condition (1), contradicting the definition of highest location $\ell^+$.
For similar reasons, $y^-$ must also be odd, otherwise there would be a location
$\ell'' = (z,y^- - 1)$ below $\ell^-$ that satisfies condition (2).
But since $y^+ \ge y^- - 1$ and both $y^+$ and $y^-$ are odd,
we need to have $y^+ \ge y^-$.
In fact, from the previous arguments we know that the location $\ell''=(z,y^+)$
(or equally the location $(x,y^-)$)
satisfies {\sl both} conditions (1) and (2). We can thus apply Theorem \ref{thm:simon2} to the
sets $Z_{\ell''}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}}$ and $Z_{\ell''}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}}$, deriving the existence of
two idempotent loops $L_1,L_2$ and two anchor points $\ell_1,\ell_2$ of $L_1,L_2$,
respectively, such that
\begin{itemize}
\item $\max(L_2) < z < \min(L_1)$,
\item $\ell \mathrel{\lhd} \ell_1 \mathrel{\lhd} \ell'' \mathrel{\lhd} \ell_2 \mathrel{\lhd} \ell'$,
\item $\out{\tr{\ell_1}},\out{\tr{\ell_2}}\neq\emptystr$.
\end{itemize}
In particular, since $\ell_1$ is to the right of $\ell_2$ w.r.t.~the order
of positions, we know that $(L_1,\ell_1,L_2,\ell_2)$ is an inversion, and
hence $\ell_1 \simeq \ell_2$. But this contradicts the assumption that
$\rho[\ell,\ell']$ does not overlap with any $\simeq$-block.
\end{proof}
\medskip
\reviewOne[inline]{Part 5, "From existence of decompositions to an equivalent one-way transducer": so far the paper did a great job hinting at the proof that remains. Here an intuition is given for the construction later detailed in 8.6, but no mention of an intuition for Proposition 9.2: if it is at all possible to do so, this might help the paper's overall flow.
\olivier[inline]{answered in review1-answers.txt}
}%
\subsection*{From existence of decompositions to an equivalent one-way transducer.}
It remains to prove the last implication \PR3 $\Rightarrow$ \PR1 of Theorem~\ref{thm:main2},
which amounts to construct a one-way transducer $\cT'$ equivalent to $\cT$.
Hereafter, we denote by $D$ the language of words $u\in\dom(\cT)$ such that
{\sl all} successful runs of $\cT$ on $u$ admit a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition.
So far, we know that if $\cT$ is one-way definable (\PR1),
then $D=\dom(\cT)$ (\PR3).
As a matter of fact, this reduces the one-way definability problem
for $\cT$ to the containment problem $\dom(\cT) \subseteq D$.
\label{testing-containment}
We will see later (in Section~\ref{sec:complexity})
how the latter problem can be decided
in double exponential space
by further reducing it to checking the emptiness of the
intersection of the languages $\dom(\cT)$ and $D^\complement$,
where $D^\complement$ is the complement of $D$.
Below, we show how to construct a one-way transducer
$\cT'$ of triple exponential size such that
$\cT' \subseteq \cT$ and
$\dom(\cT')$ is the set of all input words that have
{\sl some} successful run admitting a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition
(hence $\dom(\cT')\supseteq D$).
In particular, we will have that
\[
\cT|_D \:\subseteq\: \cT' \:\subseteq\: \cT.
\]
Note that this will prove \PR3 to \PR1, as well as the second
item of Theorem~\ref{thm:main}, since $D=\dom(\cT)$
if and only if $\cT$ is one-way definable.
A sketch of the proof of this construction when
$\cT$ is a sweeping transducer was given at the
end of Section \ref{sec:characterization-sweeping}.
\begin{prop}\label{prop:construction-twoway}
Given a functional two-way transducer $\cT$,
a one-way transducer $\cT'$
satisfying
\[\cT' \subseteq \cT \quad \text{ and } \quad \dom(\cT') \supseteq D\] can be constructed in $3\exptime$.
Moreover, if $\cT$ is sweeping, then $\cT'$
can be constructed in $2\exptime$.
\end{prop}
\begin{proof}
Given an input word $u$, the transducer $\cT'$ will guess (and check)
a successful run $\rho$ of $\cT$ on $u$, together with a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition
$\prod_i \rho[\ell_i,\ell_{i+1}]$.
The latter decomposition will be used by $\cT'$ to simulate the output of
$\rho$ in left-to-right manner, thus proving that $\cT' \subseteq \cT$.
Moreover, $u\in D$ implies the existence of a successful run that can be
decomposed, thus proving that $\dom(\cT') \supseteq D$.
We now provide the details of the construction of $\cT'$.
Guessing the run $\rho$ is standard (see, for instance, \cite{she59,HU79}):
it amounts to guess the crossing sequences $\rho|x$ for
each position $x$ of the input. Recall that this is a bounded
amount of information for each position $x$, since the run is normalized.
As concerns the decomposition of $\rho$, it can be encoded
by the endpoints $\ell_i$ of its factors, that is, by annotating
the position of each $\ell_i$ as the level of $\ell_i$.
In a similar way $\cT'$ guesses the information of whether
each factor $\rho[\ell_i,\ell_{i+1}]$ is a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-diagonal or a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block.
Thanks to the definition of decomposition
(see Definition~\ref{def:decomposition-twoway} and Figure \ref{fig:decomposition-twoway}),
every two distinct factors span across non-overlapping intervals of positions.
This means that each position $x$ is covered by exactly one factor of
the decomposition. We call this factor the \emph{active factor at position $x$}.
The mode of computation of the transducer will depend on
the type of active factor: if the active factor is a diagonal
(resp.~a block), then we say that $\cT'$ is in \emph{diagonal mode}
(resp.~\emph{block mode}).
Below we describe the behaviour for these two modes of computation.
\smallskip
\par\noindent\emph{Diagonal mode.}~
We recall the key condition satisfied by the diagonal
$\rho[\ell,\ell']$ that is active at position $x$
(cf.~Definition~\ref{def:factors-twoway} and Figure~\ref{fig:diagonal-twoway}):
there is a location $\ell_x=(x,y_x)$ between $\ell$ and $\ell'$ such that the words
$\out{\rho|Z_{\ell_x}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}}}$ and $\out{\rho|Z_{\ell_x}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}}}$
have length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, where
$Z_{\ell_x}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr135}{\fixed@sra}}\mspace{-2mu}} = [\ell_x,\ell'] \:\cap\: \big([0,x]\times\bbN\big)$
and $Z_{\ell_x}^{\mspace{-2mu}\text{\rotatebox[origin=c]{\numexpr315}{\fixed@sra}}\mspace{-2mu}} = [\ell,\ell_x] \:\cap\: \big([x,\omega]\times\bbN\big)$.
Besides the run $\rho$ and the decomposition, the transducer $\cT'$ will
also guess the locations $\ell_x=(x,y_x)$, that is, will annotate each $x$
with the corresponding $y_x$.
Without loss of generality, we can assume that the function that
associates each position $x$ with the guessed location $\ell_x=(x,y_x)$
is monotone, namely, $x\le x'$ implies $\ell_x\mathrel{\unlhd}\ell_{x'}$.
While the transducer $\cT'$ is in diagonal mode, the goal is to preserve
the following invariant:
\begin{quote}
\em
After reaching a position $x$ covered by the active diagonal,
$\cT'$ must have produced the output of $\rho$ up to location $\ell_x$.
\end{quote}
\noindent
To preserve the above invariant when moving from $x$ to the next
position $x+1$, the transducer should output the word
$\out{\rho[\ell_x,\ell_{x+1}]}$. This word consists of
the following parts:
\begin{enumerate}
\item The words produced by the single transitions of $\rho[\ell_x,\ell_{x+1}]$
with endpoints in $\{x,x+1\}\times\bbN$.
Note that there are at most ${\boldsymbol{H}}} %h_{\mathsf{max}}}$ such words,
each of them has length at most ${\boldsymbol{C}}} %c_{\mathsf{max}}}$, and they can all be determined
using the crossing sequences at $x$ and $x+1$ and the information
about the levels of $\ell_x$ and $\ell_{x+1}$.
We can thus assume that this information is readily available
to the transducer.
\item The words produced by the factors of $\rho[\ell_x,\ell_{x+1}]$
that are intercepted by the interval $[0,x]$.
Thanks to the definition of diagonal, we know that
the total length of these words is at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
These words cannot be determined from the information
on $\rho|x$, $\rho|x+1$, $\ell_x$, and $\ell_{x+1}$
alone, so they need to be constructed while scanning the input.
For this, some additional information needs to be stored.
More precisely, at each position $x$ of the input,
the transducer stores all the outputs produced by the factors of
$\rho$ that are intercepted by $[0,x]$ and that occur {\sl after}
a location of the form $\ell_{x'}$, for any $x'\ge x$ that is
covered by a diagonal.
This clearly includes the previous words when $x'=x$, but also
other words that might be used later for processing other diagonals.
Moreover, by exploiting the properties of diagonals,
one can prove that those words have length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
so they can be stored with triply exponentially many states.
Using classical techniques, the stored information
can be maintained while scanning the input $u$ using the
guessed crossing sequences of $\rho$.
\item The words produced by the factors of $\rho[\ell_x,\ell_{x+1}]$
that are intercepted by the interval $[x+1,\omega]$.
These words must be guessed, since they depend on a portion
of the input that has not been processed yet.
Accordingly, the guesses need to be stored into memory,
in such a way that they can be checked later. For this, the transducer
stores, for each position $x$, the guessed words that correspond
to the outputs produced by the factors of $\rho$ intercepted by
$[x,\omega]$ and occurring {\sl before} a location of the form
$\ell_{x'}$, for any $x'\le x$ that is covered by a diagonal.
\end{enumerate}
\smallskip
\par\noindent\emph{Block mode.}~
Suppose that the active factor $\rho[\ell,\ell']$ is a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-block.
Let $I=[x,x']$ be the set of positions covered by this factor.
Moreover, for each position $z\in I$, let
$Z^{\shortleftarrow}_z = [\ell,\ell'] \:\cap\: \big([0,z]\times \bbN\big)$
and $Z^{\shortrightarrow}_z = [\ell,\ell'] \:\cap\: \big([z,\omega]\times \bbN\big)$.
We recall the key property of a block
(cf.~Definition~\ref{def:factors-twoway} and Figure~\ref{fig:block-twoway}):
the word $\out{\rho[\ell,\ell']}$ is almost periodic with bound $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
and the words $\out{\rho|Z^{\shortleftarrow}_x}$ and $\out{\rho|Z^{\shortrightarrow}_{x'}}$
have length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
For the sake of brevity, suppose that $\out{\rho[\ell,\ell']} = w_1\,w_2\,w_3$,
where $w_2$ is periodic with period $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ and $w_1,w_3$
\reviewOne[inline]{$w_1,w_3$ I assume.
\olivier[inline]{fixed (was $w_1,w_2$)}%
}%
have length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Similarly, let $w_0 = \out{\rho|Z^{\shortleftarrow}_x}$ and $w_4 = \out{\rho|Z^{\shortrightarrow}_{x'}}$.
The invariant preserved by $\cT'$ in block mode is the following:
\begin{quote}
\em
After reaching a position $z$ covered by the active block $\rho[\ell,\ell']$,
$\cT'$ must have produced the output of the prefix of $\rho$
up to location $\ell$, followed by a prefix of $\out{\rho[\ell,\ell']} = w_1\,w_2\,w_3$
of the same length as $\out{\rho|Z^{\shortleftarrow}_z}$.
\end{quote}
\noindent
The initialization of the invariant is done when reaching the left
endpoint $x$. At this moment, it suffices that $\cT'$ outputs
a prefix of $w_1\,w_2\,w_3$ of the same length as
$w_0 = \out{\rho|Z^{\shortleftarrow}_x}$, thus bounded by $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Symmetrically, when reaching the right endpoint $x'$,
$\cT'$ will have produced almost the entire word
$\out{\rho[\ell,\ell']} \, w_1 \, w_2 \, w_3$,
but without the suffix $w_4 = \out{\rho|Z^{\shortrightarrow}_{x'}}$
of length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Thus, before moving to the next factor of the decomposition, the transducer will
produce the remaining suffix, so as to complete the output
of $\rho$ up to location $\ell_{i_x+1}$.
It remains to describe how the above invariant can be maintained
when moving from a position $z$ to the next position $z+1$ inside $I=[x,x']$.
For this, it is convenient to succinctly represent the word $w_2$
by its repeating pattern, say $v$, of length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
To determine the symbols that have to be output at each step,
the transducer will maintain a pointer on either $w_1\,v$ or $w_3$.
The pointer is increased in a deterministic way, and precisely
by the amount $|\out{\rho|Z^{\shortleftarrow}_{z+1}}| - |\out{\rho|Z^{\shortleftarrow}_z}|$.
The only exception is when the pointer lies in $w_1\,v$, but its
increase would go over $w_1\,v$: in this case the transducer has
the choice to either bring the pointer back to the beginning of $v$
(representing a periodic output inside $w_2$), or move it to $w_3$.
Of course, this is a non-deterministic choice, but it can be
validated when reaching the right endpoint of $I$.
Concerning the number of symbols that need to be emitted at each
step, this can be determined from the crossing sequences at
$z$ and $z+1$, and from the knowledge of the lowest and highest
levels of locations that are at position $z$ and between
$\ell$ and $\ell'$. We denote the latter levels by
$y^-_z$ and $y^+_z$, respectively.
Overall, this shows how to maintain the invariant of the block mode,
assuming that the levels $y^-_z,y^+_z$ are known, as well as
the words $w_0,w_1,v,w_3,w_4$ of bounded length.
Like the mapping $z \mapsto \ell_z=(z,y_z)$ used in diagonal mode,
the mapping $z \mapsto (y^-_z,y^+_z)$ can be guessed and checked
using the crossing sequences.
Similarly, the words $w_1,v,w_3$ can be guessed just before
entering the active block, and can be checked along the process.
As concerns the words $w_0,w_4$, these can be guessed and checked
in a way similar to the words that we used in diagonal mode.
More precisely, for each position $z$ of the input, the
transducer stores the following additional information:
\begin{enumerate}
\item the outputs produced by the factors of $\rho$ that are
intercepted by $[0,z]$ and that occur after the beginning
$\ell''$ of some block, with $\ell''=(x'',y'')$ and $x''\ge z$;
\item the outputs produced by the factors of $\rho$ that are
intercepted by $[z,\omega]$ and that occur before the ending
$\ell'''$ of a block, where $\ell'''=(x''',y''')$
and $x'''\le z$.
\end{enumerate}
By the definition of blocks, the above words have length
at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ and can be maintained while processing the input
and the crossing sequences.
Finally, we observe that the words, together with the information
given by the lowest and highest levels $y^-_z,y^+_z$, for both $z=x$ and
$z=x'$, are sufficient for determining the content of $w_0$ and $w_4$.
\smallskip
We have just shown how to construct a one-way transducer $\cT' \subseteq \cT$
such that $\dom(\cT') \supseteq D$.
From the above construction it is easy to see that the number of states
and transitions of $\cT'$, as well as the number of letters emitted by
each transition, are at most exponential in $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$. Since $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ is
doubly exponential in the size of $\cT$, this shows that $\cT'$ can
be constructed from $\cT$ in $3\exptime$.
Note that the triple exponential
complexity comes from the lengths of the words that need to be guessed
and stored in the control states, and these lengths are bounded by $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
However, if $\cT$ is a sweeping transducer, then, according to the results
proved in Section \ref{sec:characterization-sweeping}, the bound $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$
is simply exponential. In particular, in the sweeping case
we can construct the one-way transducer $\cT'$ in $2\exptime$.
\end{proof}
\medskip
\subsection*{Generality of the construction.}
We conclude the section with a discussion on the properties of the one-way
transducer $\cT'$ constructed from $\cT$. Roughly speaking, we would like
to show that, even when $\cT$ is not one-way definable, $\cT'$ is somehow
the {\sl best one-way under-approximation of $\cT$}.
However, strictly speaking, the latter terminology is meaningless:
if $\cT'$ is a one-way transducer strictly contained in $\cT$, then
one can always find a better one-way transducer $\cT''$ that satisfies
$\cT' \subsetneq \cT'' \subsetneq \cT$, for instance by extending $\cT'$
with a single input-output pair. Below, we formalize in an appropriate
way the notion of ``best one-way under-approximation''.
We are interested in comparing the domains of transducers, but only up to
a certain amount. In particular, we are interested in languages that are
preserved under pumping loops of runs of $\cT$. Formally, given a language
$L$, we say that $L$ is \emph{$\cT$-pumpable} if $L \subseteq \dom(\cT)$ and
for all words $u\in L$, all successful runs $\rho$ of $\cT$ on $u$, all
loops $L$ of $\rho$, and all positive numbers $n$, the word $\ensuremath{\mathsf{pump}}_L^n(u)$
also belongs to $L$.
Clearly, the domain $\dom(\cT)$ of a transducer $\cT$ is a regular $\cT$-pumpable language.
Another noticeable example of $\cT$-pumpable regular language is the domain
of the one-way transducer $\cT'$, as defined in Proposition \ref{prop:construction-twoway}.
Indeed, $\dom(\cT')$ consists of words $u\in\dom(\cT)$ that induce
successful runs with $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decompositions, and the property of
having a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition is preserved under pumping.
The following result shows that $\cT'$ is the best under-approximation
of $\cT$ within the class of one-way transducers with $\cT$-pumpable domains:
\begin{cor}\label{cor:best-underapproximation}
Given a functional two-way transducer $\cT$, one can construct a one-way transducer $\cT'$ such that
\begin{itemize}
\item $\cT' \subseteq \cT$ and $\dom(\cT')$ is $\cT$-pumpable,
\item for all one-way transducers $\cT''$, if $\cT'' \subseteq \cT$ and $\dom(\cT'')$ is $\cT$-pumpable,
then $\cT'' \subseteq \cT'$.
\end{itemize}
\end{cor}
\begin{proof}
The transducer $\cT'$ is precisely the one defined in Proposition \ref{prop:construction-twoway}.
As already explained, its domain $\dom(\cT')$ is a $\cT$-pumpable language. In particular, $\cT'$
satisfies the conditions in the first item.
For the conditions in the second item, consider a one-way transducer $\cT'' \subseteq \cT$
with a $\cT$-pumpable domain $L=\dom(\cT'')$. Let $\tilde\cT$ be the transducer obtained from
$\cT$ by restricting its domain to $L$. Clearly, $\tilde\cT$ is one-way definable, and one
could apply Proposition \ref{prop:periodicity-twoway} to $\tilde\cT$, using $\cT''$ as a
witness of one-way definability. In particular, when it comes to comparing the outputs of the
pumped runs of $\tilde\cT$ and $\cT''$, one could exploit the fact that the domain $L$ of $\cT''$,
and hence the domain of $\tilde\cT$ as well, is $\cT$-pumpable. This permits to derive
periodicities of inversions with the same bound $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ as before, but only restricted
to the successful runs of $\cT$ on the input words that belong to $L$.
As a consequence, one can define $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decompositions of successful runs of $\cT$
on words in $L$, thus showing that $L \subseteq \dom(\cT')$. This proves that $\cT'' \subseteq \cT'$.
\end{proof}
\section{Basic combinatorics for sweeping transducers}\label{sec:combinatorics-sweeping}
We fix for the rest of the section a functional \emph{sweeping transducer} $\cT$,
an input word $u$, and a (normalized) successful run $\rho$ of $\cT$ on $u$.
\medskip
\subsection*{Pumping loops.}
Loops turn out to be a basic concept for characterizing one-way definability.
Formally, a \emph{loop} of $\rho$ is an interval $L=[x_1,x_2]$ such that $\rho|x_1=\rho|x_2$,
namely, with the same crossing sequences at the extremities.
The run $\rho$ can be pumped at any loop $L=[x_1,x_2]$, and this gives rise
to new runs with iterated factors. Below we study precisely the shape of
these pumped runs.
\begin{defi}[anchor point, trace]
Given a loop $L$ and a location $\ell$ of $\rho$, we say that $\ell$ is an
\emph{anchor point in $L$} if $\ell$ is the first location of some factor
of $\rho$ that is intercepted by $L$;
this factor is then denoted%
\footnote{This is a slight abuse of notation, since the factor $\tr{\ell}$
is not determined by $\ell$ alone, but requires also the knowledge of the loop $L$,
which is usually clear from the context.}
as $\tr{\ell}$ and called the \emph{trace of $\ell$}.
\end{defi}
Observe that a loop can have at most ${\boldsymbol{H}}} %h_{\mathsf{max}}} = 2|Q|-1$ anchor points, since
we consider only normalized runs.
Given a loop $L$ of $\rho$ and a number $n\in\bbN$, we can replicate $n$ times
the factor $u[x_1,x_2]$ of the input, obtaining a new input of the form
\begin{equation}\label{eq:pumped-word}
\ensuremath{\mathsf{pump}}_L^{n+1}(u) ~=~ u[1,x_1]\cdot \big(u[x_1+1,x_2]\big)^{n+1} \cdot u[x_2+1,|u|].
\end{equation}
\reviewTwo[inline]{The notation $u[x_1,x_2]$ is not defined.\olivier[inline]{fixed}}
Similarly, we can replicate $n$ times the intercepted factors $\tr{\ell}$ of $\rho$,
for all anchor points $\ell$ of $L$. In this way we obtain a successful run on $\ensuremath{\mathsf{pump}}_L^{n+1}(u)$
that is of the form
\begin{equation}\label{eq:pumped-run}
\ensuremath{\mathsf{pump}}_L^{n+1}(\rho) ~=~ \rho_0 ~ \tr{\ell_1}^n ~ \rho_1 ~ \dots ~ \rho_{k-1} ~ \tr{\ell_k}^n ~ \rho_k
\end{equation}
where $\ell_1\mathrel{\unlhd}\dots\mathrel{\unlhd}\ell_k$ are all the anchor points in $L$
(listed according to the run order $\mathrel{\unlhd}$), $\rho_0$ is the prefix of $\rho$
ending at $\ell_1$,
$\rho_k$ is the suffix of $\rho$
starting at $\ell_k$, and for all $i=1,\dots,k-1$,
$\rho_i$ is the factor of $\rho$ between
$\ell_i$ and $\ell_{i+1}$.
Note that $\ensuremath{\mathsf{pump}}_L^1(\rho)$ coincides with the original run $\rho$. As a matter of fact,
one could define in a similar way the run $\ensuremath{\mathsf{pump}}_L^0(\rho)$ obtained from removing the loop
$L$ from $\rho$. However, we do not need this, and we will always parametrize the operation
$\ensuremath{\mathsf{pump}}_L$ by a positive number $n+1$.
An example of a pumped run $\ensuremath{\mathsf{pump}}_{L_1}^3(\rho)$ is given in Figure \ref{fig:pumping-sweeping},
together with the indication of the anchor points $\ell_i$ and the intercepted factors $\tr{\ell_i}$.
\input{pumping-sweeping}
\medskip
\subsection*{Output minimality.}
We are interested into factors of the run $\rho$ that lie on a single level
and that contribute to the final output, but in a minimal way, in the sense
that is formalized by the following definition:
\begin{defi}\label{def:output-minimal-sweeping}
Consider a factor $\a=\rho[\ell,\ell']$ of $\rho$.
We say that $\a$ is \emph{output-minimal} if
$\ell=(x,y)$ and $\ell'=(x',y)$, and all loops $L \subsetneq
[x,x']$
produce empty output at level $y$.
\end{defi}
From now on, we set the constant $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax} = {\boldsymbol{C}}} %c_{\mathsf{max}}} |Q|^{\boldsymbol{H}}} %h_{\mathsf{max}}} +1$,
where ${\boldsymbol{C}}} %c_{\mathsf{max}}}$ is the capacity of the transducer, that is, the
maximal length of an output produced on a single transition (recall
that $|Q|^{\boldsymbol{H}}} %h_{\mathsf{max}}}$ is the maximal number of crossing sequences).
As shown below, $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ bounds the length of
the output produced by an output-minimal factor:
\begin{lem}\label{lem:output-minimal-sweeping}
For all output-minimal factors $\alpha$,
$|\out{\alpha}| \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
\end{lem}
\begin{proof}
Suppose by contradiction that $|\out{\alpha}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, with
$\a=\rho[\ell,\ell']$, $\ell=(x,y)$ and $\ell=(x',y)$.
Let $X$ be the set of all positions $x''$, with $\min(x,x') < x'' < \max(x,x')$,
that are sources of transitions of $\alpha$ that produce non-empty output.
Clearly, the total number of letters produced by the transitions that depart
from locations in $X\times\{y\}$ is strictly larger than $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}-1$.
Moreover, since each transition emits at most ${\boldsymbol{C}}} %c_{\mathsf{max}}}$ symbols, we have $|X| > \frac{\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}-1}{{\boldsymbol{C}}} %c_{\mathsf{max}}}} = |Q|^{\boldsymbol{H}}} %h_{\mathsf{max}}}$.
Now, recall that crossing sequences are sequences of states of length at most ${\boldsymbol{H}}} %h_{\mathsf{max}}}$.
Since $|X|$ is larger than the number of crossing sequences, $X$ contains two positions
$x_1<x_2$ such that $\rho|x_1=\rho|x_2$. In particular, $L=[x_1,x_2]$
is a loop strictly between $x,x'$
with non-empty output on level $y$.
This shows that $\rho[\ell,\ell']$ is not output-minimal.
\end{proof}
\medskip
\subsection*{Inversions and periodicity.}
Next, we define the crucial notion of inversion. Intuitively, an inversion
in a run identifies a part of the run that is potentially difficult to
simulate in a one-way manner because the order of generating the
output is reversed w.r.t.~the input. Inversions arise naturally in transducers
that reverse arbitrarily long portions of the input, as well as in transducers
that produce copies of arbitrarily long portions of the input.
\label{page-def-inversion}
\begin{defi}\label{def:inversion-sweeping}
An \emph{inversion} of the run $\rho$ is a tuple $(L_1,\ell_1,L_2,\ell_2)$ such that
\begin{enumerate}
\item $L_1,L_2$ are loops of $\r$,
\item $\ell_1=(x_1,y_1)$ and $\ell_2=(x_2,y_2)$
are anchor points of $L_1$ and $L_2$, respectively,
\item $\ell_1 \mathrel{\lhd} \ell_2$ and $x_1 > x_2$
\par\noindent
(namely, $\ell_2$ follows $\ell_1$ in the run,
but the position of $\ell_2$ precedes the position of $\ell_1$),
\item for both $i=1$ and $i=2$, $\out{\tr{\ell_i}}\neq\emptystr$ and $\tr{\ell_i}$ is output-minimal.
\end{enumerate}
\end{defi}
\noindent
The left hand-side of Figure~\ref{fig:inversion-sweeping} gives an example of an inversion,
assuming that the outputs $v_1=\tr{\ell_1}$ and $v_2=\tr{\ell_2}$ are non-empty
and the intercepted factors are output-minimal.
\input{inversion-sweeping}
The rest of the section is devoted to prove the implication \PR1 $\Rightarrow$ \PR2
of Theorem \ref{thm:main2}.
We recall that a word $w=a_1 \cdots a_n$ has \emph{period} $p$ if for every $1\le i\le |w|-p$,
we have $a_i = a_{i+p}$. For example, the word $abc \, abc \, ab$ has period $3$.
We remark that, thanks to Lemma \ref{lem:output-minimal-sweeping},
for every inversion $(L_1,\ell_1,L_2,\ell_2)$, the outputs
$\out{\tr{\ell_1}}$ and $\out{\tr{\ell_2}}$ have length at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By pairing this with the assumption that the transducer $\cT$ is one-way definable,
and by using some classical word combinatorics, we show that the output
produced between the anchor points of every inversion has period that divides
the lengths of $\out{\tr{\ell_1}}$ and $\out{\tr{\ell_2}}$. In particular, this
period is at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
The proposition below shows a slightly stronger periodicity property,
which refers to the output produced between the anchor points $\ell_1,\ell_2$
of an inversion, but extended on both sides with the words $\out{\tr{\ell_1}}$ and $\out{\tr{\ell_2}}$.
We will exploit this stronger periodicity property later, when dealing with
overlapping portions of the run delimited by different inversions
(cf.~Lemma \ref{lem:overlapping}).
\begin{prop}\label{prop:periodicity-sweeping}
If $\cT$ is one-way definable, then the following property \PR2 holds:
\begin{quote}
For all inversions
$(L_1,\ell_1,L_2,\ell_2)$ of $\rho$, the period $p$ of the word
\[
\out{\tr{\ell_1}} ~ \out{\rho[\ell_1,\ell_2]} ~ \out{\tr{\ell_2}}
\]
divides both $|\out{\tr{\ell_1}}|$ and
$|\out{\tr{\ell_2}}|$. Moreover, $p \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
\end{quote}
\end{prop}
The above proposition
thus formalizes the implication \PR1 $\Rightarrow$ \PR2 of
Theorem \ref{thm:main2}.
Its proof relies on a few combinatorial results.
The first one is Fine and Wilf's theorem~\cite{Lothaire97}.
In short, this theorem says that, whenever two periodic
words $w_1,w_2$ share a sufficiently long factor, then they
have the same period.
Here we use a slightly stronger variant of Fine and Wilf's theorem,
which additionally shows how to align a common factor of the two words $w_1,w_2$
so as to form a third word containing a prefix of $w_1$ and a suffix of $w_2$.
This variant of Fine-Wilf's theorem will be particularly useful in the proof of Lemma~\ref{lem:overlapping}, while for all other applications the classical
statement suffices.
\olivier{This last sentence is outdated, right?}%
\gabriele{This refers to the variant of Fine-Wilf, which still used in the referenced lemma.
But I rephrased so as to make it clear. Let me know if it makes more sense now.}%
\begin{thm}[Fine-Wilf's theorem]\label{thm:fine-wilf}
If $w_1 = w'_1\,w\:w''_1$ has period $p_1$,
$w_2 = w'_2\,w\,w''_2$ has period $p_2$, and
the common factor $w$ has length at least $p_1+p_2-\gcd(p_1,p_2)$,
then $w_1$, $w_2$, and $w_3 = w'_1\,w\,w''_2$ have period $\gcd(p_1,p_2)$.
\end{thm}
The second combinatorial result required in our proof concerns periods of words
with iterated factors, like those that arise from considering outputs of pumped runs,
and it is formalized precisely by the lemma below.
To improve readability, we often highlight the
important iterations of factors inside a word.
\begin{lem}\label{lem:periods}
Assume that $v_0 \: \pmb{v_1^n} \: v_2 \: \cdots \: v_{k-1} \: \pmb{v_k^n} \: v_{k+1}$
has period $p$ for some $n >p$.
Then $v_0 \: \pmb{{v_1}^{n_1}} \: v_2 \: \cdots \: v_{k-1} \: \pmb{{v_k}^{n_k}} \: v_{k+1}$
has period $p$ for all $n_1,\ldots,n_k \in \Nat$.
\end{lem}
\begin{proof}
Assume that
$w=v_0 \: \pmb{v_1^n} \: v_2 \: \cdots \: v_{k-1} \: \pmb{v_k^n} \: v_{k+1}$
has period $p$, and that $n >p$.
Consider an arbitrary factor $v_i^p$ of $w$. Since $v_i^p$ has periods $p$ and $|v_i|$,
it has also period $r=\gcd(p,|v_i|)$.
By Fine-Wilf (Theorem \ref{thm:fine-wilf}),
we know that $w$ has period $r$ as well.
Moreover, since the length of $v_i$ is multiple of $r$,
changing the number of repetitions of $v_i$ inside $w$ does
not affect the period $r$ of $w$.
Since $v_i$ was chosen arbitrarily, this means that, for all $n_1,\dots,n_k\in\bbN$,
$v_0 \: \pmb{{v_1}^{n_1}} \: v_2 \: \cdots \: v_{k-1} \: \pmb{{v_k}^{n_k}} \: v_{k+1}$
has period $r$, and hence period $p$ as well.
\end{proof}
Recall that our goal is to show that the output produced amid every
inversion has period bounded by $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
The general idea is to pump the loops of the inversion and compare the outputs
of the two-way transducer $\cT$ with those of an equivalent one-way
transducer $\cT'$.
The comparison leads to an equation between words with
iterated factors, where the iterations are parametrized by two unknowns
$n_1,n_2$ that occur in opposite order in the left, respectively right
hand-side of the equation.
Our third and last combinatorial result considers a word equation of
this precise form, and derives from it a periodicity property.
\reviewOne[inline]{In Corollary 4.8, the definition of $v^{(n_1,n_2)}$ is hard to process, especially when introduced in the middle of a proof. The notion is used later in the part: it warrants a proper definition and/or clear example either in the preliminaries or at the beginning of Part 4.
\felix[inline]{I don't understand this remark}
\olivier[inline]{answered in review1-answers.txt: the best place is here.}
}
\gabriele[inline]{This reviewer commend has led to a number of corrections, and the removal of Saarela tool}
For the sake of brevity, we use the notation $v^{(n_1,n_2)}$
to represent words with factors iterated $n_1$ or $n_2$ times,
namely, words of the form
$v_0 \: v_1^{n_{i_1}} \: v_2 \: \cdots \: v_{k-1} \: v_k^{n_{i_k}} \: v_{k+1}$,
where the $v_0,v_1,v_2,\dots,v_{k-1},v_k,v_{k+1}$ are fixed words (possibly empty)
and each index among $i_1,\dots,i_k$ is either $1$ or $2$.
\begin{lem}\label{lem:oneway-vs-twoway}
Consider a word equation of the form
\[
v_0^{(n_1,n_2)} \: \pmb{v_1^{n_1}} \: v_2^{(n_1,n_2)} \: \pmb{v_3^{n_2}} \: v_4^{(n_1,n_2)}
~=~
w_0 \: \pmb{w_1^{n_2}} \: w_2 \: \pmb{w_3^{n_1}} \: w_4
\]
where $n_1,n_2$ are the unknowns and $v_1,v_3$ are non-empty words.
If the above equation holds for all $n_1,n_2\in\bbN$,
then
\[
\pmb{v_1} ~ \pmb{v_1^{n_1}} ~ v_2^{(n_1,n_2)} ~ \pmb{v_3^{n_2}} ~ \pmb{v_3}
\]
has period $\gcd(|v_1|,|v_3|)$ for all $n_1,n_2\in\bbN$.
\end{lem}
\begin{proof}
The idea of the proof is to let the parameters $n_1,n_2$ of the equation
grow independently, and apply Fine and Wilf's theorem (Theorem \ref{thm:fine-wilf})
a certain number of times to establish periodicities in overlapping factors of the
considered words.
We begin by fixing $n_1$ large enough so that the factor
$\pmb{v_1^{n_1}}$ of the left hand-side of the equation becomes
longer than $|w_0|+|w_1|$ (this is possible because $v_1$ is non-empty).
Now, if we let $n_2$ grow arbitrarily large, we see that the length of
the periodic word $\pmb{w_1^{n_2}}$ is almost equal to the length of
the left hand-side term
$v_0^{(n_1,n_2)} ~ \pmb{v_1^{n_1}} ~ v_2^{(n_1,n_2)} ~ \pmb{v_3^{n_2}} ~ v_4^{(n_1,n_2)}$:
indeed, the difference in length is given by the constant
$|w_0| + |w_2| + n_1\cdot |w_3| + |w_4|$.
In particular, this implies that $\pmb{w_1^{n_2}}$
covers arbitrarily long prefixes of
$\pmb{v_1} ~ v_2^{(n_1,n_2)} ~ \pmb{v_3^{n_2+1}}$,
which in its turn contains long repetitions of the word $v_3$.
Hence, by Theorem \ref{thm:fine-wilf},
the word
$\pmb{v_1} ~ v_2^{(n_1,n_2)} ~ \pmb{v_3^{n_2+1}}$
has period $|v_3|$.
We remark that the periodicity shown so far holds for a large enough
$n_1$ and for all but finitely many $n_2$, where the threshold for
$n_2$ depends on $n_1$: once $n_1$ is fixed, $n_2$ needs to be larger
than $f(n_1)$, for a suitable function $f$.
In fact, by using
\gabriele{Saarela has been replaced by the new lemma here}
Lemma \ref{lem:periods},
with $n_1$ fixed and $n=n_2$ large enough,
we deduce that the periodicity holds for large enough $n_1\in\bbN$ and
for all $n_2\in\bbN$.
We could also apply a symmetric reasoning: we choose
$n_2$ large enough and let $n_1$ grow arbitrarily large. Doing so, we
prove that for a large enough $n_2$ and for all but finitely many $n_1$,
the word $\pmb{v_1^{n_1+1}} ~ v_2^{(n_1,n_2)} ~ \pmb{v_3}$ is periodic
with period $|v_1|$. As before, with the help of
\gabriele{same here for Saarela...}
Lemma \ref{lem:periods},
this can be strengthened to hold for large enough $n_2\in\bbN$ and for all $n_1\in\bbN$.
Putting together the results proven so far, we get that for all but finitely many $n_1,n_2$,
\[
\rightward{ \underbracket[0.5pt]{ \phantom{ \pmb{v_1^{n_1}} \cdot \pmb{v_1} ~\cdot~
v_2^{(n_1,n_2)} ~\cdot~ \pmb{v_3} } }%
_{\text{period } |v_1|} }
\pmb{v_1^{n_1}} \cdot
\overbracket[0.5pt]{ \pmb{v_1} ~\cdot~ v_2^{(n_1,n_2)} ~\cdot~
\pmb{v_3} \cdot \pmb{v_3^{n_2}} }%
^{\text{period } |v_3|}
.
\]
Finally, we observe that the prefix
$\pmb{v_1^{n_1+1}}\cdot v_2^{(n_1,n_2)}\cdot \pmb{v_3}$
and the suffix
$\pmb{v_1}\cdot v_2^{(n_1,n_2)}\cdot\pmb{v_3^{n_2+1}}$
share a common factor of length at least $|v_1|+|v_3|$.
By Theorem~\ref{thm:fine-wilf},
we derive that $\pmb{v_1^{n_1+1}}\cdot v_2^{(n_1,n_2)}\cdot
\pmb{v_3^{n_2+1}}$ has period $\gcd(|v_1|,|v_3|)$ for all but finitely
many $n_1,n_2$.
Finally, by using again
\gabriele{...and here}
Lemma \ref{lem:periods},
we conclude that the periodicity holds for all $n_1,n_2\in\bbN$.
\end{proof}
\medskip
We are now ready to prove the implication \PR1 $\Rightarrow$ \PR2:
\begin{proof}[Proof of Proposition~\ref{prop:periodicity-sweeping}]
Let $\cT'$ be a one-way transducer equivalent to $\cT$, and consider
an inversion $(L_1,\ell_1,L_2,\ell_2)$ of the successful run $\rho$ of $\cT$
on input $u$.
The reader may refer to Figure \ref{fig:inversion-sweeping}
to get basic intuition about the proof technique.
For simplicity, we assume that the loops $L_1$ and $L_2$ are disjoint,
as shown in the figure. If this were not the case, we would have
at least $\max(L_1) > \min(L_2)$, since the anchor point $\ell_1$
is strictly to the right of the anchor point $\ell_2$.
We could then consider the pumped run $\ensuremath{\mathsf{pump}}_{L_1}^k(\rho)$ for a
large enough $k>1$ in such a way that the rightmost copy of $L_1$
turns out to be disjoint from and strictly to the right of $L_2$.
We could thus reason as we do below, by replacing everywhere
(except in the final part of the proof, cf.~{\em Transferring periodicity to the original run})
the run $\rho$ with the pumped run $\ensuremath{\mathsf{pump}}_{L_1}^k(\rho)$, and the formal
parameter $m_1$ with $m_1+k$.
\smallskip\noindent
{\em Inducing loops in $T'$.}~
We begin by pumping the run $\rho$ and the underlying input $u$,
on the loops $L_1$ and $L_2$, in order to induce new loops $L'_1$
and $L'_2$ that are also loops in a successful run of $\cT'$.
Assuming that $L_1$ is strictly to the right of $L_2$, we define for all numbers $m_1,m_2\in\bbN$:
\[
\begin{array}{rcl}
u^{(m_1,m_2)} &=& \ensuremath{\mathsf{pump}}_{L_1}^{m_1+1}(\ensuremath{\mathsf{pump}}_{L_2}^{m_2+1}(u)) \\[1ex]
\rho^{(m_1,m_2)} &=& \ensuremath{\mathsf{pump}}_{L_1}^{m_1+1}(\ensuremath{\mathsf{pump}}_{L_2}^{m_2+1}(\rho)).
\end{array}
\]
In the pumped run $\rho^{(m_1,m_2)}$, we identify the positions that mark the
endpoints of the occurrences of $L_1,L_2$. More precisely, if $L_1=[x_1,x_2]$
and $L_2=[x_3,x_4]$, with $x_1>x_4$, then the sets of these positions are
\[
\begin{array}{rcl}
X_2^{(m_1,m_2)} &=& \big\{ x_3 + i(x_4-x_3) ~:~ 0\le i\le m_2+1 \big\} \\[1ex]
X_1^{(m_1,m_2)} &=& \big\{ x_1 + j(x_2-x_1) + m_2(x_4-x_3) ~:~ 0\le j\le m_1+1 \big\}.
\end{array}
\]
\smallskip\noindent
{\em Periodicity of outputs of pumped runs.}~
We use now the fact that $\cT'$ is a one-way transducer equivalent to $\cT$.
\reviewTwo[inline]{you fix $\lambda^{m_1,m_2}$ to be a particular run of T’ on the input $u^{m_1,m_2}$, and then, on line 10, you state that for some particular $m_1$ and $m_2$, this run can be obtained by pumping $\lambda^{k_0,k_0}$. This does not seem true in general: since $T$ is not deterministic, we might just have chosen a different run.}%
\gabriele[inline]{Corrected}%
We first recall (see, for instance, \cite{eilenberg1974automata,berstel2013transductions})
that every functional one-way transducer can be made unambiguous, namely,
can be transformed into an equivalent one-way transducer that admits at
most one successful run on each input.
This means that, without loss of generality, we can assume that $\cT'$ too
is unambiguous, and hence it admits exactly one successful run, say
$\lambda^{(m_1,m_2)}$, on each input $u^{(m_1,m_2)}$.
Since $\cT'$ has finitely many states, we can find, for a large enough number $k_0$
two positions $x'_1<x'_2$, both in $X_1^{(k_0,k_0)}$, such that $L'_1=[x'_1,x'_2]$
is a loop of $\lambda^{(k_0,k_0)}$. Similarly, we can find two positions
$x'_3<x'_4$, both in $X_2^{(k_0,k_0)}$, such that $L'_2=[x'_3,x'_4]$ is a
loop of $\lambda^{(k_0,k_0)}$.
By construction $L'_1$ (resp.~$L'_2$) consists of $k_1\leq k_0$
(resp.~$k_2\leq k_0$) copies of $L_1$ (resp.~$L_2$), and
hence $L'_1,L'_2$ are also loops of $\rho^{(k_0,k_0)}$.
In particular, this implies that for all $n_1,n_2\in\bbN$:
\[
\begin{array}{rcl}
\ensuremath{\mathsf{pump}}_{L'_1}^{n_1+1}(\ensuremath{\mathsf{pump}}_{L'_2}^{n_2+1}(u^{(k_0,k_0)}))
&=& u^{(f(n_1),g(n_2))} \\[1ex]
\ensuremath{\mathsf{pump}}_{L'_1}^{n_1+1}(\ensuremath{\mathsf{pump}}_{L'_2}^{n_2+1}(\rho^{(k_0,k_0)}))
&=& \rho^{(f(n_1),g(n_2))} \\[1ex]
\ensuremath{\mathsf{pump}}_{L'_1}^{n_1+1}(\ensuremath{\mathsf{pump}}_{L'_2}^{n_2+1}(\lambda^{(k_0,k_0)}))
&=& \lambda^{(f(n_1),g(n_2))}.
\end{array}
\]
where $f(n_1)=k_1 n_1+k_0$ and $g(n_2)=k_2 n_2+k_0$.
Now recall that $\rho^{(f(n_1),g(n_2))}$ and $\lambda^{(f(n_1),g(n_2))}$ are
runs of $\cT$ and $\cT'$ on the same word $u^{(f(n_1),g(n_2))}$, and they
produce the same output. Let us denote this output by $w^{(f(n_1),g(n_2))}$.
Below, we show two possible factorizations of $w^{(f(n_1),g(n_2))}$
based on the shapes of the pumped runs $\lambda^{(f(n_1),g(n_2))}$
and $\rho^{(f(n_1),g(n_2))}$.
For the first factorization, we recall that $L'_2$ precedes $L'_1$,
according to the ordering of positions, and that the run
$\lambda^{(f(n_1),g(n_2))}$ is one-way (in particular loops have only one anchor point and one trace). We thus obtain:
\reviewTwo[inline]{eq. 4.3 The exponents should be $n_2 + 1$ and $n_1 + 1$. (same for eq. 4.4)}
\felix[inline]{Yes but not sure it makes sense to keep the +1 everywhere then}
\gabriele[inline]{We agreed to change the two itemized lists below and replace `right border'
by `left border' everywhere. I have implemented this...}
\begin{equation}\label{eq:one-way}
w^{(f(n_1),g(n_2))} ~=~ w_0 ~ \pmb{w_1^{n_2}} ~ w_2 ~ \pmb{w_3^{n_1}} ~ w_4
\end{equation}
where
\begin{itemize}
\item $w_0$ is the output produced by the prefix of $\lambda^{(k_0,k_0)}$
ending at the only anchor point of $L'_2$,
\item $\pmb{w_1}$ is the trace of $L'_2$,
\item $w_2$ is the output produced by the factor of $\lambda^{(k_0,k_0)}$
between the anchor points of $L'_2$ and $L'_1$,
\item $\pmb{w_3}$ is the trace of $L'_1$,
\item $w_4$ is the output produced by the suffix of
$\lambda^{(k_0,k_0)}$ starting at the anchor point of $L'_1$. Hence, $w_0 ~ w_2 ~ w_4$ is the output of $\lambda^{(k_0,k_0)}$.
\end{itemize}
\felix{added the last sentence to avoid the $+1$ or not confusion. In addition to the anchor point/trace usage that we talked about}
For the second factorization, we consider $L'_1$ and $L'_2$ as loops of $\rho^{(k_0,k_0)}$.
We recall that $\ell_1,\ell_2$ are anchor points of the loops $L_1,L_2$ of $\rho$, and that
there are corresponding copies of these anchor points in the pumped
run $\rho^{(f(n_1),g(n_2))}$.
We define $\ell'_1$ (resp.~$\ell'_2$) to be the first (resp.~last)
location in $\rho^{(f(n_1),g(n_2))}$
that corresponds to $\ell_1$ (resp.~$\ell_2$) and that is an anchor point of a copy of $L'_1$ (resp.~$L'_2$).
For example, if $\ell_1=(x_1,y_1)$, with $y_1$ even, then $\ell'_1=\big(x_1+f(n_2)(x_4-x_3),y_1\big)$.
Thanks to Equation \ref{eq:pumped-run} we know that the output produced by
$\rho^{(f(n_1),g(n_2))}$ is of the form
\begin{equation}\label{eq:two-way}
w^{(f(n_1),g(n_2))} ~=~
v_0^{(n_1,n_2)} ~ \pmb{v_1^{n_1}} ~ v_2^{(n_1,n_2)} ~ \pmb{v_3^{n_2}} ~ v_4^{(n_1,n_2)}
\end{equation}
where
\begin{itemize}
\item $\pmb{v_1}=\out{\tr{\ell'_1}}$, where $\ell'_1$ is seen as an anchor point in a copy of $L'_1$,
\item $\pmb{v_3}=\out{\tr{\ell'_2}}$, where $\ell'_2$ is seen as an anchor point in a copy of $L'_2$
\par\noindent
(note that the words $v_1,v_3$ depend on $k_0$, but not on $n_1,n_2$),
\item $v_0^{(n_1,n_2)}$ is the output produced by the prefix of $\rho^{(f(n_1),g(n_2))}$
that ends at $\ell_1'$
(this word may depend on the parameters $n_1,n_2$ since the loops
$L'_1,L'_2$ may be traversed several times before reaching the first occurrence of $\tr{\ell'_1}$),
\item $v_2^{(n_1,n_2)}$ is the output produced by the factor of $\rho^{(f(n_1),g(n_2))}$
that starts at $\ell'_1$
and ends at $\ell'_2$,
\item $v_4^{(n_1,n_2)}$ is the output produced by the suffix of $\rho^{(f(n_1),g(n_2))}$
that starts at $\ell'_2$.
\end{itemize}
Putting together Equations~(\ref{eq:one-way}) and (\ref{eq:two-way}), we get
\begin{equation}\label{eq:one-way-vs-two-way}
v_0^{(n_1,n_2)} ~ \pmb{v_1^{n_1}} ~ v_2^{(n_1,n_2)} ~ \pmb{v_3^{n_2}} ~ v_4^{(n_1,n_2)}
~~=~~
w_0 ~ \pmb{w_1^{n_2}} ~ w_2 ~ \pmb{w_3^{n_1}} ~ w_4 .
\end{equation}
Recall that the definition of inversions (Definition
\ref{def:inversion-sweeping}) states
that the words $v_1,v_3$ are non-empty.
This allows us to apply Lemma \ref{lem:oneway-vs-twoway}, which shows that the word
$\pmb{v_1} ~ \pmb{v_1^{n_1}} ~ v_2^{(n_1,n_2)} ~ \pmb{v_3^{n_2}} ~ \pmb{v_3}$
has period $p=\gcd(|v_1|,|v_3|)$, for all $n_1,n_2\in\bbN$.
Note that the latter period $p$ still depends on $\cT'$, since
the words $v_1,v_3$ were obtained from loops
$L'_1,L'_2$ on the run $\lambda^{(k_0,k_0)}$ of $\cT'$.
However, because each loop $L'_i$ consists of $k_i$ copies of the original loop $L_i$,
we also know that $v_1=(\out{\tr{\ell_1}})^{k_1}$ and $v_3=(\out{\tr{\ell_2}})^{k_2}$.
By Theorem \ref{thm:fine-wilf}, this implies that for all $n_1,n_2\in\bbN$, the word
\[
\big(\out{\tr{\ell_1}}\big) ~
\big(\out{\tr{\ell_1}}\big)^{k_1 n_1} ~
v_2^{(n_1,n_2)} ~
\big(\out{\tr{\ell_2}}\big)^{k_2 n_2} ~
\big(\out{\tr{\ell_2}}\big)
\]
has a period that divides $|\out{\tr{\ell_1}}|$ and $|\out{\tr{\ell_2}}|$.
\smallskip\noindent
{\em Transferring periodicity to the original run.}~
The last part of the proof amounts at showing a similar periodicity property
for the output produced by the original run $\rho$.
By construction, the iterated factors inside $v_2^{(n_1,n_2)}$ in the previous
word are all of the form $v^{k_1 n_1 + k_0}$ or $v^{k_2 n_2 + k_0}$,
for some words $v$. By taking out the constant factors $v^{k_0}$ from the
latter repetitions, we can write $v_2^{(n_1,n_2)}$ as a word with iterated
factors of the form $v^{k_1 n_1}$ or $v^{k_2 n_2}$, namely, as ${v'_2}^{(k_1 n_1, k_2 n_2)}$.
So the word
\[
\big(\out{\tr{\ell_1}}\big) ~
\big(\out{\tr{\ell_1}}\big)^{k'_1} ~
{v'_2}^{(k'_1, k'_2)} ~
\big(\out{\tr{\ell_2}}\big)^{k'_2} ~
\big(\out{\tr{\ell_2}}\big)
\]
is periodic, with period that divides $|\out{\tr{\ell_1}}|$ and $|\out{\tr{\ell_2}}|$,
for all $k'_1 \in \{k_1 n \::\: n\in\bbN\}$ and all $k'_2 \in \{k_2 n \::\: n\in\bbN\}$.
We now apply
\gabriele{Also here Saarela has been replaced by the new lemma}
Lemma \ref{lem:periods},
once with $n=k'_1$ and once with $n=k'_2$,
to conclude that the latter periodicity property holds also for $k'_1=1$ and $k'_2=1$.
This shows that the word
\[
\out{\tr{\ell_1}} ~ \out{\rho[\ell_1,\ell_2]} ~ \out{\tr{\ell_2}}
\]
is periodic, with period that divides $|\out{\tr{\ell_1}}|$ and $|\out{\tr{\ell_2}}|$.
\end{proof}
\section{Combinatorics in the two-way case}\label{sec:combinatorics-twoway}
In this section we develop the main combinatorial techniques required
in the general case.
In particular, we will show how to derive the existence of idempotent
loops with bounded outputs using Ramsey-based arguments, and we will
use this to derive periodicity properties for the outputs produced
between inversions.
As usual, $\rho$ is a fixed successful run of $\cT$ on some input word $u$.
\medskip
\subsection*{Ramsey-type arguments.}
We start with a technique used for bounding the lengths of the outputs
of certain factors, or subsequences of a two-way run. This technique
is a Ramsey-type argument, more precisely it relies on
Simon's ``factorization forest'' theorem~\cite{factorization_forests,factorization_forests_for_words_paper},
which is recalled below. The classical version of Ramsey theorem would
yield a similar result, but without the tight bounds that we get here.
Let $X$ be a set of positions of $\rho$.
A \emph{factorization forest} for $X$ is an unranked tree, where the nodes are
intervals $I$ with endpoints in $X$ and labeled with the corresponding effect $E_I$,
the ancestor relation is given by the containment order on intervals, the leaves are the
minimal intervals $[x_1,x_2]$, with $x_2$ successor of $x_1$ in $X$, and for every
internal node $I$ with children $J_1,\dots,J_k$, we have:
\begin{itemize}
\item $I=J_1\cup\dots\cup J_k$,
\item $E_I = E_{J_1}\odot\dots\odot E_{J_k}$,
\item if $k>2$, then $E_I = E_{J_1} = \dots = E_{J_k}$
is an idempotent of the semigroup $(\cE,\odot)$.
\end{itemize}
Recall that in a normalized run there are at most $|Q|^{{\boldsymbol{H}}} %h_{\mathsf{max}}}}$ distinct
crossing sequences. Moreover, a flow contains at most ${\boldsymbol{H}}} %h_{\mathsf{max}}}$ edges,
and each edge has one of the 4 possible types ${\ensuremath{\mathsf{LL}}},{\ensuremath{\mathsf{LR}}},{\ensuremath{\mathsf{RL}}},\RR$, so they are at most $4^{{\boldsymbol{H}}} %h_{\mathsf{max}}}}$ different flows.
Hence, the effect semigroup $(\cE,\odot)$ has size at most
${\boldsymbol{E}}} %e_{\mathsf{max}}}=4^{{\boldsymbol{H}}} %h_{\mathsf{max}}}}\cdot|Q|^{2{\boldsymbol{H}}} %h_{\mathsf{max}}}}\cdot|Q|^{2{\boldsymbol{H}}} %h_{\mathsf{max}}}} =(2|Q|)^{2{\boldsymbol{H}}} %h_{\mathsf{max}}}}$.
\reviewTwo[inline]{the way you bound the number of flows could be explained more precisely.
Here you just state that there is at most H edges, and that each edge has one of the possible 4 types.
Then, you bound the number of flows by $4^{H}$, which seems to correspond to any choice of types for the H edges.
However, as you state, there is at most H edges, but there could be less.}%
\felix{done}%
Further recall that ${\boldsymbol{C}}} %c_{\mathsf{max}}}$ is the maximum number of letters output by a
single transition of $\cT$.
Like we did in the sweeping case, we define the constant
${\boldsymbol{B = {\boldsymbol{C}}} %c_{\mathsf{max}}} \cdot {\boldsymbol{H}}} %h_{\mathsf{max}}} \cdot (2^{3{\boldsymbol{E}}} %e_{\mathsf{max}}}}+4) + 4{\boldsymbol{C}}} %c_{\mathsf{max}}}}}$
that will be used to bound the lengths of some outputs of $\cT$.
Note that now $\boldsymbol{B}$ is doubly exponential with respect
to the size of $\cT$, due to the size of the effect semigroup.
\felix{added this explanation, it could be misleading otherwise}%
\begin{thm}[Factorization forest theorem \cite{factorization_forests_for_words_paper,factorization_forests}]%
\label{th:simon}
For every set $X$ of positions of $\rho$, there is a factorization forest for $X$
of height at most $3{\boldsymbol{E}}} %e_{\mathsf{max}}}$.
\end{thm}
\begin{wrapfigure}{r}{5cm}
\vspace{-4mm}
\input{ramsey}
\end{wrapfigure}
The above theorem can be used to show that if $\rho$
produces an output longer than $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, then it contains an idempotent
loop and a trace with non-empty output. Below, we present a result
in the same spirit, but refined in a way that it can be used to
find anchor points inside specific intervals.
To formally state the result, we consider subsequences
of $\r$ induced by sets of locations that are not necessarily
contiguous.
Recall the notation $\rho|Z$ introduced on page~\pageref{rhoZ}:
$\rho|Z$ is the subsequence of $\rho$ induced by the location set $Z$.
For example, Figure \ref{fig:ramsey} depicts a set $Z=[\ell_1,\ell_2]\cap (I\times\bbN)$
by a hatched area, together with the induced subrun $\rho|Z$, represented by
thick arrows.
\smallskip
\begin{thm}\label{thm:simon2}
Let $I=[x_1,x_2]$ be an interval of positions, $K=[\ell_1,\ell_2]$
an interval of locations, and $Z = K \:\cap\: (I\times\bbN)$.
If $|\out{\rho|Z}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
then there exists an idempotent loop $L$ and an anchor point $\ell$ of $L$ such that
\begin{enumerate}
\item $x_1 < \min(L) < \max(L) < x_2$ (in particular, $L\subsetneq I$),
\item $\ell_1 \mathrel{\lhd} \ell \mathrel{\lhd} \ell_2$ (in particular, $\ell \in K$),
\item $\out{\tr{\ell}} \neq \emptystr$.
\end{enumerate}
\end{thm}
\begin{proof}
Let $I$, $K$, $Z$ be as in the statement,
and suppose that $\big|\out{\rho| Z}\big| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
We define
$Z' = Z ~\setminus~ (\{\ell_1,\ell_2\} \cup \{x_1,x_2\}\times\bbN)$
and we observe that there are at most $2{\boldsymbol{H}}} %h_{\mathsf{max}}} +2$ locations
that are missing from $Z'$. This means that $\rho| Z'$ contains
all but $4{\boldsymbol{H}}} %h_{\mathsf{max}}}+4$
transitions of $\rho|Z$,
and because each transition outputs at most ${\boldsymbol{C}}} %c_{\mathsf{max}}}$ letters, we have
$|\out{\rho| Z'}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax} - 4{\boldsymbol{C}}} %c_{\mathsf{max}}}\cdot{\boldsymbol{H}}} %h_{\mathsf{max}}} -4{\boldsymbol{C}}} %c_{\mathsf{max}}} = {\boldsymbol{C}}} %c_{\mathsf{max}}}\cdot{\boldsymbol{H}}} %h_{\mathsf{max}}}\cdot 2^{3{\boldsymbol{E}}} %e_{\mathsf{max}}}}$.
\input{ramsey-proof}
For every level $y$, let $X_y$ be the set of positions $x$ such that
$(x,y)$ is the source location of some transition of $\rho|Z'$
that produces non-empty output.
For example, if we refer to Figure~\ref{fig:ramsey-proof},
the vertical dashed lines represent the positions
of $X_y$ for a particular level $y$; accordingly, the circles
in the figure represent the locations of the form $(x,y)$, for
all $x\in X_y$.
Since each transition outputs at most ${\boldsymbol{C}}} %c_{\mathsf{max}}}$ letters,
we have $\sum_y |X_y| > {\boldsymbol{H}}} %h_{\mathsf{max}}}\cdot 2^{3{\boldsymbol{E}}} %e_{\mathsf{max}}}}$.
Moreover, since there are at most ${\boldsymbol{H}}} %h_{\mathsf{max}}}$ levels,
there is a level $y$ (which we fix hereafter) such that $|X_y| > 2^{3{\boldsymbol{E}}} %e_{\mathsf{max}}}}$.
We now prove the following:
\begin{clm}
There are two consecutive loops $L_1=[x,x']$ and $L_2=[x',x'']$
with endpoints $x,x',x''\in X_y$ and such that $E_{L_1}=E_{L_2}=E_{L_1\cup L_2}$.
\end{clm}
\begin{proof}
By Theorem \ref{th:simon},
there is a factorization forest for $X_y$ of height at most $3{\boldsymbol{E}}} %e_{\mathsf{max}}}$.
Since $\rho$ is a valid run, the dummy element $\bot$ of the effect
semigroup does not appear in this factorization forest.
Moreover, since $|X_y| > 2^{3{\boldsymbol{E}}} %e_{\mathsf{max}}}}$, we know that the factorization
forest contains an internal node $L'=[x'_1,x'_{k+1}]$ with $k > 2$ children,
say $L_1=[x'_1,x'_2], \dots, L_k=[x'_k,x'_{k+1}]$.
By definition of factorization forest, the effects
$E_{L'}$, $E_{L_1}$, \dots, $E_{L_k}$ are all equal and idempotent.
In particular, the effect $E_{L'}=E_{L_1}=\dots=E_{L_k}$
is a triple of the form $(F_{L'},c_1,c_2)$,
where $c_i=\rho|x_i$ is the crossing sequence at $x'_i$.
Finally, since $E_{L'}$ is idempotent, we have that $c_1 = c_2$ and
this is equal to the crossing sequences of $\rho$ at the positions
$x'_1,\dots,x'_{k+1}$. This shows that $L_1,L_2$ are idempotent loops.
\end{proof}
Turning back to the proof of the theorem, we know from the above claim that
there are two consecutive idempotent loops $L_1=[x,x']$ and $L_2=[x',x'']$ with the
same effect and with endpoints $x,x',x''\in X_y \subseteq I \:\setminus\: \{x_1,x_2\}$
(see again Figure~\ref{fig:ramsey-proof}).
Let $\tilde\ell_1=(x,y)$ and $\tilde\ell_2=(x'',y)$, and observe that
$\tilde\ell_1,\tilde\ell_2\in Z'$. In particular, $\tilde\ell_1$ and $\tilde\ell_2$
are strictly between $\ell_1$ and $\ell_2$.
Suppose by symmetry that $\tilde\ell_1 \mathrel{\unlhd} \tilde\ell_2$.
Further let $C$ be the component of $L_1\cup L_2$ (or, equally, of $L_1$ or $L_2$)
that contains the node $y$.
Below, we focus on the factors of $\rho[\tilde\ell_1,\tilde\ell_2]$
that are intercepted by $L_1\cup L_2$: these are represented in
Figure~\ref{fig:ramsey-proof} by the thick arrows.
By Lemma~\ref{lem:component2} all these factors correspond to edges
of the same component $C$, namely, they are $(L_1 \cup L_2,C)$-factors.
Let us fix an arbitrary factor $\alpha$ of $\rho[\tilde\ell_1,\tilde\ell_2]$
that is intercepted by $L_1\cup L_2$, and assume that $\alpha=\beta_1 \cdots \beta_k$,
where $\beta_1,\dots,\beta_k$ are the factors intercepted by either $L_1$ or $L_2$.
\begin{clm}
If $\beta,\beta'$ are two factors intercepted by $L_1=[x,x']$ and $L_2=[x',x'']$,
with $E_{L_1}=E_{L_2}=E_{L_1\cup L_2}$, and $\beta,\beta'$ are adjacent in the run
$\rho$ (namely, they share an endpoint at position $x'$), then $\beta,\beta'$
correspond to edges in the same component of $L_1$ (or, equally, $L_2$).
\end{clm}
\begin{proof}
Let $C$ be the component of $L_1$ and $y_1 \mapsto y_2$ the edge of $C$
that corresponds to the factor $\beta$ intercepted by $L_1$.
Similarly, let $C'$ be the component of $L_2$ and $y_3 \mapsto y_4$ the edge of $C'$
that corresponds to the factor $\beta'$ intercepted by $L_2$.
Since $\beta$ and $\beta'$ share an endpoint at position $x'$,
we know that $y_2=y_3$. This shows that $C \cap C' \neq \emptyset$,
and hence $C=C'$.
\end{proof}
The above claim shows that any two adjacent factors $\beta_i,\beta_{i+1}$
correspond to edges in the same component of $L_1$ and $L_2$, respectively.
Thus, by transitivity, all factors $\beta_1,\dots,\beta_k$ correspond to
edges in the same component, say $C'$.
We claim that $C'=C$. Indeed, if $\beta_1$ is intercepted by $L_1$,
then $C'=C$ because $\alpha$ and $\beta_1$ start from the same location
and hence they correspond to edges of the flow that depart from the
same node. The other case is where $\beta_1$ is intercepted by $L_2$,
for which a symmetric argument can be applied.
So far we have shown that every factor of $\rho[\tilde\ell_1,\tilde\ell_2]$ intercepted
by $L_1\cup L_2$ can be factorized into some $(L_1,C)$-factors and some $(L_2,C)$-factors.
We conclude the proof with the following observations:
\begin{itemize}
\item By construction, both loops $L_1,L_2$ are contained in the interval of positions $I=[x_1,x_2]$,
and have endpoints different from $x_1,x_2$.
\item Both anchor points of $C$ inside $L_1,L_2$ belong to the interval of locations
$K\:\setminus\:\{\ell_1,\ell_2\}$.
This holds because
$\rho[\tilde\ell_1,\tilde\ell_2]$ contains a factor $\alpha$ that is intercepted
by $L_1\cup L_2$ and spans across all the positions from $x$ to $x''$, namely,
an ${\ensuremath{\mathsf{LR}}}$-factor.
This factor starts at the anchor point of $C$ inside $L_1$
and visits the anchor point of $C$ inside $L_2$.
Moreover, by construction, $\alpha$ is also a factor of the subsequence $\rho|Z'$.
This shows that the anchor points of $C$ inside $L_1$ and $L_2$ belong to $Z'$,
and in particular to $K\:\setminus\:\{\ell_1,\ell_2\}$.
\item The first factor of $\rho[\tilde\ell_1,\tilde\ell_2]$ that is intercepted by
$L_1\cup L_2$ starts at $\tilde\ell_1=(x,y)$, which by construction is the
source location of some transition producing non-empty output.
By the previous arguments, this factor is a concatenation of $(L_1,C)$-factors
and $(L_2,C)$-factors. This implies that the trace of the anchor point
of $C$ inside $L_1$, or the trace of $C$ inside $L_2$ produces non-empty output.
\qedhere
\end{itemize}
\end{proof}
\medskip
\subsection*{Inversions and periodicity.}
The first important notion that is used to characterize one-way definability
is that of inversion. It turns out that
the
definition of inversion in the sweeping case (see
page~\pageref{page-def-inversion}) can be reused almost verbatim
in the two-way setting. The only difference is that here we require the loops
to be idempotent and we do not enforce output-minimality (we will discuss this
latter choice further below, with a formal definition of output-minimality at hand).
\begin{defi}\label{def:inversion-twoway}
An \emph{inversion} of the run $\rho$ is a tuple $(L_1,\ell_1,L_2,\ell_2)$ such that
\begin{enumerate}
\item $L_1,L_2$ are idempotent loops,
\item $\ell_1=(x_1,y_1)$ and $\ell_2=(x_2,y_2)$
are anchor points inside $L_1$ and $L_2$, respectively,
\item $\ell_1 \mathrel{\lhd} \ell_2$ and $x_1 > x_2$,
\item for both $i=1$ and $i=2$, $\out{\tr{\ell_i}}\neq\emptystr$.
\end{enumerate}
\end{defi}
\input{inversion-twoway}
\noindent
Figure \ref{fig:inversion-twoway} gives an example of an inversion involving
the idempotent loop $L_1$ with anchor point $\ell_1$, and the idempotent
loop $L_2$ with anchor point $\ell_2$. The intercepted factors that form
the corresponding traces are represented by thick arrows; the one highlighted in red
are those that produce non-empty output.
The implication \PR1 $\Rightarrow$ \PR2 of Theorem \ref{thm:main2} in the two-way
case is formalized below exactly as in Proposition~\ref{prop:periodicity-sweeping},
and the proof is very similar to the sweeping case.
More precisely, it can be checked that the proof of the first claim in
Proposition~\ref{prop:periodicity-sweeping} was shown independently of the sweeping assumption
--- one just needs to replace the use of Equation \ref{eq:pumped-run}
with Proposition \ref{prop:pumping-twoway}.
The sweeping assumption was used only for deriving the notion of \emph{output-minimal}
factor, which was crucial to conclude that the period $p$ is bounded by the specific
constant $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
In this respect, the proof of Proposition~\ref{prop:periodicity-twoway}
requires a different argument for showing that $p \le\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$:
\begin{prop}\label{prop:periodicity-twoway}
If $\cT$ is one-way definable, then the following property \PR2 holds:
\begin{quote}
For all inversions $(L_1,\ell_1,L_2,\ell_2)$ of $\rho$,
the period $p$ of the word
\[
\out{\tr{\ell_1}} ~ \out{\rho[\ell_1,\ell_2]} ~ \out{\tr{\ell_2}}
\]
divides both $|\out{\tr{\ell_1}}|$ and $|\out{\tr{\ell_2}}|$.
Moreover, $p \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
\end{quote}
\end{prop}
We only need to show here that $p \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$. Recall that in the
sweeping case we relied on the assumption that the factors
$\tr{\ell_1}$ and $\tr{\ell_2}$ of an inversion are output-minimal,
and on Lemma~\ref{lem:output-minimal-sweeping}. In the general case
we need to replace output-minimality by the following notion:
\begin{defi}\label{def:output-minimal-twoway}
Consider pairs $(L,C)$ consisting of an idempotent loop $L$
and a component $C$ of $L$.
\begin{enumerate}
\item On such pairs, define the relation
$\sqsubset$ by $(L',C') \sqsubset (L,C)$ if
$L'\subsetneq L$ and at least one $(L',C')$-factor
is contained in some $(L,C)$-factor.
\item A pair $(L,C)$ is \emph{output-minimal} if
$(L',C') \sqsubset (L,C)$ implies $\out{\tr{\an{C'}}}=\emptystr$.
\end{enumerate}
\end{defi}
\noindent
Note that the relation $\sqsubset$ is not a partial order in general
(it is however antisymmetric).
Moreover, it is easy to see that the notion of output-minimal
pair $(L,C)$ generalizes that of output-minimal factor introduced
in the sweeping case: indeed, if $\ell$ is the anchor point of a
loop $L$ of a sweeping transducer and $\tr{\ell}$ satisfies
Definition \ref{def:output-minimal-sweeping}, then the pair
$(L,C)$ is output-minimal, where $C$ is the unique component
whose edge corresponds to $\tr{\ell}$.
The following lemma bounds the length of the output trace
$\out{\tr{\an{C}}}$ for an output-minimal pair $(L,C)$:
\begin{lem}\label{lem:output-minimal-twoway}
For every output-minimal pair $(L,C)$, $|\out{\tr{\an{C}}}| \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
\end{lem}
\begin{proof}
Consider a pair $(L,C)$ consisting of an idempotent loop $L=[x_1,x_2]$ and a component $C$ of $L$.
Suppose by contradiction that $|\out{\tr{\an{C}}}|>\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
We will show that $(L,C)$ is not output-minimal.
Recall that $\tr{\an{C}}$ is a concatenation of $(L,C)$-factors, say,
$\tr{\an{C}}=\beta_1\cdots\beta_k$. Let $\ell_1$ (resp.~$\ell_2$) be the
first (resp.~last) location that is visited by these factors. Further let
$K = [\ell_1,\ell_2]$ and $Z = K \:\cap\: (L\times\bbN)$.
By construction, the subsequence $\rho|Z$ can be seen as a concatenation
of the factors $\beta_1,\dots,\beta_k$, possibly in a different order than
that of $\tr{\an{C}}$. This implies that $|\out{\rho|Z}| > \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
By Theorem \ref{thm:simon2}, we know that there exist an idempotent
loop $L'\subsetneq L$ and a component $C'$ of $L'$ such that
$\an{C'} \in K$ and $\out{\tr{\an{C'}}}\neq\emptystr$.
Note that the $(L',C')$-factor that starts at the anchor point
$\an{C'}$ (an ${\ensuremath{\mathsf{LR}}}$- or ${\ensuremath{\mathsf{RL}}}$-factor) is entirely contained
in some $(L,C)$-factor.
This implies that $(L',C') \sqsubset (L,C)$, and thus $(L,C)$ is not output-minimal.
\end{proof}
We remark that the above lemma cannot be used directly to bound the period
of the output produced amid an inversion. The reason is that we cannot
restrict ourselves to inversions $(L_1,\ell_1,L_2,\ell_2)$ that induce
output-minimal pairs $(L_i,C_i)$ for $i=1,2$, where $C_i$ is the unique
component of the anchor point $\ell_i$.
An example is given in Figure~\ref{fig:inversion-twoway},
assuming that the factors depicted in red are the only ones that
produce non-empty output, and the lengths of these outputs exceed $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
On the one hand $(L_1,\ell_1,L_2,\ell_2)$ is an inversion, but
$(L_1,C_1)$ is not output-minimal.
On the other hand, it is possible that $\rho$ contains no other
inversion than $(L_1,\ell_1,L_2,\ell_2)$: any loop strictly contained
in the red factor in $L_1$ will have the anchor point \emph{after}
$\ell_2$.
We are now ready to show the second claim of
Proposition~\ref{prop:periodicity-twoway}.
\input{non-output-minimal-inversion-full}
\begin{proof}[Proof of Proposition~\ref{prop:periodicity-twoway}]
The proof of the second claim requires a refinement of the arguments that involve
pumping the run $\rho$ simultaneously on three different loops. As usual, we
assume that the loops $L_1,L_2$ of the inversion are disjoint (otherwise,
we preliminarily pump one of the two loops a few times).
Recall that the word
\[
\out{\tr{\ell_1}} ~ \out{\rho[\ell_1,\ell_2]} ~ \out{\tr{\ell_2}}
\]
has period $p = \gcd\big( |\out{\tr{\ell_1}}|, |\out{\tr{\ell_2}}|
\big)$, but that we cannot bound $p$ by assuming that $(L_1,\ell_1,L_2,\ell_2)$
is output-minimal.
However, in the pumped run $\rho^{(2,1)}$ we do find inversions with
output-minimal pairs.
For example, as depicted in the right part of Figure~\ref{fig:non-output-minimal-inversion-full},
we can consider the left and right copy of $L_1$ in $\rho^{(2,1)}$,
denoted by $\mathpalette{\overarrow@\shortleftarrowfill@} L_1$ and $\mathpalette{\overarrow@\shortrightarrowfill@} L_1$, respectively.
Accordingly, we denote by $\mathpalette{\overarrow@\shortleftarrowfill@}\ell_1$ and $\mathpalette{\overarrow@\shortrightarrowfill@}\ell_1$ the left and
right copy of $\ell_1$ in $\rho^{(2,1)}$.
Now, let $(L_0,C_0)$ be any {\sl output-minimal} pair such that $L_0$
is an idempotent loop, $\out{\tr{\an{C_0}}}\neq\emptystr$, and either
$(L_0,C_0)=(\mathpalette{\overarrow@\shortleftarrowfill@} L_1,C_1)$ or $(L_0,C_0) \sqsubset (\mathpalette{\overarrow@\shortleftarrowfill@} L_1,C_1)$.
Such a loop $L_0$ is represented in
Figure~\ref{fig:non-output-minimal-inversion-full} by
the red vertical stripe. Further let $\ell_0=\an{C_0}$.
We claim that either $(L_0,\ell_0,L_2,\ell_2)$ or $(\mathpalette{\overarrow@\shortrightarrowfill@} L_1,\mathpalette{\overarrow@\shortrightarrowfill@}\ell_1,L_0,\ell_0)$
is an inversion of the run $\rho^{(2,1)}$, depending on whether $\ell_0$ occurs
before or after $\ell_2$.
First, note that all the loops $L_0$, $L_2$, $\mathpalette{\overarrow@\shortrightarrowfill@} L_1$ are idempotent
and non-overlapping;
more precisely, we have
$\max(L_2) \le \min(L_0)$ and $\max(L_0) \le \min(\mathpalette{\overarrow@\shortrightarrowfill@} L_1)$.
Moreover, the outputs of the traces $\tr{\ell_0}$, $\tr{\mathpalette{\overarrow@\shortrightarrowfill@}\ell_1}$,
and $\tr{\ell_2}$ are all non-empty.
So it remains to distinguish two cases based on the ordering of the anchor
points $\ell_0$, $\mathpalette{\overarrow@\shortrightarrowfill@}\ell_1$, $\ell_2$.
If $\ell_0 \mathrel{\lhd} \ell_2$, then $(L_0,\ell_0,L_2,\ell_2)$ is an inversion.
Otherwise, because $(\mathpalette{\overarrow@\shortrightarrowfill@} L_1,\mathpalette{\overarrow@\shortrightarrowfill@}\ell_1,L_2,\ell_2)$ is an inversion, we know that
$\mathpalette{\overarrow@\shortrightarrowfill@}\ell_1 \mathrel{\lhd} \ell_2 \mathrel{\unlhd} \ell_0$, and hence $(\mathpalette{\overarrow@\shortrightarrowfill@} L_1,\mathpalette{\overarrow@\shortrightarrowfill@}\ell_1,L_0,C_0)$
is an inversion.
Now, we know that
$\rho^{(2,1)}$ contains the inversion $(\mathpalette{\overarrow@\shortrightarrowfill@} L_1,\mathpalette{\overarrow@\shortrightarrowfill@} \ell_1,L_2,\ell_2)$, but also
an inversion involving the output-minimal pair $(L_0,C_0)$, with $L_0$ strictly
between $\mathpalette{\overarrow@\shortrightarrowfill@} L_1$ and $L_2$.
For all $m_0,m_1,m_2$, we define $\rho^{(m_0,m_1,m_2)}$ as the run obtained from
$\rho^{(2,1)}$ by pumping $m_0,m_1,m_2$ times the loops $L_0,\mathpalette{\overarrow@\shortrightarrowfill@} L_1,L_2$, respectively.
By reasoning as we did in the proof of Proposition~\ref{prop:periodicity-sweeping}
(cf.~{\em Periodicity of outputs of pumped runs}), one can show that there are
arbitrarily large output factors of $\rho^{(m_0,m_1,m_2)}$ that are produced
within the inversion on $\ell_0$ (i.e.~either $(L_0,\ell_0,L_2,\ell_2)$ or $(\mathpalette{\overarrow@\shortrightarrowfill@} L_1,\mathpalette{\overarrow@\shortrightarrowfill@}\ell_1,L_0,\ell_0)$)
and that are periodic with period $p'$ that divides $|\out{\tr{\ell_0}}|$.
In particular, by Lemma~\ref{lem:output-minimal-twoway}, we know that
$p' \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
Moreover, large portions of these factors are also produced within the
inversion $(\mathpalette{\overarrow@\shortrightarrowfill@} L_1,\mathpalette{\overarrow@\shortrightarrowfill@}\ell_1,L_2,\ell_2)$, and hence
by Theorem~\ref{thm:fine-wilf} they have period $\gcd(p,p')$.
To conclude the proof we need to transfer the periodicity property
from the pumped runs $\rho^{(m_0,m_1,m_2)}$ to the original run $\rho$.
This is done exactly like in Proposition~\ref{prop:periodicity-sweeping}
by relying on
\gabriele{Usual replacement of Saarela...}
Lemma \ref{lem:periods}:
we observe that the periodicity
property holds for large enough parameters $m_0,m_1,m_2$, hence for
all values of the parameters, and in particular
for $m_0 = m_1 = m_2 = 1$. This shows that the word
\[
\out{\tr{\ell_1}} ~ \out{\rho[\ell_1,\ell_2]} ~ \out{\tr{\ell_2}}
\]
has period $\gcd(p,p') \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
\end{proof}
So far we have shown that the output produced amid every inversion of a
run of a one-way definable two-way transducer is periodic, with period
bounded by $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ and dividing the lengths of the trace outputs of
the inversion. This basically proves the implication \PR1 $\Rightarrow$ \PR2
of Theorem \ref{thm:main2}.
In the next section we will follow a line of arguments similar to that of
Section \ref{sec:characterization-sweeping} to prove the remaining
implications \PR2 $\Rightarrow$ \PR3 $\Rightarrow$ \PR1.
\section{Complexity of the one-way definability problem}\label{sec:complexity}
In this section we analyze the complexity of the problem of deciding whether
a transducer $\cT$ is one-way definable. We begin with the case of a functional
two-way transducer. In this case, thanks to the results presented in
Section~\ref{sec:characterization-twoway} page \pageref{testing-containment},
we know that $\cT$ is one-way
definable if and only if $\dom(\cT) \subseteq D$, where $D$ is the language of words
$u\in\dom(\cT)$ such that all successful runs of $\cT$ on $u$ admit a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition.
In particular, the one-way definability problem reduces to an emptiness problem
for the intersection of two languages:
\[
\cT \text{ one-way definable}
\qquad\text{if and only if}\qquad
\dom(\cT) \cap D^\complement = \emptyset.
\]
The following lemma exploits the characterization of Theorem~\ref{thm:main2}
to show that the language $D^\complement$ can be recognized by a non-deterministic
finite automaton $\cA$ of triply exponential size w.r.t.~$\cT$. In fact,
this lemma shows that the automaton recognizing $D^\complement$ can be constructed
using doubly exponential {\sl workspace}. As before, we gain an exponent when
restricting to sweeping transducers.
\reviewOne[inline]{Lemma 9.1: D is a poor choice of notation for the automaton given that there already is a language D. Might A (same font as current D) be an adequate choice?
\gabriele[inline]{Done. BTW. if anyone has changed the macros \cA, \cT, etc. mind that
now they are rendered as simple capital letters instead as with mathcal.
I like this, and it is more uniform than using caligraphic A for automata
and normal T for transducers... But we should check we are consistent!}%
}%
\begin{lem}\label{lem:D-complement}
Given a functional two-way transducer $\cT$, an NFA $\cA$ recognizing
$D^\complement$ can be constructed in $2\expspace$.
Moreover, when $\cT$ is sweeping, the
NFA $\cA$ can be constructed in $\expspace$.
\end{lem}
\begin{proof}
Consider an input word $u$. By Theorem~\ref{thm:main2} we know that
$u\in D^\complement$ iff there exist a successful run $\rho$ of $\cT$
on $u$ and an inversion $\cI=(L_1,\ell_1,L_2,\ell_2)$ of $\rho$ such that
no positive number $p \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ is a period of the word
\[
w_{\rho,\cI} ~=~
\outb{\tr{\ell_1}} ~ \outb{\rho[\ell_1,\ell_2]} ~ \outb{\tr{\ell_2}}.
\]
The latter condition on $w_{\rho,\cI}$ can be rephrased as follows:
there is a function $f:\{1,\dots,\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}\} \rightarrow \{1,\dots,|w_{\rho,\cI}|\}$
such that $w_{\rho,\cI}\big(f(p)\big) \neq w_{\rho,\cI}\big(f(p)+p\big)$
for all positive numbers $p\le\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
In particular, each of the images of the latter function $f$, that is,
$f(1),\dots,f(\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax})$, can be encoded by a suitable marking of the
crossing sequences of $\rho$. This shows that the run $\rho$, the
inversion $\cI$, and the function $f$ described above can all be
guessed within space $\cO(\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax})$: $\r$ is guessed on-the-fly, the
inversion is guessed by marking the anchor points, and for $f$ we only
store two symbols and a counter $\le\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$, for each $1 \le i \le \boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$.
That is, any state of $\cA$ requires doubly
exponential space, resp.~simply exponential space, depending on whether $\cT$ is arbitrary
two-way or sweeping.
\end{proof}
As a consequence of the previous lemma, the emptiness problem for the language
$\dom(\cT) \cap D^\complement$, and thus the one-way definability problem for $\cT$,
can be decided in $2\expspace$ or $\expspace$, depending on whether $\cT$ is
two-way or sweeping:
\begin{prop}\label{prop:complexity}
The problem of deciding whether a functional two-way transducer
$\cT$ is one-way definable is in $2\expspace$. When $\cT$ is
sweeping, the problem is in $\expspace$.
\end{prop}
\reviewOne[inline]{The transition from 9.2 to 9.3 is a tad abrupt. The kind of argument you make before Corollary 8.7 to explain that this makes your result more robust or tight than I expected in first approach could be useful here.
\gabriele[inline]{Done, see below}%
}%
\medskip
The last result of the section shows that functional two-way transducers
are close to be the largest class for which a characterization
of one-way definability is feasible: as soon as we consider
arbitrary transducers (including non-functional ones),
the problem becomes undecidable.
\begin{prop}\label{prop:undecidability}
The one-way definability problem for \emph{non-functional}
sweeping transducers is undecidable.
\end{prop}
\begin{proof}
The proof uses some ideas and variants of constructions provided in \cite{Ibarra78},
concerning the proof of undecidability of the equivalence problem for one-way
non-functional transducers.
We show a reduction from the Post Correspondence Problem (PCP).
A \emph{PCP instance} is described by two finite alphabets $\Sigma$ and $\Delta$
and two morphisms $f,g:\Sigma^*\then\Delta^*$. A \emph{solution} of such an instance
is any non-empty word $w\in\Sigma^+$ such that $f(w)=g(w)$. We recall that the problem
of testing whether a PCP instance has a solution is undecidable.
Below, we fix a tuple $\tau=(\Sigma,\Delta,f,g)$ describing a PCP instance and we
show how to reduce the problem of testing the {\sl non-existence of solutions} of
$\tau$ to the problem of deciding {\sl one-way definability} of a relation computed
by a sweeping transducer.
Roughly, the idea is to construct a relation $B_\tau$ between words over a suitable
alphabet $\Gamma$ that encodes all the {\sl non-solutions} to the PCP instance
$\tau$ (this is simpler than encoding solutions because the presence of errors
can be easily checked). The goal is to have a relation $B_\tau$ that
(i) can be computed by a sweeping transducer and (ii) coincides with
a trivial one-way definable relation when $\tau$ has no solution.
We begin by describing the encodings for the solutions of the PCP instance.
We assume that the two alphabets of the PCP instance, $\Sigma$ and $\Delta$,
are disjoint and we use a fresh symbol $\#\nin \Sigma\cup\Delta$.
We define the new alphabet $\Gamma = \Sigma\cup\Delta\cup\{\#\}$ that will
serve both as input alphabet and as output alphabet for the transduction.
We call \emph{encoding} any pair of words over $\Gamma$ of the form
$(w\cdot u,w\cdot v)$, where $w\in\Sigma^+$, $u\in\Delta^*$, and $v\in\{\#\}^*$.
We will write the encodings as vectors to improve readability, e.g., as
\[
\lbinom{w\cdot u}{w\cdot v} \ .
\]
We denote by $E_\tau$ the set of all encodings and we observe that $E_\tau$
is computable by a one-way transducer (note that this transducer needs
$\varepsilon$-transitions).
We then restrict our attention to the pairs in $E_\tau$ that are encodings
of valid solutions of the PCP instance.
Formally, we call \emph{good encodings} the pairs in $E_\tau$ of the form
\[
\lbinom{w\cdot u}{w\cdot\#^{|u|}}
\qquad\qquad\text{where } u = f(w) = g(w) \ .
\]
All the other pairs in $E_\tau$ are called \emph{bad encodings}.
Of course, the relation that contains the good encodings is not computable
by a transducer. On the other hand, we can show that the complement
of this relation w.r.t.~$E_\tau$ is computable by a sweeping transducer.
Let $B_\tau$ be the set of all bad encodings.
Consider $(w\cdot u,w\cdot \#^m)\in E_\tau$, with $w\in\Sigma^+$,
$u\in\Delta^*$, and $m\in\bbN$, and we observe that this pair belongs to
$B_\tau$ if and only if one of the following conditions is satisfied:
\begin{enumerate}
\item $m<|u|$,
\label{enc1}
\item $m>|u|$,
\label{enc2}
\item $u\neq f(w)$,
\label{enc3}
\item $u\neq g(w)$.
\label{enc4}
\end{enumerate}
We explain how to construct a sweeping transducer $\cS_\tau$ that computes $B_\tau$.
Essentially, $\cS_\tau$ guesses which of the above conditions holds and processes
the input accordingly. More precisely, if $\cS_\tau$ guesses that the first condition
holds, then it performs a single left-to-right pass, first copying the prefix $w$
to the output and then producing a block of occurrences of the symbol $\#$ that is
shorter than the suffix $u$. This task can be easily performed while reading
$u$: it suffices to emit at most one occurrence of $\#$ for each position in $u$,
and at the same time guarantee that, for at least one such position, no occurrence
of $\#$ is emitted. The second condition can be dealt with by a similar strategy:
first copy the prefix $w$, then output a block of $\#$ that is longer than
the suffix $u$. To deal with the third condition, the transducer $\cS_\tau$
has to perform two left-to-right passes, interleaved by a backward pass that
brings the head back to the initial position.
During the first left-to-right pass, $\cS_\tau$ copies the prefix $w$ to the output.
During the second left-to-right pass, it reads again the prefix $w$, but this time
he guesses a factorization of it of the form $w_1\:a\:w_2$.
On reading $w_1$, $\cS_\tau$ will output $\#^{|f(w_1)|}$.
After reading $w_1$, $\cS_\tau$ will store the symbol $a$ and move to the position
where the suffix $u$ begins. From there, it will guess a factorization of $u$
of the form $u_1\:u_2$, check that $u_2$ does not begin with $f(a)$, and
emit one occurrence of $\#$ for each position in $u_2$.
The number of occurrences of $\#$ produced in the output is thus
$m=|f(w_1)| + |u_2|$, and the fact that $u_2$ does not begin with $f(a)$
ensures that the factorizations of $w$ and $u$ do not match, i.e.
\[ m\neq|f(w)| \]
Note that the described behaviour does not immediately guarantee that $u\neq f(w)$.
Indeed, it may still happen that $u=f(w)$, but as a consequence $m\neq |u|$.
This case is already covered by the first and second condition,
so the computation is still correct in the sense that it produces only
bad encodings.
On the other hand, if $m$ happens to be the same as $|u|$,
then $|u| = m \neq |f(w)|$ and thus $u\neq f(w)$.
A similar behaviour can be used to deal with the fourth condition.
\smallskip
We have just shown that there is a sweeping non-functional transducer $\cS_\tau$
that computes the relation $B_\tau$ containing all the bad encodings.
Note that, if the PCP instance $\tau$ admits no solution, then all encodings
are bad, i.e., $B_\tau=E_\tau$, and hence $B_\tau$ is one-way definable.
It remains to show that when $\tau$ has a solution, $B_\tau$ is not one-way
definable. Suppose that $\tau$ has solution $w\in\Sigma^+$ and let
$\big(w\cdot u,\:w\cdot \#^{|u|}\big)$ be the corresponding good encoding,
where $u=f(w)=g(w)$.
Note that every exact repetition of $w$ is also a solution, and hence
the pairs $\big(w^n\cdot u^n,\:w^n\cdot \#^{n\cdot|u|}\big)$ are also
good encodings, for all $n\ge 1$.
Suppose, by way of contradiction, that there is a one-way transducer $\cT$
that computes the relation $B_\tau$.
For every $n,m\in\bbN$, we define the encoding
\[
\alpha_{n,m} ~=~
\lbinom{w^n\cdot u^m}{w^n\cdot \#^{m\cdot|u|}}
\]
and we observe that $\alpha_{n,m} \in B_\tau$ if and only if $n\neq m$
(recall that $w\neq\emptystr$ is the solution of the PCP instance $\tau$ and $u=f(w)=g(w)$).
Below, we consider bad encodings like the above ones,
where the parameter $n$ is supposed to be large enough.
Formally, we define the set $I$ of all pairs of indices $(n,m)\in\bbN^2$
such that (i) $n\neq m$ (this guarantees that $\alpha_{n,m}\in B_\tau$)
and (ii) $n$ is larger than the number $|Q|$ of states of $\cT$.
We consider some pair $(n,m)\in I$ and we choose a successful
run $\rho_{n,m}$ of $\cT$ that witnesses the membership of
$\alpha_{n,m}$ in $B_\tau$, namely, that reads the input
$w^n\cdot u^m$ and produces the output $w^n\cdot \#^{m\cdot|u|}$.
We can split the run $\rho_{n,m}$ into a prefix $\mathpalette{\overarrow@\shortleftarrowfill@}\rho_{n,m}$
and a suffix $\mathpalette{\overarrow@\shortrightarrowfill@}\rho_{n,m}$ in such a way that $\mathpalette{\overarrow@\shortleftarrowfill@}\rho_{n,m}$
consumes the prefix $w^n$ and $\mathpalette{\overarrow@\shortrightarrowfill@}\rho_{n,m}$ consumes the remaining
suffix $u^m$.
Since $n$ is larger than the number of state of $\cT$, we can find a
factor $\hat\rho_{n,m}$ of $\mathpalette{\overarrow@\shortleftarrowfill@}\rho_{n,m}$ that starts and ends with
the same state and consumes a non-empty exact repetition of $w$,
say $w^{n_1}$, for some $1\le n_1\le |Q|$.
We claim that the output produced by the factor $\hat\rho_{n,m}$
must coincide with the consumed part $w^{n_1}$ of the input.
Indeed, if this were not the case, then deleting the factor $\hat\rho_{n,m}$
from $\rho_{n,m}$ would result in a new successful run that reads
$w^{n-n_1}\cdot u^m$ and produces $w^{n-n_2}\cdot \#^{m\cdot|u|}$
as output, for some $n_2\neq n_1$. This however would contradict
the fact that, by definition of encoding, the possible outputs produced
by $\cT$ on input $w^{n-n_1}\cdot u^m$ must agree on the prefix $w^{n-n_1}$.
We also remark that, even if we do not annotate this explicitly, the number
$n_1$ depends on the choice of the pair $(n,m)\in I$. This number, however,
range over the fixed finite set $J = \big[1,|Q|\big]$.
We can now pump the factor $\hat\rho_{n,m}$ of the run $\rho_{n,m}$ any
arbitrary number of times. In this way, we obtain new successful runs of
$\cT$ that consume inputs of the form
$w^{n+k\cdot n_1}\cdot u^m$ and produce outputs of the form
$w^{n+k\cdot n_1}\cdot \#^m$, for all $k\in\bbN$.
In particular, we know that $B_\tau$ contains all
pairs of the form $\alpha_{n+k\cdot n_1,m}$.
Summing up, we can claim the following:
\begin{clm}
There is a function $h:I\then J$ such that, for all pairs $(n,m)\in I$,
\[
\big\{ (n+k\cdot h(n,m),m) ~\big|~ k\in\bbN \big\} \:\subseteq\: I \ .
\]
\end{clm}
\noindent
We can now head towards a contradiction. Let $\tilde n$
be the maximum common multiple of the numbers $h(n,m)$,
for all $(n,m)\in I$. Let $m=n+\tilde n$ and observe that
$n\neq m$, whence $(n,m)\in I$. Since $\tilde n$ is a multiple
of $h(n,m)$, we derive from the above claim that the pair
$(n+\tilde n,m) = (m,m)$ also belongs to $I$.
However, this contradicts the definition of $I$, since we
observed earlier that $\alpha_{n,m}$ is a bad encoding if
and only if $n\neq m$.
We conclude that $B_\tau$ is not one-way definable
when $\tau$ has a solution.
\end{proof}
\section{Conclusions}\label{sec:conclusions}
It was shown in \cite{fgrs13} that it is decidable whether
a given two-way transducer can be implemented by some one-way
transducer. However, the provided algorithm has non-elementary complexity.
The main contribution of our paper is a new algorithm that solves
the above question with elementary complexity, precisely in $2\expspace$.
The algorithm is based on a characterization of those transductions,
given as two-way transducers, that can be realized by one-way
transducers. The flavor of our characterization is
different from that of \cite{fgrs13}. The approach of
\cite{fgrs13} is based on a variant of Rabin and Scott's construction
\cite{RS59} of one-way automata, and on local modifications of
the two-way run. Our approach instead relies on the global notion
of \emph{inversion} and more involved combinatorial arguments.
The size of the one-way transducer that we obtain is triply exponential
in the general case, and doubly exponential in the sweeping case, and
the latter is optimal.
\felix{add last sentence. Maybe we can do more on future work ? The characterization of sweeping in term of rational relations maybe ?}%
\gabriele{I did not like the sentence in the end, so I moved it here and rephrased (and it was not future work!)}%
The approach described here was adapted to characterize functional two-way transducers
that are equivalent to some sweeping transducer with either known or
unknown number of passes (see~\cite{bgmp16}, \cite{Bas17} for details).
\reviewOne[inline]{The conclusion gives no clue towards future works, either current, considered or at all possible.
\olivier[inline]{added the following paragraph}%
}%
Our procedure considers non-deterministic transducers,
both for the initial two-way transducer, and
for the equivalent one-way transducer, if it exists.
\gabriele{Improved and mentioned that determinism does not bring much to our problem}%
Deterministic two-way transducers are as expressive as
non-deterministic functional ones. This means that
starting from deterministic two-way transducers would address
the same problem in terms of transduction classes, but could
in principle yield algorithms with better complexity.
\gabriele{Added this tiny remark}%
We also recall that Proposition \ref{prop:lower-bound}
gives a tight lower bound for the size of a one-way transducer
equivalent to a given deterministic sweeping transducer. This
latter result basically shows that there is no advantage in
considering one-way definability for deterministic variants
of sweeping transducers, at least with respect to the size
of the possible equivalent one-way transducers.
\gabriele{slightly rephrased}%
A variant of the one-way definability problem asks whether a given
two-way transducer is equivalent to some \emph{deterministic} one-way transducer.
A decision procedure for this latter problem is obtained by combining
our characterization with the classical algorithm that determines whether a one-way
transducer can be determinized \cite{cho77,bealcarton02,weberklemm95}.
In terms of complexity, it is conceivable that a better algorithm
may exist for deciding definability by deterministic one-way transducers,
since in this case one can rely on structural properties
that characterize
deterministic transducers. \anca{I deleted the last phrase (``on the
contrary, our approach etc'') because at this point, the reader
should have remembered that we do only guessing.}
\section{Introduction}\label{sec:introduction}
Since the early times of computer science, transducers have been
identified as a fundamental computational model. Numerous
fields of computer science are ultimately concerned with
transformations, ranging from databases to image
processing, and an important challenge is to perform transformations with
low costs, whenever possible.
The most basic form of transformations is obtained using devices that
process an input with finite memory
and produce outputs during the processing. Such
devices are called finite-state transducers. Word-to-word finite-state
transducers were considered in very early work in formal language
theory~\cite{sch61,ahu69,eilenberg1974automata}, and it was soon clear that they are much more
challenging than finite-state word acceptors (classical finite-state
automata). One essential difference between transducers and automata
over words is that the capability to process the
input in both directions strictly increases the expressive power in the case
of transducers, whereas this does not for
automata~\cite{RS59,she59}. In other words, two-way word transducers
are strictly more expressive than one-way word transducers.
We consider in this paper functional transducers, that compute
functions from words to words. Two-way word transducers capture very
nicely the notion of regularity in this setting. Regular word
functions, in other words, functions computed by functional two-way transducers%
\footnote{We know from \cite{EH98,de2013uniformisation} that deterministic
and non-deterministic functional two-way transducers have the
same expressive power, though the non-deterministic variants are
usually more succinct.},
inherit many of the characterizations and algorithmic properties of the robust
class of regular languages. Engelfriet and Hoogeboom~\cite{EH98}
showed that monadic second-order definable graph transductions,
restricted to words, are equivalent to two-way transducers --- this
justifies the
notation ``regular'' word functions, in the spirit of classical
results in automata theory and logic by B\"uchi, Elgot, Rabin and
others. Recently, Alur and Cern\'{y}~\cite{AlurC10} proposed an enhanced
version of one-way transducers called streaming transducers, and
showed that they are equivalent to the two previous models. A streaming
transducer processes the input word from left to right, and stores
(partial) output words in some given write-only registers, that are
updated through concatenation and constant updates.
\reviewOne[inline]{Few reasons are given for a specific focus towards two-way transducers as opposed to equivalent models.
\olivier[inline]{I answered to the editor that the main reason is that we are more familiar with it, so it seems natural. But we shouldn't mention it here.}
}%
\anca[inline]{I agree not to say it here, but I would not say this
is the real reason - and I changed the answer. The real reason (for
me) is that pumping SST is much less intuitive.}%
Two-way transducers raise challenging questions about resource
requirements. One crucial resource is the number of times the
transducer needs to re-process the input word. In particular, the case
where the input can be processed in a single pass, from left to right,
is very attractive as it corresponds to the setting of \emph{streaming},
where the (possibly very large) inputs do not need to be stored in order
to be processed. The~\emph{one-way definability} of a functional
two-way transducer, that is, the question
whether the transducer is equivalent to some one-way transducer, was
considered quite recently: \cite{fgrs13} shows that one-way
definability of string transducers is a decidable property. However, the decision procedure
of~\cite{fgrs13} has non-elementary complexity, which raises the
question about the intrinsic complexity of this problem.
In this paper we provide an algorithm of elementary complexity solving
the one-way definability problem.
Our decision algorithm has single or doubly exponential space complexity,
depending on whether the input transducer is sweeping (namely, it performs reversals
only at the extremities of the input word) or genuinely two-way.
We also describe an algorithm that constructs an equivalent one-way
transducer, whenever it exists, in doubly or triply exponential time,
again depending on whether the input transducer is sweeping or
two-way. For the
construction of an equivalent one-way transducer we obtain a doubly
exponential lower bound, which is tight for sweeping transducers. Note that for the decision problem,
the best lower bound known is only polynomial space~\cite{fgrs13}.
\reviewOne[inline]{The subclass of sweeping transducers is central to
the paper: not only is the algorithm of better complexity in this
particular case, it is also used as an easy case to prepare for the
general proof. However, beyond this property, it is unclear whether
this class has other interesting properties, or has garnered
interest in the part. This information should, ideally, be made
available in the introduction. \olivier[inline]{added a paragraph
below.}%
}%
\reviewOne[inline]{Were deterministic two-way word transducers
considered at all (Introduction)? If not, do you plan to consider
them (Conclusion)? \olivier[inline]{added the footnote in intro,
and a paragraph in conclusion}%
\felix[inline]{I think the question is "do you have a better
complexity if the given transducer is deterministic?" like
usually. We maybe also need to add something like : One can notice
that if we want to decide definability by \emph{deterministic}
one-way transducers, an efficient procedure is known since
Choffrut78 \olivier[inline]{you can complete the conclusion if you
want. To me it is sufficient.}%
}%
}%
\olivier{added this paragraph}%
\gabriele{Changed a bit (without the reviewer comment the paragraph was a bit isolated)}%
\anca{changed a bit more}%
Our initial interest in sweeping transducers was the fact that they
provide a simpler setting for characterizing one-way
definability. Later it turned out that sweeping transducers enjoy interesting and
useful connections with streaming transducers: they have the same
expressiveness as streaming transducers where concatenation of
registers is disallowed. The connection goes even further, since the number of
sweeps corresponds exactly to the number of
registers~\cite{bgmp16}. The results of this paper were refined
in~\cite{bgmp16}, and used to determine the minimal number of
registers required by functional streaming transducers without
register concatenation.
\subsection*{Related work.}
Besides the papers mentioned above, there are
several recent results around the expressivity and the resources of
two-way transducers, or
equivalently, streaming transducers.
First-order definable transductions were shown to be equivalent to
transductions defined by aperiodic
streaming transducers~\cite{FiliotKT14} and to aperiodic two-way
transducers~\cite{CartonDartois15}. An effective characterization of
aperiodicity for one-way transducers was obtained in~\cite{FGL16}.
Register minimization for right-appending deterministic streaming
transducers
was shown to be
decidable in~\cite{DRT16}. An algebraic characterization of (not necessarily
functional) two-way transducers over unary alphabets was
provided in~\cite{CG14mfcs}. It was shown that in this case
sweeping transducers have the same expressivity.
The expressivity of non-deterministic input-unary
or output-unary two-way
transducers was investigated in~\cite{Gui15}.
In \cite{Smith14} a pumping lemma for two-way transducers is proposed,
and used to investigate properties of the output languages of two-way
transducers. In this paper we also rely on pumping arguments over runs
of two-way transducers, but we require loops of a particular form,
that allows to identify periodicities in the output.
\olivier{TODO ref Ismael to be improved before resubmission}%
The present paper unifies results on one-way definability obtained
in~\cite{bgmp15} and~\cite{bgmp17}.
Compared to the conference versions, some combinatorial proofs have
\gabriele{I have removed the reference to Saarela}%
been simplified,
and the complexity of the procedure presented in~\cite{bgmp15} has been
improved by one exponential.
\anca{please check. I deleted the sentence on the
under-approximation, because I don't find it understandable at this point.}%
\olivier{added this paragraph}%
\subsection*{Overview.}
Section~\ref{sec:preliminaries} introduces basic
notations for two-way and sweeping transducers, and Section~\ref{sec:overview}
states the main result and provides a roadmap of the proofs. For
better readability our paper
is divided in two parts: in the first part we consider the easier case of
sweeping transducers, and in the second part the general case. The two
proofs are similar, but the general case is more involved since we
need to deal with special loops (see
Section~\ref{sec:loops-twoway}). Since the high-level ideas of the
proofs are the same and the sweeping case illustrates them in a
simpler way, the proof in that setting is a preparation for the
general case. Both proofs have
the same structure: first we introduce some combinatorial arguments
(see Section~\ref{sec:combinatorics-sweeping} for the sweeping case
and Section~\ref{sec:combinatorics-twoway} for the general case), then we provide the
characterization of one-way definability (see
Section~\ref{sec:characterization-sweeping} for the sweeping case and
Section~\ref{sec:characterization-twoway} for the general
case). Finally, Section~\ref{sec:complexity} establishes the complexity
of our algorithms.
\section{The structure of two-way loops}\label{sec:loops-twoway}
While loop pumping in a sweeping transducer is rather simple,
we need a much better understanding when it comes to pump loops of
unrestricted two-way transducers.
This section is precisely devoted to untangling the structure of two-way loops.
We will focus on specific loops, called idempotent,
that generate repetitions with a ``nice shape'', very similar
to loops of sweeping transducers.
We fix throughout this section a functional two-way transducer $\cT$,
an input word $u$, and a (normalized) successful run $\rho$ of $\cT$ on $u$.
As usual, ${\boldsymbol{H}}} %h_{\mathsf{max}}}=2|Q|- 1$ is the maximal length of a crossing sequence
of $\rho$, and ${\boldsymbol{C}}} %c_{\mathsf{max}}}$ is the maximal number of letters output by a single
transition.
\reviewTwo[inline]{
I have some questions concerning the definition of the flows and effects.
Initially you fix a transducer T, a word u and a run $\rho$ of T on u, and you define the flow corresponding to an interval I of $\rho$. On line 10, you say that “we consider effects that are not necessarily associated with intervals of specific runs”. Then you define the set of all flows, and all effects.
If I understand correctly, a flow has to correspond to an interval I, whereas an effect is a triple containing a flow (corresponding to an interval I) and two crossing sequences (that might not correspond to I).
My first question is: wouldn’t it be more natural to have either
1. also flows that do not correspond to an interval,
2. or only effects that correspond to intervals?
I realise that in case 1, defining the flows in a way for Lemma 6.5 to still hold seems complicated, but I was wondering if you had considered it.
Second, I was wondering if it wouldn’t be easier to fix the set of nodes of the flows to $\{0,\dots , 2|Q| - 2 \}$.
This would allow a smoother definition of $G \cdot G'$ (l.25): as of now, the set of nodes of $G \cdot G'$ is not stated explicitly. If I am not mistaken, it is the set of nodes that are part of G and admit an outgoing edge, or are part of $G'$ and admit an incoming edge (which is not that complicated, but wouldn't be needed at all if we always have all the nodes).
\olivier[inline]{addressed in review2-answer.txt}%
}%
\medskip
\subsection*{Flows and effects.}
We start by analyzing the shape of factors of $\rho$ intercepted
by an interval $I=[x_1,x_2]$.
We identify four types of factors $\alpha$ intercepted by $I$
depending on the first location $(x,y)$ and the last location
$(x',y')$:
\begin{itemize}
\item $\alpha$ is an ${\ensuremath{\mathsf{LL}}}$-factor if $x=x'=x_1$,
\item $\alpha$ is an $\RR$-factor if $x=x'=x_2$,
\item $\alpha$ is an ${\ensuremath{\mathsf{LR}}}$-factor if $x=x_1$ and $x'=x_2$,
\item $\alpha$ is an ${\ensuremath{\mathsf{RL}}}$-factor if $x=x_2 $ and $x'=x_1$.
\end{itemize}
In Figure \ref{fig:intercepted-factors} we see that $\a$ is an
${\ensuremath{\mathsf{LL}}}$-factor, $\b,\delta$ are ${\ensuremath{\mathsf{LR}}}$-factors, $\z$ is an $\RR$-factor,
and $\g$ is an ${\ensuremath{\mathsf{RL}}}$-factor.
\begin{defi}\label{def:flow}
Let $I = [x_1,x_2]$ be an interval of $\rho$ and $h_i$ the length of
the crossing sequence $\rho|x_i$, for both $i=1$ and $i=2$.
The \emph{flow} $F_I$ of $I$ is the directed graph with set of nodes
$\set{0,\dots,\max(h_1,h_2)-1}$ and set of edges consisting of all
$(y,y')$ such that there is a factor of $\rho$ intercepted by $I$
that starts at location $(x_i,y)$ and ends at location $(x_j,y')$,
for $i,j\in\{1,2\}$.
The \emph{effect} $E_I$ of $I$ is the triple $(F_I,c_1,c_2)$,
where $c_i=\r|x_i$ is the crossing sequence at $x_i$.
\end{defi}
\noindent
For example, the interval $I$ of Figure \ref{fig:intercepted-factors}
has the flow graph $0\mapsto 1\mapsto 3\mapsto 4\mapsto 2\mapsto 0$.
It is easy to see that every node of a flow $F_I$ has at most one
incoming and at most one outgoing edge. More precisely, if $y<h_1$ is
even, then it has one outgoing edge (corresponding to an ${\ensuremath{\mathsf{LR}}}$- or ${\ensuremath{\mathsf{LL}}}$-factor
intercepted by $I$), and if it is odd it has one incoming edge (corresponding
to an ${\ensuremath{\mathsf{RL}}}$- or ${\ensuremath{\mathsf{LL}}}$-factor intercepted by $I$). Similarly, if $y<h_2$ is
even, then it has one incoming edge (corresponding to an ${\ensuremath{\mathsf{LR}}}$- or $\RR$-factor),
and if it is odd it has one outgoing edge (corresponding to an ${\ensuremath{\mathsf{RL}}}$- or
$\RR$-factor).
In the following we consider effects that are not necessarily
associated with intervals of specific runs. The definition of such effects
should be clear: they are triples consisting of a graph (called flow)
and two crossing sequences of lengths $h_1,h_2 \le {\boldsymbol{H}}} %h_{\mathsf{max}}}$, with sets of
nodes of the form $\{0,\ldots,\max(h_1,h_2)-1\}$,
that satisfy the in/out-degree properties stated above.
It is convenient to distinguish the edges in a flow based on the
parity of the source and target nodes. Formally, we partition any
flow $F$ into the following subgraphs:
\begin{itemize}
\item $F_{\ensuremath{\mathsf{LR}}}$ consists of all edges of $F$ between pairs of even nodes,
\item $F_{\ensuremath{\mathsf{RL}}}$ consists of all edges of $F$ between pairs of odd nodes,
\item $F_{\ensuremath{\mathsf{LL}}}$ consists of all edges of $F$ from an even node to an odd node,
\item $F_\RR$ consists of all edges of $F$ from an odd node to an even node.
\end{itemize}
We denote by $\cF$ (resp.~$\cE$) the set of all flows (resp.~effects)
augmented with a dummy element $\bot$. We equip both sets $\cF$ and $\cE$ with
a semigroup structure, where the corresponding products $\circ$ and $\odot$ are
defined below (similar definitions appear in \cite{Birget1990}).
Later we will use the semigroup structure to identify the \emph{idempotent loops},
that play a crucial role in our characterization of one-way definability.
\begin{defi}\label{def:product}
For two graphs $G,G'$, we denote by $G\cdot G'$ the graph with edges of
the form $(y,y'')$ such that $(y,y')$ is an edge of $G$ and $(y',y'')$ is an
edge of $G'$, for some node $y'$ that belongs
to both $G$ and $G'$.
Similarly, we denote by $G^*$ the graph with edges $(y,y')$
such that there exists a (possibly empty) path in $G$ from $y$ to $y'$.
The product of two flows $F,F'$ is the unique flow $F\circ F'$ (if it exists) such that:
\begin{itemize}
\item $(F\circ F')_{\ensuremath{\mathsf{LR}}} = F_{\ensuremath{\mathsf{LR}}} \cdot (F'_{\ensuremath{\mathsf{LL}}} \cdot F_\RR)^* \cdot F'_{\ensuremath{\mathsf{LR}}}$,
\item $(F\circ F')_{\ensuremath{\mathsf{RL}}} = F'_{\ensuremath{\mathsf{RL}}} \cdot (F_\RR \cdot F'_{\ensuremath{\mathsf{LL}}})^* \cdot F_{\ensuremath{\mathsf{RL}}}$,
\item $(F\circ F')_{\ensuremath{\mathsf{LL}}} = F_{\ensuremath{\mathsf{LL}}} ~\cup~ F_{\ensuremath{\mathsf{LR}}} \cdot (F'_{\ensuremath{\mathsf{LL}}} \cdot F_\RR)^* \cdot F'_{\ensuremath{\mathsf{LL}}} \cdot F_{\ensuremath{\mathsf{RL}}}$,
\item $(F\circ F')_\RR = F'_\RR ~\cup~ F'_{\ensuremath{\mathsf{RL}}} \cdot (F_\RR \cdot F'_{\ensuremath{\mathsf{LL}}})^* \cdot F_\RR \cdot F'_{\ensuremath{\mathsf{LR}}}$.
\end{itemize}
If no flow $F\circ F'$ exists with the above properties,
then we let $F\circ F'=\bot$.
The product of two effects $E=(F,c_1,c_2)$ and $E'=(F',c'_1,c'_2)$ is either the effect
$E\odot E' = (F\circ F',c_1,c'_2)$ or the dummy element $\bot$, depending on whether
$F\circ F'\neq \bot$ and $c_2=c'_1$.
\end{defi}
\noindent
For example, let $F$ be the flow of interval $I$
in Figure \ref{fig:intercepted-factors}. Then
$(F \circ F)_{\ensuremath{\mathsf{LL}}}=\set{0\mapsto 1, 2\mapsto 3}$,
$(F \circ F)_\RR=\set{1\mapsto 2, 3\mapsto 4}$, and
$(F \circ F)_{\ensuremath{\mathsf{LR}}}=\set{4\mapsto 0}$
--- one can quickly verify this with the
help of Figure \ref{fig:pumping-twoway}.
It is also easy to see that $(\cF,\circ)$ and $(\cE,\odot)$ are finite semigroups, and that
for every run $\r$ and every pair of consecutive intervals $I=[x_1,x_2]$ and $J=[x_2,x_3]$ of $\r$,
$F_{I\cup J} = F_I \circ F_J$ and $E_{I\cup J} = E_I \odot E_J$.
In particular, the function $E$ that associates each interval $I$ of $\rho$ with the
corresponding effect $E_I$ can be seen as a semigroup homomorphism.
\medskip
\subsection*{Loops and components.}
Recall that a loop is an interval $L=[x_1,x_2]$
with the same crossing sequences at $x_1$ and $x_2$.
We will follow techniques similar to those presented in Section \ref{sec:combinatorics-sweeping}
to show that the outputs generated in non left-to-right manner are essentially periodic.
However, differently from the sweeping case, we will consider only special types
of loops:
\begin{defi}\label{def:idempotent}
A loop $L$ is \emph{idempotent} if $E_L = E_L \odot E_L$ and $E_L\neq\bot$.
\end{defi}
\noindent
For example, the interval $I$ of Figure \ref{fig:intercepted-factors} is a loop,
if one assumes that the crossing sequences at the borders of $I$ are the same.
By comparing with Figure \ref{fig:pumping-twoway}, it is easy to see that $I$
is not idempotent. On the other hand, the loop consisting of 2 copies of $I$
is idempotent.
\input{pumping-twoway}
As usual, given a loop $L=[x_1,x_2]$ and a number $n\in\bbN$, we can
introduce $n$ new copies of $L$ and connect the intercepted factors
in the obvious way.
This results in a new run $\ensuremath{\mathsf{pump}}_L^{n+1}(\rho)$ on the word $\ensuremath{\mathsf{pump}}_L^{n+1}(u)$.
Figure \ref{fig:pumping-twoway} shows how to do this for $n=1$ and $n=2$.
Below, we analyze in detail the shape of the pumped run $\ensuremath{\mathsf{pump}}_L^{n+1}(\rho)$
(and the produced output as well) when $L$ is an {\sl idempotent} loop.
We will focus on idempotent loops because pumping non-idempotent loops
may induce permutations of factors that are difficult to handle.
For example, if we consider again the non-idempotent loop $I$ to the
left of Figure \ref{fig:pumping-twoway}, the factor of the run between
$\beta$ and $\gamma$ (to the right of $I$, highlighted in red) precedes
the factor between $\gamma$ and $\delta$ (to the left of $I$, again in red),
but this ordering is reversed when a new copy of $I$ is added.
When pumping a loop $L$, subsets of factors intercepted by $L$ are glued
together to form factors intercepted by the replication of $L$.
The notion of component introduced below identifies
groups of factors that are glued together.
\begin{defi}\label{def:component}
A \emph{component} of a loop $L$ is any strongly
connected component of its flow $F_L$
(note that this is also a cycle, since
every node in it has in/out-degree $1$).
Given a component $C$, we denote by
$\min(C)$ (resp.~$\max(C)$) the minimum (resp.~maximum)
node in $C$.
We say that $C$ is \emph{left-to-right} (resp.~\emph{right-to-left})
if $\min(C)$ is even (resp., odd).
An \emph{$(L,C)$-factor} is a factor of the run that is
intercepted by $L$ and that corresponds to an edge of $C$.
\end{defi}
\noindent
We will usually list the $(L,C)$-factors based on their order of occurrence in the run.
For example, the loop $I$ of Figure \ref{fig:pumping-twoway} contains
a single component $C=0\mapsto 1\mapsto 3\mapsto 4\mapsto 2\mapsto 0$
which is left-to-right.
Another example is given in Figure \ref{fig:many-components}, where the
loop $L$ has three components $C_1,C_2,C_3$ (colored in blue, red,
and green, respectively):
$\a_1,\a_2,\a_3$ are the $(L,C_1)$-factors, $\b_1,\b_2,\b_3$ are
the $(L,C_2)$-factors, and $\g_1$ is the unique $(L,C_3)$-factor.
\input{many-components}
\medskip
Below, we show that the levels of each component of a loop (not necessarily idempotent)
form an interval.
\begin{lem}\label{lem:component}
Let $C$ be a component of a loop $L=[x_1,x_2]$.
The nodes of $C$ are precisely the levels in the interval $[\min(C),\max(C)]$.
Moreover, if $C$ is left-to-right (resp.~right-to-left), then $\max(C)$
is the smallest level $\ge \min(C)$
such that between $(x_1,\min(C))$ and $(x_2,\max(C))$ (resp.~$(x_2,\min(C))$ and $(x_1,\max(C))$)
there are equally many ${\ensuremath{\mathsf{LL}}}$-factors and $\RR$-factors intercepted by $L$.
\end{lem}
\begin{proof}[Proof idea]
The proof of this lemma is rather technical and deferred to
Appendix~\ref{app:proof-component}, since the lemma is not at the core of the proof of the main
result. Let us first note that with the definition of $\max(C)$ stated
in the lemma it is rather easy to see that the interval
$[\min(C),\max(C)]$ is a union of cycles (i.e., components). This
can be shown by arguing that every node in $[\min(C),\max(C)]$ has
in-degree and out-degree one. What is much less obvious is that
$[\min(C),\max(C)]$ is connected, thus consists of a single cycle.
\input{edges}
The crux is thus to show that the nodes visited by every cycle of the flow
(or, equally,
every component) form an interval. For this, we use an induction based
on portions of the cycle, namely, on {\sl paths} of the flow.
The difficulty underlying the formalization of the inductive invariant comes from the
fact that, differently from cycles, paths of a flow may visit sets of levels that do
not form intervals.
An example is given in Figure \ref{fig:edges}, which represents some edges of a flow
forming a path from $\mathpalette{\overarrow@\shortrightarrowfill@} y_i$ to $\mathpalette{\overarrow@\shortrightarrowfill@} y_i +1$ and covering a non-convex set of nodes:
note that there could be a large gap between the nodes $\mathpalette{\overarrow@\shortrightarrowfill@} y_i$ and $\mathpalette{\overarrow@\shortleftarrowfill@} y_i$ due
to the unbalanced numbers of ${\ensuremath{\mathsf{LL}}}$-factors and $\RR$-factors below $\mathpalette{\overarrow@\shortleftarrowfill@} y_i$.
Essentially, the first part of the proof of the lemma amounts at identifying the sources
$\mathpalette{\overarrow@\shortrightarrowfill@} y_i$ (resp.~$\mathpalette{\overarrow@\shortleftarrowfill@} y_i$) of the ${\ensuremath{\mathsf{LR}}}$-factors (resp.~${\ensuremath{\mathsf{RL}}}$-factors), and at showing
that the latter factors are precisely of the form $\mathpalette{\overarrow@\shortrightarrowfill@} y_i \rightarrow \mathpalette{\overarrow@\shortleftarrowfill@} y_{i-1}+1$
(resp.~$\mathpalette{\overarrow@\shortleftarrowfill@} y_i \rightarrow \mathpalette{\overarrow@\shortrightarrowfill@} y_i +1$).
Once these nodes are identified, we show by induction on $i$ that every two
consecutive nodes $\mathpalette{\overarrow@\shortrightarrowfill@} y_i$ and $\mathpalette{\overarrow@\shortrightarrowfill@} y_i +1$ must be connected by a path whose
intermediate nodes form the interval $[\mathpalette{\overarrow@\shortleftarrowfill@} y_{i-1}+1,\mathpalette{\overarrow@\shortleftarrowfill@} y_i]$.
Finally, we argue that every cycle (or component) $C$ visits all and only
the nodes in the interval $[\min(C),\max(C)]$.
\end{proof}
The next lemma describes the precise shape and order of the intercepted factors
when the loop $L$ is idempotent.
\begin{lem}\label{lem:component2}
If $C$ is a left-to-right (resp.~right-to-left) component
of an {\sl idempotent} loop $L$, then the $(L,C)$-factors are in the following order:
$k$ ${\ensuremath{\mathsf{LL}}}$-factors (resp.~$\RR$-factors), followed by one ${\ensuremath{\mathsf{LR}}}$-factor (resp.~${\ensuremath{\mathsf{RL}}}$-factor),
followed by $k$ $\RR$-factors (resp.~${\ensuremath{\mathsf{LL}}}$-factors), for some $k \ge 0$.
\end{lem}
\begin{proof}
Suppose that $C$ is a left-to-right component of $L$.
We show by way of contradiction that $C$ has only one ${\ensuremath{\mathsf{LR}}}$-factor
and no ${\ensuremath{\mathsf{RL}}}$-factor. By Lemma~\ref{lem:component} this will yield
the claimed shape. Figure~\ref{fig:notidem} can be used as a reference
example for the arguments that follow.
We begin by listing the $(L,C)$-factors.
As usual, we order them based on their occurrences in the run $\rho$.
Let $\gamma$ be the first $(L,C)$-factor that is not an ${\ensuremath{\mathsf{LL}}}$-factor,
and let $\beta_1,\dots,\beta_k$ be the $(L,C)$-factors that precede $\gamma$
(these are all ${\ensuremath{\mathsf{LL}}}$-factors).
Because $\gamma$ starts at an even level, it must be an ${\ensuremath{\mathsf{LR}}}$-factor.
Suppose that there is another $(L,C)$-factor, say $\zeta$, that comes
after $\gamma$ and it is neither an $\RR$-factor nor an ${\ensuremath{\mathsf{LL}}}$-factor.
Because $\zeta$ starts at an odd level, it must be an ${\ensuremath{\mathsf{RL}}}$-factor.
Further let $\delta_1,\dots,\delta_{k'}$ be the intercepted $\RR$-factors
that occur between $\gamma$ and $\zeta$.
We claim that $k'<k$, namely, that the number of $\RR$-factors between
$\gamma$ and $\zeta$ is strictly less than the number of ${\ensuremath{\mathsf{LL}}}$-factors
before $\gamma$. Indeed, if this were not the case, then, by Lemma
\ref{lem:component}, the level where $\zeta$ starts would not belong to
the component $C$.
Now, consider the pumped run $\rho'=\ensuremath{\mathsf{pump}}_L^2(\rho)$, obtained by adding a new
copy of $L$. Let $L'$ be the loop of $\rho'$ obtained from the union
of $L$ and its copy. Since $L$ is idempotent, the components of $L$ are isomorphic
to the components of $L'$. In particular, we can denote by $C'$ the component
of $L'$ that is isomorphic to $C$.
Let us consider the $(L',C')$-factors of $\rho'$. The first $k$ factors
are isomorphic to the $k$ ${\ensuremath{\mathsf{LL}}}$-factors $\beta_1,\ldots,\beta_k$ from $\rho$.
However, the $(k+1)$-th element has a different shape: it is isomorphic to
$\gamma~\beta_1~\delta_1~\beta_2~\cdots~\delta_{k'}~\beta_{k'+1}~\zeta$,
and in particular it is an ${\ensuremath{\mathsf{LL}}}$-factor.
This implies that the $(k+1)$-th edge of $C'$ is of the form $(y,y+1)$,
while the $(k+1)$-th edge of $C$ is of the form $(y,y-2k)$.
This contradiction comes from having assumed the existence of
the ${\ensuremath{\mathsf{RL}}}$-factor $\zeta$, and is illustrated in Figure~\ref{fig:notidem}.
\end{proof}
\input{notidem}
\begin{rem}
Note that every loop in the sweeping case is
idempotent. Moreover, the $(L,C)$-factors are precisely the factors
intercepted by the loop $L$.
\end{rem}
\medskip
\subsection*{Pumping idempotent loops.}
To describe in a formal way the run obtained by pumping an idempotent loop,
we need to generalize the notion of anchor point in the two-way case
(the reader may compare this with the analogous definitions in
Section~\ref{sec:combinatorics-sweeping} for the sweeping case).
Intuitively, the anchor point of a component $C$ of an idempotent loop $L$
is the source location of the unique ${\ensuremath{\mathsf{LR}}}$- or ${\ensuremath{\mathsf{RL}}}$-factor intercepted by
$L$ that corresponds to an edge of $C$ (recall Lemma~\ref{lem:component2}):
\begin{defi}\label{def:anchor}
Let $C$ be a component of an idempotent loop $L = [x_1,x_2]$.
The \emph{anchor point} of $C$ inside $L$, denoted%
\footnote{In denoting the anchor point --- and similarly the trace --- of a component $C$
inside a loop $L$, we omit the annotation specifying $L$, since this is
often understood from the context.}
$\an{C}$, is either the location $(x_1,\max(C))$ or the location
$(x_2,\max(C))$, depending on whether $C$ is left-to-right or right-to-left.
\end{defi}
\noindent
We will usually depict anchor points by black circles (like, for instance, in Figure \ref{fig:many-components}).
It is also convenient to redefine the notation $\tr{\ell}$ for representing
an appropriate sequence of transitions associated with each anchor point
$\ell$ of an idempotent loop:
\begin{defi}\label{def:trace}
Let $C$ be a component of some idempotent loop $L$, let $\ell=\an{C}$
be the anchor point of $C$ inside $L$, and let
$i_0 \mapsto i_1 \mapsto i_2 \mapsto \dots \mapsto i_k \mapsto i_{k+1}$
be a cycle of $C$, where $i_0=i_{k+1}=\max(C)$.
For every $j=0,\dots,k$, further let $\beta_j$ be the factor intercepted
by $L$ that corresponds to the edge $i_j \mapsto i_{j+1}$ of $C$.
The \emph{trace} of $\ell$ inside $L$ is the run $\tr{\ell} = \beta_0 ~ \beta_1 ~ \cdots ~ \beta_k$.
\end{defi}
\noindent
Note that $\tr{\ell}$ is not necessarily a factor of the original run
$\rho$. However, $\tr{\ell}$ is indeed a run, since $L$ is a loop and
the factors $\b_i$ are concatenated according to the flow. As we will see below,
$\tr{\ell}$ will appear as (iterated) factor of the pumped version of $\rho$,
where the loop $L$ is iterated.
As an example, by referring again to the components $C_1,C_2,C_3$ of
Figure~\ref{fig:many-components}, we have the following traces:
$\tr{\an{C_1}}=\alpha_2\:\alpha_1\:\alpha_3$,
$\tr{\an{C_2}}=\beta_2\:\beta_1\:\beta_3$, and
$\tr{\an{C_3}}=\gamma_1$.
The next proposition shows the effect of pumping idempotent loops. The
reader can note the similarity with the sweeping case.
\begin{prop}\label{prop:pumping-twoway}
Let $L$ be an idempotent loop of $\rho$ with components $C_1,\dots,C_k$,
listed according to the order of their anchor points:
$\ell_1=\an{C_1} \mathrel{\lhd} \cdots \mathrel{\lhd} \ell_k=\an{C_k}$.
For all $n\in\bbN$, we have
\[
\ensuremath{\mathsf{pump}}_L^{n+1}(\rho) ~=~
\rho_0 ~ \tr{\ell_1}^n ~ \rho_1 ~ \cdots ~ \rho_{k-1} ~ \tr{\ell_k}^n ~ \rho_k
\]
where
\begin{itemize}
\item $\rho_0$ is the prefix of $\rho$ that ends at the first anchor point $\ell_1$,
\item $\rho_k$ is the suffix of $\rho$ that starts at the last anchor point $\ell_k$,
\item $\rho_i$ is the factor $\rho[\ell_i,\ell_{i+1}]$, for all $1\le i<k$.
\end{itemize}
\end{prop}
\begin{proof}
Along the proof we sometimes refer to Figure \ref{fig:many-components} to
ease the intuition of some definitions and arguments.
For example, in the left hand-side of Figure \ref{fig:many-components},
the run $\rho_0$ goes until the first location marked by a black circle;
the runs $\rho_1$ and $\rho_2$, resp., are between the first and the
second black dot, and the second and third black dot; finally, $\rho_3$
is the suffix starting at the last black dot. The pumped run
$\ensuremath{\mathsf{pump}}_L^{n+1}(\rho)$ for $n=2$ is depicted to the right of the figure.
Let $L=[x_1,x_2]$ be an idempotent loop and, for all $i=0,\dots,n$, let
$L'_i=[x'_i,x'_{i+1}]$ be the $i$-th copy of the loop $L$ in the pumped run
$\rho'=\ensuremath{\mathsf{pump}}_L^{n+1}(\rho)$, where $x'_i = x_1 + i\cdot (x_2-x_1)$
(the ``$0$-th copy of $L$'' is the loop $L$ itself).
Further let $L'=L'_0\cup\dots\cup L'_n = [x'_0,x'_{n+1}]$, that is,
$L'$ is the loop of $\rho'$ that spans across the $n+1$ occurrences of $L$.
As $L$ is idempotent, the loops $L'_0,\dots,L'_n$ and $L'$ have all the
same effect as $L$.
In particular, the components of $L'_0,\dots,L'_n$, and $L'$ are isomorphic
to and in same order as those of $L$.
We denote these components by $C_1,\dots,C_k$.
We let $\ell_j=\an{C_j}$ be the anchor point of each component $C_j$ inside
the loop $L$ of $\rho$
(these locations are marked by black dots in the left hand-side
of Figure \ref{fig:many-components}).
Similarly, we let $\ell'_{i,j}$ (resp.~$\ell'_j$)
be the anchor point of $C_j$ inside the loop $L'_i$ (resp.~$L'$).
From Definition \ref{def:anchor}, we have that either $\ell'_j=\ell'_{1,j}$ or $\ell'_j=\ell'_{n,j}$,
depending on whether $C_j$ is left-to-right or right-to-left (or, equally, on whether $j$ is odd or even).
Now, let us consider the factorization of the pumped run $\rho'$
induced by the locations $\ell'_{i,j}$, for all $i=0,\dots,n$ and for $j=1,\dots,k$
(these locations are marked by black dots in the right hand-side of the figure).
By construction, the prefix of $\rho'$ that ends at location $\ell'_{0,1}$
coincides with the prefix of $\rho$ that ends at $\ell_1$,
i.e.~$\rho_0$ in the statement of the proposition.
Similarly, the suffix of $\rho'$ that starts at location $\ell'_{n,k}$ is isomorphic
to the suffix of $\rho$ that starts at $\ell_k$, i.e. $\rho_k$ in the statement.
Moreover, for all odd (resp.~even) indices $j$, the factor
$\rho'[\ell'_{n,j},\ell'_{n,j+1}]$ (resp.~$\rho'[\ell_{0,j},\ell_{0,j+1}]$) is isomorphic
to $\rho[\ell_j,\ell_{j+1}]$, i.e.~the $\rho_j$ of the statement.
The remaining factors of $\rho'$ are those delimited by the pairs of locations
$\ell'_{i,j}$ and $\ell'_{i+1,j}$, for all $i=0,\dots,n-1$ and all $j=1,\dots,k$.
Consider one such factor $\rho'[\ell'_{i,j},\ell'_{i+1,j}]$,
and assume that the index $j$ is odd (the case of an even $j$ is similar).
This factor can be seen as a concatenation of factors intercepted by $L$
that correspond to edges of $C_j$ inside $L'_i$.
More precisely, $\rho'[\ell'_{i,j},\ell'_{i+1,j}]$ is obtained by concatenating
the unique ${\ensuremath{\mathsf{LR}}}$-factor of $C_j$ --- recall that by Lemma \ref{lem:component2}
there is exactly one such factor --- with an interleaving of the ${\ensuremath{\mathsf{LL}}}$-factors
and the $\RR$-factors of $C_j$.
As the components are the same for all $L'_i$'s and for $L$, this corresponds
precisely to the trace $\tr{\ell_j}$ (cf.~Definition \ref{def:trace}).
Now that we know that $\rho'[\ell'_{i,j},\ell'_{i+1,j}]$ is isomorphic to $\tr{\ell_j}$,
we can conclude that
$\rho'[\ell'_{0,j},\ell'_{n,j}] \:=\:
\rho'[\ell'_{0,j},\ell'_{1,j}] ~ \dots ~ \rho'[\ell'_{n-1,j},\ell'_{n,j}]$
is isomorphic to $\tr{\ell_j}^n$.
\end{proof}
\section*{Acknowledgment}
\noindent The authors wish to acknowledge fruitful discussions with
Emmanuel Filiot, Isma\"el Jecker and Sylvain Salvati. We also thank
the referees for their very careful reading and the suggestions for improvement.
\bibliographystyle{abbrv}
\section{One-way definability: overview}\label{sec:overview}
In this section we state our main result, which is the existence of an
elementary algorithm for checking whether a two-way transducer is
equivalent to some one-way transducer. We call such transducers
\emph{one-way definable}. Before stating our result, we
start with a few examples illustrating the reasons that may prevent a
transducer to be one-way definable.
\begin{exa}\label{ex:one-way-definability}
We consider two-way transducers that accept any input $u$
from a given regular language $R$ and produce as output the word $u\,u$.
We will argue how, depending on $R$, these transducers may or may not be one-way definable.
\begin{enumerate}
\item If $R=(a+b)^*$, then there is no equivalent one-way transducer,
as the output language is not regular.
If $R$ is finite, however, then the transduction mapping $u\in R$ to $u\,u$
can be implemented by a one-way transducer that stores the input $u$
(this requires at least as many states as the cardinality of $R$),
and outputs $u\,u$ at the end of the computation.
\item A special case of transduction with finite domain is obtained from the language
$R_n = \{ a_0 \, w_0 \, \cdots a_{2^n-1} \, w_{2^n-1} \::\: a_i\in\{a,b\} \}$,
where $n$ is a fixed natural number, the input alphabet is $\{a,b,0,1\}$,
and each $w_i$ is the binary encoding of the index $i=0,\dots,2^n-1$
(hence $w_i\in\{0,1\}^n$).
According to Proposition~\ref{prop:lower-bound} below, the transduction
mapping $u\in R_n$ to $u\,u$ can be implemented by a two-way transducer
of size $\cO(n^2)$, but every equivalent one-way transducer
has size (at least) doubly exponential in $n$.
\item Consider now the periodic language $R=(abc)^*$.
The function that maps $u\in R$ to $u\,u$ can be easily implemented by a
one-way transducer: it suffices to output alternatively $ab$, $ca$, $bc$
for each input letter, while checking that the input is in $R$.
\end{enumerate}
\end{exa}
\begin{exa}\label{ex:running}
We consider now a slightly more complicated transduction
that is defined on input words of the form $u_1 \:\#\: \cdots \:\#\: u_n$,
where each factor $u_i$ is over the alphabet $\Sigma=\{a,b,c\}$.
The associated output has the form
$w_1 \:\#\: \cdots \:\#\: w_n$, where each $w_i$
is either $u_i \: u_i$ or just $u_i$, depending on whether or not
$u_i\in (abc)^*$ and $u_{i+1}$ has even length, with $u_{n+1}=\emptystr$
by convention.
\noindent
The natural way to implement this transduction is by means
of a two-way transducer that performs multiple passes
on the factors of the input:
a first left-to-right pass is performed on
$u_i \,\#\, u_{i+1}$ to produce the first copy of $u_i$
and to check whether $u_i\in (abc)^*$ and $|u_{i+1}|$ is even; if so,
a second pass on $u_i$ is performed to produce
another copy of $u_i$.
\noindent
Observe however that the above transduction can also be implemented by a one-way
transducer, using non-determinism: when entering a factor $u_i$, the transducer
guesses whether or not $u_i\in (abc)^*$ and $|u_{i+1}|$ is even;
depending on this it outputs either $(abc\,abc)^{\frac{|u_i|}{3}}$
or $u_i$, and checks that the guess is correct while proceeding to
read the input.
\end{exa}
\noindent
\medskip
The main result of our paper is an elementary algorithm that decides
whether a functional transducer is one-way definable:
\begin{thm}\label{thm:main}
There is an algorithm that takes as input a functional two-way
transducer $\cT$ and outputs in $3\exptime$ a \emph{one-way} transducer
$\cT'$ satisfying the following properties:
\begin{enumerate}
\item $\cT'\subseteq\cT$,
\item $\dom(\cT')=\dom(\cT)$ if and only if $\cT$ is one-way definable.
\item $\dom(\cT')=\dom(\cT)$ can be checked in $2\expspace$.
\end{enumerate}
Moreover, if $\cT$ is a sweeping transducer, then $\cT'$ can be
constructed in $2\exptime$
and $\dom(\cT')=\dom(\cT)$ is decidable in $\expspace$.
\end{thm}
\begin{rem}
The transducer $\cT'$ constructed in the above theorem is
in a certain sense maximal: for every
$v \in \dom(\cT) ~\setminus~ \dom(\cT')$
and every one-way transducer $\cT''$ with
$\dom(\cT') \subseteq \dom(\cT'') \subseteq \dom(\cT)$ there exists
some witness input $v'$ obtained from $v$ such that
$v' \in \dom(\cT) ~\setminus~ \dom(\cT'')$. We will make this more
precise at the end of Section~\ref{sec:characterization-twoway}.
\end{rem}
We also provide a two-exponential lower bound for the size of the equivalent transducer.
As the lower bound is achieved by a sweeping transduction (even a deterministic one),
this gives a tight lower bound on the size of any one-way transducer equivalent to
some sweeping transducer.
\begin{prop}\label{prop:lower-bound}
\gabriele{I have added the fact that the sweeping transducers are even deterministic}%
There is a family $(f_n)_{n\in\bbN}$ of transductions such that
\begin{enumerate}
\item $f_n$ can be implemented by a deterministic sweeping transducer of size $\cO(n^2)$,
\item $f_n$ can be implemented by a one-way transducer,
\item every one-way transducer that implements $f_n$
has size $\Omega(2^{2^n})$.
\end{enumerate}
\end{prop}
\begin{proof}
The family of transformations is precisely the one described in
Example~\ref{ex:one-way-definability}~(2), where $f_n$ maps inputs of the form
$u = a_0 \, w_0 \, \cdots \, a_{2^n-1} ~ w_{2^n-1}$ to outputs of the form $u\,u$,
where $a_i\in\{a,b\}$ and $w_i\in\{0,1\}^n$ is the binary encoding of $i$.
A deterministic sweeping transducer implementing $f_n$ first checks that the
binary encodings $w_i$, for $i=0,\dots,2^n-1$, are correct.
This can be done with $n$ passes:
the $j$-th pass uses $\cO(n)$ states to check the correctness of
the $j$-th bits of the binary encodings.
Then, the sweeping transducer performs two additional passes to
copy the input twice. Overall, the sweeping transducer has size $\cO(n^2)$.
As already mentioned, every one-way transducer that implements $f_n$ needs
to remember input words $u$ of exponential length in order to output $u\,u$, which
roughly requires doubly exponentially many states.
A more formal argument providing a lower bound for the size of a one-way
transducer implementing $f_n$ goes as follows.
First of all, one observes that given a one-way transducer $\cT$,
the language of its outputs,
i.e., $L^{\text{out}}_\cT = \{ w \::\: (u,w)\in\sL(\cT) \text{ for
some } u\}$
is regular. More precisely, if $\cT$ has size $N$, then the language
$L^{\text{out}}_\cT$ is recognized by an automaton of size linear in $N$.
Indeed, while parsing $w$, the automaton can guess an input word $u$
and a run on $u$,
together with a factorization of $w$ in which the $i$-th
factor corresponds to the output of the transition
on the $i$-th letter of $u$. Basically, this requires
storing as control states the transition rules of $\cT$ and the
suffixes of outputs.
Now, suppose that the function $f_n$ is implemented by a one-way
transducer $\cT$ of size $N$. The language
$L^{\text{out}}_\cT = \{ u\,u \::\: u\in\dom(f_n) \}$ is then
recognized by an automaton of size $\cO(N)$.
Finally, we recall a result from \cite{GlaisterShallit96}, which shows that,
given a sequence of pairs of words $(u_i,v_i)$, for $i=1,\dots,M$,
every non-deterministic automaton that separates the language
$\{u_i\,v_i \::\: 1\le i\le M\}$ from the language
$\{u_i\,u_j \::\: 1\le i\neq j\le M\}$ must have at least $M$ states.
By applying this result to our language $L^{\text{out}}_\cT$, where
$u_i=v_i$ for all $i=1,\dots,M=2^{2^n}$, we get that $N$ must be at
least linear in $M$, and hence $N \in \Omega(2^{2^n})$.
\end{proof}
\bigskip
\gabriele{improved a bit, but we may do better}%
The proof of Theorem~\ref{thm:main} will be developed in the next sections.
The main idea is to decompose a run of the two-way transducer $\cT$
into factors that can be easily simulated in a one-way manner. We defer the
formal definition of such a decomposition to Section \ref{sec:characterization-sweeping},
while here we refer to it simply as a ``$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition'', where
$\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ is a suitable number computed from $\cT$.
The reader can refer to Figure~\ref{fig:decomposition-sweeping} on page
\pageref{fig:decomposition-sweeping}, which provides some intuitive
account of a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition for a sweeping run.
Roughly speaking,
each factor
of a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition either already looks like a run of a
one-way transducer (e.g.~the factors $D_1$ and $D_2$ of Figure~\ref{fig:decomposition-sweeping}),
or it produces a periodic output, where the period is bounded by $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$
(e.g.~the factor between $\ell_1$ and $\ell_2$).
Identifying factors that look like runs of one-way transducers is rather easy.
On the other hand, to identify factors with periodic outputs we rely on
a notion of ``inversion'' of a run. Again, we defer the formal definition
and the important combinatorial properties of inversions
to Section \ref{sec:combinatorics-sweeping}.
The reader can refer to Figure \ref{fig:inversion-sweeping}
on page \pageref{fig:inversion-sweeping}
for an example of an inversion of a run of a sweeping transducer.
Intuitively, this is a portion of run that is potentially difficult to simulate
in a one-way manner, due to existence of long factors of the output that are
generated following the opposite order of the input.
Finally, the complexity of the decision procedure in Theorem~\ref{thm:main}
is analyzed in Section~\ref{sec:complexity}.
\reviewOne[inline]{As neither inversions nor blocks are defined by Page 8, the presence of Theorem 3.6 is not as enlightening as one might hope. If the notion of inversion and their relevance is made quite clear at a glance of Page 11, the definition of run decomposition is not as intuitive. Hence, Theorem 3.6 cannot be appreciated before Page 17. It might be a good idea to give an intuition about inversion and diagonal/blocks before 3.6 (this solution being preferable, but made challenging by how involved the notion of decomposition seems to be in a first read).
\felix[inline]{added the references to the corresponding figures}%
\olivier[inline]{and Gabriele added some intuitions on decompositions}%
}%
\subsection*{Roadmap.}
In order to provide a roadmap of our proofs, we state below the equivalence
between the key properties related to one-way definability, inversions of runs,
and existence of decompositions:
\begin{thm}\label{thm:main2}
Given a functional two-way transducer $\cT$,
an integer $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$ can be computed such that the following are equivalent:
\begin{itemize}
\item[\PR1)] $\cT$ is one-way definable,
\item[\PR2)] for every successful run of $\cT$ and every inversion in it,
the output produced amid
the inversion has period at most $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$,
\item[\PR3)] every input has a successful run of $\cT$ that admits a $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition.
\end{itemize}
\end{thm}
As the notions of inversion and $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decomposition are simpler to formalize
for sweeping transducers, we will first prove the theorem assuming that $T$ is
a sweeping transducer; we will focus later on unrestricted two-way transducers.
Specifically, in Section~\ref{sec:combinatorics-sweeping} we introduce the basic combinatorics
on words and the key notion of inversion for a run of a sweeping transducer, and we prove the
implication \PR1 $\Rightarrow$ \PR2.
In Section~\ref{sec:characterization-sweeping} we define $\boldsymbol{B}} %{\cmax \cdot \hmax \cdot 2^{3\emax}$-decompositions of runs of
sweeping transducers, prove the implication \PR2 $\Rightarrow$ \PR3, and sketch a proof of
\PR3 $\Rightarrow$ \PR1 (as a matter of fact, this latter implication can be proved in a way
that is independent of whether $\cT$ is sweeping or not, which explains why we
only sketch the proof in the sweeping case).
Section~\ref{sec:loops-twoway} lays down the appropriate definitions
concerning loops of two-way transducers, and analyzes in detail the effect of
pumping special idempotent loops.
In Section~\ref{sec:combinatorics-twoway} we further develop the combinatorial arguments
that are used to prove the implication \PR1 $\Rightarrow$ \PR2 in the general case.
Finally, in Section~\ref{sec:characterization-twoway} we prove the implications
\PR2 $\Rightarrow$ \PR3 $\Rightarrow$ \PR1 in the general setting,
and show how to decide the condition $\dom(\cT')=\dom(\cT)$ of Theorem \ref{thm:main}.
\section{Preliminaries}\label{sec:preliminaries}
We start with some basic notations and definitions for two-way
automata and transducers. We assume that every input word $w=a_1\cdots a_n$
has two special delimiting symbols $a_1 = \vdash$
and $a_n = \dashv$ that do not occur elsewhere: $a_i \notin \{\vdash,\dashv\}$
for all $i=2,\dots,n-1$.
A \emph{two-way automaton} is a tuple
$\cA=(Q,\Sigma,\vdash,\dashv,\Delta,I,F)$, where
\begin{itemize}
\item $Q$ is a finite set of states,
\item $\Sigma$ is a finite alphabet (including $\vdash, \dashv$),
\item $\Delta \subseteq Q \times \Sigma \times Q \times \set{\ensuremath{\mathsf{left}},\ensuremath{\mathsf{right}}}$
is a transition relation,
\item $I,F\subseteq Q$ are sets of initial and final states, respectively.
\end{itemize}
By convention, left transitions on $\vdash$ are not
allowed; on the other hand, right transitions on $\dashv$ are allowed, but, as we will see,
they will necessarily appear as last transitions of successful runs.
A \emph{configuration} of $\cA$ has the form $u\,q\,v$,
with $uv \in \vdash\, \S^* \, \dashv$
and $q \in Q$. A configuration $u\,q\,v$ represents the
situation where the current state of $\cA$ is $q$ and its head reads the first
symbol of $v$ (on input $uv$). If $(q,a,q',\ensuremath{\mathsf{right}}) \in \Delta$,
then there is a transition from any configuration of the form
$u\,q\,av$ to the configuration $ua\,q'\,v$; we denote such a transition
by $u\,q\,av \trans{a,\ensuremath{\mathsf{right}}} ua\,q'\,v$.
Similarly, if $(q,a,q',\ensuremath{\mathsf{left}}) \in \Delta$,
then there is a transition from any configuration of the form
$ub\,q\,av$ to the configuration $u\,q'\,bav$,
denoted as $ub\,q\,av \trans{a,\ensuremath{\mathsf{left}}} u\,q'\,bav$.
A \emph{run} on $w$
is a sequence of transitions.
It is \emph{successful} if it starts in an initial configuration
$q\, w$, with $q\in I$, and ends in a final configuration $w\,q'$,
with $q' \in F$ --- note that this latter configuration does not allow
additional transitions. The \emph{language} of $\cA$ is the set of words
that admit a successful run of $\cA$.
The definition of \emph{two-way transducers} is similar to that of two-way automata,
with the only difference that now there is an additional output alphabet $\Gamma$ and the transition
relation is a finite subset of $Q \times \Sigma \times \Gamma^* \times Q \times \{\ensuremath{\mathsf{left}},\ensuremath{\mathsf{right}}\}$,
which associates an output over $\Gamma$ with each transition of the underlying two-way automaton.
For a two-way transducer $\cT=(Q,\Sigma,\vdash,\dashv,\Gamma,\Delta,I,F)$,
we have a transition of the form $ub\,q\,av \trans{a,d \, \mid w} u'\,q'\,v'$, outputting $w$,
whenever $(q,a,w,q',d)\in\Delta$ and either $u'=uba ~\wedge~ v'=v$ or
$u'=u ~\wedge~ v'=bav$, depending on whether $d=\ensuremath{\mathsf{right}}$ or $d=\ensuremath{\mathsf{left}}$.
The \emph{output} associated with a run
$\rho = u_1\,q_1\,v_1 \trans{a_1,d_1 \mid w_1}<\qquad> \dots
\trans{a_n,d_n \mid w_n}<\qquad> u_{n+1}\,q_{n+1}\,v_{n+1}$
of $\cT$ is the word $\out{\rho} = w_1\cdots w_n$. A transducer $\cT$
defines a relation $\sL(\cT)$
\anca{I was wondering if we ever use this notation, but
I found it on page 10... Maybe it is the only place...
consisting of all pairs $(u,w)$ such that
$w=\out{\rho}$, for some successful run $\rho$ on $u$.
The \emph{domain} of $\cT$, denoted $\dom(\cT)$,
is the set of input words that have a successful run.
For transducers $\cT,\cT'$, we write $\cT' \subseteq \cT$
to mean that $\dom(\cT') \subseteq \dom(\cT)$ and the transductions
computed by $\cT,\cT'$ coincide on $\dom(\cT)$.
A transducer is called \emph{one-way} if it does not contain transition
rules of the form $(q,a,w,q',\ensuremath{\mathsf{left}})$. It is called \emph{sweeping} if
it can perform reversals only at the borders of the input word.
A transducer that is equivalent to some one-way
(resp.~sweeping) transducer is called \emph{one-way definable}
(resp.~\emph{sweeping definable}).
The \emph{size} of a transducer takes into
account both the state space and the transition relation, and thus
includes the length of the output of each transition.
\medskip
\subsection*{Crossing sequences.}
The first notion that we use throughout the paper is that of crossing sequence.
We follow the convenient presentation from \cite{HU79}, which appeals to a
graphical representation of runs of a two-way transducer, where each configuration
is seen as a point (location) in a two-dimensional space.
Let $u=a_1\cdots a_n$ be an input word (recall that $a_1=\vdash$ and $a_n=\dashv$)
and let $\rho$ be a run of a two-way automaton (or transducer) on $u$.
The \emph{positions} of $\rho$ are the numbers from $0$ to $n$, corresponding
to ``cuts'' between two consecutive letters of the input. For example,
position $0$ is just before the first letter $a_1$,
position $n$ is just after the last letter $a_n$,
and any other position $x$, with $1\le x<n$, is between
the letters $a_x$ and $a_{x+1}$.
We will denote by $u[x_1,x_2]$ the factor of $u$ between
the positions $x_1$ and $x_2$ (both included).
\olivier{added}%
\gabriele{Please check this reformulation in terms of configurations}%
Each configuration $u\,q\,v$ of a two-way run $\r$
has a specific position associated with it. For technical reasons
we need to distinguish leftward and rightward transitions. If the configuration $u\,q\,v$
is the target of a rightward transition
then the position associated with $u\,q\,v$ is $x=|u|$.
The same definition also applies when $u\,q\,v$ is the initial configuration,
for which we have $u=\emptystr$ and $x=|u|=0$.
Otherwise, if $u\,q\,v$ is the target of a leftward transition
then the position associated with $u\,q\,v$ is $x=|u|+1$. Note that in
both cases, the letter read by the transition leading to $u\,q\,v$ is
$a_x$.
\anca{rewritten a bit}%
A \emph{location} of $\rho$ is any pair $(x,y)$,
where $x$ is the position of some configuration of $\rho$ and
$y$ is any non-negative integer for which there are at least
$y+1$ configurations in $\rho$ with the same position $x$.
The second component $y$ of a location is called \emph{level}.
For example, in Figure \ref{fig:run} we represent a possible
run of a two-way automaton together with its locations $(0,0)$,
$(1,0)$, $(2,0)$, $(2,1)$, etc.
Each location is naturally associated with a configuration, and thus a state.
Formally, we say that $q$ is the \emph{state at location $\ell=(x,y)$} in $\rho$,
and we denote this by writing $\rho(\ell)=q$,
if the $(y+1)$-th configuration of $\rho$ with position $x$ has state $q$.
Finally, we define the \emph{crossing sequence} of $\rho$ at position $x$
as the tuple $\rho|x=(q_0,\dots,q_h)$, where the $q_y$'s are all the states
at locations of the form $(x,y)$, for $y=0,\dots,h$.
\input{run}
As shown in Figure~\ref{fig:run}, a two-way run can be represented
as an path between locations annotated by the associated states.
We observe in particular that if a location $(x,y)$ is the target
of a rightward transition, then this transition has read the symbol $a_x$;
similarly, if $(x,y)$ is the target of a leftward transition, then
the transition has read the symbol $a_{x+1}$.
We also observe that, in any successful run $\rho$, every crossing
sequence has odd length and every rightward (resp.~leftward) transition
reaches a location with even (resp.~odd) level.
In particular, we can identify four types of transitions between locations,
depending on the parities of the levels (the reader may refer again to
Figure~\ref{fig:run}):
\begin{center}
\begin{tikzpicture}[baseline=0,scale=0.9]
\draw (-1,1.75) node (node1) {$\phantom{\!+\!1}~(x,2y)$};
\draw (3,1.75) node (node2) {$(x\!+\!1,2y')~\phantom{\!+\!1}$};
\draw (-1,0) node (node3) {$(x,2y\!+\!1)$};
\draw (3,0) node (node4) {$(x\!+\!1,2y'\!+\!1)$};
\draw (9,1.75) node (node5) {$\phantom{\!+\!1}~(x,2y)$};
\draw (9,2.5) node (node6) {$(x,2y\!+\!1)$};
\draw (9,0) node (node7) {$(x,2y\!+\!1)$};
\draw (9,0.75) node (node8) {$(x,2y\!+\!2)$};
\draw (node1) edge [->] node [above=-0.05, scale=0.9] {\small $a_{x+1},\ensuremath{\mathsf{right}}$} (node2);
\draw (node4) edge [->] node [above=-0.05, scale=0.9] {\small $a_{x+1},\ensuremath{\mathsf{left}}$} (node3);
\draw (node5.east) edge [->, out=0, in=0, looseness=2]
node [right=0, scale=0.9] {\small $a_{x+1},\ensuremath{\mathsf{left}}$} (node6.east);
\draw (node7.west) edge [->, out=180, in=180, looseness=2]
node [left=0, scale=0.9] {\small $a_x,\ensuremath{\mathsf{right}}$} (node8.west);
\end{tikzpicture}
\vspace{1mm}
\end{center}
Hereafter, we will identify runs with the corresponding annotated paths between locations.
It is also convenient to define a total order $\mathrel{\unlhd}$ on the locations of a run $\rho$
by letting $\ell_1 \mathrel{\unlhd} \ell_2$ if $\ell_2$ is reachable from $\ell_1$ by following the
path described by $\rho$ --- the order $\mathrel{\unlhd}$ on locations is called
\emph{run order}.
Given two locations $\ell_1 \mathrel{\unlhd} \ell_2$ of a run $\rho$, we write $\rho[\ell_1,\ell_2]$
for the factor of the run that starts in $\ell_1$ and ends in $\ell_2$. Note that the latter
is also a run and hence the notation $\outb{\rho[\ell_1,\ell_2]}$ is permitted.
\gabriele{Parity of levels needs to be preserved}%
We will often reason with factors of runs up to isomorphism, that is, modulo
shifting the coordinates of their locations while preserving the parity of the levels.
Of course, when the last location of (a factor of) a run $\rho_1$
coincides with the first location of (another factor of) a run $\rho_2$,
then $\rho_1$ and $\rho_2$ can be concatenated to form a longer run,
denoted by $\rho_1 \rho_2$.
\olivier{added, see review 2 below}%
\gabriele{rephrased a bit, and I think corrected a problem with negative numbers.
But do we really need to say this?}%
This operation can be performed even if the two locations,
say $(x_1,y_1)$ and $(x_2,y_2)$, are different, provided that
$y_1=y_2\bmod 2$: in this case it suffices to shift the positions
(resp.~levels) of the locations of the first run $\rho_1$ by $x_2$ (resp.~$y_2$)
and, similarly, the positions (resp.~levels) of the locations of the second
run $\rho_2$ by $x_1$ (resp.~$y_1$).
\felix{it's not really enough, with our current definition the first location of $\rho_2$ is $(x,0)$ is $x$ is the position of the cut. So we cannot even concatenate $\rho_1$ and $\rho_2$. I have an alternate paragraph where the locations of the subruns use the levels of the original run.}%
\gabriele{I don't understand your comment Felix. Does it still apply?}%
\reviewTwo[inline]{
There seems to be some problems in you definition of crossing sequences.
First, according to your definition, the state at location $(x,y)$ is the state reached by the $(y+1)$-th transition that crosses x. In order for this to be consistent with Figure 1, you should swap u and u' in your definition of a position crossed by a transition.
\olivier[inline]{Correct, there was a mistake there! Check my fix above.}%
Second, since, following your definition, the state at a given location always is the target of a transition, the first state of the run has no location (it should be added explicitly).
\olivier[inline]{Correct, also fixed}%
Third, not allowing more freedom in the second components of the locations seems to cause some problems while considering subruns.
Let me explain what I mean with an example.
Let us suppose that we split the run $\rho$ of your Figure 1 into two runs $\rho_1$ and $\rho_2$, where $\rho_2$ is composed of the last three transitions.
Then the locations of the states of the run $\rho_1$ (considered as a whole run) are equal to the locations of the same states considered as part of $\rho$.
However, the locations of the states of the run $\rho_2$ (considered as a whole run) are (1,0), (2,0), (3,0), (4,0), whereas in $\rho$, the locations of the corresponding states are (1,2), (2,2), (3,0), (4,0).
As a consequence, $\rho_1$ and $\rho_2$ can not be concatenated to reform $\rho$, since to do so we need that “the last location of [\dots] $\rho_1$ coincides with the first location of [\dots] $\rho_2$” (p.5 l.15).
\olivier[inline]{Added a sentence to explicit}%
Finally (and this one is not a real problem), you introduce precise notions, but sometimes do not use them in the following parts of the paper: for example, p.4, “never uses a left transition from position x” corresponds to “no transition crosses position x”. Why not use the latter ?
\olivier[inline]{``no left transition on $\vdash$'' comes before the definition of ``crosses'' and is more explicit, so I would not change.}%
}%
\anca{there is no ``crosses'' anymore, right?}%
\begin{wrapfigure}{r}{5.1cm}
\input{intercepted-factors}
\end{wrapfigure}
\medskip
\subsection*{Intercepted factors.}
For simplicity, we will denote by $\omega$
the maximal position of the input word.
We will consider \emph{intervals of positions} of
the form $I=[x_1,x_2]$, with $0 \le x_1<x_2 \le \omega$.
The \emph{containment} relation $\subseteq$ on intervals is
defined expected, as $[x_3,x_4] \subseteq [x_1,x_2]$ if $x_1\le x_3 < x_4\le x_2$.
A \emph{factor} of a run $\rho$ is a contiguous subsequence of $\rho$.
A factor of $\rho$ \emph{intercepted} by an interval
$I=[x_1,x_2]$ is a maximal factor that visits only
positions $x\in I$, and never uses a left transition from
position $x_1$ or a right transition from position $x_2$.
Figure~\ref{fig:intercepted-factors} on the right shows
the factors $\alpha,\beta,\gamma,\delta,\zeta$ intercepted
by an interval $I$.
The numbers that annotate the endpoints of the factors
represent their levels.
\medskip
\subsection*{Functionality.}
We say that a transducer is \emph{functional} (equivalently, one-valued, or single-valued)
if for each input $u$, at most one output $w$ can be
produced by any possible successful run on $u$.
Of course, every deterministic transducer is functional, while the opposite
implication fails in general.
To the best of our knowledge determining the precise complexity of the determinization
of a two-way transducer (whenever an equivalent deterministic one-way transducer exists)
is still open. From classical bounds on determinization of finite automata, we only know
that the size of a determinized transducer may be exponential in the worst-case.
One solution to this question, which is probably
not the most efficient one, is to
check one-way definability: if an equivalent one-way transducer is
constructed, one can check in $\ptime$ if it can be
determinized~\cite{cho77,weberklemm95,bealcarton02}.
The following result, proven in Section \ref{sec:complexity},
is the reason to consider only functional transducers:
{
\renewcommand{\thethm}{\ref{prop:undecidability}}
\begin{prop}[
The one-way definability problem for \emph{non-functional}
sweeping transducers is undecidable.
\end{prop}
}
Unless otherwise stated, hereafter we tacitly assume that all transducers
are functional. Note that functionality is a decidable property, as shown below.
The proof of this result is similar to the decidability proof for the equivalence problem
of deterministic two-way transducers~\cite{Gurari80}, as it reduces the functionality
problem to the reachability problem of a $1$-counter automaton of exponential size.
A matching $\pspace$ lower bound follows by a reduction of the emptiness problem
for the intersection of finite-state automata \cite{Kozen77}.
\begin{prop}\label{prop:functionality-pspace}
Functionality of two-way transducers can be decided in polynomial
space. This problem is $\pspace$-hard already for sweeping transducers.
\end{prop}
A (successful) run of a two-way transducer is called \emph{normalized}
if it never visits two locations with the same position, the same
state, and both either at even or at odd level. It is easy to see that
if a successful run $\rho$ of a \emph{functional} transducer visits two locations
$\ell_1=(x,y)$ and $\ell_2=(x,y')$ with the same state
$\rho(\ell_1)=\rho(\ell_2)$ and with $y=y' \mod 2$, then the output
produced by $\rho$ between $\ell_1$ and $\ell_2$ is empty:
otherwise, by repeating the non-empty factor $\rho[\ell_1,\ell_2]$, we would
contradict functionality. So, by deleting the factor
$\rho[\ell_1,\ell_2]$ we obtain a successful run that produces the
same output. Iterating this operation leads to an equivalent,
normalized run.
Normalized runs are interesting because their crossing sequences have
bounded length (at most ${\boldsymbol{H}}} %h_{\mathsf{max}}} = 2|Q|-1$). Throughout the paper we
will implicitly assume that successful runs are normalized. The
latter property can be easily checked on crossing sequences.
| {'timestamp': '2018-12-07T02:13:01', 'yymm': '1706', 'arxiv_id': '1706.01668', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01668'} | arxiv |
\section*{Introduction}
The Brain Computer Interface (BCI) community today's priority is to assure the system robustness and its usability. It is quite a difficult task, considering the abundant inter and intra-subject variability. The major obstacle lies in the large spectrum of sources of variability during BCI usage, ranging from (i) imperfect recording conditions e.g. environmental noise, humidity, static electricity etc. \cite{Maby2016} to (ii) the fluctuations in the user’s psycho-physiological states, due to e.g., fatigue, motivation or attention \cite{JeunetPredictingPatterns}. There are yet more improvements to be done for a system ready to be easily used in real life conditions \cite{Wolpaw2002BraincomputerControl}.
BCI systems showed quite an improvement with adaptive methods, i.e. adapting the machine to the changeable brain signals of the user during a BCI task. Currently, adaptation is mainly done by using different signal processing techniques without including human factors \cite{Makeig2012}. However, if the users do not understand how to manipulate a BCI system, or are not motivated to make necessary effort for such manipulation, then they are not able to produce stable and distinct EEG patterns. In that case, no signal processing algorithm would be able to decode such signals \cite{Lotte2013}. Thus, for designing a BCI, ignoring certain information about the users, e.g. their skills, cognitive abilities and motivations, may represent one of the major drawbacks for the advancement of BCIs.
A potential improvement in BCI is to acknowledge how difficult it can be to learn to produce mental commands (a very atypical skill) without a proper feedback about the progress one has made.
In every discipline, a certain feedback on ones performance is necessary to enable learning, as shown in the earliest work about Operant Conditioning and Reinforcement Learning \cite{Skinner1938}. Notably, this question was studied by behaviorists for decades on animals, using rewards e.g. food, as extrinsic motivation to promote desired behavior. As humans have more complex cognitive functions, a more effective way to promote learning is in a social context, with a tutor who would prepare and adapt a task according to the student's competences. The tutor's feedback and well organized tasks would lead the disciple to gradually build up knowledge and skills, to feel confident and to be intrinsically motivated, or to be in the Zone of Proximal Development (ZPD)\cite{Vygotsky1978}. Derived from cognitive developmental theories \cite{Vygotsky1978} and refined through instructional design theories \cite{Keller1987,Malone1987}, intrinsic motivation is to be a substantial element for learning. Thus, it is important to carefully design the feedback if we want to encourage learning and optimal performance.
Unfortunately, for long this was not the case in BCI community, as BCI systems were improved mostly with novel machine learning techniques \cite{Makeig2012}. The result of neglecting the feedback design led to often monotonous and repetitive content, further discouraging the user, and leading to reduced skill and impaired performance \cite{Cho2004a,Kleih2010}, thus highly affecting the system's accuracy. Potentially, instructional design theories could add a missing piece for designing optimal BCI feedback \cite{Lotte2013}.
There have been extensive literature describing higher BCI user performance and experience using game-like feedback \cite{Ron-angevin2009BraincomputerTechniques,Scherer2015}.
Immersive and game-like environments attract users' attention, induce intrinsic motivation, thus promote learning and performance with less effort and frustration -- for a review see \cite{Lumsden2016}.
Even using extrinsic motivation such as monetary reward can encourage users to perform better \cite{Kleih2010}. Some studies showed that user's belief on their performance with biased feedback induced motivation and thus higher performance \cite{Barbero2010BiasedInterfaces.}. Hence, sometimes it is worth to trade the system's accuracy to the perceived, subjective user's feeling of control.
Keeping that into account, a way to promote efficiency and motivation while respecting the principles of instructional design leads us to the Theory of Flow introduced by Csikszentmihalyi in \cite{Csikszentmihalyi1975}. He was fascinated by the capacity of artists to be in a state of enjoyment while effortlessly focused on a task so immersive that one looses the perception of time, of self and of basic human needs (hunger, sleep etc.). When in the flow state, people are absorbed in an activity, their focused awareness is narrowed, they lose self-consciousness, and they feel in control of their environment. As a consequence, they often perform to the best of their capacity with a sense of automaticity and a high level of confidence. Studies report flow experience in numerous activities including rock climbing, dancing, chess, reading, etc. \cite{Csikszentmihalyi1975,Csikszentmihalyi1989}.
Another pertinent element which encourages intrinsic motivation and is showed to be in relation with flow, is music \cite{Croom2015}. Recent studies showed that music has an ergogenic effect on humans, i.e. physical enhancement while performing a physical activity \cite{Anshel1978}. In \cite{Karageorghis2010ErgogenicExercise} was reported that Haile Gebrselassie, an athlete who broke 10 000m world record in 1998, paced his running on music he was listening to, i.e. synchronous music. There is evidence that synchronous music, as a strong motivational effect, directly enhances physical performance \cite{Simpson2006} while asynchronous (background) music induces flow when accomplishing a task \cite{Pates2003EffectsPlayers,Pain2011Pre-CompetitionSoccer}. Most of all, background music with medium tempo (speed) has showed highest impact on flow \cite{Karageorghis2008PsychologicalExercise}.
To be in the state of flow, a task needs to have the following requirements:
\begin{itemize}
\item \textbf{To be immersive}, with attractive visual/audio stimuli to maintain the user's attention. The principle of preserving flow with aesthetically pleasing and ergonomic content have been researched largely in the context of human computer interaction \cite{Webster1993} and Internet navigation, e.g. e-learning \cite{Esteban-millat2014ModellingEnvironment};
\item \textbf{To adapt} the task difficulty with the user’s skills, i.e. an easy task might be boring as a difficult one might be frustrating, hence finding the golden middle is the way of feeling in control and keeping the motivation. Such difficulty adaptations were found in games, to keep the gamer in flow \cite{Bulitko2012FlowModel}, or during teaching activities \cite{Clement2015Multi-ArmedJEDM} to improve learning and keep the student in the ZPD \cite{Vygotsky1978}.
\item \textbf{To have clear goals and immediate feedback / rewards}; aspired for educational purposes \cite{Heutte2016}, so that learning becomes an enjoying and autotelic (self-rewarding) process \cite{Ninaus2015GameTask}.
\end{itemize}
Therefore, in order to improve BCI users' performance, learning, and experience, it seems promising to try to guide them towards the state of flow. This is what we start to explore in this paper.
In particular, our research question is: \textit{Does flow improve BCI user performance?} We chose to manipulate flow in a ludic BCI environment with 2 factors: 1) Feedback adaptation, i.e. perceived difficulty adaptation to the user skills, and 2) Asynchronous music to encourage the user. Thus, our following hypotheses are:
\textbf{H1.} Adapting the feedback improves flow, thus improves performance.
\textbf{H2.} Asynchronous music improves flow, thus improves performance.
In consonance with the Flow theory, we presented a motor imagery (MI) BCI task in an open-source 3D video game (TuxRacer \footnote{https://extremetuxracer.sourceforge.io/}).
We investigated the effects of these two flow factors on user's flow state as well as on user performance, i.e. classification accuracy.
\section*{Materials and Methods}
\emph{Manipulating Flow:} In order to fulfill Flow theory requirements, we considered the following:
\begin{itemize}
\item \textbf{An immersive and ludic environment}, here the \textbf{TuxRacer} video game was adjusted for a 2-class Motor Imagery (MI) BCI. The game depicts a ski course, in which a virtual penguin, Tux -- controlled by the player -- slides through various slopes and has to catch as much fish as possible. With the BCI adjustments, Tux was maneuvered with kinesthetic imagination of either left or right hand, see Figure \ref{fig:tux_score}.
\item \textbf{The adaptation} of the feedback bias, i.e. users were made to believe they performed differently from what they really did, in order to be in the flow state. If they had poor performances they were positively biased to a higher degree than if they had fairly good performances. However, when the performances were too good, then the users were slightly negatively biased, so that the task would not seem too easy. This was achieved by adaptively increasing or decreasing the classifier output, i.e. the decoding of MI commands would seem different from what it was in reality.
\item \textbf{Asynchronous music} consisted of 3 songs with medium tempo (120-160 beats per min), played in the background during the BCI task. 15 persons voted on social media for songs which would motivate them while playing TuxRacer. The selected songs are "Epic" by Alexey Anisimov (113s), "Confident \& Successful" by MFYM (168s) and "Acoustic Corporation" by OAP (132s), all available on Jamendo\footnote{https://www.jamendo.com/}.
\item \textbf{Clear goals with immediate audio and visual feedback}, i.e. to collect maximum points by manipulating Tux to move either left or right to catch fish.
The feedback is clear -- once caught, the fish disappears with a brief audio stimuli stressing that the target was reached.
\end{itemize}
\begin{figure}[!htbp]
\centering
\includegraphics[width=0.7\columnwidth]{img/tux_score.jpg}
\caption{\small{Participant using MI commands to play TuxRacer, e.g. imagining right hand movement to catch fish on the right.}~\label{fig:tux_score}}
\end{figure}
\hspace{0.5cm}\emph{Experimental design:} We created a 2 (\textit{adapt} \textit{vs} \textit{no-adapt}) by 2 (\textit{music} \textit{vs} \textit{no-music}) mixed factorial design, i.e. a between-subject adaptation factor, and a within-subject background music factor.
\hspace{0.5cm}\emph{Protocol:} 28 healthy subjects, naive to BCI, participated in the \textasciitilde2 hour-long experiment (5 women, mean age: 25.23 years, SD: 2.98). The first 30 minutes consisted of (i) signing a consent form, (ii) installing of a 32 channels Brain Product LiveAmp EEG, (iii) instructions given to the user and preparation, (iv) \textasciitilde10 minutes system calibration (40 trials of 7s) with the standard 2-class MI BCI (left/right hand) Graz protocol \cite{PfurtschellerMotorCommunication}. In the Graz protocol, the user was presented with arrows indicating the left or right side, to instruct the participant to imagine a left or right hand movement. Afterwards, each participant took part in 2 counterbalanced conditions of \textasciitilde 20mins each with TuxRacer, (a) with and (b) without background music. 3 songs were repeated to accompany the music condition of 6 runs (1 song per 2 runs). Each condition comprised of $6\times 3$min-runs, with 22 trials per run (11 for left and 11 for right hand, in random order), see Figure \ref{fig:protocool}. Each trial consisted in performing left/right hand MI to move Tux in order to catch fish on the left/right of the ski course, respectively. There were 7 closely arranged fish per trial, to be caught within 3 seconds. During 5-second long breaks between trials, the BCI controls were disabled so that Tux would return in a neutral position (center on the ski course) and participants could rest. The study was approved by the Inria ethics committee, COERLE (Comité opérationnel d'évaluation des risques légaux et éthiques).
\begin{figure}[!htbp]
\centering
\includegraphics[width=1\columnwidth]{img/protocool3.jpg}
\caption{\small{The experiment started with \textasciitilde 10min calibration \cite{PfurtschellerMotorCommunication}, followed by 2 conditions: either with or without music -- 6 runs of 3 minutes per condition. The adapt group received an adapted (biased) feedback, contrary to the no-adapt group. Adaptation is symbolized by the magnet. Both groups were asked to fill EduFlow2 \cite{Heutte2016} questionnaires for the flow state assessment and BMRI \cite{Karageorghis1999} questionnaire for investigating the quality of music.}~\label{fig:protocool}}
\end{figure}
\hspace{0.5cm}\emph{Questionnaires:} Prior to the experiment, a Swedish Flow Proneness Questionnaire (SFPQ) \cite{Ullen2011} was sent to subjects to fill in at home. This 5 points Likert scale questionnaire measures flow proneness -- flow as a person's trait. To estimate to which extent users were in the state of flow, they were asked to fill in the EduFlow2 questionnaire \cite{Heutte2016} after each condition (\textit{music} or \textit{no-music}). The EduFlow2 measures flow state through 4 dimensions: cognitive control, immersion, selflessness and autotelism -- a self rewarding experience. To have a measure of the quality and motivation of the selected music, the participants also filled a dedicated questionnaire, the Brunel Music Rating Inventory (BMRI) \cite{Karageorghis1999}.
\hspace{0.5cm}\emph{Signal processing}: The acquired EEG was band-bass filtered with a Butterworth temporal filter between 8 and 30Hz. We computed the band power using a 1s time window sliding every 1/16th s. We used a set of Common Spatial Patterns (CSP) spatial filters to reduce the 32 original channels down to 6 "virtual" channels that maximize the differences between the two class motor imagery \cite{Ramoser2000}. A probabilistic SVM (Support Vector Machine) with a linear kernel was used to classify the data between left and right classes (regularization parameter C = 1). That way, the output of the SVM between 0 and 1, indicated a class recognized with a certain degree of confidence, e.g. 1 means that the right- hand class was recognized with high confidence.
\hspace{0.5cm}\emph{Performances}: The online performance corresponds to the peak accuracy of the classifier that controlled the video game, i.e. the highest classification accuracy over all trials' time windows. The offline performance was computed afterwards with a 4-folds cross validation, i.e. regarding only the data recorded during the interaction with the video game for training and testing. In other words, data recorded during the Graz protocol was not used to compute offline performances. We used a LDA (Linear Discriminant Analysis) for the offline classification, since it is less computationally demanding. Both for online and offline analyses, one accuracy score was computed over the music / no\_music condition (i.e. 6 runs of 22 trials).
\hspace{0.5cm}\emph{Game controls}: The TuxRacer game was controlled \textit{via} a virtual joystick. When a right hand movement was recognized (SVM output of 1) the virtual joystick was tilted toward the right at its maximum angle, 45 degrees. Inversely, when a left hand movement was recognized (SVM output of 0), the virtual joystick was tilted 45 degrees to the left. Between 0 and 1, the values of the virtual joystick were mapped linearly (from minus 45 degrees to 45 degrees). Thanks to this simple virtual joystick, we did not need to modify the usual input commands to the complex BCI ones in the game. Basically, the virtual joystick can act as or replace the usual computer controls, such as keys on the keyboard. Our freely available source code\footnote{https://github.com/conphyture/LSL2joy} could be used to control any (linux) joystick-based game with a BCI.
\hspace{0.5cm}\emph{Game modifications}: We designed the BCI TuxRacer game so that its timing and structure mirror that of the Graz motor imagery BCI protocol \cite{PfurtschellerMotorCommunication}, but in an immersive and motivating environment. We modified the shape of the terrain, curving it alike a bobsleigh course. Consequently, by the force of gravity, Tux would slide back to the middle of the screen between trials, when the commands were deactivated. Between trials, Tux would still be skiing towards the following trial with constant speed, enabling the users to see the next fish.
We fixed the position of the fish on the ski course edges, so that the targets were equidistant from Tux at the beginning of each trial, i.e. same distance from the center of the ski course. The reason for this is to enable the user to provide equivalent potential effort for both MI classes (left/right hand). By assuring a constant speed for Tux, a race (run) always lasted 3 minutes.
\hspace{0.5cm}\emph{Game adaptation}: The \textit{no\_adapt} group was the first to participate in the experiment. Thanks to the fact that there was a correlation between the user's flow state and the performances in the control group, we empirically calculated a performance level (classifier accuracy) for which users felt most in flow. We used that value as an attractor or a quasi-flow value to lure Tux in. At each instant ($1/16^{th}$sec sliding window) we would retrieve the classifier output and add to it a value which would push Tux a half way towards our attractor. This value was determined intuitively from Flow theory, to keep the difficulty in the "golden middle". Consequently, when user performances were very poor, Tux was boosted to a higher extent towards the attractor, i.e. in this case users were helped (positively biased) more than when their performances were fairly good. However, when the performances were too good, the perceived performances were deteriorated (feedback was negatively biased). The "flow" function would then be: $f(s_i) = s_i + \frac{(a-s_i)}{2} , s_i \in [-1,1] $, where $s_i$ stands for user skill, which is given by the classifier output and scaled to ease the computation (-1 for left, 1 for right), for all instants $i$ within 22 trials, ($i =1,..16Hz\times 66s$). Finally, $a = 0.79$ denotes the attractor for the right class ($a = -0.79$ for left class).
\section*{Results}
The normal distribution of all the data was verified using a Shapiro-Wilk normality test.
\hspace{0.5cm}\emph{Flow-factor's influence on EduFlow2}: We tested the effects of our mixed factorial design on each of the 4 dimensions measured by the EduFlow2 questionnaires using a Markov Chain Monte Carlo (MCMC) method \cite{Hadfield2010b}. The MCMC showed a significant difference between \emph{adapt} and \emph{no-adapt} along the $1^{st}$ dimension (p < 0.01). Participants in the adapt group reported higher cognitive control (mean: 5.38, SD: 0.84) compared to the no-adapt group (mean: 4.49, SD: 0.83), see Figure \ref{fig:eduflow}.
There was no significant difference between groups regarding their flow trait, measured with SFPQ (1-way ANOVA, p = 0.25). ANCOVA tests showed that it was not a confounding factor for neither EduFlow2 nor performances.
There was no difference between groups regarding BMRI (1-way ANOVA, p = 0.53). Mean score: 15.80, SD: 4.14 -- maximum score with the questionnaire we distributed: 25.3. There was no correlation between BMRI scores and flow (p = 0.54) nor with user performance, online (p = 0.78) or offline (p = 0.20).
\begin{figure}[!htbp]
\centering
\includegraphics[width=0.9\columnwidth]{img/eduflow_D1.pdf}
\caption{\small {The EduFlow2 score (7 Likert scale) for the first dimension (cognitive control) depending on the between-subject factor \textit{adapt} and on the within-subject factor \textit{music}. Users were in higher cognitive control in the adapt condition (left).}~\label{fig:eduflow}}
\end{figure}
\hspace{0.5cm}\emph{Flow-factor's influence on performance}: The question whether our conditions could directly improve the online performances was tested with a 2-way ANOVA. There was a significant interaction between music and adaptation (\textit{p<0.05}). Music had a significant effect on the online performance (mean with music: 0.62, SD: 0.09, mean with no\_music: 0.65, SD: 0.11, \textit{p<0.05}) but adaptation had not (\textit{p=0.08}), see Figure \ref{fig:perfs}. A post-hoc Tukey analysis reveals that the one significant interaction occurs in the no\_adapt condition, between music (mean: 0.64, SD: 0.11) and no\_music (mean: 0.68, SD: 0.13) (\textit{p<0.001}).
\begin{figure}[!htbp]
\centering
\includegraphics[width=0.9\columnwidth]{img/perfs.pdf}
\caption{\small {The peak performance during the completion of the video game depending on the between-subject factor \textit{adapt} and on the within-subject factor \textit{music}. In the no\_adapt condition (right), users had better online performances without music.}~\label{fig:perfs}}
\end{figure}
\hspace{0.5cm}\emph{Correlation between EduFlow2 \& performance}:
There was no correlation between flow (mean of all the EduFlow2 dimensions) and online performance (\textit{p=0.12}), however there was a positive correlation between flow and offline performance (Pearson coefficient: 0.35, \textit{p<0.01}), see Figure \ref{fig:correlation}. More precisely, offline performances are significantly correlated with two dimensions of flow: the $2^{nd}$ -- immersion (p<0.01, Pearson coefficient: 0.38) and the $4^{th}$ -- autotelism, (p<0.05, Pearson coefficient: 0.32). We corrected the p-values for multiple comparisons with false discovery rate \cite{Noble2009}.
\begin{figure}[!htbp]
\centering
\includegraphics[width=0.9\columnwidth]{img/correlation.pdf}
\caption{\small {Positive correlation between EduFLow2 scores (mean of 4D) and offline performance (Pearson coef:0.35, \textit{p<0.01}).}~\label{fig:correlation}}
\end{figure}
\section*{Discussion}
\textbf{H1. validated}: Adapting the task difficulty to users skill improved one dimension of flow state, cognitive control. People who faced a challenge better suited to their skill felt more in control. Thus, taking into account user's predispositions could lead to a greater user experience.
\textbf{H2. in contradiction}: Not only the presence of a background music had no effect on flow, but it deteriorated the online performance. Therefore, this result contradicts our second hypothesis.
\hspace{0.5cm}\emph{Music pace mismatch}. As opposed to what we expected, we could not directly improve performance by manipulating the flow factors we chose (adaptation and music). The latter could be explained by the songs we chose, since the motivational qualities of the music (measured with the BMRI questionnaire) were not very high and not correlated to any dimension of flow. Instead of picking those songs from the public domain, users may have been more motivated should they have chosen their own music. The decrease of performance in the music condition might come from the mismatch between the rhythm of the music and the pace of the game, i.e. with the pace of the imagined hands movements. Indeed, some users shared informally that they were imagining playing their musical instrument as MI commands and that the songs further disturbed their pace.
\hspace{0.5cm}\emph{Different training environment.} There was no correlation between flow state (EduFlow2) and online performances. That could be due to the differences between the calibration environment (Graz protocol) and the game, e.g. the first being minimalistic and the latter a 3D video-game. Moreover, as the calibration was done without music, maybe the performances online were better without it because the EEG signals might have changed, therefore the classifier could not recognize them anymore.
\hspace{0.5cm}\emph{Flow increases with performances.} These later assumptions are strengthened by the fact that there was a positive correlation between flow and the offline performances, when only game data was taken into consideration. The state of flow was then positively correlated with users' performance: the feeling of immersion and the autotelic experience (i.e. the completion of the task was self-rewarding) increased with the offline performance. Hence, not only encouraging a state of flow would produce BCIs more pleasing to the users, but it might also benefit the accuracy of the system. We still have to identify the direction of the correlation though: does flow state increases performances or do good performances increase flow state?
Overall, the discrepancy in our results could stress that flow is a complex phenomenon, and however beneficial to obtaining better BCI, the emerging interaction between its components should be more thoroughly investigated.
\section*{Conclusion}
By investigating means to improve BCI user performance and usability through instructional design theories, we came across the Flow Theory. This theory, which describes an optimal user state, showed to improve performances in many fields. We hypothesized that the state of flow could benefit BCIs. In a MI BCI task, we manipulated flow by adapting the perceived difficulty and by adding a background music. We used an immersive environment, a 3D video game, TuxRacer (the modification can be found online \footnote{https://github.com/jelenaLis/tux-modifs)}).
Our main findings show that the adaptation increases one of the dimensions of flow -- cognitive control, and that user's offline performances are positively correlated with flow. In the future we could attempt to better suit the adaptation of the task to the users: it could be biased adaptively over time, across several sessions, following the progress of the user. We could also try to account for the amount of effort that the user puts into the completion of the task in order to better comprehend such complex phenomena. For example, measuring workload could facilitate the assessment of the challenge that users are facing and computationally predict the state of flow\cite{Bulitko2012FlowModel}.
According to the literature, we chose asynchronous music with medium tempo to follow the BCI task. Unexpectedly, the background music impeded the performances of the user. This result stresses the importance of the choice of music to accompany a task. One explanation could lie in the very BCI paradigm we chose. Indeed, a motor imagery task might share similarities with actual physical activity, where it had been shown that \textit{synchronous} music could effectively stimulate the sensory-motor cortex\cite{Hardy2013}. Hence, a future work would consist in synchronizing music to game's cues (e.g. trials sequences) or to user's motor imagery pace. Such music, generated in real time, might enhance the flow state and intrinsic motivation. Concurrently, we should verify if the user is musically educated, as in some cases users imagined playing instruments as MI commands, and because musicians elicit different brain activity in motor areas\cite{Luo2012}.
Flow is not only a promising research direction to improve BCI systems, but it raises a new question: should we put all our efforts in favoring the machine accuracy, or rather the human subjective experience?
\smallbreak
\emph{Acknowledgements}: This work was supported by the French National Research Agency with the REBEL project and grant ANR-15-CE23-0013-01. The authors would like to thank Jean Heute for his help with the EduFlow questionaire.
\setlength{\bibitemsep}{0pt}
\printbibliography
\end{document}
| {'timestamp': '2017-06-07T02:05:53', 'yymm': '1706', 'arxiv_id': '1706.01728', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01728'} | arxiv |
\section{Introduction}
Deep Learning systems have surpassed other algorithms and even humans at several tasks~\cite{Bengio:2013,Krizhevsky:2012,Mnih:2013,Silver:2016}. While their applications continue to grow, deep learning systems are still considered black-box optimization methods. One of the most vital features behind their success is their ability to extract relevant yet minimal information as it progresses into deeper and deeper layers \cite{Tishby:2000}. This is an extension of \emph{Rate Coding Theory}~\cite{Berger:1971} presented as the \emph{Information Bottleneck} principle~\cite{Tishby:2000,Tishby:2015}. The information bottleneck principle has been primarily focused on systems that are (a)~feedforward, and (b)~in an open-loop, decoupled from their environment.
Neuroscientists, on the other hand, have long been studying the principles behind encoding and representation of environmental information in neural activity using principles of information theory~\cite{Borst:1999} and rate distortion theory~\cite{Simoncelli:2001}. Continuous variables from the environment are encoded as discrete spikes in the brain, which are then decoded to produce smooth continuous movement. Due to experimental limitations, an informational analysis of a closed-loop brain-body-environment behaviour system is not yet feasible.
We take a radically different approach to understanding information flow in a behaviorally-functional agent. We artificially evolve embodied agents controlled by recurrent spiking neural networks to perform a task. For this paper, we focus on a non-Markovian version of the classical pole balancing task. Pole balancing has been explored quite extensively as a benchmark for control using neural networks~\cite{Pasemann:1997,Onat:1998}. With continuous states and actions, this task serves as an ideal setting to study the transformation of the continuous input information into spikes and then back to continuous action. While the typical task is Markovian, and thus too trivial for an informational analysis, it can easily be transformed into a non-Markovian task by making the available information to the agent limited. Our approach to pole balancing incorporates an agent-centric ``visual'' interface to the pole. Therefore, information that is typically available, like the pole's angle and angular velocity, the agent's position and velocity, are not fed directly to the network. Ultimately, the minimal nature of the task makes it tractable for an investigation of a recurrent network in a closed-loop task.
The parameters of the recurrent spiking neural network that balances the pole were optimized using an evolutionary algorithm. Evolving neural networks as opposed to hand-designing them allows maximum flexibility for exploring the parameter space. While evolutionary algorithms have been very commonly used in several fields~\cite{Jong:2006}, recently, they have been proven to be efficient for optimizing deep neural networks as well~\cite{Miikkulainen:2017,Salimans:2017}. Moreover, due to the stochastic nature of the optimization, running the algorithm several times provides us with an ensemble of solutions that solve the problem. This allows the analysis of not just one solution but several to evaluate consistency of results.
The paper is organized as follows. In the first section we report on the agent, task, optimization technique, and analysis method. The section that follows presents an informational analysis for the best and top performing agents. In the last section we summarize the results.
\section{Methods}
\begin{figure}
\centering
\includegraphics[height=3.5cm]{SetupV1.pdf}
\caption{Task set up and agent design. [A]~The agent (gray circle) moves left/right along the horizontal axis (gray arrows) sensing the pole (black rod) through the seven vision rays (color dashed lines), with a range of $36$ degrees. [B]~Sensory rays have a linearly diffused receptive field from their centers and overlap at the edges with the receptive fields of adjacent rays. [C]~The agent has $7$ vision sensors (black) connected to two recurrent spiking interneurons (red) connected to two motor units (gray).}
\label{fig:setUp}
\end{figure}
{\it Agent design.}
The agent lives in a 1-dimensional world with the pole attached to its center. Seven equidistant rays of ``vision'' with overlapping receptive fields spanning 36\degree provide it with sensory stimuli (Fig.~\ref{fig:setUp}A,B). The control network of the agent has three primary components: sensory units, spiking interneurons, and motor units. There is one sensory units per ray, which merely pass on the signal received from the rays. Sensory units are fully connected to $N$ interneurons (here $N=2$), modeled by Izhikevich spiking neuron model \cite{Izhikevich:2003}. The model has 4 parameters per neuron and is governed by a two-dimensional system of ordinary differential equations~\cite{Izhikevich:2003}. Interneurons are recurrently connected (Fig.~\ref{fig:setUp}C). Therefore, each interneuron receives weighted input from each sensory unit, $S_i$, and from other spiking interneurons, $I_i$, as follows:
\begin{equation}
S_i+I_i = \sum_{j=1}^7 w_{ji}^s s_j + \sum_{j=1}^N w_{ji}^i o_i
\end{equation}
\noindent where $s_j$ is the input at the $j^{\text{\tiny th}}$ sensory unit, $w_{ji}^s$ is the strength of the connection from the $j^{\text{\tiny th}}$ sensory unit to the $i^{\text{\tiny th}}$ spiking interneuron, $w_{ji}^i$ is the strength of the recurrent connections from the $j^{\text{\tiny th}}$ to the $i^{\text{\tiny th}}$ spiking neuron, and $o_i$ is the output of the neuron. The sign of all outgoing connections from an interneuron depends on its excitatory or inhibitory nature, as identified by a binary parameter. Finally, the layer of interneurons feeds into the two motor neurons, that has the following state equation:
\begin{equation}
\tau_m \dot{m_i} = - m_i + \sum_{j=1}^N w_{ji}^m \bar{o}_j \quad
i = 1,2
\end{equation}
\begin{equation}
\bar{o}_j(t)= \frac{1}{h_j} \sum_{k=0}^{h_j} o_j(t-k)
\end{equation}
\noindent where $m_i$ represents the motor neuron state, $w_{ji}^m$ is the strength of the connection from the $j^{\text{\tiny th}}$ spiking interneuron to the $i^{\text{\tiny th}}$ motor neuron, $\bar{o}_j$ represents the firing rate code, the moving average over a window of length $h_j$ for the output of spiking interneuron $j$. Finally, the difference in output between the motor neurons results in a net force that acts upon the agent, moving it along the track. The network was simulated using Euler integration with step size 0.01.
{\it Pole Balancing Task Design.}
The agent can move left/right to balance a pole for as long as possible. The pole-balancing task was implemented based on published descriptions~\cite{Barto:1983}. The force from the agent, computed as the difference between motor unit outputs, affects the angular acceleration of the pole and acceleration of the agent. The physical parameters such as mass, length and coefficient of friction were all set as per the same reference. While typically pole-balancers receive as input the angle of the pole ($\theta$), its angular velocity ($\omega$), the agent's position ($x$) and velocity ($v$), our implementation was modified to only sense the pole through the sensory rays.
{\it Evolutionary Algorithm.}
The network was optimized using a real valued evolutionary algorithm. A solution was encoded by 38 parameters, including the intrinsic parameters of the Izhikevich neurons, the neuron-specific size of the window for estimating rate code, all connection weights (sensory-interneuron, interneuron-interneuron, interneuron-motor), and the time constant, bias and gain for the motor units. Parameters were constrained to certain ranges: connection strengths $\in$ $[-50,50]$; motor unit biases $\in$ $[-4,4]$; time-constants $\in$ $[1,2]$. The range of intrinsic parameters and the polarity of the outgoing weights from the inter-neuron depended on a binary inhibitory/excitatory neuron flag parameter in the genotype~\cite{Izhikevich:2003}. The population consisted of 100 individuals.
{\it Fitness Function.}
Performance was estimated by averaging over 16 trials, starting at pole angles $\theta_0$ between $\pm12\degree$, in increments of 3\degree, and two initial angular velocities, $\omega_0=\pm0.001$. The fitness function to be maximized was $f=(\sum_{t=1}^{T} cos(\theta_t))/T$, where $T=500s$ is the maximum duration of the run. The pole was considered balanced if it was within the sensory range of the agent. Also, the track length was fixed at $45$ units, beyond which the trial was terminated.
{\it Mutual Information.}
The amount of information contained in one variable about another was estimated using Mutual Information (MI). We quantified the information that neurons contain about pole angle ($\theta$), angular velocity ($\omega$), agent position ($x$) and agent velocity ($v$) by calculating their probability distributions (using a binning method with each bin of width 0.01):
\begin{equation}
MI(N,X) = \sum_{n \in N}\sum_{x \in X} p(x,n)log\frac{p(x,n)}{p(x) p(n)}
\end{equation}
\section{Results}
{\it Performance of evolutionary optimization.}
While pole balancing is a well-known benchmark, it was also a relatively easy task to optimize. The evolutionary algorithm found fairly good solutions (around 75\% performance) at the very first random draw of the population. Fig.~\ref{fig:bestAgent}A shows the performance of the best agent in every generation over time. Out of the $100$ evolutionary runs, $99$ converged to over $99\%$ fitness with only two spiking interneurons.
\begin{figure}
\centering
\includegraphics[height=3.5cm]{bestAgentV2.pdf}
\caption{Optimization performance. [A]~Fitness of the best individual in the population vs. generations for 100 evolutionary runs. Best run in blue, top 10 in light blue and the rest in gray. [B]~Network structure of the best agent. The width of the edges indicate the magnitude of the weights and are also color coded for polarity. The sensory units in black are identified as S1-S7, spiking interneurons N1,N2 in red and motor units M1,M2 in grey. [C]~Generalization performance over a broader and finely grained set of initial conditions that were tested during evolution (marked by cross marks).}
\label{fig:bestAgent}
\end{figure}
\begin{figure}
\centering
\includegraphics[height=11.5cm]{bestInfoArchV2.pdf}
\caption{Behavior of the best agent and one of its trials in detail. [A]~Angle of the pole over time on 16 trials. One of the trials ($\theta_0=-6\degree$ and $\omega_0=0.001$) is highlighted and explored further. [B]~Information flowchart: from sensory input rays through the spiking inter-neuron layer, composed of 3 levels of processing (neuron potential, spiking activity and rate code), and then the motor units. [C]~A sample trace for each of the components corresponding to each box in B from the trial highlighted in A. Each color in the first figure is matched with the sensory rays in Fig.~\ref{fig:setUp}. The blue and orange colors indicate interneurons 1 and 2 respectively. The green and brown traces corresponds to the left and right motor neurons respectively. [D]~Mutual Information about the pole angle ($\theta$) for the highlighted trial for each of the components. [E]~Mutual information about $\theta$ in the neuron potential ($V$). A comparison between the trial-by-trial MI vs. the total MI across trials.}
\label{fig:bestInfoArch}
\end{figure}
\begin{figure}
\centering
\includegraphics[height=3.2cm]{miSigsV2.pdf}
\caption{MI about the four environmental variables: pole angle ($\theta$), pole angular velocity($\omega$), agent position ($x$) and agent velocity ($v$) in the network elements: neuron potentials ($V$), rate coded outputs of neurons ($R$), and motor unit states ($M$). Paired samples t-test yielded highly significant ($p\ll0.05$) differences between the information contained about $\theta, \omega$ and $v$ in $V$ versus $R$ and $R$ versus $M$.}
\label{fig:vrSignificance}
\end{figure}
{\it Network structure and performance of the best agent.}
The network structure of the best agent from the $100$ runs is shown in Fig.~\ref{fig:bestAgent}B.
The behavioral traces of this agent on the 16 trials specified in the previous section are shown in Fig.~\ref{fig:bestInfoArch}A. This agent achieved a fitness of $99.4\%$. To test for generalization, its performance was evaluated on a finer and broader range of conditions, post-optimization (Fig.~\ref{fig:bestAgent}C): initial pole angle $\theta_0$ in the range $[-45,45]$ and initial pole angular velocity $\omega_0$ in the range $[-0.01,0.01]$. As can be seen, the agent generalizes well within and outside the region it was evolved on. Note that $\theta_0$ that are beyond $18\degree$ on either side are beyond the range of the sensory rays.
{\it Encoding of environmental variables.}
The different network elements that manipulate the input are shown in Fig.~\ref{fig:bestInfoArch}B. Sensory signals first act on neurons' potential. The neuron fires based on dynamics in its potential, which is then interpreted by its rate. The motor units then convert this discrete spike rate to smooth continuous movement. Note that a single neuron has three levels of informational content - continuous valued potential, binary spikes, and discrete spike rate codes. Fig.~\ref{fig:bestInfoArch}C shows traces for the highlighted trial in Fig.~\ref{fig:bestInfoArch}A of the best agent. Although $\theta$ is the most directly available information, unlike the standard practice of directly providing it, the sensory rays provide an agent-centric perspective of $\theta$. MI between each of the network elements with $\theta$, see Fig.~\ref{fig:bestInfoArch}D, revealed that internal potential of neurons have relatively more information about $\theta$ than the spike rate and so does the motor units. Albeit only for one trial in one agent, this shows that the bottleneck does not always become narrow in control tasks. MI also reveals that indirect encoding of $\omega$, $x$ and $v$ all happen in the very first stage of the network, neuron potential (black bars in Fig.~\ref{fig:vrSignificance}). This can be attributed to the recurrent nature of connections between the interneurons and also their rather complex non-linear internal dynamics.
{\it Analysis of the Information Bottleneck.}
All available information, as shown by MI in $V$, is not necessarily used in controlling movement, as shown by relatively lower information in $R$. To further study the bottleneck, we compared the amount of information contained in neuron potentials, $V$, versus the rate coded outputs of the neurons, $R$. Note that the spikes themselves do not have any information about the environment but, in fact, encode them in its rate. For each of the environmental variables a paired samples t-test was conducted with a significance threshold of $p<0.05$. This revealed that there is a significant drop in the amount of information between $V$ and $R$ (Fig.~\ref{fig:vrSignificance}) robustly across the top ten agents. This can be attributed to the loss due to the discretization of information available in $V$ as spikes. However, the information in $R$ is sufficient to perform the behavior with great accuracy and so this is in fact an efficient encoding of information. The minimal yet relevant information that is encoded in $R$ is interpreted by the motor units. They integrate $R$ from the interneurons and their outputs directly impact $\theta$, $\omega$, $x$ and $v$ and so this is where a deviation from the IB principle is expected. Statistical analyses of the MI between $R$ and the motor units state, $M$, using the paired samples t-test yielded highly significant ($p\ll0.05$) increase in information about all environmental variables in $M$ (Fig.~\ref{fig:vrSignificance}). This shows that the IB for control tasks is not always a filtering of information but is rather filtering followed by an expansion at the control layer.
{\it Context sensitive information encoding.}
From previous analysis, we know that components of the network encode information about the environment. But what information do they encode? Typically, when a neuron is said to encode information about a feature of the environment it is thought to be a consistent, context-independent code. To explore this idea further, we compared the MI the neuron potential has about the pole's angle $I(V,\theta)$ on a trial by trial basis to the information that same neuron has across all trials about the same feature of the environment on the best agent (Fig.~\ref{fig:bestInfoArch}E) and the top 10 agents. A one-sample t-test of the combined MI with the distribution of trial-by-trial MI values yielded a highly significant difference ($p\ll0.05$). This means that the combined information is significantly lower than trial-by-trial information, and therefore that encoding is highly context-dependent across all evolved pole-balancers.
\section{Discussion}
In this paper, we have presented results from an information theoretic analysis of recurrent spiking neural networks that were evolved to perform a continuous control task: agent-centric non-Markovian pole balancing. Our results can be summarized as follows. First, networks with as few as two spiking neurons could be evolved to perform this task. Second, through the use of MI, we show that the spiking network encoded environmental variables of interest that were directly and indirectly available. Third, we show that the information bottleneck from the neuron potential to its firing rate is an efficient filtering/compression, which was followed by an increase in information at the control layer on account of their causal effect on the environment. This is a phenomenon that we expect to arise in control tasks in general, and plan to explore further with different tasks and types of networks. Perhaps, this can develop into an optimization method for neural network control. Finally, we show that the information encoded in the spiking neurons vary across trials, causing the across-trial combined information to be significantly lower. This can mean either that the same stimuli are encoded in different ways (redundancy) or that different stimuli are mapped on to the same encoding (generalization) or both. This warrants further analysis to understand the encoding in more detail and more interestingly, to understand how the context helps disambiguate the generalized representations during a trial.
| {'timestamp': '2017-06-07T02:08:11', 'yymm': '1706', 'arxiv_id': '1706.01831', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01831'} | arxiv |
\section{Introduction}\label{s:intro}
Hexahedral meshes are often preferred to tetrahedral meshes as they offer
excellent numerical properties: faster assembly\,\oldcite{remacle2016gpu}, orthogonal
grids in the wall-normal direction for wall-bounded
flows, high accuracy in solid mechanics,
both for statics\,\oldcite{wang2004back} and dynamics,
or for quasi-incompressible materials\,\oldcite{benzley1995comparison}
\footnote{In many references, the
accuracy of linear hexahedra is shown to be equivalent to the
accuracy of quadratic tetrahedra with the same mesh density. Note
that quadratic tetrahedra have one extra node per edge of the mesh,
which multiplies the number of degrees of freedom by $7$.}.
Generating hex-meshes is however still an open problem for general 3D domains.
Finite element meshes should ideally fill the 3D domain in a conformal
fashion but should also respect some size and quality constraints in
order to be suitable for finite element formulations.
The validity of elements is usually the most important constraint and can be checked
by verifying the local injectivity of their mapping; in the usual finite
element language, one should check the positivity of the Jacobian determinant.
While checking the validity of a linear tetrahedron just consists in ensuring
its volume positivity, checking the validity of a linear hexahedron is not trivial.
Testing hexahedron validity is of particular interest when generating hex meshes
with an indirect method\,\oldcite{baudouin2014frontal,botella2016indirect,%
sokolov2016hexahedral}. In these methods, a huge set of hexahedral elements whose
cardinality can be as high as 40 times the number of vertices of the mesh is
computed\,\oldcite{pellerin2017}. Computing the validity robustly and
rapidly is then essential for the efficiency of these methods.
Many algorithms have been proposed in the literature for checking the validity of
hexahedra, however they do not provide
any strong guarantees except method of\,\oldcite{johnen2013geometrical}.
In this paper, we particularize this method for the linear hexahedron and propose
an efficient and simple implementation.
\paragraph{Previous works}
\citet{knupp1990invertibility} has shown that the positivity of the
Jacobian determinant at the $8$ corners of a linear hexahedron,
as well as on its edges, is not sufficient to ensure its validity.
He conjectured that any hexahedra having a positive Jacobian determinant on its
boundary is valid.
However, the Jacobian determinant on the faces are biquadratic functions;
verifying their positivity is complex and, to our knowledge, no practical
algorithm has been presented.
Some authors have proposed to check the validity by ensuring the
positivity of sets of tetrahedra constructed from the $8$ nodes of the
hexahedron\,\oldcite{ivanenko1999harmonic,grandy1999conservative,ushakova2001conditions,vavasis2003bernstein,shangyou2005subtetrabedral}.
The number of tetrahedra ranges from $8$ to $64$.
\citet{ushakova2011nondegeneracy} compiled and empirically studied these tests.
It is known that the positivity of the $8$ corner tetrahedra is a necessary
condition\,\oldcite{knupp1990invertibility,ivanenko1999harmonic}.
\citet{ushakova2011nondegeneracy} showed that none of the tests that consider less
than $58$ tetrahedral volumes constitute a sufficient condition.
The volume of the hexahedron is sometimes used in commercial
packages\,\oldcite{ushakova2001conditions}. It can be expressed from the volume of $10$
tetrahedra. It is a poor test alone but gives a sharper necessary condition when
combined with the $8$ corner tetrahedra.
Another original method for checking the validity of linear hexahedra has been
proposed by \citet{knabner2003conditions}.
The Jacobian determinant of the hexahedron is expanded into the monomial basis.
Positivity conditions are derived from the monomial coefficients of respectively
a quadratic one-dimensional polynomial, a biquadratic polynomial and a triquadratic
polynomial. The latter enables to check the positivity of the Jacobian determinant
of the hexahedron.
However, it is needed to linearize inequalities containing a square root which
implies this approach to be only a sufficient condition.
A parameter provided by the user allows to determine the precision of this linearization.
A method for checking the validity of curved finite element of any type has
been proposed by \citet{johnen2013geometrical}.
This method consists in expanding the Jacobian determinant into the B\'ezier basis
of order 2. Thanks to the convex hull property of B\'ezier expansion, the minimum of
these coefficients gives a lower bound of the Jacobian determinant. Moreover, the
minimum of specific coefficients gives an upper bound of the minimum of the
Jacobian determinant. These bounds are subsequently sharpened by ``subdividing''
in a recursive and adaptive manner which allows to compute the minimum of the
Jacobian determinant with any prescribed tolerance.
This method can be employed for the validity of the linear hexahedron since
it is a particular case of the curved hexahedron.
\paragraph{Contribution}
To the best of our knowledge, the method\,\oldcite{johnen2013geometrical} is the
only method to robustly check the validity of linear hexahedra. However,
the general framework used for curved elements is not well-adapted for an efficient
computation of the validity of one specific type of element. In this work, this
method is optimized for to the specific case of the linear hexahedron.
We start by introducing the validity of the linear quadrangle and hexahedron
(\S\ref{s:validity}), and the B\'ezier expansion of the Jacobian determinant
(\S\ref{s:bezier}). Then, two substantial improvements are presented:
we show that only $20$ quantities have to be computed
instead of $27$ (\S\ref{s:only20}) and that those quantities can be computed as the
volume of tetrahedra (\S\ref{s:tet2lag}).
Finally, we present the complete algorithm (\S\ref{s:algo}) and demonstrate that
this new algorithm is robust and efficient (\S\ref{s:results}).
The C++ code implementing the algorithm will be available in
Gmsh\,\oldcite{geuzaine2009gmsh} (\url{www.gmsh.info}).
\section{Validity of finite elements}\label{s:validity}
Let us consider a $d$-dimensional physical linear finite element which is
geometrically defined by a set of
$N$ points $\n k\in\R^d,\ k = 1, \dots , \Np$, called nodes, and a set of Lagrange shape
functions $\L{}k(\vec\xi): \Omega_{ref}\subset\R^d\to\R,\ k = 1, \dots , \Np$. These polynomial
functions allow to map a reference unit element, represented by the domain of
definition $\Omega_{ref}$, to the physical element (see Figure~\ref{f:mapping}):
\beqn{e:mapping}
\vec x(\vec\xi) = \sum_{k=1}^{\Np}\L{}{k}(\vec\xi)\,\n k.
\end{equation}
\begin{figure}[ht!]
\begin{center}
\setlength\figwidth{.5\textwidth}
\setlength\figheight{.3\textwidth}
\input{figures/tikz/mapping.tex}
\caption{Mapping between the reference and the physical hexahedron.}
\label{f:mapping}
\end{center}
\end{figure}
The Jacobian matrix of this mapping, denoted
$\jac: \Omega_{ref} \to \R^{d\times d} : \vec\xi \mapsto \jac(\vec\xi)$,
is by definition the matrix of the first-order partial derivatives of $\vec x$,
\emph{i.e.}\xspace $\Par{\jac}_{ij} = \frac{\partial\sx_i}{\partial\sxr_j}$.
Since the mapping is polynomial, each element of $\jac$ is polynomial.
To be well-defined, finite element formulations require the mapping between
the reference and any physical element to be injective\,\oldcite{frey1978some}. This
imposes to the determinant of the Jacobian matrix (the Jacobian determinant)
to be non-zero for every point of $\Omega_{ref}$\,\oldcite{zhang2005bijectivity} and
we conventionally impose it to be strictly positive.
A physical element is valid if its
Jacobian determinant is positive everywhere on the reference domain,
otherwise it is invalid. The validity of linear simplices
(\emph{i.e.}\xspace linear triangles and tetrahedra) is easy to check: since the Jacobian
determinant is constant for these elements, it is sufficient to compute it
at any point $\vec\xi\in\Omega_{ref}$ and verify that it is positive.
In practice, it is equivalent to compute the signed area of linear triangle since it is
equal to the Jacobian determinant divided by 2. Similarly, the signed volume of linear
tetrahedra is equal to the Jacobian determinant divided by 6 and can equivalently be
computed to check their validity.
The Jacobian determinant of linear quadrangles and hexahedra, on the
other hand,
is not constant over their reference domain. It is necessary to compute the
minimum of their Jacobian determinant in order to check their validity.
The two following sections are dedicated to explaining how to achieve it.
\subsection{Validity control of a linear quadrangle}
In finite element codes, the domain of definition $\Omega_{ref}$ of the quadrangular
element is taken as the domain $[-1,1]\times[-1,1]$ due to better numerical properties.
This choice has no impact on the validity criterion and we will
consider $\Omega_{ref}\equiv[0,1]\times[0,1]$ in this paper for clarity reasons.
Consequently, the Lagrange shape functions for a linear quadrangle reads:
\[
\left\{
\begin{array}{lcc}
\L{}1(\xra, \xrb) = &(1-\xra)&(1-\xrb)\\
\L{}2(\xra, \xrb) = &\xra&(1-\xrb)\\
\L{}3(\xra, \xrb) = &\xra&\xrb\\
\L{}4(\xra, \xrb) = &(1-\xra)&\phantom.\xrb.
\end{array}
\right.
\]
This implies that the mapping of a quadrangle (cf. equation~\eqref{e:mapping}),
is bilinear. Let $(x_k, y_k)$
denotes the coordinates of the node $\n k$, and let us write shortly any difference
$(x_j-x_i)$ as $\xx ij$ (and similarly for the $y$ coordinate). The partial derivative
of $x$ with respect to $\xra$ is noted $\da x$. The Jacobian matrix is given by:
\
\jac(\xra, \xrb)=\Par{
\begin{array}{cc}
\da x & \db x\\
\da y & \db y
\end{array}
}=\Par{
\begin{array}{c@{\ \ \ }c}
\xx12\,(1-\xrb)+\xx43\,\xrb & \xx14\,(1-\xra)+\xx23\,\xra\\
\yy12\,(1-\xrb)+\yy43\,\xrb & \yy14\,(1-\xra)+\yy23\,\xra
\end{array}
}
\
and the Jacobian determinant is given by:
\begin{align}\label{e:determinant2D}
\begin{split}
\detJ(\xra, \xrb) = \det\jac = &\phantom{{}+{}}\L{}1(\xra, \xrb)\,\Cro{\xx12\,\yy14-\yy12\,\xx14}
+\L{}2(\xra, \xrb)\,\Cro{\xx12\,\yy23-\yy12\,\xx23}\\
&+\L{}3(\xra, \xrb)\,\Cro{\xx43\,\yy14-\yy43\,\xx14}
+\L{}4(\xra, \xrb)\,\Cro{\xx43\,\yy23-\yy43\,\xx23}\\
= &\phantom{{}+{}}\sum_{k=1}^4\L{}k(\xra, \xrb)\,\detJ_k
\end{split}
\end{align}
where the coefficient $\detJ_k$ is the value taken by the Jacobian determinant
at corner $k$. As a consequence, the Jacobian determinant is also bilinear and its minimum
is reached at one of the four corners. The validity control of linear quadrangle thus
consists in computing the Jacobian determinant at each corner and in verifying that none
is negative. An equivalent, but computationally more expensive test would be
to compute the angles of the four corners and to check if they lie between $0\degree$
and $180\degree$.
The four quantities to compute (either the angles or the coefficients $\detJ_k$) are not
linearly independent. Indeed, concerning the angles, the existing linear relation is
that the four angles of a quadrangle sum up to $360\degree$. Now, from
equation~\eqref{e:determinant2D}, we can deduce that the Jacobian
determinant at \emph{e.g.}\xspace the first corner is equal to the third component of the vector
$\v12\times\v14$, where $\v ij=\n j-\n i=(\xx ij, \yy ij)$ is the vector that goes
from node $i$ to node $j$. But, for two vectors $\vec a$
and $\vec b$ of the $xy$-plane, it is well-known that the value of the third component
of their cross product $\vec a\times\vec b$ is equal to the signed area of the
parallelogram they span. In consequence, the Jacobian determinant at corner 1 is equal
to two times the signed area of the triangle defined by $\n 1$, $\n 2$ and $\n 4$. Let us
note $A_k$ the signed area of the triangle of corner $k$. Since the total area of the
quadrangle is equal to $A_1+A_3$ or $A_2+A_4$, we have the following relation
concerning the Jacobian determinant: $\detJ_1+\detJ_3 = \detJ_2+\detJ_4$
(see Figure~\ref{f:areas}).
\begin{figure}[ht!]
\begin{center}
\setlength\figwidth{.4\textwidth}
\input{figures/tikz/areas.tex}
\caption{The linear relationship between the areas of the triangles in a quadrangle
($A_1+A_3=A_2+A_4$) implies an equivalent linear relationship between the four
coefficients of the Jacobian determinant $\detJ_k$: $\detJ_1+\detJ_3 = \detJ_2+\detJ_4$,
where $\detJ_k$ is the value taken by the Jacobian determinant
at corner $k$.}
\label{f:areas}
\end{center}
\end{figure}
\subsection{Validity control of a linear hexahedron}
Let $(x_1(\vec\xi),\,x_2(\vec\xi),\,x_3(\vec\xi))$ be the trilinear mapping of the hexahedron.
The 3D Jacobian determinant is by definition:
\beqn{e:det3d}
\detJ(\xra,\xrb,\xrc) = \sum_{i,\,j,\,k\,=1}^3 \varepsilon_{i,\,j,\,k}
\ \ \da{\big(x_i\big)}\ \db{\big(x_j\big)}\ \dc{\big(x_k\big)}
\end{equation}
where $\varepsilon_{i,\,j,\,k}$ is the permutation symbol. We have that $\Da{x_i}$ is a
bilinear function in $\xrb$ and $\xrc$, and similarly for $\Db{x_i}$ and $\Dc{x_i}$.
This means that each term of the sum in equation~\eqref{e:det3d} is triquadratic and so
is the Jacobian determinant of the linear hexahedron. As a
consequence, the minimum of the Jacobian determinant is not
necessarily located at one of the eight corners. A more sophisticated validity test for
hexahedra would be to compute the minimum of $\detJ$ on the edges. This can be easily
implemented since the Jacobian determinant restricted to an edge is a quadratic function in
one of the reference variables. However, it has been proved in\,\oldcite{knupp1990invertibility}
that this test is not sufficient. One step further would be the ``face test'' that would
consist in computing the global minimum of a biquadratic function
(defined on a square domain) for the 6 faces of the hexahedron. However, there is,
to the best of our knowledge, no proof that it would be sufficient,
\emph{i.e.}\xspace that the global minimum cannot be exclusively located in the volume.
Currently, the only existing technique to robustly compute the validity of linear
hexahedra is the method proposed in\,\oldcite{johnen2013geometrical}. This method
computes bounds on the minimum of the Jacobian determinant that can be sharpened as
much as desired. The main drawback of the proposed algorithm is the general framework
used for curved elements that is not well-adapted for an efficient computation for
the linear hexahedron. We thus propose to adapt this method to the particular case
that concerns us.
In the next section, we introduce the B\'ezier formulation that allows to compute the
bounds and subsequently accurately compute the minimum of $\detJ$.
\section{B\'ezier expansion of hexahedra Jacobian determinant}\label{s:bezier}
Polynomial quantities can be expanded into the so-called B\'ezier basis in order to make
use of B\'ezier expansion properties. In this section, we first
introduce the B\'ezier expansion, then we derive the transformation matrix that
computes the B\'ezier coefficients from the Lagrange coefficients.
\subsection{Definition of B\'ezier expansion}
Let $\B\o k$ be the Bernstein polynomial function whose expression is:
\[
\B\o k(t) = \nchoosek\o k\ t^k\,(1-t)^{\o-k}\qquad t\in[0,1],\ \ k=0,\dots,n
\]
where $\nchoosek\o k=\frac{\o!}{k!(\o-k)!}$ is the binomial coefficient. These functions
allow to construct the hexahedral B\'ezier functions in term of the tensor product
of three Bernstein polynomials:
\beqn{e:bezDefinition}
\B\o{ijk}(\xra,\xrb,\xrc) = \B\o i(\xra)\ \B\o j(\xrb)\ \B\o k(\xrc).
\end{equation}
These functions, $\{\B\o{ijk}\}_{(0\leq i,j,k\leq\o)}$, defines the
\emph{B\'ezier basis} of the hexahedral polynomial space of order $\o$. Since the Jacobian
determinant of the linear hexahedron is a triquadratic function, it is included
in the hexahedral polynomial space of order $2$ and it can be expanded into
the B\'ezier basis of order 2. There exists thus a unique set of coefficients $b_{ijk}$
(also known as control values) such that we have:
\beqn{e:bezExpansion}
\detJ(\vec\xi) = \sum_{i,j,k=0}^2\ b_{ijk}\,\B2{ijk}(\vec\xi)
\end{equation}
where the right member of the above expression is the \emph{B\'ezier expansion} of the
Jacobian determinant. The number of coefficients is $27$ since every index can take three
values.
B\'ezier bases have the property that the basis functions are positive over
their domain of definition and sum up to~1.
This implies the well-known convex hull property which, in our case, gives
that $\min_{ijk}b_{ijk}\leq\min_{\vec\xi}\detJ$. In addition to that, some
B\'ezier coefficients are actual values of the Jacobian determinant. Those are the one
``located'' at the corners of the element. For example, we have: $b_{000}=\detJ(0,0,0)$ and
$b_{200}=\detJ(1,0,0)$.
The minimum of these corner coefficients constitutes an upper bound for
$\min_{\vec\xi}\detJ$.
In other words, the control values allow to bound the minimum of the Jacobian
determinant from below and above.
A positive lower bound implies the positivity of the Jacobian determinant and the
validity of the element. On the other hand, a negative upper bound implies that the
element is invalid. In the third and last case, when the lower bound is negative and the
upper bound is positive, nothing can be told concerning the validity of the element.
Those bounds are not necessarily sharp. However, they can
be sharpened as much as desired by ``subdividing'', \emph{i.e.}\xspace by expanding the same
function defined on a smaller domain, called a subdomain\,\oldcite{johnen2013geometrical}.
It is proven in\,\oldcite{leroy2008certificats,leroy2011certificats} that such
subdivision algorithm always stops and
that it can be used to check the positivity of a multivariate polynomials.
Moreover, the bounds converge quadratically with the size of the
subdomains\,\oldcite{cohen1985rates}. The subdivision algorithm can be implemented in a
recursive and adaptive manner making the validity check very
efficient\,\oldcite{johnen2013geometrical}.
In the following section, we explain how to compute the 27 coefficients $b_{ijk}$ of the B\'ezier expansion~\eqref{e:bezExpansion}.
\subsection{Computation of the B\'ezier coefficients}
In order to compute the 27 B\'ezier coefficients we have to write a linear
system of equations.
Let us consider a different indexing for B\'ezier coefficients and B\'ezier
functions for which the order is given in Figure~\ref{f:ordercoeff}. This permits
to gather the $27$ B\'ezier coefficients into a vector $\vec b$ for which we
have, for example, $b_1\!=\!b_{000}$, $b_2\!=\!b_{200}$ and $b_9\!=\!b_{100}$.
We will use a greek letter to refer to this new indexing.
\begin{figure}[ht!]
\begin{center}
\setlength\figwidth{.3\textwidth}
\input{figures/tikz/ordering3.tex}
\caption{Ordering of the nodes. Low order nodes are in black while high order nodes are in
gray.}
\label{f:ordercoeff}
\end{center}
\end{figure}
In the same way, $B_\i$ will refer to a certain function $B_{ijk}$ such
that to respect the order defined in Figure~\ref{f:ordercoeff}.
Let $\vec\xi_\i, \i=1,\dots,27$ be different points of the reference domain.
In practice, these points are taken as the uniformly spaced nodes of the order 2
hexahedron, which limits numerical errors.
We order them in the same way, such that we have $\vec\xi_1=(0,0,0)$, $\vec\xi_2=(1,0,0)$ and $
\vec\xi_9=(1/2,0,0)$ for example. Let $\vec c$ be the vector of the Jacobian determinant
computed at those points, \emph{i.e.}\xspace $c_\i = \detJ(\vec\xi_\i)$.
From the definition of the
B\'ezier expansion~\eqref{e:bezExpansion}, we can write the following linear system:
\begin{align*}
\detJ(\vec\xi_\i) &= \sum_{\j=1}^{27} b_\j\,B_\j(\vec\xi_\i)\qquad\forall \i\in\{1,\dots,27\}\\
\Leftrightarrow\qquad \vec c &= \vec A \vec b
\end{align*}
where $\vec A$ is a transformation matrix\footnote{
Indeed, we can expand the Jacobian determinant into the traditional Lagrange
functions of order 2 for the hexahedral element, in which case we have: $
\detJ(\vec\xi)=\sum_{j=1}^{27}c_j\,L_j(\vec\xi)$. The sets $\{L_j\}$ and $\{B_j\}$ are two
different bases of the same functional space for which $\vec c$ and $\vec b$ are the
respective coefficients of the Jacobian determinant.} in which each element
$A_{\i\j}$ is equal to $B_\j(\vec\xi_\i)$. The inverse of $\vec A$, denoted $\Tb$,
is the matrix that computes the B\'ezier coefficients from the computed values
of the Jacobian determinant, \emph{i.e.}\xspace $\vec b =\Tb\,\vec c$.
Matrix $\Tb$ is given in Table~\ref{t:Tb}.
To calculate the vector $\vec c$, one may derive
the analytical expression of the Jacobian determinant, as we did in 2D (see equation~
\eqref{e:determinant2D}). But we will see in Section~\ref{s:tet2lag} that it can
be performed by computing the volume of tetrahedra. Moreover, we show in the next
section that only a small part of $\vec c$ has to be computed.
\begin{table}
\[
\Tb = \Par{\begin{array}{cccc:cccc|cccc:cccc:cccc|cccccc|c}
\multicolumn{8}{c|}{\phantom{\Big(}\identity88\phantom{\Big(}} & \multicolumn{19}{c}{\zeros8{19}}\\\hline
-\mf12&-\mf12&0&0&0&0&0&0&\multicolumn{12}{c|}{}\\
0&-\mf12&-\mf12&0&0&0&0&0&\multicolumn{12}{c|}{}\\
0&0&-\mf12&-\mf12&0&0&0&0&\multicolumn{12}{c|}{}\\
-\mf12&0&0&-\mf12&0&0&0&0&\multicolumn{12}{c|}{}\\\cdashline{1-8}[4pt/4pt]
-\mf12&0&0&0&-\mf12&0&0&0&\multicolumn{12}{c|}{}\\
0&-\mf12&0&0&0&-\mf12&0&0&\multicolumn{12}{c|}{\multirow{2}{*}{$2\,\identity{12}{12}$}}&\multicolumn{7}{c}{\multirow{2}{*}{$\zeros{12}7$}}\\
0&0&-\mf12&0&0&0&-\mf12&0&\multicolumn{12}{c|}{}\\
0&0&0&-\mf12&0&0&0&-\mf12&\multicolumn{12}{c|}{}\\\cdashline{1-8}[4pt/4pt]
0&0&0&0&-\mf12&-\mf12&0&0&\multicolumn{12}{c|}{}\\
0&0&0&0&0&-\mf12&-\mf12&0&\multicolumn{12}{c|}{}\\
0&0&0&0&0&0&-\mf12&-\mf12&\multicolumn{12}{c|}{}\\
0&0&0&0&-\mf12&0&0&-\mf12&\multicolumn{12}{c|}{}\\\hline
\mf14&\mf14&\mf14&\mf14&0&0&0&0&-1&-1&-1&-1&0&0&0&0&0&0&0&0&&&&&&&0\\\cdashline{1-20}[4pt/4pt]
\mf14&\mf14&0&0&\mf14&\mf14&0&0&-1&0&0&0&-1&-1&0&0&-1&0&0&0&&&&&&&0\\
0&\mf14&\mf14&0&0&\mf14&\mf14&0&0&-1&0&0&0&-1&-1&0&0&-1&0&0&\multicolumn{6}{c|}{\multirow{2}{*}{$4\,\identity66$}}&0\\
0&0&\mf14&\mf14&0&0&\mf14&\mf14&0&0&-1&0&0&0&-1&-1&0&0&-1&0&\multicolumn{6}{c|}{}&0\\
\mf14&0&0&\mf14&\mf14&0&0&\mf14&0&0&0&-1&-1&0&0&-1&0&0&0&-1&&&&&&&0\\\cdashline{1-20}[4pt/4pt]
0&0&0&0&\mf14&\mf14&\mf14&\mf14&0&0&0&0&0&0&0&0&-1&-1&-1&-1&&&&&&&0\\\hline
\multicolumn{8}{c|}{\phantom{\Big(}-\mf18\,\ones18\phantom{\Big(}}&\multicolumn{12}{c|}{\mf12\,\ones1{12}}&\multicolumn{6}{c|}{~-2\,\ones16~}&8
\end{array}}
\]
\caption{Transformation matrix that computes the B\'ezier coefficients from the
sampling of the Jacobian determinant. Submatrix $\identity mm$ designate the identity
matrix of dimension $m$, submatrix $\zeros mn$ is a $m$ by $n$ matrix with only $0$ and $
\ones mn$ is a $m$ by $n$ matrix containing only $1$.}
\label{t:Tb}
\end{table}
\section{Linear dependency of the coefficients}\label{s:only20}
Like for quadrangles, B\'ezier coefficients of the hexahedral elements are not all
linearly independent. This is linked to the fact that the Taylor series expansion of the
Jacobian determinant contains only $20$ non-zero coefficients, as demonstrated
in\,\oldcite{knupp1990invertibility}. In this section, we formulate the dependency between the
coefficients through a similar reasoning. We then construct a transformation matrix between
the 20 linearly independent Jacobian determinant values and the $27$ B\'ezier coefficients.
The Jacobian determinant can be written as the triple scalar product:
\[
\detJ=\triple{\da\vec x}{\db\vec x}{\dc\vec x}.
\]
This permits to compute the derivatives of the Jacobian determinant in terms of
derivatives of the mapping. Given that the mapping is trilinear, the only
non-zero derivatives of $\vec x$ are $\da\vec x$, $\db\vec x$, $\dc\vec x$, $\d\vec x{\xra\xrb}$,
$\d\vec x{\xra\xrc}$, $\d\vec x{\xrb\xrc}$ and $\d\vec x{\xra\xrb\xrc}$.
The derivatives of $J$ can be found in\,\oldcite{knupp1990invertibility}
and result in the following observation:
\begin{observation}\label{p:derivative}
The following non-trivial high-order derivatives of the Jacobian determinant
are equal to zero: $\d\detJ{\xra\xra\xrb\xrb} = \d\detJ{\xra\xra\xrc\xrc}
= \d\detJ{\xrb\xrb\xrc\xrc} = 0$.
\end{observation}
Let us consider the monomial basis $\{M_{ijk}\}_{(0\leq i,j,k\leq2)}$, where $M_{ijk}
=M_{ijk}(\xra,\xrb,\xrc)=\xra^i\xrb^j\xrc^k$ and let us expand the Jacobian
determinant into this basis.
Let $m_{ijk}$ be the coefficients of this expansion.
Observation~\ref{p:derivative} admits the following corollary:
\begin{corollary}\label{p:monomial}
7 monomial coefficients of the Jacobian determinant are always equal to zero:
$m_{220}=m_{202}=m_{022}=m_{221}=m_{212}=m_{122}=m_{222}=0$.
\end{corollary}
Corollary~\ref{p:monomial} implies that the Jacobian determinant
space is of dimension 20 and that it is possible to obtain 7 linear relations
between the 27 B\'ezier/Lagrange coefficients. We will obtain them by writing the
expression of the monomimial coefficients in function of the B\'ezier coefficients.
Let $a_{\i\j}$ be the coefficient of monomial $\i$ in the expression of the
B\'ezier function $\j$ (whose definition is given at equation~\eqref{e:bezDefinition}).
Mathematically, we have $B_\j(\vec\xi) = \sum_{\i=1}^{27}a_{\i\j}\,M_\i(\vec\xi)$.
We can thus write:
\[
\detJ(\vec\xi) = \sum_{\j=1}^{27} b_\j\,B_\j(\vec\xi) = \sum_{\i=1}^{27}\underbrace{\Cro{\sum_{\j=1}^{27}b_\j\,a_{\i\j}}}_{\displaystyle m_\i}M_\i(\vec\xi)
\]
The linear relations between the B\'ezier coefficients are found by considering
the equations $m_\i=\sum_{\j=1}^{27}a_{\i\j}\,b_\j$ for the 7 monomial
coefficients of Corollary~\ref{p:monomial}.
This leads to the matrix given in Table~\ref{t:7LinRel} that
computes the last 7 B\'ezier coefficients in function of the first ones.
\begin{table}
\[
\vec b_{21\rightarrow27} = \Par{\begin{array}{cccc:cccc|cccc:cccc:cccc}
\mf14&\mf14&\mf14&\mf14&0&0&0&0&-\mf12&-\mf12&-\mf12&-\mf12&0&0&0&0&0&0&0&0\\\cdashline{1-20}[4pt/4pt]
\mf14&\mf14&0&0&\mf14&\mf14&0&0&-\mf12&0&0&0&-\mf12&-\mf12&0&0&-\mf12&0&0&0\\
0&\mf14&\mf14&0&0&\mf14&\mf14&0&0&-\mf12&0&0&0&-\mf12&-\mf12&0&0&-\mf12&0&0\\
0&0&\mf14&\mf14&0&0&\mf14&\mf14&0&0&-\mf12&0&0&0&-\mf12&-\mf12&0&0&-\mf12&0\\
\mf14&0&0&\mf14&\mf14&0&0&\mf14&0&0&0&-\mf12&-\mf12&0&0&-\mf12&0&0&0&-\mf12\\\cdashline{1-20}[4pt/4pt]
0&0&0&0&\mf14&\mf14&\mf14&\mf14&0&0&0&0&0&0&0&0&-\mf12&-\mf12&-\mf12&-\mf12\\\cline{1-20}
\multicolumn{8}{c|}{\phantom{\Big(}\mf14\,\ones18\phantom{\Big(}}&\multicolumn{12}{c}{-\mf14\,\ones1{12}}
\end{array}}\cdot\vec b_{20}
\]
\caption{Computation of the last 7 B\'ezier coefficients in function of the 20 first.
}
\label{t:7LinRel}
\end{table}
Let us write $\vec D$ the matrix that computes the 27 B\'ezier coefficients from
the first 20 B\'ezier coefficients. Matrix $\vec D$ is constructed by extending
the matrix given in Table~\ref{t:7LinRel} with an identity matrix of size 20.
We have:
\[
\vec b = \vec D\,\vec b_{20}
\]
where $\vec b_{20}$ is the vector containing the first 20 components of $\vec b$.
Constructing the matrix that computes the 27 B\'ezier coefficients in function of
20 Lagrange coefficients is now straightforward. Matrix $\Tb$ (see Table~\ref{t:Tb})
is such that the first 20 B\'ezier coefficients depends only on the first 20 Lagrange
coefficients. Let $\Tsub$ be the $20\times20$ upper left submatrix of $\Tb$ and $\vec
c_{20}$ the first 20 components of $\vec c$. We have that:
\[
\vec b_{20}=\Tsub\,\vec c_{20}\quad\Leftrightarrow\quad\vec b =
\vec D\,\Tsub\vec c_{20} = \Tsmall\vec c_{20}
\]
where $\Tsmall$, the matrix that computes all the B\'ezier coefficients from
the first 20 Lagrange coefficients, is given in Table~\ref{t:Tsmall}.
\begin{table}
\[
\Tsmall = \Par{\begin{array}{cccc:cccc|cccc:cccc:cccc}
\multicolumn{8}{c|}{\phantom{\Big(}\identity88\phantom{\Big(}} & \multicolumn{12}{c}{\zeros8{12}}\\\hline
-\mf12&-\mf12&0&0&0&0&0&0&\\
0&-\mf12&-\mf12&0&0&0&0&0&\\
0&0&-\mf12&-\mf12&0&0&0&0&\\
-\mf12&0&0&-\mf12&0&0&0&0&\\\cdashline{1-8}[4pt/4pt]
-\mf12&0&0&0&-\mf12&0&0&0&\\
0&-\mf12&0&0&0&-\mf12&0&0&\multicolumn{12}{c}{\multirow{2}{*}{$2\,\identity{12}{12}$}}\\
0&0&-\mf12&0&0&0&-\mf12&0&\\
0&0&0&-\mf12&0&0&0&-\mf12&\\\cdashline{1-8}[4pt/4pt]
0&0&0&0&-\mf12&-\mf12&0&0&\\
0&0&0&0&0&-\mf12&-\mf12&0&\\
0&0&0&0&0&0&-\mf12&-\mf12&\\
0&0&0&0&-\mf12&0&0&-\mf12&\\\hline
-\mf34&-\mf34&-\mf34&-\mf34&0&0&0&0&~1~&~1~&~1~&~1~&~0~&~0~&~0~&~0~&~0~&~0~&~0~&~0~\\\cdashline{1-20}[4pt/4pt]
-\mf34&-\mf34&0&0&-\mf34&-\mf34&0&0&1&0&0&0&1&1&0&0&1&0&0&0\\
0&-\mf34&-\mf34&0&0&-\mf34&-\mf34&0&0&1&0&0&0&1&1&0&0&1&0&0\\
0&0&-\mf34&-\mf34&0&0&-\mf34&-\mf34&0&0&1&0&0&0&1&1&0&0&1&0\\
-\mf34&0&0&-\mf34&-\mf34&0&0&-\mf34&0&0&0&1&1&0&0&1&0&0&0&1\\\cdashline{1-20}[4pt/4pt]
0&0&0&0&-\mf34&-\mf34&-\mf34&-\mf34&0&0&0&0&0&0&0&0&1&1&1&1\\\hline
\multicolumn{8}{c|}{\phantom{\Big(}-\mf58\,\ones18\phantom{\Big(}}&\multicolumn{12}{c}{\mf12\,\ones1{12}}
\end{array}}
\]
\caption{Transformation matrix that allows to compute the B\'ezier coefficients from 20
samplings of the Jacobian determinant.
matrix of dimension $m$, submatrix $\zeros mn$ is a $m$ by $n$ matrix with only $0$ and $
\ones mn$ is a $m$ by $n$ matrix containing only $1$.
}
\label{t:Tsmall}
\end{table}
\section{Expression of the 20 Lagrange coefficients in function of 20 tetrahedral volumes}
\label{s:tet2lag}
In this section we show that the 20 Lagrange coefficients that has to be computed are
equal to the volume of tetrahedra.
Recalling that $\vec x$ is the column vector $(x, y, z)^{\text T}$, the Jacobian matrix can be
written as:
\[
\jac(\xra,\xrb,\xrc)=\Par{
\,\Cro{\begin{array}{c}\\\da\vec x\\~\end{array}}\,
\Cro{\begin{array}{c}\\\db\vec x\\~\end{array}}\,
\Cro{\begin{array}{c}\\\dc\vec x\\~\end{array}}\,
},
\]
Let us recall that $\v\i\j$ denotes the difference $(\n\j-\n\i)$.
We can express the derivatives of $\vec x$ from the definition of the
mapping~\eqref{e:mapping} and the Lagrange functions given in~\ref{s:lagrangeFunction3D}:
\[
\left\{
\begin{array}{l}
\da\vec x = \v12\ (1-\xrb)\,(1-\xrc) + \v43\ \xrb\,(1-\xrc) + \v56\ (1-\xrb)\,\xrc + \v87\ \xrb\,\xrc\\
\db\vec x = \v14\ (1-\xra)\,(1-\xrc) + \v23\ \xra\,(1-\xrc) + \v58\ (1-\xra)\,\xrc + \v67\ \xra\,\xrc\\
\dc\vec x = \v15\ (1-\xra)\,(1-\xrb) + \v26\ \xra\,(1-\xrb) + \v48\ (1-\xra)\,\xrb + \v37\ \xra\,\xrb.
\end{array}
\right.
\]
In the following, $\det{\vec a, \vec b, \vec c}$ will denote the determinant of the matrix
made up of columns $\vec a$, $\vec b$ and $\vec c$. Note that $\det{\vec a, \vec b, \vec c}
$ equals $\triple{\vec a}{\vec b}{\vec c}$ and is a trilinear function. Moreover, if the
three vectors have the same origin, then the determinant is also 6 times the volume of the
tetrahedron that the vectors define. Lastly, if the three vectors are not
linearly independent, then the determinant is zero.
There are two types of Lagrange coefficients we are interested in: the coefficients that
correspond to the corners and the coefficients that correspond to the edges of the
hexahedron. By symmetry of the problem, there must be also two types of tetrahedra to
identify. It is already well-known that the Jacobian determinant computed at a corner
corresponds to 6 times the volume of the tetrahedron constructed from the 3 edges of the
corner. Let us formulate it mathematically for the first corner:
\[
\detJ_1 = \det{\jac(0,0,0)} = \det{\v12,\,\v14,\,\v15} = 6\ \text{vol}\,(\n1,\,\n2,\,\n4,\,\n5)
\]
where $\vol(\cdot)$ refer to the volume of the tetrahedron defined by the four nodes.
In a similar manner, we can express the 9th value of the Jacobian determinant as the volume
of a tetrahedron:
\begin{align*}
\detJ_9 = \det{\jac(1/2,0,0)} &= \det{\v12,\ \frac{\v14+\v23}2,\ \frac{\v15+\v26}2} \\
&= \det{\v12,\ \frac{\n4+\n3}2-\frac{\n1+\n2}2,\ \frac{\n5+\n6}2-\frac{\n1+\n2}2} \\
&= \det{\v12,\ \Cro{\frac{\n4+\n3}2-\n1}+\Cro{\n1-\frac{\n1+\n2}2},\ \Cro{\frac{\n5+\n6}2-\n1}+\Cro{\n1-\frac{\n1+\n2}2}}
\end{align*}
where the terms $\Cro{\n1-\frac{\n1+\n2}2}$ are equal to $-\frac{\v12}2$. By trilinearity
of the determinant and dependency with respect to the first vector ($\v12$), the terms
$-\frac{\v12}2$ vanish and we obtain:
\[
\detJ_9 = 6\ \text{vol}\,\Par{\n1,\ \n2,\ \frac{\n4+\n3}2,\ \frac{\n5+\n6}2}
\]
Figure~\ref{f:tet} shows the tetrahedra that correspond to four value of the Jacobian
determinant.
\begin{figure}[ht!]
\begin{center}
\setlength\figwidth{.2\textwidth}
\input{figures/tikz/tetrahedron1.tex}
\input{figures/tikz/tetrahedron9.tex}
\input{figures/tikz/tetrahedron2.tex}
\input{figures/tikz/tetrahedron10.tex}
\caption{Different tetrahedra whose volume corresponds to the value of the respective
coefficients $\detJ_1$, $\detJ_9$, $\detJ_2$ and $\detJ_{10}$ divided by $6$.}
\label{f:tet}
\end{center}
\end{figure}
\section{The algorithm}\label{s:algo}
The algorithm that computes the validity of a linear hexahedron takes as input
the 8 nodes coordinates of the element.
It returns true if the element is valid and return false if the element is invalid.
The execution is the following:
\begin{enumerate}
\item Compute the 20 volumes of Section~\ref{s:tet2lag} and put them in vector $\vec v$
(ordering them as in Figure~\ref{f:ordercoeff}).
\item If at least one volume is negative, return False.
\item Compute the B\'ezier coefficients $\vec b = \Tsmall\vec v$ where $\Tsmall$
is the matrix given in Table~\ref{t:Tsmall}.
\item If all the B\'ezier coefficients in $\vec b_{9\to27}$ are positive, return True.
\item Return \texttt{recursive\_subdivision}($\vec b$).
\end{enumerate}
In Step~4, the 8 first B\'ezier coefficients are equal to the volume of the corner
tetrahedra and must be positive otherwise the algorithm would have stop at Step~2.
The subdivision algorithm, \texttt{recursive\_subdivision}($\vec b$), is identical
to the subdivision algorithm presented in paper\,\oldcite{johnen2013geometrical}
(although implemented in a more efficient manner in our new implementation).
It takes a vector of 27 B\'ezier coefficients as input and return true if the
Jacobian determinant is strictly positive on the subdomain, otherwise it returns
false. The algorithm is:
\begin{enumerate}
\item Subdivide: Compute the subcoefficients $\vec b^i,\ i=1,\dots,8$ as described
in paper\,\oldcite{johnen2013geometrical}.
\item For each $\vec b^i$:
\item \ \ If at least one of the coefficients in $\vec b^i_{1\to8}$ is negative,
return False.
\item \ \ If all the coefficients in $\vec b^i_{9\to27}$ are positive, continue the loop.
\item \ \ If \texttt{recursive\_subdivision}($\vec b^i$) is false, return False.
\item Return True.
\end{enumerate}
In Step~3 of this algorithm, it is checked if the 8 first B\'ezier coefficients are
not negative since they are actual values of the Jacobian determinant. In Step~4,
the positivity of the 19 other coefficients ensures that the Jacobian determinant is
positive on the corresponding subdomain in which case the algorithm skip Step~5 and
continue the loop. While there is no negative real value of the Jacobian
determinant but at least one negative B\'ezier coefficients, the algorithm
subdivide (Step~5).
\section{Results}\label{s:results}
We begin the results with unitary tests. The Jacobian determinant of the hexahedron
defined in Figure~\ref{f:invalidButUshakovaValid} is positive at the 8 corners, the
center of the edges, the center of the faces and the center of the volume.
Moreover, the hexahedron passes the Ushakova's\,\oldcite{ushakova2011nondegeneracy} test6
that requires the computation of $24$ tetrahedral volumes.
Our algorithm detects that this hexahedron is invalid.
\begin{figure}[htp]
\begin{center}
\begin{tikzpicture}
\node[anchor=east] at (0, 0) {
\begin{tabular}{c|ccc}
i & x & y & z\\
\hline
0 & 0 & 0 & 0 \\
1 & 1 & 0 & 0 \\
2 & 1.7615170641459 & 0.594764272968121 & 0.15552188663289 \\
3 & 0.438888411629833 & 1.53098020041072 & 0.185631029838277 \\
4 & 1.3859049651391 & 0.0755794018509022 & 1.77483024073906 \\
5 & 1.22129676447071 & 0.271876165350328 & 0.630922158503566 \\
6 & 1.77365642274365 & 1.25103990471942 & 1.83300604452892 \\
7 & 0.0769922201302364 & 0.940424880836765 & 1.45521546591891 \\
\end{tabular}
};
\node[anchor=west] at (0, 0) {
\includegraphics[width=.3\textwidth]{hex8}
};
\end{tikzpicture}
\end{center}
\caption{Invalid hexahedron for which the Jacobian determinant is positive at the
$27$ nodes of the second-order hexahedron and for which the 24 tetrahedral volumes of
Ushakova's\,\oldcite{ushakova2011nondegeneracy} test6 are all positive.}
\label{f:invalidButUshakovaValid}
\end{figure}
Figure~\ref{f:validNegativeOshakova} presents a hexahedron that does not pass
Ushakova's\,\oldcite{ushakova2011nondegeneracy} test6, despite the fact that the
element is valid.
\begin{figure}[htp]
\begin{center}
\begin{tikzpicture}
\node[anchor=east] at (0, 0) {
\begin{tabular}{c|ccc}
i & x & y & z\\
\hline
0 & 0 &0& 0\\
1 &1 &0& 0 \\
2 &1.539& 0.704696 &1.84011\\
3 & 0.166589 &1.08208 &0.162539\\
4 & 0.0501127& 1.96347 &1.56559\\
5 & 0.422336 &0.00419138& 1.43038\\
6 & 0.509917 & 0.0214216 &1.55322\\
7 & 0.40783 & 1.73452 & 1.93234\\
\end{tabular}
};
\node[anchor=west] at (0, 0) {
\includegraphics[width=.3\textwidth]{hex6}
};
\end{tikzpicture}
\end{center}
\caption{Valid hexahedron that does not pass Ushakova's\,\oldcite{ushakova2011nondegeneracy} test6.}
\label{f:validNegativeOshakova}
\end{figure}
In hexahedral mesh community, it is common to measure the quality of hexahedra by
computing the minimum of the ``scaled Jacobian'' on the 8
corners\,\oldcite{knupp2000achievingB,yamakawa2003fully}.
For the hexahedron of Figure~\ref{f:invalidHighCornerQual}, this quality measure
is equal to 0.64 although the element is invalid. This demonstrates that even
invalid hexahedra can have a good quality at the corners.
\begin{figure}[htp]
\begin{center}
\begin{tikzpicture}
\node[anchor=east] at (0, 0) {
\begin{tabular}{c|ccc}
i & x & y & z\\
\hline
1 & 0.464949491866817 & 0.358989226966155 & 0.0133365886410108\\
2 & 0.481795709097567 & 0.358745078890347 & 0.0163884395886105\\
3 & 0.482406079287087 & 0.351664784691916 & 0.0235297708059938\\
4 & 0.466719565416425 & 0.339945677053133 & 0.0278023621326335\\
5 & 0.465498825037385 & 0.320291756950591 & -0.00277718436231578\\
6 & 0.465987121189001 & 0.321085238196966 & -0.0042420728171636\\
7 & 0.501998962370677 & 0.322367015594958 & -0.0116275521103549\\
8 & 0.487166966765343 & 0.308816797387616 & 0.0115054780724508
\end{tabular}
};
\node[anchor=west] at (0, 0) {
\includegraphics[width=.3\textwidth]{hex1}
};
\end{tikzpicture}
\end{center}
\caption{Invalid hexahedron for which the minimum of the scaled Jacobian computed at the
corners is equal to 0.64.}
\label{f:invalidHighCornerQual}
\end{figure}
For the next experimentation, we compare our method with some previous methods
on different datasets. The results are given in Table~\ref{t:comparison}.
The datasets have been generated by the algorithm
described in\,\oldcite{pellerin2017} which takes a tetrahedral mesh as input and computes
hexahedra that can be created by combining tetrahedra. This algorithm can generate a
large amount of hexahedra of different qualtity.
We have considered two models. The first one, ``Fusee\_1'',
contains $71,947$ vertices and $349,893$ tetrahedra. The second one is ``FT47'' and
contains $370,401$ vertices and $2,085,394$ tetrahedra. Both of them are available
on the website \url{www.hextreme.eu}.
We have disabled the validity check during the hexahedra creation and, for each model,
we have generated three datasets of hexahedra by varying the desired minimal quality $q$
(computed at the corners). Datasets that correspond to $q=-1$ contain a large proportion
of invalid hexahedra while datasets that correspond to $q=0.5$ contain only valid
hexahedra. We have compared our new implementation with the previous
one\,\oldcite{johnen2013geometrical}, as well as the 5 first validity tests presented
in\,\oldcite{ushakova2011nondegeneracy}. These tests consist in computing the volume of
respectively 8, 10, 24, 32 and 58 tetrahedra and returning False as soon as a
negative volume is found or returning True if no negative volume is obtained.
For each algorithm we store the execution time as well as the
number of false valid (the number of invalid hexahedra that pass the test) and the
number of false invalid (the number of valid hexahedra that do not pass the test).
The experimentation has been conducted in serial on a MacBook Pro 2016 @ 2.9 GHz.
Our new implementation detects the same invalid hexahedra than our previous
implementation. We have taken this result as the reference for computing the false
invalid and false valid elements of the methods from\,\oldcite{ushakova2011nondegeneracy}.
Test~1 computes the volume of corner tetrahedra, which corresponds to a necessary
condition. As expected, Test~1 misses invalid elements but never finds false invalid.
Test~2 to Test~4 are neither sufficient nor necessary. Test~4 misses very few
invalid hexahedra, however.
Test~5 corresponds to a sufficient condition and can miss as much as 80\% of
valid elements (see dataset Fusee\_1, $q=-1$).
Our new implementation is about $15$ to $30$ time faster than the algorithm
designed for curvilinear elements and runs at similar speed than Test~5
of\,\oldcite{ushakova2011nondegeneracy} which consists in computing $58$ tetrahedral
volumes. Our new algorithm can check the validity of hexahedra at a rate of
between $6$ million and $12$ million hexahedra per second on a single core.
The speed is higher when there is a large proportion of invalid
hexahedra since the algorithm can stop at an early stage if a negative
Jacobian determinant is obtained.
\begin{table}
\renewcommand{\arraystretch}{1.}
\setlength{\tabcolsep}{3pt}
\centering
\scriptsize
\caption{Comparison of our new implementation with some previous methods. The datasets
differ in the number of hexahedra and proportion of invalid element amongst them.
For each method, the computation time, the number of false valid and the number
of false invalid are given. Numbers are given with 3 significant digits.}
\begin{tabular}{lrr@{\qquad}l@{\quad}rrrrrrr}
\toprule
Dataset & \# hex & \# invalid & & Ours & \citet{johnen2013geometrical}
& Test 1\,\oldcite{ushakova2011nondegeneracy} & Test 2\,\oldcite{ushakova2011nondegeneracy}
& Test 3\,\oldcite{ushakova2011nondegeneracy} & Test 4\,\oldcite{ushakova2011nondegeneracy}
& Test 5\,\oldcite{ushakova2011nondegeneracy} \\
\midrule
Fusee\_1, $q=0.5$ & $334,000$ & $0$ & \# false valid & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$\\
& & & \# false invalid & $0$ & $0$ & $0$ & $529$ & $10,000$ & $10,000$ & $111,000$\\[.5ex]
& & & time [s] & $0.0565$ & $0.812$ & $0.0180$ & $0.0168$ & $0.0349$ & $0.0549$ & $0.0866$\\[2ex]
Fusee\_1, $q=0$ & $2,040,000$ & $79,900$ & \# false valid & $0$ & $0$ & $79,900$ & $73,900$ & $0$ & $0$ & $0$\\
& & & \# false invalid & $0$ & $0$ & $0$ & $10,200$ & $814,000$ & $814,000$ & $1,590,000$\\[.5ex]
& & & time [s] & $0.339$ & $6.60$ & $0.0945$ & $0.0977$ & $0.161$ & $0.220$ & $0.358$\\[2ex]
Fusee\_1, $q=-1$ & $6,060,000$ & $4,110,000$ & \# false valid & $0$ & $0$ & $80,000$ & $74,000$ & $48,400$ & $0$ & $0$\\
& & & \# false invalid & $0$ & $0$ & $0$ & $10,200$ & $814,000$ & $814,000$ & $1,590,000$\\[.5ex]
& & & time [s] & $0.488$ & $15.5$ & $0.202$ & $0.212$ & $0.301$ & $0.347$ & $0.418$\\[2ex]
FT47, $q=0.5$ & $3,000,000$ & $0$ & \# false valid & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$\\
& & & \# false invalid & $0$ & $0$ & $0$ & $1,890$ & $115,000$ & $115,000$ & $1,060,000$\\[.5ex]
& & & time [s] & $0.459$ & $6.93$ & $0.181$ & $0.203$ & $0.341$ & $0.463$ & $0.725$\\[2ex]
FT47, $q=0$ & $14,700,000$ & $366,000$ & \# false valid & $0$ & $0$ & $366,000$ & $342,000$ & $7$ & $7$ & $0$\\
& & & \# false invalid & $0$ & $0$ & $0$ & $38,900$ & $4,880,000$ & $4,880,000$ & $11,100,000$\\[.5ex]
& & & time [s] & $2.43$ & $42.5$ & $0.712$ & $0.872$ & $1.30$ & $1.73$ & $2.33$\\[2ex]
FT47, $q=-1$ & $40,500,000$ & $26,100,000$ & \# false valid & $0$ & $0$ & $370,000$ & $346,000$ & $247,000$ & $7$ & $0$\\
& & & \# false invalid & $0$ & $0$ & $0$ & $38,900$ & $4,880,000$ & $4,880,000$ & $11,100,000$\\[.5ex]
& & & time [s] & $3.17$ & $102$ & $1.55$ & $1.54$ & $2.08$ & $2.49$ & $3.09$\\
\bottomrule
\end{tabular}%
\label{t:comparison}%
\end{table}%
\section{Conclusion}\label{s:conclusion}
Our implementation is able to check the validity of linear hexahedral elements
in a very efficient manner. The algorithm benefit from the robustness of the
previous method for checking the validity of curvilinear
elements\,\oldcite{johnen2013geometrical} on which it is based.
The novelty consists of two improvements: (1) a reduced number of quantities
to be computed at the beginning of the algorithm and (2) the computation of those
quantities as tetrahedral volumes instead of the Jacobian determinant. The
particularization to hexahedra also permits a fine-tuned implementation.
Our new code runs more than 15 time faster than the previous code for curvilinear
elements and runs at similar speed than the sufficient but not necessary method
presented in\,\oldcite{ushakova2011nondegeneracy}.
More than $6$ million hexahedra per second can be analyzed on a single core of
a personal computer.
The algorithm is simple and can readily be implemented from the information
given in this paper. The C++ code will be available in Gmsh
(\url{www.gmsh.info}).
\section*{Acknowledgements}
This research project was funded by the European Research Council
(project HEXTREME, ERC-2015-AdG-694020) and the TILDA project. The TILDA (Towards
Industrial LES/DNS in Aeronautics - Paving the Way for Future Accurate CFD)
project has received funding from the European Union’s Horizon 2020 research
and innovation program under grant agreement No 635962.
The project is a collaboration between NUMECA, DLR, ONERA, DASSAULT, SAFRAN, CERFACS,
CENAERO, UCL, UNIBG, ICL and TsAGI.
| {'timestamp': '2017-08-08T02:13:19', 'yymm': '1706', 'arxiv_id': '1706.01613', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01613'} | arxiv |
\section{Introduction}
\IEEEPARstart{M}{achine} learning techniques play a central role in data analysis, data fusion and visualization. As geophysical acquisition tools become more sophisticated and gather more information, data analysts relay more on machine learning techniques for
generating meaningful representations of the data. A coherent representation of complex data often includes a feature extraction step followed by a dimensionality reduction step, which results in a compact and visual model.
Analysis tasks such as clustering, classification, anomaly detection or regression may be carried out in the constructed low-dimensional space. Common dimensionality reduction methods such as Principal Component Analysis (PCA) \cite{Pca1} and Linear Discriminant Analysis (LDA) \cite{LDA_book} project the feature space into a low dimensional space by constructing meaningful coordinated that are linear combinations of the original feature vectors.
PCA is widely used for low-dimensional modeling of geoscience datasets. Jones \& Christopher \cite{Jones} applied PCA to infer aerosol specification for research of oceans or more complex land surfaces. Griparis and Faur \cite{Griparis} applied a linear dimensionality reduction tool, Linear Discriminant Analysis (LDA) for a projection of earth observations into a low-dimensional space. Their low-dimensional representation resulted in a cluster organization of the image data by land types. PCA and Self organization maps \cite{Kohonen} were applied for pattern recognition in volcano seismic spectra by Unglert et. al. \cite{Unglert} and for geologic pattern recognition by Roden et. al. \cite{Roden}.
Another key issue in processing large amounts of data is the ability to fuse data from different sensors. Typical seismometers record data using three channels. These three channels capture the motion in the horizontal and perpendicular directions to the earth. Each channel may be processed separately and the results can be combined. Alternatively, a fused representation may be formed for common analysis. Recent advances in machine learning and in particular the use of non-linear kernel-based algorithm enable to construct data-driven fusions and to compute geometry-preserving low-dimensional embeddings. Such kernel-based embedding techniques are known as manifold learning methods, among them Local Linear Embedding \cite{LLE}, Lapacian Eigenmaps \cite{Belkin1} and Diffusion Maps (DM) \cite{Lafon}. Manifold learning methods overcome limitations of linear dimensionality reduction tools such as PCA and LDA \cite{manifold_book}. When the relationship between the original high-dimensional points is complex and non-linear, linear projections may fail to organize the data in a way that is loyal to the intrinsic physical parameters that drives the observed phenomena.
This work focuses on extending manifold learning techniques for low-dimensional modeling and kernel based data-driven fusion of seismic data. Identifying the characteristic of seismic events is a challenging and important task. This includes the discrimination between earthquakes and explosions which is not only an essential component of nuclear test monitoring but it is also important for the maintaining the quality of earthquake catalogs. For example, wrong classification of explosions as earthquakes may cause the erroneous estimation of seismicity hazard. The discrimination task is typically performed based on some extracted seismic parameters. Among such parameters is the focal depth, the ratio between surface wave magnitude and body wave magnitude and the spectral ratio between different seismic phases \cite{Blandford}, \cite{rodgers1997comparison}.
Discrimination methods based on seismic parameters give only a partial solution to the problem. For instance, a larger half of seismic events reported by the Comprehensive Nuclear-Test-Ban Treaty Organization (CTBTO) are not “screened out” as natural events or even are not considered for the discrimination at all although most of those events are typically earthquakes \cite{BenHorin}.
Recently, this problem and other geophysical challenges have been approached using machine
learning frameworks. Hidden Markov model were proposed in \cite{Ohrnberger}, \cite{Beyreuther}, \cite{Hammer} and modeled the data in an unsupervised manner. Artificial neural networks \cite{Tiira}, \cite{DelPezzo}, \cite{esposito2006automatic} or support vector machines \cite{Kortstrom,ruano2014seismic} were also used to construct a classifier in a supervised manner. The study in \cite{Kuyuk} utilizes Self Organization Maps to distinguish micro-earthquakes from quarry blasts in the vicinity of Istanbul, Turkey. Manifold learning is used in \cite{ramirez2011machine} for seismic phase classification. In \cite{mishne2015graph} a graph is used to detect sea mines in side-scan sonar images. The DM method is used in \cite{fernandez2015diffusion} for visualization of meteorological data. A non-linear dimensionality reduction is proposed in \cite{rabin2016earthquake} to discriminate between earthquakes and explosions.
In this study, the manifold learning approach that was presented in \cite{rabin2016earthquake} is extended by using a kernel-based fusion method for identification of seismic events. The method is model-free, and it is based on signal processing for feature extraction followed by manifold learning techniques for embedding the data. Furthermore, the method reviles the underlying intrinsic physical properties of the data, which results in a natural organization of the events by type. Since seismic data is recorded at multiple channels, we suggest fusing the information to extract a more reliable representation for the seismic recordings. The fusion framework is based on a recent work by \cite{lindenbaum,lindenbaum2015learning}. The study extends Diffusion Maps (DM) \cite{Lafon}, which has been successfully applied for phase classification \cite{ramirez2011machine}, for estimation of arrival times \cite{taylor2011estimation} and for events discrimination \cite{Poster}. Other constructions for fusing kernels were proposed in \cite{salhov2016multi,lederman,michaeli}.
The proposed framework begins with a preprocessing stage in which a time-frequency representation is extracted from each seismic event. The training phase includes the construction of a normalized graph that holds the local connections between the seismic events. A low dimensional map is then obtained by the eigen-decomposition of the graph. The constructed embedding is distance preserving. Thus the geometry of the dataset is kept in the new embedding coordinates. By utilizing the low dimensional embedding, we demonstrate capabilities of classification, location estimation and anomaly detection of seismic events.
The paper is organized as follows: Sections \ref{sec:Manifold} and \ref{SecMulti} present the machine learning frameworks for manifold learning and data fusion. In Section \ref{sec:Data} the data set is described. The mathematical methods required for analysis of seismic data are provided in Section \ref{sec:Pre}. The proposed framework and experimental results are presented in Section \ref{sec:Exp}. We conclude this work in Section \ref{sec:Future}.
\section{Manifold Learning }
\label{sec:Manifold}
This section reviews the manifold learning method that is applied in this work for non-linear dimensionality reduction, diffusion maps. The method's main ingredient is a kernel function. Here, radial basis kernel functions are used, their construction is described in detail.
\subsection{Radial Basis Kernel Function}
Kernel functions are vastly utilized in machine learning. Classification, clustering and manifold learning use some affinity measure to learn the relations among data points. A kernel is a pre-defined similarity function designed to capture the fundamental structure of a high dimensional data set.
Given a high dimensional data set \begin{math} {\myvec{X} = \lbrace
{ { \myvec{x}_1,\myvec{x}_2, \myvec{x}_3,...,\myvec{x}_M }} \rbrace
},\myvec{x}_i \in {\mathbb{R}^{D}},
\end{math} a kernel ${{\cal{K}} : \mymat{X}\times{\mymat{X}}\longrightarrow{\mathbb{R}} }$ is an affinity function over all pairs of points in $\mymat{X}$. The discrete kernel is represented by a matrix $\mymat{K}$ with following properties
\begin{itemize}
\item {Symmetry \begin{math}{K_{i,j}={\cal{K}}(\myvec{x}_i,\myvec{x}_j)={\cal{K}}(\myvec{x}_j,\myvec{x}_i) }
\end{math}}
\item {Positive semi-definiteness: \begin{math}{ \myvec{v}_i^T \mymat{K} \myvec{v}_i \geq 0 }\end{math} for all $\myvec{v}_i \in
\mathbb{R}^M$ and \begin{math}{{\cal{K}}(\myvec{x}_i,\myvec{x}_j)
\geq 0. }
\end{math}}
\end{itemize}
These properties guarantee that the matrix $\mymat{K}$ has
real eigenvectors and non-negative real eigenvalues.
In this study radial basis functions (RBF) are used for constructing the kernel. The RBF kernel function is defined by
\begin{equation}\label{eq:RBF}
{ K_{i,j}=exp\{
{-\frac{||\myvec{x}_i-\myvec{x}_j||^2}{2 \sigma^2}\}} }.\end{equation} Applying the Euclidean distance to high dimensional pairs of distant vectors could somewhat be misleading, as data is typically sparse in the high-dimensional space. For this reason the decaying property of the Gaussian kernel is beneficial. The Gaussian tends to zero for distant points, whereas its value is close to one for adjacent points.
\subsection{Setting the Kernel's Bandwidth}
The kernel's bandwidth $\sigma$ controls the number of points taken into consideration by the kernel.
A simple choice for \begin{math} \sigma \end{math} is based on the standard deviation of the data. This approach is good when the data is sampled from a uniform distribution. In this study, we use a max-min measure. The method was proposed in \cite{Keller} and aims to find a small scale to maintain local connectivities. The scale is set to
\begin{equation} \label{eq:MaxMin}
\sigma^2_{\text{MaxMin}}={\cal{C}}\cdot \underset{j}{\max} [ \underset{i,i\neq j}{\min} (||\myvec{x}_i-\myvec{x}_j||^2)],
\end{equation}
where ${\cal{C}} \in [2,3]$. Alternative methods such as \cite{Singer,lindenbaum2015musical} have demonstrated similar results in our experiments.
\subsection{Non-Linear Dimensionality Reduction}
\label{SecDiff}
Most dimensionality reduction methods are unsupervised frameworks that seek for a low dimensional representation of complex, high dimensional data sets. Each method preserves a certain criteria while reducing the dimension of the data. Principal component analysis (PCA) \cite{PCA}, reduces the dimension of the data while preserving most of the variance. Non linear methods such as Local Linear Embedding \cite{LLE}, Laplacian Eigenmaps
\cite{Luo}, Diffusion Maps (DM) \cite{Lafon} preserve the local structure of the high-dimensional data. In particular, in DM \cite{Lafon}, a metric that describes the intrinsic connectivity between the data points is defined. This metric is preserved in the low-dimensional space, resulting in a distance-preserving embedding. The metric is refereed to as diffusion distance, it is defined later in this subsection.
The DM framework enforces a fictitious random walk on the graph of a high dimensional data set $\myvec{X}=\{\myvec{x}_1,..,\myvec{x}_M \},\myvec{x}_i \in \mathbb{R}^D$. This results in a Markovian process that travels in the high-dimensional space only in areas where the sampled data exists. The method has been demonstrated useful when applied to audio signals \cite{lindenbaum2015musical}, image editing \cite{farbman2010diffusion}, medical data analysis \cite{haghverdi2015diffusion} and other types of data sets.
Reducing the dimension of a data set by construction of DM coordinates is performed using the following steps
\begin{enumerate}
\item Given a data set $\myvec{X}$ compute an RBF kernel $\myvec{K}$ based on Eq. \ref{eq:RBF}.
\item Normalize the kernel using $\mymat{D}$ where \begin{math} D_{i,i}=\underset{j}{\sum}{K_{ij}} \end{math}.
Construct the row stochastic matrix $\mymat{P}$ by \begin{equation}
{P_{i,j}\defeq{\cal{P}}(\myvec{x}_i,\myvec{x}_j)\defeq[{{\mymat{D}}^{-1}{\mymat{K}} }}]_{i,j}
\label{EquationPDM}
.\end{equation}
\item Compute the spectral decomposition of the matrix \begin{math} \mymat{P} \end{math} to obtain a sequence of eigenvalues \begin{math}{\lbrace {\lambda_m}\rbrace }
\end{math} and normalized right eigenvectors \begin{math}{\lbrace{{\mbox{\boldmath${\psi}$}}_m}\rbrace }
\end{math} that satisfy ${ {\mymat{P}} {\mbox{\boldmath${\psi}$}_m} =\lambda_m{\mbox{\boldmath${\psi}$}}_m, m=0,...,M-1}
$;
\item Define the $d$-dimensional ($d \ll D$) DM representation as
\begin{equation}\label{EQPSI}{ \myvec{\Psi}{(\myvec{x}_i)}: \myvec{x}_i
\longmapsto \begin{bmatrix} { \lambda_1\psi_1(i)} , {.} {.} {.}
,
{\lambda_{d}\psi_{d}(i)}\\
\end{bmatrix}^T \in{\mathbb{R}^{d}} },
\end{equation}
where $\psi_m(i)$ denotes the $i^{\rm{th}}$ element of ${\mbox{\boldmath${\psi}$}_m}$.
\end{enumerate}
The power of the DM framework stems from the Diffusion Distance (Eq. \ref{EqDist}). It was shown in \cite{Lafon} that the Euclidean distance in the embedded space $ \myvec{\Psi}{(\myvec{x}_i)}$ is equal to a weighted distance between rows of the probability matrix $\myvec{P}$.
This distance is defined as the Diffusion Distance
\begin{equation}{ \label{EqDist} { {\cal{D}}^2_t( \myvec{x}_i,\myvec{x}_j)=||{\mymat{\Psi}_t{(\myvec{x}_i)}}-{\mymat{\Psi}_t{(\myvec{x}_j)}}||^2=||\myvec{P}_{i,:}-\myvec{P}_{j,:}||^2_{\tiny\mymat{W}^{-1}}},}
\end{equation}
where $\mymat{W}$ is a diagonal matrix with elements
$W_{i,i}=\frac{D_{i,i}}{\sum_{i=1}^M D_{i,i}}$. Thus, the DM embedding is distance preserving, meaning that neighboring points in the high-dimensional space are embedded close to each other in the diffusion coordinates.
\section{Data Fusion}
\label{SecMulti}
Many physical phenomena are sampled using multiple types of sensing devices. Each sensor provides a noisy measurement of a latent parameter of interest. Data fusion is the process of incorporating multiple observation of the same data points to find a more coherent and accurate representation. \\
{\bf{Problem Formulation:}} Given multiple sets of data points $\mymat{X}^l\text{ }, l=1,...,L$. Each
view is a high dimensional dataset ${\mymat{X}^l = \lbrace{ {
\myvec{x}_1^l,\myvec{x}_2^l, \myvec{x}_3^l,...,\myvec{x}_M^l }}
\rbrace , \myvec{x}_i^l\in {\mathbb{R}^{D}} }$. Find a reliable low dimensional representation $\myvec{\Psi}(\myvec{X}^1,...,\myvec{X}^L)\in \mathbb{R}^d$.
\subsection{Multi-View Diffusion Maps (Multi-View DM)}
\label{Sec2} An approach for fusion kernel matrices in the spirit of DM framework was presented in \cite{lindenbaum}. The idea is to enforce a random walk model based on the kernels that model each view by restraining
the random walker to ``hop'' between views in each time step.
The construction requires to compute a Gaussian kernel for each view
\begin{equation} \label{EQK}{ K^l_{i,j}=exp\{
{-\frac{||\myvec{x}^l_i-\myvec{x}^l_j||^2}{2 \sigma_l^2}\}},\text{ } l=1,...,L },\end{equation}
then the multi-view kernel is formed by the following matrix
\begin{equation} \label{EQKMAT}
\mymat{\widehat{K}}= \begin{bmatrix} \mymat{0}_{M \times M} & {\mymat{K}^1\mymat{K}^2}& {\mymat{K}^1\mymat{K}^3}&...& {\mymat{K}^1\mymat{K}^p} \\
\mymat{K}^2\mymat{K}^1 & \mymat{0}_{M \times M} & {\mymat{K}^2\mymat{K}^3}&...& {\mymat{K}^2\mymat{K}^p}\\ \mymat{K}^3\mymat{K}^1 & {\mymat{K}^3\mymat{K}^2} &
\mymat{0}_{M \times M} &...& {\mymat{K}^3\mymat{K}^p}\\:&:&:&...&:\\\mymat{K}^p\mymat{K}^1 & {\mymat{K}^p\mymat{K}^2} & {\mymat{K}^p\mymat{K}^3} &...&
{\mymat{0}_{M \times M}}.
\end{bmatrix}. \end{equation}
Next, re-normalizing using the diagonal matrix $\mymat{\widehat{D}}$ where
\begin{math}
{\widehat{D}}_{i,i}=\underset{j}{\sum}{{\widehat{K}}_{i,j}}
\end{math}, the normalized row-stochastic matrix is defined as
\begin{equation}
\label{phat}
\mymat{\widehat{P}}={\mymat{\widehat{D}}}^{-1}\mymat{\widehat{K}}, ~~~
{\widehat{P}}_{i,j}=\frac{{{\widehat{K}}_{i,j}} }{\widehat{D}_{i,i} },
\end{equation}
where the $m,l$ block is a square $M\times M$ matrix located at\\
$[1+(m-1)M,1+(l-1)M], l=1,...,L$. This block describes the probability of
transition between view $\mymat{X}^m$ and $\mymat{X}^l$.
The multi-view DM representation for $\mymat{X}^l$ is computed
by
\begin{equation}
\label{Map1}
{ \myvec{\widehat{\Psi}}_t{(\myvec{x}^l_i)}: \myvec{x}^l_i
\longmapsto
\begin{bmatrix} { \lambda_1^{t}\psi_1(i+\bar{l})} , {.} {.} {.} ,
{\lambda_{d}^{t}\psi_{d}(i+\bar{l})}
\end{bmatrix}^T \in{\mathbb{R}^{d}} },
\end{equation} where $\bar{l}=(l-1)\cdot M$.
The final low dimensional representation is defined by a concatenation of all low dimensional multi-view mappings
\begin{equation} \label{eq:MVDMrep} \vec{\myvec{\Psi}}(\vec{\myvec{X}})=
{[ \myvec{\widehat{\Psi}}{(\myvec{X}^1)}},\myvec{\widehat{\Psi}}{(\myvec{X}^2)},...,\myvec{\widehat{\Psi}}{(\myvec{X}^L)}].
\end{equation}
\subsection{Alternative Methods}
\label{SECALT}
Here we provide a brief description of several methods for fusing the views before the application of a spectral decomposition. \\
{\bf{Kernel Product (KP)}}: Multiplying the kernel matrices element wise $\mymat{K}^{{\circ}}\defeq \mymat{K}^1
\circ \mymat{K}^2 \circ ...\circ \mymat{K}^L $, ${K}_{ij}^{\circ}\defeq {K}_{ij}^1
\cdot {K}_{ij}^2\cdot...\cdot {K}_{ij}^L$, then normalizing by the sum of rows. The resulting row stochastic matrix is denoted as $\mymat{P}^{{\circ}}$.
This kernel corresponds to the approach in \cite{Lafon}.\\
{\bf{Kernel Sum (KS)}}: Defining the sum
kernel $\mymat{K}^{+}\defeq\sum^L_{l=1}\mymat{K}^l$. Normalizing the sum kernel by the sum
of rows, to compute $\mymat{P}^{+}$. This random walk sums the step probabilities from each view.
This approach is proposed in \cite{Zhou}.\\
{\bf{Kernel Canonical Correlation Analysis (KCCA)}}: This method detailed in \cite{lai2000kernel,akaho2006kernel} extend the well know Canonical Correlation Analysis (CCA).Two kernels $\myvec{K}^1 \text{and }\myvec{K}^2$ are constructed in each view as in Eq. (\ref{EQK}) and the canonical vectors $\myvec{v}_1 \text{and }\myvec{v}_2$ are computed by solving the following generalized eigenvalue problem
\begin{equation} \label{eq:KCCA}
\begin{bmatrix} \mymat{0}_{M \times M} & {\mymat{K}^1\cdot \mymat{K}^2} \\ {{\mymat{K}^2\cdot \mymat{K}^1}} & \mymat{0}_{M \times M} \end{bmatrix} \begin{pmatrix}
{\myvec{v}_1} \\ {\myvec{v}_2}
\end{pmatrix}= \rho \cdot \begin{bmatrix} (\mymat{K}^1+\gamma\myvec{I})^2 & {\mymat{0}_{M \times M}} \\ {\mymat{0}_{M \times M}} &(\mymat{K}^2+\gamma\myvec{I})^2 \end{bmatrix} \begin{pmatrix}
{\myvec{v}_1} \\ {\myvec{v}_2}
\end{pmatrix},
\end{equation} where $\gamma \myvec{I}$ are regularization terms which guarantee that the matrices $(\mymat{K}^1+\gamma\myvec{I})^2$ and $(\mymat{K}^2+\gamma\myvec{I})^2 $ are invertible.
\section{Seismic Data Set}
\label{sec:Data}
The data set that is used for demonstrating the proposed kernel based approaches includes $2023$ explosions and $105$ earthquakes. $1654$ of the explosions occurred at the Shidiya phosphate quarry in the Southern Jordan between the years $2005$-$2015$ (see a map of the region in Figure \ref{fig:QuarryLocationsA}). These events were reported by the Israel National Data Center at the Soreq Nuclear Research Center with magnitudes $2\leq \text{ML}\leq3$ seismic. The rest of the events were taken from the seismic catalog of the Geophysical Institute of Israel between the years $2004$-$2014$ . All events were reported in Israel between latitudes $29^{\circ}$N-$32.5^{\circ}$N and longitudes $34.2^{\circ}$E-$35.7^{\circ}$E with duration magnitudes Md $\ge 2.5$.
Most of the earthquakes in the dataset occurred in the Dead Sea transform \cite{Garfunkel}.
The dataset includes the February 11, 2004 earthquake with the duration magnitude of Md = 5.1. This was the strongest event in this area since 1927 \cite{Hofstetter}. Twelve aftershocks that are included in the dataset are associated with this main shock.
The majority of the explosions in the dataset are ripple-fire query blasts. Moreover, the dataset consists of several one shot explosions, for instance, two experimental underwater explosions in the Dead Sea \cite{Hofstetter} and surface and near-surface experimental explosions at the Oron quarry \cite{gitterman2009source} and at the Sayarim Military Range \cite{Fee} in the Negev desert.
The dataset consists of seismogram recordings from the HRFI (Harif) station in Israel. The station is part of the Israel National Seismic Network \cite{Hofstetter}. It is equipped with a three component broad band STS-2 seismometer and a Quanterra data logger. The seismograms are sampled at a frequency of $40$ Hz. Waveform segments of $2.5$-minutes (6000 samples) have been selected for every event. In each waveform, the first P phase onsets reside $30$ seconds after the beginning of each waveform.
Figure \ref{fig:QuarryLocationsA} displays the events on the regional map.
\begin{figure}
\centering
\includegraphics[scale = 0.45]{MULTI-VIEW_KERNELS_Events_FigY1.jpg}
\caption{Seismic events in the data set and the HRFI station.}\label{fig:QuarryLocationsA}
\end{figure}
\section{Seismic Preprocessing and Feature Extraction Methods}
\label{sec:Pre}
This section provides background on typical methods that are used for seismic signal processing as well as the description of the feature extraction method that was applied here. First, the STA/LTA detector is reviewed. Next, we describe how the alignment between the different waveforms was implemented. Last, the feature extraction step, which results in a time-frequency representation of the seismic signal, is described.
\subsection{Short and Long Time Average (STA/LTA)}
\label{STA}
Detection of seismic signal embedded in the background noise is a classical problem in the signal processing theory. In the context of statistical decision theory it may be formulated as a choice between two alternatives: a waveform contains solely the noise or it contains a signal of interest superimposed on the noise. The STA/LTA trigger is a most widely accepted detection algorithm in seismology \cite{trnkoczytopic}. It relies on the assumption that a signal is characterize by a concentration of higher energy level compared with the energy level of the noise. This is done by comparing short-time energy average to a long-time energy average using a Short Time Average/ Long Time Average (STA/LTA) detector. Usually a band-pass filter is applied before the STA/LTA test.
Given a time signal $\myvec{y}(n)$ the ratio $R(i)$ is computed at each time instance $i$ is computed as follows
\begin{equation} \label{eq:STALTA}
R(i)=\frac{L\cdot[\overset{i+S}{\underset{{j=i}}{\sum}}y^2(j)]}{S\cdot(\overset{i+L}{\underset{{j=i}}{\sum}}y^2(j))},
\end{equation} where $L \gg S$ are the number of samples used for the long and short average correspondingly. The ratio $R(i)$ is compared to a threshold $\delta$ to identify time windows suspected as seismic events.
\subsection{Seismic Event Alignment}
All waveform segments in the dataset were extracted according to the first P phase onset time. Those onset times were manually picked by the analysts. However, our selective waveform inspection showed that the P onsets often have actual offsets of several seconds, sometimes even of ten seconds.
In order to increase the accuracy of the alignment, Algorithm \ref{alg:Trigger} is proposed to detect the first P onsets.
\begin{algorithm}[h]
\caption{Seismic trigger alignment} \textbf{Input:} Input time signals $\myvec{y}[n]$.\\ \textbf{Output:} Estimated time sample $\hat{n}_P$ for P onset of seismic event.
\begin{algorithmic}[1]
\STATE Apply a finite impulse response band pass filter to $\myvec{y}[n]$. The filter $\myvec{h}_1$ is designed to pass the signal between $f^{(1)}_L=2[Hz] \text{ and } f^{(1)}_H=4[Hz]$. The filtered signal is denoted as $\myvec{\tilde{y}}^{(1)}[n]$
\STATE Compute the STA/LTA ratio based on Eq. (\ref{eq:STALTA}).
\STATE Set $n^{(1)} \defeq \min (n),\text{s.t. } R(n)> \delta$. The threshold $\delta$ is computed based on the following formula $\delta= \min (4,0.3 \cdot \max (R(n)))$.
\STATE Repeat steps 1-3 using $f^{(2)}_L=4[Hz],f^{(2)}_H=8[Hz]$ and $f^{(3)}_L=8[Hz],f^{(3)}_H=12[Hz]$. Denote the trigger indexes as $n^{(2)}$ and $n^{(3)}$.
\STATE Set the estimated trigger as $\hat{n}\defeq \min (n^{(1)},n^{(2)},n^{(3)})$.
\end{algorithmic}
\label{alg:Trigger}
\end{algorithm}
Algorithm \ref{alg:Trigger} aligns the seismic events based on the STA/LTA ratios which are computed using three filtered versions of the input signal. We assume that most of the energy of the seismic signature is between $2[Hz]$ and $12[Hz]$. Figure \ref{fig:STALTA} presents a visual example for the application of Algorithm \ref{alg:Trigger}.
\begin{figure}
\centering
\includegraphics[scale = 0.2]{STALTA.png}
\caption{The STA/LTA ratios (Eq. \ref{eq:STALTA}) computed for an earthquake. Each ratio $R(i)$ is computed using one of three filtered signals $\myvec{\tilde{y}}^{(1)}(n),\myvec{\tilde{y}}^{(2)}(n),\myvec{\tilde{y}}^{(3)}(n)$. The filters are designed as explained in step 2 of Algorithm \ref{alg:Trigger}. The constant black line is an example of a threshold $\delta=4$. The onset $\hat{n}_P$ is defined as the first cross point of the threshold $\delta$.}\label{fig:STALTA}
\end{figure}
\subsection{Feature Extraction}
In this study a time-frequency representations, named sonograms \cite{joswig1990pattern}, is used, with some modification. The sonogram is a normalized short time Fourier transform (STFT) rearranged to be equal tempered on a logarithmic scale.
Each raw single-trace seismic waveform input is denoted by $\myvec{y}(n)\in \mathbb{R}^{\bar{N}}$. The length of the signals in this study is $N=6,000$ with a sampling rate of $F_s=40 Hz$. An example of seismic signals recorded using three channels is presented in Figure \ref{fig:Sig}.
\begin{figure}
\centering
\includegraphics[scale = 0.25]{SignalZ.png}
\includegraphics[scale = 0.25]{SignalE.png}
\includegraphics[scale = 0.25]{SignalN.png}
\caption{4500 samples from a recording of an explosion. Top - Z channel. Middle - E channel. Bottom - N channel.}\label{fig:Sig}
\end{figure}
The sonogram is extracted from $\myvec{y}(n)$ based on the following steps:
\begin{itemize}
\item {Given a recorded signal $\myvec{y}(n)\in \mathbb{R}^N$ the short time Fourier transform (STFT) is computed by
\begin{equation}
\label{eq:STFT}
\myvec{{{STFT}}}(f,t) = \sum\limits_{n = 1}^{N} {w(n-\ell) \cdot {y}(n)} \cdot {e^{ - j2\pi f}} ,
\end{equation}
where $w(n-t)$ is a Hann window function with a length of $N_0=256$ and a $s=0.8$ overlap. The time indexes are $\ell=(1-s)\cdot N_O\cdot t ,t=1,...,T$. The number of time bins is computed using the following equation
\begin{equation}
\label{eq:TimeWin}
T=\lceil{\frac{N-N_0}{(1-s)\cdot N_0}}\rceil+1
\end{equation}}
\item{The Spectrogram is the normalized energy of $\myvec{STFT}(f,t)$
\begin{equation}
\label{eq:NSPEC}
\myvec{R}(f,t) = \frac{\myvec{STFT}(f,t)^2 }{N_0}.
\end{equation} The Spectrogram $\myvec{R}(f,t)$ contains $T$ time bins and $F=N_0$ frequency bins. }
\item{The frequency scale is then rearrange to be equally tempered on a logarithmic scale, such that the final spectrogram contains $11$ frequency bands. The frequency bands are presented in Table \ref{table0}.
\begin{figure}
\centering
\includegraphics[scale = 0.26]{Sono.png}
\caption{A sonogram extracted from the E channel of an explosion seismogram.}\label{fig:Sono}
\end{figure}
\begin{table}
\centering
\caption{The list of frequency bands used for the sonogram computation.}
\label{table0}
\begin{tabular}[t!]{|c|c|c|}
\hline
{ Band Number} & f-start & f-end \\
\hline
{\#1} & ${0}$ [Hz] & ${0}$ [Hz] \\
{\#2} & ${0.157}$ [Hz] & ${0.315}$ [Hz] \\
{\#3} & ${0.315}$ [Hz] & ${0.630}$ [Hz] \\
{\#4 } & ${0.630}$ [Hz] & ${1.102}$ [Hz] \\
{\#5} & ${1.102}$ [Hz] & ${1.889}$ [Hz] \\
{\#6} & ${1.889}$ [Hz] & ${2.992}$ [Hz] \\
{\#7} & ${2.992}$ [Hz] & ${4.567}$ [Hz] \\
{\#8} & ${4.567}$ [Hz] & ${6.772}$ [Hz] \\
{\#9} & ${6.772}$ [Hz] & ${9.921}$ [Hz] \\
{\#10} & ${9.921}$ [Hz] & ${14.331}$ [Hz] \\
{\#11} & ${14.331}$ [Hz] & ${20}$ [Hz] \\
\hline
\end{tabular}
\end{table}
\item The bins are normalized such that the sum of energy in every frequency band is equal to $1$. The resulted sonogram is denoted by $\myvec{S}(k,t)$, where $k$ is the frequency band number, and $t$ is the time window number. Finally, we transpose the sonogram matrix into a Sonovector $\myvec{x}$ by concatenating the columns such that
\begin{equation} \label{eq:Sonovec}
\myvec{x}=\myvec{S}(:).
\end{equation}
}
\end{itemize}
An example of a sonogram extracted from an explosion is presented in Figure \ref{fig:Sono}.
\section{Case Studies}
\label{sec:Exp}
To evaluate the strength of multi-view DM for identifying the properties of seismic events we perform the following experiments.
\subsection{Discrimination Between Earthquakes and Explosions}
We consider the earthquake-explosion discrimination problem as a supervised binary classification task. A homogeneous evaluation data set is constructed by using data from 105 earthquakes and a random sample of 210 explosions. The sampling is repeated 200 times, and the results are the average of all trials. Algorithm \ref{alg:SeismicDM} is applied to extract a low dimensional representation of the seismic data. The number of data samples used for each events is 6000, where $N_1=1199$ (samples before onset) and $N_2=3800$ (samples after onset). An example of a 3-dimensional single view DM mapping is presented in Figure \ref{fig:MapE}. In this example, the explosions seem geometrically concentrated, while the earthquakes are spread out. This spread out structure may be associated with the diversity of the time-spectral information describing earthquakes, as oppose to the explosions that were mostly generated in specific quarries. The separation is clearly visible in this example. An evaluation of the separation is performed using a 1-fold cross-validation procedure. Test points are classified by using a simple K-NN classifier in a $d=4$ dimensional representation. The optimal dimension ($d=4$) for classification was found empirically based on our data set. The average accuracy of classification for various values of $K$ are presented in Figure \ref{fig:ClassifyExpEq}. Thus, the multi-view approach shows better performance with 95\% of correct discrimination.
\begin{algorithm}
\caption{Mapping of seismic data} \textbf{Input:} Three sets of time signals $\myvec{Y}_E, \myvec{Y}_N,\myvec{Y}_Z$. One for each seismic channel.\\ \textbf{Output:} A low dimensional mapping $\myvec{\Psi}(\myvec{Y}_E,\myvec{Y}_N,\myvec{Y}_Z)$.
\begin{algorithmic}[1]
\STATE Apply Algorithm \ref{alg:Trigger} to each time signal $\myvec{y}_Z^{(i)}$ and estimate the P onset $\hat{n}^{(i)}$.
\STATE Define the aligned truncated signal as $\myvec{\bar{y}}_Z^{(i)}(n)\defeq[y_Z^{(i)}(\hat{n}^{(i)}-N_1),...,y_Z^{(i)}(\hat{n}^{(i)}+N_2)]$.
\STATE Compute $\myvec{\bar{y}}_E^{(i)}(n) \text{ and } \myvec{\bar{y}}_N^{(i)}(n)$ in a similar manner.
\STATE Compute the Sonovecs based on Eqs. (\ref{eq:STFT}), (\ref{eq:NSPEC}) and (\ref{eq:Sonovec}).
\STATE Compute the DM mappings $\myvec{\Psi}_E,\myvec{\Psi}_N,\myvec{\Psi}_Z$ (Eq. (\ref{EQPSI})).
\STATE Compute the multi-view DM mapping $\vec {\myvec{\Psi}} $ (Eq. (\ref{eq:MVDMrep})).
\end{algorithmic}
\label{alg:SeismicDM}
\end{algorithm}
\begin{figure}
\centering
\includegraphics[scale = 0.3]{EXPvsEQmapMV.png}
\caption{A 3-dimensional DM mapping extracted from recordings of the E channel. Blue points represent man-made explosions from a variety of sources. Yellow points represent recordings of earthquakes most of which were originated in southern part of Israel.}\label{fig:MapE}
\end{figure}
\begin{figure}
\centering
\includegraphics[scale = 0.2]{EQvsExpClassify200runs.png}
\caption{The classification accuracy for two classes, 105 earthquakes and 210 explosions.}\label{fig:ClassifyExpEq}
\end{figure}
\subsection{Quarry Classification}
Identification and separation of quarries by attributing the explosions to the known sources is a challenging task in observational seismology \cite{Harris1}, \cite{Harris2}. Here we demonstrate how the DM representation can be utilized to identify the origin of an explosion.
\begin{table} \label{Table:Loc}\caption{Description of quarry clusters.}
\begin{tabular}[h!]{|l|c|c|c|c|}
\hline
{Quarry Clusters} & \# of events & Center Lat & Center Lon & Distances to HRFI \\
\hline
{Shidiya, Jordan } & ${250}$ & ${29.91}^{\circ}$ & ${36.32}^{\circ}$ & $125\text{[Km]}$ \\
{Oron, Israel } & ${222}$ & ${30.82}^{\circ}$ & ${35.04}^{\circ}$ & $86.7\text{[Km]}$ \\
{Rotem, Israel } & ${115}$ & ${31.09}^{\circ}$ & ${35.19}^{\circ}$ & $117.7\text{[Km]}$ \\
{M. Ramon, Israel } & ${8}$ & ${30.46}^{\circ}$ & ${34.95}^{\circ}$ & $47.3\text{[Km]}$ \\
{Har Tuv, Israel } & ${7}$ & ${31.68}^{\circ}$ & ${35.05}^{\circ}$ & $128.2\text{[Km]}$ \\
\hline
\end{tabular}
\end{table}
For this study 602 seismograms of explosions are used. The explosions occurred in 5 quarry clusters (see Table \ref{Table:Loc} and Figure \ref{fig:QuarryLocations}) and the label data was taken from seismic catalogs. It should be noted that the quarry clusters may include several neighboring quarries and the quarry area may be of several kilometers (like Rotem) or more than ten kilometers (like Shidiya). Moreover, the precise (“ground truth”) location for most of explosions inside a quarry are not known. We estimate that the hypo-center accuracy in the used seismic catalogs is about a few kilometers for the explosions in Israel and it is more than ten kilometers for the explosions in Jordan, which are located outside the Israeli seismic network. The mean latitude and longitude are computed for the explosions belonging to each cluster and referred them to the nearby quarry (see Table \ref{Table:Loc}).
The application of Algorithm \ref{alg:SeismicDM} yields a low dimensional representation of the seismic recordings. An example of a 3-dimensional single view DM mapping is presented in Figure \ref{fig:QuarriesMapZ}.
\begin{figure}
\centering
\includegraphics[scale = 0.4]{MULTI-VIEW_KERNELS_QuarryClaccif_Fig6.jpg}
\caption{Map of quarry clusters.}\label{fig:QuarryLocations}
\end{figure}
\begin{figure}
\centering
\includegraphics[scale = 0.24]{QuarryClustersDM.png}
\caption{A 3-dimensional diffusion mapping of 602 explosions.}\label{fig:QuarriesMapZ}
\end{figure}
The mapping is followed by a classification step that is performed based on a 1-fold cross validation using K-NN with $K=3$. The accuracy of the classification is presented in Figure \ref{fig:ClassifyQuarry}. The multi-view approach shows a peak performance of 85\% of correct classification rate.
\begin{figure}
\centering
\includegraphics[scale = 0.25]{ExpClassify50runsNew.png}
\caption{The classification accuracy for 5 source locations.}\label{fig:ClassifyQuarry}
\end{figure}
\subsection{Location Estimation}
The following case study demonstrates how the diffusion coordinates extract underlying physical properties of the sampled signal. In particular we show that the low dimensional representation that is generated by diffusion maps organizes the events with respect to their source location, even though this was not an input parameter of the algorithm. The original high-dimensional space holds the sonogram of each event. Nearly co-located events with the similar source mechanisms and magnitudes should have a similar time-frequency content and, consequently, have similar sonograms. Therefore, we expect them to lie close to each other in the high dimensional space. The diffusion distance, which is the metric that is preserved in DM, embeds the data while keeping its geometrical structure. Thus, physical properties (such as the source location) that characterize the sonogram and therefore define the geometric structure of the points in the high-dimensional space, are preserved in low-dimensional DM embedding. Note that such a geometry preserving metric does not exist in linear dimensionality reduction methods like PCA.
The dataset for this study includes 352 explosions that occurred in 4 quarry clustering Israel out 5 clusters above. The explosions in Jordan were removed since they are located at a large distance from the HRFI station. We show that the location of seismic events can be evaluated from the DM embedding coordinates. A similar evaluation based on a linear projection that was calculated with PCA yields a less accurate correlation to the events' true location.
Figure \ref{fig:MapLoc} (top image) displays the longitude and latitude coordinates of catalog locations of the events. These are the source locations of the seismic events. The points are colored by distance in kilometers from HRFI station. The middle and bottom images of Figure \ref{fig:MapLoc} present the two-dimensional PCA and DM embeddings of the dataset, respectively. It is clearly evident that the DM (bottom image in Figure \ref{fig:MapLoc}) representation has captured the location variability, while in the PCA representation this intrinsic factor is less obvious (middle image in Figure \ref{fig:MapLoc}). In the DM embedding, the clusters are well separated with respect to the event's location. In PCA the separation is not as clear, meaning that the low-dimensional PCA representation does not reveal this property. The Pearson correlation coefficients between first two diffusion coordinates and relative latitude and longitude are 0.82 and 0.77 for both dimensions respectively. The Pearson correlation coefficients between first two principle and relative latitude and longitude are 0.56 and 0.39 respectively.
\begin{figure}
\includegraphics[width=3.7in]{MapLocTruth1.png}
\includegraphics[width=3.7in]{PCAloc.png}
\includegraphics[width=3.7in]{MapLocN.png}
\caption{Top- the manually estimated location of events. Middle- the first two principle components of the N-channel. Bottom- the first two diffusion coordinated of the N-channel. Color represents the distance from HRFI station.}
\label{fig:MapLoc}
\end{figure}
\subsection{Detecting Anomalous Events}
This case study demonstrates the diffusion representation's ability to detect anomalous events among set of events at specific site. When two events are nearly co-located, have close magnitudes but with different source mechanisms, then their sonograms should be quite different as well.
Ripple-fire explosions are part of routine mining production cycles at the Oron phosphate quarry in Israel. In July 2006, three experimental one shot explosions were conducted by the Geophysical Institute of Israel at the Oron quarry \cite{gitterman2009source}. Our goal is to distinguish between the one shot explosions and the ripple-fire quarry blasts. This is not a trivial task, as all the events were conducted at very close distances.
\begin{algorithm}
\caption{K-NN based anomaly detection} \textbf{Input:} Low dimensional mapping $\myvec{\Psi}$.\\ \textbf{Output:} A set of indexes $\cal{I}$ of suspected anomalies.
\begin{algorithmic}[1]
\STATE Find $K$ nearest neighbors for all data points $\myvec{\bar{\Psi}}(\myvec{y}_i),i=1,...,M$, denote the set as $\cal{J}$.
\STATE Define the K-NN average distance as $\myvec{\hat{D}}_i\defeq \sum^K_{l=2} \frac{||\myvec{\Psi}(\myvec{y}_i)-\myvec{\Psi}(\myvec{y}_{j_l})||^2}{K} $.
\STATE Find all points with average distance $\myvec{\hat{D}}_i$ larger then a threshold $\delta$.
\end{algorithmic}
\label{alg:KNNanomaly}
\end{algorithm}
To remove the variability created by the location of the events, 98 blast from a small region surrounding the ground truth location of the experimental explosions as reported in \cite{gitterman2009source} are used. Algorithm \ref{alg:SeismicDM} is applied and a mapping extracted from the Z-channel is used to find the suspected anomalies. The diffusion maps embedding is presented in Figure \ref{fig:Anomalies}. The three anomaly points are colored in blue, they are clearly separated from the main cluster. The anomalies are automatically identified using Algorithm \ref{alg:KNNanomaly} with $K=4$ and a threshold set as four times the median of all distances $\hat{D}_i,i=1,...,M$. The average K-NN distance for the 98 blasts is presented in Figure \ref{fig:AverageKNN}. The four events that were suspected as anomalies include the three experimental explosions (which are described in \cite{gitterman2009source}).
\begin{figure}
\centering
\includegraphics[scale = 0.25]{Anomalies3.png}
\caption{Diffusion representation of 98 explosions recorded using the Z-channel. The suspected anomalies are colored in blue.}\label{fig:Anomalies}
\end{figure}
\begin{figure}
\centering
\includegraphics[scale = 1]{AverageKNN.png}
\caption{Average K-NN distance for each explosion. The distance is computed using $d=3$ coordinates and $K=5$ nearest neighbors.}\label{fig:AverageKNN}
\end{figure}
\section{Conclusion}
\label{sec:Future}
In this paper, we have adapted a multi-view manifold learning framework for fusion of seismic recordings and for low-dimensional modeling. The abilities of kernel fusion methods for extracting meaningful seismic parameters were demonstrated on various case studies. Various algorithms for classification of seismic events type, location estimation and anomaly detection were presented. These algorithms can be used as decision support tools for analysts who need to determine the source, location and type of recorded seismic events. Correct classification of events results in improved and more accurate seismic bulletins.
The proposed method is model free, thus it does not require knowledge of physical parameters. The underlying physical parameters are revealed by the diffusion maps and multi-view constructions. This type of kernel based sensor fusion is new in seismic signal processing and it overcomes some of the limitation of traditional model based fusion methods.
\section*{Acknowledgments}
This research was supported by the research grant of Pazy Foundation. We would like to thank Yochai Ben Horin for his advice and suggestions. We are grateful to Dov Zakosky and Batia Reich for providing us with the seismic catalog of Geophysical Institute of Israel.
\ifCLASSOPTIONcaptionsoff
\newpage
\fi
| {'timestamp': '2017-06-07T02:06:35', 'yymm': '1706', 'arxiv_id': '1706.01750', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01750'} | arxiv |
\section{Introduction}
Blind deconvolution is a fundamental problem in low level vision, and is always drawing research attentions \cite{perrone2014total,pan2016robust,krishnan2011blind,krishnan2009fast,pan2016blind}.
Given a blurry image $\mathbf y$, blind deconvolution aims to recover a clear version $\bf x$, in which it is crucial to first estimate blur kernel $\bf k$ successfully.
Formally, the degradation of image blur is modeled as
\begin{equation}\label{eq1}
\mathbf y= \mathbf x \otimes \mathbf k+ \mathbf n,
\end{equation}
where $\mathbf x$ and $\mathbf y$ are with size $M\times N$, $\mathbf k$ is with size $L\times K$,
$\otimes$ is the 2D convolution operator and $\mathbf n$ is usually assumed as random Gaussian noises.
Blind deconvolution needs to jointly estimate blur kernel $\bf k$ and recover clear image $\bf x$.
The most successful blind deconvolution methods are based on the maximum-a-posterior (MAP) framework.
MAP tries to jointly estimate $\mathbf k$ and $\mathbf x$ by maximizing the posterior $p(\mathbf k, \mathbf x|\mathbf y)$, which can be further reformulated as an optimization on regularized least squares~\cite{chan1998total},
\begin{equation}\label{eq2}
\mathbf{\hat x}, \mathbf{\hat k}=\arg\min_{\mathbf x, \mathbf k}{\left(\|
\mathbf x\otimes \mathbf k-\mathbf y\|^2+\lambda g\left(\mathbf x\right)+\sigma h\left(\mathbf k\right)\right)}
\end{equation}
where $g$ and $h$ are prior functions designed to prefer a sharp image and an ideal kernel, respectively.
It is not trivial to solve the optimization problem in Eqn. \eqref{eq2}, and instead it is usually addressed as alternate steps,
\begin{equation}\label{eq3}
\mathbf {\hat{x}}^{(i+1)} = \arg\min_{\mathbf x}{\left(\|\mathbf x \otimes \mathbf {\hat{k}}^{(i)}-\mathbf y\|^2+\lambda g\left(\mathbf x\right)\right)}
\end{equation}
and
\begin{equation}\label{eq4}
\mathbf{\hat{k}}^{(i+1)} = \arg\min_{\mathbf{k}}{\left(\|\mathbf{\hat{x}}^{(i+1)}\otimes \mathbf k- \mathbf y\|^2+\sigma h\left(\mathbf k\right)\right)}.
\end{equation}
In the most blind deconvolution methods, kernel size $(L, K)$ is hyper-parameters that should be manually set.
An ideal choice is the ground truth size to constrain the support domain, which however is not available in practical applications, requiring hand-crafted tuning.
On one hand, a smaller kernel size than ground truth cannot provide enough support domain for estimated blur kernel.
Therefore, kernel size in the existing methods is usually pre-defined as a large value to guarantee support domain.
\begin{figure*}[t]
\centering
\setlength{\tabcolsep}{2pt}
\small
\begin{tabular}{ccccc}
\multirow{1}{*}[50pt]{\includegraphics[width=.3\linewidth]{tend_final.eps}} &
\includegraphics[width=.155\linewidth]{yk} &
\includegraphics[width=.155\linewidth]{xk1} &
\includegraphics[width=.155\linewidth]{xk2} &
\includegraphics[width=.155\linewidth]{xk3} \vspace{-2pt} \\
&\includegraphics[width=.155\linewidth]{kd.pdf} &
\includegraphics[width=.155\linewidth, trim={86.5pt 87.5pt 18pt 16pt}, clip]{k1d.pdf} &
\includegraphics[width=.155\linewidth]{k2d.pdf} &
\includegraphics[width=.155\linewidth]{k3d.pdf} \vspace{-2pt} \\
& truth size = 23 & size = 23, err = 1.9 & size = 47, err = 5.9& size = 69, err = 69.9 \vspace{2pt}\\
(a) & (b) & (c) & (d) & (e) \vspace{10pt} \\
\end{tabular}\\
\caption{Large kernels produce inferior results. (a) Numerical errors with kernel size.
(b) Blurry image and ground truth kernel. (c-e) Deblurred results. In the first row of (c-e) are restored images and corresponding estimated kernels; in the second row are support domains ($k>0$), where adjacent positive pixels are colored identically and zeros are white.
In this experiment, we omitted regularization $h$;
hence, k-step equals to a bare least squares optimization.
We also avoided using multi-scaling scheme and threshold in this experiment. Parameters that performed well on the truth size were kept identical for larger sizes during the experiment.}\label{fig1}
\end{figure*}
On the other hand, as shown in Figure~\ref{fig1}, oversized kernels are very likely to introduce estimation errors, and hence lead to unreasonable results.
Hereby, we name this phenomenon \textit{larger-kernel effect}.
This interesting fact was first mentioned by Fergus~\textit{et~al.}~\cite{fergus2006removing}.
Then Cho and Lee~\cite{cho2016convergence} showed a similar result that the residual cost of (\ref{eq2}) increases with over-estimated kernel size.
However, such annoying phenomenon was not well analyzed and studied yet.
Note that most MAP-based blind deconvolution algorithms adopt the trial-and-error strategy to tune kernel size, so the larger-kernel effect is a very common problem.
In this paper, we first explore the mechanism of larger-kernel effect and then propose a novel low rank-based regularization to relieve this adverse effect.
Theoretically, we analyze the mechanism to introduce kernel estimation error in oversized kernel size.
Specifically, we reformulate convolution of (\ref{eq3}) and (\ref{eq4}) to affine transformations and analyze their properties on kernel size.
We show that for $\mathbf x$ in sparse distributions, this larger-kernel effect remains with probability one.
We also conduct simulation experiments to show that kernel error is expected to increase with kernel size even without noise $\mathbf n$.
Furthermore, we attempt to find out a proper regularization to suppress noise in large kernels.
By exploiting the low rank property of blur kernels, we propose a low-rank regularization to reduce noises in $\mathbf{\hat k}$, suppressing larger-kernel effect.
Experimental results on both synthetic and real blurry images validate the effectiveness of the proposed method, and show its robustness to against over-estimated kernel size. Our contributions are two-folds:
\begin{itemize}
\item
We give a thorough analysis to mechanism of the phenomenon that over-estimated kernel size yields inferior results in blind deconvolution, on which little research attention has been paid.
\item
We propose a low rank-based regularization to effectively suppress \textit{larger-kernel effect} along with efficient optimization algorithm, and performs favorably on oversized blur kernel than state-of-the-arts.
\end{itemize}
\section{Larger-kernel effect}
In this section, we describe the \textit{larger-kernel effect} in detail and provide a mathematical explanation.
\subsection{Phenomenon}
In Figure ~\ref{fig1}(b-c), it has shown that the larger the kernel size would lead to more inferior deblurring results, since the estimated blur kernel with larger support domain is very likely to introduce noises and estimation errors.
Figure ~\ref{fig1}(a) shows both the error ratio (err)~\cite{levin2009understanding} of restored images and the Summed Squared Difference (SSD) of estimated kernels reach the lowest at the truth size and increase afterwards.
\subsection{Mechanism}
To analyze the source of larger-kernel effect, we firstly introduce an interesting fact that we call \textit{inflating effect}.
\newtheorem{thm}{Claim}
\begin{thm}(Inflating Effect)
Let $ A = [\bm{v_1} \ldots \bm{v_n}]$, where $\bm{v_i} \in \mathbb{R}^m$ $(m \ge n + 1)$.
Let $ B = [\bm{w_1} \: A \: \bm{w_2}]$, where $ \bm{w_1}, \bm{w_2} \in \mathbb{R}^m $ and
$\mathrm{rank}(B)>\mathrm{rank}(A)$. Given an m-D random vector $\bm{b}$ whose elements
are i.i.d. with the continuous probability density function p, for $ \bm{u} \in \mathbb{R}^m$
$$ \Pr\big(\inf\{\|B\bm{u}-\bm{b}\|^2\}<\inf\{\|A\bm{u}-\bm{b}\|^2\}\big) = 1.$$
\end{thm}
\begin{proof}
\begin{equation*}
\begin{aligned}
&&&\Pr\big(\inf\{\|B\bm{u}-\bm{b}\|^2\}\ge \inf\{\|A\bm{u}-\bm{b}\|^2\}\big) \\
&=&&\Pr\big(\bm{b}\in \mathbb{R}^m \setminus (\spn\{B\}\setminus \spn\{A\})\big) \\
&=&&\int_\Omega {d {p(\bm{b})}}
\end{aligned}
\end{equation*}
where $\Omega = \mathbb{R}^m \setminus (\spn\{B\}\setminus \spn\{A\})$.
For $\mathrm{rank}(B)>\mathrm{rank}(A)$, we have $\mathrm{dim}(\spn\{B\}\setminus \spn\{A\}) > 0$. Hence, the Lebesgue measure of
$\Omega$ is zero, and the probability is zero.
\end{proof}
Claim 1 shows that padding linear independent columns to a thin matrix leads to a different least squares solution with lower residue squared cost.
The convolution part in (\ref{eq1}) is equivalent to linear transforms:
\begin{equation}\label{eq6}
\bm y = \mathbf T_{\mathbf{k}}\bm{x} + \bm n = \mathbf T_{\mathbf{x}}\bm{k} + \bm n.
\end{equation}
where italic letters $\bm y, \bm x$, $ \bm k $ and $\bm n $ represent column-wise expanded vectors of 2D $\mathbf y, \mathbf x$, $ \mathbf k $ and $\mathbf n $, respectively; $\mathbf T_{\mathbf k}\in\mathbb{R}^{MN\times MN}$ and $\mathbf{T_{\mathbf x}}\in \mathbb{R}^{MN\times LK}$ are blocked banded Toeplitz matrices~\cite{andrews1977digital, gray2006toeplitz}; $L$ and $K$ are required to be odd.
We attribute the larger-kernel effect to either substep \eqref{eq3} or \eqref{eq4}. On one hand, $\mathbf T_{\mathbf k}$ remains identical when $L$ and $K$ increase by wrapping a layer of zeros around $\mathbf k$ and the result of x-step keeps the same. Hence, x-step should not be blamed as the source of the larger-kernel effect. On the other hand, when $\mathbf k$ is larger, $\mathbf T_{\mathbf x}$ will become inflated for the same $\mathbf x$. In 1D cases, where $N = K = 1$, assume $L = 2l + 1$, then
\begin{equation}\label{eq_Tx}
\begin{aligned}
&\mathbf T_{\bm{x}}(L) \\= &\left[\begin{matrix}
x_{l+1}& \cdots& x_2& x_1& 0& \cdots& 0 \\
\vdots & & \vdots& x_2& x_1& \ddots& \vdots \\
x_{M-1}& & \vdots& \vdots& x_2& \ddots& 0 \\
x_M& \ddots& \vdots& \vdots& \vdots& \ddots& x_1 \\
0& \ddots& x_{M-1}& \vdots& \vdots& & x_2 \\
\vdots& \ddots& x_M& x_{M-1}& \vdots& & \vdots \\
0& \cdots& 0& x_M& x_{M-1}& \cdots& x_{M-l}
\end{matrix}\right]
\end{aligned}
\end{equation}
During blind deconvolution iterations, for identical values of $\bm{\hat x}^{(i)}$, a larger $L$ introduces more columns onto both sizes of $\mathbf T_{\bm{\hat x}^{(i)}}$ and results in different
solutions. To illustrate this point, we tested a 1D version of blind deconvolution without kernel regularization and took different values of $L$ (truth and double and four times the truth size) for the 50th
k-step optimization after 49 truth-size iterations (see Figure ~\ref{fig2}). Figure ~\ref{fig2}(a-c) show that the optimal solutions in different sizes differ slightly on the main body
that lies within the ground truth size (colored in red), but greatly outside this range (colored in green) where zeros are expected. Figure ~\ref{fig2}(d-f) compare
ground truth to estimated kernels in (a-c) after non-negativity and sum-to-one projections.
Larger sizes yield more positive noises; hence, they lower the
weight of the main body after projections and change the outlook of estimated kernel.
\begin{figure}[t]
\begin{center}
\setlength{\tabcolsep}{5pt}
\small
\begin{tabular}{cccc}
& \includegraphics[width=.4\linewidth]{sz.eps} &
\includegraphics[width=.4\linewidth]{psz} \vspace{0pt} \\
& (a) & (d)\\
\rotatebox{90}{Estimated kernels} & \includegraphics[width=.4\linewidth]{sz2} &
\includegraphics[width=.4\linewidth]{psz2} \vspace{0pt} \\
& (b) & (e) \\
&
\includegraphics[width=.4\linewidth]{sz4} &
\includegraphics[width=.4\linewidth]{psz4} \\
& (c) & (f) \\
& index & index \\
\end{tabular}\\
\end{center}
\caption{Estimated kernels in 1D Blind deconvolution simulations. Left column are optimized kernels of different sizes after 50\small{th} iteration. Right column are corresponding normalized kernels of left after non-negativity and sum-to-one projections. In this experiment, $\bm x$ is a 255$\times$1 vector extracted from a real image and the truth $\bm k$ is generated by marginalizing a $23\times23$ truth kernel from Levin's dataset~\cite{levin2009understanding}. The signal prior is $\frac{\ell_1}{\ell_2}$. This figure is recommended to view in color.}
\label{fig2}
\end{figure}
\subsection{Probability of larger-kernel effect}
Even if $\bm{\hat x}^{(i)}$ successfully iterates to truth $\bm{x}$, Claim 1 implicates
the larger-kernel effect remains under the existence of random noise $\bm n$.
We show
\begin{equation}\label{eq_pro_equals_1}
\Pr \left(\mathrm{rank}\left(\mathbf T_{\bm{x}}\left(L+2\right)\right) > \mathrm{rank} \left(\mathbf T_{\bm{x}} \left(L\right)\right)\right) = 1,
\end{equation}
under which, the \textit{inflating effect} holds for probability one in blind deconvolution.
\begin{figure*}[t]
\begin{center}
\includegraphics[width=\linewidth]{siyao3_h.pdf}
\end{center}
\caption{Quantitative simulations show that error increases with kernel size.
%
(a) The extracted row from a clear image.
%
(b) Singular boundaries of $\mathbf T_{\bm{x}}^\dagger$ and $\|\mathbf T_{\bm{x}}^\dagger \bm{n}\|$ with sampled $\bm n$. (c) Synthetic sparse signals. (d) The smallest, greatest and mean singular values of $(\mathbf T_{\bm x_{gt}}+\mathbf T_{\Delta \bm x})^\dagger \mathbf T_{\bm x_{gt}} - \mathbf I$.}
\label{fig3}
\end{figure*}
Above all, we have
\begin{equation}\label{eq_prob_trans}
\begin{aligned}
&\Pr \left(\mathrm{rank}\left(\mathbf T_{\bm{x}}\left(L+2\right)\right) > \mathrm{rank} \left(\mathbf T_{\bm{x}} \left(L\right)\right)\right)
\\ \ge &\Pr\left(\mathrm{rank}\left(\mathbf T_{\bm{x}}\left(M\right)\right)=M\right).
\end{aligned}
\end{equation}
Kaltofen and Lobo~\cite{kaltofen1996rank} proved
that for an M-by-M Toeplitz matrix composed of finite filed of $q$ elements,
\begin{equation}\label{eq_finite_prob}
\Pr\big(\mathrm{rank}(\mathbf T_{M\times M}) = M\big) = 1-1/q.
\end{equation}
Herein, clear images are statistically sparse on derivative fields~\cite{olshausen1996emergence, weiss2007makes}, and elements of $\bm x$ are modeled to be continuous in hyper-Laplacian distributions~\cite{krishnan2009fast}:
\begin{equation}\label{eq_pdf}
p({x}) = \begin{cases}
\beta \exp\left(-\gamma |x|^{\alpha}\right) & ,x \in [-1, 1] \\
0 &, otherwise.
\end{cases}
\end{equation}
Then we get the following claim:
\begin{thm}
$$ \Pr\big(\mathrm{rank}(\mathbf T_{\bm{x}}(M)) = M\big) = 1.$$
\end{thm}
\begin{proof}
See supplementary file.
\end{proof}
To now, we have shown that for $\mathbf{x}$ in sparse distribution, the \textit{inflating effect} happens almost surely.
\subsection{Quantification of error increment}
Assume $\mathbf{\hat x}$ iterates to ground truth $\mathbf{x}_{gt}$ during iterations. Then, for estimated kernel $\mathbf{\hat k}$, we have
\begin{equation}\label{eq_first_noise_k}
\begin{aligned}
\hat{\bm{k}} = \arg\min_{\bm k}{\|\mathbf T_{\bm x_{gt}}\bm k - \bm y\|^2}
= \bm k_{gt} + \mathbf T_{\bm x_{gt}}^\dagger \bm n
\end{aligned}
\end{equation}
where $\dagger$ represents Moore-Penrose pseudo-inverse. Then,
\begin{equation}\label{eq_first_noise_ssd}
SSD=\|\bm {\hat k} - \bm k_{gt} \|^2 = \|\mathbf T_{x_{gt}}^\dagger \bm n\|^2.
\end{equation}
Assume $\|\bm n\| = 1$, then
\begin{equation}\label{eq_first_bound}
s_1(\mathbf T_{\bm x_{gt}}^\dagger) \le \|\mathbf T_{\bm x_{gt}}^\dagger \bm n\| \le s_n(\mathbf T_{\bm x_{gt}}^\dagger),
\end{equation}
where $s_1$ and $s_n$ represents the smallest and the greatest singular values, respectively.
The \textit{inflating effect} implicates that a larger kernel size amplifies the error in $\mathbf {\hat k}$ due to noise $\mathbf n$. To quantify this increment, we extracted a line $\bm x$ from a clear image in Levin's set~\cite{levin2009understanding} as shown in Figure ~\ref{fig3}(a), and plotted $s_1(\mathbf T_{\bm{x}}^\dagger)$ and $s_n(\mathbf T_{\bm{x}}^\dagger)$ with increasing kernel size $L$. We also generated normalized random Gaussian vectors $\bm n$ and compared $\|\mathbf T_{\bm x} \bm n\|$ to simulated boundaries of singular values (see Figure ~\ref{fig3}(b)). The error in $\mathbf{\hat k}$ increases hyper-linearly with kernel size.
In practice, nuances are expected between $\mathbf{\hat{x}}$ and $\mathbf{x}_{gt}$. Cho and Lee~\cite{cho2016convergence} indicated that $\mathbf{\hat x}$ should be regarded as a sparse approximation to $\mathbf{x}_{gt}$, not the ground truth. Hence,
\begin{equation}\label{eq_not_same}
\mathbf{\hat x} = \mathbf{x}_{gt} + \Delta \mathbf x,
\end{equation}
which yields implicit noise~\cite{shan2008high}.
Assume $\mathbf n = \mathbf 0$, then,
\begin{equation}\label{eq_second_noise_conv}
\begin{aligned}
\mathbf{\hat x} \otimes \mathbf{k}_{gt} = \mathbf x_{gt} \otimes \mathbf k_{gt} + \Delta \mathbf x \otimes \mathbf k_{gt}
\end{aligned}
\end{equation}
and
\begin{equation}\label{eq_second_k}
\begin{aligned}
\bm{\hat k} = & \arg\min_{\bm k}\|\mathbf T_{\bm {\hat x}} \bm k - \bm y\|^2 \\
= & (\mathbf T_{\bm x_{gt}} + \mathbf T_{\Delta \bm x})^\dagger \mathbf T_{\bm x_{gt}}\bm{k}_{gt}.
\end{aligned}
\end{equation}
Then,
\begin{equation}\label{eq_second_ssd}
SSD=\|\left((\mathbf T_{\bm x_{gt}}+\mathbf T_{\Delta \bm x})^\dagger \mathbf T_{\bm x_{gt}}-\mathbf I\right)\bm{k}_{gt}\|^2.
\end{equation}
To quantify how singular values of $(\mathbf T_{\bm x_{gt}}+\mathbf T_{\Delta \bm x})^\dagger \mathbf T_{\bm x_{gt}} - \mathbf I$ changes with kernel size, we simulated 100 times, in each of which we generated a stochastic sparse signal $\bm x_{gt}$ with length 254 under PDF in (\ref{eq_pdf}) with $M = 254$, $\gamma = 10$ and $\alpha = 0.5$, and generated random Gaussian vector $\Delta \bm{x}$ where $ \|\Delta \bm x\| = \|\bm x_{gt}\| / 100$. Figure ~\ref{fig3}(c) shows one example of generated $\bm x_{gt}$ and $\Delta \bm{x}$. Figure ~\ref{fig3}(d) shows means and standard deviations of $s_1$, $s_n$ and $\bar s$, which is the average of singular values, of simulated $(\mathbf T_{\bm x}+\mathbf T_{\Delta \bm x})^\dagger \mathbf T_{\bm x} - \mathbf I$ on $L$. The error of $\mathbf{\hat k}$ is expected to grow with kernel size even $\mathbf n =0$.
\begin{figure*}[t]
\begin{center}
\includegraphics[width=0.9\linewidth]{siyao6m.pdf}
\end{center}
\caption{Singular values of clean kernels and noisy matrices. (a) The support domain (black) of a $47\times47$ random positive half Gaussian noise matrix. (b) The distribution of singular values of (a). (c) $\log\det$ costs of random Gaussian noise matrix (black), the truth kernel from~\cite{levin2009understanding} after zero-padding (red), and Gaussian PSF with $\text{size}/6$ standard deviation (blue) on kernel size. (d) Scaled (maximum to 1) singular value distributions of clean, impure and regularized kernels. }
\label{fig6}
\end{figure*}
\section{Low-rank regularization}
Blind deconvolution is an ill-posed problem for lacking sufficient information. Without regularization, MAP degrades to Maximum Likelihood (ML), which yields infinite solutions~\cite{levin2009understanding}. As prior information, kernel regularization should be designed to compensate the shortage of ML and to guide the optimization to expected results.
Great amount of studies focus on image regularization to describe natural images, e.g., Total Variation (TV-$\ell_1$)~\cite{levin2007image,wang2008new,ren2015fast}, hyper-Laplacian~\cite{krishnan2009fast}, dictionary sparsity~\cite{zhang2010bregmanized,hu2010single}, patch-based low rank prior~\cite{ren2016image}, non-local similarity~\cite{dong2013nonlocal} and deep discriminative prior~\cite{li2018learning}.
Unfortunately, kernel optimization doesn't attract much attention of the literature. Previous works adopted various kernel regularizations, e.g., $\ell_2$-norm~\cite{xu2010two, gong2016blind, cho2009fast, xu2013unnatural,pan2016blind}, $\ell_1$-norm~\cite{krishnan2011blind, shan2008high, pan2016robust} and $\ell_\alpha$-norm $(0<\alpha<1)$~\cite{zuo2015discriminative}, which, however, generally treated kernel regularization as an accessory and lacked a detailed discussion.
The larger-kernel effect is yielded by noise in ultra-sized kernels. Figure ~\ref{fig1} and Figure ~\ref{fig2} show that without kernel regularization, the main bodies of estimated kernels can emerge clearly, but increasing noises take greater amounts when $k$ is larger. To constrain $\hat k$ to be clean, regularization $h$ is expected to distinguish noise from ideal kernels efficiently.
To suppress the noise in estimated kernels, we take low-rank regularization on $k$ such that k-step \eqref{eq4} becomes
\begin{equation}\label{eq_low_rank_opt}
\mathbf{\hat{k}}^{(i+1)} = \arg\min_{\mathbf k}{\left(\|\mathbf{\hat{x}}^{(i+1)}\otimes \mathbf k- \mathbf y\|^2+\sigma \mathrm{rank}\left(\mathbf k\right)\right)}.
\end{equation}
Because the direct rank optimization is an NP-hard problem, continuous proximal functions are required. Fazel~\textit{et~al.}~\cite{fazel2003log} proposed
\begin{equation}\label{heuristic_proxy}
\log\det\left(\mathbf X + \delta \mathbf I\right)
\end{equation}
as a heuristic proxy for
$\mathbf X\in \mathbb{S}^N_+ $ where $\mathbf I$ is the N-by-N identity matrix and $\delta$
is a small positive number.
To allow this approximation to play a role in general matrices, the low-rank object is substituted to $(\mathbf X \mathbf X^T)^{1/2}$~\cite{dong2014compressive}. The regularization function then becomes
\begin{equation}\label{heuristic_proxy2}
h(\mathbf X)=\log{\det ((\mathbf X \mathbf X^T)^{\frac{1}{2}}+\delta \mathbf I)} = \sum_j \log(s_i + \delta),
\end{equation}
where $s_i$ is the $i$-th singular value of $X$.
Taking low-rank regularization on kernels is motivated by a generic phenomenon of noise matrices~\cite{andrews1977digital}.
Figure ~\ref{fig6}(a-b) shows a non-negative Gaussian noise matrix and its singular values in decreasing order. For a noise matrix, where light and darkness alternate irregularly, the distribution of singular values decays sharply at lower indices; then, it breaks and drag a relatively long and flat tail to the last.
In contrast, ideal kernels respond much lower to $\log\det$ regularization (see Figure ~\ref{fig6}(c)).
Based on this fact, noise matrices are distinguished by high $\log\det$ cost from real kernels. Figure ~\ref{fig6}(d) shows that singular values of a low-rank regularized kernel are distributed similarly as the ground truth, compared with the impure one.
One intelligible explanation on the low-rank property of ideal kernels is the continuity of blur motions. Rank of a matrix equals the number of independent rows or columns; it reversely reflects how similar these rows or columns are. Speed of a camera motion is deemed to be continuous~\cite{fang2014separable}. Hence, the local trajectory of a blur kernel emerges similar to neighbor pixels, which is measured in a low value by the continuous proxy of rank.
\begin{figure}[t]
\begin{center}
\includegraphics[width=0.8\linewidth]{insight.pdf}
\end{center}
\caption{Comparison on respond to noise. The cost ratio is calculated as $1+\frac{\text{cost}(\epsilon)-\text{cost}(0)}{|\text{cost}(0)|}$. This figure is recommended to view in color.}
\label{fig7}
\end{figure}
Compared to previous $\ell_{\alpha}$ norms, low-rank regularization responds more efficiently to noise. To illustrate this point,
we generated a noisy kernel by adding a small percentage ($\epsilon$) of non-negative Gaussian
noise and $1-\epsilon$ of the real kernel. Figure ~\ref{fig7} shows that the low-rank cost rapidly adjust favorably to the noise but $\ell_{\alpha}$ norms fail. That is because $\ell_\alpha$ only takes statistical information. An extreme example consists of disrupting a truth kernel and randomly reorganizing its elements, with $\ell_\alpha$ cost unchanged. In contrast, rank (singular values) corresponds to structural information.
\section{Optimization}
Function $\log\det$ is non-convex (and it is actually concave on $\mathbb{S}_+$). To solve the low-rank regularized least
squares ~\eqref{eq4},
we introduce an auxiliary variable $\Psi = k$ and reformulate the optimization into
\begin{equation}\label{2_optimiz}
\begin{aligned}
\min_{\mathbf k, \mathbf \Psi} & \left(\mathbf{\|\hat x}^{(i+1)}\otimes \mathbf \Psi-\mathbf y\|^2 +
\sigma\log\det\left(\left(\mathbf k \mathbf k\right)^{\frac{1}{2}}+\delta\mathbf{I}\right)\right) \\
\text{s.t. } & \mathbf \Psi = \mathbf k
\end{aligned}
\end{equation}
Using the Lagrange method, (\ref{2_optimiz}) is solved by two alternate sub-optimizations
\begin{equation}\label{eq:two_step}
\left\{
\begin{aligned}
\mathbf{\hat \Psi}^{(j+1)} &= \arg\min_{\mathbf \Psi} {\|\mathbf{\hat x}^{(i+1)}\otimes \mathbf \Psi-\mathbf y\|^2 + \mu \|\mathbf \Psi -
\mathbf {\hat k}^{(j)}\|^2 }\\
\mathbf{\hat k}^{(j+1)} &= \arg\min_{\mathbf k}{
\frac{1}{2\tau}\|\mathbf k-\mathbf{\hat\Psi}^{(j+1)}\|^2+\sigma h(\mathbf k)}
\end{aligned}
\right.
\end{equation}
where $j$ is the iteration number while $\mu$ and $\tau$ are trade-off parameters.
The $\Psi$-substep is convex and accomplished using the Conjugate Gradient (CG) method. For $k$-substep,
low rank is adopted with limit; otherwise, the regularization may change the
main body of kernel---an extreme result is $\mathbf{\hat k} = 0$. Thus, our strategy is to lower
the rank at $\mathbf{\hat \Psi}$ locally. Using the first-order Taylor expansion of $h$ at fixed matrix $\mathbf Z$:
\begin{equation}\label{taylor}
\begin{aligned}
h_{\mathbf Z}(\mathbf X)=h\left(\mathbf Z\right) + \sum_i\frac{s_i-\hat{s}_i}{\hat{s}_i+\delta},
\end{aligned}
\end{equation}
where $\hat{s}_i$ is the $i$-th eigenvalue of $\mathbf Z$, the k-substep in \eqref{eq:two_step} is transformed into an iterative optimization
\begin{equation}\label{final_eq}
\mathbf k^{(t+1)} = \arg\min_{\mathbf k}
\left(\frac{1}{2\tau}\|\mathbf k-\mathbf{\hat\Psi}^{(j+1)}\|^2+\sigma h_{\mathbf k^{(t)}}\left(\mathbf k\right) \right)
\end{equation}
where $t$ is the inner iteration number. For convenience, we set $\sigma$ as a flag (if $\sigma=0$, the k-substep will be skipped) and only tuned $\tau$ as the trade-off parameter.
Define the proximal mapping of function $\phi$ as follows:
\begin{equation}\label{prox1}
\prox_\phi(v) = \arg\min_u\left(\frac{1}{2}\|u-v\|^2 + \phi(u)\right).
\end{equation}
Dong~\textit{et~al.}~\cite{dong2014compressive} proved that one solution to the proximal mapping of $\tau h_{\mathbf Z}$ is
\begin{equation}\label{prox2}
\prox_{\tau
h_{\mathbf Z}}\left(\mathbf X\right)=\mathbf U\left(\mathbf \Sigma-\tau\mathrm{diag}\left(\bm{w}\right)\right)_+\mathbf V^T
\end{equation}
where
$\mathbf U\mathbf \Sigma \mathbf V^T$ is SVD of $\mathbf X$, $w_i = 1/\left(\hat{s}_i+\delta \right) $
and
${(\cdot)}_+=\max{\{ \cdot,0 \}}$.
Local low-rank optimization is implemented as iterations via the given parameter $\tau$ (see Algorithm~\ref{algk}).
In our implementation, $\mu$ is designed to exponentially grow with $j$ to allow more freedom of $\mathbf{\hat \Psi}$ for early iterations.
\emph{Overall Implementation.} We took deconvolution sechme in~\cite{krishnan2011blind} where $g = \ell_1/\ell_2$ (but with small modification) and applied non-blind deconvolution method proposed in~\cite{krishnan2009fast}.
\begin{algorithm}[t]
\caption{Updating k with low-rank regularization}\label{algk}
\begin{algorithmic}[1]
\Require{$\mathbf x$, $\mathbf y$, $\mu$, $\tau$, $OuterIterMax$, $CGIterMax$, $innerIterMax$}
\Ensure{$\mathbf{\hat k}$}
\For{$j\gets0$ to $OuterIterMax - 1$}
\If{$j=0$}
\State{$\mathbf{\hat \Psi}^{(j+1)}\gets \min_{\mathbf\Psi} \|\mathbf x\otimes\mathbf \Psi-\mathbf y\|^2 $ using CG
with maximum $CGIterMax$ iterations}
\Else
\State{$\mu^{(j)} \gets \mu \left(e^j/e^{OuterIterMax}\right)$}
\State{\small{$\mathbf{\hat \Psi}^{(j+1)}\gets \min_{\mathbf \Psi}{ \|\mathbf x \otimes \mathbf \Psi - \mathbf y\|^2 + \mu^{(j)} \|\mathbf \Psi - \mathbf k^{(j)}\|^2 }$} using CG with $CGIterMax$ iterations}
\EndIf
\State{Initializing $\mathbf k^{(0)}$ with all singular values equal to 1}
\For{$t\gets 0$ to $innerIterMax - 1$}
\State{$\mathbf k^{(t+1)}\gets \prox_{\tau h_{\mathbf k^{(t)}}}\left(\mathbf{\hat \Psi}^{(j)}\right)$}
\EndFor{}
\State{$\mathbf{\hat k}^{(j+1)}\gets \max\{\mathbf k^{(innerIterMax)}, 0\}$}
\State{$\mathbf{\hat k}^{(j+1)}\gets \mathbf{\hat k}^{(j+1)}/\sum \mathbf{\hat k}^{(j+1)}$}
\EndFor
\State{$\mathbf{\hat k}\gets \mathbf{\hat k}^{(outerIterMax)}$}
\end{algorithmic}
\end{algorithm}
\begin{algorithm}[t]
\caption{Blind Deconvolution (single-scaling version)}\label{algall}
\begin{algorithmic}[1]
\Require{blurry image $\mathbf y$, kernel size $L$, $\lambda$, $\eta$, $\tau$, $IterMax$}
\Ensure{clear image $x$ and degradation kernel $k$}
\State{$\mathbf y\gets\left[\mathbf \nabla_h{\mathbf y}, \mathbf \nabla_v{\mathbf y}\right]$}
\State{Initialize $\mathbf x \gets \mathbf y$}
\State{Initialize $\mathbf k$ with an $L\times L$ zero matrix adding [0.5 0.5] in the center}
\For{$t\gets 1$ to $IterMax$}
\State{Update $\mathbf x$ using Algorithm 3 in~\cite{krishnan2011blind}}
\State{Update $\mathbf k$ using Algorithm~\ref{algk}}
\EndFor{}
\State{$x\gets$ Non-blind deconvolution $(\mathbf k, \mathbf y)$}
\end{algorithmic}
\end{algorithm}
\section{Experimental Results}
In this section, we first discuss the effects of low rank-based regularization, then evaluate the proposed method on benchmark datasets, and finally demonstrate its effectiveness on real-world blurry images.
The source code is available at \url{https://github.com/lisiyaoATbnu/low_rank_kernel}.
\begin{figure}[b]
\centering
\setlength{\tabcolsep}{3pt}
\small
\begin{tabular}{ccc}
\includegraphics[width=.29\linewidth]{cxk1} &
\includegraphics[width=.29\linewidth]{cxk2} &
\includegraphics[width=.29\linewidth]{cxk3} \vspace{-4pt} \\
size=23, err=1.55 & size=47, err=1.56 & size=69, err=2.14 \vspace{1pt}\\
\end{tabular}\\
\caption{Deblurring results using low-rank regularization.}\label{fig8}
\end{figure}
\begin{figure*}[t]
\centering
\setlength{\tabcolsep}{1pt}
\small
\begin{tabular}{ccccccccccccccccccccc}
\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/blur11}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/blur11_31_2}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/blur11_61_rank2}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/blur11_61_non2}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/blur11_61_l22}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/blur11_61_l12}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/blur11_61_la2}} \vspace{-1pt}\\
\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/hanzi}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/hanzi_31}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/hanzi_61_rank}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/hanzi_61_non}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/hanzi_61_l2}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/hanzi_61_l1}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/hanzi_61_la}} \vspace{-1pt}\\
\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/nv}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/nv_31}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/nv_61_rank}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/nv_61_non}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/nv_61_l2}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/nv_61_l1}}
&\multicolumn{3}{c}{\includegraphics[width=0.13\linewidth]{final_fig8/nv_61_la}} \vspace{-1pt}\\
\multicolumn{3}{c}{Blurry}
& \multicolumn{3}{c}{$31\times31$}
& \multicolumn{3}{c}{Low rank}
& \multicolumn{3}{c}{None}
& \multicolumn{3}{c}{$\ell_2$}
& \multicolumn{3}{c}{$\ell_1$}
& \multicolumn{3}{c}{$\ell_\alpha$} \vspace{10pt}\\
\end{tabular}\\
\caption{Comparison of different kernel priors on real-world images. Large kernel size is $61\times61$. It's recommended to zoom in.}
\label{fig9}
\end{figure*}
\begin{figure}[t]
\centering
\setlength{\tabcolsep}{0.2pt}
\small
\begin{tabular}{cc}
\includegraphics[width=0.49\linewidth]{compare1}
& \includegraphics[width=0.49\linewidth]{compare2}\\
\small{(a)} & \small{(b)}\\
\end{tabular}\\
\caption{Success rates on truth (a) and double (b) sizes. }
\label{fig10}
\end{figure}
\subsection{Effects of low rank-based regularization}
Corresponding to high error ratios of large kernels in Figure ~\ref{fig1},
we repeat the experiment using same parameters except $\mu$ and $\sigma$. Figure ~\ref{fig8} shows
low-rank regularized kernels are much more robust to kernel size. Noises in kernels are efficiently reduced and qualities of restored images are enhanced.
We further verify it on real-world images by imposing different regularization terms. As in Figure ~\ref{fig9}, blur kernels with low-rank regularization have less noises, while the others suffer from strong noises, yielding artifacts in the deblurring images.
We note that in experiments of Figure ~\ref{fig8} and Figure ~\ref{fig9}, we deliberately omitted multi-scaling scheme to expose the effectiveness of low-rank regularization itself.
\subsection{Evaluation on synthetic dataset}
The proposed method is quantitatively evaluated on dataset from~\cite{levin2009understanding}. Figure ~\ref{fig10} shows the success rates of state-of-the-art methods versus our implementations with and without (set $\mu$ and $\sigma$ zero) low-rank regularization. The average PSNRs in Figure ~\ref{fig10} with different sizes are compared in Table~\ref{table:psnr}. Parameters are fixed during the whole experiment: $\sigma=1$, $\mu=1$, $\tau=5\times10^{-5}$, $OuterIterMax=20$, $CGIterMax=3$ and $innerIterMax=10$; a 7-layer multi-scaling pyramid is taken. Kernel elements smaller than 1/20 of the maximum are cut to zero, which is also taken in \cite{cho2009fast,krishnan2009fast}. Low-rank regularization works more effectively than the regularization-free implementation and the state-of-art.
\begin{table}[t]
\small
\centering
\begin{tabular}{cccc}
\hline
Method & prior & truth size & double size
\\
\hline
\cite{perrone2014total} &-- & 27.34 &23.29
\\\cite{cho2009fast} & $\ell_2$ &26.85 & 25.74
\\ \cite{xu2010two} & $\ell_2$ &26.91 & 26.71
\\ \cite{shan2008high} & $\ell_1$ & 26.54 & 26.44
\\\cite{krishnan2011blind} & $\ell_1$ &25.34 & 23.95
\\\cite{zuo2015discriminative} & $\ell_\alpha$ &26.58 & 26.83
\\\hline
$\sigma=0$ & -- & 26.68 & 23.85
\\$\sigma=1$ &$\log\det$ & \textbf{27.36} & \textbf{27.47} \\
\hline
\end{tabular} \vspace{10pt} \\
\caption{Average PSNRs (dB) with truth and double sizes in experiments of Figure ~\ref{fig10}.}
\label{table:psnr}
\end{table}
\begin{figure*}[t!]
\begin{center}
\setlength{\tabcolsep}{1pt}
\small
\begin{tabular}{cccc}
\includegraphics[width=0.21\linewidth]{roma_blur}
&\includegraphics[width=0.21\linewidth]{cho_roma_xkk.jpg}
&\includegraphics[width=0.21\linewidth]{cho_roma_xkk2.jpg}
&\includegraphics[width=0.21\linewidth]{xu_roma_xkk.jpg}
\vspace{-4pt}\\
Blurry & $\ell_2$~\cite{cho2009fast} $85\times85$ & $\ell_2$~\cite{cho2009fast} $185\times185$ & $\ell_2$~\cite{xu2010two} $85\times85$\\
\includegraphics[width=0.21\linewidth]{xu_roma_xkk2.jpg}
&\includegraphics[width=0.21\linewidth]{krishnan_roma_xkk.jpg}
&\includegraphics[width=0.21\linewidth]{krishnan_roma_xkk2.jpg}
&\includegraphics[width=0.21\linewidth]{zuo_roma_xkk.jpg} \vspace{-4pt}\\
$\ell_2$~\cite{xu2010two} $185\time185$ & $\ell_1$~\cite{krishnan2011blind} $85\times85$ & $\ell_1$~\cite{krishnan2011blind} $185\time185$ & $\ell_\alpha$~\cite{zuo2015discriminative} $85\times85$ \\
\includegraphics[width=0.21\linewidth]{zuo_roma_xkk2.jpg}
&\includegraphics[width=0.21\linewidth]{ours_roma_xkk.jpg}
&\includegraphics[width=0.21\linewidth]{ours_roma_non_xkk2.jpg}
&\includegraphics[width=0.21\linewidth]{ours_roma_xkk2.jpg} \vspace{-4pt}\\
$\ell_\alpha$~\cite{zuo2015discriminative} $185\times185$ & Low rank (ours) $85\times85$ &None (ours) &Low rank (ours) $185\times185$\\
\end{tabular}\\
\end{center}
\caption{Test on real-world image \texttt{roma}. Each domain (positive parts) of estimated kernel is displayed at the bottom right corner of corresponding restored image.}
\label{fig11}
\end{figure*}
\begin{figure*}[t!]
\begin{center}
\setlength{\tabcolsep}{2pt}
\small
\begin{tabular}{ccc}
\includegraphics[width=0.26\linewidth]{postcard.jpg}
&\includegraphics[width=0.26\linewidth]{cho_postcard_xkk.jpg}
&\includegraphics[width=0.26\linewidth]{xu_postcard_xkk.jpg} \vspace{-2pt}\\
Blurry & $\ell_2$, 1/20 max threshold~\cite{cho2009fast} & $\ell_2$, heuristic domain detector~\cite{xu2010two} \\
\includegraphics[width=0.26\linewidth]{krishnan_postcard_xkk.jpg}
&\includegraphics[width=0.26\linewidth]{zuo_postcard_xkk.jpg}
&\includegraphics[width=0.26\linewidth]{ours_last_tune.png}
\vspace{-2pt}\\
$\ell_1$~\cite{krishnan2011blind}, 1/20 max threshold & $\ell_\alpha$, none~\cite{zuo2015discriminative} & Low rank, 1/20 max threshold\\
\end{tabular}\\
\end{center}
\caption{Test on real-world image \texttt{postcard}. Kernel regularizations are listed under restored images.}
\label{fig12}
\end{figure*}
\subsection{Evaluation on real-world blurry images}
We compared our implementation to state-of-the-art methods on real-world images to reveal the robustness of low rank regularization on large kernel size. Specifically, \cite{xu2010two} takes a heuristic iterative support domain detector based on the differences of elements of $\hat k$, which is regarded to be more effective than 1/20 threshold. Figure ~\ref{fig11} shows that $185\times185$ size yields strong noises in estimated kernels of previous works~\cite{cho2009fast,xu2010two}, and even changes main bodies of kernels~\cite{krishnan2011blind,zuo2015discriminative}. In contrast, low rank regularization can keep the kernel relatively stable for the larger size. One more comparison of different regularizations and refinement methods on large kernel size are shown in Figure~\ref{fig12}.
As for computational efficiency of our method, it takes about 85s on a Lenovo ThinkCentre computer with Core i7 processor to process images with size $255\times 255$.
\section{Conclusion}
In this paper, we demonstrate that over-estimated kernel sizes produce increased noises in estimated kernel. We attribute the larger-kernel effect to the \textit{inflating effect}. To reduce this effect, we propose a low-rank based regularization on kernel, which could suppress noise while remaining restored main body of optimized kernel.
The success of blind deconvolution is contributed by many aspects. In practical implementations, even for noise-free $\mathbf y$, the intermediate $\mathbf{\hat x}^{(i)}$ is unlikely to iterate to ground truth, hence some parts of $\mathbf y$ will be treated as implicit noises, which may intensify the effect even more than expected and require future researches.
\section*{Acknowledgement}
This work is supported by the grants from the National Natural Science Foundation of China (61472043) and the National Key R\&D program of China (2017YFC1502505).
We thank Ping Guo for constructive conversation.
Qian Yin is the corresponding author.
\newpage
{\small
\bibliographystyle{ieee}
| {'timestamp': '2019-02-25T02:14:34', 'yymm': '1706', 'arxiv_id': '1706.01797', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01797'} | arxiv |
\section{Introduction}
Establishing causal relations between variables from observation of their behaviour in time is central to scientific investigation and it is at the core of data-science where these causal relations are the basis for the construction of useful models and tools capable of prediction.
The capability to predict (future) outcomes from the analytics of (past) input data is crucial in modeling and it should be the main property to take into consideration in model selection, when the validity and meaningfulness of a model is assessed.
From an high-level perspective, we can say that the whole scientific method is constructed around a circular procedure consisting in observation, modelling, prediction and testing. In such a procedure, the accuracy of prediction is used as a selection tool between models.
In addition, the principle of parsimony favours the simplest model when two models have similar predictive power.
The scientific method is the rational process that, for the last 400 years, has mostly contributed to scientific discoveries, technological progresses and the advancement of human knowledge.
Machine learning and data-science are nowadays pursuing the ambition to mechanize this discovery process by feeding machines with data and using different methodologies to build systems able to make models and predictions by themselves.
However, the automatisation of this process requires to identify, without the help of human intuition, the relevant variables and the relations between these variables out of a large quantity of data.
Predictive models are methodologies, systems or equations which identify and make use of such relations between sets of variables in a way that the knowledge about a set of variables provides information about the values of the other set of variables.
This problem is intrinsically high-dimensional with many input and output data.
Any model that aims to explain the underlying system will involve a number of elements which must be of the order of magnitude of the number of relevant relations between the system's variables.
In complex systems, such as financial markets or the brain, prediction is probabilistic in nature and modeling concerns inferring the probability of the values of a set of variables given the values of another set.
This requires the estimation of the joint probability of all variables in the system and, in complex systems, the number of variables with potential macroscopic effects on the whole system is very large.
This poses a great challenge for the model construction/selection and its parameter estimation because the number of relations between variables scales with -at least- the square of the number of variables but, \CR{for a given fix} observation window, the amount of information gathered from such variables scales -at most- linearly with the number of variables \cite{bruckstein2009sparse,theodoridis2012sparsity}.
For instance, a linear model for a system with $p$ variables requires the estimation from observation of $p(p+1)/2$ parameters (the distinct elements of the covariance matrix).
In order to estimate $\mathcal O(p^2)$ parameters one needs a comparable number of observations requiring time series of length $q \sim p$ or larger to gather a sufficient information content from a number of observations which scales as $p \times q \sim \mathcal O(p^2)$.
However, the number of parameters in the model can be reduced by considering only $\mathcal O(p)$ out of the $\mathcal O(p^2)$ relations between the variables reducing in this way the required time series length to $\mathcal O(p)$.
Such models with reduced numbers of parameters are referred in the literature as sparse models.
In this paper we consider two instances of linear sparse modelling: Glasso \cite{tibshirani1996} which penalizes non-zero parameters by introducing a $\ell_1$ norm penalization and LoGo \cite{LoGo16} which reduces the inference network to an $\mathcal O(p)$ number of links selected by using information filtering networks \cite{asteetal2005,tumminelloetal2005,TMFG}.
The results from these two sparse models are compared with the $\ell_2$ norm penalization (non-sparse) ridge model \cite{tikhonov1963solution,hoerl1970ridge}.
{
This paper is an exploratory attempt to map the parameter-regions of time series length, number of variables, penalization parameters and kinds of models to define the boundaries where probabilistic models can be reasonably constructed from the analytics of observation data.
In particular, we investigate empirically, \CR{by means of a linear autoregressive model with sparse inference structure,} the true \CR{causality} link retrieval performances in the region of short time-series and large number of variables which is the most critical region -- and the most interesting -- in many practical cases.
\CR{Causality is defined in information theoretic sense as a significant reduction on uncertainty over the present values of a given variable provided by the knowledge of the past values of another variable obtained in excess to the knowledge provided by the past of the variable itself and --in the conditional case-- the past of all other variables \cite{zaremba2014measures}. We measure such information by using transfer entropy and, within the present linear modelling, this coincides with the concept of Granger causality and conditional Granger causality \cite{schreiber2000measuring}.
The use of transfer entropy has the advantage of being a concept directly extensible to non-linear modelling.
However, non-linearity is not tackled within the present paper.
Linear models with multivariate normal distributions have the unique advantage that causality and partial correlations are directly linked, largely simplifying the computation of transfer entropy and directly mapping the problem into the sparse inverse covariance problem \cite{tibshirani1996,LoGo16}.
}
Results are reported for artificially generated time series from an autoregressive model of $p=100$ variables and time series lengths $q$ between 10 and 20,000 data points.
Robustness of the results has been verified over a wider range of $p$ from 20 to 200 variables.
Our results demonstrate that sparse models are superior in retrieving the true causality structure for short time series.
Interestingly, this is despite considerable inaccuracies in the inference network of these sparse models.
We indeed observe that statistical validation of causality is crucial in identifying the true causal links, and this identification is highly enhanced in sparse models.
}
The paper is structured as follows.
In section \ref{s.definitions} we briefly review the basic concepts of mutual information and conditional transfer entropy and their estimation from data that will then be used in the rest of the paper.
We also introduce the concepts of sparse inverse covariance, inference network and causality networks.
Section \ref{s.causalNet} concerns the retrieval of causality network from the computation and statistical validation of conditional transfer entropy.
Results are reported in Section \ref{s.results} where the retrieval of the true causality network from the analytics of time series from an autoregressive process of $p=100$ variables is discussed.
Conclusions and perspectives are given in Section \ref{s.conclusions}.
\section{Estimation of conditional transfer entropy from data}
\label{s.conditionslSigma}\label{s.definitions}
In this paper causality is quantified by means of statistically-validated transfer entropy.
Transfer entropy $T(\mathbf{ Z_i} \rightarrow \mathbf{ Z_j})$ quantifies the amount of uncertainty on a random variable, $\mathbf{ Z_j}$, explained by {the past} of another variable, $\mathbf{Z_i}$ conditioned to the knowledge about the past of $\mathbf{ Z_j}$ itself.
Conditional transfer entropy, $T(\mathbf{ Z_i} \rightarrow \mathbf{ Z_j} | \mathbf W)$, includes an extra condition also to a set variables $\mathbf W$.
These quantities are introduced in details in Appendix \ref{cTE} (see also \cite{shannon2001mathematical,schreiber2000measuring,anderson1984multivariate}).
Let us here just report the main expression for the conditional transfer entropy that we shall use in this paper:
\begin{align}\label{General_cTE}
T(\mathbf{ Z_i} \rightarrow \mathbf{ Z_j}|\mathbf{ W}) & {}=
H(\mathbf Z_{\mathbf j,t} | \{\mathbf Z_{\mathbf j,t}^{lag},\mathbf{ W}_{t}\})
-
H(\mathbf Z_{\mathbf j,t} | \{\mathbf Z_{\mathbf i,t}^{lag},\mathbf Z_{\mathbf j,t}^{lag},\mathbf{ W}_{t}\}) \;\;.
\end{align}
Where $H(.|.)$ is the conditional entropy, $\mathbf Z_{\mathbf j,t}$ is a random variable at time $t$, whereas $\mathbf Z_{\mathbf i,t}^{lag} =\{ \mathbf Z_{\mathbf i,t-1},...,\mathbf Z_{\mathbf i,t-\tau}\}$ is the lagged set of random variable `$\mathbf i$' considering previous times $t-1...t-\tau$ and $\mathbf{ W}_{t}$ are all other variables and their lags (see Appendix \ref{cTE}, Eq.\ref{General_cTE1}).
In this paper we use Shannon entropy and restrict to linear modeling with multivariate normal setting (see Appendix \ref{Shannon}).
In this context the conditional transfer entropy can be expressed in terms of the determinants of conditional covariances $\mbox{det}( \mathbf \Sigma(.|.))$ (see Eq.\ref{H2} in Appendix \ref{Shannon}):
\begin{align}\label{General_cTE_Sigma}
T(\mathbf{ Z_i} \rightarrow \mathbf{ Z_j}|\mathbf{ W}) & {}=
\frac12 \log \mbox{det}\!\left( \mathbf \Sigma(\mathbf Z_{\mathbf j,t} | \{\mathbf Z_{\mathbf j,t}^{lag},\mathbf{ W}_{t}\})\right)
-
\frac12 \log \mbox{det}\!\left( \mathbf \Sigma(\mathbf Z_{\mathbf j,t} | \{\mathbf Z_{\mathbf j,t}^{lag},\mathbf Z_{\mathbf i,t}^{lag},\mathbf{ W}_{t}\})\right) \;\;.
\end{align}
Conditional covariances can be conveniently computed in terms of the inverse covariance of the whole set of variables
$\mathbf Z_t = \{ \mathbf Z_{k,t},\mathbf Z_{k,t-1},...\mathbf Z_{k,t-\tau}\}_{k=1}^p \in \mathbb R^{p\times(\tau+1)}$
(see Appendix \ref{InverseCovJandSigma}).
Such inverse covariance matrix, $\mathbf J$, represents the structure of conditional dependencies among all couples of variables in the system and their lags.
Each sub-part of $\mathbf J$ is associated with the conditional covariances of the variables in that part with respect to all others.
In terms of $\mathbf J$, the expression for the conditional transfer entropy becomes:
\begin{align}\label{TE20}
T(\mathbf{ Z_i} \rightarrow \mathbf{ Z_j}|\mathbf{ W}) = - \frac12 \log\mbox{det}\! \left(\mathbf {J_{1,1}} - \mathbf {J_{1,2}} (\mathbf {J_{2,2}})^{-1} \mathbf {J_{2,1}})\right)+ \frac12 \log \mbox{det}\! \left (\mathbf{ J_{1,1} }\right ) \;\;.
\end{align}
where the indices `$\mathbf 1$' and `$\mathbf 2$' refer to sub-matrices of $\mathbf J$ respectively associated with the variables $ \mathbf Z_{\mathbf j,t}$ and $\mathbf Z_{\mathbf i,t}^{lag}$.
\CB{
\subsection{Causality and inference networks}
The inverse covariance $\mathbf J$, also known as precision matrix, represents the structure of conditional dependencies.
If we interpret the structure of $\mathbf J$ as a network, where nodes are the variables and non-zero entries correspond to edges of the network, then we shall see that any two sub-sets of nodes that are not directly connected by one or more edges are conditionally-independent.
Condition is with respect to all other variables.
Links between variables at different lags are associated with causality with direction going from larger to smaller lags.
The network becomes therefore a directed graph.
In such a network entropies can be associated with nodes, conditional mutual information can be associated with edges between variables with the same lag and conditional transfer entropy can be associated to edges between variables with different lags.
A nice property of this mapping of information measures with directed networks is that there is a simple way to aggregate information which is directly associated with topological properties of the network.
Entropy, mutual information and transfer entropies can be defined for any aggregated sub set of nodes with their values directly associated to the presence, direction and weight of network edges between these sub-parts.
Non-zero transfer entropies indicating --for instance-- variable $\mathbf i$ causing variable $\mathbf j$ are associated with some non-zero entries in the inverse covariance matrix $\mathbf J$ between lagged variables $\mathbf i$ (i.e. $\mathbf{ Z_{i}}_{,t-\tau}$, with $\tau >0$) and variable $\mathbf j$ (i.e. $\mathbf{ Z_{j}}_{,t}$)).
\CR{In linear models, }these non-zero entries define the \CR{estimated} {\it inference network}.
However, not all edges in this inference network correspond to transfer entropies that are significantly different from zero.
To extract the structure of the {\it causality network} we shall retain only the edges in the inference network which correspond to statistically validated transfer entropies.
}
Conditioning eliminates the effect of the other variables retaining only the exclusive contribution from the two variables in consideration.
This should provide estimations of transfer entropy that are less affected by spurious effects from other variables.
On the other hand, conditioning in itself can introduce spurious effects, indeed two independent variables can become dependent due to conditioning \cite{anderson1984multivariate}.
In this paper we explore two extreme conditioning cases: i) condition to all other variables and their lags; ii) unconditioned.
{
In principle, one would like to identify the maximal value of $T(\mathbf{ Z_i} \rightarrow \mathbf{ Z_j} | \mathbf W)$ over all lags and all possible conditionings $\mathbf W$.
However, the use of multiple lags and conditionings increases the dimensionality of the problem making estimation of transfer entropy very hard especially when only a limited amount of measurements is available (i.e. short time-series).
This is because the calculation of the conditional covariance requires the estimation of the inverse covariance of the whole set of variables and such an estimation is strongly affected by noise and uncertainty.
Therefore, a standard approach is to reduce the number of variables and lags to keep dimensionality low and estimate conditional covariances with appropriate penalizers \cite{tikhonov1963solution,hoerl1970ridge,tibshirani1996,friedmanetal2008}.
An alternative approach is to invert the covariance matrix only locally on low dimensional sub-sets of variables selected by using information filtering networks \cite{asteetal2005,tumminelloetal2005,TMFG} and then reconstruct the global inversion by means of the LoGo approach \cite{LoGo16}.
Let us here briefly account for these two approaches. }
\subsection{Penalized inversions}
The estimate of the inverse covariance is a challenging task to which a large body of literature has been dedicated \cite{friedman2008sparse}.
From an intuitive perspective, one can say that the problem lies in the fact that uncertainty is associated with nearly zero eigenvalues of the covariance matrix.
Variations in these small eigenvalues have relatively small effects on the entries of the covariance matrix itself but have major effects on the estimation of its inverse.
Indeed small fluctuations of small values can yield to unbounded contributions to the inverse.
A way to cure such near-singular matrices is by adding finite positive terms to the diagonal which move the eigenvalues away from zero:
$\hat {\mathbf J} = \left((1-\gamma) \mathbf S +\gamma \mathbf I_N \right)^{-1}$, where $\mathbf S = \mbox{Cov}(\mathbf Z)$ is the covariance matrix of the set of variables $\mathbf Z \in \mathbb R^N$ estimated from data and $\mathbf I_{N}\in \mathbb R^{N\times N}$ is the identity matrix (where $N=p\times(\tau+1)$, see later).
This is what is performed in the so-called ridge regression \cite{hoerl1970ridge}, also known as shrinkage mean-square-error estimator \cite{gruber1998improving} or Tikhonov regularization \cite{tikhonov1963solution}.
The effect of the additional positive diagonal elements is quivalent to compute the inverse covariance which maximizes the log-likelihood: $\log \mbox{det}( \hat {\mathbf J}) - \mbox{tr}(\mathbf S\hat{\mathbf J}) - \gamma ||\hat {\mathbf J} ||_2$, where the last term penalizes large off-diagonal coefficients in the inverse covariance with a $\ell_2$ norm penalization \cite{witten2009covariance}.
The regularizer parameter $\gamma$ tunes the strength of this penalization.
This regularization is very simple and effective.
However, with this method insignificant elements in the precision matrix are penalized toward small values but they are never set to zero.
By using instead $\ell_1$ norm penalization: $\log \mbox{det}( \hat {\mathbf J}) - \mbox{tr}(\mathbf S\hat{\mathbf J}) - \gamma ||\hat{\mathbf J} ||_1$, insignificant elements are forced to zero leading to a sparse inverse covariance.
This is the so-called lasso regularization \cite{tibshirani1996,meinshausenbuehlmann2006,friedmanetal2008}.
The advantage of a sparse inverse covariance consists in the provision of a network \CR{representing a conditional dependency structure.} Indeed, let us recall that \CR{in linear models} zero entries in the inverse covariance are associated with couples of non-conditionally dependent variables.
\subsection{Information filtering network approach: LoGo}
An alternative approach to obtain sparse inverse covariance is by using information filtering networks generated by keeping the elements that contribute most to the covariance by means of a greedy process.
\CR{This approach, named LoGo, proceeds by first constructing a chordal information-filtering graph such as a Maximum Spanning Tree (MST) \cite{kruskal1956,mantegna1999} or a Triangulated Maximally Filtered Graph (TMFG) \cite{TMFG}.
These graphs are build by retaining edges that maximally contribute to a given gain function which, in this case, is the log-likelihood or --more simply-- the sum of the squared correlation coefficients \cite{asteetal2005,tumminelloetal2005,TMFG}.
Then, this chordal structure is interpreted as the inference structure of the joint probability distribution function with non-zero conditional dependency only between variables that are directly connected by an edge.
On this structure the sparse inverse covariance is computed in such a way to preserve the values of the correlation coefficients between couples of variables that are directly connected with an information-filtering graph edge.
The main advantage} of this approach is that inversion is performed at local level on a small subsets of variables and then the global inverse is reconstructed by joining the local parts through the information filtering network.
Because of this Local-Global construction this method is named LoGo.
It has been shown that LoGo method yields to statistically significant sparse precision matrices that outperform the ones with the same sparsity computed with lasso method \cite{LoGo16}.
\section{Causality network reterival} \label{s.causalNet}
\subsection{Simulated multivariate autoregressive linear process}
In order to be able to test if causality measures can retrieve the true causality network in the underlying process, we generated artificial multivariate normal time series with known sparse causality structure by using the following autoregressive multivariate linear process \cite{hamilton1994time}:
\begin{align}\label{Process}
\mathbf Z_t = \sum_{\lambda=1}^\tau \mathbf A_\lambda \mathbf Z_{t-\lambda} + \mathbf U_t
\end{align}
where $\mathbf A_\lambda \in \mathbb R^{p \times p}$ are matrices with random entries drawn from a normal distribution.
The matrices are made upper diagonal (diagonal included) by putting to zero all lower diagonal coefficients and made sparse by keeping only a $\mathcal O(p)$ total number of entries different from zero in the upper and diagonal part.
$\mathbf U_t \in \mathbb R^p$ are random normally distributed uncorrelated variables.
This process produces autocorrelated, cross-correlated and causally dependent time series.
We chose it because it is among the simplest processes that can generate this kind of structured datasets.
The dependency and causality structure is determined by the non-zero entries of the matrices $\mathbf A_\lambda$.
The upper-triangular structure of these matrices simplify the causality structure eliminating causality cycles.
Their sparsity reduces dependency and causality interactions among variables.
The process is made autoregressive and stationary by keeping the eigenvalues of $\mathbf A_\lambda$ all smaller than one in absolute value.
For the tests we used $\tau=5$, $p=100$ and sparsity is enforced to have a number of links approximately equal to $p$.
We reconstructed the network from time series of different lengths $q$ between 5 to 20,000 points.
To test statistical reliability the process was repeated 100 times with every time a different set of randomly generated matrices $\mathbf A_\lambda$.
We verify that the results are robust and consistent by varying sample sizes from $p=20$ to $200$, by changing sparsity with number of links from $0.5 p$ to $5 p$ and for $\tau$ from 1 to 10.
\CR{We verified that the presence of isolated nodes or highly connected hub nodes does not affect results significantly.}
\subsection{Causality and inference network retrieval}
We tested the agreement between the causality structure of the underlying process and the one inferred from the analysis of $p$ time-series of different lengths $q$, $\mathbf Z_t \in \mathbb R^p$ with $t=1..q$, generated by using Eq.\ref{Process}.
We have $p$ different variables and $\tau$ lags.
The dimensionality of the problem is therefore $N = p \times (\tau+1)$ variables at all lags including zero.
To estimate the inference and causality networks we started by computing the inverse covariance, $\mathbf J \in \mathbb R^{ N \times N}$, for all variables at all lags $\mathbf Z \in \mathbb R^{ N \times q}$ by using the following three different estimation methods:
\begin{itemize}
\item[1)] $\ell_1$ norm penalization (Glasso \cite{friedmanetal2008});
\item[2)] $\ell_2$ norm penalization (ridge \cite{tikhonov1963solution});
\item[3)] information filtering network (LoGo \cite{LoGo16}).
\end{itemize}
We retrieved the inference network by looking at all couples of variables, with indices ${\mathbf i} \in[1,..,p]$ and ${\mathbf j} \in[1,..,p]$, which have non-zero entries in the inverse covariance matrix $\mathbf J$ between the lagged set of $\mathbf j$ and the non-lagged $\mathbf i$.
Clearly, for the ridge method the result is a complete graph but for the Glasso and LoGo the results are sparse networks with edges corresponding to non-zero conditional transfer entropies between variables $\mathbf i$ and $\mathbf j$.
For the LoGo calculation we make use of the regularizer parameter as a local shrinkage factor to improve the local inversion of the covariance of the 4-cliques and triangular separators (see \cite{LoGo16}).
We then estimated transfer entropy between couples of variables, ${\mathbf i} \rightarrow {\mathbf j}$ conditioned to all other variables in the system.
This is obtained by estimating of the inverse covariance matrix (indicated with an `hat' symbol) by using Eq.\ref{TE20b} (see Appendix \ref{s.CTE}) with:
\begin{align}
\mathbf{Z_1} &= \mathbf{ Z_j}_{,t}\\ \nonumber
\mathbf{Z_2} &=\{\mathbf{ Z_i}_{,t-1}...\mathbf{ Z_i}_{,t-\tau}\}\\ \nonumber
\mathbf{Z_3} &= \{\mathbf{ Z_j}_{,t-1}...\mathbf{ Z_j}_{,t-\tau},\mathbf{ W}\} \;.
\end{align}
With $\mathbf{ W}$ a conditioning to all variables $\mathbf{Z}$ except $\mathbf{Z_1},\mathbf{Z_2}$ and $\{\mathbf{ Z_j}_{,t-1}...\mathbf{ Z_j}_{,t-\tau}\}$.
The result is a $p \times p$ matrix of conditional transfer entropies $T(\mathbf{ Z_i}_{,t} \rightarrow \mathbf{ Z_j}_{,t})$.
Finally, to retrieve the causality network we retained the network of statistically validated conditional transfer entropies only.
Statistical validation was performed as follows.
\subsection{Statistical validation of causality}
{Statistical validation has been performed from likelihood ratio statistical test. Indeed, entropy and likelihood are intimately related: entropy measures uncertainty and likelihood measures the reduction in uncertainty provided by the model.
Specifically, the Shannon entropy associated with a set of random variables, $\mathbf{ Z_i}$, with probability distribution $p(\mathbf{ Z_i})$ is $H(\mathbf{ Z_i}) = - \mathbb E [ \log p(\mathbf{ Z_i}) ]$ (Eq.\ref{entropy}) whereas the log-likelihood for the model $\hat p(\mathbf{ Z_i})$ associated with a set of independent observations $\mathbf{ \hat Z}_{i,t}$ with $t=1..q$ is $\log \mathcal L(\mathbf{\hat Z}_{\mathbf i}) = \sum_{t=1}^q \log \hat p(\mathbf{\hat Z}_{i,t})$ which can be written as $\log \mathcal L(\mathbf{\hat Z}_{\mathbf i}) = q \mathbb E_{\hat p} [ \log \hat p(\mathbf{ Z_i}) ]$.
Note that $q$ is the total available number of observations which, in practice, is the length of the time-series minus the maximum number of lags.
It is evident from these expressions that entropy and the log-likelihood are strictly related trough this link might be non-trivial.
In the case of linear modeling this connection is quite evident because the entropy estimate is $H = \frac 12 (- \log |\mathbf{\hat J} | + p \log (2\pi) + p)$ and the log-likelihood is $\log \mathcal L = \frac q2 ( \log |\mathbf{\hat J} | - Tr( \mathbf{\hat \Sigma} \mathbf{\hat J} ) - p \log (2\pi))$.
For the three models we study in this paper we have $Tr( \mathbf{\hat \Sigma} \mathbf{\hat J} ) =p$ and therefore the log-likelihood is equal to $q$ times the opposite of the entropy estimate.
Transfer entropy, or conditional transfer entropy, are differences between two entropies: the one of a set of variables conditioned to their own past minus the one conditioned also to {the past} of another variable.
This, in turns, is the difference of the unitary log-likelihood of two models and therefore it is the logarithm of a likelihood ratio.
As Wilks pointed out \cite{wilks1938large,vuong1989likelihood} the null distribution of such model is asymptotically quite universal.
Following the likelihood ratio formalism, we have $\lambda=q T$ and the probability of observing a transfer entropy larger than $T$, estimated under null hypothesis, is given by $p_v \sim 1-\chi_c^2(r qT,d)$ with $r\simeq 2$ and $\chi_c^2$ the chi-square the cumulative distribution function with $d$ degrees of freedom which are the difference between the number of parameters in the two models.
In our case the two models have respectively $\tau (p_j^2+1)$ and $\tau(p_j^2+1) + \tau (p_j \, p_i)$ parameters.
}
\subsection{Statistical validation of the network}
The procedures described in the previous two subsections produce the inference network and causality network.
Such networks are then compared with the known underlying network of true causalities in the underlying process which is defined by the non-zero elements in the matrices $A_\lambda$ (see Eq.\ref{Process}).
The overlapping between the retrieved links in the inference or causality networks with the ones in the true network underlying the process is an indication of a discovery of a true causality relation.
However some discoveries can be obtained just by chance or some methodologies might discover more links only because they produce denser networks.
We therefore tested the hypothesis that the matching links in the retrieved networks are not obtained just by chances by computing the null-hypothesis probability to obtain the same or a larger number of matches randomly.
Such probability is given by the conjugate cumulative hypergeometric distribution for a number equal or larger than $\mathrm{TP}$ of `true positive' matching causality links between an inferred network of $n$ links and a process network of $K$ true causality links, from a population of $p^2-p$ possible links:
\begin{align}\label{HyperTest}
P(X \ge \mathrm{TP} | n , K , p)= 1 - \sum_{k=0}^{\mathrm{TP}-1} {\frac {{\binom {K}{k}}{\binom {p^2-p -K}{n-k}}}{\binom {p^2-p}{n}}} \;\;\;.
\end{align}
Small values of $P$ indicate that the retrieved $\mathrm{TP}$ links out of $K$ are unlikely to be found by randomly picking $n$ edges from $p^2-p$ possibilities.
Note that in the confusion matrix notation \cite{swets2014signal} we have \CR{ $n=\mathrm{TP}+\mathrm{FP}$ and $K = \mathrm{TP}+\mathrm{FN}$ }with $\mathrm{TP}$ number of true positives, $\mathrm{FP}$ number of false positives, $\mathrm{FN}$ number of false negatives and $\mathrm{TN}$ number of true negatives.
\CR{The total number of `negative' (unlinked couples of vertices) in the true model is instead $m=\mathrm{FP}+\mathrm{TN}$.}
\section{Results}\label{s.results}
\subsection{Computation and validation of conditional transfer entropies}
By using Eq.\ref{Process} we generated 100 multivariate autoregressive processes with known causality structures.
We here report results for $p=100$ but analogous outcomes were observed for dimensionalities between $p=20$ and $200$ variables.
Conditional transfer entropies between all couples of variables, conditioned to all other variables in the system, were computed by estimating the inverse covariances by using tree methodologies, ridge, lasso and LoGo and applying Eq.\ref{TE20}.
Conditional transfer entropies were statistically validated with respect to null hypothesis (no causality) at $p_v=1\%$ p-value. Results for Bonferroni adjusted p-value at 1\% (i.e. $p_v = 0.01/(p^2-p) \sim 10^{-6}$ for $p=100$) are reported in Appendix \ref{BonferroniValidated}.
We also tested other values of $p_v$ from $10^{-8}$ to 0.1 obtaining consistent results.
We observe that small $p_v$ reduce the number of validated causality links but increase the chance that these links match with the true network in the process.
Conversely large values of $p_v$ increase the numbers of mismatched links but also of the true links discoveries.
Let us note that here we use $p_v$ as a thresholding criteria and we are not claiming any evidence of statistical significance of the causality.
We assess the goodness of this choice a-posteriori by comparing the resulting causality network with the known causality network of the process.
\begin{center}
\begin{figure}[t]
\includegraphics[width=0.80\textwidth]{SignificantRetreivals.pdf}
\caption{
{\bf Regions in the $p/q$-$\gamma$ space where causality networks for the three models are statistically significant.}
The significance regions are all at the left of the corresponding lines.
Tick line reports the boundary $P< 0.05$ (Eq.\ref{HyperTest}) and dotted lines indicate $P< 10^{-8}$ significance levels ($P$ is averaged over 100 processes).
The plots refer to $p=100$ and report the region where the causality network are all significant for 100 processes. }
\label{f.significance}
\end{figure}
\end{center}
\begin{center}
\begin{figure}[t]
\includegraphics[width=0.80\textwidth]{FractionRetreivedLinks_Colromap.pdf}
\caption{
{\bf True positive rate: fraction of retrieved true causality links ($\mathrm{TP}$) with respect to the total number of links in the process (n).}
The three panels refer to ridges, Glasso and LoGo (top, central and bottom).
Data are average fractions over 100 processes.
}
\label{f.RegionFractionRetreived}
\end{figure}
\end{center}
\subsection{Statistical significance of the recovered causality network.}
Results for the contour frontiers of significant causality links for the three models are reported in Fig.\ref{f.significance} for a range of time series with lengths $q$ between 10 and 20,000 and regularizer parameters $\gamma$ between $10^{-8}$ and $0.5$.
Statistical significance is computed by using Eq.\ref{HyperTest} and results are reported for both $P < 0.05$ and $P < 10^{-8}$ (continuous and dotted lines respectively).
As one can see, the overall behaviours for the three methodologies are little affected by the threshold on $P$.
We observe that LoGo significance region extends well beyond the Glasso and ridge regions.
The value of the regularizer parameter $\gamma$ affects the results for the three models in a different way.
Glasso has a region in the plane $\gamma-p/q$ where it has best performances (in this case it appears to be around $\gamma \simeq 0.1$ and $p/q \simeq 2.5$).
Ridge appears instead to be little affected with mostly constant performances across the range of $\gamma$.
LoGo has best performances for small, even infinitesimal, values of $\gamma$.
Indeed, differently from Glasso in this case $\gamma$ does not control sparsity but instead acts as local shrinkage parameter.
Very small values can be useful in some particular cases to reduce the effect of noise but large values have only the effect to reduce information.
\begin{table}[!h]
\caption{
{\bf Causality network validation.} Comparison between fraction of true positive (${TP/n}$) and fraction of false positive ($FP/n$), statistically validated, causality links for the three models and different time-series lengths.
The table reports only the case for the parameter $\gamma=0.1$.
Statistical validation of conditional transfer entropy is at $p_v=1\%$ p-value.
Note that LoGo can perform better than reported in this table for smaller values of $\gamma$ (see Figs.\ref{f.significance} and \ref{f.RegionFractionRetreived}).
}
\begin{center}
\begin{tabular}{@{\extracolsep{4pt}}llllllllll@{}}
\hline
q & 10 & 20 & 30 & 50 & 200 & 300 & 1000 & 20000 \\ \hline
ridge TP/n & 0.00 & 0.00 & 0.00 & 0.00 & 0.23$^{**}$ & 0.49$^{**}$ & 0.76$^{**}$ & 0.93$^{**}$ \\
ridge FP/n & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 & 0.10 & 0.65 & 1.06 \\ \hline
Glasso TP/n & 0.00 & 0.00 & 0.00 & 0.13$^{**}$ & 0.48$^{**}$ & 0.53$^{**}$ & 0.62$^{**}$ & 0.74$^{**}$ \\
Glasso FP/n & 0.00 & 0.00 & 0.00 & 0.00 & 0.06 & 0.10 & 0.23 & 0.54 \\ \hline
LoGo TP/n & 0.00 & 0.08$^*$ & 0.21$^{**}$ & 0.37$^{**}$ & 0.61$^{**}$ & 0.65$^{**}$ & 0.75$^{**}$ & 0.90$^{**}$ \\
LoGo FP/n & 0.00 & 0.00 & 0.00 & 0.01 & 0.06 & 0.08 & 0.15 & 0.34 \\ \hline
&& $^{*}$ $P < 0.05$;& $^{**}$ $P < 10^{-8}$ &&&\\
\end{tabular}\end{center}
\label{tab:fraction}
\end{table}
\subsection{Causality links retrieval}
Once identified the parameter-regions where the retrieved causality links are statistically significant, we also measured the fraction of true links retrieved.
\CR{Indeed, given that the true underlying causality network is sparse, one could do significantly better than random by discovering only a few true positives.
Instead, from any practical perspective we aim to discover a significant fraction of the edges.
Figure \ref{f.RegionFractionRetreived} shows that the fraction of causality links correctly discovered (true positive, $\mathrm{TP}$) with respect to the total number of causality links in the process ($n$) is indeed large reaching values above 50\%.}
This is the so-called true positive rate or sensitivity, which takes values between 0 (no links discovered) and 1 (all links discovered).
Reported values are averages over 100 processes.
We observe that the region with discovering of 10\% or more true causality links greatly overlaps with the statistical validity region of Fig.\ref{f.significance}.
We note that when the observation time becomes long, $p/q \lessapprox 0.25$, ridge discovery rate becomes larger than LoGo.
However, statistical significance is still inferior to LoGo, indeed the ridge network becomes dense when $q$ increases and the larger discovery rate of true causality links is also accompanied by a larger rate of false links incorrectly identified (false positive $\mathrm{FP}$).
The fraction of false positives with respect to the total number of causality links in the process ($n$) are reported in Table~\ref{tab:fraction} together with the true positive rate for comparison.
This number can reach values larger than one because the process is sparse and there are much more possibilities to randomly chose false links than true links.
\CR{Note this is not the false positive rate, which instead is $\mathrm{FP}/m$, and cannot be larger than one.}
Consistently with Fig.\ref{f.significance} we observe that, for short time series, up to $p/q \sim 0.5$ the sparse models have better capability to identify true causality links and to discard the false ones with LoGo being superior to Glasso.
Remarkably, LoGo can identify a significant fraction of causality links already from time-series with lengths of 30 data-points only.
P-value significances, reported in the table with one or two stars indicate when all values of $P(X \ge \mathrm{TP} | n , K , p)$ from Eq.\ref{HyperTest} for all 100 processes have respectively $P<0.05$ or $P<10^{-8}$.
Again we observe that LoGo discovery rate region extends well beyond the Glasso and ridge regions.
\begin{table}[!h]
\caption{
{\bf Inference network validation: comparison between fraction of true positive (TP/n) and fraction of false positive (FP/n).}
Data for ridge are only for comparison because it is a complete graph with all links present.
The table reports only the case for the parameter $\gamma=0.1$.
}
\begin{center}
\begin{tabular}{@{\extracolsep{4pt}}llllllllll@{}}
\hline
q & 10 & 20 & 30 & 50 & 200 & 300 & 1000 & 20000 \\ \hline
ridge TP/n & 1.00 & 1.00 & 1.00 & 1.00 & 1.00 & 1.00 & 1.00 & 1.00 \\
ridge FP/n & 97.84 & 97.84 & 97.84 & 97.84 & 97.84 & 97.84 & 97.84 & 97.84 \\ \hline
Glasso TP/n & 0.61$^*$ & 0.74$^*$ & 0.79$^*$ & 0.85$^*$ & 0.87$^{**}$ & 0.84$^{**}$ & 0.80$^{**}$ & 0.80$^{**}$ \\
Glasso FP/n & 28.39 & 38.11 & 45.79 & 53.58 & 40.61 & 26.60 & 1.54 & 0.92 \\ \hline
LoGo TP/n & 0.31$^*$ & 0.50$^{**}$ & 0.58$^{**}$ & 0.63$^{**}$ & 0.75$^{**}$ & 0.78$^{**}$ & 0.85$^{**}$ & 0.93$^{**}$ \\
LoGo FP/n & 4.53 & 4.27 & 4.18 & 4.03 & 3.72 & 3.63 & 3.44 & 3.21 \\ \hline
&& $^{*}$ $P < 0.05$; & $^{**}$ $P < 10^{-8}$ &&&\\
\end{tabular}\end{center}
\label{tab:fraction_Inference}
\end{table}
\begin{center}
\begin{figure}[t]
\includegraphics[width=0.45\textwidth]{ROC_cond.pdf}
\includegraphics[width=0.45\textwidth]{ROC_All_detail.pdf}
\caption{
{\bf ROC values, for each model and each parameter combination.} X-axis false positive rates ($\mathrm{FP}/m$), y-axis true positive rates ($\mathrm{TP}/n$).
Left and right figures are the same with X-axis expanded on the low values only for the right figure to better visualise the differences between the various models.
Large symbols refer to $\gamma = 0.1$ and validation at p-value $p_v=0.01$.
Color intensity is proportional to time series length.
Inference network results are all outside the range of the plot.
Reported values are averages over 100 processes. }
\label{f.ROC}
\end{figure}
\end{center}
\subsection{Inference network}
We have so far empirically demonstrated that a significant part of the true causality network can be retrieved from the statistically validated network of conditional transfer entropies.
Results depend on the choice of the threshold value of the $p_v$ at which null hypothesis is rejected.
We observed that lower $p_v$ are associated with network with fewer true positives but also fewer false positives and conversely larger $p_v$ yield to causality networks with larger true positives but also larger false positives.
Let us here report on the extreme case of the inference network which contains all causality channels with no validation.
For the ridge model this network is the complete graph with all variables connected to each-other.
Instead, for Glasso and LoGo the inference network is sparse.
Results are summarized in Table.\ref{tab:fraction_Inference}.
In terms of true positive rate we first notice that they are all larger than the ones in Table.\ref{tab:fraction}.
Indeed, the network of statistically validated conditional transfer entropies is a sub-network of the inference network.
On the other hand we notice that the false positive fraction is much larger than the ones in Table.\ref{tab:fraction_Inference}.
Ridge network has a fraction of 1 because, in this case, the inference network is the complete graph.
Galsso also contains a very large number of false positives reaching even 55 times the number of links in the true network and getting to lower fractions only from long time-series with $q >1000$.
These numbers also indicate that Galsso networks are not sparse.
LoGo has a sparser and more significant inference network with smaller fractions of false positives which stay below $5n$, which is anyway a large number of misclassification.
Nonetheless, we observe that, despite such large fractions of $\mathrm{FP}$, the discovered true positives are statistically significant.
\begin{table}[!h]
\caption{
{\bf Unconditioned transfer entropy network: comparison between fraction of true positive (TP/n) and fraction of false positive (FP/n).}
Statistical validation of transfer entropy is at $p_v=1\%$ p-value.
The table reports only the case for the parameter $\gamma=0.1$.
}
\begin{center}
\begin{tabular}{@{\extracolsep{4pt}}lllllllll@{}}
\hline
q & 10 & 20 & 30 & 50 & 200 & 300 & 1000 & 20000 \\ \hline
ridge TP/n & 0.02 & 0.39$^{**}$ & 0.45$^{**}$ & 0.51$^{**}$ & 0.65$^{**}$ & 0.69$^{**}$ & 0.78$^{**}$ & 0.92$^{**}$ \\
ridge FP/n & 0.07 & 1.06 & 0.95 & 0.85 & 0.93 & 0.99 & 1.20 & 1.73 \\ \hline
Glasso TP/n & 0.00 & 0.24$^{**}$ & 0.35$^{**}$ & 0.43$^{**}$ & 0.57$^{**}$ & 0.60$^{**}$ & 0.67$^{**}$ & 0.77$^{**}$ \\
Glasso FP/n & 0.00 & 0.10 & 0.20 & 0.29 & 0.51 & 0.56 & 0.73 & 1.66 \\ \hline
LoGo TP/n & 0.11 & 0.34$^{**}$ & 0.41$^{**}$ & 0.47$^{**}$ & 0.63$^{**}$ & 0.66$^{**}$ & 0.76$^{**}$ & 0.89$^{**}$ \\
LoGo FP/n & 0.02 & 0.16 & 0.25 & 0.34 & 0.59 & 0.66 & 0.87 & 1.49 \\ \hline
&& & $^{**}$ $P < 10^{-8}$ &&&\\
\end{tabular}\end{center}
\label{tab:fraction_Unconditional}
\end{table}
\subsection{Unconditioned transfer entropy network}
We last tested whether conditioning to {the past} of all other variables gives better causality network retrievals than the unconditioned case.
Here, transfer entropy, $T(\mathbf{ Z_i} \rightarrow \mathbf{ Z_j})$, is computed by using Eq.\ref{TE20} with $\mathbf W=\emptyset$, the empty set.
For the ridge case this unconditional transfer entropy depends only from the time-series, $\mathbf{ Z}_{i,t}$, $\{\mathbf{ Z}_{i,t-1},...,\mathbf{ Z}_{i,t-\tau}\}$ and $\{\mathbf{ Z}_{j,t-1},...,\mathbf{ Z}_{j,t-\tau}\}$ (with $\tau = 5$ in this case).
Glasso and LoGo cases are instead hybrid because a conditional dependency has been already introduced in the sparse structure of the inverse covariance $\mathbf J$ (the inference network).
Results are reported in Tab.\ref{tab:fraction_Unconditional} where we observe that these networks retrieve a larger quantity of true positives than the ones constructed from conditional entropy.
However, the fraction of false positive is also larger than the ones in Tab.\ref{tab:fraction} although it is smaller than what observed in the inference network in Tab.\ref{tab:fraction_Inference}.
{Overall, these results indicate that conditioning is effective in discarding false positives. }
\subsection{Summary of all results in a single ROC plot}
In summary, we have investigated the networks associated with conditional transfer entropy, unconditional transfer entropy and inference for three models under a range of different parameters.
In the previous sub-sections we have provided some comparisons between the performances of the three models in different ranges of parameters.
Let us here provide a summary of all results within a single ROC plot \cite{swets2014signal}.
Figure \ref{f.ROC} reports the ROC values, for each model and each parameter combination, x-axis are false positive rates ($\mathrm{FP}/m$) and y-axis true positive rates ($\mathrm{TP}/n$).
Each point is an average over 100 processes.
Points above the diagonal line are associated to relatively well performing models with the upper left corner representing the point where models correctly discover all true causality links without any false positive.
The plot reports with large symbols the cases for $\gamma = 0.1$ and validation at p-value $p_v=0.01$, which can be compared with the data reported in the tables.
\CR{We note that, by construction, LoGo models are sparse (with a number of edges $\sim 3p$ \cite{LoGo16}). This restrains the ROC results to the left-hand side of the plot.
For this reason an expanded view of the figure is also proposed with the x-axis scaled.
Note that this ROC curve is provided as a visual tool for intuitive comparison between models.}
Overall from Tables \ref{tab:fraction}, \ref{tab:fraction_Inference}, \ref{tab:fraction_Unconditional} and Fig. \ref{f.ROC} we conclude that all models obtain better results for longer time series and that conditional transfer entropy over-performs the unconditional counterparts (see, Tables \ref{tab:fraction} and \ref{tab:fraction_Unconditional} and the two separated ROC figures for conditional and unconditional transfer entropies reported in Fig.\ref{f.ROCCoUc} in appendix \ref{A.Co.UC}).
In the range of short time series, when $q\le p$, which is of interest for this paper, LoGo is the best performing model with better performances achieved for small $\gamma \lesssim 10^{-4}$ and validation with small p-values $p_v \lesssim 10^{-4}$.
LoGo is consistently the best performing model also for longer time-series up to lengths of $q \sim1000$.
Instead, above $q=2000$ ridge begins to provide better results.
For long time series, at $q=20,000$, the best performing model is ridge with parameters $\gamma =10^{-5}$, p-value $p_v = 5\;10^{-6}$.
LoGo is also performing well when time series are long with best performance obtained at $q=20,000$ for parameters $\gamma =10^{-10}$, p-value $p_v = 5\;10^{-6}$.
We note that LoGo instead performs poorly in the region of parameters with $\gamma \le 0.1$ and $p_v \le 0.01$ for short time-series $q\le p/2$.
\section{Conclusions and perspectives}\label{s.conclusions}
In this paper we have undertaken the challenging task to explore models and parameter regions where the analytics of time series can retrieve significant fractions of true causality links from linear multivariate autoregressive process with known causality structure.
Results demonstrate that sparse models with conditional transfer entropy are the ones who achieve best results with significant causality link retrievals already for very short time series even with $q \le p/5 = 20$.
\CR{This region is very critical and general considerations would suggest that no solutions can be discovered.
Indeed, this result is in apparent contradiction with a general analytical results in \cite{varga2016replica,papp2016fluctuation} who find that no significant solutions should be retrieved for $q \le N/2 = 150$.
However, we notice that the problem we are addressing here is different from the one in \cite{varga2016replica,papp2016fluctuation}.
In this paper we have been considering an underlying sparse true causality structure and such a sparsity changes considerably the condition of the problem yielding to significant solutions even well below the theoretical limit from \cite{varga2016replica,papp2016fluctuation} which is instead associated to non-sparse models.
}
Unexpectedly, we observed that the structure of the inference networks in the two sparse models, Glasso and LoGo, have excessive numbers of false positives yielding to rather poor performances.
However, in these models false positive can be efficiently filtered out by imposing statistical significance of the transfer entropies.
Results are affected by the choice of the parameters and the fact that the models depend on various parameters ($q$, $p$, $\gamma$, $p_v$, $P$) make the navigation in this space quite complex.
We observed that the choice of p-values, $p_v$, for valid transfer entropies affects results.
Within our setting we obtained best results with the smaller p-values especially in the regions of short time-series.
We note that the regularizer parameter $\gamma$ also plays an important role and best performances are obtained by combination of the two parameters $\gamma$ and $p_v$.
Not surprizingly, longer time-series yield to better results.
We observe that conditioning to all other variables or unconditioning is affecting the transfer entropy estimation with better performing causality network retrieval obtained for conditioned transfer entropies.
However, qualitatively, results are comparable. Other intermediate cases, such as conditioning to past of all other variables only, have been explored again with qualitatively comparable results.
It must be said that in the present system results are expected to be robust to different conditionings because the underlying network of the investigated processes is sparse. For denser inference structures, conditioning could affect more the results.
Consistently with the findings in \cite{LoGo16} we find that LoGo outperforms the other methods.
This is encouraging because the present settings of LoGo is using a simple class of information filtering networks, namely the TMFG \cite{TMFG}, obtained by retaining largest correlations.
There are a number of alternative information filtering networks which should be explored.
In particular, given the importance of statistical validation emerged from the present work, it would be interesting to explore statistical validation within the process of construction of the information filtering networks themselves.
In this paper we investigate a simple case with a linear autoregressive multivariate normal process analysed by means of linear models.
Both LoGo and Glasso can be extended to the non-linear case with LoGo being particularly suitable for non-parametric approaches as well \cite{LoGo16}.
There are Alternative methods to extract causality networks from short time series, in particular Multispatial CCM \cite{sugihara2012detecting,clark2015spatial} appears to perform well for short time series.
A comparison between different approaches and the application of these methods to real data will be extremely interesting.
However this should be the object of future works.
\subsection*{Acknowledgement}
T.A. acknowledges support of the UK Economic and Social Research Council (ESRC) in funding the Systemic Risk Centre (ES/K002309/1).
TDM wishes to thank the COST Action TD1210 for partially supporting this work and Complexity Science Hub Vienna.
\subsection*{Conflict of interest disclosure}
The authors declare that there is no conflict of interest regarding the publication of this paper.
| {'timestamp': '2017-10-06T02:07:21', 'yymm': '1706', 'arxiv_id': '1706.01954', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01954'} | arxiv |
\section{Introduction}
A classical problem in grammatical inference is to find, i.e.\ \emph{learn}, a regular language from a set of examples of that language.
When this set is divided into positive examples (belonging to the language) and negative examples (not belonging to the language), the problem is typically solved by searching for the smallest deterministic finite automaton (DFA) that accepts the positive examples, and rejects the negative ones.
Provided with sufficiently many examples, there exist algorithms that will correctly learn the unknown language from these examples \cite{Gold1967}.
This is not necessarily the case, however, if only positive examples are available.
We consider a setting where one can observe positive examples from multiple different regular languages, but it is not clear to which of these languages the examples belong.
Moreover, it is known that each example belongs to exactly one of these languages, i.e.\ that the languages are disjoint.
As a result, the positive examples for one language are negative examples for the other languages.
The problem at hand is to cluster the examples by assigning them to a language.
In this paper, we present two clustering approaches based on an essential property of regular languages described by the pumping lemma.
The pumping lemma is often used to prove that a certain language is \emph{not} regular.
It states that any sufficiently long example from a regular language has a middle section that may be repeated (i.e. \emph{pumped}) to produce a new example that is also in that language \cite{rabin1959finite}.
Efficient algorithms can be used for finding such possible decompositions \cite{gusfield2004linear}.
We use this set of possible decompositions for clustering our examples.
The intuition behind this approach is that examples from the same language are more likely to have observable similarities than examples from different languages.
Our problem is motivated by a case study of print jobs submitted to large industrial printers.
Strings of symbols represent these print jobs, where each symbol denotes a different media type, such as a book cover or a newspaper page.
Together, this set of print jobs make for a fairly complicated `language'.
Nevertheless, we observed that each print job can be classified as belonging to one of a fixed set of categories, such as `book' or `newspaper'.
Two print jobs that belong to the same category are typically very similar, to the extent that they only differ in the number of repetitions of a certain media type.
Therefore, the languages for the different categories are fairly simple.
Our goal is to uncover these simple languages.
\section{Preliminaries}
\label{sec:preliminaries}
\paragraph{Strings}
Let $\Sigma$ denote a finite alphabet of \emph{symbols}.
A \emph{string} is a finite sequence of symbols.
The empty string is denoted $\epsilon$.
We denote with $\Sigma^{\ast}$ the set of all strings over $\Sigma$, and with $\Sigma^{+}$ all nonempty strings over $\Sigma$ (i.e.\ $\Sigma^{\ast} = \Sigma^{+} \cup \{ \epsilon \}$).
Similarly, we denote with $\Sigma^i$ the set of all strings over $\Sigma$ of length $i$.
Let $x$ be a string over $\Sigma$, then $|x|$ denotes the length of $x$.
We denote with $x^i$ the string $x$ repeated $i$ times, e.g.\ $x^2 = xx$.
We use $x^{\geq i}$ to denote the language $\{x^j : j \geq i\}$.
Moreover, we use $x^+$ to denote the language $\{x^i : i \in \mathbb{N}^+\}$, and $x^*$ to denote the language $x^+ \cup \{\epsilon\}$.
A string $u$ is a (proper) \emph{prefix} of $x$ if there exists a (nonempty) string $v$ such that $x = uv$.
Similarly, $u$ is a (proper) \emph{suffix} of $x$ if there exists a (nonempty) string $v$ such that $x = vu$.
We say $u$ is a (proper) \emph{infix} of $x$ if there exist (nonempty) strings $v, w$ such that $x = vuw$.
In the remainder of this paper, we use $a$, $b$ and $c$ to refer to symbols in $\Sigma$, and we use $r \ldots z$ to refer to strings over $\Sigma$.
\paragraph{Languages}
A \emph{language} is a set of strings.
A regular language can be described by a \emph{deterministic finite automaton} (DFA), which is a tuple $(\Sigma, Q, q_0, \delta, F)$, where $Q$ is a set of \emph{states}, $q_0 \in Q$ is the \emph{start state}, $\delta: Q \times \Sigma \to Q$ is a \emph{transition function} from states and symbols to states, and $F \subseteq Q$ is a set of \emph{final states}.
The set of tails described by a state $q$ is the set $\{ x \in \Sigma^* : \delta(q, x) \in F\}$.
Hence, the set of tails of the start state of a DFA describes its language.
Let $q$ be a state, $a$ be a symbol and $u$ be a string, then we extend $\delta$ to $\delta^{\ast}: Q \times \Sigma^{\ast} \to Q$ by $\delta^{\ast}(q, \epsilon) = q$ and $\delta^{\ast}(q, au) = \delta^{\ast}(\delta(q, a), u)$.
We slightly abuse notation and simply use $\delta$ to refer to $\delta^{\ast}$ in the remainder of this paper.
\paragraph{The pumping lemma}
The pumping lemma \cite{rabin1959finite} states that all sufficiently long strings of a regular language contain an infix that may be \emph{pumped}, i.e.\ repeated an arbitrary number of times to construct a new string that is in the language.
Let $\mathcal{L}$ be a regular language, then there exists an integer $p \geq 1$ depending only on $\mathcal{L}$ such that every string $x \in \mathcal{L}$ of length at least $p$ can be written as $x = uvw$ such that $|v| \geq 1$, $|uv| \leq p$ and $\forall i \geq 0,\ uv^iw \in \mathcal{L}$.
The intuition is that $v$ will always lead back to the same state, i.e.\ $\delta(q_0, u) = \delta(\delta(q_0, u), v) = q$. Therefore, a string $uv^iw$ is in the language iff $w$ is in the set of tails of $q$.
We say that two strings $x$ and $y$ have the same \emph{pumping decomposition} if $x = uv^iw$ and $y = uv^jw$ for some $u$, $v$, $w$, $i$ and $j$.
\paragraph{Compression}
Compression refers to the practice of encoding information using fewer units of information (e.g.\ \emph{bits}) than the original representation.
The function that provides such an encoding is called a \emph{compressor}.
We formally define a compressor as a so-called `code word length function' $C : \Sigma^{\ast} \to \mathbb{N}$ that maps strings to the length of their compressed encoding.
A normal compressor can be used to approximate the \emph{Kolmogorov complexity} \cite{ming1997introduction} of a string (i.e. the length of the shortest computer program that produces the string as output), as the Kolmogorov complexity itself is not computable.
In \cite[Definition 3.1 and Lemma 3.4]{cilibrasi2005clustering}, a \emph{normal compressor} is defined as follows.
\begin{definition}
A compressor $C$ is \emph{normal} if it satisfies, up to an additive $O(log\ n)$ term, with $n$ the maximal length of an element involved in the (in)equality concerned, the following axioms:
\begin{enumerate}
\item $C(uu)=C(u)$ and $C(\epsilon)=0$ (idempotency)
\item $C(uv) = C(vu)$ (symmetry)
\item $C(uv) \leq C(u) + C(v)$ (subadditivity)
\end{enumerate}
\end{definition}
The \emph{normalized compression distance} (NCD) is a quasi-universal measure for the similarity of two strings.
It is an approximation of their (uncomputable) \emph{information distance}, which measures the minimum information required to go from one string to the other or vice versa.
The NCD for two strings $x, y$ is defined in \cite{cilibrasi2005clustering} as follows.
\begin{equation}
NCD(x,y) = \frac{max\{C(xy)-C(x),C(yx)-C(y)\}}{max\{C(x),C(y)\}}
\end{equation}
\vspace*{0.1cm}
\section{Clustering by Compression}
\vspace*{0.1cm}
The NCD can be used to cluster strings based on their pumping decomposition.
\paragraph{Pumping lemma and clustering based on NCD}
Let us consider a setting where $\cal{L}$ and $\cal{L'}$ are two disjoint regular languages, i.e. $\cal{L} \cap \cal{L'} = \emptyset$.
Let $x,y \in \cal{L}$ two strings such that $x = uv^iw$ and $y = uv^jw$ with $i,j \geq 0$ and $i \neq j$.
Let now $z \in \cal{L'}$ be a string with $z = rs^kt$, $k \geq 0$ and $(r \neq u$ or $s \neq v$ or $t \neq w)$.
We note here that $\cal{L}$ and $\cal{L'}$ are special cases of \textit{simple} regular languages in which any string belonging to the language can be fully described by the star-free regular expression of the language, together with the multiplicities of the repetitions.
We now consider a proper normal compressor $C$, which would reduce any string in $\cal{L}$ or $\cal{L'}$ into the respective regular expressions of $\cal{L}$ and $\cal{L'}$, up to an additive $O(log\ n)$ term (the number of bits needed to encode the multiplicities).
Thus, we can say that, up to an additive $O(log\ n)$ term, $\forall x, y \in$ $\cal{L}$ $\ \ C(x) = C(y) = C(regexp($$\cal{L}$$))$
We also assume that the normal compressor we use satisfies, up to an additive $O(log\ n)$ term, the equality $C(xy) = C(x)$, since a proper normal compressor $C$ would compress equally the concatenation of two similar strings, i.e. belonging to the same simple language, and the strings separately. Since we know that $C(x) = C(y)$, and that $C(xy) = C(yx)$ by symmetry, we can then reformulate the NCD between $x$ and $y$ as
\[NCD(x,y) = \frac{C(xy)-C(x)}{C(x)} = 0\]
As in our setting, $\cal{L}$ and $\cal{L'}$ are two disjoint regular languages not sharing the same regular expressions, we can thus assume that
\[
NCD(x, y) \leq NCD(x, z) \quad \textrm{and} \quad NCD(x, y) \leq NCD(y, z)
\]
By considering pairwise disjoint regular languages, we can say that a clustering based on the NCD will regroup sufficiently long strings in the format defined above and belonging to the same language.
In practice, note that the additive $O(log\ n)$ term has an impact on the purity of the clustering.
We will therefore carry out different clusterings of strings, possibly corresponding to clear distinct languages, depending on the granularity of the clustering, and of the number of clusters to find.
Given a set of strings, the pairwise NCDs are used to compute a distance matrix.
The next step is to establish clusters from the previously computed distance matrix.
The output of hierarchical clustering is a dendrogram, a binary tree with one leaf for every string.
A dendrogram is composed of internal nodes, linking leaves or subtrees.
The level of the nodes is set up according to a pre-defined linkage matrix computed as a function of the distance matrix.
\begin{figure}[!t]
\centering
\hspace*{-0.2cm}
\vspace*{-1.0cm}
\includegraphics[height=0.39\textheight]{dendro-4lang-2.pdf}
\vspace*{0.1cm}
\caption[Clustering of a sample of the printers dataset.]{Clustering of a sample of the printers dataset.}
\vspace*{-0.4cm}
\label{fig:clusteringexample}
\end{figure}
To build the dendrogram, hierarchical agglomerative clustering algorithms find and merge the pair of clusters with the lowest linkage, and create a parent node at the level of the linkage.
We gather the dendrogram, and thus clusters are computed by varying the level of linkage as a threshold.
We assume that the number of languages to get, thus the right threshold to set, is known beforehand.
As shown in the example in Figure \ref{fig:clusteringexample}, clusters are created and highlighted with different colors, assuming a threshold of $0.15$ for the separation.
In this case, we gather 4 clusters, from which it is possible to infer distinct languages.
It is straightforward here to see that, for a given cluster $\cal{C}$$_x$, we can infer a language $\cal{L}$$_x$ such that $\forall i \geq 0,\ uv^iw \in \cal{L}$$_x$.
In order to do so, it is possible for any cluster $\cal{C}$$_x$ to infer the corresponding language $\cal{L}$$_x$ (for example, by using state merging \cite{cdlh}), using all strings clustered in $\cal{C}$$_x$ as positive examples, and all strings in $\bigcup_y \mathcal{C}_y : y \neq x$ as negative examples.
We then gather 4 languages $\cal{L}$$_{1\ldots 4}$ respectively standing for $a^+$ (blue), $a^+b^+$ (red), $ab^+a$ (green) and $(ab)^+$ (purple).
\paragraph{Granularity of Clustering}
As shown above, choosing the right threshold enables getting the desired number of clusters. As a consequence, we assume that the right number of clusters is provided, in order to enhance the identification of different languages. In case the wrong number of clusters would have been provided, or an inadequate threshold found, the granularity of the clustering, that is to say, how fine the strings are clustered together, would have changed. More precisely, a greater threshold would tend to generalize the optimal solution (a solution with a threshold of $0.2$ would give 3 languages, namely $a^+$, $(ab)^+$ and $a^+b^+a^{[0..1]}$) whereas a smaller threshold would provide finer languages (up to singleton sets).
\section{Tandem repeats}
Another approach is to first compute the pumping decompositions of the strings (and regroup the strings accordingly) by computing \emph{tandem repeats}.
\begin{definition
A string $v$ is a \emph{tandem repeat} in $x$ if $x = uv^iw$ for some $i \geq 2$, $u,w \in \Sigma^*$ and $v \neq \epsilon$.
\end{definition}
There exist algorithms that can detect tandem repeats in a string \cite{gusfield2004linear,crochemore1981optimal,apostolico1983optimal,main1984n}.
We relate the pumping lemma for regular languages to the identification of tandem repeats, in a context of simple regular languages.
\paragraph{Pumping lemma and identification of languages}
According to the pumping lemma, if $\cal{L}$ is a regular language, then there exists an integer $p \geq 1$ depending only on $\cal{L}$ such that every string $x \in \cal{L}$ of length at least $p$ can be written as $x = uvw$ such that $|v| \geq 1$, $|uv| \leq p$ and $\forall i \geq 0,\ uv^iw \in \cal{L}$.
If, in addition $\mathcal{L}$ is a simple language, then there is only a finite number of such decompositions.
Therefore, if we assume an upper bound on the number of states of the DFA for $\cal{L}$, two sufficiently long strings belong to the same language if they contain a similar prefix, tandem repeat, and suffix.
Algorithms for finding tandem repeats in a string can thus be used to cluster strings.
Let us consider the string $x = uvvw$.
Tandem repeat finder algorithms will naturally find $v$ as being a tandem repeat.
As a consequence, we can use the tandem repeat found to describe the string as $x = uv^2w$.
We can then generalize this to infer the simple language $\{uv^iw : i \geq 2\}$.
\begin{table*}[!t]
\begin{center}
\begin{tabular}{lcccccc}
\toprule
$abc$ & \multicolumn{3}{c}{$abc$} & \multirow{3}{*}{$(abc)^*$} & \multirow{10}{*}{$\Sigma^*$} \\
\cline{1-4}
$abcabc$ & \multicolumn{2}{c}{\multirow{2}{*}{$(abc)^{\geq 2}$}} & \multirow{2}{*}{$(abc)^+$} \\
\cline{1-1}
$abcabcabc$ & \\
\cline{1-5}
$ababab$ & \multicolumn{2}{c}{\multirow{2}{*}{$(ab)^{\geq 2}$}} & \multirow{2}{*}{$(ab)^+$} & \multirow{7}{*}{$(a^*b^*)^*$} \\
\cline{1-1}
$abababab$ & \\
\cline{1-4}
$aabaabaab$ & \multirow{2}{*}{$(aaab)^{\geq 2}$} & \multirow{2}{*}{$(a^{\geq 2}b)^{\geq 2}$} & \multirow{2}{*}{$(a^+b)^+$} & \\
\cline{1-1}
$aabaabaabaabaab$ \\
\cline{1-4}
$aabbbaabbbaabbb$ & $(aabbb)^{\geq 2}$ & \multirow{2}{*}{$(a^{\geq 2}b^{\geq 2})^{\geq 2}$} & \multirow{2}{*}{$(a^+b^+)^+$} & & \\
\cline{1-2}
$aaabbaaabbaaabb$ & $(aaabb)^{\geq 2}$ \\
\cline{1-3}
$aaabbaaabbaabbbaabbb$ & $(aaabb)^{\geq 2}(aabbb)^{\geq 2}$ & $(a^{\geq 2}b^{\geq 2})^{\geq 2}(a^{\geq 2}b^{\geq 2})^{\geq 2}$ \\
\bottomrule
\end{tabular}
\vspace*{0.1cm}
\caption{Clustering of languages, from fine grained solutions (left) to coarse (right).}
\label{table:clusteringlanguages}
\end{center}
\vspace*{-1cm}
\end{table*}
Now, let us consider a string $x = abcbcbcbcd$.
String $x$ contains two distinct tandem repeats, namely $bc$ and $bcbc$.
By taking the longest tandem repeat that is not a tandem repeat itself, we can say $x = a(bc)^4d$.
By generalizing, we can infer the simple language $\{a(bc)^id : i \geq 2\}$.
Tandem repeats can also be computed recursively.
Let us consider the string $x = aaabcbcaaabcbcaaabcbc$.
We can first detect the tandem repeat $aaabcbc$, and state that $x = (aaabcbc)^3$.
If we again process the result, we can detect tandem repeats $a$ and $bc$, and describe $x$ as $x = (a^3(bc)^2)^4$.
By generalizing, we can infer the simple language $\{(a^i(bc)^j)^k : i,j,k \geq 2\}$.
\paragraph{Ambiguities}
Let $x$ be the string $abaabaab$.
Then, $x$ contains several possible branching tandem repeats, namely $t_1 = baa$, $t_2 = aab$ or $t_3 = aba$.
Thus, we can describe the language for $x$ in different ways, namely $\mathcal{L}_1 = a(baa)^{\geq 2}b$, $\mathcal{L}_2 = ab(aab)^{\geq 2}$ or $\mathcal{L}_3 = (aba)^{\geq 2}ab$.
Nevertheless, all these representations are equal, i.e. $\forall i \geq 0$, $a(baa)^ib = ab(aab)^i = (aba)^iab$.
Therefore, we claim that any of these representations is valid in order to infer the language.
It does not matter which one choose, as long as we check for equivalence.
\paragraph{Hierarchical clustering of languages}
We have defined several steps to generalize pumping decompositions of strings based on tandem repeats.
As shown above, we can describe strings as $x = uv^iw$ for all $i \geq 2$, and cluster them into $uv^{\geq 2}w$.
We then propose to lower the multiplicity of $v$ to $\geq 1$, to get $uv^+w$.
The next step of generalization is to get $uv^*w$ by lowering the multiplicity of $v$ to $\geq 0$.
We can then imagine $\Sigma^*$ to be an ultimate generalization.
Indeed, $\{uvvw\} \subset uv^{\geq 2}w \subset uv^+w \subset uv^*w \subset \Sigma^*$.
In this generalization process, some strings might share some generalizations from given steps.
In Table \ref{table:clusteringlanguages} we propose such a hierarchical clustering of regular languages, from singleton sets to $\Sigma^*$.
\section{Industrial Application}
\begin{table}[!b]
\vspace*{-0.5cm}
\begin{center}
\begin{tabular}{lcc}
\toprule
printjob & pattern & \hspace{0.5cm} type of printjob \\
\midrule
$\ aaaaa$ & \multirow{3}{*}{$a^+$} & \multirow{3}{*}{homogeneous job} \\
\cline{1-1}
\rule{0pt}{2.5ex} $aaaaaaaaaa$ & & \\
\cline{1-1}
\rule{0pt}{2.5ex} $aaaaa\ldots aaa$ & & \\
\cline{1-3}
\rule{0pt}{2.5ex} $abababab$ & \multirow{2}{*}{$(ab)^+$} & \multirow{4}{*}{heterogeneous job} \\
\cline{1-1}
\rule{0pt}{2.5ex} $abababababababab$ & & \\
\cline{1-2}
\rule{0pt}{2.5ex} $abcabcabc$ & \multirow{2}{*}{$(abc)^+$}& \\
\cline{1-1}
\rule{0pt}{2.5ex} $abcabcabcabcabcabc$ & & \\
\cline{1-3}
\rule{0pt}{2.5ex} $abcbcbcbca$ & $a(bc)^+a$ &\multirow{2}{*}{booklet}\\
\cline{1-2}
\rule{0pt}{2.5ex} $abcdebcdebcdea$ & $a^+(bcde)^+a^+$ & \\
\bottomrule
\end{tabular}
\vspace*{0.1cm}
\caption{Sample of identified print-job patterns.}
\label{table:patterns-example}
\end{center}
\vspace*{-0.5cm}
\end{table}
Our case study has been inspired by an industrial problem related to the domain of large-scale printers.
Recent work \cite{waqas} focused on the impact of design parameters of an industrial printer on its productivity.
It appeared in the aforementioned study that the productivity depends on the print-job being rendered.
To that end, the prior identification of the different print-job patterns is crucial in enabling printer engineers to find out optimal parameters related to paper flow, according to each significant type of job being printed.
It is also important to identify significant usages of the printers, in order to set up components as a function of these usages.
Indeed, the productivity of large-scale printers is sensitive to changes of media types, since some component settings (such as printheads height or paper speed for instance) need to be readjusted each time a different media type is used.
Thus, frequent changes of the type of sheets within a print job may lead to a decrease of productivity due to different component settings, if not correctly supported.
We possess a dataset containing more than 23.000 distinct strings, each representing a print job.
Each print job is composed of several pages, that can be of different media types (papers of different thickness, sizes, etc.).
Thus, each string is composed of letters standing for the media-type of the printed page.
We could have for instance $aaaaaabbbbbbbbbb$ that would represent a print job consisting of 6 pages of type $a$, and 10 pages of type $b$.
A characteristic of our dataset, and of our strings to cluster, is that the occurrence of new symbols in the strings follows alphabetical order.
For instance, if we consider $\Sigma = \{a,b,c\}$, our strings will always start with an $a$, followed eventually by either an $a$ or a $b$, etc.
In Table \ref{table:patterns-example}, we present a sample of the significant print job patterns identified using the method involving tandem repeats.
\section{Conclusion and Further Work}
In this paper, we have described different heuristics for learning pairwise disjoint simple languages from positive examples.
The results obtained within the scope of our industrial case study indicate that these methods are applicable in practice.
Nevertheless, we realize that the success of our methods is related to the simplicity of the languages we learn.
Therefore, in future work we aim to formally define a class of languages for which our methods work.
\section*{Acknowledgments}
We would like to thank Lou Somers and Patrick Vestjens\footnote{\{lou.somers,patrick.vestjens\}@oce.com} for providing industrial datasets as well as required expertise related to the case study.
This research is supported by the Dutch Technology Foundation (STW) under the Robust CPS program (project 12693) and by the Netherlands Organisation for Scientific Research (NWO) project on Learning Extended State Machine for Malware Analysis (LEMMA, project 628.001.009).
\bibliographystyle{IEEEtran}
| {'timestamp': '2017-06-07T02:04:40', 'yymm': '1706', 'arxiv_id': '1706.01663', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01663'} | arxiv |
\section{Introduction}
\IEEEPARstart{S}{pectral} analysis techniques are among the most important tools for extracting information from time series data recorded {from} naturally occurring processes. Examples include speech \cite{Quatieri:08}, images \cite{lim1990two}, electroencephalography (EEG) \cite{Buzsaki:09}, oceanography \cite{emery2001data}, climatic time series \cite{ghil2002advanced} and seismic data \cite{Yilmaz:01}. Due to the exploratory nature of most of these applications, non-parametric techniques based on Fourier methods and {wavelets} are among the most widely used. In particular, the multitaper (MT) method excels among the available non-parametric techniques due to both its simplicity and {control over the bias-variance trade-off via bandwidth adjustment \cite{mtm,percival1993,bronez}}.
Most existing spectral analysis techniques assume that the time series is stationary. In many applications of interest, however, the energy of the various oscillatory components in the data exhibits dynamic behavior. {Extensions of stationary time series analysis to these non-stationary processes have led to `time-varying' spectral descriptions such as the Wigner-Ville distribution \cite{Cohen95,martin1985wigner}, the evolutionary spectra and its generalizations \cite{priestley1965evolutionary,matz1997generalized}, and the time-frequency operator symbol formulation \cite{matz2006nonstationary} (See \cite{kozek1996matched} for a detailed review).} A popular approach to {estimating} such time-varying spectra is to subdivide the data into overlapping windows or segments and estimate the spectrum locally for each window using various Fourier or wavelet-based methods\cite{HAMMOND1996419}, assuming the underlying process is quasi-stationary, i.e., the spectrum changes slowly with time. Thereby, the so-called spectrogram analysis is obtained by using sliding windows with overlap in order to capture non-stationarity.
Although sliding window processing is widely used due to its fast implementation, it has several major drawbacks. {First, the window length and extent of overlap are subjective choices and can drastically change the overall attribute of the spectrogram if chosen poorly.} Second, given that {the estimate associated to a given window is obtained by only the data within}, it ignores the common dynamic trends shared across multiple windows, and thereby fails to fully capture the degree of smoothness inherent in the signal. Instead, the smoothness of the estimates is enforced by the amount of overlap between adjacent windows. {Third, although techniques such as the MT analysis are able to mitigate the variabilities arising from finite data duration or the so-called `sampling' noise by averaging over multiple tapers, their spectral resolution degrades when applied to data within small windows due to the increase in the Rayleigh resolution \cite{rayleigh1994collected}. In addition, they do not have a mechanism in place to suppress the additive measurement noise that commonly contaminates empirical observations.} {Fourth}, the overlap between adjacent windows hinders a precise statistical assessment of the estimates, such as constructing confidence intervals due to the high dependence of estimates across windows. To address this issue, statistical corrections for multiple comparisons need to be employed \cite{efron1982jackknife}, which in turn limit the resulting test powers when multiple windows are involved.
In recent years, several alternative approaches to non-stationary spectral analysis have been proposed, such as the empirical mode decomposition (EMD) \cite{Huang903full}, synchrosqueezed wavelet transform \cite{daubechies2011synchrosqueezed,daubechies2016conceft}, time-frequency reassignment \cite{xiao2007multitaper}, {time-frequency ARMA models \cite{Jachan2007TFARMA}}, and spectrotemporal pursuit \cite{ba2014}. These techniques aim at decomposing the data into a small number of smooth oscillatory components in order to produce spectral representations that are smooth in time but sparse or structured in frequency. Although they produce spectral estimates that are highly localized in the time-frequency plane, they require certain assumptions on the data to hold. {For example, EMD analysis assumes the signal to be deterministic and does not take into account the effect of observation noise \cite{Huang903full}.} Other methods assume that the underlying spectrotemporal components pertain to certain structures such as amplitude-modulated narrowband mixtures \cite{daubechies2011synchrosqueezed, daubechies2016conceft}, sparsity \cite{ba2014} or chirp-like dynamics \cite{xiao2007multitaper}. In addition, they lack a statistical characterization of the estimates. Finally, although these sophisticated methods provide spectrotemporal resolution improvements, they do not yield implementations as simple as those of the sliding window-based spectral estimators.
{In this paper, we address the above-mentioned shortcomings of {sliding window multitaper estimators} by resorting to state-space modeling. State-space models provide a flexible and natural framework for analyzing systems that evolve with time \cite{fahrmeir2013multivariate, shum,ssm2003,Kitagawa1987}, and have been previously used for parametric \cite{bohlin1977analysis, Jachan2007TFARMA} and non-parametric \cite{ba2014} spectral estimation. The novelty of our approach is in the integration of techniques from MT analysis and state-space modeling in a Bayesian estimation framework. To this end, we construct state-space models in which the underlying states pertain to the eigen-spectral quantities, such as the empirical eigen-coefficients and eigen-spectra arising in MT analysis. We employ state dynamics that capture the evolution of these quantities, coupled with observation models that {reflect} the effect of {measurement} and sampling noise. We then utilize Expectation-Maximization (EM) to find the maximum \emph{a posteriori} (MAP) estimate of the states given the observed data to construct our spectral estimators as well as statistical confidence intervals.}
{We provide theoretical analysis of the bias-variance trade-off, which reveals two major features of our proposed framework: 1) our methodology inherits the control mechanism of the bias-variance trade-off from the MT framework by means of changing the design bandwidth parameters \cite{bronez}, and 2) our algorithms enjoy the optimal data combining and denoising features of Bayesian filtering and smoothing.} In addition, due to the simplicity and wide usage of Bayesian filtering and smoothing algorithms, our algorithms are nearly as simple to implement as the sliding window-based spectrograms. To further demonstrate the performance of our algorithms, we apply them to synthetic as well as real data including human EEG recordings during sleep and electric network frequency data from audio recordings. Application of our proposed estimators to these data provides spectrotemporal features that are significantly denoised, are smooth in time, and enjoy high spectral resolution, thereby corroborating our theoretical results.
The rest of the paper is organized as follows: In Section \ref{problem}, we present the preliminaries and problem formulation. In Section \ref{sec:algorithms}, we develop our proposed estimators. Application of our estimators to synthetic and real data are given in Section \ref{sec:application}, followed by our theoretical analysis in Section \ref{sec:theory}. Finally, our concluding remarks are presented in Section \ref{sec:conclusion}.
\section{Preliminaries and Problem Formulation}
\label{problem}
\subsection{Non-stationary Processes and Time-Varying Spectrum}
Consider a finite realization of $T$ samples from a discrete-time non-stationary process $y_t, t = 1,2, \cdots T$, obtained via sampling a
continuous-time signal above Nyquist rate. We assume that the non-stationary process $y_t$ is harmonizable so that it admits a Cram\'{e}r representation\cite{Loeve63} of the form:
\begin{equation}
\label{eq:cramer}
y_t = \int_{-\frac{1}{2}}^{\frac{1}{2}} e^{i2\pi f t} dz(f),
\end{equation}
where $dz(f)$ is the generalized Fourier transform of the process. This process has a covariance function of the form:
\begin{align} \label{eq:gen_covar}
\!\!\!\!\resizebox{.94\columnwidth}{!}{$\displaystyle \Gamma_{L}(t_1,t_2)\!:=\!\mathbbm{E}[y_{t_1}y^{*}_{t_2{}}]\!=\! \int_{-\frac{1}{2}}^{\frac{1}{2}}\!\int_{-\frac{1}{2}}^{\frac{1}{2}} e^{i2\pi(t_1f_1-t_2f_2)}\gamma_{L}(f_1,f_2)df_1df_2$,}
\end{align}
where $ \gamma_{L}(f_1,f_2)\!\!:=\!\!\mathbbm{E}[dz(f_1)dz^{*}(f_2)] $ is referred to as the generalized spectral density or the Lo\`{e}ve spectrum \cite{thomsonbc}. Due to the difficulty in extracting physically-plausible spectrotemporal information from the two-dimensional function $\gamma_{L}(f_1,f_2)$, other forms of spectrotemporal characterization that are two-dimensional functions over time and frequency have gained popularity \cite{HAMMOND1996419}. To this end, by defining the coordinate rotations $t := (t_1 + t_2)/2$, $\tau := t_1 - t_2$, $f := (f_1 + f_2)/2$, and $g := f_1 -f_2$ and by substituting in the definition of the covariance function in (\ref{eq:gen_covar}), we obtain:
\begin{align} \nonumber
\resizebox{!}{!}{$\displaystyle \Gamma(\tau,t)\!:=\!\Gamma_{L}(t_1,t_2)\!\!=\!\!\!\int_{-\frac{1}{2}}^{\frac{1}{2}}\!\int_{-\frac{1}{2}}^{\frac{1}{2}}\!\!\!\!e^{i2\pi(tg+\tau f)}\gamma(g,f)dfdg$,}
\end{align}
where $f$ and $g$ are referred to as the ordinary and non-stationary frequencies, respectively\cite{thomsonbc}, and
$\gamma(g,f)df dg := \gamma_{L}(f_1,f_2)df_1df_2$
is the Lo\`{e}ve spectrum in the rotated coordinates. To obtain one such two-dimensional spectral density representation over time and frequency, we define:
\begin{align} \label{eq:Wigner}
\resizebox{0.91\columnwidth}{!}{$\displaystyle \!\!\!\!\!D(t,f)\!:=\!\! \int_{-\frac{1}{2}}^{\frac{1}{2}}\!\!e^{i2\pi tg} \gamma(g,f) dg\!=\!\!\int_{-\frac{1}{2}}^{\frac{1}{2}}\!\!e^{-i2\pi\tau f} \mathbbm{E}[y_{t+\frac{\tau}{2}}y_{t-\frac{\tau}{2}}^{*}] d\tau,$}
\end{align}
which coincides with the expected value of the Wigner-Ville distribution \cite{Cohen95}. The `time-varying' spectral representation $D(t,f)$ captures the spectral information of the data as a function of time, and thus provides a useful framework for analyzing non-stationary time series. {However, estimating $D(t,f)$ from finite samples of the process is challenging, considering that the expectation needs to be replaced by time averages which may smooth out the time-varying features of the signal \cite{martin1985wigner}.}
{In order to address this challenge, certain additional assumptions need to be imposed on the underlying process, which as a matter of fact restrict the extent of temporal or spectral variations the signal can exhibit. In this regard, two such popular assumptions are posed in terms of the \emph{quasi-stationary} and \emph{underspread} properties. In order to define these properties quantitatively, let us first define the Expected Ambiguity Function (EAF) \cite{kozek1996matched,matz1997generalized} as:
\begin{align}
\resizebox{0.91\columnwidth}{!}{$\displaystyle \!\!\!\!\!\Delta(\tau,g)\!:=\!\int_{-\frac{1}{2}}^{\frac{1}{2}}\!\!e^{i2\pi \tau f} \gamma(g,f) df\!=\!\! \int_{-\frac{1}{2}}^{\frac{1}{2}}\!\!e^{-i2\pi t g} \mathbbm{E}[y_{t+\frac{\tau}{2}}y_{t-\frac{\tau}{2}}^{*}] dt$}
\end{align}
A signal whose EAF has a limited spread along $g$ (i.e., negligible spectral correlation) is called \emph{quasi-stationary}. If the signal is concentrated around the origin with respect to both $\tau$ and $g$ (i.e., small spectral and temporal correlation), it is called \emph{underspread.} There exists a large body of work on estimating time-varying spectra under the quasi-stationarity assumption, such as short-time periodograms, pseudo-Wigner estimators \cite{martin1985wigner}, and estimates of the evolutionary spectra \cite{priestley1965evolutionary}. More recent methods such as the Generalized Evolutionary Spectra (GES) estimators \cite{matz1997generalized} and time-frequency auto-regressive moving-average (TFARMA) \cite{Jachan2007TFARMA} estimators rely on the underspread property of the underlying signals. We refer the reader to \cite[Chapter 10]{hlawatsch2013time} for a detailed discussion of these properties.}
{It is noteworthy that both assumptions are fairly general, encompass a broad range of naturally-occurring processes, and have resulted in successful applications in real life problems. We will next discuss one of the widely used methods for estimating time-varying spectra under the quasi-stationary assumption, which extends MT spectral analysis beyond second-order stationary processes and has gained popularity in exploratory studies of naturally occurring processes \cite{thomsonbc}.}
\subsection{The Sliding Window MT Spectral Analysis}
{One of the popular non-parametric techniques for estimating the `time-varying' spectral representation $D(t,f)$ is achieved by subdividing the data into overlapping windows or segments and estimating the spectrum for each window independently using the MT method \cite{thomsonbc}. This method naturally and intuitively extends the popular non-parametric MT method to the non-stationary scenario under the assumption of quasi-stationarity, which enables one to treat the time series within segments (locally) as approximately second-order stationary \cite{priestley1981spectral}. The resulting spectrotemporal representations are smoothed version of the Wigner-Ville distribution \cite{kozek1996matched} and are referred to as spectrogram. In what follows, we briefly describe the MT spectrogram method, since it preludes the rest of our treatment.}
The MT method is an extension of single-taper spectral analysis, where the data is element-wise multiplied by a taper prior to forming the spectral representation to mitigate spectral leakage \cite{percival1993, mtm}. In the MT method, spectral representation is computed as the average of several such single-taper PSDs, where the tapers are orthogonal to each other and exhibits good leakage properties. This can be achieved by using the \textit{discrete prolate spheroidal sequences} (dpss) or {\textit{Slepian sequences}} \cite{slepian78}, due to their orthogonality and optimal leakage properties.
Another viewpoint of the MT method with this particular choice of data tapers is the decomposition of the spectral representation of the process over a set of orthogonal basis functions. Indeed, these basis functions originate from an approximate solution to the integral equation expressing the projection of $dz(f)$ onto the Fourier transform of the data:
\begin{align}
\nonumber y(f) = \int_{-\frac{1}{2}}^{\frac{1}{2}}\frac{\sin W \pi (f-\zeta)}{\sin \pi (f-\zeta)} e^{-i2\pi (f-\zeta) \frac{W-1}{2}}dz(\zeta).
\end{align}
where $W$ is window length, i.e., number of samples, and $dz(\zeta)$ is an orthogonal increment process. This integral equation can be approximated using a local expansion of the increment process over an interval $[-B, B]$, for some small design band-width $B$, in the space spanned by the eigenfunctions of the Dirichlet kernel $\frac{\sin W \pi f}{\sin \pi f}$ \cite{percival1993, mtm}.
These eigenfunctions are known as the prolate spheroidal wave functions (PSWFs), which are a set of doubly-orthogonal functions over $[-B, B]$ and $[-{1}/{2}, {1}/{2}]$, with time-domain representations given by the dpss sequences. Let $u_l^{(k)}$ be the $l$th sample of the $k$th dpss sequence, for a given bandwidth $B$ and window length $W$. The $k$th PSWF is then defined as:
\vspace{-2mm}
\begin{align}
\nonumber U^{(k)}(f) := \sum_{l = 0}^{W-1} u_l^{(k)}e^{-i2\pi f l}.
\end{align}
{Choosing $K \leqslant \lfloor2WB\rfloor -1$ dpss having eigenvalues close to $1$ as data tapers}, the {MT spectral estimate} can be calculated as follows:
\begin{align}
\label{eq:mtsa}
\widehat{S}^{(\sf mt)}(f) := \frac{1}{K}\sum_{k=1}^{K}|{\widehat{x}^{(k)}(f)}|^2,
\end{align}
where ${\widehat{x}^{(k)}(f)} := \sum_{l=0}^{W-1}e^{-i2\pi f l}u_l^{(k)}y_{l}$ for $k=1,2,\cdots, K$ are called the `eigen-coefficients'. The `eigen-spectra', $\widehat{S}^{(k)}(f) := |{\widehat{x}^{(k)}(f)}|^2$ can be viewed as the expansion coefficients of the decomposition.
To estimate time-varying spectra under the MT framework, sliding windows with overlap are used to enforce temporal smoothness and increase robustness of the estimates \cite{reviewmtm,thomsonbc}, resulting in MT spectrogram estimates. {Although this `overlapping' MT procedure overcomes frequency leakage issues and produces consistent estimates, subjective choices of the window length and the degree of overlap can change the overall appearance of the spectrogram drastically when poor choices of these parameters are used.
In addition, these estimates lack precise statistical inference procedures, such as hypothesis testing, due to the statistical dependence induced by the overlaps. The objective of this work is to overcome these limitations by directly modeling and estimating the evolution of the process without committing to overlapping sliding windows, while achieving fast and efficient implementations. {Before presenting our proposed solutions, we give a brief overview of other existing approaches in the literature in order to put our contributions in context.}
\vspace{-2mm}
\subsection{Motivation and Connection to Existing Literature}
{Our goal is to overcome the foregoing challenges faced by the sliding window MT spectrogram analysis in estimating the expected value of the Wigner-Ville distribution (See Eq. (\ref{eq:Wigner})) under the quasi-stationarity assumption. In addition, our work can be viewed in the context of the spectrogram approximation to the evolutionary spectra \cite{priestley1965evolutionary}. The evolutionary spectra is obtained by considering an expansion of $y_t$ over the set of complex sinusoids as
\begin{equation}
\displaystyle y_t = \int_{-1/2} ^{1/2}x_t(f)e^{j2\pi ft} df,
\end{equation}
with uncorrelated time-varying expansion coefficients, i.e., $\displaystyle \mathbbm{E}[x_t(f_1)x_t^{*}(f_2)] = D(t,f_1)\delta(f_1-f_2)$. In standard MT spectrogram analysis, the extent of overlap between consecutive segments dictates the amount of temporal smoothness in the estimates. Our approach is to avoid the usage of overlapping windows by modeling and estimating the dependence of the spectra across windows using state-space models, while retaining the favorable leakage properties of the MT analysis. As will be revealed in the subsequent sections, in the same vein as the sliding window multitaper analysis our methods pertain to the class of spectrogram estimates, which are viewed as smoothed versions of the Wigner-Ville spectrum \cite{kozek1996matched}.}
{Due to the underlying quasi-stationarity assumption, i.e., negligible spectral correlation, the domain of applicability of our methods might be narrower than the more general non-stationary spectral analysis methods such as GES and Weyl spectral estimation and TFARMA modeling; however, our methods admit simple and efficient implementations, which makes them attractive for exploratory applications in which sliding window processing is widely used with subjective and ad hoc choices of design parameters. In this context, the novelty of our contributions lies in:}
\begin{itemize}
\item[1)] Capturing the evolution of the spectra across windows by modeling the dynamics of certain eigen-spectral quantities arising in MT analysis (e.g., spectral eigen-coefficients and eigen-spectra);
\item[2)] Addressing the additive measurement noise and multiplicative sampling noise, which severely distort the spectrograms obtained by the multitaper framework; and
\item[3)] Constructing a framework for precise statistical assessment of the estimates, by addressing the dependency among windows using a Bayesian formulation.
\end{itemize}
As it will be evident in Section \ref{sec:theory}, the use of state-space models in the context of MT analysis results in adaptive weighting of the estimates of the eigen-coefficients or eigen-spectra across windows, thanks to the optimal data combining feature of Bayesian smoothing. These adaptive weights depend on the common dynamic trends shared across windows and hence result in capturing the degree of smoothness inherent in the signal, while producing estimates robust against uncertainties due to observation noise and limited data.
{It is noteworthy that the use of state-space models in our work is significantly different from those used in \emph{parametric} non-stationary spectral analysis methods such as TFARMA modeling \cite{Jachan2007TFARMA}. In the TFARMA formulation, time delays and frequency shifts are used to model the non-stationary dynamics of the process in a physically intuitive way. These state-space models therefore determine the functional form of the resulting spectral estimates in closed form in terms of the finite set of ARMA coefficients. The state-space models used in our work, however, do not determine the functional form of the spectral estimates at each window, and rather control the temporal smoothness of the eigen-spectral quantities via forming a regularization mechanism in the underlying Bayesian estimation framework (See Section \ref{sec:inverse}). In our approach, we indeed estimate the spectrogram at a given number of frequency bins in each window, which scales with the total number of samples, in the same vein as sliding window MT spectrogram.}
{In light of the above, our algorithms belong to the class of \emph{semi-parametric} estimation methods, as the underlying model is a hybrid of \emph{parametric} unobservable state evolution process and a \emph{non-parametric} data generating process \cite{powell1994estimation}. In Section \ref{sec:simulation}, we will compare our proposed semi-parametric methodology with both non-parametric and parametric techniques, namely the MT spectrogram analysis and the Time-Frequency Autoregressive (TFAR) modeling technique \cite{Jachan2007TFARMA}.}
\color{black}
\vspace{-2mm}
\subsection{Problem Formulation}
Assume, without loss of generality, that an arbitrary window of length $W$ is chosen so that for some integer $N$, $NW = T$ and let $\mathbf{y}_n = \big[y_{(n-1)W+1}, y_{(n-1)W+2} ,\cdots, y_{nW}\big]^\top$ for $n = 1,2 \cdots N$, denotes the data in the $n$th window. This way, the entire data is divided into $N$ non-overlapping segments of length $W$ each. To this end, we invoke quasi-stationarity assumption by modeling $y_t$ to be stationary within each of these segments of length $W$. With this assumption, motivated by the major sources of uncertainty in spectral estimation, i.e., measurement noise and sampling noise, we formulate two state-space frameworks in the following subsections.
\subsubsection{Mitigating the Measurement Noise}
\label{sec:MeasurementNoise}
{Suppose that $\widetilde{y}_t$ is the noise corrupted observation obtained from the true signal $y_t$, i.e., $\widetilde{y}_t = y_t + v_t$, where $(v_t)_{t=1}^T$ is an i.i.d. zero-mean Gaussian noise sequence with fixed variance $\sigma^2$}. By discretizing the representation in (\ref{eq:cramer}) at a frequency spacing of $2\pi/J$ with $J$ an integer, at any arbitrary window $n$, we have
\begin{align}
\label{eq:meas_noise_model}
\widetilde{\mathbf{y}}_n = \mathbf{F}_n \mathbf{x}_n + \mathbf{v}_n,
\end{align}
where $\mathbf{F}_n$ is a matrix with elements $(\mathbf{F}_n)_{l,j} := \exp\big(i2\pi(((n-1)W+l)\frac{j-1}{J})\big)$ for $l = 1,2,\cdots, W$ and $j = 1,2,, \cdots J$; $\widetilde{\mathbf{y}}_n := \big[\widetilde{y}_{(n-1)W+1}, \widetilde{y}_{(n-1)W+2} ,\cdots, \widetilde{y}_{nW}\big]^\top$ is the noisy observation of the true signal $\mathbf{y}_n$; $x_n(f)$ and $\mathbf{x}_n:= \big[x_n(0), x_n(2\pi\frac{1}{J}), \cdots ,x_n(2\pi\frac{J-1}{J})\big]^\top$ denote the orthogonal increment process and its discretized version, respectively at window $n$ and $\mathbf{v}_n = \big[v_{(n-1)W+1}, v_{(n-1)W+2} ,\cdots, v_{nW}\big]^\top$ is zero-mean Gaussian noise with covariance $\text{Cov}\{\mathbf{v}_i,\mathbf{v}_j\} = \sigma^2\mathbf{I}\delta_{i,j}$ .
Let $ \mathbf{u}^{(k)}\!:=\!\big[u_{1}^{(k)}, u_{2}^{(k)} ,\cdots, u_{W}^{(k)}\big]^\top $ denotes the $k$th dpss taper and {$\widetilde{\mathbf{y}}_n^{(k)} := \mathbf{u}^{(k)} \odot \widetilde{\mathbf{y}}_n$}, where $\odot$ denotes element-wise multiplication. Let $x_n^{(k)}(f)$ and $\mathbf{x}_n^{(k)} := \left [x_n^{(k)}(0), x_n^{(k)}(2\pi\frac{1}{J}), \cdots ,x_n^{(k)}(2\pi\frac{J-1}{J})\right ]^\top$ denote the $k$th spectral eigen-coefficient of $\mathbf{y}_n$ and its discretized version, respectively, for $k=1,2,\cdots,K$. Then, following (\ref{eq:meas_noise_model}) we consider the following spectrotemporal representation of the tapered data segments:
\vspace{-2mm}
\begin{align}
\label{eq:formod1}
\widetilde{\mathbf{y}}_n^{(k)}= \mathbf{F}_n \mathbf{x}_{n}^{(k)} + \mathbf{v}_n^{(k)},
\end{align}
where $\mathbf{v}^{(k)}_n$ is the contribution of $\mathbf{v}_n$ to the $k$th tapered data, assumed to be independent of $\mathbf{x}_{1:n-1}^{(k)}$, and identically distributed according to a zero-mean Gaussian distribution with covariance $\text{Cov}\{\mathbf{v}^{(k)}_i,\mathbf{v}^{(k)}_j\} ={\sigma^{(k)}}^2 \mathbf{I}\delta_{i,j}$. We view $\widetilde{\mathbf{y}}_n^{(k)}$ as a noisy observation corresponding to the true eigen-coefficient $\mathbf{x}_{n}^{(k)}$, which provides a linear Gaussian forward model for the observation process.
In order to capture the evolution of the spectrum and hence systematically enforce temporal smoothness, we impose a stochastic continuity constraint on the eigen-coefficients $( \mathbf{x}_{n}^{(k)})_{n=1}^{N}$ for $ k = 1,2, \cdots K$, using a first-order difference equation:
\vspace{-2mm}
\begin{align} \label{eq:scc1}
\mathbf{x}_n^{(k)} = \alpha^{(k)} \mathbf{x}_{n-1}^{(k)} + \mathbf{w}^{(k)}_n,
\end{align
where $0 \leqslant \alpha^{(k)}<1$, and $\mathbf{w}^{(k)}_n$ is independent of $\mathbf{x}_{1:n-1}^{(k)}$ and assumed to be independently distributed according to a zero-mean Gaussian distribution with diagonal covariance $\text{Cov}\{\mathbf{w}^{(k)}_i,\mathbf{w}^{(k)}_j\} = \mathbf{Q}^{(k)}_i \delta_{i,j}$. Under this assumption, the discrete-time process, $(\mathbf{x}_n^{(k)})_{n=1}^{N}$ forms a jointly Gaussian random process with independent increments, while the process itself is statistically dependent. An estimate of the unobserved states (true eigen-coefficients) from the observations (tapered data) under this model suppresses the measurement noise and captures the state dynamics.
\subsubsection{Mitigating the Sampling Noise}
\label{sec:SamplingNoise}
Suppose the additive measurement noise is negligible, i.e. $v_t \approxeq 0$. For now, consider only a single window of length $W$. It is known that when the spectrum does not rapidly vary over the chosen design bandwidth $B$, the eigen-spectra are approximately uncorrelated and the following approximation holds for $k = 1,2 \cdots, K$ \cite{thomsonbc,percival1993}:
\begin{align}\label{eq:chi}
\frac{\widehat{S}^{(k)}(f)}{S(f)} \sim \frac{\chi_{2}^2}{2}, \text{ } 0 <f <1/2,
\end{align}
where $\widehat{S}^{(k)}(f)$ and $S(f)$ are the tapered estimate and true PSD, respectively. {In other words, the empirical eigen-spectra of the process can be thought of as the true spectra corrupted by a multiplicative noise, due to sampling and having access to only a single realization of the process. We refer to this uncertainty induced by sampling as \emph{sampling noise}.} {By defining $\psi^{(k)}(f) := \log{\widehat{S}^{(k)}(f)} + \log2$ and $s^{(k)}(f) := \log{S(f)}$, we can transform the multiplicative effect of the {sampling noise} in Eq. (\ref{eq:chi}) to the following additive forward model\cite{rosen2009}:
\begin{align}
\psi^{(k)}(f) = s^{(k)}(f) + \phi^{(k)}(f),
\end{align}
where $\phi^{(k)}(f)$ is a log-chi-square distributed random variable, capturing the uncertainty due to sampling noise.} It can be shown that $\phi^{(k)}(f)$ has a density given by:
\begin{align}
p(\phi) = \frac{1}{2}\exp\left (\phi-\frac{1}{2}\exp(\phi)\right),
\end{align}
which belongs to the family of log-Gamma distributions, including the Gumbel and Bramwell-Holdsworth-Pinton distributions common in extreme value statistics \cite{Prentice74}.
In order to incorporate this observation model in our dynamic framework, we define the state vector, $\mathbf{s}_n^{(k)}\!:=\!\Big[ s_n^{(k)}(0), s_n^{(k)}\Big(\textstyle 2\pi\frac{1}{J}\Big), \cdots ,s_n^{(k)}\Big(\textstyle2\pi\frac{J-1}{J}\Big)\Big]^{\top}$; the observation vector, $\boldsymbol{\psi}_n^{(k)}\!:=\!\Big [\psi_n^{(k)}(0), \psi_n^{(k)}\Big(\textstyle2\pi\frac{1}{J}\Big), \cdots ,\psi_n^{(k)}\Big(\textstyle2\pi\frac{J-1}{J}\Big)\Big]^{\top}$ and the observation noise vector, $
\boldsymbol{\phi}_n^{(k)} := \Big[\phi_n^{(k)}(0), \phi_n^{(k)}\Big(\textstyle2\pi\frac{1}{J}\Big), \cdots ,\phi_n^{(k)}\Big(\textstyle2\pi\frac{J-1}{J}\Big)\Big]^{\top}$. Then, the forward model at window $n$ can be stated as:
\begin{align}\label{eq:formod2}
\boldsymbol{\psi}_n^{(k)} = \mathbf{s}_n^{(k)} + \boldsymbol{\phi}_n^{(k)},
\end{align}
where each element of $\boldsymbol{\phi}_n^{(k)}$ is log-chi-square distributed. Similar to the preceding model, we impose a stochastic continuity constraint over the logarithm of the eigen-spectra as follows:
\begin{align} \label{eq:scc2}
\mathbf{s}_n^{(k)} = \theta^{(k)} \mathbf{s}_{n-1}^{(k)} + \mathbf{e}_n^{(k)},
\end{align}
where $0 \leqslant \theta^{(k)} < 1$, and $\mathbf{e}_n^{(k)}$ is assumed to be a zero-mean Gaussian vector {independent of $\mathbf{s}_{1:n-1}^{(k)}$ and} with a diagonal covariance $\text{Cov}\{\mathbf{e}^{(k)}_i,\mathbf{e}^{(k)}_j\} = \mathbf{R}^{(k)}_i \delta_{i,j}$. Note that the logarithm function maps the range of the eigen-spectra in $[0,\infty)$ to $(-\infty,\infty)$ which makes the Gaussian state evolution plausible. An estimate of the unobserved states (logarithm of the true spectra) from the observations (logarithm of the empirical eigen-spectra) under this model suppresses the sampling noise and captures the state dynamics.
In summary, through these models we project the data of each short window onto the functional space spanned by the PSWFs and impose stochastic continuity constraints ((\ref{eq:scc1}) and (\ref{eq:scc2})) on these projections (eigen-coefficients or eigen-spectra) in order to recover spectral representations that are smooth in time and robust against measurement or sampling noise. Fig. \ref{fig:scheme} provides a visual illustration of the proposed modeling paradigm.
\begin{figure}[!t]
\centering
\includegraphics[width=.75\columnwidth]{Fig1.pdf}%
\caption{Schematic depiction of the proposed models.}
\label{fig:scheme}
\vspace{-5mm}
\end{figure}
\vspace{-2mm}
\subsection{The Inverse Problem}\label{sec:inverse}
We formulate the spectral estimation problem as one of Bayesian estimation, in which the Bayesian risk/loss function, fully determined by the posterior density of $(\mathbf{x}_n^{(k)})_{n=1,k=1}^{N,K}$ (resp. $(\mathbf{s}_n^{(k)})_{n=1,k=1}^{N,K}$) given the observations $(\widetilde{\mathbf{y}}_n^{(k)})_{n=1,k=1}^{N,K}$ (resp. $(\boldsymbol{\psi}_n^{(k)})_{n=1,k=1}^{N,K}$) is minimized. We first consider the forward model of (\ref{eq:formod1}), which provides the observed data likelihood given the states. Under the state-space model of Eq. (\ref{eq:scc1}), the $k$th eigen-coefficient can be estimated by solving the following maximum \emph{a posteriori} (MAP) problem:
\begin{align}
\label{opt:DBMT}
\hspace*{-2mm}\min_{\mathbf{x}_1^{(k)},\mathbf{x}_2^{(k)},\cdots,\mathbf{x}_N^{(k)}} &\sum_{n = 1}^{N}\bigg[ \frac{1}{\sigma^2} \left \| \widetilde{\mathbf{y}}_n^{(k)} -\mathbf{F}_n\mathbf{x}^{(k)}_n\right \|_2^2 + \nonumber \\ &\!\!\!\!(\mathbf{x}_n^{(k)} -\alpha\mathbf{x}_{n-1}^{(k)})^H {\mathbf{Q}^{(k)}_{n}}^{-1}(\mathbf{x}_n^{(k)} -\alpha\mathbf{x}_{n-1}^{(k)})\bigg],
\end{align}
for $k = 1,2, \cdots, K$. {Similarly}, in the second state space framework (\ref{eq:formod2}), the eigen-spectra can be obtained by solving another MAP estimation problem:
\begin{align}
\label{opt:log-DBMT}
\min_{\mathbf{s}_1^{(k)},\mathbf{s}_2^{(k)},\cdots,\mathbf{s}_N^{(k)}} &\sum_{n = 1}^{N}\bigg[ \mathbf{1}_J^\top[\mathbf{s}_n^{(k)} - \boldsymbol{\psi}_n^{(k)} + \frac{1}{2}\exp(\boldsymbol{\psi}_n^{(k)}-\mathbf{s}_n^{(k)})] \nonumber \\
+&(\mathbf{s}_n^{(k)} -\theta \mathbf{s}_{n-1}^{(k)})^H {\mathbf{R}_{n}^{(k)}}^{-1}(\mathbf{s}_n^{(k)} -\theta\mathbf{s}_{n-1}^{(k)})\bigg],
\end{align}
for $k = 1,2, \cdots, K$, where $\mathbf{1}_J$ is the vector of all ones of length $J$. We call the MAP estimation problems in (\ref{opt:DBMT}) and (\ref{opt:log-DBMT}) the Dynamic Bayesian Multitaper ({\sf DBMT}) and the {\sf log-DBMT} estimation problems, respectively. Similarly, the respective spectrogram estimates will be denoted by the {\sf DBMT} and {\sf log-DBMT} estimates.
Equation (\ref{opt:DBMT}) is a strictly convex function of $\mathbf{x}^{(k)}_n \in \mathbb{C}^{W}$ and $\mathbf{Q}^{(k)}_n \in \mathbb{S}^W_{++}$ for $n = 1,2\cdots,N$, which can be solved using standard optimization techniques. However, these techniques do not scale well with the data length $N$. A careful examination of the log-posterior reveals a block tri-diagonal structure of the Hessian, which can be used to develop efficient recursive solutions that exploit the temporal structure of the problem. A similar argument holds for the optimization problem in (\ref{opt:log-DBMT}). However, the parameters of these state-space models need to be estimated from the data. In the next section, we show how the EM algorithm can be used to both estimate the parameters and states efficiently from the optimization problems (\ref{opt:DBMT}) and (\ref{opt:log-DBMT}).
\vspace{-3mm}
\section{Fast Recursive Solutions via the EM Algorithm}\label{sec:algorithms}
In order to solve the MAP problem in (\ref{opt:DBMT}), we need to find the parameters $\mathbf{Q}_{n}^{(k)} \in \mathbb{S}^W_{++}$ and $\alpha^{(k)} \in (0,1]$ for $n = 1,2\cdots,N$ and $k=1,2,\cdots,K$. Similarly $\mathbf{R}_{n}^{(k)} \in \mathbb{S}^W_{++}$ and $\theta^{(k)} \in (0,1]$ need to be estimated for the problem in (\ref{opt:log-DBMT}). If the underlying states were known, one could further maximize the log-posterior with respect to the parameters. This observation can be formalized in the EM framework \cite{em1977,ssm2003,shum}. To avoid notational complexity, we drop the dependence of the various variables on the taper index $k$ in the rest of this subsection.
\subsection{The {\sf DBMT} Spectrum Estimation Algorithm}
By treating $\mathbf{x}_n, n = 1,2,\cdots,N$ as the hidden variables and $\alpha, \mathbf{Q}_{n},n = 1,2,\cdots,N$ as the unknown parameters to be estimated, we can write the complete log-likelihood as:
\vspace{-2mm}
\begin{align}\label{eq:complete-ll1}
\log L(\alpha,\mathbf{Q}_{1:N}) &:= - \sum_{n = 1}^{N}\!\bigg[\frac{1}{\sigma^2}\left \|\widetilde{\mathbf{y}}_n - \mathbf{F}_n\mathbf{x}_n \right \|_2^2 + \log |\det \mathbf{Q}_n|\nonumber \\[-2mm]
& \!\!\!\!\!\!\!\!\!\!\!\!\!+ (\mathbf{x}_n-\alpha\mathbf{x}_{n-1})^H\mathbf{Q}_n^{-1}(\mathbf{x}_n - \alpha\mathbf{x}_{n-1}) \bigg ] + {c},
\end{align}
\noindent {where $c$ represents the terms that do not depend on $\alpha$, $( \mathbf{Q}_{n})_{n=1}^N$ or $(\mathbf{x}_{n})_{n=1}^N$}. For simplicity of exposition, we assume that $\mathbf{Q}_{n} = \mathbf{Q}$ for $n = 1,2,\cdots,N$. The forthcoming treatment can be extended to the general case with little modification. Also, note that $\sigma^2$ can be absorbed in $\mathbf{Q}$, and thus is assumed to be known. At the $l$th iteration, we have:
\subsubsection{E-Step}
Given $\alpha^{[l]}, \mathbf{Q}^{[l]}$, for $ n = 1,2,\cdots,N$, the expectations,
$\mathbf{x}_{n|N}:=\mathbbm{E}[\mathbf{x}_n|\widetilde{\mathbf{y}}_{1:N},\alpha^{[l]},\mathbf{Q}^{[l]}],$
$\boldsymbol{\Sigma}_{n|N}:=\mathbbm{E}[(\mathbf{x}_n-\mathbf{x}_{n|N})(\mathbf{x}_n-\mathbf{x}_{n|N})^H|\widetilde{\mathbf{y}}_{1:N},\alpha^{[l]},\mathbf{Q}^{[l]}],$
$\boldsymbol{\Sigma}_{n,n-1|N}:=\mathbbm{E}[(\mathbf{x}_n\!-\!\mathbf{x}_{n|N})(\mathbf{x}_{n-1}\!-\!\mathbf{x}_{n-1|N})^H|\widetilde{\mathbf{y}}_{1:N},\alpha^{[l]},\mathbf{Q}^{[l]}],$
can be calculated using the Fixed Interval Smoother (\textit{FIS}) \cite{rauch65} (lines 4 and 5) and the state-space covariance smoothing algorithm \cite{Jong1988} (line 6). These expectations can be used to compute the expectation of the complete data log-likelihood $\mathbbm{E}\big[\log L(\alpha,\mathbf{Q})|\widetilde{\mathbf{y}}_{1:N}, \alpha^{[l]},\mathbf{Q}^{[l]}\big]$.
\begin{algorithm}[!t]
\caption{The {\sf DBMT} Estimate of the $k$th Eigen-coefficient}
\label{alg:DS3}
\begin{algorithmic}[1]
\State Initialize: observations $\widetilde{\mathbf{y}}_{1:N}^{(k)}$; initial guess ${\mathbf{x}^{(0)}_{1:N}}$; initial guess $\mathbf{Q}^{[0]}$; initial conditions $\boldsymbol{\Sigma}_{0|0}$; tolerance ${\sf tol} \in (0,10^{-3})$, Maximum Number of iteration $L_{\max} \in \mathbbm{N}^+$.
\Repeat
\State $l =0$ .
\State Forward filter for $n=1,2,\cdots, N$:
\vspace{-2.5mm}
\begin{small}
\begin{align*}
&\mathbf{x}_{n|n-1} = \alpha^{[l]} \mathbf{x}_{n-1|n-1}\\
&{\mathbf{\Sigma}_{n|n-1} = {\alpha^{[l]}}^2\mathbf{\Sigma}_{n-1|n-1} + \mathbf{Q}^{[l]}}\\
&\mathbf{K}_n = \mathbf{\Sigma}_{n|n-1}\mathbf{F}_n^H(\mathbf{F}_n\mathbf{\Sigma}_{n|n-1}\mathbf{F}_n^H + \sigma^2\mathbf{I})^{-1}\\
&\mathbf{x}_{n|n} = \mathbf{x}_{n|n-1} + \mathbf{K}_n(\widetilde{\mathbf{y}}_n - \mathbf{F}_n\mathbf{x}_{n|n-1})\\
&\mathbf{\Sigma}_{n|n} = \mathbf{\Sigma}_{n|n-1} - \mathbf{K}_n\mathbf{F}_n\mathbf{\Sigma}_{n|n-1}
\end{align*}
\end{small}
\vspace{-6.5mm}
\State \resizebox{.78\columnwidth}{!}{Backward smoother for $n=N-1,N-2,\cdots,1$}:
\vspace{-2.5mm}
\begin{small}
\begin{align*}
&\mathbf{B}_n = \alpha^{[l]}\mathbf{\Sigma}_{n|n}\mathbf{\Sigma}_{n+1|n}^{-1}\\
&\mathbf{x}_{n|N} = \mathbf{x}_{n|n} + \mathbf{B}_n(\mathbf{x}_{n+1|N} - \mathbf{x}_{n+1|n})\\
&\mathbf{\Sigma}_{n|N} = \mathbf{\Sigma}_{n|n} + \mathbf{B}_n(\mathbf{\Sigma}_{n+1|N}-\mathbf{\Sigma}_{n+1|n})\mathbf{B}_n^H
\end{align*}
\end{small}
\vspace{-5.5mm}
\State \resizebox{.82\columnwidth}{!}{Covariance smoothing for $n=N-1,N-2,\cdots,1$}:
\vspace{-2.5mm}
\begin{small}
\begin{align*}
\hspace{-25.5mm}\mathbf{\Sigma}_{n,n-1|N} = \mathbf{B}_{n-1}\mathbf{\Sigma}_{n|N}
\end{align*}
\end{small}
\State Let {\small $\widehat{\mathbf{X}}^{[l]} := [\mathbf{x}_{1|N}^{H},\mathbf{x}_{2|N}^{H},\cdots,\mathbf{x}_{N|N}^{H}]^{H}$}.
\State Update $\alpha^{[l+1]}$ and $\mathbf{Q}^{[l+1]}$ as:
\vspace{-1mm}
\begin{align*}
\resizebox{.9\columnwidth}{!}{$\displaystyle \alpha^{[l+1]} = \frac{\sum_{n = 2}^{N} \text{Tr} (\boldsymbol{\Sigma}_{n,n-1|N}{\mathbf{Q}^{[l]}}^{-1})+\mathbf{x}_{n-1|N}^H \mathbf{\mathbf{Q}^{[l]}}^{-1}\mathbf{x}_{n|N}}{\sum_{n = 2}^{N} \text{Tr}(\boldsymbol{\Sigma}_{n-1|N}{\mathbf{Q}^{[l]}}^{-1})+\mathbf{x}_{n-1|N}^H {\mathbf{Q}^{[l]}}^{-1}\mathbf{x}_{n-1|N}}$},
\end{align*}
\vspace{-5mm}
\begin{small}
\begin{align*}
&\resizebox{.9\columnwidth}{!}{$\displaystyle \mathbf{Q}^{[l+1]}\!=\frac{1}{N}\sum_{n=1}^{N} \big[\mathbf{x}_{n|N}\mathbf{x}_{n|N}^{H}\!+\!\boldsymbol{\Sigma}_{n|N}\!+\!{\alpha^{[l+1]}}^2 (\mathbf{x}_{n-1|N}\mathbf{x}_{n-1|N}^{H}\!+\!\boldsymbol{\Sigma}_{n-1|N})$} \nonumber \\[-4pt]
&\qquad \qquad \qquad \resizebox{.7\columnwidth}{!}{$\displaystyle -\alpha^{[l+1]} (\mathbf{x}_{n-1|N}\mathbf{x}_{n|N}^{H}\!+\!\mathbf{x}_{n|N}\mathbf{x}_{n-1|N}^{H}\!+\!2\boldsymbol{\Sigma}_{n,n-1|N}) \big]$}.
\end{align*}
\end{small}
\vspace{-6mm}
\State Set $l \leftarrow l+1$.
\vspace{1mm}
\Until{$\frac{\|\widehat{\mathbf{X}}^{[l]}-\widehat{\mathbf{X}}^{(l-1)}\|_2}{\|\widehat{\mathbf{X}}^{[l]}\|_2} < {\sf tol}$ or $l = L_{\max}$.}
\State Output: Denoised eigen-coefficients {$\widehat{\mathbf{X}}^{[L]}$} where $L$ is the index of the last iteration of the algorithm, and error covariance matrices $\boldsymbol{\Sigma}_{n|N}$ for $n = 1,2,\cdots,N$ in from last iteration of the algorithm.
\end{algorithmic}
\end{algorithm}
\subsubsection{M-Step}
The parameters for subsequent iterations, $\alpha^{[l+1]}$ and $\mathbf{Q}^{[l+1]}$ can be obtained by maximizing the expectation of (\ref{eq:complete-ll1}). Although this expectation is convex in $\alpha$ and $\mathbf{Q}$ individually, it is not a convex function of both. Hence, we perform cyclic iterative updates for $\alpha^{[l+1]}$ and $\mathbf{Q}^{[l+1]}$ given by:
\vspace{-1mm}
\begin{align}
\resizebox{.80\columnwidth}{!}{$\displaystyle \alpha^{[l+1]} = \frac{\sum_{n = 2}^{N} \text{Tr} (\boldsymbol{\Sigma}_{n,n-1|N}{\mathbf{Q}^{[l]}}^{-1})+\mathbf{x}_{n-1|N}^H \mathbf{\mathbf{Q}^{[l]}}^{-1}\mathbf{x}_{n|N}}{\sum_{n = 2}^{N} \text{Tr}(\boldsymbol{\Sigma}_{n-1|N}{\mathbf{Q}^{[l]}}^{-1})+\mathbf{x}_{n-1|N}^H {\mathbf{Q}^{[l]}}^{-1}\mathbf{x}_{n-1|N}}$}
\end{align}
\vspace{-2mm}
and
\vspace{-1mm}
\begin{align}
\label{eq:m-step1}
& \resizebox{0.98\columnwidth}{!}{$\displaystyle \mathbf{Q}^{[l+1]} =\frac{1}{N}\sum_{n=1}^{N} \Big[\mathbf{x}_{n|N}\mathbf{x}_{n|N}^{H}\!+\!\boldsymbol{\Sigma}_{n|N}\!+\!{\alpha^{[l+1]}}^2 (\mathbf{x}_{n-1|N}\mathbf{x}_{n-1|N}^{H}\!+\!\boldsymbol{\Sigma}_{n-1|N})$} \nonumber \\[-4pt]
&\qquad \qquad \quad\resizebox{.68\columnwidth}{!}{$\displaystyle\!\!\!\!\!\!\!\!\!-\!\alpha^{[l+1]} (\mathbf{x}_{n-1|N}\mathbf{x}_{n|N}^{H}\!+\!\mathbf{x}_{n|N}\mathbf{x}_{n-1|N}^{H}\!+\!2\boldsymbol{\Sigma}_{n,n-1|N}) \Big]$}.
\end{align}
\vspace{-5mm}
These iterations can be performed until convergence to a possibly local maximum. However, with even one such update, the overall algorithm forms a majorization-minimization (MM) procedure, generalizing the EM procedure and enjoying from similar convergence properties \cite{lange2004}. One possible implementation of this iterative procedure is described in Algorithm \ref{alg:DS3}. Once the {\sf DBMT} estimates of all the $K$ eigen-coefficients $\widehat{\mathbf{x}}_n^{(k)}$ are obtained, for $n = 1,2,\cdots ,N$ and $k = 1,2,\cdots,K$, the {\sf DBMT} spectrum estimate is constructed similar to (\ref{eq:mtsa}):
\begin{align}
\label{est:dbmt}
\widehat{D}_n(f_j) = \frac{1}{K}{\sum_{k=1}^{K}\left |\left(\widehat{\mathbf{x}}_{n}^{(k)}\right)_j\right|^2},
\end{align}
where $f_j := \frac{2\pi(j-1)}{J}$ for $j=1,2,\cdots, J$ and $n=1,2,\cdots,N$. {Confidence intervals can be computed by mapping the Gaussian confidence intervals for $\widehat{\mathbf{x}}_n^{(k)}$'s to the final {\sf DBMT} estimate.}
\subsection{The {\sf log-DBMT} Spectrum Estimation Algorithm}
We utilize a similar iterative procedure based on the EM algorithm to find the {\sf log-DBMT} spectrum estimate. As before, we treat $\mathbf{s}_n, n = 1,2,\cdots,N$ as hidden variables and $\theta, \mathbf{R}_{n},n = 1,2,\cdots,N$ as the unknown parameters to be estimated. In order to give more flexibility to the observation model, we consider the observation noise to be distributed as log-chi-square with degrees of freedom $2 \nu$, for some positive integer $\nu$ to be estimated. The density of each element of $\boldsymbol{\phi}_n^{(k)}$ is then given by:
\vspace{-3mm}
\begin{align}
p(\phi) = \frac{1}{2^{\nu} \Gamma(\nu)}\exp\left (\nu\phi-\frac{1}{2}\exp(\phi)\right).
\end{align}
We can express the complete data log-likelihood as:
\begin{align}
\label{eq:complete-ll2}
&\resizebox{\columnwidth}{!}{$\displaystyle \log L(\nu, \theta, \mathbf{R}_{1:n})\!:=-\sum_{n = 1}^{N}\bigg[ \mathbf{1}_J^\top\left(\nu (\mathbf{s}_n - \boldsymbol{\psi}_n)+ \frac{1}{2}\exp(\boldsymbol{\psi}_n-\mathbf{s}_n)\right)$} \nonumber \\
\nonumber &+ J\bigg(\nu \log 2 + \log \Gamma(\nu)\bigg) + (\mathbf{s}_n\!-\theta\mathbf{s}_{n-1})^H \mathbf{R}_{n}^{-1}(\mathbf{s}_n\!-\theta\mathbf{s}_{n-1})\\
&\qquad \qquad \qquad \qquad \quad \quad + \log |\det \mathbf{R}_n| \bigg] + {c},
\end{align}
{where $c$ represents the terms that do not depend on $\nu$, $\theta$, $(\mathbf{R}_{n})_{n=1}^N$ or $(\mathbf{s}_{n})_{n=1}^N$}.
Again assuming $\mathbf{R}_n = \mathbf{R}$ for all $n = 1,2, \cdots, N$ for simplicity, the following EM algorithm can be constructed:
\subsubsection{E-step}
Computation of the conditional expectation of the log-likelihood in (\ref{eq:complete-ll2}) requires evaluating $\mathbbm{E}[\mathbf{s}_n|\boldsymbol{\psi}_{1:N},\mathbf{R}^{[l]},\theta^{[l]},\nu^{[l]}]$ and $\mathbbm{E}[\exp(-\mathbf{s}_n)|\boldsymbol{\psi}_{1:N},\mathbf{R}^{[l]},\theta^{[l]},\nu^{[l]}]$ for $n = 1,2,\cdots,N$. Unlike the {\sf DBMT} estimation problem, the forward model in this case is non-Gaussian, and hence we cannot apply the Kalman filter and FIS to find the state expectations. To compute the conditional expectation, the distribution of $\mathbf{s}_n|\boldsymbol{\psi}_{1:n},\mathbf{R}^{[l]},\theta^{[l]},\nu^{[l]}$ or its samples are required \cite{Kitagawa1987}. Computation of the distribution $\mathbf{s}_n|\boldsymbol{\psi}_{1:n},\mathbf{R}^{[l]},\theta^{[l]},\nu^{[l]}$ involves intractable integrals and sampling from the distribution using numerical methods such as Metropolis-Hastings is not computationally efficient, especially for long data, given that it has to be carried out at every iteration.
\begin{algorithm}[!t]
\caption{\small The {\sf log-DBMT} Estimate of the $k$th log-Eigen-spectra}
\label{alg:DS4}
\begin{algorithmic}[1]
\State Initialize: observations $\boldsymbol{\psi}_{1:N}^{(k)}$; initial guess ${\mathbf{s}^{[0]}_{1:N}}$; initial guess $\mathbf{R}^{[0]}$; initial conditions $\boldsymbol{\Omega}_{0|0}$; tolerance ${\sf tol} \in (0,10^{-3})$, Maximum Number of iteration $L_{\max} \in \mathbbm{N}^+$.
\Repeat
\State $l =0$ .
\State Forward filter for $n=1,2,\cdots, N$:
\vspace{-1.5mm}
\begin{small}
\begin{align*}
&\mathbf{s}_{n|n-1} = \theta^{[l]} \mathbf{s}_{n-1|n-1}\\
&\mathbf{\Omega}_{n|n-1} = {\theta^{[l]}}^2\mathbf{\Omega}_{n-1|n-1} + \mathbf{R}^{[l]}\\
&\mathbf{s}_{n|n} = \mathbf{s}_{n|n-1} + \mathbf{\Omega}_{n|n-1}\left[\frac{1}{2}\exp(\boldsymbol{\psi}_n - \mathbf{s}_{n|n}) - \nu^{[l]} \mathbf{1}_J \right]\\
&\mathbf{\Omega}_{n|n} = \mathbf{\Omega}_{n|n-1}^{-1} - \frac{1}{2}\text{diag} \{ \exp(\boldsymbol{\psi}_n - \mathbf{s}_{n|n}) \}
\end{align*}
\end{small}
\vspace{-5.5mm}
\State \resizebox{.78\columnwidth}{!}{Backward smoother for $n=N-1,N-2,\cdots,1$}:
\vspace{-1.5mm}
\begin{small}
\begin{align*}
&\mathbf{A}_n = \theta^{[l]}\mathbf{\Omega}_{n|n}\mathbf{\Omega}_{n+1|n}^{-1}\\
&\mathbf{s}_{n|N} = \mathbf{s}_{n|n} + \mathbf{A}_n(\mathbf{s}_{n+1|N} - \mathbf{s}_{n+1|n})\\
&\mathbf{\Omega}_{n|N} = \mathbf{\Omega}_{n|n} + \mathbf{A}_n(\mathbf{\Omega}_{n+1|N}-\mathbf{\Omega}_{n+1|n})\mathbf{A}_n^H
\end{align*}
\end{small}
\State \resizebox{.82\columnwidth}{!}{Covariance smoothing for $n=N-1,N-2,\cdots,1$}:
\vspace{-1.5mm}
\begin{small}
\begin{align*}
\hspace{-25.5mm}\mathbf{\Omega}_{n,n-1|N} = \mathbf{A}_{n-1}\mathbf{\Omega}_{n|N}
\end{align*}
\end{small}
\State Let {\small $\widehat{\mathbf{S}}^{[l]} := [\mathbf{s}_{1|N}^{H},\mathbf{s}_{2|N}^{H},\cdots,\mathbf{s}_{N|N}^{H}]^{H}$}.
\State Update $\nu^{[l+1]}$, $\theta^{[l+1]}$ and $\mathbf{R}^{[l+1]}$ as:
\begin{small}
\begin{align*}
\resizebox{.9\columnwidth}{!}{$\displaystyle \theta^{[l+1]} = \frac{\sum_{n = 2}^{N} \text{Tr} (\boldsymbol{\Omega}_{n,n-1|N}{\mathbf{R}^{[l]}}^{-1})+\mathbf{s}_{n-1|N}^H {\mathbf{R}^{[l]}}^{-1}\mathbf{s}_{n|N}}{\sum_{n = 2}^{N} \text{Tr}(\boldsymbol{\Omega}_{n-1|N}{\mathbf{R}^{[l]}}^{-1})+\mathbf{s}_{n-1|N}^H {\mathbf{R}^{[l]}}^{-1}\mathbf{s}_{n-1|N}}$},
\end{align*}
\end{small}
\vspace{-4mm}
\begin{small}
\begin{align*}
\nu^{[l+1]} = \frac{1 - \log2 + \frac{1}{JN}\sum_{n = 1}^{N}\mathbf{1}_J^{\top}(\boldsymbol{\psi}_n^{[l]}\!-\!\mathbf{s}_n^{[l]}) - \digamma(\nu^{[l+1]})}{\frac{2}{JN}\sum_{n = 1}^{N}\mathbf{1}_J^{\top}\exp(\boldsymbol{\psi}_n^{[l]}\!-\!\mathbf{s}_n^{[l]})},
\end{align*}
\end{small}
\vspace{-5mm}
\begin{small}
\begin{align*}
&\resizebox{.9\columnwidth}{!}{$\displaystyle \mathbf{R}^{[l+1]}\!=\frac{1}{N}\sum_{n=1}^{N} \big[\mathbf{s}_{n|N}\mathbf{s}_{n|N}^{H}\!+\!\boldsymbol{\Omega}_{n|N}\!+\!{\theta^{[l+1]}}^2 (\mathbf{s}_{n-1|N}\mathbf{s}_{n-1|N}^{H}\!+\!\boldsymbol{\Omega}_{n-1|N})$} \nonumber \\
&\qquad \qquad \qquad \resizebox{.7\columnwidth}{!}{$\displaystyle -\theta^{[l+1]} (\mathbf{s}_{n-1|N}\mathbf{s}_{n|N}^{H}\!+\!\mathbf{s}_{n|N}\mathbf{s}_{n-1|N}^{H}\!+\!2\boldsymbol{\Omega}_{n,n-1|N}) \big]$}.
\end{align*}
\end{small}
\vspace{-6mm}
\State Set $l \leftarrow l+1$.
\vspace{1mm}
\Until{$\frac{\|\widehat{\mathbf{S}}^{[l]}-\widehat{\mathbf{S}}^{(l-1)}\|_2}{\|\widehat{\mathbf{S}}^{[l]}\|_2} < {\sf tol}$ or $l = L_{\max}$.}
\State Output: Denoised log-eigen-spectra {$\widehat{\mathbf{S}}^{[L]}$} where $L$ is the index of the last iteration of the algorithm, and error covariance matrices $\boldsymbol{\Omega}_{n|N}$ for $n = 1,2,\cdots,N$ in from last iteration of the algorithm.
\end{algorithmic}
\end{algorithm}
Since the posterior distribution is unimodal and a deviation from the Gaussian posterior, we approximate the distribution of $\mathbf{s}_n|\boldsymbol{\psi}_{1:n},\mathbf{R}^{[l]},\theta^{[l]},\nu^{[l]}$ as a Gaussian distribution by matching its mean and covariance matrix to the log-posterior in Eq. (\ref{eq:complete-ll2}). To this end, the mean is approximated by the mode of $f_{\mathbf{s}_n|\boldsymbol{\psi}_{1:n},\mathbf{R}^{[l]},\theta^{[l]},\nu^{[l]}}$ and the covariance is set to the inverse of the negative Hessian of the log-likelihood in (\ref{eq:complete-ll2}) \cite{fahrmeir1992,ssm2003}. Under this {approximation}, computing $\mathbbm{E}[\exp(-\mathbf{s}_n)|\boldsymbol{\psi}_{1:n},\mathbf{R}^{[l]},\theta^{[l]},\nu^{[l]}]$ is also facilitated thanks to the closed-form moment generating function of $\mathbf{z} \sim \mathcal{N}(\boldsymbol{\mu}, \boldsymbol{\Sigma})$:
\begin{align}
\label{eq:MGF}
\mathbbm{E}\left[\exp\left(\mathbf{a}^\top \mathbf{z}\right)\right] = \exp\left(\mathbf{a}^\top \boldsymbol{\mu} + \frac{1}{2}\mathbf{a}^\top \boldsymbol{\Sigma} \mathbf{a}\right).
\end{align}
Similar to the case of {\sf DBMT}, we can exploit the block tri-diagonal structure of the Hessian in (\ref{opt:log-DBMT}) to carry out the E-step efficiently using forward filtering and backward smoothing.
\subsubsection{M-step}
Once the conditional expectation of the log-likelihood in (\ref{eq:complete-ll2}) given $\boldsymbol{\psi}_{1:n}$, $\mathbf{R}^{[l]}$, $\theta^{[l]}$, $\nu^{[l]}$ is available, we can update $\mathbf{R}^{[l+1]}$ and $\theta^{[l+1]}$ using similar closed form equations as in (\ref{eq:m-step1}). But updating $\nu^{[l+1]}$ by maximizing the conditional expectation of the log likelihood in (\ref{eq:complete-ll2}) wrt. $\nu^{[l+1]}$ requires solving following nonlinear equation:
\begin{align}
\resizebox{.89\columnwidth}{!}{$\displaystyle \nu^{[l+1]} = \frac{1 - \log2 + \frac{1}{JN}\sum_{n = 1}^{N}\mathbf{1}_J^{\top}(\boldsymbol{\psi}_n^{[l]}\!-\!\mathbf{s}_n^{[l]}) - \digamma(\nu^{[l+1]})}{\frac{2}{JN}\sum_{n = 1}^{N}\mathbf{1}_J^{\top}\exp(\boldsymbol{\psi}_n^{[l]}\!-\!\mathbf{s}_n^{[l]})},$}
\end{align}
where $\digamma(\cdot)$ is the digamma function. We can use Newton's method to solve this equation up to a given precision. An implementation of the {\sf log-DBMT} is given by Algorithm \ref{alg:DS4}.
Note that unlike the {\sf DBMT} algorithm which pertains to a Gaussian observation model, the forward filtering step to compute $\mathbf{s}_{n|n}$ is nonlinear, and standard techniques such as Newton's method can be used to solve for $\mathbf{s}_{n|n}$. We use the {\sf log-DBMT} algorithm to find all the $K$ estimates of true log-spectra and construct the {\sf log-DBMT} estimate as:
\begin{align}
\label{est:logdbmt}
\widehat{D}_n(f_j) = \frac{1}{K} \sum_{k=1}^{K} \exp\left ( \left(\widehat{\mathbf{s}}^{(k)}_n\right)_j \right),
\end{align}
where $f_j := \frac{2\pi(j-1)}{J}$ for $j=1,2,\cdots, J$ and $n=1,2,\cdots,N$. Again, confidence intervals can be computed by mapping the Gaussian confidence intervals for $\widehat{\mathbf{s}}_n^{(k)}$'s to the final {\sf log-DBMT} estimate.
\subsection{Parameter Selection}
The window length $W$, design bandwidth $B$, and the number of tapers $K$ need to be carefully chosen. Since both proposed algorithms are motivated by the standard overlapping MT method, we use the same guidelines for choosing these parameters \cite{thomsonbc,reviewmtm}. The window length $W$ is determined based on the expected rate of change of the PSD (given domain-specific knowledge) in order to make sure that the quasi-stationarity assumption holds. The design bandwidth $B$ is chosen small enough to be able to resolve the dominant frequency components in the data, while being large enough to keep the time-bandwidth product $\rho := WB \geqslant 1$. The number of tapers $K$ is then chosen as $K \leqslant \lfloor2\rho\rfloor -1$ \cite{thomsonbc}.
\section{Application to Synthetic and Real Data} \label{sec:application}
Before presenting our theoretical analysis, we examine the performance of {\sf DBMT} and {\sf log-DBMT} spectrogram estimators on synthetic data, and then demonstrate their utility in two real world data applications, namely spectral analysis of human EEG during sleep and Electric Network Frequency signal detection.
\vspace*{-4.5mm}
\subsection{Application to Synthetic Data}
\label{sec:simulation}
The synthetic data consists of the linear combination of two amplitude-modulated and frequency-modulated processes with high dynamic range (i.e., high-Q). The amplitude-modulated component $y^{(1)}_t$ is generated through modulating an $\text{AR}(6)$ process tuned around $11~\text{Hz}$ by a cosine at a low frequency $f_0 = 0.02~\text{Hz}$. The frequency-modulated component $y^{(2)}_t$ is a realization of an $\text{ARMA}(6,4)$ with varying pole loci. To this end, the process has a pair of 3rd order poles at $\omega_t := 2 \pi f_t$ and $-\omega_t$, where $f_t$ increases from $5~\text{Hz}$, starting at $t=0$, every $\sim 26~\text{s}$ by increments of $0.48~\text{Hz}$, to achieve frequency modulation. In summary, the noisy observations are given by:
\begin{align}
y_t = y_t^{(1)} \cos(2\pi f_0t) + y_t^{(2)} + \sigma v_t,
\end{align}
where $v_t$ is a white Gaussian noise process and $\sigma$ is chosen to achieve an SNR of $30~\text{dB}$. The process is truncated at $600~\text{s}$ to be used for spectrogram analysis. Figure \ref{fig:toy_example} shows a $12$ second sample window of the process.
\begin{figure}[!h]
\centering
\includegraphics[width=0.8\columnwidth]{Fig2.pdf}%
\vspace{-2mm}
\caption{\small Sample from the synthetic data from $t=384~\text{s}$ to $t=396~\text{s}$.}
\vspace{-4mm}
\label{fig:toy_example}
\end{figure}
\begin{figure*}[!t]
\centering
\includegraphics[width=0.8\textwidth]{Fig3.pdf}%
\vspace{-2.0mm}
\caption{\small Spectrogram analysis of the synthetic data. (A) Ground truth, (B) overlapping MT estimates, (C) {\sf DBMT} estimates, (D) {\sf log-DBMT} estimates, and (E) TFAR estimates. Left: spectrograms. Middle: zoomed-in views from $t=370~\text{s}$ to $t=440~\text{s}$. The color scale is in decibels. Right: PSDs corresponding to a window of length $6~\text{s}$ starting at $t=474~\text{s}$. Dashed and solid lines in row A show respectively the noiseless and noisy PSDs. Grey hulls show $95\%$ confidence intervals.}\label{fig:simulation}
\vspace{-6mm}
\end{figure*}
{In addition to the standard overlapping MT, we present comparison to the TFAR method as an example of parametric state-space modeling approaches to non-stationary spectral analysis. This method is known to be well suited to processes whose time-varying spectra exhibits sharp peaks, i.e., signals consisting of several narrow-band components \cite{Jachan2007TFARMA}. The TFAR model is defined by the input-output relation
\begin{align*}
y_t\!:=\!-\!\sum_{m=1}^{M_A}\sum_{l=-L_A}^{L_A} \!\!a_{m,l}e^{i\frac{2\pi}{N}lt} y_{t-m}\!+ \!\sum_{l=-L_B}^{L_B}\!\!b_{0,l}e^{i\frac{2\pi}{N}lt}e_t,
\end{align*}
where $e_t$ is a stationary white noise process with unit variance, and $(a_{m,l})_{m=1,l=-L_A}^{M_A,L_A}$ and $(b_{0,l})_{l=-L_B}^{L_B}$ are the autoregressive (AR) and zero-delay moving average (MA) parameters, respectively. The integers $M_A$ and $L_A$ are respectively the delay and Doppler model orders of the AR component and $L_B$ denotes the Doppler model order of the zero-delay MA component. The AR and MA parameters are estimated by solving the time-frequency Yule-Walker equations, from which the evolutionary spectra can be constructed (See the methods described in \cite{Jachan2007TFARMA} for more details).} \newline
\indent Figure \ref{fig:simulation} shows the true as well as estimated spectrograms by the standard overlapping MT, {\sf DBMT}, {\sf log-DBMT} and the TFAR estimators. Each row consists of three panels: the left panel shows the entire spectrogram; the middle panel shows a zoomed-in spectrotemporal region marked by the dashed box in the left panel; and the right panel shows the PSD along with confidence interval (CI) in gray hull, at a selected time point marked by a dashed vertical line in the middle panel. {Note that for the standard MT estimates, the CIs are constructed assuming a $\chi_{2K}^2$ distribution of the estimates around the true values \cite{thomsonbc,percival1993}, whereas for {\sf DBMT} and {\sf log-DBMT} estimate by mapping the Gaussian confidence intervals for eigen-coefficients or eigen-spectra to the final estimates.} {We were not able to evaluate the CIs for the TFAR estimates, since to the best of our knowledge we are not aware of any method to do so.} Figure \ref{fig:simulation}\textit{A} shows true spectrogram of the synthetic process, in which the existence of both amplitude and frequency modulations makes the spectrogram estimation a challenging problem. \newline
\indent Fig. \ref{fig:simulation}\textit{B} shows the standard overlapping MT spectrogram estimate. We used windows of length $6~\text{s}$ and the first $3$ tapers corresponding to a time-bandwidth product of $3$ and $50\%$ overlap to compute the estimates (note that the same window length, tapers and time-bandwidth product are used for the {\sf DBMT} and {\sf log-DBMT} estimators). Although the standard MT spectrogram captures the dynamic evolution of both components, it is blurred by the background noise and picks up spectral artifacts (i.e., vertical lines) due to window overlap, frequency mixing, and sampling noise. Fig. \ref{fig:simulation}\textit{C} demonstrates how the {\sf DBMT} spectrogram estimate overcomes these deficiencies of the overlapping MT spectrogram: the spectrotemporal localization is sharper and smoother across time, artifacts due to overlapping between windows are vanished, and frequency mixing is further mitigated. By comparing the right panel of the second and third rows, two important observations can be made: first, the {\sf DBMT} captures the true dynamic range of the original noiseless PSD, while the standard MT estimate fails to do so. Second, the CIs in Fig. \ref{fig:simulation}\textit{C} as compared to \ref{fig:simulation}\textit{B} are wider when the signal is weak (e.g., near $5~\text{Hz}$) and tighter when the signal is strong (e.g., near $11~\text{Hz}$). The latter observation highlights the importance of the model-based confidence intervals in interpreting the denoised estimates of {\sf DBMT}: while the most likely estimate (i.e., the mean) captures the true dynamic range of the noiseless PSD, the estimator does not preclude cases in which the noise floor of $-40~\text{dB}$ is part of the true signal, while showing high confidence in detecting the spectral content of the true signal that abides by the modeled dynamics. \newline
\indent Next, Fig. \ref{fig:simulation}\textit{D} shows the {\sf log-DBMT} spectrogram estimate, which shares the artifact rejection feature of the {\sf DBMT} spectrogram. However, the {\sf log-DBMT} estimate is smoother than both the {standard overlapping MT} and {\sf DBMT} spectrograms in time as well as in frequency (see the zoomed-in middle panels), due to its sampling noise mitigation feature (by design). In addition, similar to the standard {MT} estimate, the {\sf log-DBMT} estimator is not able to denoise the estimate by removing the observation noise. Though, the confidence intervals of the {\sf log-DBMT} PSD estimate are tighter than those of the standard overlapping MT estimate due to averaging across multiple windows via Bayesian filtering/smoothing. As we will show in Section \ref{sec:theory}, these qualitative observations can be established by our theoretical analysis.
{Finally, Fig. \ref{fig:simulation}\textit{E} shows the TFAR spectral estimate. The model orders are chosen as $M_A =20$, $L_A = 25$, $L_B = 25$, large enough to allow the parametric model to achieve high time-frequency resolution. As it is shown in the right panel, the TFAR method provides the smoothest estimate along the frequency axis. However, it is not successful in capturing the true dynamic range of the signal due to spectral leakage (See middle and right panels). In addition, it is contaminated by similar vertical frequency artifacts as in the case of the MT spectrogram (See Figure \ref{fig:simulation}\textit{A}).} \newline
\indent In the spirit of easing reproducibility, we have deposited a MATLAB implementation of these algorithms on the open source repository GitHub \cite{code}, which generates Figure \ref{fig:simulation}.
\subsection{Application to EEG data}
\begin{figure*}[!t]
\centering
\includegraphics[width=0.80\textwidth]{Fig4.pdf
\caption{\small Spectrogram analysis of the EEG data. (A) overlapping MT estimates, (B) {\sf DBMT} estimates, and (C) {\sf log-DBMT} estimates. Left: spectrograms. Middle: zoomed-in views from $t=700~\text{s}$ to $t=750~\text{s}$. The color scale is in decibels. Right: PSD estimate corresponding to a window of length $2.25~\text{s}$ starting at $t=722.25~\text{s}$. Grey hulls show $95\%$ confidence intervals.}
\label{fig:sleepdata}
\vspace*{-5mm}
\end{figure*}
\begin{figure*}[!b]
\centering
\vspace*{-4mm}
\includegraphics[width=0.80\textwidth]{Fig5.pdf
\vspace*{-1.5mm}
\caption{\small Spectrogram analysis of the ENF data. (A) overlapping MT estimates, (B) {\sf DBMT} estimates, and (C) {\sf log-DBMT} estimates. Left: spectrograms. Middle: zoomed-in views from $t=480~\text{s}$ to $t=540~\text{s}$. The color scale is in decibels. Right: PSD estimate corresponding to a window of length $5~\text{s}$ starting at $t=505~\text{s}$. Grey hulls show $95\%$ confidence intervals.}
\label{fig:ENFdata}
\end{figure*}
To illustrate the utility of our proposed spectrogram estimators, we apply them to human EEG data recorded during sleep. {In the interest of space, in the remainder of this section, we only present comparisons with the MT spectrogram as a non-parametric benchmark.} The EEG data set is available online as part of the SHHS Polysomnography Database (\url{https://www.physionet.org/pn3/shhpsgdb/}). The data is $900~\text{s}$ long during stage 2 sleep, and sampled at $250~\text{Hz}$. During stage 2 sleep, the EEG is known to manifest delta waves ($0-4~\text{Hz}$) and sleep spindles (transient wave packets with frequency $12-14~\text{Hz}$) \cite{spindles2003, delta1933}. Accurate localization of these spectrotemporal features has significant applications in studying sleep disorders and cognitive function \cite{spindles2003}. Since the transient spindles occur at a time scale of seconds, we choose a window length of $2.25~\text{s}$ for all algorithms (with $50\%$ overlap for the standard overlapping MT estimate). We also chose a time-bandwidth product of $2.25$ for all algorithms, in order to keep the frequency resolution at $2~\text{Hz}$. Figs. \ref{fig:sleepdata}\textit{A}, \textit{B} and \textit{C} show the MT, {\sf DBMT} and {\sf log-DBMT} spectrogram estimates, respectively, with a similar presentational structure as in Fig. \ref{fig:simulation}. As the middle panels reveal, the overlapping MT estimate is not {able} to clearly distinguish the delta waves and sleep spindles due to high background noise. The {\sf DBMT} estimate shown in Fig. \ref{fig:sleepdata}\textit{B}, however, provides a significantly denoised spectrogram, in which the delta waves and sleep spindles are visually separable. The {\sf log-DBMT} estimator shown in Fig. \ref{fig:sleepdata}\textit{C} provides significant spectrotemporal smoothing, and despite not fully reducing the background noise, provides a clear separation of the delta waves and spindles (see the PSD in the right panel). Similar to the analysis of synthetic data, the same observations regarding the confidence intervals of the estimators can be made.
\vspace{-2mm}
\subsection{Application to ENF data}
Finally, we examine the performance of our proposed algorithms in tracking the Electrical Network Frequency (ENF) signals from audio recordings. The ENF signal corresponds to the supply frequency of the power distribution network which is embedded in audio recordings \cite{garg2013seeing,Wu2013}. {The instantaneous values of this time-varying frequency and its harmonics form the ENF signal.} The ability to detect and track the spectrotemporal dynamics of ENF signals embedded in audio recordings has shown to be crucial in data forensics applications \cite{garg2013seeing}.
Fig. \ref{fig:ENFdata}\textit{A} shows the spectrogram estimates around the sixth harmonic of the nominal $60~\text{Hz}$ ENF signal (data from \cite{Wu2013}). We used $1000~\text{s}$ of audio recordings, and constructed spectrograms with windows of length $5~\text{s}$ and using the first $3$ tapers corresponding to a time-bandwidth product of $3$ for all three methods (with $25\%$ overlap for the overlapping MT estimate). The two dominant components around the sixth ENF harmonic exhibit temporal dynamics, but are hard to distinguish from the noisy background. Fig. \ref{fig:ENFdata}\textit{B} shows the {\sf DBMT} spectrogram, in which the background noise is significantly suppressed, yielding a crisp and temporally smooth estimate of the ENF dynamics. The {\sf log-DBMT} estimate is shown in Fig. \ref{fig:ENFdata}\textit{C}, which provides higher spectrotemporal smoothness than the standard MT estimate. Although the {\sf log-DBMT} shows smaller variability in the estimates (middle and right panels), the gain is not as striking as in the cases of synthetic data and EEG analysis, due to the usage of longer windows which mitigates the sampling noise for all algorithms. Similar observations as in the previous two cases regarding the statistical confidence intervals can be made, which highlight the advantage of modeling the spectrotemporal dynamics in spectrogram estimation.
\section{Theoretical Analysis}\label{sec:theory}
\subsection{Filter Bank Interpretation}
In order to characterize the spectral properties of any non-parametric spectrum estimator, the tapers applied to the data need to be carefully inspected. In the MT framework, the dpss sequences are used as tapers, which are known to produce negligible side-lobes in the frequency domain \cite{mtm,percival1993}. The {\sf DBMT} and {\sf log-DBMT} algorithms also use the dpss tapers to alleviate the problem of frequency leakage. However, because of the stochastic continuity constraint we introduced, the estimate associated to any given window is now a function of the data in \emph{all} the windows. Therefore, the theoretical properties of the MT method do not readily apply to our estimators.
To characterize the statistical properties of our estimates, we first need take a detour from the usual analysis of spectrum estimation techniques. In what follows, we mainly focus on the {\sf DBMT} algorithm for the sake of presentation. By virtue of the FIS procedure under the assumptions that: 1) the window length $W$ is an integer multiple of $J$, the number of discrete frequencies, so that $\mathbf{F}_n = \mathbf{F}_1, \forall n$, and 2) the state noise covariance matrices are time-invariant, i.e., $\mathbf{Q}_n = \mathbf{Q}, \forall n$, one obtains the following expansion of $\mathbf{x}_{n|N}^{(k)}$ in terms of the observed data \cite{ba2014}:
\begin{align}
\label{FB3}
\mathbf{{x}}_{n|N}^{(k)} = \sum_{s = 1}^{n-1}\!\prod_{m = s}^{n-1}\!\big[\alpha(\mathbf{I}\!-\!\mathbf{K}_m&\mathbf{F}_m)\big] \mathbf{K}_s \mathbf{U}^{(k)} \widetilde{\mathbf{y}}_s + \mathbf{K}_n \mathbf{U}^{(k)} \widetilde{\mathbf{y}}_n \nonumber \\[-8pt]
+& \sum_{s = n+1}^{N}\!\prod_{m = n}^{s}\!\mathbf{B}_m \mathbf{K}_s \mathbf{U}^{(k)} \widetilde{\mathbf{y}}_s.
\end{align}
In other words, the {\sf DBMT} algorithm maps the entire data $\widetilde{\mathbf{y}} := [\widetilde{y}_1,\widetilde{y}_2,\cdots, \widetilde{y}_T]^\top$ to the {vector of coefficients} $\widehat{\mathbf{X}}^{(k)}$ according to \cite{ba2014}:
\begin{equation}
\label{FilterBank2}
\widehat{\mathbf{X}}^{(k)} = \mathbf{G}^{(k)} \mathbf{F}^{H}\mathbf{U}^{(k)}\widetilde{\mathbf{y}},
\end{equation}
where $\mathbf{F}$ and $\mathbf{U}^{(k)}$ are block-diagonal matrices with $\mathbf{F}_1$ and $\mathbf{U}_{k} := \text{diag}[\mathbf{u}^{(k)}]$ as the diagonal blocks, respectively, and $\mathbf{G}$ is a weighting matrix which depends only on $\mathbf{Q}_\infty = \lim_{l\rightarrow \infty} \mathbf{Q}^{[l]}$, {$\alpha_\infty = \lim_{l \rightarrow \infty} \alpha^{[l]}$,} and window length, $W$. The rows of $\mathbf{G}^{(k)}\mathbf{F}^{H}\mathbf{U}^{(k)}$ form a filter bank whose output is equivalent to the time-frequency representation.
In order to continue our analysis, we make two assumptions common in the analysis of adaptive filters\cite{haykin1991,anderson1979optimal}. First, we assume that the parameter {estimates $\mathbf{Q}_\infty$ and $\alpha_\infty$ are close enough to the true values of $\mathbf{Q}$ and $\alpha$, and therefore replace them by $\mathbf{Q}$ and $\alpha$, i.e., as if the true parameters were known.} Note that we have discarded the dependence of $\mathbf{Q}$ and $\alpha$ on $k$ for lucidity of analysis. Second, noting that $\alpha(\mathbf{I}-\mathbf{K}_m\mathbf{F}_m) = \alpha\boldsymbol{\Sigma}_{m|m} \boldsymbol{\Sigma}_{m|m-1}^{-1}$ and $\mathbf{B}_m = \alpha\mathbf{\Sigma}_{m|m}\mathbf{\Sigma}_{m+1|m}^{-1}$ and that in steady state we have $\boldsymbol{\Sigma}_{m|m} := \boldsymbol{\Sigma}_\infty $ and $\boldsymbol{\Sigma}_{m|m-1} = \alpha^2\boldsymbol{\Sigma}_\infty + \mathbf{Q}$, Eq. (\ref{FB3}) can be approximated by:
\vspace{-2mm}
\begin{align}\label{eq:xn}
\mathbf{{x}}_{n|N}^{(k)} = \sum_{s=1}^{N}\mathbf{ \Lambda}^{|s-n|} \mathbf{\Gamma} \mathbf{F}_s^{H}\mathbf{U}^{(k)}\widetilde{\mathbf{y}}_s,
\end{align}
\noindent for $1 \ll n \ll N$, where $ \mathbf{\Lambda} = \alpha \mathbf{\Sigma}_\infty (\alpha^2 \mathbf{\Sigma}_\infty + \mathbf{Q})^{-1}$, and $\mathbf{\Gamma} = (\alpha^2 \mathbf{\Sigma}_\infty + \mathbf{Q})\big[\mathbf{I}-rW\big((\alpha^2 \mathbf{\Sigma}_\infty + \mathbf{Q})^{-1}+rW\mathbf{I}\big)^{-1}\big]$. That is, for values of $n$ far from the data boundaries, the weighting matrix is equivalent to a weighted set of dpss tapers in matrix form acting on all the data windows with an exponential decay with respect to the $n$th window.
\begin{figure}[!t]
\centering
\includegraphics[width=0.99\columnwidth]{Fig6.pdf}%
\vspace{-1.5mm}
\caption{\small {Equivalent filters corresponding to the first taper of the {\sf DBMT} estimate of the synthetic data example. Left: equivalent filters in time around $t=300~\text{s}$. Right: equivalent filters of MT (red) and {\sf DBMT} (green) in frequency.}}
\vspace*{-5mm}
\label{fig:filter}
\end{figure}
{As an example, the equivalents filters of the {\sf DBMT} estimator corresponding to the first taper for the $11$Hz and $9$Hz frequencies around $300$ secs, from the synthetic data example are shown in Fig. \ref{fig:filter}. They are also compared to the equivalent filters corresponding to first taper of standard MT method in the frequency domain.} As apparent from Fig. \ref{fig:filter}, the weighting matrix sets the gain of these filters in an adaptive fashion across \emph{all} windows, unlike the standard MT method which only uses the data in window $n$. In addition, the filter corresponding to frequency of $9$Hz, which is negligible in the data, is highly attenuated, resulting in significant noise suppression. In this sense, the proposed estimation method can be identified as a \emph{data-driven denoising method} for constructing time-frequency representations given noisy time series data. Next, we will characterize the performance of the {\sf DBMT} estimator in terms of bias-variance trade-off.
\vspace{-4mm}
\subsection{Bias and Variance Analysis}
We first consider the implication of the stochastic continuity constraint of Eq. (\ref{eq:scc1}) on the evolution of the orthogonal increment processes governing the time series data. We first assume that the parameters $\alpha^{(k)} = \alpha$, for all $k=1,2,\cdots,K$. Suppose that the data in window $n$ has a Cram\'{e}r representation with an orthogonal increment process $dz_n(f)$, $n=1,2,\cdots,N$. Then, one way to achieve the stochastic continuity of Eq. (\ref{eq:scc1}) is to assume: \vspace{-2mm}
\begin{equation}\label{eq:z-ss}
d z_{n+1}(f) = \alpha d z_{n}(f) + d \epsilon_n (f),\vspace{-2mm}
\end{equation}
where $d \epsilon_n(f)$ is a Gaussian orthogonal increment process, independent of $d z_{n}(f)$.
In the forthcoming analysis we also assume the locally stationarity condition, i.e., the generalized Fourier transform of the process remains stationary within each window. This assumption is common in the analysis of non-parametric spectral estimators \cite{reviewmtm,thomsonbc}. Finally, we assume a scaling of $K,N,W \rightarrow \infty$, $B \rightarrow 0$, $BW \rightarrow \rho$, for some constant $\rho$ \cite{lii2008}. The following theorems characterize the bias and variance of the {\sf DBMT} estimator:
\vspace*{-2mm}
\begin{thm}
\label{theorem1}
Suppose that the locally stationary process $y_t$ is governed by orthogonal increment processes evolving according to the dynamics $dz_{n+1}(f) = \alpha dz_n(f) + d \epsilon_n(f)$, with $\alpha < 1$, where the noise process $d \epsilon_n(f), \forall f \in (-1/2,1/2]$ is a zero-mean Gaussian increment process with variance $q(f)>0$, independent of $dz_n(f)$. If the process is corrupted by additive zero-mean Gaussian noise with variance $\sigma^2$, then {for $f \in \{f_1,f_2,\cdots,f_J\}$,} the {\sf DBMT} estimate satisfies:
\begin{align}
\nonumber & \resizebox{\columnwidth}{!}{$\displaystyle \left|\mathbbm{E}[\widehat{D}_{n}(f)] - D(f) \right| \leqslant \bigg(1-\frac{1}{K}\sum_{k=1}^{K}\lambda_k\bigg) \kappa_n(f) \sup_{f} \{D(f)\}$}\\
\nonumber & \qquad \qquad \qquad \quad \! + |1-\kappa_n(f)| D(f) + \mu_n(f) \sigma^2 + \kappa_n(f) o(1),
\end{align}
where $\lambda_k$ is the eigenvalue associated with the $k$th PSWF, $D(f) := q(f)/(1-\alpha)$, and $\kappa_n(f), \mu_n(f)$ are functions of $\alpha$ and $q(f)$ and explicitly given in the proof.
\end{thm}
\vspace*{-3mm}
\begin{thm}
\label{theorem2}
Under the assumptions of Theorem \ref{theorem1}, the variance of the {\sf DBMT} estimate $\widehat{D}_n(f)$ satisfies:
\begin{align}
\nonumber {\sf Var}\left \{\widehat{D}_{n}(f) \right \} \leqslant \frac{2}{K} \left[\sup_{f} \{\kappa_n(f)D(f) + \mu_n(f)\sigma^2\}\right]^2.
\end{align}
\end{thm}
The proofs of Theorems \ref{theorem1} and \ref{theorem2} integrate the treatment of \cite{lii2008} with the structure of the FIS estimates, and are presented in Appendix \ref{A1}. In order to illustrate the implications of these theorems, several remarks are in order:
\textit{\textbf{Remark 1.}}
The function $\kappa_n(f)$ controls the trade-off between bias and variance: for values of $\kappa_n(f) < 1$, the bound on the variance decreases while the bias bound increases, and for $\kappa_n(f) \approx 1$, all the terms in the bias bound become negligible, while the variance bound increases. The function $\mu_n(f)$, on the other hand, reflects observation noise suppression in both the bias and variance. Note that these upper bounds are tight and achieved for a signal with flat spectrum.
\textit{\textbf{Remark 2.}}
The bias and variance bounds of \cite{lii2008} for the standard MT method can be recovered by setting $\kappa_n(f) =1 $, $\mu_n(f) = 1$, and $\sigma^2 = 0$ in the results of Theorems \ref{theorem1} and \ref{theorem2}, i.e., in the absence of signal dynamics and {measurement} noise. For the {\sf DBMT} estimator, signal and {measurement} noise variances, respectively contribute to the bias/variance upper bounds in different fashions through $\kappa_n(f)$ and $\mu_n(f)$, due to the distinction of the signal and {measurement} noise in our state-space model. In contrast, in the standard MT method, possible {measurement} noise is treated in the same way as the true data, and hence both the signal and noise variances have equal contributions in the estimator bias/variance.
\begin{figure}[t!]
\centering
\includegraphics[width=.88\columnwidth]{Fig7.pdf}
\caption{\small (A) $\mu_n$ versus $\alpha$, (B) $\kappa_n$ and its upper/lower bounds versus $\alpha$ for $N = 100$, $n = 50$, and $q/\sigma^2 = 10$.}
\label{fig:kappa_vs_alpha}
\vspace{-6mm}
\end{figure}
The functions $\kappa_n(f)$ and $\mu_n(f)$ do not have closed-form expressions with respect to the state-space parameters $\alpha$, $\sigma^2$ and $q(f)$. In order to illustrate the roles of $\kappa_n(f)$ and $\mu_n(f)$, we consider the scenario under which the upper bounds on the bias and variance are achieved, i.e., $q(f)$ being independent of $f$, and hence $\kappa_n(f) = \kappa_n$ and $\mu_n(f) = \mu_n$, $\forall f$. In this scenario, even though the dependence of $\mu_n$ and $\kappa_n$ on the state-space parameters are quite involved, it is possible to obtain upper and lower bounds on $\kappa_n$ and $\mu_n$. As it is shown in Proposition \ref{prop:kappa} in Appendix \ref{A3}, the main parameters determining the behavior of $\kappa_n$ and $\mu_n$ are $q_n/\sigma$ (i.e., the SNR) and $\alpha$ (i.e., temporal signal dependence). Here, we present a numerical example for clarification. Fig. \ref{fig:kappa_vs_alpha}\textit{A} and \textit{B} shows the plot of $\mu_n$ vs. $\alpha$ and $\kappa_n$ vs. $\alpha$ for $n = 50$ and $q/\sigma^2 = 10$. It is apparent that $\mu_n$ increases with $\alpha$ and does not exceed $1$. The fact that $\mu_n < 1$ implies that the {\sf DBMT} estimator achieves a higher noise suppression compared to the standard MT method. This fact agrees with the noise suppression performances observed in Section \ref{sec:application}.
Fig. \ref{fig:kappa_vs_alpha}\textit{B} shows the plot of $\kappa_n$ vs. $\alpha$, which exhibits a similar increasing trend, but eventually exceeds $1$. This result implies that with a careful choice $\alpha$, it is possible to achieve $\kappa_n < 1$, and hence obtain lower variance than that of the standard MT estimate. Fig. \ref{fig:alpha_vs_q} illustrates this statement by showing the value of $\alpha$ for which $\kappa_n \approx 1$ vs. $q_n/\sigma^2$. For models with high temporal dependence (i.e., $\alpha$ close to $1$), it is possible to achieve $\kappa_n < 1$ and hence reduce the estimator variance, due to the increase in the weight of data pooled from adjacent windows, even for small values of $q_n/\sigma^2$ (i.e., low SNR). However, this reduction in variance comes with the cost of increasing the bias. On the contrary when the data across windows have low temporal dependence (i.e., $\alpha \ll 1$), it is only possible to achieve a reduction in variance for high values of $q_n/\sigma^2$ (i.e., high SNR). This is due to the fact that at low SNR with low temporal dependence, pooling data from adjacent windows is not beneficial in reducing the variance in a particular window, and indeed can result in higher bias.
\begin{figure}[t!]
\centering
\vspace{0mm}
\includegraphics[width=.8\columnwidth]{Fig8.pdf}%
\vspace{-2mm}
\caption{\small $\alpha$ corresponding to $\kappa_n \approx 1$ against $q/\sigma^2$}
\label{fig:alpha_vs_q}
\vspace{-5mm}
\end{figure}
\textit{\textbf{Remark 3.}} Even though the parameter $\alpha$ is estimated in a data-driven fashion, it can be viewed as a tuning parameter controlling the bias-variance trade-off, given the foregoing discussion. For a given SNR, fixing $\alpha$ at a small value can help reduce the variance but with a cost of increasing bias, and vice versa. In light of this observation, Fig. \ref{fig:alpha_vs_q} can be thought of as a guideline for choosing $\alpha$ to achieve $\kappa_n \approx 1$, so that the estimator is nearly unbiased, and achieves a lower variance than that of the standard overlapping MT estimator due to the noise suppression virtue of the state-space model. Although we focused on the case of flat spectrum in the foregoing discussion, it is possible to numerically compute these trade-off curves for more general cases, given the general expressions for $\kappa_n(f)$ and $\mu_n(f)$ given in Appendix \ref{A1}.
\textit{\textbf{Remark 4.}} Extending Theorems 1 and 2 to the {\sf log-DBMT} algorithm is not straightforward, due to the high nonlinearity of the underlying state-space models. However, under the common Gaussian approximation of the log-posterior density, the well-known variance reduction property of the fixed interval smoother \cite{rauch65,anderson1979optimal} carries over to the estimator of $\log S_n(f)$. That is, the variance of the {\sf log-DBMT} estimate of $\log S_n(f)$ obtained using the state-space model is lower than that of the standard MT estimate which only uses the data within window $n$. This fact agrees with our earlier observation in Section \ref{sec:simulation} regarding the tightening of the confidence intervals for {\sf log-DBMT} as compared to the overlapping MT estimates.
\vspace*{-1mm}
\section{Concluding Remarks}\label{sec:conclusion}
\vspace*{-1mm}
Spectral analysis of non-stationary time series data poses serious challenges for classical non-parametric techniques, in which temporal smoothness of the spectral representations are implicitly captured using sliding windows with overlap. This widely-practiced approach tends to ignore the inherent smoothness of the data and is not robust {against} measurement/sampling noise. In this paper, we address these issues and provide an alternative to the sliding window spectrogram analysis paradigm. We propose two {semi-parametric} spectrogram estimators, namely the {\sf DBMT} and {\sf log-DBMT} estimators, by integrating techniques from MT analysis and Bayesian estimation. To this end, we explicitly model the temporal dynamics of the spectrum using a state-space model over the spectral features obtained by multitapering. Therefore our algorithms inherit the optimality features of both Bayesian estimators and MT analysis.
Our algorithms admit efficient and simple implementations, thanks to the Expectation-Maximization algorithm and the well-known fixed interval state-space smoothing procedure. Unlike existing approaches, our algorithms require no \emph{a priori} assumptions about the structure of the spectral representation and operate in a fully data-driven fashion. While both algorithms yield {spectral estimates} that are continuous in time, by design the {\sf DBMT} algorithm significantly suppresses the {measurement} noise in forming the spectrogram and the {\sf log-DBMT} algorithm mitigates {sampling} noise due to small observation length. We establish the performance gains provided by our algorithms through theoretical analysis of the bias-variance trade-off, as well as application to synthetic and real data from human EEG recording during sleep and ENF signals from audio recordings.
\vspace{-4mm}
\appendices
\section{Proofs of Theorems 1 and 2}
\label{A1}
\vspace{-1mm}
\label{pfthm1}
{Recall from Eq. (\ref{eq:xn}) that the $k$th eigen-coefficient estimate at window $n$ can be written in terms of the observed data as:
\vspace{-1mm}
\begin{align}
\label{eq:xnN}
\widehat{\mathbf{x}}_{n|N}^{(k)} = \sum_{s=1}^{N}\mathbf{ \Lambda}^{|s-n|} \boldsymbol{\Gamma} \mathbf{F}_s^{H}\widetilde{\mathbf{y}}_s^{(k)},
\end{align}
\vspace{-2mm}
\noindent where $\widetilde{\mathbf{y}}_s^{(k)} = \mathbf{u}^{(k)}\odot \widetilde{\mathbf{y}}_s = \mathbf{U}^{(k)}\widetilde{\mathbf{y}}_s$.} Given that $\mathbf{Q}$ is a diagonal matrix with elements $q(f_j)$, $j=1,2,\cdots,J$, it can be shown that {$\mathbf{\Sigma}_{\infty}$}, $\mathbf{\Lambda}$ and $\mathbf{\Gamma}$ are also diagonal matrices. Denoting the elements of {$\mathbf{\Sigma}_{\infty}$}, $\mathbf{\Gamma}$ and $\mathbf{\Lambda}$, respectively by $\tau(f)$, $\eta(f)$ and $\gamma(f)$, for $f \in \{f_1,f_2,\cdots, f_J\}$, we have $
\eta(f) = \frac{\alpha^2\tau(f)+q(f)}{1+rW(\alpha^2\tau(f)+q(f))}$.
\vspace{-1mm}
\subsection{Proof of Theorem 1}
First note that Eq. (\ref{eq:z-ss}) implies that $\mathbbm{E}[{dz_n(f)dz_{n+t}^{*}(f')}] = \alpha^t D(f)\delta(f-f')dfdf'$. By invoking the Cram\'{e}r representation, the covariance of the data tapered by the $k$th and $l$th dpss sequences can be expressed as:
\vspace{-1mm}
\begin{align}
&\resizebox{\columnwidth}{!}{$\displaystyle \mathbbm{E}\left[(\widetilde{\mathbf{y}}_{s}^{(k)})_j (\widetilde{\mathbf{y}}_{s'}^{(l)})_{j'}^*\right] = \alpha^{|s-s'|}\int_{-1/2}^{1/2}U_k(f_j-\beta)D(\beta)U_l^{*}(f_{j'}-\beta)d\beta$} \nonumber \\[-5pt]
& \qquad \quad \ \ \ \ \resizebox{0.67\columnwidth}{!}{$\displaystyle + \int_{-1/2}^{1/2}U_k(f_j-\beta)\sigma^2\delta(s-s')U_l^{*}(f_{j'}-\beta)d\beta$}.
\end{align}
\vspace{-1.5mm}
\noindent From Eqs. (\ref{est:dbmt}) and (\ref{eq:xnN}), we get:
\vspace{-1mm}
\begin{align}
\resizebox{.89\columnwidth}{!}{$\displaystyle \widehat{D}_{n|N}(f_j) = \frac{\eta^2(f_j)}{K}\sum_{k=1}^{K}\sum_{s=1}^{N}\sum_{s'=1}^{N} \gamma(f_j)^{|s-n|}\gamma(f_j)^{|s'-n|}(\widetilde{\mathbf{y}}_{s}^{(k)})_j (\widetilde{\mathbf{y}}_{s'}^{(k)})_{j}^*.$}
\end{align}
Taking the expectation of both sides and after some simplification, one arrives at:
\begin{align}
\label{ub}
& \resizebox{\columnwidth}{!}{$\displaystyle \mathbbm{E}[\widehat{D}_{n|N}(f_j)]=\frac{\eta^2(f_j)}{K}\sum_{k=1}^{K}\sum_{s=1}^{N}\sum_{s'=1}^{N} \gamma(f_j)^{|s-n|} \gamma(f_j)^{|s'-n|} \mathbbm{E} \left[(\widetilde{\mathbf{y}}_{s}^{(k)})_j (\widetilde{\mathbf{y}}_{s'}^{(k)})_j^*\right]$} \nonumber \\[-4pt]
& \qquad \quad \quad \ =\bigg[\eta(f_j)^2\sum_{s=1}^{N}\sum_{s'=1}^{N} \gamma(f_j)^{|s-n|} \gamma(f_j)^{|s'-n|} \alpha^{|s-s'|}\bigg] \times \nonumber \\[-5pt]
& \qquad \qquad \qquad \frac{1}{K}\sum_{k=1}^{K}\int_{-1/2}^{1/2} U_k(f_j-\beta) D(\beta) U_k^{*}(f_j-\beta)d\beta \nonumber \\[-5pt]
& \qquad \qquad \quad \ + \bigg[\eta(f_j)^2\sum_{s=1}^{N} \gamma(f_j)^{2|s-n|} \bigg] \sigma^2
\end{align}
Using the orthogonality of the PSWFs as in \cite{lii2008}, and using the fact that $D(\beta) \leqslant \sup_f D(f), \forall \beta$, we get:
\begin{align}
\big|\mathbbm{E}[\widehat{D}_{n|N}&(f)]- \kappa_n(f) D(f) \big| \leqslant \kappa_n(f)(\sup_{f} \{D(f)\}-D(f)) \times \nonumber \\[-5pt]
&\bigg(1-\frac{1}{K}\sum_{k=1}^{K}\lambda_k\bigg) + \mu_n(f) \sigma^2 +\kappa_n(f) o(1),
\end{align}
\vspace{-4mm}
\[
\text{where } \kappa_n(f) := \eta(f)^2\sum_{s=1}^{N}\sum_{s'=1}^{N} \gamma(f)^{|s-n|} \gamma(f)^{|s'-n|} \alpha^{|s-s'|},
\]
$
\text{and }\mu_n(f) := \eta(f)^2\sum_{s=1}^{N} \gamma(f)^{2|s-n|},
$
for $f \in \{f_1,f_2,\cdots, f_J\}$. Using the triangle inequality, the bound of Theorem \ref{theorem1} on $\big|\mathbbm{E}[\widehat{D}_{n|N}(f)]- D(f) \big|$ follows. \QEDB
\vspace{-3mm}
\subsection{Proof of Theorem 2}
Using the notation of Appendix \ref{pfthm1}, we have:
\begin{align}\label{eq:cov}
&{\sf Cov}\left\{\widehat{D}_{n}^{(k)}(f),\widehat{D}_{m}^{(l)}(f')\right\} = \nonumber \\[-5pt]
&\eta(f)^4\!\!\!\!\sum_{s,s',t,t'=1}^{N}\!\!\!\gamma(f)^{|s-n|}\gamma(f)^{|s'-n|} \gamma(f')^{|t-m|} \gamma(f')^{|t'-m|}\times \nonumber \\[-5pt]
&\resizebox{.82\columnwidth}{!}{$\displaystyle \bigg[ \alpha^{|s-t|} \alpha^{|s'-t'|} \int\int U_k(f-\beta) U_l(f'+\beta) U_k(-\beta'-f)\times$} \nonumber
\\[-3pt]
&\!\resizebox{.89\columnwidth}{!}{$\displaystyle U_l(\beta'-f') (D(\beta)+\sigma^2\delta(s-t)) (D(\beta')+\sigma^2\delta(s'-t')) d\beta d\beta'$} + \nonumber\\[-3pt]
& \resizebox{.82\columnwidth}{!}{$\displaystyle\alpha^{|s-t'|} \alpha^{|s'-t|}\int\int U_k(f-\beta) U_l(\beta-f') U_k(-\beta'-f)\times$} \nonumber \\[-5pt]
&\!\!\resizebox{.9\columnwidth}{!}{$\displaystyle U_l(\beta'+f')(D(\beta)+\sigma^2\delta(s-t')) (D(\beta')+\sigma^2\delta(s'-t)) d\beta d\beta'\bigg]$}
\end{align}
Note that we have omitted the integral limits, as they are understood to be same as in (\ref{eq:cramer}) henceforth. After summing over all tapers and rearranging the summations, the first expression within the brackets in {(\ref{eq:cov})} becomes:
\begin{align}\label{eq:cov2}
&\resizebox{.98\columnwidth}{!}{$\displaystyle \int\!\!\int\bigg[\!\eta(f)^2\!\sum_{s,t=1}^{N}\! \gamma(f)^{|s-n|}\! \gamma(f')^{|t-m|} \!\alpha^{|s-t|}\! \bigg]\!(D(\beta)\!+\!\sigma^2\delta(s\!-\!t)) \times$} \nonumber \\[-6pt]
&\resizebox{.98\columnwidth}{!}{$\displaystyle \bigg[\!\eta(f)^2\!\sum_{s',t'=1}^{N}\!\gamma(f)^{|s'-n|}\!\gamma(f')^{|t'-m|}\!\alpha^{|s'-t'|}\!\bigg]\!(D(\beta')\!+\!\sigma^2\delta(s'\!-\!t')) \times$} \nonumber \\[-6pt]
&\resizebox{0.89\columnwidth}{!}{$\displaystyle \sum_{k=1}^{K}U_k(f\!-\!\beta) U_k(\!-\!\beta'\!-\!f)\!\sum_{l =1}^{K}U_l(f'\!+\!\beta) U_l(\beta'\!-\!f') d\beta d\beta'.$}
\end{align}
Let \vspace*{-4mm}
\begin{align}
\mathbbm{A}(n,m,f) &:= \bigg[\eta^2(f) \sum_{s,t=1}^{N}\gamma(f)^{|s-n|} \gamma(f')^{|t-m|} \alpha^{|s-t|} \bigg]D(f) \nonumber \\[-5pt]
& \qquad +\bigg[ \eta(f)^2 \sum_{s=1}^{N} \gamma(f)^{2|s-n|} \bigg]\sigma^2
\end{align}
Using the Schwarz inequality, the integral in Eq. (\ref{eq:cov2}) can be bounded by:
\begin{align}
\label{ubvar}
&\!\!\resizebox{.9\columnwidth}{!}{$\displaystyle\Bigg[\int\!\!\int \bigg|\sum_{k=1}^{K}U_k(f-\beta) U_k(-\beta'-f)\bigg|^2
\mathbbm{A}(n,m,\beta) \mathbbm{A}(n,m,\beta') d\beta d\beta'$} \nonumber\\
&\!\!\resizebox{0.89\columnwidth}{!}{$\displaystyle\times \int\!\!\int \Bigg|\sum_{l =1}^{K}U_l(f'+\beta) U_l(\beta'-f')\Bigg|^2
\mathbbm{A}(n,m,\beta) \mathbbm{A}(n,m,\beta') d\beta d\beta'\Bigg]^{1/2}$},
\end{align}
Using bounds on the convolutions of PSWFs {from} \cite{lii2008}, and upper bounding $\mathbbm{A}(n,m,\beta)$ by $\sup_f \{ \kappa_n(f) D(f) + \mu_n(f) \sigma^2\}$, the statement of the theorem on the variance of the {\sf DBMT} estimate $\widehat{D}_n(f)$ follows. \QEDB
\section{Characterization of $\kappa_n(f)$: bounds and parameter dependence}
\label{A3}
\subsection{Lower and Upper Bounds on $\kappa_n(f)$}
Consider the scenario where $q(f) = q$, i.e., flat spectrum. Then, the dependent of $\gamma(f)$ and $\kappa_n(f)$ on $f$ is suppressed. We have the following bound on $\kappa_n$:
\begin{prop}
\label{prop:kappa}
For $0< \gamma, \alpha <1 $, the quantity $\kappa_n$ can be bounded as:
\begin{align}
\nonumber \resizebox{\columnwidth}{!}{$\displaystyle \Bigg|\kappa_n - \bigg(1-\frac{\gamma}{\alpha}\bigg)^2 \bigg[ \frac{1+\alpha \gamma - 2(\alpha \gamma)^N}{1-\alpha \gamma}T_0 +\frac{\gamma}{(1-\gamma)^2}\bigg]\Bigg| \leqslant \bigg(1-\frac{\gamma}{\alpha}\bigg)^2 \frac{\gamma}{(1-\gamma)^2},$}
\end{align}
where $\displaystyle T_0 := \frac{1+\gamma^2 -\gamma^{2n}-\gamma^{2(N-n+1)}}{1-\gamma^2}$.
\end{prop}
\begin{IEEEproof}
To get an upper bound on $\kappa_n$, we rewrite the expression defining $\kappa_n$ as:
\begin{align}
\nonumber \resizebox{\columnwidth}{!}{$\displaystyle \kappa_n =\eta^2\sum_{s=1}^{N}\sum_{s'=1}^{N} \gamma^{|s-n|} \gamma^{|s'-n|} \alpha^{|s-s'|} =\eta^2\!\!\!\!\!\!\sum_{t=-N+1}^{N-1} \alpha^{|t|} \sum_{s=1}^{N} \gamma^{|s-n|} \gamma^{|s-t-n|}.$}
\end{align}
Now, let us define $T_t := \sum_{s=1}^{N} \gamma^{|s-n|} \gamma^{|s-t-n|}$. Then it can be verified that:
\begin{small}
\begin{align}
T_{t+1}
\begin{cases}
=\gamma T_t, \text{ when } t\geqslant N-n \\
\leqslant \gamma T_{t} + \gamma^{t+1}, \text{ when } 0 \leqslant t< N-n \\
\end{cases}
\end{align}
\end{small}
and
\begin{small}
\begin{align}
T_{t-1}
\begin{cases}
=\gamma T_t, \text{ when } t \leqslant -n+1 \\
\leqslant \gamma T_{t} + \gamma^{|t-1|}, \text{ when } -n+1 < t < 0. \\
\end{cases}
\end{align}
\end{small}
Also, we have:
\begin{small}
\begin{align}
\label{sum1}
\sum_{t=0}^{N-1} \alpha^{t}T_t &\leqslant \sum_{t=0}^{N-1} \alpha^{t}\gamma^t T_0 + \sum_{t=1}^{N-n-1} t \gamma^t + \sum_{t=N-n}^{N-1} (N-n)\gamma^t \nonumber \\[-3pt]
&\leqslant \frac{1-(\alpha \gamma)^N}{1-\alpha \gamma}T_0 + \frac{\gamma}{(1-\gamma)^2}.
\end{align}
\end{small}
Similarly, we have:
\begin{small}
\begin{align}
\label{sum2}
\sum_{t=-N+1}^{0} \alpha^{|t|}T_t \leqslant \frac{1-(\alpha \gamma)^N}{1-\alpha \gamma}T_0 + \frac{\gamma}{(1-\gamma)^2},
\end{align}
\end{small}
which along with (\ref{sum1}) leads to the claimed upper bound.
For the lower bound, we use the fact that
\begin{small}
\begin{align}
\gamma T_t =
\begin{cases}
\leqslant T_{t+1} \text{ when } t\geqslant0\\
\leqslant T_{t-1} \text{ when } t\leqslant0\\
\end{cases},
\end{align}
\end{small}
which implies $\sum_{t=0}^{N-1} \alpha^{t}T_t \geqslant \frac{1-(\alpha \gamma)^N}{1-\alpha \gamma}T_0$ and $\sum_{t=-N+1}^{0} \alpha^{|t|}T_t \geqslant \frac{1-(\alpha \gamma)^N}{1-\alpha \gamma}T_0$. Using the latter lower bounds for $\kappa_n$ yield the claimed lower bound.
\end{IEEEproof}
\vspace{-3mm}
\subsection{Relation between $\kappa_n$ and $\mathbf{Q}$}
\label{A4}
The expressions for $\kappa_n(f)$ and $\mu_n(f)$ in Appendix \ref{A1} depend on $\gamma(f)$ and $\alpha$. But $\gamma(f)$ itself depends on $q(f)$ and $\alpha$, and it is not straightforward to give a closed-form expression of $\gamma(f)$ merely in terms of $q(f)$ and $\alpha$, since it requires computation of the filtered error covariance matrix $\mathbf{\Sigma}_{n|n}$ given $\mathbf{Q}$. Again, by invoking the stead-state approximation, and defining $\mathbf{\Sigma}_{n|n-1} =: \mathbf{\Sigma}, \forall n = 1,2, \cdots,N$, the matrix $\boldsymbol{\Sigma}$ can be obtained by solving the following algebraic Riccati equation:
\begin{align}
\label{Ric}
\mathbf{\Sigma} = \alpha^2\mathbf{\Sigma} - \alpha^2 \mathbf{\Sigma} \mathbf{F}_n^{H}\big( \sigma^2\mathbf{I} + \mathbf{F}_n\mathbf{\Sigma}\mathbf{F}_n^{H} \big)^{-1} \mathbf{F}_n \mathbf{\Sigma} + \mathbf{Q}
\end{align}
and thereby the steady-state error covariance matrix $\boldsymbol{\Sigma}_{n|n} =: \boldsymbol{\Sigma}_\infty$ is given by $\mathbf{\Sigma}_\infty = \frac{1}{\alpha^2}(\mathbf{\Sigma} - \mathbf{Q})$.
Although this procedure {can} be carried out numerically, in general it is not possible to solve the Riccati equation to get a closed-form expression for arbitrary $\mathbf{Q}$. In order to illustrate the explicit dependent of $\kappa_n(f)$ on the state-space parameters, we consider the case of flat spectrum where $\mathbf{Q} = q\mathbf{I}$. In this case, it can be shown that $\mathbf{\Sigma} = \zeta \mathbf{I}$ for some $\zeta > 0$ and the matrix equation (\ref{Ric}) reduces to a simpler scalar equation for $\zeta$, given by:
\begin{align}
\resizebox{.80\columnwidth}{!}{$\displaystyle \frac{\zeta}{\sigma^2} = \alpha^2 \frac{\zeta}{\sigma^2}\left[ 1 - \frac{\zeta}{\sigma^2} \bigg(1 - \frac{rW (\zeta/\sigma^2)}{rW(\zeta/\sigma^2) +1}\bigg)rW\right] + \frac{q}{\sigma^2}$}.
\end{align}
Following simplification, a quadratic equation for $\zeta$ results, and since $\zeta \geqslant 0$, the positive solution for $\zeta$ is given by:
\begin{align}
\!\!\!\!\resizebox{.92\columnwidth}{!}{$\displaystyle \frac{\zeta}{\sigma^2} =\frac{1}{2rW} \left[ -\left(1 - \alpha^2 - rW\frac{q}{\sigma^2}\right) +\sqrt{\left(1-\alpha^2- rW\frac{q}{\sigma^2}\right)^2 + 4rW\frac{q}{\sigma^2}}\right].$}
\end{align}
Then, $\gamma$ can be computed as $\gamma = \frac{1}{\alpha} \big( 1-\frac{q/\sigma^2}{\zeta/\sigma^2}\big)$. Using these expressions for $\gamma$ and $\alpha$, the functions $\kappa_n$ and $\mu_n$ can be computed. Fig. \ref{fig:kappa_vs_alpha}\textit{B} shows the upper and lower bounds on $\kappa_n$ evaluated for $n = 50$ and different values of $\alpha$ for $q/\sigma^2 = 10$. The upper and lower bounds are simple functions of $\alpha$ and $q/\sigma^2$ and can be used to further inspect the performance trade-offs of the {\sf DBMT} algorithm with respect to the state-space model parameters.
\section*{Acknowledgment}
We would like to thank Adi Hajj-Ahmad and Min Wu for providing us the ENF data from \cite{Wu2013}.
\ifCLASSOPTIONcaptionsoff
\newpage
\fi
\bibliographystyle{IEEEtran}
| {'timestamp': '2017-12-18T02:09:16', 'yymm': '1706', 'arxiv_id': '1706.01563', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01563'} | arxiv |
\section{Introduction}
Recently, character composition models have shown great success in many NLP tasks, mainly because of their robustness in dealing with out-of-vocabulary (OOV) words by capturing sub-word informations. Among the character composition models, bidirectional long short-term memory (LSTM) models and convolutional neural networks (CNN) are widely applied in many tasks, e.g. part-of-speech (POS) tagging \citep{Santos:2014, Plank:2016}, named entity recognition \citep{Santos:2015}, language modeling \citep{Ling:2015, Kim:2016}, machine translation \citep{Costa:2016} and dependency parsing \citep{Ballesteros:2015, Yu:2017}.
In this paper, we present a state-of-the-art general-purpose tagger that uses CNNs both to compose word representations from characters and to encode context information for tagging.\footnote{We will release the code in the camera-ready version.} We show that the CNN model is more capable than the LSTM model for both functions, and more stable for unseen or unnormalized words, which is the main benefit of character composition models.
\newcite{Yu:2017} compared the performance of CNN and LSTM as character composition model for dependency parsing, and concluded that CNN performs better than LSTM. In this paper, we show that this is also the case for POS tagging. Furthermore, we extend the scope to morphological tagging and supertagging, in which the tag set is much larger and long-distance dependencies between words are more important.
In these three tagging tasks, we compare our tagger with the \textbf{bilstm-aux} tagger \citep{Plank:2016} and the CRF-based morphological tagger \textbf{MarMot} \citep{Mueller:2013}. The CNN tagger shows robust performance accross the three tasks, and achieves the highest average accuracy in all tasks. It (significantly) outperforms LSTM in morphological tagging, and outperforms both baselines in supertagging by a large margin.
To test the robustness of the taggers against the OOV problem, we also conduct experiments using artificially constructed unnormalized text by corrupting words in the normal dev set. Again, the CNN tagger outperforms the two baselines by a very large margin.
Therefore we conclude that our CNN tagger is a robust state-of-the-art general-purpose tagger that can effectively compose word representation from characters and encode context information.
\section{Model}
Our proposed CNN tagger has two main components: the character composition model and the context encoding model. Both components are essentially CNN models, capturing different levels of information: the first CNN captures morphological information from character n-grams, the second one captures contextual information from word n-grams. Figure~\ref{fig:cnn} shows a diagram of both models of the tagger.
\begin{figure}[t]
\includegraphics[width=.48\textwidth]{2conv-crop.pdf}
\caption{Diagram of the CNN tagger.\label{fig:cnn}}
\end{figure}
\subsection{Character Composition Model}
The character composition model is similar to \newcite{Yu:2017}, where several convolution filters are used to capture character n-grams of different sizes. The outputs of each convolution filter are fed through a max pooling layer, and the pooling outputs are concatenated to represent the word.
\subsection{Context Encoding Model}
The context encoding model captures the context information of the target word by scanning through the word representations of its context window. The word representation could be only word embeddings ($\vec{w}$), only composed vectors ($\vec{c}$) or the concatenation of both ($\vec{w}+\vec{c}$)
A context window consists of N words to both sides of the target word and the target word itself.
To indicate the target word, we concatenate a binary feature to each of the word representations with 1 indicating the target and 0 otherwise, similar to \newcite{Vu:2016}.
Additional to the binary feature, we also concatenate a position embedding to encode the relative position of each context word, similar to \newcite{Gehring:2017}.
\subsection{Hyper-parameters}\label{hyper}
For the character composition model, we take a fixed input size of 32 characters for each word, with padding on both sides or cutting from the middle if needed. We apply four convolution filters with sizes of 3, 5, 7, and 9. Each filter has an output channel of 25 dimensions, thus the composed vector is 100-dimensional. We apply Gaussian noise with standard deviation of 0.1 is applied on the composed vector during training.
For the context encoding model, we take a context window of 15 (7 words to both sides of the target word) as input and predict the tag of the target word.
We also apply four convolution filters with sizes of 2, 3, 4 and 5, each filter is stacked by another filter with the same size, and the output has 128 dimensions, thus the context representation is 512-dimensional. We apply one 512-dimensional hidden layer with ReLU non-linearity before the prediction layer. We apply dropout with probability of 0.1 after the hidden layer during training.
The model is trained with averaged stochastic gradient descent with a learning rate of 0.1, momentum of 0.9 and mini-batch size of 100. We apply L2 regularization with a rate of $10^{-5}$ on all the parameters of the network except the embeddings.
\section{Experiments}
\subsection{Data}
We use treebanks from version 1.2 of Universal Dependencies\footnote{\url{http://universaldependencies.org}} (UD), and in the case of several treebanks for one language, we only use the canonical treebank. There are in total 22 treebanks, as in \newcite{Plank:2016}.\footnote{We use all training data for Czech, while \newcite{Plank:2016} only use a subset.}
Each treebank splits into train, dev, and test sets, we use the dev sets for early stop, and test on the test sets.
\subsection{Tasks}
\enote{Note}{I think you should add some motivation why three tasks and not one. Something like:}
We evaluate our method on three tagging tasks: POS tagging (\textbf{\textsc{Pos}{}}), morphological tagging (\textbf{\textsc{Morph}{}}) and supertagging (\textbf{\textsc{Stag}{}}).
\enote{Note}{If the reason is the tag set size then you should have those sizes somewhere. }
For POS tagging we use Universal POS tags, which is an extension of \newcite{Petrov:2012}. The universal tag set tries to capture the ``universal'' properties of words and facilitate cross-lingual learning. Therefore the tag set is very coarse and leaves out most of the language-specific properties to morphological features.
Morphological tags encode the language-specific morphological features of the words, e.g., number, gender, case. They are represented in the UD treebanks as one string which contains several key-value pairs of morphological features.\footnote{German, French and Indonesian do not have \textsc{Morph}{} tags in UD-1.2, thus not evaluated in this task.}
Supertags \cite{Joshi:1994} are tags that encode more syntactic information than standard POS tags, e.g. the head direction or the subcategorization frame. We use dependency-based supertags \cite{FothBM06} which are extracted from the dependency treebanks. Adding such tags into feature models of statistical dependency parsers significantly improves their performance \cite{Ouchi:2014,Falenska:2015}. Supertags can be designed with different levels of granularity.
We use the standard Model~1 from \newcite{Ouchi:2014}, where each tag consists of head direction, dependency label and dependent direction.
Even with the basic supertag model, the \textsc{Stag}{} task is more difficult than \textsc{Pos}{} and \textsc{Morph}{} because it generally requires taking long-distance dependencies between words into consideration.
We select these tasks as examples for tagging applications because they differ strongly in tag set sizes.
Generally, the \textsc{Pos}{} set sizes for all the languages are no more than 17 and \textsc{Stag}{} set sizes are around 200.
When treating morphological features as a string (i.e. not splitting into key-value pairs), the sizes of the \textsc{Morph}{} tag sets range from about 100 up to 2000.
\subsection{Setups}
As baselines to our models, we take the two state-of-the-art taggers MarMot\footnote{\url{http://cistern.cis.lmu.de/marmot/}} (denoted as CRF) and bilstm-aux\footnote{\url{https://github.com/bplank/bilstm-aux}} (denoted as LSTM). We train the taggers with the recommended hyper-parameters from the documentation.
To ensure a fair comparison (especially between LSTM and CNN), we generally treat the three tasks equally, and do not apply task-specific tuning on them, i.e., using the same features and same model hyper-parameters in each single task. Also, we do not use any pre-trained word embeddings.
For the LSTM tagger, we use the recommended hyper-parameters in the documentation\footnote{We use the most recent version of the tagger and stacking 3 layers of LSTM as recommended. The average accuracy for \textsc{Pos}{} in our evaluation is slightly lower than reported in the paper, presumably because of different versions of the tagger, but it does not influence the conclusion.}
including 64-dimensional word embeddings ($\vec{w}$) and 100-dimensional composed vectors ($\vec{c}$).
We train the $\vec{w}$, $\vec{c}$ and $\vec{w}+\vec{c}$ models as in \newcite{Plank:2016}. We train the CNN taggers with the same dimensionalities for word representations.
For the CRF tagger, we predict \textsc{Pos}{} and \textsc{Morph}{} jointly as in the standard setting for MarMot, which performs much better than with separate predictions, as shown in \newcite{Mueller:2013} and in our preliminary experiments. Also, it splits the morphological tags into key-value pairs, whereas the neural taggers treat the whole string as a tag.\footnote{Since we use the CRF tagger as a non-neural baseline model, we prefer to use the settings which maximize its performances than the rigorously equal but suboptimal settings. }
We predict \textsc{Stag}{} as a separate task.
\subsection{Results}
The test results for the three tasks are shown in Table~\ref{tbl:results} in three groups. The first group of seven columns are the results for \textsc{Pos}{}, where both LSTM and CNN have three variations of input features: word only ($\vec{w}$), character only ($\vec{c}$) and both ($\vec{w}+\vec{c}$). For \textsc{Morph}{} and \textsc{Stag}{}, we only use the $\vec{w}+\vec{c}$ setting for both LSTM and CNN.
On macro-average, three taggers perform close in the \textsc{Pos}{} task, with the CNN tagger being slightly better.
In the \textsc{Morph}{} task, CNN is again slightly ahead of CRF, while LSTM is about 2 points behind.
In the \textsc{Stag}{} task, CNN outperforms both taggers by a large margin: 2 points higher than LSTM and 8 points higher than CRF.
While considering the input features of the LSTM and CNN taggers, both taggers perform close with only $\vec{w}$ as input, which suggests that the two taggers are comparable in encoding context for tagging \textsc{Pos}. However, with only $\vec{c}$, CNN performs much better than LSTM (95.54 vs. 92.61), and close to $\vec{w}+\vec{c}$ (96.18). Also, $\vec{c}$ consistently outperforms $\vec{w}$ for all languages. This suggests that the CNN model alone is capable of learning most of the information that the word-level model can learn, while the LSTM model is not.
The more interesting cases are \textsc{Morph}{} and \textsc{Stag}{}, where CNN performs much higher than LSTM.
We hypothesize three possible reasons to explain the considerably large difference.
First, the LSTM tagger may be more sensitive to hyper-parameters and requires task specific tuning. We use the same setting which is tuned for the \textsc{Pos}{} task, thus it underperforms in the other tasks.
Second, the LSTM tagger may not deal well with large tag sets. The tag set size for \textsc{Morph}{} are larger than \textsc{Pos}{} in orders of magnitudes, especially for Czech, Basque, Finnish and Slovene, all of which have more than 1000 distinct \textsc{Morph}{} tags in the training data, and the LSTM performs poorly on these languages.
Third, the LSTM has theoretically unlimited access to all the tokens in the sentence, but in practice it might not learn the context as good as the CNN. In the LSTM model, the information of long-distance contexts will gradually fade away during the recurrence, whereas in the CNN model, all words are treated equally as long as they are in the context window.
Therefore the LSTM underperforms in the \textsc{Stag}{} task, where the information from long-distance context is more important.
\begin{table*}[!h]
\footnotesize
\centering
\begin{tabular}{l | c : c c c : c c c | c c c | c c c }
\toprule
& \multicolumn{7}{|c|}{\textbf{\textsc{Pos}{}}} & \multicolumn{3}{c|}{\textbf{\textsc{Morph}{}}} & \multicolumn{3}{c}{\textbf{\textsc{Stag}{}}} \\
& CRF & \multicolumn{3}{c:}{LSTM} & \multicolumn{3}{c|}{CNN} & {CRF} & {LSTM} & {CNN} & {CRF} & {LSTM} & {CNN} \\
& & $\vec{w}$ & $\vec{c}$ & $\vec{w}+\vec{c}$ & $\vec{w}$ & $\vec{c}$ & $\vec{w}+\vec{c}$ &&$\vec{w}+\vec{c}$ &$\vec{w}+\vec{c}$&&$\vec{w}+\vec{c}$ & $\vec{w}+\vec{c}$ \\
\midrule
avg & 96.02 & 92.26 & 92.61 & 95.82 & 92.65 & 95.54 & \textbf{96.18} & 93.72 & 91.62 & \textbf{93.90} & 76.10 & 82.50 & \textbf{84.69} \\
\midrule
ar & 98.83 & 95.05 & 98.35 & 98.88 & 95.30 & 98.89 & \textbf{99.00} & 98.11 & 97.91 & \textbf{98.45} & 79.67 & 83.70 & \textbf{85.51}\\
bg & 98.11 & 94.96 & 96.94 & 98.07 & 95.25 & 97.79 & \textbf{98.20} & \textbf{95.12} & 92.28 & 94.85 & 78.91 & 85.91 & \textbf{87.64}\\
cs & 98.74 & 96.12 & 92.98 & 98.40 & 96.36 & 98.35 & \textbf{98.79} & 93.81 & 90.21 & \textbf{94.45} & 76.33 & 81.43 & \textbf{87.46}\\
da & 95.96 & 91.74 & 94.29 & \textbf{96.06} & 92.08 & 95.24 & 95.92 & \textbf{95.50} & 94.15 & 95.14 & 73.83 & 81.00 & \textbf{81.82}\\
de & \textbf{92.77} & 89.91 & 88.97 & 92.57 & 90.21 & 92.44 & 92.73 & - & - & - & 70.56 & 77.58 & \textbf{79.69}\\
en & 94.49 & 91.58 & 88.99 & 94.17 & 92.64 & 93.76 & \textbf{94.76} & 95.69 & 95.45 & \textbf{95.88} & 75.57 & 83.27 & \textbf{85.87}\\
es & 95.28 & 93.27 & 91.41 & 94.62 & 93.95 & 95.36 & \textbf{95.65} & 96.14 & 95.26 & \textbf{96.34} & 78.07 & 83.80 & \textbf{86.27}\\
eu & 94.79 & 88.70 & 89.80 & 93.99 & 89.69 & 94.31 & \textbf{94.94} & \textbf{89.60} & 84.32 & 89.06 & 70.44 & 77.88 & \textbf{80.43}\\
fa & 96.82 & 95.67 & 94.73 & 96.95 & 95.97 & 96.12 & \textbf{97.12} & \textbf{96.56} & 96.37 & 96.50 & 76.76 & 83.21 & \textbf{83.25}\\
fi & \textbf{95.79} & 87.78 & 84.41 & 94.16 & 88.24 & 94.33 & 95.31 & \textbf{94.33} & 87.33 & 93.82 & 70.69 & 76.65 & \textbf{82.63}\\
fr & 95.98 & 94.34 & 91.82 & 95.85 & 94.56 & 95.68 & \textbf{96.27} & - & - & - & 78.36 & 84.01 & \textbf{85.44}\\
he & 95.48 & 93.81 & 92.96 & 95.62 & 93.81 & 94.68 & \textbf{96.04} & 92.92 & 91.27 & \textbf{93.29} & 76.73 & 82.56 & \textbf{85.44}\\
hi & 96.36 & 95.66 & 91.12 & 96.23 & 96.04 & 95.77 & \textbf{96.69} & 90.93 & 90.78 & \textbf{92.11} & 85.54 & 89.62 & \textbf{90.08}\\
hr & \textbf{95.56} & 88.10 & 94.47 & 94.69 & 88.92 & 94.76 & 95.05 & 87.25 & 84.56 & \textbf{87.73} & 71.42 & 77.77 & \textbf{79.27}\\
id & \textbf{93.51} & 90.40 & 90.76 & 92.97 & 91.15 & 92.32 & 93.44 & - & - & - & 75.37 & 80.55 & \textbf{81.63}\\
it & \textbf{97.74} & 96.04 & 94.64 & 97.55 & 96.54 & 97.08 & 97.62 & \textbf{97.63} & 97.13 & 97.47 & 84.02 & 89.10 & \textbf{90.89}\\
nl & 91.03 & 85.09 & 86.52 & 92.23 & 83.74 & 92.05 & \textbf{93.11} & 92.32 & 91.26 & \textbf{93.12} & 67.04 & 77.71 & \textbf{79.68}\\
no & 97.61 & 94.39 & 93.32 & 97.49 & 94.60 & 97.05 & \textbf{97.65} & \textbf{96.03} & 94.85 & 95.74 & 79.99 & 86.45 & \textbf{89.41}\\
pl & \textbf{96.92} & 89.53 & 95.05 & 96.30 & 90.48 & 96.41 & 96.83 & \textbf{87.74} & 82.34 & 87.13 & 76.09 & 80.00 & \textbf{83.45}\\
pt & \textbf{97.78} & 94.20 & 94.95 & 97.53 & 94.41 & 97.22 & 97.46 & 94.99 & 94.75 & \textbf{95.76} & 78.68 & 86.02 & \textbf{87.42}\\
sl & 96.60 & 90.43 & 96.35 & \textbf{97.42} & 91.02 & 96.89 & 97.16 & 90.41 & 86.47 & \textbf{91.94} & 76.35 & 85.67 & \textbf{86.45}\\
sv & 96.23 & 93.04 & 94.48 & 96.20 & 93.27 & 95.38 & \textbf{96.28} & \textbf{95.65} & 94.08 & 95.30 & 73.81 & 81.04 & \textbf{83.34}\\
\bottomrule
\end{tabular}
\caption{Tagging accuracies of the three taggers in the three tasks on the test set of UD-1.2, the highest accuracy for each task on each language is marked in bold face.}\label{tbl:results}
\end{table*}
\subsection{Unnormalized Text}
It is a common scenario to use a model trained with news data to process text from social media, which could include intentional or unintentional misspellings. Unfortunately, we do not have social media data to test the taggers.
However, we design an experiment to simulate unnormalized text, by systematically editing the words in the dev sets with three operations: insertion, deletion and substitution.
For example, if we modify a word {\em abcdef} at position 2 (0-based), the modified words would be {\em abxcdef}, {\em abdef}, and {\em abxdef}, where {\em x} is a random character from the alphabet of the language.
For each operation, we create a group of modified dev sets, where all words longer than two characters are edited by the operation with a probability of 0.25, 0.5, 0.75, or 1.
For each language, we use the models trained on the normal training sets and predict \textsc{Pos}{} for the three groups of modified dev set.
The average accuracies are shown in Figure~\ref{fig:edits}.
Generally, all models suffer from the increasing degrees of unnormalized texts, but CNN always suffers the least. In the extreme case where almost all words are unnormalized, CNN performs 4 to 8 points higher than LSTM and 4 to 11 points higher than CRF. This suggests that the CNN is more robust to misspelt words.
While looking into the specific cases of misspelling, CNN is more sensitive to insertion and deletion, while CRF and LSTM are more sensitive to substitution.
\begin{figure}[h]
\includegraphics[width=.48\textwidth]{edits.pdf}
\caption{\textsc{Pos}{} tagging accuracies on the dev set with the three modifications of different degrees.\label{fig:edits}}
\end{figure}
\section{Conclusion}
In this paper, we propose a general-purpose tagger that uses two CNNs for both character composition and context encoding. On the universal dependency treebanks (v1.2), the tagger achieves state-of-the-art results for POS tagging and morphological tagging, and to the best of our knowledge, it also performs best for supertagging.
The tagger works well across different tagging tasks without tuning the hyper-parameters, and it is also robust against unnormalized text.
\newpage
\newpage
| {'timestamp': '2017-06-07T02:05:46', 'yymm': '1706', 'arxiv_id': '1706.01723', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01723'} | arxiv |
\section{Introduction}
\label{sec:Intro}
In the last few years Recurrent Neural Networks (RNNs) \cite{jordan-serial,Elman90findingstructure,Hochreiter-1997-LSTM} have proved very effective in several Natural Language Processing (NLP) tasks such as Part-of-Speech tagging (POS tagging), chunking, Named Entity Recognition (NER), Spoken Language Understanding (SLU), machine translation and even more \cite{RNN-Mikolov-Interspeech-2010,RNNExtensions_Mikolov-ICASSP-2011,Collobert-2008-UAN-1390156.1390177,Collobert-2011-NLP-1953048.2078186,RNNforLU-Interspeech-2013,RNNforSLU-Interspeech-2013,Vukotic.etal_2015}.
These models are particularly effective thanks to their recurrent architecture, which allows neural models to \textit{keep in memory} past information and re-use it at the current processing step.
In the literature of RNNs applied to NLP, several architectures have been proposed.
At first Elman and Jordan RNNs, introduced in \cite{Elman90findingstructure,jordan-serial}, and known also as simple RNNs, have been adapted to NLP.
The difference between these two models is in the type of connection giving the recurrent character to these two architectures: in the Elman RNN the recursion is a loop at the hidden layer, while in the Jordan RNN it relies the output layer to the hidden layer.
This last recursion allows to use at the current step labels predicted for previous positions in a sequence.
These two recurrent models have shown limitations in learning relatively long contexts \cite{Bengio-1994-RNN-Learning-Difficulty}.
In order to overcome this limitation the RNNs known as \textit{Long Short-Term Memory} (LSTM) have been proposed \cite{Hochreiter-1997-LSTM}.
Recently, a simplified and, apparently, more effective variant of LSTM has been proposed, using \textit{Gated Recurrent Units} and thus named \textit{GRU} \cite{Cho-2014-GatedRecurrentUnits}.
Despite outstanding performances on several NLP tasks, RNNs have not been explicitly adapted to integrate effectively label-dependency information in sequence labeling tasks.
Their sequence labeling decisions are based on intrinsically local functions (e.g. the softmax).
In order to overcome this limitation, sophisticated hybrid \textit{RNN+CRF} models have been proposed \cite{huang2015bidirectional,lample2016neural,Ma-Hovy-ACL-2016},
where the traditional output layer is replaced by a CRF neural layer.
These models reach state-of-the-art performances, their evaluation however is not clear.
In particular it is not clear if performances derive from the model itself, or thanks to particular experimental conditions.
In \cite{Ma-Hovy-ACL-2016} for example, the best result of POS tagging on the Penn Treebank corpus is an accuracy of $97.55$, which is reached using word embeddings trained using \textit{GloVe} \cite{pennington2014glove},
on huge amount of unlabeled data. The model of \cite{Ma-Hovy-ACL-2016} without pre-trained embeddings reaches an accuracy of $96.9$, which doesn't seem that outstanding if we consider that a CRF model dating from $2010$, trained from scratch, without using any external resource, reaches an accuracy of $97.3$ on the same data \cite{lavergne2010practical}. We achieved the same result on the same data with a CRF model trained from scratch using the incremental procedure described in \cite{Dinarelli:Rosset:ijcnlp:2011}.
Moreover, the first version of the network proposed in this paper, but using a sigmoid activation function and only the $L_2$ regularization, tough with a slightly different data preprocessing, achieves an accuracy on the Penn Treebank of $96.9$ \cite{2016:arXiv:DinarelliTellier:NewRNN}.
The intuition behind this paper is that embeddings allow a fine and effective modeling not only of words,
but also of labels and label dependencies, which are crucial in some tasks of sequence labeling.
In this paper we propose, as alternative to \textit{RNN+CRF} models, a variant of RNN allowing this more effective modeling.
Surprisingly, a simple modification to the RNN architecture results in a very effective model:
in our variant of RNN the recurrent connection connects the output layer to the input layer and,
since the first layer is just a \textit{look-up} table mapping discrete items into embeddings,
labels predicted at the output layer are mapped into embeddings the same way as words.
Label embeddings and word embeddings are combined at the hidden layer, allowing to learn relations between these two types of information, which are used to predict the label at current position in a sequence.
Our intuition is that using several label embeddings as context, a RNN is able to model correctly label-dependencies, the same way as more sophisticated models explicitly designed for sequence labeling like CRFs \cite{lafferty01:crf}.
This paper is a straight follow-up of \cite{DinarelliTellier:RNN:CICling2016}.
Contributions with respect to that work are as follows:
i) An analysis of performances of \textit{forward}, \textit{backward} and bidirectional models.
ii) The use of \textit{ReLU} hidden layer and \textit{dropout} regularization \cite{JMLR-v15-srivastava14a} at the hidden and embedding layers for improved regularized models.
iii) The integration of a character-level convolution layer.
iv) An in-depth evaluation, showing the effect of different components and of different information level on the performance.
v) A straightforward comparison of the proposed variant of RNN to Elman, Jordan, LSTM and GRU RNNs,
showing that the new variant is at least as effective as the best RNN models, such as LSTM and GRU.
Our variant is even more effective when taking label-dependencies into account is crucial in the task, proving that our intuition is correct.
An high level schema of simple RNNs and of the variant proposed in this paper is shown in figure~\ref{fig:3architecgtures}, where $w$ is the input word, $y$ is the label, $E$, $H$, $O$ and $R$ are the model parameters, which will be discussed in the following sections.
\begin{figure
\centering
\footnotesize
\subfigure[Elman]{
\includegraphics[height=4.2cm]{ElmanRNN_inkscape.png}
}
\quad
\subfigure[Jordan]{
\includegraphics[height=4.2cm]{JordanRNN_inkscape.png}
}
\quad
\subfigure[Our variant]{
\includegraphics[height=4.2cm]{OcramRNN_inkscape.png}
}
\vspace{-0.8em}
\caption{High level schema of simple RNNs (Elman and Jordan) and the variant proposed in this paper.}
\label{fig:3architecgtures}
\vspace{-1.5em}
\end{figure}
Since evaluations on tasks like POS tagging on the Penn Treebank are basically reaching perfection (state-of-the-art is at $97.55$ accuracy), any new model would probably provide little or no improvement.
Also, performances on this type of tasks seem to have reached a \textit{plateau}, as models achieving $97.2$ accuracy or even better, were already published starting from $2003$ \cite{Toutanova03posTagging,shen-satta-joshi:2007:ACLMain}.
We propose instead to evaluate all the models on two different and widely used tasks of Spoken Language Understanding \cite{demori08-SPM}, which provide more variate evaluation settings: ATIS \cite{Dahl-1994-ESA-1075812.1075823} and MEDIA \cite{Bonneau-Maynard2006-media}.
ATIS is a relatively simple task and doesn't require a sophisticated modeling of label dependencies.
This task allows to evaluate models in similar settings as tasks like POS tagging or Named Entity Recognition as defined in the \textit{CoNLL Shared Task} 2003, both widely used as benchmarks in NLP papers.
MEDIA is a very challenging task, where the ability of models to keep label dependencies into account is crucial to obtain good results.
Results show that our new variant is as effective as the best RNN models on a simple task like ATIS, still having the advantage of being much simpler.
On the MEDIA task however, our variant outperforms all the other RNNs by a large margin, and even sophisticated CRF models, providing the best absolute result ever achieved on this task.
The paper is organized as follows:
In the next section we describe the RNNs used in the literature for NLP, starting from existing models to arrive at describing the new variant we propose.
In the section~\ref{sec:Eval} we present the corpora used for evaluation, the experimental settings and the results obtained in several experimental conditions.
We draw some conclusions in section~\ref{sec:Conclusions}.
\vspace{-1.5em}
\section{Recurrent Neural Networks (RNNs)}
\label{sec:RNN}
In this section we describe the most popular RNNs used for NLP, such as Elman and Jordan RNNs \cite{jordan-serial,Elman90findingstructure}, and the most sophisticated RNNs like LSTM and GRU \cite{Hochreiter-1997-LSTM,Cho-2014-GatedRecurrentUnits}.
We also describe training and inference procedures, and the RNN variant we propose.
\vspace{-1.0em}
\subsection{Elman and Jordan RNNs}
\label{subsec:OldRNNs}
Elman and Jordan RNNs are defined as follows:
\vspace{-1.0em}
\begin{equation}
\label{eqn:ElmanHidden}
\mathbf{h_t}^{\text{Elman}} = \Phi(R ~ \mathbf{h_{t-1}^{\text{Elman}}} + H ~ \mathbf{I_t})
\end{equation}
\vspace{-2.0em}
\begin{equation}
\label{eqn:JordanHidden}
\mathbf{h_t}^{\text{Jordan}} = \Phi(R ~ \mathbf{y_{t-1}} + H ~ \mathbf{I_t})
\end{equation}
\vspace{-1.0em}
\noindent The difference between these two models is in the way of computing hidden activities,
while the output is computed in the same way:
\vspace{-1.2em}
\begin{equation}
\mathbf{y_t} = softmax(O ~ \mathbf{h_t^{*}})
\end{equation}
\vspace{-1.5em}
\noindent $h_t^{*}$ and $y_t$ are respectively the hidden and output layer's activities\footnote{$h_*$ means the hidden layer of any model, as the output layer is computed in the same way for all networks described in this paper.}, $\Phi$ is an activation function,
$H$, $O$ and $R$ are the parameters at the hidden, output and recurrent layer, respectively (biases are omitted to keep equations lighter).
$h_{t-1}^{\text{Elman}}$ is the hidden layer activity computed at previous time step and used as context in the Elman RNN,
while $y_{t-1}$ is the previous predicted labels, used as context in the Jordan RNN.
$I_t$ is the input, which is often the concatenation of word embeddings in a fixed window $d_w$ (for win\textbf{D}ow of \textbf{W}ords) around the current word $w_t$ to be labeled.
We define as $E(w_i)$ the embedding of any word $w_i$.
$I_t$ is then defined as:
\vspace{-1.3em}
\begin{equation}
\mathbf{I_t} = [E_w(w_{t-d_w}) ... E_w(w_{t}) ... E_w(w_{t+d_w})]
\end{equation}
\vspace{-1.5em}
\noindent where $[ ~ ]$ is the concatenation of vectors (or matrices in the following sections).
The $softmax$ function, given a set $S$ of $m$ numerical values $v_i$,
associated to discrete elements $i \in [1,m]$, computes the probability associated to each element as:
{\centering
$\forall i \in [1,m]$~$p(i) = \frac{e^{v_i}}{\sum_{j=1}^m e^{v_j}}$
}
\noindent This function allows to compute the probability associated to each label and choose as predicted label the one with the highest probability.
\vspace{-0.8em}
\subsection{\textit{Long Short-Term Memory} (LSTM) RNNs}
\label{subsec:LSTM}
While LSTM is often used as the name of the whole network, it just defines a different way of computing the hidden layer activities.
LSTMs use \textit{gate} units to control how past and present information affect the network's internal state, and a \textit{cell} to store past information that is going to be used as context at the current processing step.
\textit{Forget}, \textit{input} gates and \textit{cell state} are computed as:
\vspace{-1.8em}
\begin{eqnarray}
\mathbf{f_t} & = & \Phi( W_f \mathbf{h_{t-1}} + U_f \mathbf{I_t} ) \\
\mathbf{i_t} & = & \Phi( W_i \mathbf{h_{t-1}} + U_i \mathbf{I_t} ) \\
\mathbf{\hat{c}_t} & = & \Gamma( W_c \mathbf{h_{t-1}} + U_c \mathbf{I_t} )
\end{eqnarray}
\vspace{-1.5em}
\noindent $\Gamma$ is used to indicate a different activation function from $\Phi$\footnote{In the literature $\Phi$ and $\Gamma$ are the \textit{sigmoid} and \textit{tanh}, respectively}.
$\hat{c}_t$ is actually an intermediate value used to update the \textit{cell state} value as follows:
\vspace{-1.2em}
\begin{equation}
\mathbf{c_t = f_t \odot c_{t-1} + i_t \odot \hat{c_t}}
\end{equation}
\vspace{-1.5em}
\noindent $\odot$ is the element-wise multiplication. Once these quantities have been computed, the \textit{output} gate is computed and used to control the hidden layer activities at the current time step $t$:
\vspace{-1.8em}
\begin{eqnarray}
\mathbf{o_t} & = & \Phi( W_o \mathbf{h_{t-1}} + U_o \mathbf{I_t} ) \\
\mathbf{h_t}^{\text{LSTM}} & = & \mathbf{o_t} \odot \Phi( \mathbf{c_t} )
\end{eqnarray}
\vspace{-1.5em}
\noindent Once again (and in the remainder of the paper), biases are omitted to keep equations lighter.
As we can see, each gate and the cell state have their own parameter matrices $W$ and $U$,
used for the linear transformation of the previous hidden state ($h_{t-1}$) and the current input ($I_t$).
The evolution of the LSTM layer named GRU (\textit{Gated Recurrent Units}) \cite{Cho-2014-GatedRecurrentUnits},
combines together \textit{forget} and \textit{input} gates, and the previous hidden layer with the \textit{cell state}:
\vspace{-1.8em}
\begin{eqnarray}
\mathbf{z_t} & = & \Phi( W_z \mathbf{h_{t-1}} + U_z \mathbf{I_t} ) \\
\mathbf{r_t} & = & \Phi( W_r \mathbf{h_{t-1}} + U_r \mathbf{I_t} ) \\
\mathbf{\hat{h_t}} & = & \Gamma( W (\mathbf{r_t \odot h_{t-1}}) + U \mathbf{I_t} ) \\
\mathbf{h_t}^{\text{GRU}} & = & (1 - \mathbf{z_t}) \odot \mathbf{h_{t-1}} + \mathbf{z_t \odot \hat{h_t}}
\end{eqnarray}
\vspace{-1.5em}
\noindent GRU is thus a simplification of LSTM, it uses less units and it has less parameters to learn.
\subsection{LD-RNN : Label-Dependencies Aware Recurrent Neural Networks}
\label{subsec:I-RNN}
The variant of RNN that we propose in this paper can be thought of as having a recurrent connection from the output to the input layer. Note that from a different perspective, this variant can just be seen as a Feed-Forward Neural Network (FFNN) using previous predicted labels as input. Since Jordan RNN has the same architecture, the only difference being that in contrast to Jordan models we embed labels, we still prefer talking about recurrent network.
This simple modification to the architecture of the network has important consequences on the model.
The reason motivating this modification is that we want embeddings for labels and use them the same way as word embeddings.
Like we mentioned in the introduction, the first layer is a look-up table mapping discrete, or \textit{one-hot}\footnote{The one-hot representation of a token represented by an index $i$ in a dictionary, is a vector $v$ of the same size as the dictionary and assigned zero everywhere, except at position $i$ where it is $1$.}, representations into distributional representations.
Such representations can encode very fine syntactic and semantic properties, as it has already been proved by \textit{word2vec} \cite{Word2Vec_Mikolov-2013} or \textit{GloVe} \cite{pennington2014glove}.
We want similar properties to be learned also for labels, so that to encode in label embeddings the label dependencies needed for sequence labeling tasks.
In this paper we learn label embeddings from the sequences of labels associated to word sentences in annotated data.
But this procedure could be applied also when structured label information is available.
We could thus exploit syntactic parse trees, structured named entities or entity relations for learning sophisticated label embeddings.
The idea of using label embeddings has been introduced in \cite{chen-manning-2014-EMNLP2014} for dependency parsing, resulting in a very effective parser.
In this paper we go ahead with respect to \cite{chen-manning-2014-EMNLP2014} by using several label embeddings as context to predict the label at current position in a sequence. Also we pre-train label embeddings like it is usually done for words.
As consequence, we learn first generic dependencies between labels without their interactions with words. Such interactions are then integrated and refined during the learning phase of the target sequence labeling task.
For this ability to learn label-dependencies, we name our variant \emph{LD-RNN},
standing for \textit{Label Dependencies aware RNN}.
Using the same formalism as before,
we define $E_w$ the matrix for word embeddings,
while $E_l$ is the matrix for label embeddings.
The word-level input to our RNN is $I_t$ as for the other RNNs, while the label-level input is:
\vspace{-1.2em}
\begin{equation}
\mathbf{L_t} = [E_l(y_{t-d_l+1}) ~ E_l(y_{t-d_l+2}) \dots E_l(y_{t-1})]
\end{equation}
\vspace{-1.5em}
\noindent which is the concatenation of vectors representing the $d_l$ previous predicted labels ($d_l$ stands (for win\textbf{D}ow of \textbf{L}abels)).
The hidden layer activities of our RNN variant are computed as:
\vspace{-1.0em}
\begin{equation}
\mathbf{h_t}^{\text{LD-RNN}} = \Phi( H ~ [\mathbf{I_t L_t}] )
\end{equation}
\vspace{-1.5em}
\noindent We note that we could rewrite the equation above as $\Phi(H_w \mathbf{I_t} + H_l \mathbf{L_t})$ with a similar formalism as before, the two equations are equivalent if we define $H = [H_w H_l]$.
Thanks to the use of label embeddings and their combination at the hidden layer,
our \emph{LD-RNN} variant learns very effectively label dependencies.
Since the other RNNs in general don't use explicitly the label information as context, they can predict incoherent label sequences.
As we already mentioned, this limitation lead research toward hybrid \emph{RNN+CRF} models \cite{huang2015bidirectional,lample2016neural,Ma-Hovy-ACL-2016}.
Another consequence of the modification introduced in our RNN variant is an improved robustness to prediction mistakes.
Since we use several label embeddings as context (see $\mathbf{L_t}$ above),
once the model has learned label embeddings, in the test phase it is unlikely that several prediction mistakes occur in the same context. Even in that case, thanks to properties encoded in the embeddings, mistaken labels have similar representations to correct labels, allowing the model to possibly predict correct labels.
Reusing an example from \cite{LinguisticRegularities-Mikolov-2013}:
if \textit{Paris} is replaced by \textit{Rome} in a text, this has no impact on several NLP tasks,
as they are both proper nouns in POS tagging, localization in Named Entity Recognition etc.
Using label embeddings provides the \emph{LD-RNN} variant with the same robustness on the label side.
While the traditional Jordan RNN uses also previous labels as context information,
it has not the same robustness because of the poor label representation used in adaptations of this model to NLP tasks.
In Jordan RNNs used for NLP like \cite{RNNforLU-Interspeech-2013,RNNforSLU-Interspeech-2013,Vukotic.etal_2015}, labels are represented either with the probability distribution computed by the $softmax$,
or with the \textit{one-hot} representation computed from the probability distribution.
In the latter case it is clear that a prediction mistake can have a bad impact in the context,
as the only value being $1$ in the \textit{one-hot} representation would be in the wrong position.
Instead, using the probability distribution may seem a kind of \textit{fazzy} representation over several labels,
but we have found empirically that the probability is very sharp and picked on one or just few labels.
In any case this representation doesn't provide the desired robustness that can be achieved with label embeddings.
From another point of view, we can interpret the computation of the hidden activities in a Jordan RNN as using label embeddings. In the equation \ref{eqn:JordanHidden}, the multiplication $R y_{t-1}$, since $y_{t-1}$ is a sparse vector,
can be interpreted as the selection of an embedding from $R$.
Even with this interpretation there is a substantial difference between a Jordan RNN and our variant.
In the Jordan RNN, once the label embedding has been computed with $R y_{t-1}$,
the result is not involved in the linear transformation applied by the matrix $H$, which is only applied to the word-level input $I_t$.
The result of this multiplication is added to $R y_{t-1}$ and then the activation function is applied.
In our variant in contrast, labels are first mapped into embeddings with $E[y_i]$\footnote{In our case, $y_i$ is explicitly converted from probability distribution to \textit{one-hot} representation.}.
Word and label inputs $\mathbf{I_t}$ and $\mathbf{L_t}$ are then both transformed by multiplying by $H$,
which is correctly dimensioned to apply the linear transformation on both inputs.
In our variant thus, two different label transformations are always applied: i) the conversion from sparse to embedding representation; ii) the linear transformation by multiplying label embeddings by $H$.
\vspace{-1.0em}
\subsection{Learning and Inference}
\label{subsec:Learning}
We learn the \emph{LD-RNN} variant like all the other RNNs, by minimizing the cross-entropy between the expected label $l_t$ and the predicted label $y_t$ at position $t$ in the sequence, plus a $L_2$ regularization term:
\vspace{-1.2em}
\begin{equation}
C = - \mathit{l_t} \odot log( \mathbf{y_t} ) + \frac{\lambda}{2} \left | \Theta \right |^2
\end{equation}
\vspace{-1.5em}
\noindent $\lambda$ is a hyper-parameter to be tuned, $\Theta$ is a short notation for $E_w, E_l, H, O$.
$l_t$ is the \textit{one-hot} representation of the expected label.
Since $y_t$ above is the probability distribution over the label set,
we can see the output of the network as the probability $P(i | \mathbf{I_t, L_t})$~$\forall i \in [1,m]$,
where $\mathbf{I_t}$ and $\mathbf{L_t}$ are the input of the network (words and labels), $i$ is the index of one of the labels defined in the targeted task.
We can thus associate to the \emph{LD-RNN} model the following decision function:
\vspace{-1.2em}
\begin{equation}
argmax_{i \in [1,m]} P(i | \mathbf{I_t, L_t})
\end{equation}
\vspace{-1.5em}
\noindent We note that this is still a local decision function, as the probability of each label is normalized at each position of a sequence.
Despite this, the use of label-embeddings $\mathbf{L_t}$ as context allows the \emph{LD-RNN} to effectively model label dependencies.
Since the other RNNs like Elman and LSTM don't use the label information in their context,
their decision function can be defined as:
\vspace{-1.2em}
\begin{equation}
argmax_{i \in [1,m]} P(i | \mathbf{I_t})
\end{equation}
\vspace{-1.5em}
\noindent which can lead to incoherent predicted label sequences.
We use the traditional back-propagation algorithm with momentum to learn our networks \cite{PracticalRecommendations-Bengio-2012}.
Given the recurrent nature of the networks, the Back-Propagation Through Time (BPTT) is often used \cite{werbos-bptt}.
This algorithm consists in unfolding the RNN for $N$ previous steps, $N$ being a parameter to choose, and using thus the $N$ previous inputs and hidden states to update the model's parameters.
The traditional back-propagation algorithm is then applied. This is equivalent to learn a feed-froward network of depth $N$.
The BPTT algorithm is supposed to allow the network to learn arbitrary long contexts.
However \cite{RNNExtensions_Mikolov-ICASSP-2011} has shown that RNNs for language modeling learn best with only $N = 5$ previous steps.
This can be due to the fact that, at least in NLP, a longer context does not lead necessarily to better performances,
as a longer context is also more noisy.
Since the BPTT algorithm is quite expensive,
\cite{RNNforSLU-Interspeech-2013} chose to explicitly use the contextual information provided by the recurrent connection, and to use the traditional back-propagation algorithm, apparently without performance loss.
In this paper we use the same strategy.
When the contextual information is used explicitly in a Jordan RNN, the hidden layer state is computed as follows:
\vspace{-1.2em}
\begin{equation}
\mathbf{h_t} = \Phi(R [\mathbf{y_{t-d_l+1} \; y_{t-d_l+2}} \; ... \; \mathbf{y_{t-1}} ] + H ~ \mathbf{I_t})
\end{equation}
\vspace{-1.5em}
\noindent A similar modification can be applied also to Elman, LSTM and GRU RNNs to keep into account explicitly the previous hidden states. To our knowledge however, these networks are effectively learned using only one previous hidden state \cite{huang2015bidirectional,lample2016neural,Ma-Hovy-ACL-2016}.
From explanations above we can say that using explicit wide context of words and labels like we do in LD-RNN, can be seen as an approximation of the BPTT algorithm.
\vspace{-0.8em}
\subsection{Toward More Sophisticated Networks: Character-Level Convolution}
\label{subsec:Improvements}
Even if word embeddings provide a very fine encoding of word features, several works such like \cite{huang2015bidirectional,LSTM-CNN-NER-2015,lample2016neural,Ma-Hovy-ACL-2016} have shown that more effective models can be obtained using a convolution layer over characters of words.
Character-level information is indeed very useful to allow a model generalizing over rare inflected surface forms and even out-of-vocabulary words in the test phase. Word embeddings are in fact much less effective in such cases.
The convolution over word characters provide also the advantage of being very general:
it can be applied in the same way to different languages, allowing to re-use the same system on different languages and tasks.
In this paper we focus on a convolution layer similar to the one used in \cite{Collobert-2011-NLP-1953048.2078186} for words.
For any word $w$ of length $|w|$, we define $E_{ch}(w,i)$ the embedding of the character $i$ of the word $w$.
We define $W_{ch}$ the matrix of parameters for the linear transformation applied by the convolution (once again we omit the associated bias).
We compute a convolution of window size $2 d_c + 1$ over characters of a word $w$ as follows:
\begin{itemize}
\item $\forall i \in [1,|w|]$
$Conv_i = W_{ch} [E_{ch}(w,i-d_c); \dots E_{ch}(w,i); \dots E_{ch}(w,i+d_c)]$
\item $Conv_{ch} = [Conv_1 \dots Conv_{|w|}]$
\item $Char_{w} = Max(Conv_{ch})$
\end{itemize}
\noindent the $Max$ function is the so-called max-pooling \cite{Collobert-2011-NLP-1953048.2078186}.
While it is not strictly necessary mapping characters into embeddings, it would be probably less interesting applying the convolution on discrete representations.
The matrix $Conv_{ch}$ is made of the concatenation of vectors returned from the application of the linear transformation $W_{ch}$. Its size is thus $|C| \times |w|$, where $|C|$ is the size of the convolution layer.
The max-pooling computes the maxima over the word-length direction,
thus the final output $Char_{w}$ has size $|C|$, which is independent from the word length.
$Char_{w}$ can be interpreted as a distributional representation of the word $w$ encoding the information at $w$'s character level. This is a complementary information with respect to word embeddings, which encode inter-word information, and provide the model with an information similar to what is provided by discrete lexical features like word prefixes, suffixes, capitalization information etc., plus information about morphologically correct words of a given language.
\subsection{RNN Complexities}
\label{subsec:Complexity}
The improved modeling of label dependencies in our \emph{LD-RNN} variant is achieved at the cost of more parameters with respect to the simple RNN models.
However the number of parameters is still much less than sophisticated networks like LSTM.
In this section we provide a comparison of RNNs complexity in terms of the number of parameters.
We introduce the following symbols: $|H|$ and $|O|$ are the size of the hidden and output layers, respectively. The size of the output layer is the number of labels; $N$ is the embedding size, in \emph{LD-RNN} we use the same size for word and label embeddings; $d_w$ is the window size used for context words; and $d_l$ is the number of label embeddings we use as context in \emph{LD-RNN}.
We analyze the hidden layer of all networks, and the embedding layer for \emph{LD-RNN}.
The other layers are exactly the same for all the networks described in this paper.
For Elman and Jordan RNNs, the hidden layer has the following number of parameters, respectively:
{\centering
$\{|H| * |H|\}_R + \{|H| * (2 d_w + 1) N\}_{H^{\text{Elman}}}$
}
{\centering
$\{|O| * |H|\}_R + \{|H| * (2 d_w + 1) N\}_{H^{\text{Jordan}}}$
}
\noindent Subscripts indicate from which matrix the parameters come.
The factor $(2 d_w + 1) N$ comes from the $(2 d_w + 1)$ words used as input context and then mapped into embeddings.
The factor $|O| * |H|$ in Jordan RNN is due to the fact that the matrix $R$ connects output and hidden layers.
In \emph{LD-RNN} we have:
{\centering
$\{|O| * N\}_{E_l} + \{((2 d_w + 1 + d_l) N) * |H|\}_{H^{\text{LD-RNN}}}$
}
The factor $|O| * N$ is due to the use of the matrix $E_l$ containing $|O|$ label embeddings of size $N$.
Since in this paper we chose $N = |H|$ and $|O| < |H|$, and since in LD-RNN we don't use any matrix R on the recurrent connection, the fact of using label embeddings doesn't increase the number of parameters of the \emph{LD-RNN} variant.
The hidden layer of \emph{LD-RNN} however is dimensioned to connect all the word and label embeddings to all the hidden neurons. As consequence in the matrix $H$ we have $d_l N$ more parameters than in the matrix $H$ of Elman and Jordan RNNs.
In LSTM and GRU RNNs we have two extra matrices $W$ and $U$ for each gate and for the \textit{cell state},
used to connect the previous hidden layer and the current input, respectively.
These two matrices contain thus $|H| * |H|$ and $(2 wd + 1) N * |H|$ parameters, respectively.
Using the same notation and the same settings as above, in the hidden layer of LSTM and GRU we have the following number of parameters:
{\centering
$\{4 (|H| * |H| + |U| * (2 d_w + 1) N)\}_{H^{\text{LSTM}}}$
}
{\centering
$\{3 (|H| * |H| + |U| * (2 d_w + 1) N)\}_{H^{\text{GRU}}}$
}
The $3$ for GRU reflects the fact that this network uses only $2$ gates and a \textit{cell state}.
It should be pointed out, however, that while we have been testing LSTM and GRU with a word window for a matter of fair comparison\footnote{Indeed we observed better performances when using a word window with respect to when using a single word}, these layers are applied on the current word and the previous hidden layer only, without the need of a word window. This is because this layer learns automatically how to use previous word information.
In such case the complexity of the LSTM layer reduces to $\{4 (|H| * |H| + |U| * N)\}_{H^{\text{LSTM}}}$.
If we choose $|U| = |H|$, such complexity is comparable to that of \emph{LD-RNN} in terms of number of parameters (slightly less actually). The LSTM is still more complex however because the hidden layer computation requires $4$ gates and the cell state ($\mathbf{\hat{c_t}}$) computations (each involving $2$ matrix multiplications), the update of the new cell state $\mathbf{c_t}$ (involving also $2$ matrix multiplications), and only after the hidden state can be computed.
\emph{LD-RNN}'s hidden state, in contrast, requires only matrix rows selection and concatenation to compute $\mathbf{I_t}$ and $\mathbf{L_t}$, which are very efficient operations, and then the hidden state can already be computed.
As consequence, while the variant of RNN we propose in this paper is more complex than simple RNNs,
LSTM and GRU RNNs are by far the most complex networks.
\subsection{\textit{Forward}, \textit{Backward} and Bidirectional Networks}
\label{subsec:bidir}
The RNNs introduced in this paper are proposed as forward, backward and bidirectional models \cite{Schuster-1997-BRNN}.
The forward model is what has been described so far.
The architecture of the backward model is exactly the same,
the only difference is that the backward model processes data from the end to the begin of sequences. Labels and hidden layers computed by the backward model can thus be used as future context in a bidirectional model.
Bidirectional models are described in details in \cite{Schuster-1997-BRNN}.
In this paper we utilize the version using separate forward and backward models.
The final output is computed as the geometric mean of the output of the two individual models, that is:
{\centering
$\mathbf{y_t} = \sqrt{\mathbf{y_t^f} \odot \mathbf{y_t^b}}$
}
where $\mathbf{y_t^f}$ and $\mathbf{y_t^b}$ are the output of the forward and backward models, respectively.
In the development phase of our systems, we noticed no difference in terms of performance between the two types of bidirectional models described in \cite{Schuster-1997-BRNN}. We chose thus the version described above, since it allows to initialize all the parameters with the forward and backward models previously trained.
As consequence the bidirectional model is very close to a very good optimum since the first learning iteration, and very few iterations are needed to learn the final model.
\section{Evaluation}
\label{sec:Eval}
\subsection{Corpora for Spoken Language Understanding}
\label{subsec:Corpora}
We evaluated our models on two tasks of Spoken Language Understanding (SLU) \cite{demori08-SPM}:
\textbf{The ATIS corpus} (\textit{Air Travel Information System}) \cite{Dahl-1994-ESA-1075812.1075823} was collected for building a spoken dialog system able to provide flight information in the United States.
ATIS is a simple task dating from $1993$.
Training data are made of $4978$ sentences chosen among dependency-free sentences in the \texttt{ATIS-2} and \texttt{ATIS-3} corpora.
The test set is made of $893$ sentences taken from the \texttt{ATIS-3} \texttt{NOV93} and \texttt{DEC94} data.
Since there are not official development data, we taken a part of the training set for this purpose.
The word and label dictionaries contain $1117$ and $85$ items, respectively.
We use the version of the corpus published in \cite{raymond07-luna},
where some word classes are available, such as city names, airport names, time expressions etc.
These classes can be used as features to improve the generalization of the model on rare or unseen words.
More details about this corpus can be found in \cite{Dahl-1994-ESA-1075812.1075823}.
An example of utterance transcription taken from this corpus is \textit{``I want all the flights from Boston to Philadelphia today''}.
The words \textit{Boston}, \textit{Philadelphia} and \textit{today} in the transcription are associated to the concepts \emph{DEPARTURE.CITY}, \emph{ARRIVAL.CITY} and \emph{DEPARTURE.DATE}, respectively.
All the other words don't belong to any concept, they are associated to the void concept named \emph{O} (for Outside).
This example show the simplicity of this task:
the annotation is sparse, only $3$ words of the transcription are associated to a non-void concept;
there is no segmentation problem, as each concept is associate to one word.
Because of these two characteristics, the ATIS task is similar on the one hand to a POS tagging task, where there is no segmentation of labels over multiple words; on the other hand it is similar to a linear Named Entity Recognition task, where the annotation is sparse.
We are aware of the existence of two version of the ATIS corpus:
the official version published starting from \cite{raymond07-luna},
and the version associated to the tutorial of \emph{deep learning} made available by the authors of \cite{RNNforSLU-Interspeech-2013}.\footnote{Available at http://deeplearning.net/tutorial/rnnslu.html}.
This last version has been modified, some proper nouns have been re-segmented (for example the token \textit{New-York} has been replaced by two tokens \textit{New York}), and a preprocessing has been applied to reduce the word dictionary (numbers have been converted into the conventional token \emph{DIGIT}, and singletons of the training data, as well as out-of-vocabulary words of the developpement and test data, have been converted into the token \emph{UNK}).
Following the tutorial of \cite{RNNforSLU-Interspeech-2013} we have been able to download the second version of the ATIS corpus. However in this version word classes that are available in the first version are not given.
We ran some experiments with these data, using only words as input. The results we obtained are comparable with those published in \cite{Mesnil-RNN-2015}, in part from same authors of \cite{RNNforSLU-Interspeech-2013}.
However without word classes we cannot fairly compare with works that are using them.
In this paper we thus compare only with published works that used the official version of ATIS.
\textbf{The French corpus MEDIA} \cite{Bonneau-Maynard2006-media} was collected to create and evaluate spoken dialog systems providing touristic information about hotels in France.
This corpus is made of $1250$ dialogs collected with \textit{Wizard-of-OZ} approach.
The dialogs have been manually transcribed and annotated following a rich concept ontology.
Simple semantic components can be combined to create complex semantic structures.\footnote{For example the component \emph{localization} can be combined with other components like \texttt{city}, \texttt{relative-distance}, \texttt{generic-relative-location}, \texttt{street} etc.}
The rich semantic annotation is a source of difficulties, but also the annotation of coreference phenomena.
Some words cannot be correctly annotated without knowing a relatively long context,
often going beyond a single dialog turn.
For example in the utterance transcription \textit{``Yes, the one which price is less than 50 Euros per night''}, \textit{the one} is a mention of an hotel previously introduced in the dialog.
Statistics on the corpus MEDIA are shown in table~\ref{tab:MEDIAStats}.
The task resulting from the corpus MEDIA can be modeled as a sequence labeling task by chunking the concepts over several words using the traditional \emph{BIO} notation \cite{Ramshaw95-BIO}.
Thanks to the characteristics of these two corpora, together with their relatively small size which allows training models in a reasonable time, these two tasks provide ideal settings for the evaluation of models for sequence labeling.
A comparative example of annotation, showing also the word classes available for the two tasks and mentioned above, is shown in the table~\ref{tab:ATIS-MEDIA-exemple}.
\begin{table}[t]
\centering
\scriptsize
\begin{tabular}{|ccc|ccc|}
\hline
\multicolumn{3}{|c|}{MEDIA} & \multicolumn{3}{|c|}{ATIS} \\
\textbf{Words} & \textbf{Classes} & \textbf{Labels} & \textbf{Words} & \textbf{Classes} & \textbf{Labels} \\
\hline
Oui & - & Answer-B & i'd & - & O \\
l' & - & BDObject-B & like & - & O \\
hotel & - & BDObject-I & to & - & O \\
le & - & Object-B & fly & - & O \\
prix & - & Object-I & Delta & airline & airline-name\\
à & - & Comp.-payment-B & between & - & O \\
moins & relative & Comp.-payment-I & Boston & city & fromloc.city-name\\
cinquante & tens & Paym.-amount-B & and & - & O \\
cinq & units & Paym.-amount-I & Chicago & city & toloc.city-name\\
euros & currency & Paym.-currency-B & & &\\
\hline
\end{tabular}
\caption{An example of annotated utterance transcription taken from MEDIA (left) and ATIS (right). The translation in French is \textit{``Yes, the one which price is less than 50 Euros per night''}}
\label{tab:ATIS-MEDIA-exemple}
\end{table}
\begin{table}[t]
\begin{minipage}{1.0\linewidth}
\centering
\scriptsize
\begin{tabular}{|l|rr|rr|rr|}
\hline
& \multicolumn{2}{|c|}{Training} & \multicolumn{2}{|c|}{Dev.} & \multicolumn{2}{|c|}{Test}\\
\hline
\# Sentences &\multicolumn{2}{|c|}{12,908} &\multicolumn{2}{|c|}{1,259}&\multicolumn{2}{|c|}{3,005} \\
\hline
\hline
& \multicolumn{1}{|c}{words} & \multicolumn{1}{c|}{concepts} & \multicolumn{1}{|c}{words} & \multicolumn{1}{c|}{concepts} &
\multicolumn{1}{|c}{words} & \multicolumn{1}{c|}{concepts} \\
\hline
\# mots & 94,466 & 43,078 & 10,849 & 4,705 & 25,606 & 11,383 \\
\# vocab. & 2,210 & 99 & 838 & 66 & 1,276 & 78 \\
\# OOV\% & -- & -- & 1.33 & 0.02 & 1.39 & 0.04 \\
\hline
\end{tabular}
\caption{Statistic of the corpus MEDIA}
\label{tab:MEDIAStats}
\end{minipage}
\end{table}
\subsection{Settings}
\label{subsec:Settings}
The RNN variant \emph{LD-RNN} has been implemented in \textit{Octave}\footnote{https://www.gnu.org/software/octave/; \\
Our code is described at http://www.marcodinarelli.it/software.php and available upon request.} using \textit{OpenBLAS} for low-level computations\footnote{http://www.openblas.net; This library allows a speed-up of roughly $330\times$ on a single matrix-matrix multiplication using $16$ cores. This is very attractive with respect to the speed-up of $380\times$ that can be reached with a GPU, keeping into account that both Octave and OpenBLAS are available for free.}.
\emph{LD-RNN} models are trained with the following procedure:
\begin{itemize}
\item Neural Network Language Models (NNLM), like the one described in \cite{Bengio03aneural}, are trained for words and labels to generate the embeddings (separately).
\item Forward and backward models are trained using the word and label embeddings trained at previous step.
\item The bidirectional model is trained using as starting point the forward and backward models trained at previous step.
\end{itemize}
We ran also some experiments using embeddings trained with \textit{word2vec} \cite{Word2Vec_Mikolov-2013}.
The results obtained are not significantly different from those obtained following the procedure described above.
This outcome is similar to the one obtained in \cite{Vukotic.etal_2015}. Since the tasks addressed in this paper are made of small data, we believe that any embedding is equally effective. In particular tools like \textit{word2vec} are designed to work on relatively big amount of data.
Results obtained with \textit{word2vec} embeddings will not be described in the following sections.
We roughly tuned the number of learning epochs for each model on the development data of the addressed tasks:
$30$ epochs are used to train word embeddings, $20$ for label embeddings, $30$ for the forward and backward models, $8$ for the bidirectional model (the optimum of this model is often reached at the first epoch on the ATIS task, between the 3rd and the 5th epoch on MEDIA).
At the end of the training phase, we keep the model giving the best prediction accuracy on the development data.
We stop training the model if the accuracy is not improved for $5$ consecutive epochs (also known as \textit{Early stopping} strategy \cite{PracticalRecommendations-Bengio-2012}).
We initialize all the weights with the ``so called'' \textit{Xavier initialization} \cite{PracticalRecommendations-Bengio-2012}, theoretically motivated in \cite{LeakyReLU-PReLU-2015} as keeping the standard deviation of the weights during the training phase when using \emph{ReLU}, which is the type of hidden layer unit we chose for our variant of RNN.
We also tuned some of the hyper-parameters on the development data:
we found out that the best initial learning rate is $0.5$, this is linearly decreased with a value computed as the ratio between the initial learning rate and the number of epochs (\textit{Learing Rate decay}).
We combine \textit{dropout} and $L_2$ regularization \cite{PracticalRecommendations-Bengio-2012},
the best value for the dropout probability is $0.5$ at the hidden layer, $0.2$ at the embedding layer on ATIS, $0.15$ on MEDIA. The best coefficient ($\lambda$) for the $L_2$ regularization is $0.01$ for all the models, except for the bidirectional model where the best is $3e^{-4}$.
We ran also some experiments for optimizing the size of the different layers.
In order to minimize the time and the number of experiments, this optimization has been based on the result provided by the forward model on the two tasks, and using only words and labels as input (without word classes and character convolution, which were optimized separately).
The best size for the embeddings and the hidden layer is $200$ for both tasks.
The best size for the character convolution layer is $50$ on ATIS, $80$ on MEDIA.
In both cases, the best size for the convolution window is $1$, meaning that characters are used individually as input to the convolution.
A window of size $3$ (one character on the left, one on the right, plus the current character) gives roughly the same results, we thus prefer the simpler model.
With a window of size $5$, results starts to slightly deteriorate.
We also optimized the size of the word and label context used in the \emph{LD-RNN} variant.
On ATIS the best word context size is $11$ ($5$ on the lest, $5$ on the right plus the current word), the best label context size is $5$. On MEDIA the best sizes are $7$ and $5$ respectively.
These values are the same found in \cite{Vukotic.etal_2015} and comparable to those of \cite{Mesnil-RNN-2015}.
The best parameters found in this phase has been used to obtain \textit{baseline} models.
The goal was to understand the behavior of the models with the different level of information used:
the word classes available for the tasks, and the character level convolution.
Some parameters needed to be re-tuned, as we will describe later on.
Concerning training and testing time of our models,
the overall time to train and test \textit{forward}, \textit{backward} and bidirectional models,
using only words and classes as input, is roughly $1$ hour $10$ minutes on MEDIA, $40$ minutes on ATIS.
These times go to $2$ hours for MEDIA and $2$ hours $10$ minutes for ATIS, using also word classes and character convolution as input.
All these times are measured on a \emph{Intel Xeon E5-2620} at $2.1$ \emph{GHz}, using $16$ cores.
\vspace{-0.8em}
\subsection{Results}
\label{subsec:Results}
All the results shown in this section are averages over $6$ runs.
Embeddings were learned once for all experiments.
\subsubsection{Incremental Results with Different Level of Information}
In this section we describe results obtained with incremental levels of information given as input to the models:
i) Only words (previous labels are always given as input), indicated with \emph{Words} in the tables; ii) words and classes \emph{Words+Classes}; iii) words and character convolution \emph{Words+CC}; iv) All possible inputs \emph{Words+Classes+CC}.
The results obtained on the ATIS task are shown in the table~\ref{tab:SLUATIS-Incremental},
results on MEDIA are in table~\ref{tab:SLUMEDIA-Incremental}.
\begin{table}[!]
\centering
\scriptsize
\begin{tabular}{|l|r|r|r|}
\hline
Model & \multicolumn{3}{c|}{F1 measure} \\
\hline
\hline
& \textit{forward} & \textit{backward} & bidirectional \\
\hline
\emph{LD-RNN} Words & 94.23\% & 94.30\% & 94.45\% \\
\emph{LD-RNN} Words+CC & 94.56\% & 94.69\% & 94.79\% \\
\emph{LD-RNN} Words+Classes & 95.31\% & 95.42\% & 95.53\% \\
\emph{LD-RNN} Words+Classes+CC & \textbf{95.55\%} & \textbf{95.45\%} & \textbf{95.65\%} \\
\hline
\end{tabular}
\caption{Results in terms of F1 measure on ATIS, using different level of information as input.}
\label{tab:SLUATIS-Incremental}
\vspace{-1.8em}
\end{table}
\begin{table}[!]
\centering
\scriptsize
\begin{tabular}{|l|r|r|r|}
\hline
Model & \multicolumn{3}{c|}{F1 measure} \\
\hline
\hline
& \textit{forward} & \textit{backward} & bidirectional \\
\hline
\emph{LD-RNN} Words & 85.39\% & 86.54\% & 87.05\% \\
\emph{LD-RNN} Words+CC & 85.41\% & 86.48\% & 86.98\% \\
\emph{LD-RNN} Words+Classes & \textbf{85.46\%} & 86.59\% & 87.16\% \\
\emph{LD-RNN} Words+Classes+CC & 85.38\% & \textbf{86.79\%} & \textbf{87.22\%} \\
\hline
\end{tabular}
\caption{Results in terms of F1 measure on MEDIA, using different level of information as input.}
\label{tab:SLUMEDIA-Incremental}
\vspace{-1.8em}
\end{table}
Results in these tables show that models have a similar behavior on the two tasks.
In particular on ATIS, adding the different level of information results improve progressively and the best performance is obtained integrating words, labels and character convolution,
though some of the improvements do not seem statistically significant, taking into account the small size of this corpus.
This observation is confirmed by results obtained on MEDIA, where adding the character level convolution leads to a slight degradation of performances.
In order to understand the reason of this behavior we analyzed the training phase on the two tasks.
We found out that the main problem was an hidden layer saturation: with the number of hidden neurons chosen in the preliminary optimization phase using only words (and labels), the hidden layer was not able to model the whole information richness provided by all the inputs at the same time.
We ran thus some experiments using a larger hidden layer with size $256$,
which gave the results shown in the two tables with the model \emph{LD-RNN Words+Classes+CC}.
For lack of time we did not further optimized the size of the hidden layer.
Beyond all of that, results shown in the table~\ref{tab:SLUATIS-Incremental} and \ref{tab:SLUMEDIA-Incremental} are very competitive, as we will discuss in the next section.
\subsubsection{Comparison with the State-of-the-Art}
\label{subsubsec:Comparison}
In this section we compare our results with the best results found in the literature.
In order to be fair, the comparison is made using the same input information: words and classes.
In the tables we use \emph{E-RNN} for Elman RNN, \emph{J-RNN} for Jordan RNN, \emph{I-RNN} for the improved RNN proposed by \cite{DinarelliTellier-RNN-TALN2016}.\footnote{This is a publication in French, but results in the tables are easy to understand and directly comparable to our results.}
In order to give an idea of how our RNN variant compares to \textit{LSTM+CRF} models like the one of \cite{Ma-Hovy-ACL-2016}, we ran an experiment on the Penn Treebank \cite{Marcus93buildinga}.
With a similar data pre-processing, exactly the same data split, using a \textit{sigmoid} activation function, and using only words as input, the \emph{LD-RNN} variant achieves an accuracy of $96.83$.
This is comparable to the $96.9$ achieved by the \textit{LSTM+CRF} model of \cite{Ma-Hovy-ACL-2016} without pre-trained embeddings.\footnote{We did not run further experiments because without a GPU, experiments on the Penn Treebank are still quite expensive.}
Results on the ATIS task are shown in table~\ref{tab:SLUATIS}.
On this task we compare to results published in \cite{Vukotic.etal_2016} and \cite{DinarelliTellier-RNN-TALN2016}.
The results in the table~\ref{tab:SLUATIS} show that all models obtain a good performance on this task,
always higher than $94.5$ $F1$. This confirm what we anticipated in the previous section concerning how easy is this task.
The GRU RNNs of \cite{Vukotic.etal_2016} and our variant \emph{LD-RNN} obtain equivalent results ($95.53$), which is slightly better than all the other models, in particular with the bidirectional models.
This is a good outcome, as our variant of RNN obtains the same result as GRU while using much less parameters (see section~\ref{subsec:Complexity} for RNNs complexity).
Indeed LSTM and GRU are considered very effective models for learning very long contexts.
The way they are used in \cite{Vukotic.etal_2016} allows to learn long contexts on the input side (words), they are not adapted however to learn also long label contexts, which is what we do in this paper with our variant.
The fact that the best word context on this task is made of $11$ words, show that this is the most important information to obtain good results on this task. It is thus not surprising that the GRU RNN achieves such good performance.
Comparing our results on the ATIS task with those published in \cite{DinarelliTellier-RNN-TALN2016} with a Jordan RNN, which uses the same label context as our models, we can conclude that the advantage in the variant \emph{LD-RNN} is given by the use of label embeddings and their combination at the hidden layer.
\begin{table}[!]
\centering
\scriptsize
\begin{tabular}{|l|r|r|r|}
\hline
Model & \multicolumn{3}{c|}{F1 measure} \\
\hline
\hline
& \textit{forward} & \textit{backward} & bidirectional \\
\hline
\cite{Vukotic.etal_2016} LSTM & 95.12\% & -- & 95.23\% \\
\cite{Vukotic.etal_2016} GRU & \textbf{95.43\%} & -- & \textbf{95.53\%} \\
\hline
\cite{DinarelliTellier-RNN-TALN2016} E-RNN & 94.73\% & 93.61\% & 94.71\% \\
\cite{DinarelliTellier-RNN-TALN2016} J-RNN & 94.94\% & 94.80\% & 94.89\% \\
\cite{DinarelliTellier-RNN-TALN2016} I-RNN & 95.21\% & 94.64\% & 94.75\% \\
\hline
\emph{LD-RNN} Words+Classes & 95.31\% & 95.42\% & \textbf{95.53\%} \\
\hline
\end{tabular}
\caption{Comparison of our results on the ATIS task with the literature, in terms of F1 measure.}
\label{tab:SLUATIS}
\vspace{-1.8em}
\end{table}
\begin{table}[!]
\centering
\scriptsize
\begin{tabular}{|l|r|r|r|}
\hline
Model & \multicolumn{3}{c|}{F1 measure} \\
\hline
\hline
& \textit{forward} & \textit{backward} & bidirectional \\
\hline
\cite{Vukotic.etal_2015} CRF & \multicolumn{3}{c|}{86.00\%} \\
\hline
\cite{Vukotic.etal_2015} E-RNN & 81.94\% & -- & -- \\
\cite{Vukotic.etal_2015} J-RNN & 83.25\% & -- & -- \\
\hline
\cite{Vukotic.etal_2016} LSTM & 81.54\% & -- & 83.07\% \\
\cite{Vukotic.etal_2016} GRU & 83.18\% & -- & 83.63\% \\
\hline
\cite{DinarelliTellier-RNN-TALN2016} E-RNN & 82.64\% & 82.61\% & 83.13\% \\
\cite{DinarelliTellier-RNN-TALN2016} J-RNN & 83.06\% & 83.74\% & 84.29\% \\
\cite{DinarelliTellier-RNN-TALN2016} I-RNN & 84.91\% & 86.28\% & 86.71\% \\
\hline
\emph{LD-RNN} Words+Classes & \textbf{85.46\%} & \textbf{86.59\%} & \textbf{87.16\%} \\
\hline
\end{tabular}
\caption{Comparison of our results on the MEDIA task with the literature, in terms of F1 measure.}
\label{tab:SLUMEDIA}
\vspace{-1.8em}
\end{table}
This conclusion is more evident if we compare results obtained with RNNs using label embeddings with the other RNNs on the MEDIA task.
This comparison is shown in table~\ref{tab:SLUMEDIA}.
As we mentioned in the section~\ref{subsec:Corpora}, this task is very challenging for several reason,
but in the context of this paper we focus on the label dependencies that we claim we can effectively model with our RNN variant.
In this context we note that a traditional Jordan RNN, the \emph{J-RNN} of \cite{DinarelliTellier-RNN-TALN2016},
which is the only traditional model to explicitly use previous label information as context, is more effective than the other traditional models, including LSTM and GRU ($84.29$ F1 with J-RNN, $83.63$ with GRU, second best model among traditional RNNs).
We note also that on MEDIA, CRFs, which are models specifically designed for sequence labeling, are by far more effective than the traditional RNNs ($86.00$ F1 with the CRF of \cite{Vukotic.etal_2015}).
The only models outperforming CRFs on the MEDIA task are the \emph{I-RNN} model of \cite{DinarelliTellier-RNN-TALN2016} and our \emph{LD-RNN} variant, both using label embeddings.
\begin{table}[!]
\centering
\scriptsize
\begin{tabular}{|l|r|}
\hline
Model & CER \\
\hline
\cite{Dinarelli.etAl-SLU-RR-2011} CRF & 11.7\% \\
\cite{dinarelli2011-emnlp} CRF & 11.5\% \\
\cite{Hahn.etAL-SLUJournal-2010} CRF & 10.6\% \\
\hline
\emph{LD-RNN} Words & 10.73\% (10.63) \\
\emph{LD-RNN} Words+Classes & 10.52\% (10.15) \\
\emph{LD-RNN} Words+Classes+CC & \textbf{10.41\% (10.09)} \\
\hline
\end{tabular}
\caption{\small{Results on the MEDIA task in terms of \emph{Concept Error Rate} (CER), compared with the best results published so far on this task.}}
\label{tab:SLUMEDIA-CER}
\vspace{-1.8em}
\end{table}
Even if results on MEDIA discussed so far are very competitive,
this task has been designed for Spoken Language Understanding (SLU) \cite{demori08-SPM}.
In SLU the goal is to extract a correct semantic representation of a sentence, allowing a correct interpretation of the user will by the spoken dialog system.
While the F1 measure is strongly correlated with SLU evaluation metrics, the evaluation measure used most often in the literature is the \emph{Concept Error Rate} (CER). CER is defined exactly in the same way as \emph{Word Error rate} in automatic speech recognition, where words are replaced by concepts.\footnote{The errors made by the system are classified as Insertions (I), Deletions (D) and Substitutions (S). The sum of these errors is divided by the number of concepts in the reference annotation (R): $CER = \frac{I + D + S}{R}$.}
In order to place our results on an absolute ranking among models designed for the MEDIA task,
we propose a comparison in terms of CER to the best models published in the literature,
namely \cite{Hahn.etAL-SLUJournal-2010}, \cite{dinarelli2011-emnlp} and \cite{Dinarelli.etAl-SLU-RR-2011}.
This comparison is shown in table~\ref{tab:SLUMEDIA-CER}.
The best individual models published by \cite{Hahn.etAL-SLUJournal-2010}, \cite{dinarelli2011-emnlp} and \cite{Dinarelli.etAl-SLU-RR-2011} are CRFs, achieving a CER of $10.6$, $11.5$ and $11.7$, respectively.
These models use both word and classes, and a rich set of lexical features such like word prefixes, suffixes, word capitalization information etc.
We note that the large gap between these CRF models is due to the fact that the CRF of \cite{Hahn.etAL-SLUJournal-2010} is trained with an improved margin criterion, similar to the large margin principle of \emph{SVM} \cite{Herbrich.etAL-LargeMargin-2000,hahn09-Interspeech}.
We note also that comparing significance tests published in \cite{Dinarelli.etAl-SLU-RR-2011}, a difference of $0.1$ in CER is already statistically significant. Since results in this paper are higher, we hypothesize than even smaller gains are significant.
Our best \emph{LD-RNN} model achieve a CER of $10.41$.
To the best of our knowledge this is the best CER obtained on the MEDIA task with an individual model.
Moreover, instead of taking the mean of CER of several experiments, following a strategy similar to \cite{RNNforLU-Interspeech-2013}, one can run several experiments and keep the model obtaining the best CER on the development data of the target task.
Results obtained using this strategy are shown in table~\ref{tab:SLUMEDIA-CER} between parenthesis.
The best result obtained by our \emph{LD-RNN} is a CER of $10.09$, the best absolute result on this task so far, even better than the \emph{ROVER} model \cite{fiscus97-rover} used in \cite{Hahn.etAL-SLUJournal-2010},
which combines $6$ individual models, including the individual CRF model achieving $10.6$ CER.
\vspace{-0.8em}
\subsection{Results Discussion}
\label{subsec:Analyses}
In order to understand the high performances of the \emph{LD-RNN} variant on the MEDIA task,
we made some simple analyses on the model output,
comparing them to the output of a Jordan RNN trained with our own system in the same conditions as \emph{LD-RNN} models.
The main difference between these two models is the general tendency of the Jordan RNN to split a single concept into two or more concepts, mainly for concepts instantiated by long surface forms, such like \textit{command-tache}.
This concept is used to mean the general user will in a dialog turn (e.g. \textit{Hotel reservation}, \textit{Price information} etc.). The Jordan RNN often split this concept into several concepts by introducing a void label, associated to a stop-word.
This is due to the limitation of this model to take relatively long label context into account, even if it is the only traditional RNN using explicitly previous labels as context information.
Surprisingly, \emph{LD-RNN} never makes this mistake and in general never makes segmentation errors (concerning the BIO formalism). This can be due to two reasons. The first is that label embeddings learns similar representations for semantically similar labels. This allows the model to correctly predict start-of-concept (B) even if the target word has been seen in the training set only as continuation-of-concept (I), or viceversa, as the two labels acquire very similar representations. The second reason, which is not in mutual exclusion with the first, is that the model factorizes information acquired on similar words seen associated to start-of-concept labels. Thus if a word has not been seen associated to start-of-concept labels, but similar words do, the model is still able to provide the correct annotation. This second reason is what made neural networks popular for learning word embeddings in earlier publications \cite{Bengio03aneural}.
In any case, in our experience, we never observed such precise behavior even with CRF models tuned for the MEDIA task.
For this reason we believe \emph{LD-RNN} deserves the name of \emph{Label Dependencies aware} RNN.
Still \emph{LD-RNN} makes mistakes, which means that once a label annotation starts for a target word, even if the label is not the correct one, the same label is kept even if the following words provide evidence that the correct label is another one. \emph{LD-RNN} tends to be coherent with previous labeling decisions. This behavior is due to the use of a local decision function which definitely relies heavily on the label embedding context, but it doesn't prevent the model from being very effective.
Interestingly, this behavior suggests that \emph{LD-RNN} could still benefit from a CRF neural layer like those used in \cite{huang2015bidirectional,lample2016neural,Ma-Hovy-ACL-2016}. We leave this as future work.
\vspace{-0.8em}
\section{Conclusion}
\label{sec:Conclusions}
In this paper we proposed a new variant of RNN for sequence labeling using a wide context of label embeddings in addition to the word context to predict the next label in a sequence.
We motivated our variant as being more effective at modeling label dependencies.
Results on two Spoken Language Understanding tasks show that i) on a simple task like ATIS our variant achieves the same performance as much more complex models such as LSTM and GRU, which are claimed the most effective RNNs; ii) on the MEDIA task, where modeling label dependencies is crucial, our variant outperforms by a large margin all the other RNNs, including LSTM and GRU.
When compared to the best models of the literature in terms of Concept Error Rate (CER),
our RNN variant results to be more effective, achieving a state-of-the-art CER of $10.09$.
\section{Acknowledgements}
This work has been partially funded by the French ANR project Democrat ANR-15-CE38-0008.
\bibliographystyle{splncs}
| {'timestamp': '2017-06-07T02:06:22', 'yymm': '1706', 'arxiv_id': '1706.01740', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01740'} | arxiv |
\section{Introduction}\label{section:Introduction}
\indent \myparagraph{Subspace Clustering} Over the past fifteen years the model of a union of linear subspaces, also called a \emph{subspace arrangement} \citep{Derksen:JPAA07}, has gained significant popularity in pattern recognition and computer vision \citep{Vidal:SPM11-SC}, often replacing the classical model of a single linear subspace, associated to the well-known Principal Component Analysis (PCA) \citep{Hotelling-1933,Pearson-1901,Jolliffe-2002}. This has led
to a variety of algorithms that attempt to cluster a collection of data drawn from a subspace arrangement, giving rise to the challenging field of subspace clustering \citep{Vidal:SPM11-SC}. Such techniques can be iterative \citep{Bradley:JGO00,Tseng:JOTA00,Zhang:WSM09}, statistical \citep{Tipping-mixtures:99,Gruber-Weiss:CVPR04}, information-theoretic \citep{Ma:PAMI07}, algebraic \citep{Vidal:CVPR03-gpca,Vidal:PAMI05,Tsakiris:SIAM17}, spectral \citep{Boult:WMU91,Costeira:IJCV98,Kanatani:ICCV01,Chen:IJCV09}, or based on sparse \citep{Elhamifar:CVPR09,Elhamifar:ICASSP10,Elhamifar:TPAMI13} and low-rank \citep{Liu:ICML10,Favaro:CVPR11,Liu:TPAMI13,Vidal:PRL14} representation theory.
\indent \myparagraph{Hyperplane Clustering} A special class of subspace clustering is that of \emph{hyperplane clustering}, which arises when the data are drawn from a union of hyperplanes, i.e., a
\emph{hyperplane arrangement}. Prominent applications include projective motion segmentation \citep{Vidal:IJCV06-multibody,Vidal:PAMI08}, 3D point cloud analysis \citep{Sampath:2010segmentation} and hybrid system identification \citep{Bako:Automatica11,Ma-Vidal:HSCC05}. Even though in some ways hyperplane clustering is simpler than general subspace clustering, since, e.g., the dimensions of the subspaces are equal and known a-priori, modern \emph{self-expressiveness-based} subspace clustering methods, such as \cite{Liu:TPAMI13,Lu:ECCV12,Elhamifar:TPAMI13}, in principle do not apply in this case, because they require small \emph{relative} subspace dimensions. \footnote{The relative dimension of a linear subspace is the ratio $d/D$, where $d$ is the dimension of the subspace and $D$ is the ambient dimension.}
From a theoretical point of view, one of the most appropriate methods for hyperplane clustering is Algebraic Subspace Clustering (ASC) \citep{Vidal:CVPR03-gpca,Vidal:PAMI05,Vidal:IJCV08,Tsakiris:Asilomar14,Tsakiris:FSASCICCV15,Tsakiris:SIAM17,Tsakiris:AffinePAMI17}, which gives closed-form solutions by means of factorization \citep{Vidal:CVPR03-gpca} or differentiation \citep{Vidal:PAMI05} of polynomials. However, the main drawback of ASC is its exponential complexity\footnote{The issue of robustness to noise for ASC has been recently addressed in \cite{Tsakiris:FSASCICCV15,Tsakiris:SIAM17}.} in the number $n$ of hyperplanes and the ambient dimension $D$, which makes it impractical in many settings. Another method that is theoretically justifiable for clustering hyperplanes is Spectral Curvature Clustering (SCC) \citep{Chen:IJCV09}, which is based on computing a $D$-fold affinity between all $D$-tuples of points in the dataset. As in the case of ASC, SCC is characterized by combinatorial complexity and becomes cumbersome for large $D$; even though it is possible to reduce its complexity, this comes at the cost of significant performance degradation. On the other hand, the intuitive classical method of $K$-hyperplanes (KH) \citep{Bradley:JGO00}, which alternates between assigning clusters and fitting a new normal vector to each cluster with PCA, is perhaps the most practical method for hyperplane clustering, since it is simple to implement, it is robust to noise and its complexity depends on the maximal allowed number of iterations. However, KH is sensitive to outliers and is guaranteed to converge only to a local minimum; hence multiple restarts are in general required. Median $K$-Flats (MKF) \citep{Zhang:WSM09} shares a similar objective function as KH, but uses the $\ell_1$-norm instead of the $\ell_2$-norm, in an attempt to gain robustness to outliers. MKF minimizes its objective function via a stochastic gradient descent scheme, and searches directly for a basis of each subspace, which makes it slower to converge for hyperplanes. Finally, we note that any single subspace learning method, such as RANSAC \citep{RANSAC} or REAPER \citep{Lerman:FCM15}, can be applied in a sequential fashion to learn a union of hyperplanes, by first learning the first dominant hyperplane, then removing the points lying close to it, then learning a second dominant hyperplane, and so on.
\indent \myparagraph{DPCP: A single subspace method for high relative dimensions} Recently, an $\ell_1$ method was introduced in the context of single subspace learning with outliers, called Dual Principal Component Pursuit (DPCP) \citep{Tsakiris:DPCPICCV15,Tsakiris:DPCP-ArXiv17}, which aims at recovering the orthogonal complement of a subspace in the presence of outliers. Since the orthogonal complement of a hyperplane is one-dimensional, DPCP is particularly suited for hyperplanes. DPCP searches for the normal to a hyperplane by solving a non-convex $\ell_1$ minimization problem on the sphere, or alternatively a recursion of linear programming relaxations. Assuming the dataset is normalized to unit $\ell_2$-norm and consists of points uniformly distributed on the great circle defined by a hyperplane (inliers), together with arbitrary points uniformly distributed on the sphere (outliers), \cite{Tsakiris:DPCPICCV15,Tsakiris:DPCP-ArXiv17} gave conditions under which the normal to the hyperplane is the unique global solution to the non-convex $\ell_1$ problem, as well as the limit point of a recursion of linear programming relaxations, the latter being reached after a finite number of iterations.
\indent \myparagraph{Contributions} Motivated by the robustness of DPCP to outliers--DPCP was shown to be the only method capable of recovering the normal to the hyperplane in the presence of about $70\%$ outliers inside a $30$-dimensional ambient space \footnote{We note that the problem of robust PCA or subspace clustering for subspaces of large relative dimension becomes very challenging as the ambient dimension increases; see Section \ref{subsection:ExperimentsSynthetic}.} --one could naively use it for hyperplane clustering by recovering
the normal to a hyperplane one at a time, while treating points from other hyperplanes as outliers. However, such a scheme is not a-priori guaranteed to succeed, since the outliers are now clearly structured, contrary to the theorems of correctness of \cite{Tsakiris:DPCPICCV15,Tsakiris:DPCP-ArXiv17} that assume that the outliers are uniformly distributed on the sphere. It is precisely this theoretical gap that we bridge in this paper: we show that as long as the hyperplanes are sufficiently separated, the dominant hyperplane is sufficiently dominant and the points are uniformly distributed (in a deterministic sense) inside their associated hyperplanes, then the non-convex DPCP problem has a unique (up to sign) global solution, equal to the normal vector of the dominant hyperplane. This suggests a sequential
hyperplane learning algorithm, which first learns the dominant hyperplane, and weights all points according to their distance to that hyperplane. Then DPCP applied on the weighted data yields the second dominant hyperplane, and so on. Experiments on
corrupted synthetic data show that this DPCP-based sequential algorithm dramatically improves over similar sequential algorithms, which learn the dominant hyperplane via state-of-the-art single subspace learning methods (e.g., with RANSAC). Finally, 3D plane clustering experiments on real 3D point clouds show that a K-Hyperplanes DPCP-based scheme, which computes the normal vector of each cluster via DPCP, instead of the classic SVD, is very competitive to state-of-the-art approaches (e.g., RANSAC or SVD-based K-Hyperplanes).
\indent \myparagraph{Notation} For a positive integer $n$, $[n]:=\left\{1,\dots,n\right\}$. For a vector $\boldsymbol{w} \in \mathbb{R}^D$ we let $\hat{\boldsymbol{w}} = \boldsymbol{w} / \left\| \boldsymbol{w} \right\|_2$ if $\boldsymbol{w} \neq \boldsymbol{0}$, and $\hat{\boldsymbol{w}}=\boldsymbol{0}$ otherwise. $\mathbb{S}^{D-1}$ is the unit sphere of $\mathbb{R}^D$. For two vectors $\boldsymbol{w}_1,\boldsymbol{w}_2 \in \mathbb{S}^{D-1}$, the \emph{principal angle} between $\boldsymbol{w}_1$ and $\boldsymbol{w}_2$ is the unique angle $\theta \in [0,\pi/2]$ with $\cos(\theta) = |\boldsymbol{w}_1^\top \boldsymbol{w}_2|$. $\boldsymbol{1}$ denotes the vector of all ones, LHS stands for \emph{left-hand-side} and RHS stands for \emph{right-hand-side}. Finally, for a set $\boldsymbol{\mathcal{X}}$ we denote by $\Card(\boldsymbol{\mathcal{X}})$ the cardinality of $\boldsymbol{\mathcal{X}}$.
\indent \myparagraph{Paper Organization}
The rest of the paper is organized as follows. In \S \ref{section:PriorArt} we review the prior-art in generic hyperplane clustering. In \S \ref{section:TheoreticalContributions} we discuss the theoretical contributions of this paper; proofs are given in \S \ref{section:Proofs}. \S \ref{section:Algorithms} describes the algorithmic contributions of this paper, and \S \ref{section:Experiments} contains experimental evaluations of the proposed methods.
\section{Prior Art} \label{section:PriorArt}
Suppose given a dataset $\boldsymbol{\mathcal{X}} = [\boldsymbol{x}_1,\dots, \boldsymbol{x}_N ]$ of $N$ points of $\mathbb{R}^D$,
such that $N_i$ points of $\boldsymbol{\mathcal{X}}$, say $\boldsymbol{\mathcal{X}}_i \in \mathbb{R}^{D \times N_i}$, lie close to a hyperplane $\mathcal{H}_i = \left\{\boldsymbol{x}: \, \boldsymbol{b}_i^\top \boldsymbol{x} = 0 \right\}$, where $\boldsymbol{b}_i$ is the normal vector to the hyperplane. Then the goal of hyperplane clustering is to identify the underlying hyperplane arrangement $\bigcup_{i=1}^n \mathcal{H}_i$ and cluster the dataset $\boldsymbol{\mathcal{X}}$ to the subsets (clusters) $\boldsymbol{\mathcal{X}}_1,\dots,\boldsymbol{\mathcal{X}}_n$.\footnote{We are assuming here that there is a unique hyperplane arrangement associated to the data $\boldsymbol{\mathcal{X}}$, for more details see \S \ref{subsection:DataModel}.}
\indent \myparagraph{RANSAC} A traditional way of clustering points lying close to a hyperplane arrangement is by means of the \emph{RANdom SAmpling Consensus} algorithm (RANSAC) \citep{RANSAC}, which attempts to identify a single hyperplane $\mathcal{H}_i$ at a time. More specifically, RANSAC alternates between randomly selecting $D-1$ points from $\boldsymbol{\mathcal{X}}$ and counting the number of points in the dataset that are within distance $\delta$ from the hyperplane generated by the selected $D-1$ points. After a certain number of trials is reached, a first hyperplane $\hat{\mathcal{H}}_1$ is selected as the one that admits the largest number of points in the dataset within distance $\delta$. These points are then removed and a second hyperplane $\hat{\mathcal{H}}_2$ is obtained from the reduced dataset in a similar fashion, and so on. Naturally, RANSAC is sensitive to the thresholding parameter $\delta$. In addition, its efficiency depends on how big the probability is, that $D-1$ randomly selected points lie close to the same underlying hyperplane $\mathcal{H}_i$, for some $i \in [n]$. This probability depends on how large $D$ is as well as how balanced or unbalanced the clusters are. If $D$ is small, then RANSAC is likely to succeed with few trials. The same is true if one of the clusters, say $\boldsymbol{\mathcal{X}}_1$, is highly dominant, i.e., $N_1 >> N_i, \, \forall i \ge 2$, since in such a case, identifying $\mathcal{H}_1$ is likely to be achieved with only a few trials. On the other hand, if $D$ is large and the $N_i$ are of the same order of magnitude, then exponentially many trials are required (see \S \ref{section:Experiments} for some numerical results), and RANSAC becomes inefficient.
\indent \myparagraph{K-Hyperplanes (KH)} Another very popular method for hyperplane clustering is the so-called
$K$-hyperplanes (KH), which was proposed by \cite{Bradley:JGO00}. KH attempts to minimize the non-convex objective function
\begin{align}
\mathcal{J}_{\text{KH}}(\boldsymbol{f}_1,\dots,\boldsymbol{f}_n;s_1,\dots,s_N):= \sum_{i=1}^n \left[\sum_{j=1}^N s_j(i) \left(\boldsymbol{f}_{i}^\top \boldsymbol{x}_j\right)^2 \right], \label{eq:KH}
\end{align} where $s_j : [n] \rightarrow \left\{0,1\right\}$ is the hyperplane assignment of point $\boldsymbol{x}_j$, i.e., $s_j(i)=1$ if and only if point $\boldsymbol{x}_j$ has been assigned to hyperplane $i$, and $\boldsymbol{f}_i \in \mathbb{S}^{D-1}$ is the normal vector to the estimated $i$-th hyperplane. Because of the non-convexity of \eqref{eq:KH}, the typical way to perform the optimization is by alternating between assigning clusters, i.e., given the $\boldsymbol{f}_i$ assigning $\boldsymbol{x}_j$ to its closest hyperplane (in the euclidean sense), and fitting hyperplanes, i.e., given the segmentation $\left\{s_j\right\}$, computing the best $\ell_2$ hyperplane for each cluster by means of PCA on each cluster. Because of this iterative refinement of hyperplanes and clusters, this method is sometimes also called \emph{Iterative Hyperplane Learning (IHL)}. The theoretical guarantees of KH are limited to convergence to a local minimum in a finite number of steps. Even though the alternating minimization in KH is computationally efficient, in practice several restarts are typically used, in order to select the best among multiple local minima. In fact, the higher the ambient dimension $D$ is the more restarts are required, which significantly increases the computational burden of KH. Moreover, KH is robust to noise but not to outliers, since the update of the normal vectors is done by means of standard ($\ell_2$-based) PCA.
\indent \myparagraph{Median K Flats (MKF)} It is precisely the sensitivity to outliers of KH that \emph{Median K Flats} (MKF) or \emph{Median K Hyperplanes} \citep{Zhang:WSM09} attempts to address, by minimizing the non-convex and non-smooth objective function
\begin{align}
\mathcal{J}_{\text{MKF}}(\boldsymbol{f}_1,\dots,\boldsymbol{f}_n;s_1,\dots,s_N):= \sum_{i=1}^n \left[\sum_{j=1}^N s_j(i) \left|\boldsymbol{f}_{i}^\top \boldsymbol{x}_j\right| \right]. \label{eq:MKF}
\end{align} Notice that \eqref{eq:MKF} is almost identical to
the objective \eqref{eq:KH} of KH, except that the distances of the points to their assigned hyperplanes now appear without the square. This makes the optimization problem harder, and \cite{Zhang:WSM09} propose to solve it by means of a stochastic gradient approach, which requires multiple restarts, as KH does. Even though conceptually MKF is expected to be more robust to outliers than KH, we are not aware of any theoretical guarantees surrounding MKF that corroborate this intuition. Moreover, MKF is considerably slower than KH, since MKF searches directly for a basis of the hyperplanes, rather than the normals to the hyperplanes. We note here that MKF was not designed specifically for hyperplanes, rather for the more general case of unions of equi-dimensional subspaces. In addition, it is not trivial to adjust MKF to search for the orthogonal complement of the subspaces, which would be the efficient approach for hyperplanes.
\indent\myparagraph{Algebraic Subspace Clustering (ASC)} ASC was originally proposed in \cite{Vidal:CVPR03-gpca} precisely for the purpose of provably clustering hyperplanes, a problem which at the time was handled either by the intuitive RANSAC or K-Hyperplanes. The idea behind ASC is to fit a polynomial $p(x_1,\dots,x_D) \in \mathbb{R}[x_1,\dots,x_D]$ of degree $n$ to the data, where $n$ is the number of hyperplanes, and $x_1,\dots,x_D$ are polynomial indeterminates. In the absence of noise, this polynomial can be shown to have up to scale the form
\begin{align}
p(x) = (\boldsymbol{b}_1^\top x)\cdots (\boldsymbol{b}_n^\top x), \, \, \, x:=\begin{bmatrix} x_1 & \cdots x_D \end{bmatrix}^\top,
\end{align} where $\boldsymbol{b}_i \in \mathbb{S}^{D-1}$ is the normal vector to hyperplane $\mathcal{H}_i$. This reduces the problem to that of factorizing $p(x)$ to the product of linear factors, which was elegantly done in \cite{Vidal:CVPR03-gpca}. When the data are contaminated by noise, the fitted polynomial need no longer be factorizable; this apparent difficulty was circumvented in \cite{Vidal:PAMI05}, where it was shown that the gradient of the polynomial evaluated at point $\boldsymbol{x}_j$ is a good estimate for the normal vector of the hyperplane $\mathcal{H}_i$ that $\boldsymbol{x}_j$ lies closest to. Using this insight, one may obtain the hyperplane clusters by applying standard spectral clustering \citep{vonLuxburg:StatComp2007} on the \emph{angle-based} affinity matrix
\begin{align}
\boldsymbol{A}_{jj'} = \left| \langle \frac{\nabla p|_{\boldsymbol{x}_j}}{||\nabla p|_{\boldsymbol{x}_j} ||_2}, \frac{\nabla p|_{\boldsymbol{x}_{j'}}}{||\nabla p|_{\boldsymbol{x}_{j'}} ||_2} \rangle \right| , \, \, \, j,j' \in [N] \label{eq:ABA}.
\end{align} The main bottleneck of ASC is computational: at least ${n+D-1 \choose n} -1$ points are required in order to fit the polynomial, which yields prohibitive complexity in many settings when $n$ or $D$ are large. A second issue with ASC is that it is sensitive to outliers; this is because the polynomial is fitted in an $\ell_2$ sense through SVD (notice the similarity with KH).
\indent \myparagraph{Spectral Curvature Clustering (SCC)} Another yet conceptually distinct method from the ones discussed so far is SCC, whose main idea is to build a $D$-fold tensor as follows. For each $D$-tuple of distinct points in the dataset, say $\boldsymbol{x}_{j_1},\dots,\boldsymbol{x}_{j_D}$, the value of the tensor is set to
\begin{align}
\mathcal{A}(j_1,\dots,j_D) = \exp\left(-\frac{\left(c_p(\boldsymbol{x}_{j_1},\dots,\boldsymbol{x}_{j_D})\right)^2}{2\sigma^2}\right),
\end{align} where $c_p(\boldsymbol{x}_{j_1},\dots,\boldsymbol{x}_{j_D})$ is the polar curvature of the points $\boldsymbol{x}_{j_1},\dots,\boldsymbol{x}_{j_D}$ (see \cite{Chen:IJCV09} for an explicit formula) and $\sigma$ is a tuning parameter. Intuitively, the polar curvature is a multiple of the \emph{volume} of the simplex of the $D$ points, which becomes zero if the points lie in the same hyperplane, and the further the points lie from any hyperplane the larger the volume becomes. SCC obtains the hyperplane clusters by unfolding the tensor $\mathcal{A}$ to an affinity matrix, upon which spectral clustering is applied. As with ASC, the main bottleneck of SCC is computational, since in principle all ${N \choose D}$ entries of the tensor need to be computed. Even though the combinatorial complexity of SCC can be reduced, this comes at the cost of significant performance degradation.
\indent \myparagraph{RANSAC/KH Hybrids} Generally speaking, any single subspace learning method that is robust to outliers and can handle
subspaces of high relative dimensions, can be used to perform hyperplane clustering, either
via a RANSAC-style or a KH-style scheme or a combination of both. For example, if $\mathcal{M}$ is a method that takes a dataset and fits to it a hyperplane, then one can use $\mathcal{M}$ to compute the first dominant hyperplane, remove the points in the dataset lying close to it, compute a second dominant hyperplane and so on (RANSAC-style). Alternatively, one can start with a random guess for $n$ hyperplanes, cluster the data according to their distance to these hyperplanes, and then use $\mathcal{M}$ (instead of the classic SVD) to fit a new hyperplane to each cluster, and so on (KH-style). Even though a large variety of single subspace learning methods exist, e.g., see references in \cite{Lerman:CA14}, only few such methods are potentially able to handle large relative dimensions and in particular hyperplanes. In addition to RANSAC, in this paper we will consider two other possibilities, i.e., REAPER and DPCP, which are described next.\footnote{Regression-type methods such as the one proposed in \cite{WangCamps:CVPR15} are also a possibility.}
\indent \myparagraph{REAPER} A recently proposed single subspace learning method that admits an interesting theoretical analysis is the so-called \emph{REAPER} \citep{Lerman:FCM15}.
REAPER is inspired by the non-convex optimization problem
\begin{align}
\min \sum_{j=1}^{L} \left\|(\boldsymbol{I}_D - \boldsymbol{\Pi}) \boldsymbol{x}_j \right\|_2, \, \, \, \text{s.t.} \, \, \, \boldsymbol{\Pi} \, \, \, \text{is an orthogonal projection}, \, \, \, \Trace\left(\boldsymbol{\Pi} \right) = d, \label{eq:ReaperNonConvex}
\end{align} whose principle is to minimize the sum of the euclidean distances of all points to a single $d$-dimensional linear subspace $\mathcal{U}$; the matrix $\boldsymbol{\Pi}$ appearing in \eqref{eq:ReaperNonConvex} can be thought of as the product
$\boldsymbol{\Pi} = \boldsymbol{U} \boldsymbol{U}^\top$, where $\boldsymbol{U} \in \mathbb{R}^{D \times d}$ contains in its columns an orthonormal basis for $\mathcal{U}$.
As \eqref{eq:ReaperNonConvex} is non-convex, \cite{Lerman:FCM15} relax it to the convex semi-definite program
\begin{align}
\min \sum_{j=1}^{L} \left\|(\boldsymbol{I}_D - \boldsymbol{\boldsymbol{P}}) \boldsymbol{x}_j \right\|_2, \, \, \, \text{s.t.} \, \, \, \boldsymbol{0} \le \boldsymbol{\boldsymbol{P}} \le \boldsymbol{I}_D, \, \, \, \Trace\left(\boldsymbol{\boldsymbol{P}} \right) = d, \label{eq:ReaperConvex}
\end{align} which is the optimization problem that is actually solved by REAPER; the orthogonal projection matrix $\boldsymbol{\Pi}^*$ associated to $\mathcal{U}$, is obtained by projecting the solution $\boldsymbol{P}^*$ of \eqref{eq:ReaperConvex} onto the space of rank $d$ orthogonal projectors. A limitation of REAPER is that the semi-definite program \eqref{eq:ReaperConvex} may become prohibitively large even for moderate values of $D$. This difficulty can be circumvented by solving \eqref{eq:ReaperConvex} in an \emph{Iteratively Reweighted Least Squares} (IRLS) fashion, for which convergence of the objective value to a neighborhood of the optimal value has been established in \cite{Lerman:FCM15}.
\indent \myparagraph{Dual Principal Component Pursuit (DPCP)} Similarly to RANSAC \citep{RANSAC} or REAPER \citep{Lerman:FCM15}, DPCP \citep{Tsakiris:DPCPICCV15,Tsakiris:DPCP-ArXiv17} is another, recently proposed, single subspace learning method that can be applied to hyperplane clustering. The key idea of DPCP is to identify a single
hyperplane $\mathcal{H}$ that is \emph{maximal} with respect to the data $\boldsymbol{\mathcal{X}}$. Such a
\emph{maximal hyperplane} is defined by the property that it must contain a maximal number of points $N_{\mathcal{H}}$ from the dataset, i.e., $N_{\mathcal{H}'} \le N_{\mathcal{H}}$ for any other hyperplane $\mathcal{H}'$ of $\mathbb{R}^D$.
Notice that such a maximal hyperplane can be characterized as a solution to the problem
\begin{align}
\min_{\boldsymbol{b}} \, \left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_0 \, \, \text{s.t.} \, \, \, \boldsymbol{b} \neq \boldsymbol{0}, \label{eq:ell0}
\end{align} since $\left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_0$ counts precisely the number of points in $\boldsymbol{\mathcal{X}}$ that are orthogonal to $\boldsymbol{b}$, and hence, contained in the hyperplane with normal vector $\boldsymbol{b}$. Problem \eqref{eq:ell0} is naturally relaxed to
\begin{align}
\min_{\boldsymbol{b}} \, \left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_1 \, \, \text{s.t.} \, \, \, \left\|\boldsymbol{b}\right\|_2 = 1, \label{eq:ell1}
\end{align} which is a non-convex non-smooth optimization problem on the sphere. In the case where there is no noise and the dataset consists of $N_1 \ge D$ \emph{inlier} points $\boldsymbol{\mathcal{X}}_1$ drawn from a single hyperplane $\mathcal{H}_1 \cap \mathbb{S}^{D-1}$ with normal vector $\boldsymbol{b}_1 \in \mathbb{S}^{D-1}$, together with $M$ \emph{outlier} points $\boldsymbol{\mathcal{O}} \subset \mathbb{S}^{D-1}$ in general position, i.e. $\boldsymbol{\mathcal{X}} = \left[ \boldsymbol{\mathcal{X}}_1 \, \, \, \boldsymbol{\mathcal{O}} \right] \boldsymbol{\Gamma}$, where $\boldsymbol{\Gamma}$ is an unknown permutation matrix, then there is a unique maximal hyperplane that coincides with $\mathcal{H}_1$. Under certain uniformity assumptions on the data points and abundance of inliers $\boldsymbol{\mathcal{X}}_1$, \cite{Tsakiris:DPCPICCV15,Tsakiris:DPCP-ArXiv17} asserted that $\boldsymbol{b}_1$ is the unique\footnote{The theorems in \cite{Tsakiris:DPCPICCV15,Tsakiris:DPCP-ArXiv17} are given for inliers lying in a proper subspace of arbitrary dimension $d$; the uniqueness follows from specializing $d=D-1$.} up to sign global solution of \eqref{eq:ell1}, i.e., the combinatorial problem \eqref{eq:ell0} and its non-convex relaxation \eqref{eq:ell1} share the same unique global minimizer.
Moreover, it was shown that under the additional assumption that the principal angle of the initial estimate $\hat{\boldsymbol{n}}_0$ from $\boldsymbol{b}_1$ is not large, the sequence
$\left\{\hat{\boldsymbol{n}}_k \right\}$ generated by the recursion of linear programs
\footnote{Notice that problem
\begin{align}
\min_{\boldsymbol{b}} \left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_1, \, \, \, \text{s.t.} \, \, \, \boldsymbol{b}^\top \hat{\boldsymbol{n}}_k=1
\end{align} may admit more than one global minimizer. Here and in the rest of the paper we denote by $\boldsymbol{n}_{k+1}$ the solution obtained via the \emph{simplex method}.}
\begin{align}
\boldsymbol{n}_{k+1} := \argmin_{\boldsymbol{b}:\, \, \, \boldsymbol{b}^\top \hat{\boldsymbol{n}}_k=1} \left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_1, \label{eq:ConvexRelaxations}
\end{align} converges up to sign to $\boldsymbol{b}_1$, after finitely many iterations. Alternatively, one can attempt to solve problem \eqref{eq:ell1} by means of an IRLS scheme, in a similar fashion as for REAPER. Even though no theory has been developed for this approach, experimental evidence in \cite{Tsakiris:DPCP-ArXiv17} indicates convergence of such an IRLS scheme to the global minimizer of \eqref{eq:ell1}.
\indent \myparagraph{Other Methods} In general, there is a large variety of clustering methods that can be adapted to perform hyperplane clustering, and the above list is by no means exhaustive; rather contains the methods that are intelluctually closest to the proposal of this paper. Important examples that we do not compare with in this paper are the statistical-theoretic \emph{Mixtures of Probabilistic Principal Component Analyzers} \citep{Tipping-PPCA:99}, as well as the information-theoretic \emph{Agglomerative Lossy Compression} \citep{Ma:PAMI07}. For an extensive account of these and other methods the reader is referred to \cite{Vidal:GPCAbook}.
\section{Theoretical Contributions} \label{section:TheoreticalContributions}
In this section we develop the main theoretical contributions
of this paper, which are concerned with the properties of the non-convex $\ell_1$ minimization problem \eqref{eq:ell1}, as well as with the recursion of linear programs \eqref{eq:ConvexRelaxations} in the context of hyperplane clustering. More specifically, we are particularly interested in developing conditions under which every global minimizer of the non-convex problem \eqref{eq:ell1} is the normal vector to one of the hyperplanes of the underlying hyperplane arrangement. Towards that end, it is insightful to study an associated \emph{continuous} problem, which is obtained by replacing each finite cluster within a hyperplane by the uniform measure on the unit sphere of the hyperplane (\S \ref{subsection:ContinuousProblem}). The main result in that direction is Theorem \ref{thm:GeneralContinuous}. Next, by introducing certain uniformity parameters which measure the deviation of discrete quantities from their continuous counterparts, we adapt our analysis to the \emph{discrete} case of interest (\S \ref{subsection:DataModel}). This furnishes Theorem \ref{thm:DiscreteNonConvex}, which is the discrete analogue of Theorem \ref{thm:GeneralContinuous}, and gives global optimality conditions for the $\ell_1$ non-convex DPCP problem \eqref{eq:ell1} (\S \ref{subsection:DiscreteProblem}). Finally, Theorem \ref{thm:LPDiscrete} gives convergence guarantees for the linear programming recursion \eqref{eq:ConvexRelaxations}. The proofs of all results are deferred to \S \ref{section:Proofs}.
\subsection{Data model and the problem of hyperplane clustering} \label{subsection:DataModel}
Consider given a collection $\boldsymbol{\mathcal{X}}=\left[\boldsymbol{x}_1,\dots,\boldsymbol{x}_N \right] \in \mathbb{R}^{D \times N}$ of $N$ points of the unit sphere $\mathbb{S}^{D-1}$ of $\mathbb{R}^D$, that lie in an arrangement $\mathcal{A}$ of $n$ hyperplanes $\mathcal{H}_1,\dots,\mathcal{H}_n$ of $\mathbb{R}^D$, i.e., $\boldsymbol{\mathcal{X}} \subset \mathcal{A}=\bigcup_{i=1}^n \mathcal{H}_i$, where each hyperplane $\mathcal{H}_i$ is the set of points of $\mathbb{R}^D$ that are orthogonal to a \emph{normal vector} $\boldsymbol{b}_i \in \mathbb{S}^{D-1}$, i.e., $\mathcal{H}_i = \left\{\boldsymbol{x} \in \mathbb{R}^D: \, \boldsymbol{x}^\top \boldsymbol{b}_i = 0 \right\}, \, i \in [n]:=\left\{1,\dots,n\right\}$. We assume that the data $\boldsymbol{\mathcal{X}}$ lie in \emph{general position} in $\mathcal{A} $, by which we mean two things. First, we mean that there are no linear relations among the points other than the ones induced by their membership to the hyperplanes. In particular, every $(D-1)$ points coming from $\mathcal{H}_i$ form a basis for $\mathcal{H}_i$
and any $D$ points of $\boldsymbol{\mathcal{X}}$ that come from at least two distinct $\mathcal{H}_i, \mathcal{H}_{i'}$ are linearly independent. Second, we mean that the points $\boldsymbol{\mathcal{X}}$ uniquely define the hyperplane arrangement $\mathcal{A}$, in the sense that $\mathcal{A}$ is the only arrangement of $n$ hyperplanes that contains $\boldsymbol{\mathcal{X}}$. This can be verified computationally by checking that
there is only one up to scale homogeneous polynomial of degree $n$ that fits the data, see
\cite{Vidal:PAMI05,Tsakiris:SIAM17} for details.
We assume that for every $i \in [n]$, precisely $N_i$ points of $\boldsymbol{\mathcal{X}}$, denoted by $\boldsymbol{\mathcal{X}}_i=[\boldsymbol{x}_1^{(i)},\dots,\boldsymbol{x}_{N_i}^{(i)}]$, belong to $\mathcal{H}_i$, with $\sum_{i=1}^n N_i=N$. With that notation, $\boldsymbol{\mathcal{X}}=[\boldsymbol{\mathcal{X}}_1,\dots,\boldsymbol{\mathcal{X}}_n] \boldsymbol{\Gamma}$, where $\boldsymbol{\Gamma}$ is an unknown permutation matrix, indicating that the hyperplane membership of the points is unknown. Moreover, we assume an ordering $N_1 \ge N_2 \ge \cdots \ge N_n$, and we refer to $\mathcal{H}_1$ as \emph{the dominant hyperplane}.
After these preparations, the problem of hyperplane clustering can be stated as follows: given the data $\boldsymbol{\mathcal{X}}$, find the number $n$ of hyperplanes associated to $\boldsymbol{\mathcal{X}}$, a normal vector to each hyperplane, and a clustering of the data $\boldsymbol{\mathcal{X}}=\bigcup_{i=1}^n \boldsymbol{\mathcal{X}}_i$ according to hyperplane membership.
\subsection{Theoretical analysis of the continuous problem} \label{subsection:ContinuousProblem}
As it turns out, certain important insights regarding problem \eqref{eq:ell1} with respect to hyperplane clustering can be gained by examining an associated continuous problem. To see what that problem is, let $\hat{\mathcal{H}}_i=\mathcal{H}_i \cap \mathbb{S}^{D-1}$, and note first that for any $\boldsymbol{b} \in \mathbb{S}^{D-1}$ we have
\begin{align}
\frac{1}{N_i} \sum_{j=1}^{N_i} \left|\boldsymbol{b}^\top \boldsymbol{x}_j^{(i)} \right| \simeq \int_{\boldsymbol{x} \in \hat{\mathcal{H}}_i}\left|\boldsymbol{b}^\top \boldsymbol{x}\right| d \mu_{\hat{\mathcal{H}}_i}, \label{eq:DiscreteIntegral}
\end{align} where the LHS of \eqref{eq:DiscreteIntegral} is precisely $\frac{1}{N_i}\left\|\boldsymbol{\mathcal{X}}_i^\top \boldsymbol{b} \right\|_1$ and can be viewed as an approximation ($\simeq$) via the point set $\boldsymbol{\mathcal{X}}_i$ of the integral on the RHS of \eqref{eq:DiscreteIntegral}, with $\mu_{\hat{\mathcal{H}}_i}$ denoting the uniform measure on $\hat{\mathcal{H}}_i$. Letting
$\theta_i$ be the principal angle between $\boldsymbol{b}$ and $\boldsymbol{b}_i$, i.e., the unique angle $\theta_i \in [0,\pi/2]$ such that $\cos(\theta_i)= |\boldsymbol{b}^\top \boldsymbol{b}_i|$, and $\pi_{\mathcal{H}_i}:\mathbb{R}^D \rightarrow \mathcal{H}_i$ the orthogonal projection onto $\mathcal{H}_i$, for any $\boldsymbol{x} \in \mathcal{H}_i$ we have
\begin{align}
\boldsymbol{b}^\top \boldsymbol{x} = \boldsymbol{b}^\top \pi_{\mathcal{H}_i}(\boldsymbol{x}) = \left(\pi_{\mathcal{H}_i}(\boldsymbol{b})\right)^\top \boldsymbol{x} = \boldsymbol{h}_{i,\boldsymbol{b}}^\top \boldsymbol{x} = \sin(\theta_i) \, \hat{\boldsymbol{h}}_{i,\boldsymbol{b}}^\top \boldsymbol{x}.
\end{align} Hence,
\begin{align}
\int_{\boldsymbol{x} \in \hat{\mathcal{H}}_i}\left|\boldsymbol{b}^\top \boldsymbol{x}\right| d \mu_{\hat{\mathcal{H}}_i} &=
\left[\int_{\boldsymbol{x} \in \hat{\mathcal{H}}_i}\left|\hat{\boldsymbol{h}}_{i,\boldsymbol{b}}^\top \boldsymbol{x}\right| d \mu_{\hat{\mathcal{H}}_i}\right] \sin(\theta_i) \\
&=\left[\int_{\boldsymbol{x} \in \mathbb{S}^{D-2}}|x_1| d \mu_{\mathbb{S}^{D-2}}\right]\sin(\theta_i) \\ &= c \, \sin (\theta_i).\label{eq:JiContinutous}
\end{align} In the second equality above we made use of the rotational invariance of the sphere, as well as the fact that $\hat{\mathcal{H}}_i \cong \mathbb{S}^{D-2}$, which leads to (for details see the proof of Proposition $4$ and Lemma $7$ in \cite{Tsakiris:DPCP-ArXiv17})
\begin{align}
\int_{\boldsymbol{x} \in \hat{\mathcal{H}}_i}\left|\hat{\boldsymbol{h}}_{i,\boldsymbol{b}}^\top \boldsymbol{x}\right| d \mu_{\hat{\mathcal{H}}_i} = \int_{\boldsymbol{x} \in \mathbb{S}^{D-2}}|x_1| d \mu_{\mathbb{S}^{D-2}} =: c, \label{eq:c}
\end{align} where $x_1$ is the first coordinate of $\boldsymbol{x}$ and $c$ is the average height of the unit hemisphere in $\mathbb{R}^D$. As a consequence, we can view the objective function of \eqref{eq:ell1}, which is given by
\begin{align}
\left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_1 = \sum_{i=1}^n \left\|\boldsymbol{\mathcal{X}}_i^\top \boldsymbol{b} \right\|_1 = \sum_{i=1}^n N_i \left(\frac{1}{N_i} \sum_{j=1}^{N_i} \left|\boldsymbol{b}^\top \boldsymbol{x}_j^{(i)} \right|\right), \label{eq:Jdiscrete}
\end{align} as a discretization via the point set $\boldsymbol{\mathcal{X}}$ of the function
\begin{align}
\mathcal{J}(\boldsymbol{b}) := \sum_{i=1}^n N_i \left( \int_{\boldsymbol{x} \in \hat{\mathcal{H}}_i}\left|\boldsymbol{b}^\top \boldsymbol{x}\right| d \mu_{\hat{\mathcal{H}}_i}\right) \stackrel{\eqref{eq:JiContinutous}}{=} \sum_{i =1}^n N_i \, c \, \sin(\theta_i). \label{eq:J}
\end{align} In that sense, the continuous counterpart of problem \eqref{eq:ell1} is
\begin{align}
\min_{\boldsymbol{b}} \, \, \, \mathcal{J}(\boldsymbol{b})=N_1 \, c\, \sin (\theta_1)+\cdots+N_n \, c \, \sin (\theta_n), \, \, \, \text{s.t.} \, \, \, \boldsymbol{b} \in \mathbb{S}^{D-1} \label{eq:ContinuousProblem}.
\end{align} Note that $\sin(\theta_i)$ is the distance between the line spanned by $\boldsymbol{b}$ and the line spanned by $\boldsymbol{b}_i$.\footnote{Recall that $\theta_i$ is a principal angle, i.e., $\theta_i \in [0,\pi/2]$.} Thus, every global minimizer $\boldsymbol{b}^*$ of problem \eqref{eq:ContinuousProblem} minimizes the sum of the weighted distances of $\Span(\boldsymbol{b}^*)$ from $\Span(\boldsymbol{b}_1),\dots,\Span(\boldsymbol{b}_n)$, and can be thought of as representing a weighted median of these lines. Medians in Riemmannian manifolds, and in particular in the Grassmannian manifold, are an active subject of research \citep{draper2014flag,ghalieh199680}. However, we are not aware of any work in the literature that defines a median by means of \eqref{eq:ContinuousProblem}, nor any work that studies \eqref{eq:ContinuousProblem}.
The advantage of working with \eqref{eq:ContinuousProblem} instead of \eqref{eq:ell1}, is that the solution set of the continuous problem \eqref{eq:ContinuousProblem} depends solely on the \emph{weights} $N_1 \ge N_2 \ge \cdots \ge N_n$ assigned to the hyperplane arrangement, as well as on the geometry of the arrangement, captured by the principal angles $\theta_{ij}$ between $\boldsymbol{b}_i$ and $\boldsymbol{b}_j$. In contrast, the solutions of the discrete problem \eqref{eq:ell1} may also depend on the distribution of the points $\boldsymbol{\mathcal{X}}$. From that perspective, understanding when problem \eqref{eq:ContinuousProblem} has a unique solution that coincides with the normal $\pm \boldsymbol{b}_1$ to the dominant hyperplane $\mathcal{H}_1$ is essential for understanding the potential of \eqref{eq:ell1} for hyperplane clustering.
Towards that end, we next provide a series of results pertaining to \eqref{eq:ContinuousProblem}.
The first configuration that we examine is that of two hyperplanes. In that case the weighted geometric median of the two lines spanned by the normals to the hyperplanes always corresponds to one of the two normals:\begin{thm} \label{prp:TwoPlanes}
Let $\boldsymbol{b}_1,\boldsymbol{b}_2$ be an arrangement of two hyperplanes in $\mathbb{R}^D$, with weights $N_1 \ge N_2$.
Then the set $\mathfrak{B}^*$ of global minimizers of \eqref{eq:ContinuousProblem} satisfies:
\begin{enumerate}
\item If $N_1=N_2$, then $\mathfrak{B}^*=\left\{\pm \boldsymbol{b}_1, \pm \boldsymbol{b}_2 \right\}$.
\item If $N_1>N_2$, then $\mathfrak{B}^*=\left\{\pm \boldsymbol{b}_1\right\}$.
\end{enumerate}
\end{thm} Notice that when $N_1 >N_2$, problem \eqref{eq:ContinuousProblem} recovers the normal $\boldsymbol{b}_1$ to the dominant hyperplane, irrespectively of how separated the two hyperplanes are, since, according to Proposition \ref{prp:TwoPlanes}, the principal angle $\theta_{12}$ between $\boldsymbol{b}_1,\boldsymbol{b}_2$ does not play a role.
The continuous problem \eqref{eq:ContinuousProblem} is equally favorable in recovering normal vectors as global minimizers in the \emph{dual} situation, where the arrangement consists of up to $D$ perfectly separated (orthogonal) hyperplanes, as asserted by the next Theorem.
\begin{thm} \label{prp:Orthogonal}
Let $\boldsymbol{b}_1,\dots,\boldsymbol{b}_n$ be an orthogonal hyperplane arrangement ($\theta_{ij}=\pi/2, \, \forall i \neq j$) of $\mathbb{R}^D$, with $n \le D$, and weights $N_1 \ge N_2 \ge \cdots \ge N_n$. Then the set $\mathfrak{B}^*$ of global minimizers of \eqref{eq:ContinuousProblem} can be characterized as follows:
\begin{enumerate}
\item If $N_1=N_n$, then $\mathfrak{B}^* = \left\{\pm \boldsymbol{b}_1,\dots,\pm \boldsymbol{b}_{n} \right\}$.
\item If $N_1=\cdots=N_\ell>N_{\ell+1} \ge \cdots N_n$, for some $\ell \in [n-1]$, then
$\mathfrak{B}^* = \left\{\pm \boldsymbol{b}_1,\dots,\pm \boldsymbol{b}_{\ell} \right\}$.
\end{enumerate}
\end{thm} Theorems \ref{prp:TwoPlanes} and \ref{prp:Orthogonal} are not hard to prove, since for two hyperplanes the objective can be shown to be a strictly concave function, while for orthogonal hyperplanes the objective is separable. In contrast, the problem becomes considerably harder for $n>2$ non-orthogonal hyperplanes. Even when $n=3$, characterizing the global minimizers of \eqref{eq:ContinuousProblem} as a function of the geometry and the weights seems challenging. Nevertheless, when the three hyperplanes are equiangular and their weights are equal, the symmetry of the configuration allows to analytically characterize the median as a function of the angle of the arrangement. \begin{thm}\label{prp:equiangular}
Let $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$ be an equiangular hyperplane arrangement of $\mathbb{R}^D$, $D \ge 3$, with $\theta_{12}=\theta_{13}=\theta_{23}=\theta \in (0,\pi/2]$ and weights $N_1=N_2=N_3$. Let $\mathfrak{B}^*$ be the set of global minimizers of \eqref{eq:ContinuousProblem}. Then $\mathfrak{B}^*$ satisfies the following phase transition:
\begin{enumerate}
\item If $\theta> 60^\circ$, then $\mathfrak{B}^*=\left\{\pm \boldsymbol{b}_1, \pm \boldsymbol{b}_2, \pm \boldsymbol{b}_3 \right\}$.
\item If $\theta= 60^\circ$, then $\mathfrak{B}^*=\left\{\pm \boldsymbol{b}_1, \pm \boldsymbol{b}_2, \pm \boldsymbol{b}_3, \pm \frac{1}{\sqrt{3}} \boldsymbol{1} \right\}$.
\item If $\theta< 60^\circ$, then $\mathfrak{B}^*=\left\{\pm \frac{1}{\sqrt{3}} \boldsymbol{1} \right\}$.
\end{enumerate}
\end{thm} Proposition \ref{prp:equiangular}, whose proof uses nontrivial arguments from spherical and algebraic geometry, is particularly enlightening, since it suggests that the global minimizers of \eqref{eq:ContinuousProblem} are associated to normal vectors of the underlying hyperplane arrangement when the hyperplanes are sufficiently separated, while otherwise they seem to be capturing the \emph{median hyperplane} of the arrangement. This is in striking similarity with the results regarding the \emph{Fermat point} of planar and spherical triangles \citep{ghalieh199680}.
However, when the symmetry in Theorem \ref{prp:equiangular} is removed, by not requiring the principal angles $\theta_{ij}$ or/and the weights $N_i$ to be equal, then our proof technique no longer applies, and the problem seems even harder. Even so, one intuitively expects an interplay between the angles and the weights of the arrangement under which, if the hyperplanes are \emph{sufficiently separated} and $\mathcal{H}_1$ is \emph{sufficiently dominant}, then \eqref{eq:ContinuousProblem} should have a unique global minimizer equal to $\boldsymbol{b}_1$. Our next theorem formalizes this intuition.
\begin{thm} \label{thm:GeneralContinuous} Let $\boldsymbol{b}_1,\dots,\boldsymbol{b}_n$ be an arrangement of $n \ge 3$ hyperplanes in $\mathbb{R}^D$, with pairwise principal angles $\theta_{ij}$. Let $N_1 \ge N_2\ge \cdots \ge N_n$ be positive integer weights assigned to the arrangement. Suppose that $N_1$ is large enough, in the sense that
\begin{align}
N_1 > \sqrt{\alpha^2+\beta^2}, \label{c:ContinuousDominance}
\end{align} where
\begin{align}
\alpha &:=\sum_{i>1}N_i \sin(\theta_{1,i})-
\sqrt{\sum_{i>1}N_i^2-\sigma_{\max}\left(\left[N_iN_j\cos(\theta_{ij})\right]_{i,j>1}\right)} \ge 0,\\
\beta &:=\sqrt{\sum_{i>1} N_i^2 + 2 \sum_{i \neq j, \, i,j >1} N_i N_j\cos(\theta_{ij})}, \label{eq:alphabeta}
\end{align} with $\sigma_{\max}\left(\left[N_iN_j\cos(\theta_{ij})\right]_{i,j>1}\right)$ denoting the maximal eigenvalue of the $(n-1)\times(n-1)$ matrix, whose
$(i-1,j-1)$ entry is $N_i N_j \cos(\theta_{ij})$ and $1 < i,j \le n$. Then any global minimizer $\boldsymbol{b}^*$ of problem \eqref{eq:ContinuousProblem} must satisfy $\boldsymbol{b}^*=\pm \boldsymbol{b}_i$, for some $i \in [n]$. If in addition,
\begin{align}
\gamma:=\min_{i'\neq 1} \sum_{i \neq i'} N_i \sin(\theta_{i',i}) - \sum_{i>1} N_i \sin(\theta_{1,i})>0, \label{eq:NormalAvoidanceGeneralFirst}
\end{align} then problem \eqref{eq:ContinuousProblem} admits a unique up to sign global minimizer $\boldsymbol{b}^* = \pm \boldsymbol{b}_1$.
\end{thm} Let us provide some intuition about the meaning of the quantities $\alpha,\beta$ and $\gamma$ in Theorem \ref{thm:GeneralContinuous}. To begin with, the first term in $\alpha$ is precisely equal to $\mathcal{J}(\boldsymbol{b}_1)$, while the second term in $\alpha$ is a lower bound on the objective function $N_2 \sin(\theta_2) + \cdots + N_n \sin(\theta_n)$, if one discards hyperplane $\mathcal{H}_1$. Moving on, under the hypothesis that $N_1>\sqrt{\alpha^2+\beta^2}$, the quantity $\frac{\beta}{N_1}$ admits a nice geometric interpretation: $\cos^{-1} \left(\frac{\beta}{N_1} \right)$ is a lower bound on how small the principal angle of a critical point $\boldsymbol{b}^{\dagger}$ from $\boldsymbol{b}_1$ can be, if $\boldsymbol{b}^{\dagger} \neq \pm \boldsymbol{b}_1$. Interestingly, this means that the larger $N_1$ is, the larger this minimum angle is, which shows that critical hyperplanes $\mathcal{H}^{\dagger}$ (i.e., hyperplanes defined by critical points $\boldsymbol{b}^\dagger$) that are distinct from $\mathcal{H}_1$, must be sufficiently separated from $\mathcal{H}_1$. Finally, the first term in $\gamma$ is $\mathcal{J}(\boldsymbol{b}_1)$, while the second term is the smallest objective value that corresponds to $\boldsymbol{b} = \boldsymbol{b}_i, \, i>1$, and so \eqref{eq:NormalAvoidanceGeneralFirst} simply guarantees that $\mathcal{J}(\boldsymbol{b}_1)< \mathcal{J}(\boldsymbol{b}_i), \, \forall i>1$.
Next, notice that condition $N_1 > \sqrt{\alpha^2+\beta^2}$ of Theorem \ref{thm:GeneralContinuous} is easier to satisfy when $\mathcal{H}_1$ is close to the rest of the hyperplanes (which leads to small $\alpha$), while the rest of the hyperplanes are sufficiently separated (which leads to small $\alpha$ and small $\beta$). Here the notion of \emph{close} and \emph{separated} is to be interpreted relatively to $\mathcal{H}_1$ and its assigned weight $N_1$. Regardless, one can show that
\begin{align}
\sqrt{2} \sum_{i>1} N_i \ge \sqrt{\alpha^2+\beta^2},
\end{align} and so if
\begin{align}
N_1 > \sqrt{2} \sum_{i>1} N_i,
\end{align} then any global minimizer of \eqref{eq:ContinuousProblem} has to be one of the normals, irrespectively of the $\theta_{ij}$. Finally, condition \eqref{eq:NormalAvoidanceGeneralFirst} is consistent with
condition \eqref{c:ContinuousDominance} in that it requires $\mathcal{H}_1$ to be close to $\mathcal{H}_i, i >1$ and $\mathcal{H}_i,\mathcal{H}_j$ to be sufficiently separated for $i, j >1$. Once again, \eqref{eq:NormalAvoidanceGeneralFirst} can always be satisfied irrespectively of the $\theta_{ij}$, by choosing $N_1$ sufficiently large, since only the positive term in the definition of $\gamma$ depends on $N_1$, once again manifesting that the terms \emph{close} and \emph{separated} are used relatively to $\mathcal{H}_1$ and its assigned weight $N_1$.
Removing the term $N_1 \sin(\theta_1)$ from the objective function, which corresponds to having identified $\mathcal{H}_1$ and removing its associated points, one may re-apply Theorem \ref{thm:GeneralContinuous} to the remaining hyperplanes $\mathcal{H}_2,\dots,\mathcal{H}_n$ to obtain conditions for recovering $\boldsymbol{b}_2$ and so on. Notice that these conditions will be independent of $N_1$, rather they will be relative to $\mathcal{H}_2$ and its assigned weight $N_2$, and can always be satisfied for large enough $N_2$. Finally, further recursive application of Theorem \ref{thm:GeneralContinuous} can furnish conditions for sequentially recovering all normals $\boldsymbol{b}_1,\dots,\boldsymbol{b}_n$. However, we should point out that the conditions of Theorem \ref{thm:GeneralContinuous} are readily seen to be stronger than necessary. For example, we already know from Theorem \ref{prp:Orthogonal} that when the arrangement is orthogonal, i.e., $\theta_{ij}=\pi/2, \, \forall i \neq j$, then problem \eqref{eq:ContinuousProblem} has a unique minimizer $\pm \boldsymbol{b}_1$ as soon as $N_1 >N_i, \forall i>1$. On the contrary, Theorem \ref{thm:GeneralContinuous} applied to that case requires $N_1$ to be unnecessarily large, i.e., condition \eqref{c:ContinuousDominance} becomes
\begin{align}
N_1^2 > \left(\sum_{i>1} N_i \right)^2 + 2 \sum_{i>1} N_i^2 - 2 \left(\sum_{i>1}N_i \right) \left(\sum_{i>1} N_i^2 \right)^{1/2},
\end{align} which in the special case $N_2=\cdots=N_n$ reduces to $N_1> (n-1) N_2$.
This is clearly an artifact of the techniques used to prove Theorem \ref{thm:GeneralContinuous}, and not a weakness of problem \eqref{eq:ContinuousProblem} in terms of its global optimality properties. Improving the proof technique of Theorem \ref{thm:GeneralContinuous} is an open problem.
\subsection{Theoretical analysis of the discrete problem} \label{subsection:DiscreteProblem}
We now turn our attention to the discrete problem of hyperplane clustering via DPCP, i.e., to problems \eqref{eq:ell1} and \eqref{eq:ConvexRelaxations}, for the case where $\boldsymbol{\mathcal{X}} = [\boldsymbol{\mathcal{X}}_1,\dots,\boldsymbol{\mathcal{X}}_n] \boldsymbol{\Gamma}$, with $\boldsymbol{\mathcal{X}}_i$ being $N_i$ points in $\mathcal{H}_i$, as described in \S \ref{subsection:DataModel}. As a first step of our analysis we define certain \emph{uniformity parameters} $\epsilon_i$, which serve as link between the continuous and discrete domains. Towards that end, note that
for any $i \in [n]$ and $\boldsymbol{b} \in \mathbb{S}^{D-1}$, the quantity $||\boldsymbol{\mathcal{X}}_i^\top \boldsymbol{b} ||_1$ can be written as
\begin{align}
\left\|\boldsymbol{\mathcal{X}}_i^\top \boldsymbol{b} \right\|_1 =\sum_{j=1}^{N_i}\left|\boldsymbol{b}^\top \boldsymbol{x}_j^{(i)}\right| = \boldsymbol{b}^\top \sum_{j=1}^{N_i} \Sign\left(\boldsymbol{b}^\top \boldsymbol{x}_j^{(i)}\right) \boldsymbol{x}_j^{(i)}=N_i \, \boldsymbol{b}^\top \boldsymbol{\chi}_{i,\boldsymbol{b}}, \label{eq:Ji}
\end{align} where
\begin{align}
\boldsymbol{\chi}_{i,\boldsymbol{b}} := \frac{1}{N_i} \sum_{j=1}^{N_i} \Sign\left(\boldsymbol{b}^\top \boldsymbol{x}_{j}^{(i)}\right) \boldsymbol{x}_j^{(i)}
\end{align} is \emph{the average point of $\boldsymbol{\mathcal{X}}_i$ with respect to the} orthogonal projection $\boldsymbol{h}_{i,\boldsymbol{b}}:=\pi_{\mathcal{H}_i}(\boldsymbol{b})$ of $\boldsymbol{b}$ onto $\mathcal{H}_i$. Notice that $\boldsymbol{\chi}_{i,\boldsymbol{b}}$ can be seen as an average of the function $\boldsymbol{y} \in \hat{\mathcal{H}}_i \mapsto \Sign\left(\boldsymbol{b}^\top \boldsymbol{y}\right) \boldsymbol{y} \in \hat{\mathcal{H}}_i$ through the point sent $\boldsymbol{\mathcal{X}}_i \subset \hat{\mathcal{H}}_i$. In other words,
$\boldsymbol{\chi}_{i,\boldsymbol{b}}$ can be seen as an approximation of the integral\footnote{For details regarding the evaluation of this integral see Lemma $9$ and its proof in \cite{Tsakiris:DPCP-ArXiv17}.}
\begin{align}
\int_{\boldsymbol{x} \in \hat{\mathcal{H}}_i} \Sign\left(\boldsymbol{b}^\top \boldsymbol{x}\right) \boldsymbol{x} \, d \mu_{\hat{\mathcal{H}}_i} = c\, \hat{\boldsymbol{h}}_{i,\boldsymbol{b}},
\end{align} where $c$ was defined in \eqref{eq:c}. To remove the dependence on $\boldsymbol{b}$ we define the approximation error $\epsilon_i$ associated to hyperplane $\mathcal{H}_i$ as
\begin{align}
\epsilon_i := \max_{\boldsymbol{b} \in \mathbb{S}^{D-1}} \left\|\boldsymbol{\chi}_{i,\boldsymbol{b}} - c \, \widehat{\boldsymbol{h}}_{i,\boldsymbol{b}} \right\|_2.\label{eq:epsilon}
\end{align} Then it can be shown (see \cite{Tsakiris:DPCP-ArXiv17} \S $4.2$) that
when the points $\boldsymbol{\mathcal{X}}_i$ are uniformly distributed in a deterministic sense
\citep{Grabner:MR97,Grabner:MathComp93}, $\epsilon_i$ is small and in particular $\epsilon_i \rightarrow 0$ as $N_i \rightarrow \infty$.
We are now almost ready to state our main results, before doing so though we need a rather technical, yet necessary, definition.
\begin{dfn} \label{dfn:DPCPmultiple_circumradius}
For a set $\boldsymbol{\mathcal{Y}} = [\boldsymbol{y}_1,\dots,\boldsymbol{y}_L] \subset \mathbb{S}^{D-1}$ and positive integer $K\le L$,
define $\mathcal{R}_{\boldsymbol{\mathcal{Y}},K}$ to be the maximum circumradius among the circumradii of all polytopes $\left\{\sum_{i=1}^K \alpha_{j_i} \boldsymbol{y}_{j_i}: \, \alpha_{j_i} \in [-1,1] \right\}$,
where $j_1,\dots,j_K$ are distinct integers in $[L]$, and the circumradius of a closed bounded set is the minimum radius among all spheres that contain the set. We now define the quantity of interest as
\begin{align}
\mathcal{R} := \max_{\substack{K_1+\cdots+K_n = D-1 \\ 0 \le K_i \le D-2}} \sum_{i=1}^n \mathcal{R}_{\boldsymbol{\mathcal{X}}_i,K_i}. \label{eq:R}
\end{align}
\end{dfn} \noindent We note that it is always the case that $\mathcal{R}_{\boldsymbol{\mathcal{X}}_i,K_i} \le K_i$, with this upper bound achieved when $\boldsymbol{\mathcal{X}}_i$ contains $K_i$ colinear points. Combining this fact with the constraint $\sum_i K_i = D-1$ in \eqref{eq:R}, we get that $\mathcal{R} \le D-1$, and the more uniformly distributed are the points $\boldsymbol{\mathcal{X}}$ inside the hyperplanes, the smaller $\mathcal{R}$ is (even though $\mathcal{R}$ does not go to zero).
Recalling the definitions of $c$, $\epsilon_i$ and $\mathcal{R}$ in \eqref{eq:c}, \eqref{eq:epsilon} and \eqref{eq:R}, respectively, we have the following result about the non-convex problem \eqref{eq:ell1}.
\begin{thm} \label{thm:DiscreteNonConvex}
Let $\boldsymbol{b}^*$ be a solution of \eqref{eq:ell1} with $\boldsymbol{\mathcal{X}}=[\boldsymbol{\mathcal{X}}_1,\dots,\boldsymbol{\mathcal{X}}_n] \boldsymbol{\Gamma}$, and suppose that $c> \sqrt{2} \epsilon_1$. If
\begin{align}
N_1 &> \sqrt{\bar{\alpha}^2+\bar{\beta}^2}, \label{c:thmDiscreteNonConvexDominance} \, \, \, \text{where} \\
\bar{\alpha} &:= \alpha+c^{-1}\left(\epsilon_1N_1+2\sum_{i>1} \epsilon_i N_i\right), \, \, \, \text{and} \\
\bar{\beta} &:=\beta + c^{-1}\left(\mathcal{R} + \sum \epsilon_i N_i \right),
\end{align} with $\alpha, \beta$ as in Theorem \ref{thm:GeneralContinuous}, then $\boldsymbol{b}^* =\pm \boldsymbol{b}_i$ for some $i \in [n]$. Furthermore, $\boldsymbol{b}^* = \pm \boldsymbol{b}_1$, if
\begin{align}
\bar{\gamma}:=\gamma - c^{-1}\left(\epsilon_1 N_1 + \epsilon_2 N_2 + 2 \sum_{i>2} \epsilon_i N_i\right) \label{eq:gammaBar} >0.
\end{align}
\end{thm} Notice the similarity of conditions $N_1 > \sqrt{\bar{\alpha}^2+\bar{\beta}^2},\bar{\gamma}>0$ of Theorem \ref{thm:DiscreteNonConvex} with conditions $N_1 > \sqrt{\alpha^2+\beta^2},\gamma>0$ of Theorem \ref{thm:GeneralContinuous}. In fact $\bar{\alpha}> \alpha, \bar{\beta}> \beta, \bar{\gamma}<\gamma$, which implies that the conditions of Theorem \ref{thm:DiscreteNonConvex} are strictly stronger than those of Theorem \ref{thm:GeneralContinuous}. This is no surprise since, as we have already remarked, the solution set of \eqref{eq:ell1} depends not only on the geometry ($\theta_{ij}$) and the weights $(N_i)$ of the arrangement, but also on the distribution of the data points (parameters $\epsilon_i$ and $\mathcal{R}$).
We note that in contrast to condition \eqref{c:ContinuousDominance} of Theorem \ref{thm:GeneralContinuous}, $N_1$ now appears in both sides of condition \eqref{c:thmDiscreteNonConvexDominance} of Theorem \ref{thm:DiscreteNonConvex}. Nevertheless, under the assumption $c > \sqrt{2} \epsilon_1$, \eqref{c:thmDiscreteNonConvexDominance} is equivalent to the positivity of a quadratic polynomial in $N_1$, whose leading coefficient is positive, and hence it can always be satisfied for sufficiently large $N_1$.
Another interesting connection of Theorem \ref{thm:GeneralContinuous} to Theorem \ref{thm:DiscreteNonConvex}, is that the former can be seen as a limit version of the latter : dividing \eqref{c:thmDiscreteNonConvexDominance} and \eqref{eq:gammaBar} by $N_1$, letting $N_1,\dots,N_n$ go to infinity while keeping each ratio $N_i/N_1$ fixed, and recalling that $\epsilon_i \rightarrow 0$ as $N_i \rightarrow \infty$ and $\mathcal{R} \le D-1$, we recover the conditions of Theorem \ref{thm:GeneralContinuous}.
Next, we consider the linear programming recursion \eqref{eq:ConvexRelaxations}. At a conceptual level, the main difference between the linear programming recursion in \eqref{eq:ConvexRelaxations} and the continuous and discrete problems \eqref{eq:ContinuousProblem} and \eqref{eq:ell1}, respectively, is that
the behavior of \eqref{eq:ConvexRelaxations} depends highly on the initialization $\hat{\boldsymbol{n}}_0$. Intuitively, the closer $\hat{\boldsymbol{n}}_0$ is to $\boldsymbol{b}_1$, the more likely the recursion will converge to $\boldsymbol{b}_1$, with this likelihood becoming larger for larger $N_1$. The precise technical statement is as follows.
\begin{thm} \label{thm:LPDiscrete}
Let $\left\{\hat{\boldsymbol{n}}_k\right\}$ be the sequence generated by the linear programming recursion
\eqref{eq:ConvexRelaxations} by means of the simplex method, where $\hat{\boldsymbol{n}}_0 \in \mathbb{S}^{D-1}$ is an initial estimate for $\boldsymbol{b}_1$,
with principal angle from $\boldsymbol{b}_i$ equal to $\theta_{i,0}$. Suppose that $c> \sqrt{5} \epsilon_1$, and let $\theta_{\min}^{(1)}=\min_{i>1} \left\{\theta_{1i} \right\}$. If $\theta_{1,0}$ is small enough, i.e.,
\begin{align}
\sin(\theta_{1,0})<\min \left\{\sin\left(\theta_{\min}^{(1)}\right)-2\epsilon_1, \sqrt{1-(c^{-1}\epsilon_1)^2}-2c^{-1}\epsilon_1 \right\}, \label{c:theta10}
\end{align} and $N_1$ is large enough in the sense that
\begin{align}
N_1 > \max \left\{\mu,\frac{\nu+\sqrt{\nu^2+4\rho \tau }}{2 \tau} \right\}, \label{c:thmLPDiscreteDominance} \, \, \, \text{where}
\end{align}
\begin{align}
\mu &:= \max_{j\neq 1} \left\{
\frac{\sum_{i>1}N_i \sin(\theta_{i,0})+c^{-1}\epsilon_j N_j+\sum_{i\neq 1,j}N_i\left[2c^{-1}\epsilon_i-\sin(\theta_{ij}) \right]}{\sin(\theta_{1j})-\sin(\theta_{1,0})-2c^{-1}\epsilon_1}\right\}, \\
\nu &:= 2c^{-1}\epsilon_1\left(\beta+c^{-1}\mathcal{R}+c^{-1}\sum_{i>1}\epsilon_i N_i \right) + 2 \left[\sin(\theta_{1,0})+2c^{-1}\epsilon_1\right]\left(\alpha+2c^{-1}\sum_{i>1}\epsilon_i N_i\right), \\
\rho &:= \left(\alpha+2c^{-1}\sum_{i>1}\epsilon_i N_i\right)^2 + \left(\beta+c^{-1}\mathcal{R}+c^{-1}\sum_{i>1} \epsilon_i N_i\right)^2, \label{eq:rho} \\
\tau &:= \cos^2(\theta_{1,0})-4c^{-1}\epsilon_1 \sin(\theta_{1,0})-5(c^{-1}\epsilon_1)^2, \label{eq:sigma}
\end{align} \normalsize with $\alpha,\beta$ as in Theorem \ref{thm:GeneralContinuous}, then $\left\{\boldsymbol{n}_k\right\}$ converges to either $\boldsymbol{b}_1$ or $-\boldsymbol{b}_1$ in a finite number of steps.
\end{thm} The quantities appearing in Theorem \ref{thm:LPDiscrete} are harder to interpret than those of Theorem \ref{thm:DiscreteNonConvex}, but we can still give some intuition about their meaning. To begin with, the two inequalities in \eqref{c:thmLPDiscreteDominance} represent two distinct requirements that we enforced in our proof, which when combined, guarantee that the limit point of \eqref{eq:ConvexRelaxations} is $\pm \boldsymbol{b}_1$.
The first requirement is that no $\pm \boldsymbol{b}_i$ can be the limit point of \eqref{eq:ConvexRelaxations} for $i>1$; this is captured by a linear inequality of the form
\begin{align}
\mu \, N_1 + (\text{terms not depending on} \, \, N_1) >0,
\end{align} which is satisfied either for $N_1$ sufficiently large (if $\mu>0$) or for $N_1$ sufficiently small (if $\mu<0$). To avoid pathological situations where $N_1$ is required to be negative or less than $D-1$, it is natural to enforce $\mu$ to be positive. This is precisely achieved by inequality $\sin(\theta_{1,0})< \sin\left(\theta_{\min}^{(1)}\right)-2\epsilon_1$ in \eqref{c:theta10}, which is a quite natural condition itself: the initial estimate $\hat{\boldsymbol{n}}_0$ needs to be closer to $\boldsymbol{b}_1$ than any other normal $\boldsymbol{b}_i$ for $i>1$, and the more well-distributed the data $\boldsymbol{\mathcal{X}}_1$ are inside $\mathcal{H}_1$ (smaller $\epsilon_1$), the further $\hat{\boldsymbol{n}}_0$ can be from $\boldsymbol{b}_1$.
The second requirement that we employed in our proof is that the limit point of \eqref{eq:ConvexRelaxations} is one of the $\pm \boldsymbol{b}_1,\dots,\pm \boldsymbol{b}_n$; this is captured by requiring that a certain quadratic polynomial
\begin{align}
p(N_1):=\tau \, N_1^2 - \nu \, N_1 - \rho
\end{align}
in $N_1$ is positive. To avoid situations where the positivity of this polynomial contradicts the relation $N_1 > \mu$, it is important that we ask its leading coefficient $\tau$ to be positive, so that the second requirement is satisfied for $N_1$ large enough, and thus is compatible with $N_1 > \mu$. As it turns out, $\tau$ is positive only if the data $\boldsymbol{\mathcal{X}}_1$ are sufficiently well distributed in $\mathcal{H}_1$, which is captured by condition $c> \sqrt{5} \epsilon_1$ of Theorem \ref{thm:LPDiscrete}. Even so, this latter condition is not sufficient; instead $\sin(\theta_{1,0})< \sqrt{1-(c^{-1}\epsilon_1)^2}-2c^{-1}\epsilon_1$ is needed (as in \eqref{c:theta10}), which is once again very natural: the more well-distributed the data $\boldsymbol{\mathcal{X}}_1$ are inside $\mathcal{H}_1$ (smaller $\epsilon_1$), the further $\hat{\boldsymbol{n}}_0$ from $\boldsymbol{b}_1$ can be.
Next, notice that the conditions of Theorem \ref{thm:LPDiscrete} are not directly comparable to those of Theorem \ref{thm:DiscreteNonConvex}. Indeed, it may be the case that $\pm \boldsymbol{b}_1$ is not a global minimizer of the non-convex problem \eqref{eq:ell1}, yet the recursions \eqref{eq:ConvexRelaxations} do converge to $\boldsymbol{b}_1$, simply because $\hat{\boldsymbol{n}}_0$ is \emph{close} to $\boldsymbol{b}_1$. In fact, by \eqref{c:theta10} $\hat{\boldsymbol{n}}_0$ must be closer to $\boldsymbol{b}_1$ than $\boldsymbol{b}_i$ to $\boldsymbol{b}_1$ for any $i>1$, i.e., $\theta_{\min}^{(1)}>\theta_{1,0}$. Similarly to Theorems \ref{thm:GeneralContinuous} and \ref{thm:DiscreteNonConvex}, the more separated the hyperplanes $\mathcal{H}_i,\mathcal{H}_j$ are for $i,j>1$, the easier it is to satisfy condition \eqref{c:thmLPDiscreteDominance}. In contrast, $\mathcal{H}_{1}$ needs to be sufficiently separated from $\mathcal{H}_i$ for $i>1$, since otherwise $\mu$ becomes large. This has an intuitive explanation: the less separated $\mathcal{H}_1$ is from the rest of the hyperplanes, the \emph{less resolution} the linear program \eqref{eq:ConvexRelaxations} has in distinguishing $\boldsymbol{b}_1$ from $\boldsymbol{b}_i, \, i>1$. To increase this \emph{resolution}, one needs to either select $\hat{\boldsymbol{n}}_0$ very close to $\boldsymbol{b}_1$, or select $N_1$ very large. The acute reader may recall that the quantity $\alpha$ appearing in \eqref{eq:rho} becomes larger when $\mathcal{H}_1$ becomes separated from $\mathcal{H}_i, \, i>1$. Nevertheless, there are no inconsistency issues in controlling the size of $\mu$ and $\rho$. This is because $\alpha$ is always bounded from above by $\sum_{i>1} N_i$, i.e., $\alpha$ does not increase arbitrarily as the $\theta_{1i}$ increase. Another way to look at the consistency of condition \eqref{c:thmLPDiscreteDominance}, is that its RHS does not depend on $N_1$; hence one can always satisfy \eqref{c:thmLPDiscreteDominance} by selecting $N_1$ large enough.
\section{Proofs} \label{section:Proofs}
In this Section we prove Theorems \ref{prp:TwoPlanes}-\ref{prp:equiangular} associated to the continuous problem \eqref{eq:ContinuousProblem}, as well as Theorems \ref{thm:DiscreteNonConvex} and \ref{thm:LPDiscrete} associated to the discrete non-convex $\ell_1$ minimization problem \eqref{eq:ell1} and the recursion of linear programs \eqref{eq:ConvexRelaxations} respectively.
\subsection{Preliminaries on the continuous problem} \label{subsection:PreliminariesContinuous}
We start by noting that the objective function \eqref{eq:ContinuousProblem} is everywhere differentiable except at the points $\pm \boldsymbol{b}_1,\dots, \pm \boldsymbol{b}_n$, where its partial derivatives do not exist. For any $\boldsymbol{b} \in \mathbb{S}^{D-1}$ distinct from $\pm \boldsymbol{b}_i$, the gradient at $\boldsymbol{b}$ is given by
\begin{align}
\nabla_{\boldsymbol{b}} \mathcal{J} = -\sum_{i=1}^n \frac{\boldsymbol{b}_i^\top \boldsymbol{b}}{\left(1 - (\boldsymbol{b}_i^\top \boldsymbol{b})^2\right)^{\frac{1}{2}}} \boldsymbol{b}_i.
\end{align} Now let $\boldsymbol{b}^*$ be a global solution of \eqref{eq:ContinuousProblem} and suppose that $\boldsymbol{b}^* \neq \pm \boldsymbol{b}_i, \, \forall i \in [n]$. Then $\boldsymbol{b}^*$ must satisfy
the first order optimality condition
\begin{align}
\nabla_{\boldsymbol{b}} \mathcal{J}|_{\boldsymbol{b}^*} + \lambda^* \, \boldsymbol{b}^* = \boldsymbol{0},
\end{align} where $\lambda^*$ is a Lagrange multiplier. Equivalently, we have
\begin{align}
-\sum_{i=1}^n N_i \, \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)
\left(1-\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)^2 \right)^{-\frac{1}{2}} \boldsymbol{b}_i + \lambda^* \, \boldsymbol{b}^* = \boldsymbol{0}, \label{eq:Optimality}
\end{align} which implies that
\begin{align}
\sum_{i=1}^n N_i \, \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)^2
\left(1-\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)^2 \right)^{-\frac{1}{2}} \boldsymbol{b}^* = \sum_{i=1}^n N_i \, \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)
\left(1-\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)^2 \right)^{-\frac{1}{2}} \boldsymbol{b}_i, \label{eq:bStar}
\end{align} from which the next Lemma follows.
\begin{lem} \label{lem:bSpan}
Let $\boldsymbol{b}^*$ be a global solution of \eqref{eq:ContinuousProblem}. Then $\boldsymbol{b}^* \in \Span \left(\boldsymbol{b}_1,\dots,\boldsymbol{b}_n \right)$.
\end{lem}
\begin{proof}
If $\boldsymbol{b}^*$ is equal to some $\pm \boldsymbol{b}_i$, then the statement of the Lemma is certainly true. If $\boldsymbol{b}^* \neq \pm \boldsymbol{b}_i, \, \forall i \in [n]$, then $\boldsymbol{b}^*$ satisfies \eqref{eq:bStar}, from which again the statement is true.
\end{proof}
\subsection{Proof of Theorem \ref{prp:TwoPlanes}} \label{subsection:ProofTwoPlanes}
By Lemma \ref{lem:bSpan} any global solution must lie in the plane $\Span(\boldsymbol{b}_1,\boldsymbol{b}_2)$, and so our problem becomes planar, i.e., we may as well assume that the hyperplane arrangement $\boldsymbol{b}_1,\boldsymbol{b}_2$ is a line arrangement of $\mathbb{R}^2$. Note that $\boldsymbol{b}_1,\boldsymbol{b}_2 \in \mathbb{S}^1$ partition $\mathbb{S}^1$ in two arcs, and among these, only one arc has length $\theta$ strictly less than $\pi$; we denote this arc by $\mathfrak{a}$.
Next, recall that the continuous objective function for two hyperplanes can be written as
\begin{align}
\mathcal{J}(\boldsymbol{b}) =N_1 \left(1 - (\boldsymbol{b}_1^\top \boldsymbol{b})^2\right)^{\frac{1}{2}} + N_2 \left(1 - (\boldsymbol{b}_2^\top \boldsymbol{b})^2\right)^{\frac{1}{2}}, \, \, \, \boldsymbol{b} \in \mathbb{S}^1.
\end{align} Let $\boldsymbol{b}^*$ be a global solution, and suppose that $\boldsymbol{b}^* \not\in \mathfrak{a}$. If $-\boldsymbol{b}^* \in \mathfrak{a}$, then we can replace $\boldsymbol{b}_1,\boldsymbol{b}_2$ by $-\boldsymbol{b}_1,-\boldsymbol{b}_2$, an operation that does not change neither the arrangement nor the objective. After this replacement, we have that $\boldsymbol{b}^* \in \mathfrak{a}$. Finally suppose that neither $\boldsymbol{b}^*$ nor $-\boldsymbol{b}^*$ are inside $\mathfrak{a}$. Then replacing either $\boldsymbol{b}_1$ with $-\boldsymbol{b}_1$ or $\boldsymbol{b}_2$ with $-\boldsymbol{b}_2$, leads to $\boldsymbol{b}^* \in \mathfrak{a}$. Consequently, without loss of generality we may assume that $\boldsymbol{b}^*$ lies in $\mathfrak{a}$. Moreover, subject to a rotation and perhaps exchanging $\boldsymbol{b}_1$ with $\boldsymbol{b}_2$, we can assume that $\boldsymbol{b}_1$ is aligned with the positive $x$-axis and that the angle $\theta$ between $\boldsymbol{b}_1$ and $\boldsymbol{b}_2$, measured counter-clockwise, lies in $(0, \pi)$.
Then $\boldsymbol{b}^*$ is a global solution to
\begin{align}
\mathcal{J}(\boldsymbol{b}) =N_1 \left(1 - (\boldsymbol{b}_1^\top \boldsymbol{b})^2\right)^{\frac{1}{2}} + N_2 \left(1 - (\boldsymbol{b}_2^\top \boldsymbol{b})^2\right)^{\frac{1}{2}}, \, \, \, \boldsymbol{b} \in \mathbb{S}^1 \cap \mathfrak{a}.
\end{align}
Now, for any vector $\boldsymbol{b} \in \mathbb{S}^1 \cap \mathfrak{a}$, let $\theta_1,\theta_2=\theta - \theta_1$ be the angle between $\boldsymbol{b}$ and $\boldsymbol{b}_1,\boldsymbol{b}_2$ respectively. Then our objective can be written as
\begin{align}
\mathcal{J}(\boldsymbol{b}) = \tilde{\mathcal{J}}(\theta_1) = N_1 \sin(\theta_1) + N_2 \sin(\theta - \theta_1), \, \, \, \theta_1 \in [0,\theta].
\end{align} Taking first and second derivatives, we have
\begin{align}
\frac{\partial \tilde{\mathcal{J}}}{\partial \theta_1} &= N_1 \cos(\theta_1) - N_2 \cos(\theta-\theta_1) \\
\frac{\partial^2 \tilde{\mathcal{J}}}{\partial \theta_1^2} &=- N_1 \sin(\theta_1) - N_2 \sin(\theta-\theta_1).
\end{align} Since the second derivative is everywhere negative on $[0,\theta]$, $\tilde{\mathcal{J}}(\theta_1)$ is strictly concave on $[0,\theta]$ and so its minimum must be achieved at the boundary $\theta_1=0$ or $\theta_1=\theta$. This means that either $\boldsymbol{b}^* = \boldsymbol{b}_1$ or $\boldsymbol{b}^* = \boldsymbol{b}_2$.
\subsection{Proof of Theorem \ref{prp:Orthogonal}} \label{subsection:ProofOrthogonal}
For the sake of simplicity we assume $n=3$, the general case follows in a similar fashion. Letting $x_i := \boldsymbol{b}_i^\top \boldsymbol{b}$ and $y_i := \sqrt{1-x_i^2}$, \eqref{eq:bStar} can be
written as
\begin{align}
\left( N_1\frac{x_1^2}{y_1} + N_2\frac{x_2^2}{y_2} + N_3\frac{x_3^2}{y_3} \right) \boldsymbol{b}^* = N_1\frac{x_1}{y_1}\boldsymbol{b}_1 + N_2\frac{x_2}{y_2}\boldsymbol{b}_2 + N_3\frac{x_3}{y_3} \boldsymbol{b}_3. \label{eq:bStarxy}
\end{align} Taking inner products of \eqref{eq:bStarxy} with $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$ we respectively obtain
\begin{align}
\left( N_1\frac{x_1^2}{y_1} + N_2\frac{x_2^2}{y_2} + N_3\frac{x_3^2}{y_3} \right) x_1 &= N_1\frac{x_1}{y_1} + N_2\frac{x_2}{y_2} (\boldsymbol{b}_1^\top\boldsymbol{b}_2) + N_3\frac{x_3}{y_3} (\boldsymbol{b}_1^\top \boldsymbol{b}_3), \label{eq:xyBegin}\\
\left( N_1\frac{x_1^2}{y_1} + N_2\frac{x_2^2}{y_2} + N_3\frac{x_3^2}{y_3} \right) x_2 &= N_1\frac{x_1}{y_1}(\boldsymbol{b}_2^\top \boldsymbol{b}_1) + N_2\frac{x_2}{y_2} + N_3\frac{x_3}{y_3} (\boldsymbol{b}_2^\top \boldsymbol{b}_3), \\
\left( N_1\frac{x_1^2}{y_1} + N_2\frac{x_2^2}{y_2} + N_3\frac{x_3^2}{y_3} \right) x_3 &= N_1\frac{x_1}{y_1}(\boldsymbol{b}_3^\top \boldsymbol{b}_1) + N_2\frac{x_2}{y_2}(\boldsymbol{b}_3^\top \boldsymbol{b}_2) + N_3\frac{x_3}{y_3}. \label{eq:xyEnd}
\end{align} Since by Lemma \ref{lem:bSpan} $\boldsymbol{b}^*$ is a linear combination of $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$, we can assume that $D=3$. Suppose that $\boldsymbol{b}^* \neq \pm \boldsymbol{b}_i, \, \forall i \in [n]$. Now, suppose that $x_3=0$. Then we can not have either $x_1=0$ or $x_2=0$, otherwise $\boldsymbol{b}^*= \boldsymbol{b}_2$ or $\boldsymbol{b}^*=\boldsymbol{b}_1$ respectively. Hence $x_1,x_2 \neq 0$. Then equations
\eqref{eq:xyBegin}-\eqref{eq:xyEnd} imply that
\begin{align}
\frac{N_1}{y_1} = \frac{N_2}{y_2} \, \, \, \text{and} \, \, \, x_1^2+x_2^2=1.
\end{align} Taking into consideration the relations $x_i^2+y_i^2=1$, we deduce that
\begin{align}
y_1 = \frac{N_1}{\sqrt{N_1^2+N_2^2}}, \, \, \, y_2 = \frac{N_2}{\sqrt{N_1^2+N_2^2}}.
\end{align} Then
\begin{align}
\mathcal{J}(\boldsymbol{b}^*) = N_1y_1+N_2y_2+N_3y_3 = \sqrt{N_1^2+N_2^2}+N_3 > \mathcal{J}(\boldsymbol{b}_1) = N_2+N_3,
\end{align} which is a contradiction on the optimality of $\boldsymbol{b}^*$. Similarly, none of the $x_1,x_2$ can be zero, i.e. $x_1,x_2,x_3 \neq 0$. Then equations \eqref{eq:xyBegin}-\eqref{eq:xyEnd} imply that
\begin{align}
x_1^2+x_2^2+x_3^2 = 1, \, \, \, \frac{N_1}{y_1} = \frac{N_2}{y_2}=\frac{N_3}{y_3},
\end{align} which give
\begin{align}
y_i = \frac{N_i \sqrt{2}}{\sqrt{N_1^2+N_2^2+N_3^2}}, \, \, \, i=1,2,3.
\end{align} But then $\mathcal{J}(\boldsymbol{b}^*) = \sqrt{2 \left(N_1^2+N_2^2+N_3^2 \right)}> \mathcal{J}(\boldsymbol{b}_1) = N_2+N_3$. This contradiction shows that our hypothesis $\boldsymbol{b}^* \neq \pm \boldsymbol{b}_i, \, \forall i \in [n]$ is not valid, i.e.,
$\mathfrak{B}^* \subset \left\{\pm \boldsymbol{b}_1,\pm \boldsymbol{b}_2,\pm \boldsymbol{b}_3 \right\}$. The rest of the theorem follows by comparing the values $\mathcal{J}(\boldsymbol{b}_i), \, i \in [3]$.
\subsection{Proof of Theorem \ref{prp:equiangular}}
Without loss of generality, we can describe an equiangular arrangement of three hyperplanes of $\mathbb{R}^D$, with an equiangular arrangement of three planes of $\mathbb{R}^3$, with normals $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$ given by
\begin{align}
\boldsymbol{b}_1 &:= \mu \begin{bmatrix} 1+\alpha & \alpha & \alpha \end{bmatrix}^\top \\
\boldsymbol{b}_2 &:= \mu \begin{bmatrix} \alpha & 1+\alpha & \alpha \end{bmatrix}^\top \\
\boldsymbol{b}_3 &:= \mu \begin{bmatrix} \alpha & \alpha & 1+\alpha \end{bmatrix}^\top \\ \label{eq:b-equiangular}
\mu &:=\left[(1+\alpha)^2+2\alpha^2 \right]^{-\frac{1}{2}},
\end{align} with $\alpha$ a positive real number that determines the angle $\theta \in (0,\pi/2]$ of the arrangement, given by
\begin{align}
\cos (\theta) := \frac{2\alpha(1+\alpha)+\alpha^2}{(1+\alpha)^2+2\alpha^2}=
\frac{2\alpha+3\alpha^2}{1+2\alpha+3\alpha^2}.
\end{align} Since $N_1=N_2=N_3$, so our objective function essentially becomes
\begin{align}
\mathcal{J}(\boldsymbol{b}) &= \left(1 - (\boldsymbol{b}_1^\top \boldsymbol{b})^2\right)^{\frac{1}{2}} + \left(1 - (\boldsymbol{b}_2^\top \boldsymbol{b})^2\right)^{\frac{1}{2}}+ \left(1 - (\boldsymbol{b}_3^\top \boldsymbol{b})^2\right)^{\frac{1}{2}}, \, \, \, \boldsymbol{b} \in \mathbb{S}^2 \\
& = \sin(\theta_1) + \sin(\theta_2) + \sin(\theta_3), \label{eq:ContinuousEquiangular}
\end{align} where $\theta_i$ is the principal angle of $\boldsymbol{b}$ from $\boldsymbol{b}_i$. The next Lemma shows that any global minimizer $\boldsymbol{b}^*$ must have equal principal angles from at least two of the $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$.
\begin{lem} \label{lem:gPolynomial}
Let $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$ be an arrangement of equiangular planes in $\mathbb{R}^3$, with angle $\theta$ and weights $N_1=N_2=N_3$. Let $\boldsymbol{b}^*$ be a global minimizer of \eqref{eq:ContinuousProblem} and let $x_i :=\boldsymbol{b}_i^\top \boldsymbol{b}^*, \, y_i = \sqrt{1-x_i^2} \, i=1,2,3$. Then either $y_1=y_2$ or $y_1=y_3$ or $y_2=y_3$.
\end{lem}
\begin{proof}
If $\boldsymbol{b}^*$ is one of $\pm\boldsymbol{b}_1,\pm\boldsymbol{b}_2,\pm\boldsymbol{b}_3$, then the statement clearly holds, since if say $\boldsymbol{b}^*=\boldsymbol{b}_1$, then $y_2 = y_3 = \sin(\theta)$. So suppose that $\boldsymbol{b}^* \neq \pm \boldsymbol{b}_i, \, \forall i \in [3]$. Then $x_i,y_i$ must satisfy equations \eqref{eq:xyBegin}-\eqref{eq:xyEnd}, together with $x_i^2+y_i^2=1$. Allowing for $y_i$ to take the value zero, the $x_i,y_i$ must satisfy
\begin{align}
p_1 &:=x_1y_1y_2y_3+x_2y_3[z-x_1x_2]+x_3y_2[z-x_1x_3] = 0, \\
p_2 &:=x_1y_3[z-x_1x_2]+x_2y_1y_2y_3+x_3y_1[z-x_2x_3] = 0, \\
p_3 &:=x_1y_2[z-x_1x_3]+x_2y_1[z-x_2x_3]+x_3y_1y_2y_3 = 0, \\
q_1 &:= x_1^2+y_1^2-1, \\
q_2 &:= x_2^2+y_2^2-1, \\
q_3 &:= x_3^2+y_3^2-1,
\end{align} where $z:= \cos(\theta)$. Viewing the above system of equations as polynomial equations in the variables
$x_1,x_2,x_3,y_1,y_2,y_3,z$, standard Groebner basis \citep{Cox:2007} computations reveal that the polynomial
\begin{align}
g:=(1-z)(y_1^2-y_2^2)(y_1^2-y_3^2)(y_2^2-y_3^2)(y_1+y_2+y_3)
\end{align} \emph{lies in the ideal generated by} $p_i,q_i, \, i=1,2,3$. In simple terms, this means that $\boldsymbol{b}^*$ must satisfy
$g(x_i,y_i,z=\cos(\theta)) = 0$. However, the $y_i$ are by construction non-negative and can not be all zero. Moreover, $\theta>0$ so $1-z \neq 0$. This implies that
\begin{align}
(y_1^2-y_2^2)(y_1^2-y_3^2)(y_2^2-y_3^2) = 0,
\end{align} which in view of the non-negativity of the $y_i$ implies
\begin{align}
(y_1-y_2)(y_1-y_3)(y_2-y_3) = 0.
\end{align}
\end{proof} \noindent The next Lemma says that a global minimizer of $\mathcal{J}(\boldsymbol{b})$ is \emph{not far} from the arrangement.
\begin{lem} \label{prp:C1C2C3}
Let $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$ be an arrangement of equiangular planes in $\mathbb{R}^3$, with angle $\theta$ and weights $N_1=N_2=N_3$. Let $\boldsymbol{\mathcal{C}}_i$ be the spherical cap with center $\boldsymbol{b}_i$ and radius $\theta$. Then any global minimizer of \eqref{eq:ContinuousEquiangular} must lie (up to a sign) either on the boundary or the interior of $\boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2 \cap \boldsymbol{\mathcal{C}}_3$.
\end{lem}
\begin{proof} First of all notice that $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$ lie on the boundary of $\boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2 \cap \boldsymbol{\mathcal{C}}_3$.
Let $\boldsymbol{b}^*$ be a global minimizer.
If $\theta = \pi/2$, we have already seen in Proposition \ref{prp:Orthogonal} that $\boldsymbol{b}^*$ has to be one of the vertices $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$ (up to a sign); so suppose that $\theta<\pi/2$. Let $\theta_i^*$ be the principal angle of $\boldsymbol{b}^*$ from $\boldsymbol{b}_i$. Then at least two of $\theta_1^*,\theta_2^*,\theta_3^*$ must be less or equal to $\theta$; for if say $\theta_1^*,\theta_2^* > \theta$, then $\boldsymbol{b}_3$ would give a smaller objective than $\boldsymbol{b}^*$. Hence,
without loss of generality we may assume that $\theta_1^*,\theta_2^* \le \theta$. In addition, because of Lemma \ref{lem:gPolynomial}, we can further assume without loss of generality that $\theta_1^* = \theta_2^*$. Let $\boldsymbol{\zeta}$ be the vector in the small arc that joins $\frac{1}{\sqrt{3}} \boldsymbol{1}$ and $\boldsymbol{b}_3$ and has angle from $\boldsymbol{b}_1,\boldsymbol{b}_2$ equal to $\theta_1^*$. Since $\mathcal{J}(\boldsymbol{b}^*) \le \mathcal{J}(\boldsymbol{\zeta})$, it must be the case that the principal angle $\theta_3^*$ is less or equal to $\theta$ (because the angle of $\boldsymbol{\zeta}$ from $\boldsymbol{b}_3$ is $\le \theta$). We conclude that $\theta_1^*,\theta_2^*,\theta_3^* \le \theta$. Consequently, there exist $i \neq j$ such that up to a sign $\boldsymbol{b}^* \in \boldsymbol{\mathcal{C}}_i \cap \boldsymbol{\mathcal{C}}_j$. Let us assume without loss of generality that $\boldsymbol{b}^* \in \boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2$, i.e., $\theta_1^*, \theta_2^*$ are the angles of $\boldsymbol{b}^*$ from $\boldsymbol{b}_1,\boldsymbol{b}_2$ (notice that now it may no longer be the case that $\theta_1^* = \theta_2^*$).
Notice that the boundaries of $\boldsymbol{\mathcal{C}}_1$ and $\boldsymbol{\mathcal{C}}_2$ intersect at two points: $\boldsymbol{b}_3$ and its reflection $\tilde{\boldsymbol{b}}_3$ with respect to the plane $\mathcal{H}_{12}$ spanned by $\boldsymbol{b}_1,\boldsymbol{b}_2$.
In fact, $\mathcal{H}_{12}$ divides $\boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2$ in two halves, $\mathcal{Y},\tilde{\mathcal{Y}}$, with $\mathcal{Y}$ being the reflection of $\tilde{\mathcal{Y}}$ with respect to $\mathcal{H}_{12}$. Letting $\tilde{\boldsymbol{\mathcal{C}}}_3$ be the spherical cap of radius $\theta$ around $\tilde{\boldsymbol{b}}_3$, we can write
\begin{align}
\boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2 = (\boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2 \cap \boldsymbol{\mathcal{C}}_3) \cup (\boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2 \cap \tilde{\boldsymbol{\mathcal{C}}}_3).
\end{align} If $\boldsymbol{b}^* \in \boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2 \cap \boldsymbol{\mathcal{C}}_3$ we are done, so let us assume that $\boldsymbol{b}^* \in \boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2 \cap \tilde{\boldsymbol{\mathcal{C}}}_3$.
Let $\tilde{\boldsymbol{b}}^*$ be the reflection of $\boldsymbol{b}^*$ with respect to $\mathcal{H}_{12}$. This reflection preserves the angles from $\boldsymbol{b}_1$ and $\boldsymbol{b}_2$. We will show that $\tilde{\boldsymbol{b}}^*$ has a smaller principal angle $\tilde{\theta}^*_3$ from $\boldsymbol{b}_3$ than $\boldsymbol{b}^*$. In fact the spherical angle of $\tilde{\boldsymbol{b}}^*$ from $\boldsymbol{b}_3$ is $\tilde{\theta}_3^*$ itself, and this is precisely the angle of $\boldsymbol{b}^*$ from $\tilde{\boldsymbol{b}}_3$. Denote by $H_{3,\tilde{3}}$ the plane spanned by $\boldsymbol{b}_3$ and $\tilde{\boldsymbol{b}}_3$, $\bar{\boldsymbol{b}}^*$ the spherical projection of $\boldsymbol{b}^*$ onto $H_{3,\tilde{3}}$, $\gamma$
the angle between $\bar{\boldsymbol{b}}^*$ and $\boldsymbol{b}^*$, $\alpha$ the angle between $\bar{\boldsymbol{b}}^*$ and $\boldsymbol{b}_3$, and $\tilde{\alpha}$ the angle between $\bar{\boldsymbol{b}}^*$ and $\tilde{\boldsymbol{b}}_3$. Then the spherical law of cosines gives
\begin{align}
\cos(\tilde{\theta}_3^*) &= \cos(\tilde{\alpha}) \cos(\gamma), \\
\cos(\theta_3^*) &= \cos(\alpha) \cos(\gamma).
\end{align} Letting $2 \psi$ be the angle between $\boldsymbol{b}_3$ and $\tilde{\boldsymbol{b}}_3$, we have that
\begin{align}
\alpha = \psi + (\psi - \tilde{\alpha}).
\end{align} By hypothesis $\tilde{\alpha} < \psi$ and so $\alpha > \psi$. If $2 \psi \le \pi/2$, then $\alpha$ is an acute angle and $\cos(\tilde{\alpha}) > \cos(\alpha) $. If $2 \psi > \pi/2$, then $\cos(\tilde{\alpha}) \le \cos(\alpha) $ only when $\pi - (2\psi-\tilde{\alpha}) \le \tilde{\alpha} \Leftrightarrow \psi \ge \pi/2$. But by construction $\psi \le \pi/2$ and equality is achieved only when $\theta = \pi/2$. Hence, we conclude that $\cos(\tilde{\alpha}) > \left| \cos(\alpha) \right|$, which implies that
$\cos(\tilde{\theta}_3) > \left| \cos(\theta_3) \right|$. This in turn means that $\mathcal{J}(\tilde{\boldsymbol{b}}^*) < \mathcal{J}(\boldsymbol{b}^*)$, which is a contradiction.
\end{proof}
\begin{lem} \label{lem:Signs}
Let $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$ be an arrangement of equiangular planes in $\mathbb{R}^3$, with angle $\theta$ and weights $N_1=N_2=N_3$. Let $\boldsymbol{b}^*$ be a global minimizer of \eqref{eq:ContinuousProblem} and let $x_i :=\boldsymbol{b}_i^\top \boldsymbol{b}^*, \, i=1,2,3$. Then either $x_1,x_2,x_3$ are all non-negative or they are all non-positive.
\end{lem}
\begin{proof}
By Lemma \ref{prp:C1C2C3}, we know that either $\boldsymbol{b}^* \in \boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2 \cap \boldsymbol{\mathcal{C}}_3$ or $-\boldsymbol{b}^* \in \boldsymbol{\mathcal{C}}_1 \cap \boldsymbol{\mathcal{C}}_2 \cap \boldsymbol{\mathcal{C}}_3$. In the first case, the angles of $\boldsymbol{b}^*$ from $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$ are less or equal to $\theta \le \pi/2$.
\end{proof} Now, Lemmas \ref{lem:gPolynomial} and \ref{lem:Signs} show that $\boldsymbol{b}^*$ is a global minimizer of problem
\begin{align}
\min_{\boldsymbol{b} \in \mathbb{S}^2} \left\{\sqrt{1-(\boldsymbol{b}_1^\top \boldsymbol{b})^2}+\sqrt{1-(\boldsymbol{b}_2^\top \boldsymbol{b})^2}+\sqrt{1-(\boldsymbol{b}_3^\top \boldsymbol{b})^2} \right\} \label{eq:ContinuousEquiangularEquiweight3}
\end{align} if and only if it is a global minimizer of problem
\begin{align}
&\min_{\boldsymbol{b} \in \mathbb{S}^2} \left\{\sqrt{1-(\boldsymbol{b}_1^\top \boldsymbol{b})^2}+\sqrt{1-(\boldsymbol{b}_2^\top \boldsymbol{b})^2}+\sqrt{1-(\boldsymbol{b}_3^\top \boldsymbol{b})^2}\right\} , \\
&\text{s.t.} \, \, \, \boldsymbol{b}_i^\top \boldsymbol{b} = \boldsymbol{b}_j^\top \boldsymbol{b}, \, \, \, \text{for some} \, \, \, i \neq j \in [3]. \label{eq:ContinuousDissection}
\end{align} So suppose without loss of generality that $\boldsymbol{b}^*$ is a global minimizer of \eqref{eq:ContinuousDissection} corresponding to indices $i=1,j=2$. Then $\boldsymbol{b}^*$ lives in the vector space
\begin{align}
\mathcal{V}_{12} = \Span \left(\begin{bmatrix}1 \\ 1 \\boldsymbol{0} \end{bmatrix}, \begin{bmatrix}0 \\ 0 \\boldsymbol{1} \end{bmatrix}\right),
\end{align} which consists of all vectors that have equal angles from $\boldsymbol{b}_1$ and $\boldsymbol{b}_2$. Taking into consideration that $\boldsymbol{b}^*$ also lies in $\mathbb{S}^2$, we have the parametrization
\begin{align}
\boldsymbol{b}^* = \frac{1}{\sqrt{2v^2+w^2}} \begin{bmatrix} v \\ v \\boldsymbol{w}\end{bmatrix}.
\end{align} The choice $v=0$, corresponding to $\boldsymbol{b}^*=\boldsymbol{e}_3$ (the third standard basis vector), can be excluded, since $\boldsymbol{b}_3$ always results in a smaller objective: moving $\boldsymbol{b}$ from $\boldsymbol{e}_3$ to $\boldsymbol{b}_3$ while staying in the plane $\mathcal{V}_{12}$ results in decreasing angles of $\boldsymbol{b}$ from $\boldsymbol{b}_1,\boldsymbol{b}_2,\boldsymbol{b}_3$. Consequently, we can assume $v=1$, and our problem becomes an unconstrained one, with objective
\begin{align}
\mathcal{J}(w) = \frac{2\left[(2+w^2)(1+2\alpha+3\alpha^2)-(\alpha w+2\alpha +1)^2\right]^{1/2}+\sqrt{2}\left|a-aw+1\right|}{\left[(2+w^2)(1+2\alpha+3\alpha^2) \right]^{1/2}}. \label{eq:Jw}
\end{align} Now, it can be shown that:
\begin{itemize}
\item The following quantity is always positive
\begin{align}
u:=(2+w^2)(1+2\alpha+3\alpha^2)-(\alpha w+2\alpha +1)^2. \label{eq:u}
\end{align}
\item The choice $w = 1+1/\alpha$ corresponds to $\boldsymbol{b}^*=\boldsymbol{b}_3$, and that is precisely the only point where $\mathcal{J}(w)$ is non-differentiable.
\item The choice $w=1$ corresponds to $\boldsymbol{b}^*=\frac{1}{\sqrt{3}} \boldsymbol{1}$.
\item The choice $\alpha=1/3$ corresponds to $\theta=60^\circ$.
\item $\mathcal{J}(\boldsymbol{b}_3) = \mathcal{J}\left(\frac{1}{\sqrt{3}} \boldsymbol{1}\right)$ precisely for $\alpha = 1/3$.
\end{itemize} Since for $\alpha=0$ the theorem has already been proved (orthogonal case), we will assume that $\alpha >0$. We proceed by showing that for $\alpha \in (0,1/3)$ and for $w \neq 1+1/a$, it is always the case that $\mathcal{J}(w)>\mathcal{J}(1+1/a)$. Expanding this last inequality, we obtain
\small
\begin{align}
\frac{2\left[(2+w^2)(1+2\alpha+3\alpha^2)-(\alpha w+2\alpha +1)^2\right]^{1/2}+\sqrt{2}\left|a-aw+1\right|}{\left[(2+w^2)(1+2\alpha+3\alpha^2) \right]^{1/2}}> \frac{2\sqrt{1+4\alpha+6\alpha^2}}{1+2\alpha+3\alpha^2},
\end{align} \normalsize which can be written equivalently as
\begin{align}
p_1&<4\sqrt{2} u^{1/2}\left|\alpha-\alpha w +1 \right|(1+2\alpha+3\alpha^2) , \, \, \, \text{where} \label{eq:p1Inequality} \\
p_1 &:= 4(2+w^2)(1+4\alpha+6 \alpha^2)-(1+2\alpha+3\alpha^2)\left[4u+2(\alpha-\alpha w+1)^2\right],
\end{align} and $u$ has been defined in \eqref{eq:u}. Viewing $p_1$ as a polynomial in $w$, $p_1$ has two real roots given by
\begin{align}
r_{p_1}^{(1)} := 1+1/\alpha \, \, \, >\, \, \, r_{p_1}^{(2)} :=\frac{-1-7\alpha+\alpha^2+15\alpha^3}{\alpha(7+22\alpha+15\alpha^2)}.
\end{align} Since the leading coefficient of $p_1$ is always a negative function of $\alpha$ (for $\alpha>0$), \eqref{eq:p1Inequality} will always be true for $w \not\in [r_{p_1}^{(2)},r_{p_1}^{(1)} ]$, in which interval $p_1$ is strictly negative. Consequently, we must show that as long as $\alpha \in (0,1/3)$, \eqref{eq:p1Inequality} is true for every $w \in [r_{p_1}^{(2)},r_{p_1}^{(1)} )$. For such $w$, $p_1$ is non-negative and by squaring \eqref{eq:p1Inequality}, we must show that
\begin{align}
p_2>&0, \, \, \, \forall w \in [r_{p_1}^{(2)},r_{p_1}^{(1)} ), \, \, \, \forall \alpha \in (0,1/3), \\
p_2:=& 32u(\alpha-\alpha w +1)^2(1+2\alpha +3 \alpha^2)-p_1^2.
\end{align} Interestingly, $p_2$ admits the following factorization
\begin{align}
p_2 =&
-4 (-1 - \alpha + \alpha w)^2 p_3, \\
p_3:=&-7 - 18 \alpha - 49 \alpha^2 - 204 \alpha^3 - 441 \alpha^4 -
162 \alpha^5 + 81 \alpha^6 \nonumber \\
&+ (30 \alpha + 238 \alpha^2 + 612 \alpha^3 + 468 \alpha^4 -
162 \alpha^5 - 162 \alpha^6 )w \nonumber \\
& +(- 8 - 48 \alpha - 111 \alpha^2 -
12 \alpha^3 + 270 \alpha^4 + 324 \alpha^5 + 81 \alpha^6) w^2
\end{align} The discriminant of $p_3$ is the following $10$-degree polynomial in $\alpha$:
\begin{align}
\Delta(p_3)&=32 (-7 - 60 \alpha - 226 \alpha^2 - 312\alpha^3 + 782 \alpha^4 + 5160 \alpha^5 + 13500 \alpha^6 + \nonumber \\
&+ 21816 \alpha^7
+ 22761 \alpha^8 + 14580 \alpha^9 + 4374 \alpha^{10}).
\end{align} By Descartes rule of signs, $\Delta(p_3)$ has precisely one positive root. In fact this root is equal to $1/3$. Since the leading coefficient of $\Delta(p_3)$ is positive, we must have that
$\Delta(p_3)<0, \, \forall \alpha \in (0,1/3)$, and so for such $\alpha$, $p_3$ has no real roots, i.e. it will be either everywhere negative or everywhere positive. Since $p_3(\alpha=1/4,w=1)=-80327/4096$, we conclude that as long as $\alpha \in (0,1/3)$, $p_3$ is everywhere negative and as long as
$w \neq 1+1/\alpha$, $p_2$ is positive, i.e. we are done.
Moving on to the case $\alpha =1/3$, we have
\begin{align}
p_2(\alpha=1/3,w) = \frac{128}{9}(w-4)^2(w-1)^2,
\end{align} which shows that for such $\alpha$ the only global minimizers are $\pm \boldsymbol{b}_3$ and $\pm \frac{1}{\sqrt{3}} \boldsymbol{1}$.
In a similar fashion, we can proceed to show that $\mathcal{J}(w)>\mathcal{J}\left(\frac{1}{\sqrt{3}} \boldsymbol{1}\right)$, for all $w \neq 1$ and all $\alpha \in (1/3,\infty)$. However, the roots of the polynomials that arise are more complicated functions of $\alpha$ and establishing the inequality $\mathcal{J}(w)>\mathcal{J}\left(\frac{1}{\sqrt{3}} \boldsymbol{1}\right)$ analytically, seems intractable; instead this can be done if one allows for numeric computation of polynomial roots.
\subsection{Proof of Theorem \ref{thm:GeneralContinuous}}
We begin with two Lemmas.
\begin{lem} \label{lem:Jdagger}
Let $\boldsymbol{b}_1,\dots,\boldsymbol{b}_n$ be vectors of $\mathbb{S}^{D-1}$, with pairwise principal angles $\theta_{ij}$. Then
\begin{align}
\max_{\boldsymbol{b}^\top \boldsymbol{b}=1}\, \, \, \left[ N_1\left|\boldsymbol{b}_1^\top \boldsymbol{b} \right|+\cdots+N_n\left|\boldsymbol{b}_n^\top \boldsymbol{b} \right|\right] \le \left[\sum_{i} N_i^2 + 2 \sum_{i \neq j} N_i N_j\cos(\theta_{ij}) \right]^{1/2}.
\end{align}
\end{lem}
\begin{proof}
Let $\boldsymbol{b}^{\dagger}$ be a maximizer of $ N_1\left|\boldsymbol{b}_1^\top \boldsymbol{b} \right|+\cdots+N_n\left|\boldsymbol{b}_n^\top \boldsymbol{b} \right|$. Then $\boldsymbol{b}^\dagger$ must satisfy the first order optimality condition, which is
\begin{align}
\lambda^{\dagger} \boldsymbol{b}^\dagger = \sum_i N_i \Sgn(\boldsymbol{b}_i^\top \boldsymbol{b}^\dagger) \boldsymbol{b}_i ,
\end{align} where $\lambda^\dagger$ is a Lagrange multiplier and $\Sgn(\boldsymbol{b}_i^\top \boldsymbol{b}^\dagger)$ is the subdifferential of $\left|\boldsymbol{b}_i^\top \boldsymbol{b}^\dagger \right|$. Then
\begin{align}
\lambda^\dagger \boldsymbol{b}^\dagger = N_1 s_1^\dagger \boldsymbol{b}_1+\cdots+N_n s_n^\dagger \boldsymbol{b}_n, \label{eq:bDaggerGeneric}
\end{align} where $s_i^\dagger = \Sign(\boldsymbol{b}_i^\top \boldsymbol{b}^\dagger)$, if $\boldsymbol{b}_i^\top \boldsymbol{b}^\dagger \neq 0$, and $s_i^\dagger \in [-1,1]$ otherwise. Recalling that $\left\| \boldsymbol{b}^\dagger \right\|_2=1$, and taking equality of $2$-norms on both sides of \eqref{eq:bDagger}, we get
\begin{align}
\boldsymbol{b}^\dagger = \frac{N_1s_1^\dagger \boldsymbol{b}_1 + \cdots + N_ns_n^\dagger \boldsymbol{b}_n}{\left\|N_1s_1^\dagger \boldsymbol{b}_1 + \cdots + N_ns_n^\dagger \boldsymbol{b}_n \right\|_2}. \label{eq:bDagger}
\end{align} Now
\begin{align}
\sum_{i} N_i\left|\boldsymbol{b}_i^\top \boldsymbol{b}^\dagger \right| &= \sum_{i: \boldsymbol{b}^\dagger \not\perp \boldsymbol{b}_i} N_i\left|\boldsymbol{b}_i^\top \boldsymbol{b}^\dagger \right| = \sum_{i: \boldsymbol{b}^\dagger \not\perp \boldsymbol{b}_i} N_is_i^\dagger \boldsymbol{b}_i^\top \boldsymbol{b}^\dagger = \left(\boldsymbol{b}^\dagger\right)^\top \left( \sum_{i: \boldsymbol{b}^\dagger \not\perp \boldsymbol{b}_i} N_is_i^\dagger \boldsymbol{b}_i\right) \nonumber \\
&= \left(\boldsymbol{b}^\dagger\right)^\top \left( \sum_{i: \boldsymbol{b}^\dagger \not\perp \boldsymbol{b}_i} N_is_i^\dagger \boldsymbol{b}_i + \sum_{i: \boldsymbol{b}^\dagger \perp \boldsymbol{b}_i} N_is_i^\dagger \boldsymbol{b}_i\right) = \left(\boldsymbol{b}^\dagger\right)^\top \left( \sum_{i} N_is_i^\dagger \boldsymbol{b}_i \right) \nonumber \\
&\stackrel{\eqref{eq:bDagger}}{=} \left\|N_1s_1^\dagger \boldsymbol{b}_1 + \cdots + N_ns_n^\dagger \boldsymbol{b}_n \right\|_2 = \left[\sum_i \left(s_i^\dagger N_i\right)^2 +2 \sum_{i \neq j} N_i N_j s_i^\dagger s_j^\dagger \boldsymbol{b}_i^\top \boldsymbol{b}_j \right]^{1/2} \nonumber \\
&\le \left[\sum_{i} N_i^2 + 2 \sum_{i \neq j} N_i N_j\cos(\theta_{ij}) \right]^{1/2}.
\end{align}
\end{proof}
\begin{lem} \label{lem:Jlowerbound}
Let $\boldsymbol{b}_1,\dots,\boldsymbol{b}_n$ be a hyperplane arrangement of $\mathbb{R}^D$ with integer weights $N_1,\dots,N_n$ assigned. For $\boldsymbol{b} \in \mathbb{S}^{D-1}$, let $\theta_i$ be the principal angle between $\boldsymbol{b}$ and $\boldsymbol{b}_i$. Then
\begin{align}
\min_{\boldsymbol{b} \in \mathbb{S}^{D-1}} \sum N_i \sin(\theta_i) \ge \sqrt{\sum N_i^2-\sigma_{\max}\left(\left[N_iN_j\cos(\theta_{ij})\right]_{i,j}
\right)},
\end{align} where $\sigma_{\max}\left(\left[N_iN_j\cos(\theta_{ij})\right]_{i,j}\right)$ denotes the maximal eigenvalue of the $n \times n$ matrix, whose
$(i,j)$ entry is $N_i N_j \cos(\theta_{ij})$ and $1 \le i,j \le n$.
\end{lem}
\begin{proof}
For any vector $\boldsymbol{\xi}$ we have that
$\left\|\boldsymbol{\xi} \right\|_1 \ge \left\|\boldsymbol{\xi} \right\|_2$. Let $\psi_i \in [0,180^\circ]$ be the angle between $\boldsymbol{b}$ and $\boldsymbol{b}_i$. Then
\begin{align}
&\sum N_i \sin(\theta_i) = \sum N_i \left| \sin(\psi_i) \right| \stackrel{\left\|\cdot \right\|_1 \ge \left\|\cdot \right\|_2}{\ge } \sqrt{\sum N_i^2 \sin^2(\psi_i)} \\
&= \sqrt{\sum N_i^2 - \sum N_i^2 \cos^2(\psi_{i})}.
\end{align} Hence $N_i \sin(\theta_i)$ is minimized when
$\sum N_i^2 \cos^2(\psi_{i})$ is maximized. But
\begin{align}
\sum N_i^2 \cos^2(\psi_{i}) = \boldsymbol{b}^\top \left (\sum N_i^2 \boldsymbol{b}_i \boldsymbol{b}_i^\top \right) \boldsymbol{b},
\end{align} and the maximum value of $\sum N_i^2 \cos^2(\psi_{i})$ is equal to the maximal eigenvalue
of the matrix
\begin{align}
\sum N_i^2 \boldsymbol{b}_i \boldsymbol{b}_i^\top=\begin{bmatrix} N_1 \boldsymbol{b}_1 & \cdots & N_n \boldsymbol{b}_n \end{bmatrix} \begin{bmatrix} N_1 \boldsymbol{b}_1 & \cdots & N_n \boldsymbol{b}_n \end{bmatrix}^\top,
\end{align} which is the same as the maximal eigenvalue of the matrix
\begin{align}
\begin{bmatrix} N_1 \boldsymbol{b}_1 & \cdots & N_n \boldsymbol{b}_n \end{bmatrix}^\top \begin{bmatrix} N_1 \boldsymbol{b}_1 & \cdots & N_n \boldsymbol{b}_n \end{bmatrix} = \left[N_i N_j \cos(\psi_{ij})\right]_{i,j},
\end{align} where $\psi_{ij}$ is the angle between $\boldsymbol{b}_i,\boldsymbol{b}_j$. Now, if $\boldsymbol{A}$ is a matrix and we denote by
$\left|\boldsymbol{A} \right|$ the matrix that arises by taking absolute values of each element in the matrix $\boldsymbol{A}$, then it is known that $\sigma_{\max}(\left|\boldsymbol{A} \right|) \ge \sigma_{\max}(\boldsymbol{A})$. Hence the result follows by recalling that $\left|\cos(\psi_{ij})\right| = \cos(\theta_{ij})$.
\end{proof} Now, let $\boldsymbol{b}^*$ be a global solution of \eqref{eq:ContinuousProblem}.
Suppose for the sake of a contradiction that $\boldsymbol{b}^* \not\perp \mathcal{H}_i, \forall i \in [n]$, i.e., $\boldsymbol{b}^* \neq \pm \boldsymbol{b}_i, \, \forall i \in [n]$. Consequently, $\mathcal{J}$ is differentiable at $\boldsymbol{b}^*$ and so $\boldsymbol{b}^*$ must satisfy \eqref{eq:Optimality}, which we repeat here for convenience:
\begin{align}
-\sum_{i=1}^n N_i \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)
\left(1-\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)^2 \right)^{-\frac{1}{2}} \boldsymbol{b}_i + \lambda^* \, \boldsymbol{b}^* = \boldsymbol{0}. \label{eq:AbstractOptimalityRepeated}
\end{align}Projecting \eqref{eq:AbstractOptimalityRepeated} orthogonally onto the hyperplane $\mathcal{H}^*$ defined by $\boldsymbol{b}^*$ we get
\begin{align}
-\sum_{i=1}^n N_i \, \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)
\left(1-\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)^2 \right)^{-\frac{1}{2}} \pi_{\mathcal{H}^*} \left(\boldsymbol{b}_i\right)=\boldsymbol{0}. \label{eq:AbstractOptimalityProjected}
\end{align} Since $\boldsymbol{b}^* \neq \boldsymbol{b}_i, \, \forall i \in [n]$, it will be the case that $\boldsymbol{h}_i:= \pi_{\mathcal{H}^*} \left(\boldsymbol{b}_i\right) \neq \boldsymbol{0}, \, \forall i \in [n]$. Since
\begin{align}
\left\|\pi_{\mathcal{H}^*} \left(\boldsymbol{b}_i\right) \right\|_2 = \left(1-\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)^2 \right)^{\frac{1}{2}}>0,
\end{align} equation \eqref{eq:AbstractOptimalityProjected} can be written as
\begin{align}
\sum_{i=1}^n N_i \, \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right) \hat{\boldsymbol{h}}_i = \boldsymbol{0}, \label{eq:OptimalityProjectedNormalized}
\end{align} which in turn gives
\begin{align}
N_1 \, \left|\boldsymbol{b}_1^\top \boldsymbol{b}^* \right| \le \left\|\sum_{i>1} N_i \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right) \hat{\boldsymbol{h}}_i \right\|_2 \le \sum_{i>1} N_i \, \left|\boldsymbol{b}_i^\top \boldsymbol{b}^* \right| \le \max_{\boldsymbol{b}^\top \boldsymbol{b}=1} \sum_{i>1} N_i \, \left|\boldsymbol{b}_i^\top \boldsymbol{b} \right|
\stackrel{Lem. \ref{lem:Jdagger}}{\le} \beta. \label{eq:theta1thetadagger}
\end{align} Since by hypothesis $N_1 > \beta$, we can define an angle $\theta_1^\dagger$ by
\begin{align}
\cos(\theta_1^\dagger):= \frac{\beta}{N_1},
\end{align} and so \eqref{eq:theta1thetadagger} says that $\theta_1$ can not drop below $\theta_1^\dagger$. Hence $\mathcal{J}(\boldsymbol{b}^*)$ can be bounded from below as follows:
\begin{align}
\mathcal{J}(\boldsymbol{b}^*) &= N_1\sin(\theta_1^*) + \sum_{i>1} N_i\sin(\theta_i^*) \ge N_1\sin(\theta_1^\dagger)+\min_{\boldsymbol{b}^\top \boldsymbol{b}=1} \sum_{i>1} N_i\sin(\theta_i) \\
& \stackrel{Lem. \ref{lem:Jlowerbound}}{\ge} N_1\sin(\theta_1^\dagger) + \sqrt{\sum_{i>1}N_i^2-\sigma_{\max}\left(\left[N_iN_j\cos(\theta_{ij})\right]_{i,j>1}\right)}. \label{eq:AbstractJbstar_FirstBound}
\end{align} By the optimality of $\boldsymbol{b}^*$, we must also have $\mathcal{J}(\boldsymbol{b}_1) \ge \mathcal{J}(\boldsymbol{b}^*)$, which in view of \eqref{eq:AbstractJbstar_FirstBound} gives
\begin{align}
\sum_{i>1} N_i \sin(\theta_{1i}) \ge N_1\sin(\theta_1^\dagger) + \sqrt{\sum_{i>1}N_i^2-\sigma_{\max}\left(\left[N_iN_j\cos(\theta_{ij})\right]_{i,j>1}\right)}.
\end{align} Now, a little algebra reveals that this latter inequality is precisely the negation of hypothesis $N_1 > \sqrt{\alpha^2 + \beta^2}$. This shows that $\boldsymbol{b}^*$ has to be $\pm \boldsymbol{b}_i$, for some $i \in [n]$. For the last statement of the Theorem, notice that condition $\gamma >0$ is equivalent to saying that $\mathcal{J}(\boldsymbol{b}_1) < \mathcal{J}(\boldsymbol{b}_i), \, \forall i >1$.
\subsection{Proof of Theorem \ref{thm:DiscreteNonConvex}}
Let us first derive an upper bound $\theta^{(1)}_{\max}$ on how large $\theta_1^*$ can be. Towards that end, we derive a lower bound on the objective function $\mathcal{J}(\boldsymbol{b})$ in terms of $\theta_1$: For any vector $\boldsymbol{b} \in \mathbb{S}^{D-1}$ we can write
\begin{align}
&\mathcal{J}(\boldsymbol{b}) =\left\| \boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_1= \sum \left\|\boldsymbol{\mathcal{X}}_i^\top \boldsymbol{b} \right\|_1 = \sum N_i \boldsymbol{b}^\top \boldsymbol{\chi}_{i,\boldsymbol{b}} \\
&= \sum c N_i \sin(\theta_i) + \sum N_i\boldsymbol{b}^\top \boldsymbol{\eta}_{i,\boldsymbol{b}}, \, \, \, \left\|\boldsymbol{\eta}_{i,\boldsymbol{b}} \right\|_2 \le \epsilon_i \\
& \ge c \sum N_i \sin(\theta_i) - \sum \epsilon_i N_i \\
& = c N_1 \sin(\theta_{1}) + c\sum_{i>1} N_i \sin(\theta_i) - \sum \epsilon_i N_i \\
& \ge c N_1 \sin(\theta_{1}) + c \min_{\boldsymbol{b}^\top \boldsymbol{b} =1} \left[\sum_{i>1} N_i \sin(\theta_i)\right]- \sum \epsilon_i N_i \\
& \stackrel{Lem. \ref{lem:Jlowerbound}}{\ge} c N_1 \sin(\theta_{1}) + c\sqrt{\sum_{i>1}N_i^2-\sigma_{\max}\left(\left[N_iN_j\cos(\theta_{ij})\right]_{i,j>1}\right)} - \sum \epsilon_i N_i. \label{eq:DiscreteNonConvexJbLB}
\end{align} Next, we derive an upper bound on $\mathcal{J}(\boldsymbol{b}_1)$:
\begin{align}
&\mathcal{J}(\boldsymbol{b}_1) = \sum_{i>1} \left\|\boldsymbol{\mathcal{X}}_i^\top \boldsymbol{b}_1 \right\|_1 =
\sum_{i>1} N_i \boldsymbol{b}_1^\top \boldsymbol{\chi}_{i,\boldsymbol{b}_1} \\
&= \sum_{i>1} c N_i \sin(\theta_{1i}) + \sum_{i>1} N_i\boldsymbol{b}_1^\top \boldsymbol{\eta}_{i,\boldsymbol{b}_1}, \, \, \, \left\|\boldsymbol{\eta}_{i,\boldsymbol{b}_1} \right\|_2 \le \epsilon_i \\
&\le c\sum_{i>1} N_i \sin(\theta_{1i}) + \sum_{i>1} \epsilon_i N_i. \label{eq:DiscreteNonConvexJb1LB}
\end{align}
Since any vector $\boldsymbol{b}$ for which the corresponding lower bound \eqref{eq:DiscreteNonConvexJbLB} on $\mathcal{J}(\boldsymbol{b})$ is strictly larger than the upper bound \eqref{eq:DiscreteNonConvexJb1LB} on $\mathcal{J}(\boldsymbol{b}_1)$, can not be a global minimizer (because it gives a larger objective than $\boldsymbol{b}_1$), $\theta_1^*$ must be bounded above by $\theta_{\max}^{(1)}$, where the latter is defined, in view of \eqref{c:thmDiscreteNonConvexDominance}, by
\begin{align}
\sin\left(\theta_{\max}^{(1)}\right) := \frac{ \alpha+c^{-1}\left(\epsilon_1N_1+2\sum_{i>1} \epsilon_i N_i\right)}{N_1}, \label{eq:thmDiscreteNonConvexTheta1MAX}
\end{align} where $\alpha$ is as in Theorem \ref{thm:DiscreteNonConvex}. Now let $\boldsymbol{b}^*$ be a global minimizer, and suppose for the sake of contradiction that $\boldsymbol{b}^* \not\perp \mathcal{H}_i, \forall i \in [n]$. We will show that there exists a lower bound $\theta_{\min}^{(1)}$ on $\theta_1$, such that $\theta_{\min}^{(1)} > \theta_{\max}^{(1)}$, which is of course a contradiction.
Towards that end, the first order optimality condition for $\boldsymbol{b}^*$ can be written as
\begin{align}
\boldsymbol{0} \in \boldsymbol{\mathcal{X}} \Sgn(\boldsymbol{\mathcal{X}}^\top \boldsymbol{b}^*) + \lambda \boldsymbol{b}^*, \label{eq:FirstOptimality}
\end{align} where $\lambda$ is a Lagrange multiplier and
$\Sgn(\alpha) = \Sign(\alpha)$ if $\alpha \neq 0$ and $\Sgn(0) = [-1,1]$, is the subdifferential of the function $|\cdot|$.
Since the points $\boldsymbol{\mathcal{X}}$ are general, any hyperplane $\mathcal{H}$ of $\mathbb{R}^D$ spanned by $D-1$ points of $\boldsymbol{\mathcal{X}}$ such that at most $D-2$ points come from $\boldsymbol{\mathcal{X}}_i, \, \forall i \in [n]$, does not contain any of the remaining points of $\boldsymbol{\mathcal{X}}$. Consequently, by Lemma \ref{lem:NonConvexMaximalInterpolation} $\boldsymbol{b}^*$ will be orthogonal to precisely $ D-1$ points $\left\{\boldsymbol{\xi}_1,\dots,\boldsymbol{\xi}_{D-1}\right\} \subset \boldsymbol{\mathcal{X}}$, from which at most $K_i \le D-2$ lie in $\mathcal{H}_i$. Thus, we can write relation \eqref{eq:FirstOptimality} as
\begin{align}
\sum_{j=1}^{D-1} \alpha_j \boldsymbol{\xi}_j + \sum_{i=1}^n N_i \, \boldsymbol{\chi}_{i,\boldsymbol{b}^*} + \lambda \boldsymbol{b}^*=\boldsymbol{0}, \label{eq:OptimalityExpanded}
\end{align} for real numbers $-1 \le \alpha_j \le 1, \, \forall j \in [D-1]$. Using the definition of $\epsilon_i$, we can write
\begin{align}
\boldsymbol{\chi}_{i,\boldsymbol{b}^*} = c \, \hat{\boldsymbol{h}}_{i,\boldsymbol{b}^*} + \boldsymbol{\eta}_{i,\boldsymbol{b}^*}, \, \forall i \in [n], \label{eq:Concentration}
\end{align} with $\left\|\boldsymbol{\eta}_{i,\boldsymbol{b}^*}\right\|_2 \le \epsilon_i$. Note that since
$\boldsymbol{b}^* \not\perp \mathcal{H}_i, \, \forall i \in [n]$, we have $\hat{\boldsymbol{h}}_{i,\boldsymbol{b}^*} \neq \boldsymbol{0}$.
Substituting \eqref{eq:Concentration} in \eqref{eq:OptimalityExpanded} we get
\begin{align}
\sum_{j=1}^{D-1} \alpha_j \boldsymbol{\xi}_j + c\sum_{i=1}^n N_i \, \hat{\boldsymbol{h}}_{i,\boldsymbol{b}^*} + \sum_{i=1}^n N_i \, \boldsymbol{\eta}_{i,\boldsymbol{b}^*} + \lambda \boldsymbol{b}^*=\boldsymbol{0}, \label{eq:OptimalityConcentration}
\end{align} and projecting \eqref{eq:OptimalityConcentration} onto the hyperplane $\mathcal{H}_{\boldsymbol{b}^*}$ with normal $\boldsymbol{b}^*$, we obtain
\begin{align}
\pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\sum_{j=1}^{D-1} \alpha_j \boldsymbol{\xi}_j \right) + c\sum_{i=1}^n N_i \pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\hat{\boldsymbol{h}}_{i,\boldsymbol{b}^*}\right) + \sum_{i=1}^n N_i \, \pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\boldsymbol{\eta}_{i,\boldsymbol{b}^*}\right) =\boldsymbol{0}.
\label{eq:OptimalityConcentrationProjected}
\end{align} Let us analyze the term $\pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\hat{\boldsymbol{h}}_{i,\boldsymbol{b}^*}\right)$. We have
\begin{align}
&\pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\hat{\boldsymbol{h}}_{i,\boldsymbol{b}^*}\right) = \pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\frac{\pi_{\mathcal{H}_i}(\boldsymbol{b}^*)}{\left\|\pi_{\mathcal{H}_i}(\boldsymbol{b}^*) \right\|_2}\right) = \pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\frac{\boldsymbol{b}^*- \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right) \boldsymbol{b}_i}{\left\|\boldsymbol{b}^*-\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right) \boldsymbol{b}_i\right\|_2}\right) \\
& = \pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\frac{\boldsymbol{b}^*-\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right) \boldsymbol{b}_i}{\sin(\theta_i)}\right) = \frac{\boldsymbol{b}^*-\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right) \boldsymbol{b}_i}{\sin(\theta_i)} - \left( \frac{1-\cos^2(\theta_i)}{\sin(\theta_i)} \right)\boldsymbol{b}^* \\
&= \frac{\left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)\left( \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right)\boldsymbol{b}^* -\boldsymbol{b}_i\right)}{\sin(\theta_i)} = - \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right) \hat{\boldsymbol{\zeta}}_i, \, \, \, \boldsymbol{\zeta}_i = \pi_{\mathcal{H}_{\boldsymbol{b}^*}}(\boldsymbol{b}_i). \label{eq:DoublePi}
\end{align} Using \eqref{eq:DoublePi}, \eqref{eq:OptimalityConcentrationProjected} becomes
\begin{align}
\pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\sum_{j=1}^{D-1} \alpha_j \boldsymbol{\xi}_j \right) - \sum_{i=1}^n N_i \, c \, \left(\boldsymbol{b}_i^\top \boldsymbol{b}^*\right) \hat{\boldsymbol{\zeta}}_i + \sum_{i=1}^n N_i \, \pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\boldsymbol{\eta}_{i,\boldsymbol{b}^*}\right) =\boldsymbol{0}.
\label{eq:OptimalityConcentrationProjectedZeta}
\end{align} Isolating the term that depends on $i=1$ to the LHS and moving everything else to the RHS, and taking norms, we get
\begin{align}
&c \, N_1 \, \cos(\theta_1) \le \sum_{i>1}^n c \, N_i \, \cos(\theta_i) + \nonumber \\
&+ \left\|\pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\sum_{j=1}^K \alpha_j \boldsymbol{\xi}_j \right) \right\|_2 + \sum_{i=1}^n N_i \, \left\|\pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\boldsymbol{\eta}_{i,\boldsymbol{b}^*}\right) \right\|_2. \label{eq:OptimalityConcentrationProjectedZetaTheta1Bound}
\end{align} Since $\left\| \boldsymbol{\eta}_{i,\boldsymbol{b}^*} \right\|_2 \le \epsilon_i$, we have that $ \left\|\pi_{\mathcal{H}_{\boldsymbol{b}^*}}\left(\boldsymbol{\eta}_{i,\boldsymbol{b}^*}\right) \right\|_2 \le \epsilon_i$. Next, the quantity $\sum_{j=1}^K \alpha_j \boldsymbol{\xi}_j$ can be decomposed along the index $i$, based on the hyperplane membership of the $\boldsymbol{\xi}_j$. For instance, if $\boldsymbol{\xi}_1 \in \mathcal{H}_1$, then replace the term $\alpha_1 \boldsymbol{\xi}_1$ with $\alpha_1^{(1)} \boldsymbol{\xi}_1^{(1)}$, where the superscript $\cdot^{(1)}$ denotes association to hyperplane $\mathcal{H}_1$. Repeating this for all $\boldsymbol{\xi}_j$ and after a possible re-indexing, we have
\begin{align}
\sum_{j=1}^{D-1} \alpha_j \boldsymbol{\xi}_j = \sum_{i=1}^n \sum_{j=1}^{K_i} \alpha_j^{(i)} \boldsymbol{\xi}_j^{(i)}.
\end{align} Now, by Definition \ref{dfn:DPCPmultiple_circumradius} we have that
\begin{align}
\left\|\sum_{j=1}^{K_i} \alpha_j^{(i)} \boldsymbol{\xi}_j^{(i)} \right\|_2 \le \mathcal{R}_{i,K_i},
\end{align} and as a consequence, the upper bound \eqref{eq:OptimalityConcentrationProjectedZetaTheta1Bound} can be extended to
\begin{align}
c \, N_1 \, \cos(\theta_1) \le \sum_{i>1}^n c \, N_i \, \cos(\theta_i) + \sum_{i} \epsilon_i \, N_i + \mathcal{R}. \label{eq:OptimalityConcProjZetaTheta1BoundCompact}
\end{align} Finally, Lemma \ref{lem:Jdagger} provides a bound
\begin{align}
\sum_{i>1}^n \, N_i \, \cos(\theta_i) \le \beta,
\end{align} where $\beta$ is as in Theorem \ref{thm:GeneralContinuous}. In turn, this can be used to extend \eqref{eq:OptimalityConcProjZetaTheta1BoundCompact} to
\small
\begin{align}
\cos(\theta_1) \le \frac{\beta+c^{-1}\left(\mathcal{R}+\sum \epsilon_i N_i\right)}{N_1}=: \cos\left(\theta_{\min}^{(1)}\right) \label{eq:thmDiscreteNonConvexTheta1MIN}.
\end{align} \normalsize Note that the angle $\theta_{\min}^{(1)}$ of
\eqref{eq:thmDiscreteNonConvexTheta1MIN} is well-defined, since by hypothesis $N_1 > \bar{\beta}$, and that what \eqref{eq:thmDiscreteNonConvexTheta1MIN} effectively says, is that $\theta_1$ never drops below $\theta_{\min}^{(1)}$. It is then straightforward to check that hypothesis $N_1 > \sqrt{\bar{\alpha}^2+\bar{\beta}^2}$ implies $\theta_{\min}^{(1)} > \theta_{\max}^{(1)}$, which is a contradiction. In other words, $\boldsymbol{b}^*$ must be equal up to sign to one of the $\boldsymbol{b}_i$, which proves the first part of the Theorem. The second part follows from noting that condition $\bar{\gamma}>0$ guarantees that $\mathcal{J}(\boldsymbol{b}_1) < \min_{i>1} \mathcal{J}(\boldsymbol{b}_i)$.
\subsection{Proof of Theorem \ref{thm:LPDiscrete}}
First of all, it follows from the theory of the simplex method, that if $\boldsymbol{n}_{k+1}$ is obtained via the simplex method, then it will satisfy the conclusion of Lemma \ref{lem:LPMaximalInterpolation} in Appendix \ref{appendix:Spath}. Then Lemma \ref{lem:LPconvergence} guarantees that $\left\{\boldsymbol{n}_k\right\}$ converges to a critical point of
problem \eqref{eq:ell1} in a finite number of steps; denote that point by $\boldsymbol{n}_{\infty}$. In other words, $\boldsymbol{n}_{\infty}$ will satisfy equation \eqref{eq:AbstractOptimalityRepeated} and it will have unit $\ell_2$ norm. Now, if $\boldsymbol{n}_{\infty} = \pm \boldsymbol{b}_j$ for some $j>1$, then
\begin{align}
\mathcal{J}(\hat{\boldsymbol{n}}_0) \ge \mathcal{J}(\boldsymbol{b}_j),
\end{align} or equivalently
\begin{align}
\sum N_i \hat{\boldsymbol{n}}_0^\top \boldsymbol{\chi}_{i,\hat{\boldsymbol{n}}_0} \ge
\sum_{i \neq j} N_i \boldsymbol{b}_j^\top \boldsymbol{\chi}_{i,\boldsymbol{b}_j}. \label{eq:LP_not_bi}
\end{align} Substituting the concentration model
\begin{align}
\boldsymbol{\chi}_{i,\hat{\boldsymbol{n}}_0} &= c \widehat{\pi_{\mathcal{H}_i}\left(\boldsymbol{n}_0\right)} + \boldsymbol{\eta}_{i,0}, \, \, \, \left\|\boldsymbol{\eta}_{i,0} \right\|_2 \le \epsilon_i, \\
\boldsymbol{\chi}_{i,\boldsymbol{b}_j} &= c \widehat{\pi_{\mathcal{H}_i}\left(\boldsymbol{b}_j\right)} + \boldsymbol{\eta}_{ij}, \, \, \, \left\|\boldsymbol{\eta}_{ij} \right\|_2 \le \epsilon_i,
\end{align} into \eqref{eq:LP_not_bi}, we get
\begin{align}
\sum N_i c \sin(\theta_{i,0}) + \sum N_i \hat{\boldsymbol{n}}_0^\top \boldsymbol{\eta}_{i,0} \ge \sum_{i \neq j} N_i c \sin(\theta_{ij}) + \sum N_i \boldsymbol{b}_j^\top \boldsymbol{\eta}_{ij}. \label{eq:LP_not_bi_concentration}
\end{align} Bounding the LHS of \eqref{eq:LP_not_bi_concentration} from above and the RHS from below, we get
\begin{align}
\sum N_i \, c \, \sin(\theta_{i,0}) + \sum \epsilon_i N_i \ge \sum_{i \neq j} N_i \, c \, \sin(\theta_{ij}) - \sum \epsilon_i N_i.
\end{align} But this very last relation is contradicted by hypothesis $N_1 > \mu$, i.e., none of the $\pm \boldsymbol{b}_j$ for $j>1$ can be $\boldsymbol{n}_{\infty}$. We will show that $\boldsymbol{n}_{\infty}$ has to be $\pm \boldsymbol{b}_1$. So suppose for the sake of a contradiction that that $\boldsymbol{n}_{\infty}$ is not colinear with $\boldsymbol{b}_1$, i.e., $\boldsymbol{n}_{\infty} \not\perp \mathcal{H}_i, \, \forall i \in [n]$. Since $\boldsymbol{n}_{\infty} $ satisfies \eqref{eq:AbstractOptimalityRepeated}, we can use part of the proof of Theorem \ref{thm:DiscreteNonConvex}, according to which the principal angle $\theta_{1,\infty}$ of $\boldsymbol{n}_{\infty}$ from $\boldsymbol{b}_1$ does not become less than $\theta_{\min}^{(1)}$, where $\theta_{\min}^{(1)}$ is as in \eqref{eq:thmDiscreteNonConvexTheta1MIN}. Consequently, and using once again the concentration model, we obtain
\begin{align}
\sum N_i \, c \, \sin(\theta_{i,0}) + \sum \epsilon_i N_i \ge \mathcal{J}(\hat{\boldsymbol{n}}_0) \ge \mathcal{J}(\boldsymbol{n}_{\infty}) \ge \sum N_i \, c \, \sin(\theta_{i,\infty}) - \sum \epsilon_i N_i \nonumber \\
\ge N_1 \, c \, \sin\left(\theta_{\min}^{(1)} \right) + c \, \sqrt{\sum_{i>1}N_i^2-\sigma_{\max}\left(\left[N_iN_j\cos(\theta_{ij})\right]_{i,j>1}\right)} - \sum \epsilon_i N_i. \label{eq:LP_b1}
\end{align} Now, a little algebra reveals that the outermost inequality in \eqref{eq:LP_b1} contradicts \eqref{c:thmLPDiscreteDominance}.
\section{Algorithmic Contributions} \label{section:Algorithms}
There are at least two ways in which DPCP can be used to learn a hyperplane
arrangement; either through a sequential (RANSAC-style) scheme, or through
an iterative (K-Subspaces-style) scheme. These two cases are described next.
\subsection{Sequential hyperplane learning via DPCP} \label{subsection:MultipleDPCPAlgorithmsRANSACstyle}
Since at its core DPCP is a single subspace learning method, we may as well use it to learn
$n$ hyperplanes in the same way that RANSAC \citep{RANSAC} is used: learn one hyperplane from the entire dataset, remove the points close to it, then learn a second hyperplane and so on. The main weakness of this
technique is well known, and consists of its sensitivity to the thresholding parameter, which is necessary
in order to remove points.
To alleviate the need of knowing a good threshold, we propose to replace the process of removing points
by a process of appropriately weighting the points. In particular, suppose we solve the DPCP problem
\eqref{eq:ell1} on the entire dataset $\boldsymbol{\mathcal{X}}$ and obtain a unit $\ell_2$-norm vector $\boldsymbol{b}_1$. Now, instead of
removing the points of $\boldsymbol{\mathcal{X}}$ that are close to the hyperplane with normal vector $\boldsymbol{b}_1$ (which would require a threshold parameter), we weight each and every point $\boldsymbol{x}_j$ of $\boldsymbol{\mathcal{X}}$ by its distance $\left| \boldsymbol{b}_1^\top \boldsymbol{x}_j \right|$ from that hyperplane. Then to compute a second hyperplane with normal $\boldsymbol{b}_2$ we apply DPCP on the weighted dataset $\left\{\left| \boldsymbol{b}_1^\top \boldsymbol{x}_j \right| \boldsymbol{x}_j \right\}$. To compute a third hyperplane,
the weight of point $\boldsymbol{x}_j$ is chosen as the smallest distance of $\boldsymbol{x}_j$ from the already computed two hyperplanes, i.e., DPCP is now applied to $\left\{\min_{i=1,2} \left| \boldsymbol{b}_i^\top \boldsymbol{x}_j \right| \boldsymbol{x}_j \right\}$. After $n$ hyperplanes have been computed, the clustering of the points is obtained based on their distances to the $n$ hypeprlanes; see Algorithm \ref{alg:MultipleDPCPsequential}.
\begin{algorithm}[t!] \caption{Sequential Hyperplane Learning via DPCP}\label{alg:MultipleDPCPsequential} \begin{algorithmic}[1]
\Procedure{SHL-DPCP}{$\boldsymbol{\mathcal{X}}=\left[\boldsymbol{x}_1, \, \boldsymbol{x}_2, \dots, \, \boldsymbol{x}_N \right] \in \mathbb{R}^{D \times N},n$}
\State $ i \gets 0$;
\State $w_j \gets 1, \, j=1,\dots,N$;
\For{$i=1 : n$}
\State $\boldsymbol{\Y} \gets \left[ w_1 \boldsymbol{x}_1 \, \cdots \, w_N \boldsymbol{x}_N \right]$;
\State $\boldsymbol{b}_i \gets \argmin_{\boldsymbol{b} \in \mathbb{R}^D} \, \, \left[ \left\| \boldsymbol{\Y}^\top \boldsymbol{b} \right\|_1, \, \, \, \text{s.t.} \, \, \, \boldsymbol{b}^\top \boldsymbol{b} = 1\right]$;
\State $w_j \gets \min_{k=1,\dots,i} \left| \boldsymbol{b}_k^\top \boldsymbol{x}_j \right|, \, j=1,\dots,N$;
\EndFor
\State $\boldsymbol{C}_i \gets \left\{\boldsymbol{x}_j \in \boldsymbol{\mathcal{X}}: \, i = \argmin_{k=1,\dots,n} \left| \boldsymbol{b}_k^\top \boldsymbol{x}_j \right| \right\}, i=1,\dots,n$;
\State \Return $\left\{(\boldsymbol{b}_i,\boldsymbol{C}_i)\right\}_{i=1}^n$;
\EndProcedure
\end{algorithmic}
\end{algorithm}
\subsection{Iterative hyperplane learning via DPCP} \label{subsection:AlgorithmsKHstyle}
Another way to do hyperplane clustering via DPCP, is to modify the classic K-Subspaces \citep{Bradley:JGO00,Tseng:JOTA00,Zhang:WSM09} by computing the normal vector of each cluster by DPCP. We call the resulting method IHL-DPCP; see Algorithm \ref{alg:IHL-DPCP}. It is worth noting
that since DPCP minimizes the $\ell_1$-norm of the distances of the points to a hyperplane, consistency dictates that the stopping criterion for IHL-DPCP be governed by the sum over all points of the distance of each point to its
assigned hyperplane (instead of the traditional sum of squares \citep{Bradley:JGO00,Tseng:JOTA00}); in other words the global objective function minimized by
IHL-DPCP is the same as that of Median K-Flats \citep{Zhang:WSM09}.
\begin{algorithm}[t!] \caption{Iterative Hyperplane Learning via Dual Principal Component Pursuit}\label{alg:IHL-DPCP} \begin{algorithmic}[1]
\Procedure{IHL-DPCP}{$\boldsymbol{\mathcal{X}}=\left[\boldsymbol{x}_1, \, \boldsymbol{x}_2, \dots, \, \boldsymbol{x}_N \right],\boldsymbol{b}_1,\dots,\boldsymbol{b}_n,\varepsilon,T_{\max}$}
\State $\mathcal{J}_{\text{old}} \gets \infty, \, \Delta \mathcal{J} \gets \infty, \, t \gets 0$;
\While{ $t < T_{\max}$ and $\Delta \mathcal{J} > \varepsilon$}
\State $\mathcal{J}_{\text{new}} \gets 0, \, t = t+1$;
\State $\boldsymbol{C}_i \gets \left\{\boldsymbol{x}_j \in \boldsymbol{\mathcal{X}}: \, i = \argmin_{k=1,\dots,n} \left| \boldsymbol{b}_k^\top \boldsymbol{x}_j \right| \right\}, i=1,\dots,n$;
\State $\mathcal{J}_{\text{new}} = \sum_{i=1}^n \sum_{\boldsymbol{x}_j \in \boldsymbol{\mathcal{C}}_i} \left|\boldsymbol{b}_i^\top \boldsymbol{x}_j \right|$;
\State $\Delta \mathcal{J} \gets
(\mathcal{J}_{\text{old}} - \mathcal{J}_{\text{new}}) / (\mathcal{J}_{\text{old}} + 10^{-9}), \, \mathcal{J}_{\text{old}} \gets \mathcal{J}_{\text{new}}$ ;
\State $\boldsymbol{b}_i \gets \argmin_{\boldsymbol{b} } \, \, \left[ \left\| \boldsymbol{\mathcal{C}}_i^\top \boldsymbol{b} \right\|_1, \, \, \, \text{s.t.} \, \, \, \boldsymbol{b}^\top \boldsymbol{b} = 1\right], \, i=1,\dots,n$;
\EndWhile
\State \Return $\left\{(\boldsymbol{b}_i,\boldsymbol{C}_i)\right\}_{i=1}^n$;
\EndProcedure
\end{algorithmic}
\end{algorithm}
\subsection{Solving the DPCP problem} \label{subsection:DPCPcomputation}
\begin{algorithm}[t!] \caption{Relaxed Dual Principal Component Pursuit}\label{alg:DPCP-r} \begin{algorithmic}[1]
\Procedure{DPCP-r}{$\boldsymbol{\mathcal{X}},\varepsilon,T_{\max}$}
\State $k \gets 0; \Delta \mathcal{J} \gets \infty$;
\State $\hat{\boldsymbol{n}}_0 \gets \argmin_{ \left\|\boldsymbol{b}\right\|_2=1} \left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_2$;
\While{$k < T_{\max}$ and $\Delta \mathcal{J} > \varepsilon$}
\State $k \gets k+1$;
\State $\boldsymbol{n}_k \gets \argmin_{\boldsymbol{b}^\top \hat{\boldsymbol{n}}_{k-1}=1} \left\| \boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_1$;
\State $\Delta \mathcal{J} \gets \left(\left\| \boldsymbol{\mathcal{X}}^\top \hat{\boldsymbol{n}}_{k-1} \right\|_1-\left\| \boldsymbol{\mathcal{X}}^\top \hat{\boldsymbol{n}}_{k} \right\|_1 \right) / \left(\left\| \boldsymbol{\mathcal{X}}^\top \hat{\boldsymbol{n}}_{k-1} \right\|_1+10^{-9}\right)$;
\EndWhile
\State \Return $\hat{\boldsymbol{n}}_{k}$;
\EndProcedure
\end{algorithmic}
\end{algorithm}
\begin{algorithm}[t!] \caption{Dual Principal Component Pursuit via Iteratively Reweighted Least Squares}\label{alg:DPCP-IRLS} \begin{algorithmic}[1]
\Procedure{DPCP-IRLS}{$\boldsymbol{\mathcal{X}},c,\varepsilon,T_{\max},\delta$}
\State $k \gets 0; \Delta \mathcal{J} \gets \infty$;
\State $\boldsymbol{B}_0 \gets \argmin_{ \boldsymbol{B} \in \mathbb{R}^{D \times c}} \, \, \left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{B} \right\|_2, \, \, \, \text{s.t.} \, \, \, \boldsymbol{B}^\top \boldsymbol{B} = \boldsymbol{I}_c$;
\While{$k < T_{\max}$ and $\Delta \mathcal{J} > \varepsilon$}
\State $k \gets k+1$;
\State $w_{\boldsymbol{x}} \gets 1/\max\left\{\delta, \left\|\boldsymbol{B}_{k-1}^\top \boldsymbol{x}\right\|_2 \right\}, \, \boldsymbol{x} \in \boldsymbol{\mathcal{X}}$;
\State $\boldsymbol{B}_k \gets \argmin_{\boldsymbol{B} \in \mathbb{R}^{D \times c}} \, \, \sum_{\boldsymbol{x} \in \boldsymbol{\mathcal{X}}} w_{\boldsymbol{x}}\left\|\boldsymbol{B}^\top \boldsymbol{x}\right\|_2^2 \, \, \, \text{s.t.} \, \, \, \boldsymbol{B}^\top \boldsymbol{B} = \boldsymbol{I}_c$;
\State $\Delta \mathcal{J} \gets \left(\left\| \boldsymbol{\mathcal{X}}^\top \boldsymbol{B}_{k-1} \right\|_1-\left\| \boldsymbol{\mathcal{X}}^\top \boldsymbol{B}_{k} \right\|_1\right) / \left(\left\| \boldsymbol{\mathcal{X}}^\top \boldsymbol{B}_{k-1} \right\|_1+10^{-9}\right)$;
\EndWhile
\State \Return $\boldsymbol{B}_{k}$;
\EndProcedure
\end{algorithmic}
\end{algorithm}
\begin{algorithm} \caption{Denoised Dual Principal Component Pursuit
}\label{alg:DPCP-d} \begin{algorithmic}[1]
\Procedure{DPCP-d}{$\boldsymbol{\mathcal{X}},\varepsilon,T_{\max},\delta,\tau$}
\State Compute a Cholesky factorization $\boldsymbol{L} \boldsymbol{L}^\top = \boldsymbol{\mathcal{X}} \boldsymbol{\mathcal{X}}^\top+\delta \boldsymbol{I}_{D}$; \State $k \gets 0; \Delta \mathcal{J} \gets \infty$;
\State $\boldsymbol{b} \gets \argmin_{\boldsymbol{b} \in \mathbb{R}^{D}: \, \left\|\boldsymbol{b}\right\|_2=1} \, \, \, \left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_2$;
\State $\mathcal{J}_0 \gets \tau \left\|\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_1$;
\While{$k < T_{\max}$ and $\Delta \mathcal{J} > \varepsilon$}
\State $k \gets k+1$;
\State $\boldsymbol{y} \gets \mathbb{S}_{\tau} \left(\boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right)$;
\State $\boldsymbol{b} \gets$ solution of $\boldsymbol{L} \boldsymbol{L}^\top \boldsymbol{\xi} = \boldsymbol{\mathcal{X}} \boldsymbol{y}$ by backward/forward propagation;
\State $\boldsymbol{b} \gets \boldsymbol{b} / \left\| \boldsymbol{b} \right\|_2$;
\State $\mathcal{J}_k \gets \tau \left\| \boldsymbol{y} \right\|_1 + \frac{1}{2} \left\|\boldsymbol{y} - \boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_2^2$;
\State $\Delta \mathcal{J} \gets \left(\mathcal{J}_{k-1} - \mathcal{J}_k \right) / \left(\mathcal{J}_{k-1} + 10^{-9} \right)$;
\EndWhile
\State \Return $(\boldsymbol{y},\boldsymbol{b})$;
\EndProcedure
\end{algorithmic}
\end{algorithm}
Recall that the DPCP problem \eqref{eq:ell1} that appears in Algorithms \ref{alg:MultipleDPCPsequential} and \ref{alg:IHL-DPCP} (with data matrices $\boldsymbol{\Y}$ and $\boldsymbol{C}_i$, respectively)
is non-convex. In \cite{Tsakiris:DPCP-ArXiv17} we described four distinct methods for solving it,
which we briefly review here.
The first method, which was first proposed in \cite{Spath:Numerische87}, consists of solving
the recursion of linear programs \eqref{eq:ConvexRelaxations} using any standard solver,
such as Gurobi \citep{gurobi}; we refer to such a method as DPCP-r, standing for \emph{relaxed DPCP} (see Algorithm \ref{alg:DPCP-r}). A second approach, called DPCP-IRLS, is to solve \eqref{eq:ell1} using a standard
\emph{Iteratively Reweighted Least-Squares (IRLS)} technique (\citep{Candes:JFAA08,Daubechies:CPAM10,Chartrand:ICASSP08}) as in Algorithm \ref{alg:DPCP-IRLS}.
A third method, first proposed in \cite{Qu:NIPS14}, is to solve \eqref{eq:ell1} approximately by applying alternative minimization on
its \emph{denoised} version
\begin{align}
\min_{\boldsymbol{b},\boldsymbol{y}: \, ||\boldsymbol{b}||_2=1} \, \left[\tau \, \left\|\boldsymbol{y}\right\|_1 + \frac{1}{2}\left\|\boldsymbol{y} - \boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_2^2 \right] \label{eq:DPCP-d}.
\end{align} We refer to such a method as \emph{DPCP-d}, standing for \emph{denoised DPCP}; see Algorithm
\ref{alg:DPCP-d}. Finally, the fourth method is \emph{relaxed and denoised DPCP (DPCP-r-d)}, which
replaces each problem of recursion \eqref{eq:ConvexRelaxations} with its denoised version
\begin{align}
\min_{\boldsymbol{y},\boldsymbol{b}} \left[ \tau \left\|\boldsymbol{y} \right\|_1 + \frac{1}{2}\left\|\boldsymbol{y} - \boldsymbol{\mathcal{X}}^\top \boldsymbol{b} \right\|_2^2 \right], \, \, \, \text{s.t.} \, \, \, \boldsymbol{b}^\top \hat{\boldsymbol{n}}_{k-1}=1; \label{eq:LassoFirst}
\end{align} which is in turn solved via alternating minimization; see \cite{Tsakiris:DPCP-ArXiv17} for details.
\section{Experimental evaluation} \label{section:Experiments}
In this section we evaluate experimentally Algorithms \ref{alg:MultipleDPCPsequential}
and \ref{alg:IHL-DPCP} using both synthetic (\S \ref{subsection:ExperimentsSynthetic})
and real data (\S \ref{subsection:ExperimentsReal}).
\subsection{Synthetic data} \label{subsection:ExperimentsSynthetic}
\begin{figure}[t!]
\centering
\subfigure[RANSAC, $\alpha=1$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_RANSAC1}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_RANSAC1-eps-converted-to.pdf}}
\subfigure[RANSAC, $\alpha=0.8$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_RANSAC08}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_RANSAC08-eps-converted-to.pdf}}
\subfigure[RANSAC, $\alpha=0.6$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_RANSAC06}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_RANSAC06-eps-converted-to.pdf}}
\subfigure[REAPER, $\alpha=1$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_REAPER1}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_REAPER1-eps-converted-to.pdf}}
\subfigure[REAPER, $\alpha=0.8$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_REAPER08}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_REAPER08-eps-converted-to.pdf}}
\subfigure[REAPER, $\alpha=0.6$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_REAPER06}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_REAPER06-eps-converted-to.pdf}}
\subfigure[DPCP-r, $\alpha=1$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-r1}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-r1-eps-converted-to.pdf}}
\subfigure[DPCP-r, $\alpha=0.8$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-r
08}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-r08-eps-converted-to.pdf}}
\subfigure[DPCP-r, $\alpha=0.6$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-r06}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-r06-eps-converted-to.pdf}}
\subfigure[DPCP-IRLS, $\alpha=1$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-IRLS1}\includegraphics[width=0.3\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-IRLS1-eps-converted-to.pdf}}
\subfigure[DPCP-IRLS, $\alpha=0.8$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-IRLS
08}\includegraphics[width=0.3\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-IRLS08-eps-converted-to.pdf}}
\subfigure[DPCP-IRLS, $\alpha=0.6$]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-IRLS06}\includegraphics[width=0.3\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-IRLS06-eps-converted-to.pdf}}
\caption{Sequential Hyperplane Learning: Clustering accuracy as a function of the number of
hyperplanes $n$ vs relative-dimension $d/D$ vs data balancing ($\alpha$). White corresponds to $1$, black to $0$.}
\label{fig:MultipleDPCPRansacStyleDvsnalpha}
\end{figure}
\begin{figure}[t!]
\centering
\subfigure[RANSAC]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_RANSAC08}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_RANSAC08-eps-converted-to.pdf}}
\subfigure[REAPER]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_REAPER08}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_REAPER08-eps-converted-to.pdf}}
\subfigure[DPCP-r]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-r
08}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-r08-eps-converted-to.pdf}}
\subfigure[DPCP-r-d]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-r-d
08}\includegraphics[width=0.3\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-r-d08-eps-converted-to.pdf}}
\subfigure[DPCP-d]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-d
08}\includegraphics[width=0.29\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-d08-eps-converted-to.pdf}}
\subfigure[DPCP-IRLS]{\label{figure:RANSACstyle_D_vs_n_Ns300_T50_DPCP-IRLS 08}\includegraphics[width=0.3\linewidth]{RANSACstyle_D_vs_n_Ns300_T50_DPCP-IRLS08-eps-converted-to.pdf}}
\caption{Sequential Hyperplane Learning: Clustering accuracy as a function of the number of
hyperplanes $n$ vs relative-dimension $d/D$. Data balancing parameter is set to $\alpha = 0.8$.}
\label{fig:MultipleDPCPRansacStyleDvsn08}
\end{figure}
\begin{figure}[t!]
\centering
\subfigure[RANSAC, $\alpha=1$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_RANSAC1}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_RANSAC1-eps-converted-to.pdf}}
\subfigure[RANSAC, $\alpha=0.8$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_RANSAC08}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_RANSAC08-eps-converted-to.pdf}}
\subfigure[RANSAC, $\alpha=0.6$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_RANSAC06}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_RANSAC06-eps-converted-to.pdf}}
\subfigure[REAPER, $\alpha=1$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_REAPER1}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_REAPER1-eps-converted-to.pdf}}
\subfigure[REAPER, $\alpha=0.8$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_REAPER08}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_REAPER08-eps-converted-to.pdf}}
\subfigure[REAPER, $\alpha=0.6$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_REAPER06}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_REAPER06-eps-converted-to.pdf}}
\subfigure[DPCP-r, $\alpha=1$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-r1}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-r1-eps-converted-to.pdf}}
\subfigure[DPCP-r, $\alpha=0.8$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-r
08}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-r08-eps-converted-to.pdf}}
\subfigure[DPCP-r, $\alpha=0.6$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-r06}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-r06-eps-converted-to.pdf}}
\subfigure[DPCP-IRLS, $\alpha=1$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-IRLS1}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-IRLS1-eps-converted-to.pdf}}
\subfigure[DPCP-IRLS, $\alpha=0.8$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-IRLS
08}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-IRLS08-eps-converted-to.pdf}}
\subfigure[DPCP-IRLS, $\alpha=0.6$]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-IRLS06}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-IRLS06-eps-converted-to.pdf}}
\caption{Sequential Hyperplane Learning: Clustering accuracy as a function of the number of
hyperplanes $n$ vs outlier ratio vs data balancing ($\alpha$). White corresponds to $1$, black to $0$.}
\label{fig:MultipleDPCPRansacStyleRvsnalpha}
\end{figure}
\begin{figure}[t!]
\centering
\subfigure[RANSAC]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_RANSAC08}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_RANSAC08-eps-converted-to.pdf}}
\subfigure[REAPER]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_REAPER08}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_REAPER08-eps-converted-to.pdf}}
\subfigure[DPCP-r]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-r
08}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-r08-eps-converted-to.pdf}}
\subfigure[DPCP-r-d]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-r-d
08}\includegraphics[width=0.3\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-r-d08-eps-converted-to.pdf}}
\subfigure[DPCP-d]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-d
08}\includegraphics[width=0.29\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-d08-eps-converted-to.pdf}}
\subfigure[DPCP-IRLS]{\label{figure:RANSACstyle_R_vs_n_Ns300_T50_DPCP-IRLS
08}\includegraphics[width=0.3\linewidth]{RANSACstyle_R_vs_n_Ns300_T50_DPCP-IRLS08-eps-converted-to.pdf}}
\caption{Sequential Hyperplane Learning: Clustering accuracy as a function of the number of
hyperplanes $n$ vs outlier ratio. Data balancing parameter is set to $\alpha = 0.8$.}
\label{fig:MultipleDPCPRansacStyleRvsn08}
\end{figure}
\indent \myparagraph{Dataset design} We begin by evaluating experimentally the sequential hyperplane learning Algorithm \ref{alg:MultipleDPCPsequential} using synthetic data. The coordinate dimension $D$ of the data is inspired by major applications where hyperplane arrangements appear. In particular, we recall that
\begin{itemize}
\item In $3D$ point cloud analysis, the coordinate
dimension is $3$, but since the various planes do not necessarily pass through a common origin, i.e., they are affine, one may work with homogeneous coordinates, which increases the coordinate dimension of the data by $1$
(see \cite{Tsakiris:AffineASC-ArXiv15}), i.e., $D=4$.
\item In two-view geometry one works with correspondences between pairs of $3D$ points. Each such correspondence is treated as a point itself, equal to the tensor product of the two $3D$ corresponding points,
thus having coordinate dimension $D=9$.
\end{itemize} As a consequence, we choose $D=4,9$ as well as $D=30$, where the choice of $30$ is a-posteriori justified as being sufficiently larger than $4$ or $9$, so that the clustering problem becomes more challenging.
For each choice of $D$ we randomly generate $n=2,3,4$ hyperplanes of $\mathbb{R}^D$ and sample each
hyperplane as follows. For each choice of $n$ the total number of points in the dataset is set to
$300n$, and the number $N_i$ of points sampled from hyperplane $i >1$ is set to $N_i = \alpha^{i-1} N_{i-1}$, so that
\begin{align}
\sum_{i=1}^n N_i = (1+\alpha+\cdots+\alpha^{n-1})N_1 = 300n.
\end{align} Here $\alpha \in (0,1]$ is a parameter that controls the \emph{balancing} of the clusters: $\alpha=1$ means the clusters are perfectly balanced, while smaller values of $\alpha$ lead to less balanced clusters.
In our experiment we try $\alpha=1,0.8,0.6$. Having specified the size of each cluster, the points of each cluster are sampled from a zero-mean unit-variance Gaussian distribution with support in the corresponding hyperplane. To make the experiment more realistic, we corrupt points from each hyperplane by adding white Gaussian noise of standard deviation $\sigma=0.01$ with support in the direction orthogonal to the hyperplane. Moreover, we corrupt the dataset by adding $10\%$ outliers sampled from a standard zero-mean unit-variance Gaussian distribution with support in the entire ambient space.
\indent \myparagraph{Algorithms and parameters} In Algorithm \ref{alg:MultipleDPCPsequential} we solve the DPCP problem by using all four variations DPCP-r, DPCP-r-d, DPCP-d and DPCP-IRLS
(see Section \ref{subsection:DPCPcomputation}),
thus leading to four different versions of the algorithm. All DPCP algorithms are set to terminate if either
a maximal number of $20$ iterations for DPCP-r or $100$ iterations for DPCP-r-d,DPDP-d, DPCP-IRLS
is reached, or if the algorithm converges within accuracy of $10^{-3}$.
We also compare with the REAPER analog of Algorithm \ref{alg:MultipleDPCPsequential}, where the computation of each normal vector is done by the IRLS version of REAPER (see Section \ref{section:PriorArt}) instead of DPCP. As with the DPCP algorithms, its maximal number of iterations is $100$ and its convergence accuracy is $10^{-3}$.
Finally, we compare with RANSAC, which is the predominant method for clustering hyperplanes in low ambient dimensions (e.g., for $D=4,9$). For fairness, we implement a version of RANSAC which involves the same weighting scheme as Algorithm \ref{alg:MultipleDPCPsequential}, but instead of weighting the points, it uses the normalized weights as a discrete probability distribution on the data points; thus points that lie close to some of the already computed hyperplanes, have a low probability of being selected. Moreover, we control the running time of RANSAC so that it is as slow as DPCP-r, the latter being the slowest among the four DPCP algorithms.
\indent \myparagraph{Results} Since not all results can fit in a single figure, we show the mean clustering accuracy over $50$ independent experiments in Fig. \ref{fig:MultipleDPCPRansacStyleDvsnalpha} only for RANSAC, REAPER, DPCP-r and
DPDP-IRLS (i.e., not including DPCP-r-d and DPCP-d), but for all values $\alpha=1,0.8,0.6$, as well as in Fig. \ref{fig:MultipleDPCPRansacStyleDvsn08} for all methods but only for $\alpha=0.8$. The accuracy is normalized to range from $0$ to $1$, with
$0$ corresponding to black color, and $1$ corresponding to white.
First, observe that the performance of almost all methods improves as the clusters become
more unbalanced ($\alpha=1 \rightarrow \alpha=0.6$). This is intuitively expected, as the smaller $\alpha$ is the more
dominant is the $i$-th hyperplane with respect to hyperplanes $i+1,\dots,n$, and so the more likely it is to be identified at iteration $i$ of the sequential algorithm. The only exception to this intuitive phenomenon is
RANSAC, which appears to be insensitive to the balancing of the data. This is because
RANSAC is configured to run a relatively long amount of time, approximately equal to the running
time of DPCP-r, and as it turns out this compensates for the unbalancing of the data, since many
different samplings take place, thus leading to approximately constant behavior across different $\alpha$.
In fact, notice that RANSAC is the best among all methods when $D=4$,
with mean clustering accuracy ranging from $99\%$ when $n=2$, to $97\%$ when $n=4$.
On the other hand,
RANSAC's performance drops dramatically when we move to higher coordinate dimensions and more than
$2$ hyperplanes. For example, for $\alpha=0.8$ and $n=4$, the mean clustering accuracy of RANSAC
drops from $97\%$ for $D=4$, to $44\%$ for $D=9$, to $28\%$ for $D=30$. This is due to the fact
that the probability of sampling $D-1$ points from the same hyperplane decreases as $D$ increases.
Secondly, the proposed Algorithm \ref{alg:MultipleDPCPsequential} using DPCP-r is uniformly the best method (and using DPCP-IRLS is the second best), with the slight exception of $D=4$, where its clustering accuracy ranges for $\alpha=0.8$ from $99\%$ for $n=2$ (same as RANSAC), to $89\%$ for $n=4$, as opposed to the $97\%$ of RANSAC for the latter case. In fact, all DPCP variants were superior than RANSAC or REAPER in the challenging scenario of $D=30,n=4$, where for $\alpha=0.6$, DPCP-r, DPCP-IRLS, DPCP-d and DPCP-r-d gave $86\%,81\%,74\%$ and $52\%$ accuracy respectively, as opposed to $28\%$ for RANSAC and $42\%$ for REAPER.
Table \ref{table:synthetic_D_vs_n_noise_outliers_T50_rt} reports running times in seconds for $\alpha=1$
and $n=2,4$. It is readily seen that DPCP-r is the slowest among all methods (recall that RANSAC has
been configured to be as slow as DPCP-r). Remarkably, DPCP-d and REAPER are the fastest among all
methods with a difference of approximately two orders of magnitude from DPCP-r. However, as we saw
above, none of these methods performs nearly as well as DPCP-r. From that perspective, DPCP-IRLS
is interesting, since it seems to be striking a balance between running time and performance.
\setlength{\tabcolsep}{0.11em}
\begin{table}[t!]
\centering
\ra{0.7}
\caption{Mean running times in seconds, corresponding to the experiment of Fig. \ref{fig:MultipleDPCPRansacStyleDvsnalpha} for data balancing parameter $\alpha = 1$.}
\small
\begin{tabular}
{lllrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr}\toprule[1pt]
\phantom{a} &&& \multicolumn{7}{c}{$n = 2$} &&&&&&&&& \multicolumn{7}{c}{$n = 4$} \\
\cmidrule{5-8} \cmidrule{21-24}
\phantom{a} &&& \multicolumn{1}{c}{$D = 4$} &&&
\multicolumn{1}{c}{$D= 9$} &&& \multicolumn{1}{c}{$D=30$} &&&&&&&&& \multicolumn{1}{c}{$D = 4$} &&&
\multicolumn{1}{c}{$D = 9$} &&& \multicolumn{1}{c}{$D=30$} \\
\cmidrule{3-4} \cmidrule{7-8} \cmidrule{10-11} \cmidrule{18-19} \cmidrule{22-22} \cmidrule{25-25} RANSAC &&& $1.18$ &&& $1.25$ &&& $1.76$ &&&&&&&&& $8.27$ &&& $11.61$ &&& $16.00$ \\
REAPER &&& $0.05$ &&& $0.04$ &&& $0.04$ &&&&&&&&& $0.18$ &&& $0.17$ &&& $0.19$ \\
DPCP-r &&& $1.18$ &&& $1.24$ &&& $1.75$ &&&&&&&&& $8.21$ &&& $11.55$ &&& $15.89$ \\
DPCP-d &&& $0.02$ &&& $0.02$ &&& $0.05$ &&&&&&&&& $0.10$ &&& $0.16$ &&& $0.42$ \\
DPCP-IRLS &&& $0.12$ &&& $0.14$ &&& $0.21$ &&&&&&&&& $0.77$ &&& $0.81$ &&& $0.82$ \\ \bottomrule[1pt]
\end{tabular} \label{table:synthetic_D_vs_n_noise_outliers_T50_rt}
\end{table} \normalsize
Moving on, we fix $D=9$ and vary the outlier ratio as $10\%,30\%,50\%$ (in the previous experiment the outlier ratio was $10\%$). Then the mean clustering accuracy over $50$ independent trials is
shown in Fig. \ref{fig:MultipleDPCPRansacStyleRvsnalpha} and Fig. \ref{fig:MultipleDPCPRansacStyleRvsn08}.
In this experiment the hierarchy of the methods is clear: Algorithm \ref{alg:MultipleDPCPsequential} using DPCP-r and using DPCP-IRLS are the best and second best methods, respectively, while the rest of the methods perform
equally poorly. As an example, in the challenging scenario of $n=4,D=30$ and $50\%$ outliers, for $\alpha=0.6$, DPCP-r gives $74\%$ accuracy, while the next best method is DPCP-IRLS with $58\%$ accuracy; in that scenario RANSAC and REAPER give $38\%$ and $41\%$ accuracy respectively, while DPCP-r-d and DPCP-d give $41\%$ and $40\%$ respectively. Moreover, for $n=2,D=30$ and $\alpha=0.8$ DPCP-r and DPCP-IRLS give $95\%$ and $86\%$ accuracy, while all other methods give about $65\%$.
\subsection{3D Plane clustering of real Kinect data} \label{subsection:ExperimentsReal}
\indent \myparagraph{Dataset and objective} In this section we explore various Iterative Hyperplane Clustering\footnote{Recall from \S \ref{section:PriorArt} and \S \ref{subsection:AlgorithmsKHstyle} that by \emph{iterative hyperplane clustering}, we mean the process of estimating $n$ hyperplanes, then assigning each point to its closest hyperplane, then refining the hyperplanes associated to a cluster only from the points of the cluster, re-assigning points to hyperplanes and so on.} (IHL) algorithms using the benchmark dataset
NYUdepthV2 \cite{Silberman:ECCV12}. This dataset consists of $1449$ RGBd data instances acquired using
the Microsoft kinect sensor. Each instance of NYUdepthV2 corresponds to an indoor scene, and consists of the $480 \times 640 \times 3$ RGB data together with depth data for each pixel, i.e., a total of $480 \cdot 640$ depth values. In turn, the depth data can be used to reconstruct a $3D$ point cloud associated to the scene. In this experiment we use such $3D$ point clouds to learn plane arrangements and segment
the pixels of the corresponding RGB images based on their plane membership. This is an important problem
in robotics, where estimating the geometry of a scene is essential for successful robot navigation.
\indent \myparagraph{Manual annotation}
While the coarse geometry of most indoor scenes can be approximately described by a union of a few ($\le 9$) planes, many points in the scene do not lie in these planes, and may thus be viewed as outliers. Moreover,
it is not always clear how many planes one should select or which these planes are. In fact, NYUdepthV2
does not contain any ground truth annotation based on planes, rather the scenes are annotated semantically with a view to object recognition. For this reason, among a total of $1449$ scenes, we manually annotated $92$ scenes, in which the dominant planes are well-defined and capture most of the scene; see for example
Figs. \ref{figure:IMAGE2_GC0}-\ref{figure:IMAGE2_AnnotationGC0} and \ref{figure:IMAGE5_GC0}-\ref{figure:IMAGE5_AnnotationGC0}. Specifically, for each of the $92$ images, at most $9$ dominant
planar regions were manually marked in the image and the set of pixels within these regions were declared inliers,
while the remaining pixels were declared outliers. For each planar region a ground truth normal vector was computed using DPCP-r. Finally, two planar regions that were considered distinct during manual annotation, were merged if the absolute inner product of their corresponding normal vectors was above $0.999$.
\indent \myparagraph{Pre-processing} For computational reasons, the hyperplane clustering algorithms that we use (to be described in the next paragraph) do not act directly on the original $3D$ point cloud, rather on a weighted subset of it, corresponding to a superpixel representation of each image. In particular, each
$480 \times 640 \times 3$ RGB image is segmented to about $1000$ superpixels and the entire $3D$ point sub-cloud corresponding to each superpixel is replaced by the point in the geometric center of the superpixel. To account for
the fact that the planes associated with an indoor scene are affine, i.e., they do not pass through a common origin,
we work in homogeneous coordinates, i.e., we append a fourth coordinate to each $3D$ point representing a superpixel and normalize it to unit $\ell_2$-norm. Finally, a weight is assigned to each representative $3D$ point, equal to the number of pixels in the underlying superpixel. The role of this weight is to regulate the influence of each point in the modeling error (points representing larger superpixels should have more influence).
\indent \myparagraph{Algorithms} The first algorithm that we test is the sequential RANSAC algorithm (SHL-RANSAC), which identifies one plane at a time. Secondly, we explore a family of variations of the IHL algorithm (see \S \ref{section:PriorArt})
based on SVD, DPCP, REAPER and RANSAC. In particular, IHL(2)-SVD indicates the classic IHL algorithm which computes normal vectors through the Singular Value Decomposition (SVD), and minimizes an $\ell_2$ objective (this is K-Hyperplanes). IHL(1)-DPCP-r-d, IHL(1)-DPCP-d and IHL(1)-DPCP-IRLS, denote IHL variations of DPCP according to Algorithm \ref{alg:IHL-DPCP}, depending on which method is used to solve the DPCP problem \eqref{eq:ell1} \footnote{IHL(1)-DPCP-r was not included since it was slowing down the experiment considerably, while its performance was similar to the rest of the DPCP methods.}. Similarly, IHL(1)-REAPER and IHL(1)-RANSAC denote the obvious adaptation of IHL where the normals are computed with REAPER and RANASC, respectively, and an $\ell_1$ objective is minimized.
A third method that we explore is a hybrid between Algebraic Subspace Clustering (ASC), RANSAC and IHL,
(IHL-ASC-RANSAC). First, the
vanishing polynomial associated to ASC (see \S \ref{section:PriorArt}) is computed with RANSAC instead of SVD, which is the traditional way; this ensures robustness to outliers.
Then spectral clustering applied on the angle-based affinity associated to ASC (see equation \eqref{eq:ABA})
yields $n$ clusters. Finally, one iteration of IHL-RANSAC refines these clusters and yields a normal vector per cluster (the normal vectors are necessary for the post-processing step).
\setlength{\tabcolsep}{0.17em}
\begin{table}[t]
\centering
\ra{0.7}
\caption{$3D$ plane clustering error for a subset of the real Kinect dataset NYUdepthV2. $n$ is the number of fitted planes. GC(0) and GC(1) refer to clustering error without or with spatial smoothing, respectively. }
\small
\begin{tabular}
{lllllrrrrrrrrrrrrrrrrrrrrrrrrr}\toprule[1pt]
\phantom{a} && \phantom{a} &&& \multicolumn{3}{c}{$n \le 2$} &
\phantom{a} && \multicolumn{3}{c}{$n \le 4$} & \phantom{a} && \multicolumn{3}{c}{all} \\
\cmidrule{5-8} \cmidrule{10-13} \cmidrule{15-18}
\phantom{a} && \phantom{a} &&& GC(0) && GC(1) & \phantom{a} && GC(0) && GC(1) & \phantom{a} &&GC(0) && GC(1) \\
\midrule[0.5pt]
$(\tau=10^{-1})$&& IHL-ASC-RANSAC &&& $16.25$&&$12.68$ &&& $28.22$ &&$19.56$ &&& $32.95$&&$19.83$ \\
&& SHL-RANSAC &&& $16.01$&&$12.89$ &&& $29.63$ &&$23.96$ &&& $36.00$&&$28.70$ \\
&& IHL(1)-RANSAC &&& $12.73$&&$9.12$ &&& $22.16$ &&$14.56$ &&& $28.61$&&$18.22$ \\
&& IHL(1)-DPCP-r-d &&& $\boldsymbol{12.25}$&&$\boldsymbol{8.72}$ &&& $\boldsymbol{19.78}$ &&$\boldsymbol{13.15}$ &&& $\boldsymbol{24.37}$&&$\boldsymbol{15.55}$ \\
&& IHL(1)-DPCP-d &&& $12.45$&&$8.95$ &&& $19.91$ &&$13.30$ &&& $24.66$&&$16.04$ \\
\midrule[0.1pt]
$(\tau=10^{-2})$&& IHL-ASC-RANSAC &&& $9.50$&&$5.19$ &&&
$19.72$ &&$10.29$ &&& $25.15$&&$12.18$ \\
&& SHL-RANSAC &&& $\boldsymbol{6.27}$&&$\boldsymbol{3.29}$ &&& $\boldsymbol{12.84}$ &&$\boldsymbol{6.75}$ &&& $\boldsymbol{19.17}$&&$\boldsymbol{9.81}$ \\
&& IHL(1)-RANSAC &&& $7.97$&&$5.06$ &&& $14.37$ &&$8.78$ &&& $20.34$&&$12.43$ \\
&& IHL(1)-DPCP-r-d &&& $12.70$&&$9.07$ &&& $21.46$ &&$13.98$ &&& $25.94$&&$16.20$ \\
&& IHL(1)-DPCP-d &&& $12.70$&&$9.08$ &&& $21.50$ &&$14.03$ &&& $26.04$&&$16.22$ \\
\midrule[0.1pt]
$(\tau=10^{-3})$&& IHL-ASC-RANSAC &&& $8.75$&&$4.80$ &&&
$20.35$ &&$10.72$ &&& $24.46$&&$\boldsymbol{11.95}$ \\
&& SHL-RANSAC &&& $15.26$&&$8.34$ &&& $25.89$ &&$11.49$ &&& $33.08$&&$13.90$ \\
&& IHL(1)-RANSAC &&& $\boldsymbol{7.48}$&&$\boldsymbol{4.79}$ &&& $\boldsymbol{13.86}$ &&$\boldsymbol{8.79}$ &&& $\boldsymbol{19.39}$&&$12.07$ \\
&& IHL(1)-DPCP-r-d &&& $12.93$&&$9.33$ &&& $21.06$ &&$13.60$ &&& $25.65$&&$16.27$ \\
&& IHL(1)-DPCP-d &&& $12.93$&&$9.33$ &&& $21.06$ &&$13.59$ &&& $25.63$&&$16.23$ \\
\midrule[0.5pt]
$(mean)$&& IHL-ASC-RANSAC&&& $11.50$&&$7.56$ &&&
$22.76$ &&$13.52$ &&& $27.52$&&$14.65$ \\
$(mean)$&& SHL-RANSAC &&& $12.51$&&$8.17$ &&&
$22.78$ &&$14.07$ &&& $29.42$&&$17.47$\\
$(mean)$&& IHL(1)-RANSAC &&& $\boldsymbol{9.39}$&&$\boldsymbol{6.32}$ &&&
$\boldsymbol{16.80}$ &&$\boldsymbol{10.71}$ &&& $\boldsymbol{22.78}$&&$\boldsymbol{14.24}$ \\
$(mean)$&& IHL(1)-DPCP-r-d &&& $12.63$&&$9.04$ &&&
$20.77$ &&$13.58$ &&& $25.32$&&$16.01$ \\
$(mean)$&& IHL(1)-DPCP-d &&& $12.69$&&$9.12$ &&&
$20.83$ &&$13.64$ &&& $25.45$&&$16.16$ \\
&& IHL(2)-SVD &&& $13.36$&&$9.96$ &&&
$21.85$ &&$14.40$ &&& $26.22$&&$16.71$ \\
&& IHL(1)-REAPER &&& $12.45$&&$8.98$ &&&
$20.94$ &&$13.71$ &&& $25.52$&&$16.27$ \\
&& IHL(1)-DPCP-IRLS &&& $12.47$&&$9.01$ &&&
$20.77$ &&$13.64$ &&& $25.38$&&$16.10$ \\
\bottomrule[1pt]
\end{tabular} \label{table:NYU}
\end{table} \normalsize
\begin{figure}[t!]
\centering
\subfigure[original image]{\label{figure:IMAGE5_GC0}\includegraphics[width=0.3\linewidth]{IMAGE5-eps-converted-to.pdf}} \subfigure[annotation]{\label{figure:IMAGE5_AnnotationGC0}\includegraphics[width=0.3\linewidth]{IMAGE5_Annotation-eps-converted-to.pdf}}
\subfigure[IHL-ASC-RANSAC ($24.7\%$)]{\label{figure:I5_ASC_RANSAC_GC0}\includegraphics[width=0.3\linewidth]{I5_ASC_RANSAC_GC0-eps-converted-to.pdf}}\subfigure[SHL-RANSAC ($9.11\%$)]{\label{figure:I5_RANSAC_RANSAC_GC0}\includegraphics[width=0.3\linewidth]{I5_RANSAC_RANSAC_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-RANSAC ($11.9\%$)]{\label{figure:I5_KH_RANSAC_GC0}\includegraphics[width=0.3\linewidth]{I5_KH_RANSAC_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-r-d ($9.88\%$)]{\label{figure:I5_KH_DPCP_GC0}\includegraphics[width=0.3\linewidth]{I5_KH_DPCP_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-d ($10.24\%$)]{\label{figure:I5_KH_ADM_GC0}\includegraphics[width=0.3\linewidth]{I5_KH_ADM_GC0-eps-converted-to.pdf}}
\subfigure[IHL(2)-SVD ($9.78\%$)]{\label{figure:I5_KH_SVD_GC0}\includegraphics[width=0.3\linewidth]{I5_KH_SVD_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-REAPER ($9.05\%$)]{\label{figure:I5_KH_REAPER_GC0}\includegraphics[width=0.3\linewidth]{I5_KH_REAPER_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-IRLS ($9.78\%$)]{\label{figure:I5_KH_L12_IRLS_GC0}\includegraphics[width=0.3\linewidth]{I5_KH_L12_IRLS_GC0-eps-converted-to.pdf}}
\caption{Segmentation into planes of image $5$ in dataset NYUdepthV2 without spatial smoothing. Numbers are segmentation errors.}\label{figure:IMAGE5-GC0}
\end{figure}
\begin{figure}[t!]
\centering
\subfigure[original image]{\label{figure:OriginalImage}\includegraphics[width=0.3\linewidth]{IMAGE5-eps-converted-to.pdf}} \subfigure[annotation]{\label{figure:IMAGE5_Annotation}\includegraphics[width=0.3\linewidth]{IMAGE5_Annotation-eps-converted-to.pdf}}\\ \subfigure[IHL-ASC-RANSAC ($7.98\%$)]{\label{figure:I5_ASC_RANSAC_GC1}\includegraphics[width=0.3\linewidth]{I5_ASC_RANSAC_GC1-eps-converted-to.pdf}}
\subfigure[SHL-RANSAC ($3.24\%$)]{\label{figure:I5_RANSAC_RANSAC_GC1}\includegraphics[width=0.3\linewidth]{I5_RANSAC_RANSAC_GC1-eps-converted-to.pdf}}
\subfigure[IHL(1)-RANSAC ($8.36\%$)]{\label{figure:I5_KH_RANSAC_GC1}\includegraphics[width=0.3\linewidth]{I5_KH_RANSAC_GC1-eps-converted-to.pdf}} \subfigure[IHL-DPCP-ADM ($8.36\%$)]{\label{figure:I5_KH_DPCP_GC1}\includegraphics[width=0.3\linewidth]{I5_KH_DPCP_GC1-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-d ($8.057\%$)]{\label{figure:I2_KH_ADM_GC1}\includegraphics[width=0.3\linewidth]{I5_KH_ADM_GC1-eps-converted-to.pdf}}
\subfigure[IHL(2)-SVD ($8.36\%$)]{\label{figure:I5_KH_SVD_GC1}\includegraphics[width=0.3\linewidth]{I5_KH_SVD_GC1-eps-converted-to.pdf}}
\subfigure[IHL(1)-REAPER ($8.07\%$)]{\label{figure:I5_KH_REAPER_GC1}\includegraphics[width=0.3\linewidth]{I5_KH_REAPER_GC1-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-IRLS ($8.36\%$)]{\label{figure:I5_KH_L12_IRLS_GC1}\includegraphics[width=0.3\linewidth]{I5_KH_L12_IRLS_GC1-eps-converted-to.pdf}}
\caption{Segmentation into planes of image $5$ in dataset NYUdepthV2 with spatial smoothing. Numbers are segmentation errors.}\label{figure:IMAGE5-GC1}
\end{figure}
\begin{figure}[t!]
\centering
\subfigure[original image]{\label{figure:IMAGE2_GC0}\includegraphics[width=0.3\linewidth]{IMAGE2-eps-converted-to.pdf}} \subfigure[annotation]{\label{figure:IMAGE2_AnnotationGC0}\includegraphics[width=0.3\linewidth]{IMAGE2_Annotation-eps-converted-to.pdf}} \subfigure[IHL-ASC-RANSAC ($23.6\%$)]{\label{figure:I2_ASC_RANSAC_GC0}\includegraphics[width=0.3\linewidth]{I2_ASC_RANSAC_GC0-eps-converted-to.pdf}}\subfigure[SHL-RANSAC ($7.9\%$)]{\label{figure:I2_RANSAC_RANSAC_GC0}\includegraphics[width=0.3\linewidth]{I2_RANSAC_RANSAC_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-RANSAC ($8.6\%$)]{\label{figure:I2_KH_RANSAC_GC0}\includegraphics[width=0.3\linewidth]{I2_KH_RANSAC_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-r-d ($12.24\%$)]{\label{figure:I2_KH_DPCP_GC0}\includegraphics[width=0.3\linewidth]{I2_KH_DPCP_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-d ($12.73\%$)]{\label{figure:I2_KH_ADM_GC0}\includegraphics[width=0.3\linewidth]{I2_KH_ADM_GC0-eps-converted-to.pdf}}
\subfigure[IHL(2)-SVD ($43.0\%$)]{\label{figure:I2_KH_SVD_GC0}\includegraphics[width=0.3\linewidth]{I2_KH_SVD_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-REAPER ($22.82\%$)]{\label{figure:I2_KH_REAPER_GC0}\includegraphics[width=0.3\linewidth]{I2_KH_REAPER_GC0-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-IRLS ($13.9\%$)]{\label{figure:I2_KH_L12_IRLS_GC0}\includegraphics[width=0.3\linewidth]{I2_KH_L12_IRLS_GC0-eps-converted-to.pdf}}
\caption{Segmentation into planes of image $2$ in dataset NYUdepthV2 without spatial smoothing. Numbers are segmentation errors.}\label{figure:IMAGE2-GC0}
\end{figure}
\begin{figure}[t!]
\centering
\subfigure[original image]{\label{figure:OriginalImage}\includegraphics[width=0.3\linewidth]{IMAGE2-eps-converted-to.pdf}} \subfigure[annotation]{\label{figure:IMAGE2_Annotation}\includegraphics[width=0.3\linewidth]{IMAGE2_Annotation-eps-converted-to.pdf}}\\ \subfigure[IHL-ASC-RANSAC ($12.3\%$)]{\label{figure:I2_ASC_RANSAC_GC1}\includegraphics[width=0.3\linewidth]{I2_ASC_RANSAC_GC1-eps-converted-to.pdf}}
\subfigure[SHL-RANSAC ($5.91\%$)]{\label{figure:I2_RANSAC_RANSAC_GC1}\includegraphics[width=0.3\linewidth]{I2_RANSAC_RANSAC_GC1-eps-converted-to.pdf}}
\subfigure[IHL(1)-RANSAC ($9.39\%$)]{\label{figure:I2_KH_RANSAC_GC1}\includegraphics[width=0.3\linewidth]{I2_KH_RANSAC_GC1-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-r-d ($10.05\%$)]{\label{figure:I2_KH_DPCP_GC1}\includegraphics[width=0.3\linewidth]{I2_KH_DPCP_GC1-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-d ($10.05\%$)]{\label{figure:I2_KH_ADM_GC1}\includegraphics[width=0.3\linewidth]{I2_KH_ADM_GC1-eps-converted-to.pdf}}
\subfigure[IHL(2)-SVD ($32.37\%$)]{\label{figure:I2_KH_SVD_GC1}\includegraphics[width=0.3\linewidth]{I2_KH_SVD_GC1-eps-converted-to.pdf}}
\subfigure[IHL(1)-REAPER ($13.70\%$)]{\label{figure:I2_KH_REAPER_GC1}\includegraphics[width=0.3\linewidth]{I2_KH_REAPER_GC1-eps-converted-to.pdf}}
\subfigure[IHL(1)-DPCP-IRLS ($10.0\%$)]{\label{figure:I2_KH_L12_IRLS_GC1}\includegraphics[width=0.3\linewidth]{I2_KH_L12_IRLS_GC1-eps-converted-to.pdf}}
\caption{Segmentation into planes of image $2$ in dataset NYUdepthV2 with spatial smoothing. Numbers are segmentation errors.}\label{figure:IMAGE2-GC1}
\end{figure}
\indent \myparagraph{Post-processing} The algorithms described above, are generic hyperplane clustering
algorithms. On the other hand, we know that nearby points in a $3D$ point cloud have a high
chance of lying in the same plane, simply because indoor scenes are spatially coherent. Thus
to associate a spatially smooth image segmentation to each algorithm, we use the normal vectors $\boldsymbol{b}_1,\dots,\boldsymbol{b}_n$
that the algorithm produced to minimize a Conditional-Random-Field
\citep{SuttonMcCallum:MITPress06} type of energy function, given by
\begin{align}
E(y_1,\dots,y_N) := \sum_{j=1}^N d(\boldsymbol{b}_{y_j},\boldsymbol{x}_j) + \lambda \sum_{k \in \mathcal{N}_j} w(\boldsymbol{x}_j,\boldsymbol{x}_k) \delta (y_j \neq y_k).
\label{eq:CRF}
\end{align} In \eqref{eq:CRF} $y_j \in \left\{1,\dots,n \right\}$ is the plane label of point $\boldsymbol{x}_j$,
$d(\boldsymbol{b}_{\boldsymbol{y}_j},\boldsymbol{x}_j)$ is a unary term that measures the cost of assigning 3D point $\boldsymbol{x}_j$ to the plane with normal $\boldsymbol{b}_{\boldsymbol{y}_j}$, $w(\boldsymbol{x}_j,\boldsymbol{x}_k) $ is a pairwise term that measures the similarity between points $\boldsymbol{x}_j$ and $\boldsymbol{x}_k$, $\lambda > 0$ is a chosen parameter, $\mathcal{N}_j$ indexes the neighbors of $\boldsymbol{x}_j$, and $\delta(\cdot)$ is the indicator function. The unary term is defined as $d(\boldsymbol{b}_{y_j},\boldsymbol{x}_j) = |\boldsymbol{b}_{y_j}^\top \boldsymbol{x}_j |$, which is the Euclidean distance from point $\boldsymbol{x}_j$ to the plane with normal $\boldsymbol{b}_{y_j}$, and the pairwise term is defined as
\begin{align}
w(\boldsymbol{x}_j,\boldsymbol{x}_k) := \text{CB}_{j,k} \, \exp\left({-\frac{\|\boldsymbol{x}_j - \boldsymbol{x}_k \|_2^2}{2 \sigma_d^2}}\right),
\end{align} where $\left\|\boldsymbol{x}_j - \boldsymbol{x}_k \right\|_2$ is the Euclidean distance from $\boldsymbol{x}_j$ to $\boldsymbol{x}_k$, and CB$_{j,k}$ is the length of the common boundary between superpixels $j$ and $k$. The minimization of the energy function is done via Graph-Cuts \citep{Boykov:PAMI01}.
\indent \myparagraph{Parameters}
For the thresholding parameter of SHL-RANSAC, denoted by $\tau$,
we test the values $0.1,0.01,0.001$. For the parameter $\tau$
of IHL(1)-DPCP-d and IHL(1)-DPCP-r-d we test the values $0.1,0.01,0.001$. We also use the same values for the thresholding parameter of SHL-RANSAC, which we also denote by $\tau$. The rest of the parameters of DPCP and REAPER are set as in Section \ref{subsection:ExperimentsSynthetic}.
The convergence accuracy of the IHL algorithms is set to $10^{-3}$.
Moreover, the IHL algorithms are configured to allow for a maximal number
of $10$ random restarts and $100$ iterations per restart, but the overall running time of each IHL algorithm should not exceed $5$ seconds; this latter constraint is also enforced to SHL-RANSAC and IHL-ASC-RANSAC.
The parameter $\sigma_d$ in \eqref{eq:CRF} is set to the mean distance between $3D$ points representing neighboring superpixels. The parameter $\lambda$ in \eqref{eq:CRF} is set to the inverse of twice the maximal
row-sum of the pairwise matrix $\left\{w(\boldsymbol{x}_j,\boldsymbol{x}_k) \right\}$; this is to achieve a balance between unary and pairwise terms.
\indent \myparagraph{Evaluation} Recall that none of the algorithms considered in this section is explicitly configured to detect outliers, rather it assigns each and every point to some plane.
Thus we compute the clustering error as follows. First, we restrict the output labels of each algorithm to the indices of the dominant ground-truth cluster, and measure how far are these restricted labels from being identical (identical labels would signify that the algorithm identified perfectly well the plane); this is done by computing the ratio of the restricted labels that are different from the dominant label. Then the dominant
label is \emph{disabled} and a similar error is computed for the second dominant ground-truth plane, and so on. Finally the clustering error is taken to be the weighted sum of the errors associated with each dominant plane, with the weights proportional to the size of the ground-truth cluster.
We evaluate the algorithms in several different settings. First, we test how well the algorithms can cluster
the data into the first $n$ dominant planes, where $n$ is $2,4$ or equal to the total number of annotated
planes for each scene. Second, we report the clustering error before spatial smoothing, i.e., without refining
the clustering by minimizing \eqref{eq:CRF}, and after spatial smoothing. The former case is denoted by
GC(0), indicating that no graph-cuts takes place, while the latter is indicated by GC(1). Finally,
to account for the randomness in RANSAC as well as the random initialization of IHL, we average the clustering errors over $10$ independent experiments.
\indent \myparagraph{Results} The results are reported in Table \ref{table:NYU}, where the clustering error of
the methods that depend on $\tau$ is shown for each value of $\tau$ individually, as well as
averaged over all three values.
Notice that spatial smoothing improves the clustering accuracy considerably (GC(0) vs GC(1)); e.g., the clustering error of the traditional IHL(2)-SVD for all ground-truth planes drops from $26.22\%$ to $16.71\%$, when spatial smoothing is employed. Moreover, as it is intuitively expected, the clustering error increases when fitting more planes (larger $n$) is required; e.g., for the GC(1) case, the error of IHL(2)-SVD increases from $9.96\%$ for $n=2$ to $16.71\%$ for all planes ($n \approx 9$).
Next, we note the remarkable insensitivity of the DPCP-based methods IHL(1)-DPCP-d and IHL(1)-DPCP-r-d to variations of the parameter $\tau$. In sharp contrast, SHL-RANSAC is very sensitive to $\tau$; e.g., for $\tau=0.01$ and $n=2$, SHL-RANSAC is the best method with $6.27\%$, while for $\tau=0.1, 0.001$ its error increases to $16.01\%$ and $15.26\%$ respectively. Interestingly, the hybrid IHL(1)-RANSAC is significantly more robust; in fact, in terms of clustering error it is the best method. On the other hand,
by looking at the lower part of Table \ref{table:NYU}, we conclude that on average the rest of the methods have very similar behavior.
Figs. \ref{figure:IMAGE5-GC0}-\ref{figure:IMAGE2-GC1} show some segmentation results for two scenes,
with and without spatial smoothing. It is remarkable that, even though the segmentation in
Fig. \ref{figure:IMAGE5-GC0} contains artifacts, which are expected due to the lack of spatial smoothing, its quality is actually very good, in that most of the dominant planes have been correctly identified. Indeed, applying spatial smoothing (Fig. \ref{figure:IMAGE5-GC1}) further drops the error for most methods only by about $1\%$.
\section{Conclusions}
We studied theoretically and algorithmically the application of the recently proposed single subspace learning
method \emph{Dual Principal Component Pursuit (DPCP)} to the problem of clustering data that lie close to
a union of hyperplanes. We gave theoretical conditions under which the non-convex cosparse problem
associated with DPCP admits a unique (up to sign) global solution equal to the normal vector of
the underlying dominant hyperplane. We proposed sequential and parallel hyperplane clustering methods,
which on synthetic data dramatically improved upon state-of-the-art methods such as RANSAC or REAPER, while were competitive to the latter in the case of learning unions of $3D$ planes from real Kinect data.
Future research directions include analysis in the presence of noise, generalizations to unions of subspaces of arbitrary dimensions, even more scalable algorithms, and applications to deep networks.
\section*{Acknowledgement}
This work was supported by grants NSF 1447822 and NSF 1618637. The authors thank Prof. Daniel P. Robinson of the Applied Mathematics and Statistics department of the Johns Hopkins University for many useful conversations, as well as for his many comments that helped improve this manuscript.
| {'timestamp': '2017-06-21T02:01:29', 'yymm': '1706', 'arxiv_id': '1706.01604', 'language': 'en', 'url': 'https://arxiv.org/abs/1706.01604'} | arxiv |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.