diff --git a/1712.00661v3.txt b/1712.00661v3.txt new file mode 100644 index 0000000000000000000000000000000000000000..6dcb3eca41e21c433eadd88bc99c4907059d476d --- /dev/null +++ b/1712.00661v3.txt @@ -0,0 +1,395 @@ +\section{Introduction} +Semantic image segmentation is a classic computer vision task that aims at assigning each pixel in an image with a class label such as ``chair'', ``person'', and ``dog''. +It enjoys a wide spectrum of applications, such as scene understanding~\cite{li2009towards,lin2014microsoft,li2017video} and autonomous driving~\cite{geiger2013vision,cordts2016cityscapes,li2017not}. +Deep convolutional neural network (CNN) is now the state-of-the-art technique for semantic image segmentation~\cite{long2015fully,liu2015semantic,zhao2016pyramid,liu2017deep}. The excellent performance, however, comes with a price of expensive and laborious label annotations. +In most existing pipelines, a network is usually first pre-trained on millions of class-labeled images, e.g.,~ImageNet \cite{russakovsky2015imagenet} and MS COCO \cite{lin2014microsoft}, and subsequently fine-tuned with thousands of pixel-wise annotated images. + + + +Self-supervised learning\footnote{Project page: http://mmlab.ie.cuhk.edu.hk/projects/M\&M/} is a new paradigm proposed for learning deep representations without extensive annotations. This new technique has been applied to the task of image segmentation~\cite{zhang2016colorful,larsson2016learning,larsson2017colorization}. +In general, self-supervised image segmentation can be divided into two stages: \textit{the proxy stage}, and \textit{the fine-tuning stage}. +The proxy stage does not need any labeled data but requires one to design a proxy or pretext task with self-derived supervisory signals on unlabeled data. +For instance, learning by colorization~\cite{larsson2017colorization} utilizes the fact that a natural image is composed of luminance channel and chrominance channels. The proxy task is formulated with cross-entropy loss to predict an image chrominance from the luminance of the same image. +In the fine-tuning stage, the learned representations are utilized to initialize the target semantic segmentation network. The network is then fine-tuned with pixel-wise annotations. +It has been shown that without large-scale class-labeled pre-training, semantic image segmentation could still gain encouraging performance over random initialization or from-scratch training. + + +Though promising, the performance of self-supervised learning is still far from that achieved by supervised pre-training. +For instance, a VGG-16 network trained with the self-supervised method of~\cite{larsson2017colorization} achieves a 56.0\% mean Intersection over Union (mIoU) on PASCAL VOC 2012 segmentation benchmark~\cite{everingham2010pascal}, higher than a random initialized network that only yields 35.0\% mIoU. However, an identical network trained on ImageNet achieves 64.2\% mIoU. There exists a considerable gap between self-supervised and pure supervised pre-training. + +\begin{figure}[t] +\centering +\includegraphics[width=\linewidth]{intro3} +\caption{\small{(a) shows samples of patches from categories `bus' and `car', and these two categories have similar color distributions but different patch statistics. (b) depicts deep feature distributions of `bus' and `car', before and after mix-and-match, visualized with t-SNE~\cite{maaten2008visualizing}. Best viewed in color.}} +\label{fig:intro} +\end{figure} + +We believe that the performance discrepancy is mainly caused by the semantic gap between the proxy task and the target task. Take learning by colorization as an example, the goal of the proxy task is to colorize gray-scale images. +The representations learned from colorization may be well-suited for modeling color distributions, but are likely amateur in discriminating high-level semantics. +For instance, as shown in Fig.~\ref{fig:intro}(a), a red car can be arbitrarily more similar to a red bus than to a blue car. The features of both car and bus classes are highly overlapped, as depicted by the feature embedding in the left plot of Fig.~\ref{fig:intro}(b). + + +Improving the performance of self-supervised image segmentation requires one to improve the discriminative power of representation tailored to the target task. This goal is non-trivial -- target's pixel-wise annotations are discriminative for the goal but they often available with just a handful amount, typically in thousands of labeled images. +Existing approaches typically use a pixel-wise softmax loss to exploit pixel-wise annotations for fine-tuning a network. +This strategy may be sufficient for a network that is well-initialized by supervised pre-training but could fall inadequate for a self-supervised network of which the features are weak. +We argue that pixel-wise softmax loss is not the sole way of harnessing the information provided by pixel-wise annotations. + + +In this study, we present a new learning strategy called `mix-and-match' (M\&M), which can help harness the scarce labeled information of a target set for improving the performance of networks pre-trained by self-supervised learning. The M\&M learning is conducted after the proxy stage and before the usual target fine-tuning stage, serving as an intermediate step to bridge the gap between the proxy and target tasks. It is noteworthy that M\&M only uses the target images and its labels thus no additional annotation is required. + +The essence of M\&M is inspired by metric learning. +In the `\textit{mix}' step, we randomly sample a large number of local patches from the target set and mix them together. +The patch set is formed across images thus decouple any intra-image dependency to faithfully reflect the diverse and rich target distribution. Extracting patches also allows us to generate a massive number of triplets from the small target image set to produce stable gradients for training our network. +In the `\textit{match}' step, we form a graph with nodes defined by patches represented by their deep features. An edge between nodes is defined as attractive if the nodes share the same class label; otherwise, it is a rejective edge. +We enforce a class-wise connected graph, that is, all nodes from the same class in the graph compose a connected subgraph, as shown in Fig.~\ref{fig:graph}(c). This ensures global consistency in triplet selection coherent to the class labels. With the graph, we can derive a robust triplet loss that encourages the network to map each patch to a point in feature space so that patches belonging to the same class lie close together while patches of different classes are separated by a wide margin. +The way we sample triplets from a class-wise connected graph differs significantly from existing approach~\cite{schroff2015facenet} that forms multiple disconnected subgraphs for each class. + + +We summarize our contributions as follows. 1) We formulate a novel `mix-and-match' tuning method, which for the first time, allows networks pre-trained with self-supervised learning to outperform the supervised learning counterpart. Specifically, with VGG-16 as the backbone network, by using image colorization as the proxy task, our M\&M method achieves 64.5\%, outperforming the ImageNet pre-trained network that achieves 64.2\% mIoU on PASCAL VOC2012 dataset. Our method also obtains 66.4\% mIoU on CityScapes dataset, comparable to 67.9\% mIoU achieved by using a ImageNet pre-trained network. This improvement is significant considering that our approach is based on unsupervised pre-training. +2) Apart from the learning by colorization method, M\&M also improves learning by context method~\cite{noroozi2016unsupervised} by a large margin. +3) In the setting of random initialization, our method achieves significant improvements with both AlexNet and VGG-16, on both PASCAL VOC2012 and CityScapes. It makes training semantic segmentation from scratch possible. +4) In addition to the new notion of mix-and-match, we also present a triplet selection mechanism based on class-wise connected graph, which is more robust than conventional selection scheme for our task. +\section{Related Work} +\label{sec:relatedwork} + +\noindent +\textbf{Self-supervision.} +It is a standard and established practice to pre-train a deep network with large-scale class-labeled images (e.g., ImageNet) before fine-tuning the model for other visual tasks. Recent research efforts are gearing towards reducing the degree of or eliminating supervised pre-training altogether. Among various alternatives, self-supervised learning is gaining substantial interest. +To enable self-supervised learning, proxy tasks are designed so that meaningful representations can be induced from the problem-solving process. +Popular proxy tasks include sample reconstruction~\cite{pathak2016context}, temporal correlation~\cite{wang2015unsupervised,pathak2016learning}, learning by context~\cite{doersch2015unsupervised,noroozi2016unsupervised}, cross-transform correlation~\cite{dosovitskiy2015discriminative} and learning by colorization~\cite{zhang2016colorful,zhang2016split,larsson2016learning,larsson2017colorization}. +In this study, we do not design a new proxy task, but present an approach that could uplift the discriminative power of a self-supervised network tailored to the image segmentation task. We demonstrate the effectiveness of M\&M on learning by colorization and learning-by-context. + +\noindent +\textbf{Weakly-supervised segmentation.} +There exists a rich body of literature that investigates approaches for reducing annotations in learning deep models for the task of image segmentation. +Alternative annotations such as point~\cite{bearman2016s}, bounding box~\cite{dai2015boxsup}~\cite{papandreou2015weakly}, scribble~\cite{lin2016scribblesup} and video~\cite{hong2017weakly} have been explored as ``cheap'' supervisions to replace the pixel-wise counterpart. +Note that these methods still require ImageNet classification as a pre-training task. +Self-supervised learning is more challenging in that no image-level supervision is provided in the pre-training stage. The proposed M\&M approach is dedicated to improve the weak representation learned by self-supervised pre-training. + + +\noindent +\textbf{Graph-based segmentation.} +Graph-based image segmentation~\cite{felzenszwalb2004efficient} has been explored from early years. The main idea is to explore dependency between pixels. +Different from the conventional graph on pixels or superpixels in a single image, the proposed method defines the graph on image patches sampled from multiple images. We do not partition image by performing cuts on a graph, but use the graph to select triplets for the proposed discriminative loss. +\section{Mix-and-Match Tuning} +Figure~\ref{fig:arch} illustrates the proposed approach, where (a) and (c) depict the conventional stages for self-supervised semantic image segmentation, while (b) shows the proposed `mix-and-match' (M\&M) tuning. +Specifically, in (a), a proxy task, e.g.,~learning by colorization, is designed to pre-train the CNN using unlabeled images. +In (c), the pre-trained CNN is fine-tuned on images and the associated per-pixel labeled maps of a target task. +This work inserts M\&M tuning between the proxy task and the target task as shown in (b). It is noteworthy that M\&M uses the same target images and label maps in (c), hence no additional data is required. +As the name implies, M\&M tuning consists of two steps, namely `mix' and `match'. We explain these steps as follows. +\subsection{The Mix Step -- Patch Sampling} +Recall that our goal is to better harness the information in pixel-wise annotations of the target set. +Image patches have long been considered as strong visual primitive~\cite{singh2012unsupervised} that incorporates both appearance and structure information. Visual patches have been successfully applied to various tasks in visual understanding~\cite{li2013harvesting}. Inspired by these pioneering works, the first step of M\&M tuning is designed to be a `mix' step that aims at sampling patches across images. The relation between these patches can be exploited for optimization in the subsequent `match' operation. + +More precisely, a large number of image patches with various spatial sizes are randomly sampled from a batch of images. Heavily overlapped patches are discarded. These patches are represented by using the features extracted from the CNN pre-trained in the stage of Fig.~\ref{fig:arch}(a), and assigned with unique class labels based on the corresponding label map. +The patches across all images are mixed to decouple any intra-image dependency so as to reflect the diverse and rich target distribution. +The mixed patches are subsequently utilized as the input for the `match' operation. + + + + + + +\begin{figure}[t] +\centering +\includegraphics[width=\linewidth]{architecture_integral} +\caption{\small{An overview of the mix-and-match approach. Our approach starts with a self-supervised proxy task (a), and uses the learned CNN parameters to initialize the CNN in mix-and-match tuning (b). Given an image batch with label maps of the target task, we select and mix image patches and then match them according to their classes via a class-wise connected graph. The matching gives rise to a triplet loss, which can be optimized to tune the parameters of the network via back propagation. Finally, the modified CNN parameters are further fine-tuned to the target task (c).}} +\label{fig:arch} +\end{figure} +\subsection{The Match Step -- Perceptual Patch Graph} +Our next goal is to exploit the patches to generate stable gradients for tuning the network. +This is possible since patches are of different classes, and such relation can be employed to form a massive number of triplets. A triplet is denoted as $(P_a, P_p, P_n)$, where $P_a$ is an anchor patch, $P_p$ is a positive patch that shares the same label as $P_a$, and $P_n$ is a negative patch with a different class label. +With the triplets, one can formulate a discriminative triplet loss for fine-tuning the network. + + +A conventional way of sampling triplets is to follow the notion of~\citeauthor{schroff2015facenet}~\shortcite{schroff2015facenet}. For convenience, we call this strategy as `\textit{random triplets}'. In this strategy, triplets are randomly picked from the input batch. +For instance, as shown in Fig.~\ref{fig:graph}(a), nodes $\{1,2\}$ and an arbitrary negative patch forms a triplet, and nodes $\{3,4\}$ and another negative patch forms another triplet. +As can be seen, there is no positive connection between nodes $\{1,2\}$ and $\{3,4\}$ despite they share a common class label. +While locally the distance between each triplet is optimized, the boundary of the positive class can be loose since the global constraint (i.e.~all nodes $\{1,2,3,4\}$ must lie closer) is not enforced. +We term this phenomenon as global inconsistency. +Empirically, we found that this approach tends to perform poorer than the proposed method, which will be introduced next. + + + +The proposed `match' step draws triplets in a different way from the conventional approach~\cite{schroff2015facenet}. +In particular, the `match' step begins with graph construction based on the mixed patches. For each CNN learning iteration, we construct a graph on-the-fly given a batch of input images. The nodes of the graph are patches. +Two types of edges are defined between nodes -- a) ``attractive'' if two nodes have an identical class label and b) ``rejective'' if two nodes have different class labels. +Different from~\cite{schroff2015facenet}, we enforce the graph to be connected, and importantly, the graph should be class-wise connected. That is, all nodes from the same class in the graph compose a connected subgraph via ``attractive'' edges. +We adopt an iterative strategy to create such a graph. +At first, the graph is initialized to be empty. Then, as shown in Fig.~\ref{fig:graph}(b), patches are absorbed individually into the graph as a node and it creates respectively one ``attractive'' and ``rejective'' edge with existing nodes in the graph. + +An example of an established graph is shown in Fig.~\ref{fig:graph}(c). +Considering nodes $\{1,2,3,4\}$ again, unlike `random triplets', the nodes form a connected subgraph. Different classes represented in green nodes and pink nodes also form coherent clusters based on their respective classes, imposing tighter constraints than random triplets. +To fully realize such class-wise constraints, each node in the graph will take turn to serve as an anchor for loss optimization. +An added benefit of permitting all nodes as possible anchor candidate is the improved utilization efficiency of patch relation over random triplets. + + + + +\begin{figure}[t] +\centering +\includegraphics[width=\linewidth]{graph_vs_triplet} +\caption{\small{This figure shows different strategies of drawing triplets. The color of nodes represent their labels. Blue and red edges denote attractive and rejective edges, respectively. (a) depicts the random triplet strategy~\cite{schroff2015facenet}, where nodes from the same class do not necessarily form a connected subgraph. (b-i) and (b-ii) shows the proposed triplet selection strategy. A class-wised connected graph is constructed to sample triplets, which enforces tighter constraints on positive class boundary. Details are explained in the main text of methodology section. Best viewed in color.}} +\label{fig:graph} +\end{figure} +\subsection{The Tuning Loss} +\label{subsec:train} +\noindent +\textbf{Loss function.} +To optimize the semantic consistency within the graph, for any two nodes in the graph, if they are connected by attractive edges, we seek to minimize their distance in the feature space; and if they are connected by rejective edges, the distance should be maximized. +Consider a node that connects two other nodes via attractive and rejective edges, we denote it as an ``anchor'' while the two connected nodes are denoted as ``positive'' and ``negative'' respectively. +These three nodes are grouped to be a ``triplet''. + +When constructing the graph, we ensure that each node can serve as ``anchor'', except for those nodes whose labels are unique among all the nodes. +Thus, the number of nodes equals the number of triplets. +Assume that in each iteration we discover $N$ triplets in the graph. +By converting the graph optimization problem into ``triplet ranking''~\cite{schroff2015facenet}, we formulate our loss function as follows: +\begin{equation} +L = \frac{1}{N}\sum_{i}^{N}\max\left \{ D\left ( P_a^i, P_p^i \right ) - D\left ( P_a^i, P_n^i \right ) + \alpha, 0 \right \}, +\end{equation} +where $P_a$, $P_p$, $P_n$, denote ``anchor'', ``positive'', ``negative'' nodes in a triplet, +$\alpha$ is a regularization factor controlling the distance margin and $D(\cdot,\cdot)$ is a distance metric measuring patch relationship. + + +In this work, we leverage perceptual distance~\cite{gatys2015neural} to characterize the relationship between patches. +This is different from previous works~\cite{singh2012unsupervised}~\cite{doersch2012makes} that define patch distance using low-level cues (e.g.,~colors and edges). +Specifically, the perceptual representation can be formulated as $f: P\rightarrow \mathbf{x}$, where $f$ denotes a convolutional neural network (CNN) and $\mathbf{x}$ denotes the extracted representation. +$D(P_0, P_1)$ is the perceptual distance between two patches, which can be formulated as: +\begin{equation} +D(P_i, P_j) = \left \| \left( \mathbf{x}_i / \|\mathbf{x}_i\|_2 - \mathbf{x}_j / \|\mathbf{x}_j\|_2 \right) \right \| ^{2}, +\end{equation} +where $\mathbf{x}_i$ and $\mathbf{x}_j$ is the CNN representation extracted from patch $P_i$ and $P_j$. +$L_{2}$ normalization is used here for calculating Euclidean distances. + + + +By optimizing the ``triplet ranking'' loss, our perceptual patch graph converges to both intra-class and inter-class semantic consistency. + +\noindent +\textbf{M\&M implementation details.} +We use both AlexNet~\cite{krizhevsky2012imagenet} and VGG-16~\cite{simonyan2015very} as our backbone CNN architectures, as illustrated in Fig.~\ref{fig:arch}. +For initialization, we try random initialization and two proxy tasks including Jigsaw Puzzles~\cite{noroozi2016unsupervised} and Colorization~\cite{larsson2017colorization}. +From a batch of $16$ images in each CNN iteration, we sample $10$ patches per image with various sizes and resize them to a fixed size of $128\times128$. +Then we extract ``pool5'' feature of these patches from the CNN for later usage. +We assign the patches' unique labels as the central pixel labels using the corresponding label maps. +Then we perform the iterative strategy to construct the graph as discussed in the methodology section. +We make use of each node in the graph as an ``anchor'', which is made possible by our graph construction strategy. If any node whose label is unique among all the nodes, we duplicate it as its ``positive'' counterpart. +In this way, we obtain a batch of meaningful triplets whose number is equal to the number of nodes, and feed them into a triplet loss layer, whose margin $\alpha$ is set as $2.1$. +Such a M\&M tuning is conducted for 8000 iterations on PASCAL VOC2012 or CityScapes training dataset. +The learning rate is fixed at $0.01$ before iteration 6000, and then dropped to $0.001$. We apply batch normalization to speed up convergence. + +\noindent +\textbf{Segmentation fine-tuning details.} +Finally, we fine-tune the CNN to the semantic segmentation task. For AlexNet, we follow the same setting as presented in~\cite{noroozi2016unsupervised}, and for VGG-16, we follow~\cite{larsson2017colorization} whose architecture is equipped with hyper-columns~\cite{hariharan2015hypercolumns}. +The fine-tuning process undergoes 40k iterations, with an initial learning rate as 0.01 and dropped with a factor of 10 at iteration 24k, 36k. +We keep tuning batch normalization layers before ``pool5''. All experiments follow the same setting. +\section{Experiments} +\label{sec:experiments} + + + +\noindent +\textbf{Settings.} +Different proxy tasks are combined with our M\&M tuning to demonstrate its merits. +In our experiments, as initialization, we use released models of different proxy tasks from learning by context (or Jigsaw Puzzles)~\cite{noroozi2016unsupervised} and learning by colorization~\cite{larsson2017colorization}. Both methods adopt 1.3 million unlabeled images in ImageNet dataset~\cite{deng2009imagenet} for training. +Besides that, we also perform experiments on randomly initialized networks. +In M\&M tuning, we make use of PASCAL VOC2012 dataset~\cite{everingham2010pascal}, which consists of 10,582 training samples with pixel-wise annotations. The same dataset is used in ~\cite{noroozi2016unsupervised,larsson2017colorization} for fine-tuning so no additional data is used in M\&M. +For fair comparisons, all self-supervision methods are benchmarked on PASCAL VOC2012 validation set that comes with 1,449 images. +We show the benefits of M\&M tuning on different backbone networks, including AlexNet and VGG-16. +To demonstrate the generalization ability of our learned model, we also report the performance of our VGG-16 full model on PASCAL VOC2012 test set. +We further apply our method on the CityScapes dataset~\cite{cordts2016cityscapes}, with 2,974 training samples and report results on the 500 validation samples. +All results are reported in mean Intersection over Union (mIoU), which is the standard evaluation criterion of semantic segmentation. +\subsection{Results} +\noindent +\textbf{Overall.} +Existing self-supervision works report segmentation results on PASCAL VOC2012 dataset. +The highest performance attained by existing self-supervision methods is learning by colorization~\cite{larsson2017colorization}, which achieves 38.4\% mIoU and 56.0\% mIoU with AlexNet and VGG-16 as the backbone network, respectively. +Therefore, we adopt learning by colorization as our proxy task here. +With our M\&M tuning, we boost the performance to 42.8\% mIoU and 64.5\% mIoU with AlexNet and VGG-16 as the backbone network. +As shown in Table~\ref{tab:bench}, our method achieves state-of-the-art performance on semantic segmentation, outperforming~\cite{larsson2016learning} by 14.3\% and~\cite{larsson2017colorization} by 8.5\% when using VGG-16 as backbone network. +Notably, our M\&M self-supervision paradigm shows comparable results (0.3\% point of advantage) to its ImageNet pre-trained counterpart. +Furthermore, on PASCAL VOC2012 test set, our approach achieves 64.3\% mIoU, which is a record-breaking performance for self-supervision methods. +Qualitative results of this model are shown in Fig.~\ref{fig:vlz_main}. + + +We additionally perform an ablation study on the AlexNet setting. +As shown in Table~\ref{tab:bench}, with colorization task as pre-training, our class-wise connected graph outperforms `random triplets' by 1.9\%, suggesting the importance of class-wise connected graph. +With solving jigsaw-puzzles as pre-training task, our model performs even better than colorization pre-training. + + +\begin{table}[t] + \centering + \caption{\small{We test our model on PASCAL VOC2012 validation set, which is the generally accepted benchmark for semantic segmentation with self-supervised pre-training. Our method achieves the state-of-the-art with both VGG-16 and AlexNet architectures.\label{tab:bench}}} + \scriptsize + \begin{tabular}{l|lcc@{}} + \hline + Method & Arch. & \begin{tabular}[c]{@{}c@{}}VOC12\\ \%mIoU.\end{tabular} \\ + \hline + ImageNet & VGG-16 & 64.2 \\ + \hline + Random & VGG-16 & 35.0 \\ + Larsson \textit{et al.}~\cite{larsson2016learning} & VGG-16 & 50.2 \\ + Larsson \textit{et al.}~\cite{larsson2017colorization} & VGG-16 & 56.0 \\ + \hline + Ours (M\&M + Graph, colorization pre-trained) & VGG-16 & \textbf{64.5} \\ + \hline \hline + ImageNet & AlexNet & 48.0 \\ + \hline + Random & AlexNet & 23.5 \\ + k-means~\cite{krahenbuhl2015data} & AlexNet & 32.6 \\ + Pathak \textit{et al.}~\cite{pathak2016context} & AlexNet & 29.7 \\ + Donahue \textit{et al.}~\cite{donahue2016adversarial} & AlexNet & 35.2 \\ + Zhang \textit{et al.}~\cite{zhang2016colorful} & AlexNet & 35.6 \\ + Zhang \textit{et al.}~\cite{zhang2016split} & AlexNet & 36.0 \\ + Noroozi et al.~\cite{noroozi2016unsupervised} & AlexNet & 37.6 \\ + Larsson \textit{et al.}~\cite{larsson2017colorization} & AlexNet & 38.4 \\ + \hline + Ours (M\&M + Random Triplets, colorization pre-trained) & AlexNet & 40.9 \\ + Ours (M\&M + Graph, colorization pre-trained) & AlexNet & 42.8 \\ + Ours (M\&M + Graph, jigsaw-puzzles pre-trained) & AlexNet & \textbf{44.5} \\ + \hline + \end{tabular} +\end{table} + +\begin{table*}[ht] +\centering +\caption{\small{Per-class segmentation results on PASCAL VOC2012 val. The last row shows the additional results of our model combined with ImageNet pre-trained model by averaging their prediction probabilities. The results suggest the complementary nature of our self-supervised method with ImageNet pre-trained model.\label{tab:perclass}}} +\small +\resizebox{\linewidth}{!}{ + \begin{tabular}{l|cccccccccccccccccccc|c} + \hline + & aero & bike & bird & boat & bottle & bus & car & cat & chair & cow & table & dog & horse & mbike & person & plant & sheep & sofa & train & tv & mIoU. \\ + \hline + ImageNet & 81.7 & \textbf{37.4} & \textbf{73.3} & 55.8 & 59.6 & 82.4 & 74.7 & 82.4 & 30.8 & 60.3 & 46.1 & \textbf{71.4} & 65.3 & \textbf{72.6} & 76.7 & \textbf{49.7} & 70.6 & 34.2 & 72.7 & \textbf{60.2} & 64.2 \\ + \hline + Colorization & 73.6 & 28.5 & 67.5 & 55.5 & 50.2 & 78.3 & 66.1 & 78.3 & 26.8 & 60.8 & \textbf{50.6} & 70.6 & 64.9 & 62.2 & 73.5 & 38.2 & 66.8 & \textbf{38.8} & 68.1 & 55.1 & 60.2 \\ + \hline + M\&M & \textbf{83.1} & 37.0 & 69.6 & \textbf{56.1} & \textbf{62.9} & \textbf{84.4} & \textbf{76.4} & \textbf{82.8} & \textbf{33.4} & \textbf{61.5} & 44.7 & 67.3 & \textbf{68.5} & 68.0 & \textbf{78.5} & 42.2 & \textbf{72.7} & 37.2 & \textbf{75.7} & 58.6 & \textbf{64.5} \\ + \hline + \hline + \begin{tabular}[c]{@{}l@{}}Ensemble\\ ImageNet+M\&M\end{tabular} & 84.5 & 39.4 & 76.3 & 60.3 & 64.6 & 85.4 & 77.7 & 84.1 & 35.6 & 63.6 & 50.4 & 70.6 & 72.0 & 73.6 & 80.1 & 50.2 & 73.7 & 37.6 & 77.8 & 66.6 & 67.4 \\ + \hline + \end{tabular} +} +\end{table*} + + +\begin{figure*}[ht] +\centering +\includegraphics[width=\linewidth]{tsne-all} +\caption{\small{Feature distribution with and without the proposed mix-and-match (M\&M) tuning. We use 17,684 patches obtained from PASCAL VOC2012 validation set to extract features, and map the high-dimensional features to a 2-D space with t-SNE, along with their categories. For clarity, we split 20 classes into four parts in order. The first row shows the feature distribution of a naively fine-tuned model without M\&M, and the second row depicts the feature distribution of a model additionally tuned with M\&M. Note that the features are respectively extracted from the CNNs which have been fine-tuned to segmentation task, in this case, two CNNs have undergone the identical amount of data and labels. Best viewed in color.}} +\label{fig:tsne} +\end{figure*} + + +\noindent +\textbf{Per-class results.} +We analyze per-class results of M\&M tuning on PASCAL VOC2012 validation set. +The results are summarized in Table~\ref{tab:perclass}. +When compared our method with the baseline model that uses colorization\footnote{We obtain higher performance than reported with the released pre-training model of ~\cite{larsson2017colorization}.} as pre-training, our approach demonstrates significant improvements in classes including aeroplane, bike, bottle, bus, car, chair, motorbike, sheep, train. +A further attempt at combining our self-supervised model and the fully-supervised model (through averaging their predictions) leads to an even higher mIoU of 67.4\%. +The results suggest that self-supervision serves as a strong candidate complementary to the current fully-supervised paradigm. + + +\noindent +\textbf{Applicability to different proxy tasks.} +Besides colorization~\cite{larsson2017colorization}, we also explore the possibility of using Jigsaw Puzzles~\cite{noroozi2016unsupervised} as our proxy task. +Similarly, our M\&M tuning boosts the segmentation performance from 36.5\%\footnote{We use the released pre-training model of Jigsaw Puzzles~\cite{noroozi2016unsupervised} for fine-tuning and obtain a slightly lower baseline than the reported 37.6\% mIoU in the paper.} mIoU to 44.5\% mIoU. +The result suggests that the proposed approach is widely applicable to other self-supervision methods. +Our method can also be applied to randomly initialized cases. In PASCAL VOC 2012, M\&M tuning boosts the performance from 19.8\% mIoU to 43.6\% mIoU with AlexNet and from 35.0\% mIoU to 56.7\% mIoU with VGG-16. +The improvements of our method over different baselines are shown in Table~\ref{tab:baselines} for PASCAL VOC 2012. + +\begin{table}[t] + \caption{\small{The table shows the improvements of our method with different pre-training tasks. They respectively are Random (Xavier initialization) with AlexNet and VGG-16, Jigsaw Puzzles~\cite{noroozi2016unsupervised} with AlexNet and Colorization~\cite{larsson2017colorization} with AlexNet and VGG-16. Baselines are produced with naive fine-tuning. ImageNet pre-trained results are regarded as upper bound. Evaluations are conducted on PASCAL VOC2012 validation set and CityScapes validation set. Results on testing sets are shown in brackets.\label{tab:baselines}}} + \resizebox{.47\textwidth}{!}{ + \centering + \small + \begin{tabular}{|l|c|c|c|c|c|@{}c@{}|c|c|} + \hline + benchmark & \multicolumn{5}{c|}{PASCAL VOC2012} && \multicolumn{2}{c|}{CityScapes} \\ + \hline + \hline + pre-train & Random & Jigsaw & Colorize & Random & Colorize && Random & Colorize\\ + \hline + backbone & \multicolumn{3}{c|}{AlexNet} & \multicolumn{2}{c|}{VGG-16} && \multicolumn{2}{c|}{VGG-16}\\ + \hline + baseline & 19.8 & 36.5 & 38.4 & 35.0 & 60.2 && 42.5 & 57.5\\ + \hline + M\&M & 43.6 & \textbf{44.5} & 42.8 & 56.7 & \textbf{64.5 (64.3)} && 49.1 & \textbf{66.4 (65.6)}\\ + \hline + \hline + ImageNet & \multicolumn{3}{c|}{48.0} & \multicolumn{2}{c|}{64.2} && \multicolumn{2}{c|}{67.9}\\ + \hline + \end{tabular} + } +\end{table} + +\noindent +\textbf{Generalizability to CityScapes.} +We apply our method on CityScapes dataset. With colorization as pre-training, naive fine-tuning yields 57.5\% mIoU and M\&M tuning improves it to 66.4\% mIoU. The result is comparable with ImageNet pre-trained counterpart that yields 67.9\% mIoU. +With a random initialized network, M\&M could bring a large improvement from 42.5\% mIoU to 49.1\% mIoU. +The comparison can be found in Table~\ref{tab:baselines}. +\subsection{Further Analysis} +\noindent +\textbf{Learned representations.} +To illustrate the learned representations enabled by M\&M tuning, we visualize the sample distribution changes in the t-SNE embedding space. +As shown in Fig.~\ref{fig:tsne}, after M\&M tuning, samples from the same category tend to stay close while those from different categories are torn apart. +Notably, this effect is more pronounced on categories of aeroplane, bike, bottle, bus, car, chair, motorbike, sheep, train and tv, which aligns with the per-class performance improvements listed in Table~\ref{tab:perclass}. + + + +\noindent +\textbf{The Effect of graph size.} +Here we investigate how the self-supervision performance is influenced by the graph size (the number of nodes in the graph), which defines the number of triplets that can be discovered. +Specifically, we set the image batch size to be $\{10, 20, 40\}$, so that the number of nodes is $\{100, 200, 400\}$, as shown in Fig.~\ref{fig:analysis}. +The comparative study is performed on AlexNet with learning by colorization~\cite{larsson2017colorization} as initialization. We have the following observations. +On the one hand, a larger graph leads to a higher performance, since it brings more diverse samples for more accurate metric learning. +On the other hand, a larger graph takes longer time for processing, since a larger batch size of images is fed in each iteration. + +\noindent +\textbf{Efficiency.} +The previous study suggests that performance and speed trade-off can be enabled through graph size adjustment. +Nevertheless, our graph training process is very efficient. It costs respectively $3.5$ hours and $5.8$ hours on a single TITAN-X for AlexNet and VGG-16, which are much faster than conventional ImageNet pre-training or any other self-supervised pre-training task. + + +\noindent +\textbf{Failure cases.} +We also include some failure cases of our method, as shown in Fig.~\ref{fig:vlz_fail}. +The failed examples can be explained as follows. +Firstly, patches sampled from thin objects may fail to reflect the key characteristics of the object due to the clutter, so the boat in the figure ends as a false negative. +Secondly, our M\&M tuning method inherits its base model (i.e., colorization model) to some extent, which accounts for the case in the figure that the dog is falsely classified as a cat. + + + +\begin{figure}[t] + \centering + \includegraphics[width=0.9\linewidth]{analysis} + \caption{\small{The figure shows that a larger graph brings better performance, but costs a longer time in each iteration. We train the model with the same hyper-parameters for different settings and test on PASCAL VOC2012 validation set.\label{fig:analysis}}} +\end{figure} + +\begin{figure}[t] + \centering + \includegraphics[width=\linewidth]{vlz_main} + \caption{\small{Visual comparison on PASCAL VOC2012 validation set (top 4 rows) and CityScapes validation set (bottom 3 rows). (a) Image. (b) Ground Truth. (c) Results with ImageNet supervised pre-training. (d) Results with colorization pre-training. (e) Our results.\label{fig:vlz_main}}} +\end{figure} + +\begin{figure}[!ht] + \centering + \includegraphics[width=\linewidth]{vlz_fail} + \caption{\small{Our failure cases. (a) Image. (b) Ground Truth. (c) Results with ImageNet supervised pre-training. (d) Results with colorization pre-training. (e) Our results.\label{fig:vlz_fail}}} +\end{figure} +\section{Conclusion} +\label{sec:conclusion} + +We have presented a novel `mix-and-match' (M\&M) tuning method for improving the performance of self-supervised learning on semantic image segmentation task. +Our approach effectively exploits mixed image patches to form a class-wise connected graph, from which triplets can be sampled to compute a discriminative loss for M\&M tuning. +Our approach not only improves the performance of self-supervised semantic segmentation with different proxy tasks and different backbone CNNs on different benchmarks, achieving state-of-the-art results, but also outperforms its ImageNet pre-trained counterpart for the first time in the literature, shedding light on the enormous potential of self-supervised learning. +M\&M tuning is potentially to be applied to various tasks and worth further exploration. Future work will focus on the essence and advantages of multi-step optimization like M\&M tuning. + +\noindent +\textbf{Acknowledgement}. This work is supported by SenseTime Group Limited and the General Research Fund sponsored by the Research Grants Council of the Hong Kong SAR (CUHK 14241716, 14224316. 14209217). + +\small{ +\bibliography{egbib} +\bibliographystyle{aaai} +} diff --git a/1712.01048v1.txt b/1712.01048v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..2fd74ffc0208a66255317d66d1980e4e4c77442a --- /dev/null +++ b/1712.01048v1.txt @@ -0,0 +1,999 @@ +\section{Introduction} +% +\label{sec:introduction} + +Deep neural networks (DNNs) have achieved significant success in various machine learning applications, including image classification~\cite{krizhevsky2012imagenet,Simonyan14c,szegedy2015going}, image retrieval~\cite{hoang2017selective,do2016learning}, and natural language processing~\cite{deng2013new}. These achievements come with increasing computational and memory cost, as the neural networks are becoming deeper~\cite{he2016deep}, and contain more filters per single layer~\cite{zeiler2014visualizing}. + +While the DNNs are powerful for various tasks, the increasing computational and memory costs make it difficult to apply on mobile platforms, considering the limited storage space, computation power, energy supply of mobile devices~\cite{han2015deep}, and the real-time processing requirements of mobile applications. There is clearly a need to reduce the computational resource requirements of DNN models so that they can be deployed on mobile devices~\cite{7543518}. + +In order to reduce the resource requirement of DNN models, one approach relies on model pruning. By pruning some parameters in the model~\cite{han2015deep}, or skipping some operations during the evaluation~\cite{figurnov2016perforatedcnns}, the storage space and/or the computational cost of DNN models can be reduced. Another approach consists in parameter quantization~\cite{han2015deep}. By applying quantization on model parameters, these parameters can be stored and computed under lower bit-width. The model size can be reduced, and the computation becomes more efficient under hardware support~\cite{han2016eie}. It is worth noting that model pruning and parameter quantization can be applied at the same time, without interfering with each other~\cite{han2015deep}; we can apply both approaches to achieve higher compression rates. + +Many deep model compression works have also considered using parameter quantization~\cite{gupta2015deep,han2015deep,wu2016quantized} together with other compression techniques, and achieve good results. However, these works usually assign the same bit-width for quantization in the different layers of the deep network. In DNN models, the layers have different structures, which lead to the different properties related to quantization. By applying the same quantization bit-width for all layers, the results could be sub-optimal. +It is however possible to assign different bit-width for different layers to achieve optimal quantization result~\cite{hwang2014fixed}. + +In this work, we propose an accurate and efficient method to find the optimal bit-width for coefficient quantization on each DNN layer. Inspired by the analysis in~\cite{NIPS2016_6331}, we propose a method to measure the effect of parameter quantization errors in individual layers on the overall model prediction accuracy. Then, by combining the effect caused by all layers, the optimal bit-width is decided for each layer. By this method we avoid the exhaustive search for optimal bit-width on each layer, and make the quantization process more efficient. +We apply this method to quantize different models that have been pre-trained on ImageNet dataset and achieve good quantization results on all models. Our method constantly outperforms recent state-of-the-art, i.e., the SQNR-based method~\cite{lin2016fixed} on different models, and achieves 20-40\% higher compression rate compared to equal bit-width quantization. +Furthermore, we give a theoretical analysis on how the quantization on layers affects DNN accuracy. To the best of our knowledge, this is the first work that theoretically analyses the relationship between coefficient quantization effect of individual layers and DNN accuracy. +\section{Related works} +% +\label{sec:related_works} + +Parameter quantization has been widely used for DNN model compression~\cite{gupta2015deep,han2015deep,wu2016quantized}. The work in~\cite{gupta2015deep} limits the bit-width of DNN models for both training and testing, and stochastic rounding scheme is proposed for quantization to improve the model training performance under low bit-width. The authors in~\cite{han2015deep} use k-means to train the quantization centroids, and use these centroids to quantize the parameters. The authors in~\cite{wu2016quantized} separate the parameter vectors into sub-vectors, and find sub-codebook of each sub-vectors for quantization. In these works, all (or a majority of) layers are quantized with the same bit-width. However, as the layers in DNN have various structures, these layers may have different properties with respect to quantization. +It is possible to achieve better compression result by optimizing quantization bit-width for each layer. + +Previous works have been done for optimizing quantization bit-width for DNN models~\cite{hwang2014fixed,anwar2015fixed,lin2016fixed,sun2016intra}. The authors in~\cite{hwang2014fixed} propose an exhaustive search approach to find optimal bit-width for a fully-connected network. In~\cite{sun2016intra}, the authors first use exhaustive search to find optimal bit-width for uniform or non-uniform quantization; then two schemes are proposed to reduce the memory consumption +during model testing. The exhaustive search approach only works for a relatively small network with few layers, while it is not practical for deep networks. As the number of layers increases, the complexity of exhaustive search increases exponentially. The authors in~\cite{anwar2015fixed} use mean square quantization error (MSQE) ($L_2$ error) on layer weights to measure the sensitivity of DNN layers to quantization, and manually set the quantization bit-width for each layer. The work in~\cite{lin2016fixed} use the signal-to-quantization-noise ratio (SQNR) on layer weights to measure the effect of quantization error in each layer. These MSQE and SQNR are good metrics for measuring the quantization loss on model weights. However, there is no theoretical analysis to show how these measurements relate to the accuracy of the DNN model, but only empirical results are shown. The MSQE-based approach in~\cite{anwar2015fixed} minimizes the $L_2$ error on quantized weight, indicating that the $L_2$ error in different layer has the equal effect on the model accuracy. Similarly, in~\cite{lin2016fixed}, the authors maximize the overall SQNR, and suggest that quantization on different layers has equal contribution to the overall SQNR, thus has equal effect on model accuracy. Both works ignore that the various structure and position of different layers may lead to different robustness on quantization, and thus render the two approaches suboptimal. + +In this work, we follow the analysis in~\cite{NIPS2016_6331}, and propose a method to measure the effect of quantization error in each DNN layers. Different from~\cite{anwar2015fixed,lin2016fixed}, which use empirical results to show the relationship between the measurement and DNN accuracy, we conduct a theoretical analysis to show how our proposed method relates to the model accuracy. Furthermore, we show that our bit-width optimization method is more general than the method in~\cite{lin2016fixed}, which makes our optimization more accurate. + +There are also works~\cite{hinton2015distilling,romero2014fitnets} that use knowledge distillation to train a smaller network using original complex models. It is also possible to combine our quantization framework with knowledge distillation to achieve yet better compression results. +\section{Measuring the effect of quantization noise} +% +\label{sec:measuring_the_effect_of_quantization_noise} + +In this section, we analyse the effect of quantization on the accuracy of a DNN model. Parameter quantization can result in quantization noise that would affect the performance of the model. Previous works have been done for analyzing the effect of input noise on the DNN model~\cite{NIPS2016_6331}; here we use this idea to analyse the effect of noise in intermediate feature maps in the DNN model. +\subsection{Quantization optimization} +\label{ssec:quantization_optimization} + +The goal of our paper is to find a way to achieve optimal quantization result to compress a DNN model. After the quantization, under controlled accuracy penalty, we would like the model size to be as small as possible. Suppose that we have a DNN $\mathcal{F}$ with $N$ layers. Each layer $i$ has $s_i$ parameters, and we apply $b_i$ bit-width quantization in the parameters of layer $i$ to obtain a quantized model $\mathcal{F'}$. Our optimization objective is: + +\begin{equation} +\begin{split} +&~min \sum_{i=1}^{N}s_i\cdot b_i \\ +s.t.~&~acc_{\mathcal{F}} - acc_{\mathcal{F'}} \leq \Delta_{acc}, +\end{split} +\label{eq:optimization_0} +\end{equation} + +where $acc_{\mathcal{F}}$ is the accuracy of the model $\mathcal{F}$, and $\Delta_{acc}$ is the maximum accuracy degradation. Note that it requires enormous computation to calculate the accuracy of the model for all quantization cases. To solve the problem more efficiently, we propose a method to estimate the value of the performance penalty given by $acc_{\mathcal{F}} - acc_{\mathcal{F'}}$. +\subsection{Quantization noise} +\label{ssec:quantization_noise} + +Value quantization is a simple yet effective way to compress a model~\cite{han2015deep}. Here we evaluate the effect of using value quantization on model parameters. + +Assume that conducting quantization on a value is equivalent to adding noise to the value: + +\begin{equation} +w_q = w + r_w +\label{eq:quantization_noise} +\end{equation} + +Here $w$ is the original value, $w\in W$, with $W$ the set of weights in a layer. Then, $w_q$ is the quantized value, and $r_w$ is the quantization noise. +Assume that we use a uniform quantizer, and that the stepsize of the quantized interval is fixed. +Following the uniform quantization analysis in~\cite{you2010audio}, +if we consider $\textbf{r}_w=(r_{w,1},\cdots,r_{w,N_W})$ as the quantization noise on all weights in $W$, +we have the expectation of $||\textbf{r}_w||_2^2$ as + + +\begin{equation} +E(||\textbf{r}_w||_2^2) = p_w'\cdot e^{-\alpha\cdot{b}}, +\label{eq:quantization_noise_expectation} +\end{equation} + +where $p_w'=N_W\frac{(w_{min}-w_{max})^2}{12}$, $N_W$ is the number of weights in $W$, and $\alpha =ln(4)$~\cite{you2010audio}. +Detailed analysis can be found in Supplementary Material. +Eq.~(\ref{eq:quantization_noise_expectation}) indicates that every time we reduce the bit-width by 1 bit, $E(||\textbf{r}_w||_2^2)$ will increase by 4 times. This is equivalent to the quantization efficiency of 6dB/bit in~\cite{Gray:2006:QUA:2263200.2265587}. +\subsection{Measurement for quantization noise} +\label{ssec:measurement_for_quantization_noise} + +\begin{figure}[htbp] +\centering +\includegraphics[width=\figurewidthone\columnwidth]{model/model_1.png} +\caption[]{Simple DNN model architecture.} +\label{fig:model_simple} +\end{figure} +\subsubsection{From weight domain to feature domain} +\label{sssec:from_weight_domain_to_feature_domain} + +Eq.~(\ref{eq:quantization_noise_expectation}) shows the quantization noise in the weight domain; here we show how the noise on weight domain can link to the noise in the feature domain. + +A simplified DNN classifier architecture is shown in Fig.~\ref{fig:model_simple}. + +Here we define $W_i$ as the weights of layer $i$ in the DNN model $\mathcal{F}$. And $Z$ is the last feature map (vector) of the DNN model $\mathcal{F}$. As we quantize $W_i$, the quantization noise is $\textbf{r}_{W_i}$, and there would be a resulting noise $\textbf{r}_{Z_i}$ on the last feature map $Z$. +Here we define $\textbf{r}_{Z_i}$ as the noise on last feature map $Z$ that is caused by the quantization only on a single layer $i$. + +As the value of $||\textbf{r}_{Z_i}||_2^2$ is proportional to the value of $||\textbf{r}_{W_i}||_2^2$, +similar to Eq.~(\ref{eq:quantization_noise_expectation}), the expectation of resulting noise on $\textbf{r}_{Z_i}$ is: + +\begin{equation} +E(||\textbf{r}_{Z_i}||_2^2) = p_i\cdot e^{-\alpha\cdot{b_i}} +\label{eq:quantization_noise_feature_expectation} +\end{equation} + +This is proved in later sections, empirical results are shown in Fig.~\ref{fig:weight_fmlast}. +\subsubsection{The effect of quantization noise} +\label{sssec:the_effect_of_quantization_noise} + +Similarly to the analysis in~\cite{pang2017robust}, we can see that the softmax classifier has a +linear decision boundary in the last feature vectors $Z$~\cite{pang2017robust} in Fig.~\ref{fig:model_simple}. +The analysis can be found in the Supplementary Material. +Then we apply the result of~\cite{NIPS2016_6331} to bound the robustness of the classifier with respect to manipulation of weights in different layers. + +We define $\textbf{r}^*$ to be the adversarial noise, which represents the minimum noise to cause misclassification. For a certain input vector $\textbf{z}=(z_1,\cdots,z_L)$, where $L$ is the number of element in $\textbf{z}$, the $||\textbf{r}^*||_2$ is the distance from the datapoint to the decision boundary, which is a fixed value. We define a sorted vector of $\textbf{z}$ as $\textbf{z}_{sorted}=(z_{(1)},\cdots,z_{(L)})$, where the max value is $z_{(1)}$, and second max value is $z_{(2)}$. The result for softmax classifier (or max classifier) can be expressed as: $max(\textbf{z})=z_{(1)}$, which is picking up the maximum value in the vector$\textbf{z}$. + +As adversarial noise is the minimum noise that can change the result of a classifier, we can get the adversarial noise for softmax classifier $max(\textbf{z})$ as $\textbf{r}_{\textbf{z}_{sorted}}^*=(\frac{z_{(2)}-z_{(1)}}{2},\frac{z_{(1)}-z_{(2)}}{2},0,\cdots,0)$, then the norm square of adversarial noise $||\textbf{r}^*||_2^2=(z_{(1)}-z_{(2)})^2/2$. + +Here we define $\textbf{r}_Z$ as the noise that we directly add on last feature map $Z$. We can consider $\textbf{r}_Z$ as the collective effect of all $\textbf{r}_{Z_i}$ that caused by the quantization on all layers $i\in\{1,\cdots,N\}$, where $N$ is the number of layers. + +As mentioned in~\cite{NIPS2016_6331}, if we apply random noise $\|\textbf{r}_Z\|_2^2$ rather than adversarial noise $\|\textbf{r}^*\|_2$ on the input vector $\textbf{z}$ for a softmax classifier $max(\textbf{z})$, it requires higher norm for random noise $\|\textbf{r}_Z\|_2^2$ to causes prediction error with same probability, compared to adversarial noise $\|\textbf{r}^*\|_2$. + +The following result shows the relationship between the random noise $\|\textbf{r}_Z\|_2^2$ and adversarial noise $\|\textbf{r}^*\|_2$, under softmax classifier with a number of classes equal to $d$: + +\begin{restatable}{lemma}{primelemma} +Let $\gamma(\delta)=5+4\ln(1/\delta)$. The following inequalities hold between the norm square of random noise $\|\textbf{r}_Z\|_2^2$ and adversarial noise $\frac{(z_{(1)}-z_{(2)})^2}{2}$. +\begin{equation} +\frac{\ln{d}}{d}\gamma(\delta) \|\textbf{r}_Z\|_2^2 \geq +\frac{(z_{(1)}-z_{(2)})^2}{2} +\end{equation} +with probability exceeding $1 - 2 \delta$. +\label{lem:linear} +\end{restatable} + +The proof of Lemma~\ref{lem:linear} can be found in the Supplementary Material. +The lemma states that if the norm of random noise is $o\left((z_{(1)}-z_{(2)})\sqrt{d/\ln d}\right)$, it does not change the classifier decision with high probability. + +Based on Lemma~\ref{lem:linear}, we can rewrite our optimization problem. Assume that we have a model $\mathcal{F}$ with accuracy $acc_{\mathcal{F}}$. After adding random noise $\textbf{r}_Z$ on the last feature map $Z$, the model accuracy drops by $\Delta_{acc}$. If we have + +\begin{equation} +\theta(\Delta_{acc}) = \frac{d}{\gamma(\frac{\Delta_{acc}}{2acc_{\mathcal{F}}})\ln{d}}, +\label{eq:theta_define} +\end{equation} + +we have the relation between accuracy degradation and noise $\textbf{r}_Z$ as: + +\begin{equation} +\begin{split} +&~acc_{\mathcal{F}} - acc_{\mathcal{F'}} \leq \Delta_{acc} \Rightarrow \\ +&~\|\textbf{r}_Z\|_2^2 < \theta(\Delta_{acc})\frac{(z_{(1)}-z_{(2)})^2}{2} +\end{split} +\label{eq:relation_acc_noise} +\end{equation} + + + + + + + + + + + + + +The detailed analysis can be found in the Supplementary Material. +Eq.~(\ref{eq:relation_acc_noise}) shows the bound of noise on last feature map $Z$. However, adding quantization noise to different layers may have different effect on model accuracy. +Suppose we have model $\mathcal{F}$ for quantization. By adding noise $\textbf{r}_{W_i}$ on weights of layer $i$, we induce the noise $\textbf{r}_{Z_i}$ on last feature map $Z$. By quantizing earlier layers, the noise needs to pass through more layers to get $\textbf{r}_{Z_i}$, which results in a low rank noise $\textbf{r}_{Z_i}$. For example, when quantizing the first layer, is results in $\textbf{r}_{Z_1}=(e_1,\cdots,e_{d'},0,\cdots,0)$, and $rank(\textbf{r}_{Z_1})=d'0\\ +0, & if~a<=0 +\end{matrix}\right. +\label{eq:relu} +\end{equation} + +From Eq.~(\ref{eq:relu}) we can see that the ReLU layer is linear to noise in most cases. The non-linearity happens only when the noise $r_w$ crossing the zero point, which has small probability when the noise is sufficiently small. +\subsubsection{Max-pooling layers} +Max-pooling is a nonlinear downsampling layer that reduces the input dimension and controls overfitting. We can consider that max-pooling acts as a $max$ filter to the feature maps. + +Similarly to the ReLU layer, which can be described as $z=ReLU(a)=max(0,a)$, the max-pooling layer can be describes as $z=maxpool(\{a_i\})=max(\{a_i\})$, where $i=1,\cdots,P$, with $P$ the kernel size for max-pooling. The linearity for noise holds when the noises are sufficiently small and do not alter the order for $\{a_i\}$. +\subsubsection{Other layers} +For other non-linear layers like Sigmoid and PReLU, the linearity for small noises still holds under the assumptions that the function is smooth along most input ranges, and the noise has very low probability to cross the non-linear region. + +Based on the linearity assumption, as we model the quantization noise on weight as Eq.~(\ref{eq:quantization_noise_expectation}), the resulting noise on last feature vector $Z$ can be modeled as: + +\begin{equation} +||\textbf{r}_{Z_i}||_2^2=p_i\cdot e^{-\alpha\cdot b_i} +\label{eq:noise_single} +\end{equation} +\subsection{Additivity of the measurements} +\label{ssec:additivity_of_the_measurements} +\subsubsection{Noise on single multiplication} +Pairwise multiplication is a basic operation in the convolutional layers and fully connected layers of DNN. Given one value in the input $a\in A$, one value in the weight matrix $w\in W$, we have the pairwise multiplication as $a\cdot w$. +If we consider noise in both input $a\in A$ and $w\in W$, we have noised value $a_q\in A_q$ and $w_q\in W_q$, +and finally $a_q\cdot w_q = (a+r_a)\cdot (w+r_w)$. +\subsubsection{Noise on one layer} +\label{sssec:noise_on_one_layer} + +Given a convolutional layer input $A$ with size $M\times N\times C$, conv kernel $K$ with size $M_k\times N_k\times C\times D$, and stride size $s$, we have the output feature map $Z$ with size $(M/s)\times (N/s)\times D$. Here $M$ and $N$ are the height and width of input, $C$ is the number of channels of input. $M_k$ and $N_k$ are the height and width of the conv kernel, $D$ is the depth of output feature map. + +The analysis on fully connected layers will be similar to the analysis on convolutional layers. It can be considered as a special case of convolutional layers when $M$, $N$, $M_k$, and $N_k$ are equal to 1. For a single value $z_{p, q, d}\in Z$, the noise term of $z_{p, q, d}$ can be expressed as: + + + + + + + +\begin{equation} +\begin{split} +r_{z_{p, q, d}} & = \sum_{i=1}^{M_k\cdot N_k\cdot C}(a_i\cdot r_{w_{i, d}} + r_{a_i}\cdot w_{i, d} + r_{a_i}\cdot r_{w_{i, d}}) + r_{b_d} \\ + & \approx \sum_{i=1}^{M_k\cdot N_k\cdot C}(a_i\cdot r_{w_{i, d}} + r_{a_i}\cdot w_{i, d}) +\end{split} +\label{eq:convolution_value_noise_both_2} +\end{equation} + +The calculation details can be found in Supplementary Material. +Note that the term $r_{b_d}$ can be ignored under the assumption that $w$ and $b$ have same bit-width quantization. The term $r_{a_i}\cdot r_{w_{i, d}}$ can be ignored under the assumption that $||r_a||_2\ll ||a||_2$ and $||r_w||_2\ll ||w||_2$. + +From Eq.~(\ref{eq:convolution_value_noise_both_2}) we can see that: 1) adding noise to input feature maps and weights separately and independently, is equivalent to adding noise to both input feature maps and weights; 2) regarding the output feature map $\textbf{z}\in Z$, adding noise to the input feature maps and weights and doing layer operation (pairwise product), is equivalent to adding the noise directly to the output feature map. We will use these two properties in later sections. +\subsubsection{Adding noise to multiple layers} +\begin{figure}[htbp] +\centering +\subfigure[]{\includegraphics[width=\figurewidthone\columnwidth]{model/layer_1.png} +\label{sfig:model_layer_1} +} +\subfigure[]{\includegraphics[width=\figurewidthone\columnwidth]{model/layer_2.png} + +\label{sfig:model_layer_2} +} +\subfigure[]{\includegraphics[width=\figurewidthone\columnwidth]{model/layer_3.png} +\label{sfig:model_layer_3} +} +\caption[]{Effect of adding noise to multiple layers.} +\label{fig:model_layer} +\end{figure} + +Fig.~\ref{fig:model_layer} shows a 2-layer module inside a DNN model. Given input feature map $A$, after the first conv layer, an intermediate feature map $X$ is generated, then after the second conv layer, output feature map $Z$ is generated. +Fig.~\ref{sfig:model_layer_1} and~\ref{sfig:model_layer_2} show the effect of noise on layer 1 and 2, respectively. And Fig.~\ref{sfig:model_layer_3} shows the effect of noise on both layer 1 and 2. By analysing the additivity of $\|\textbf{r}_{Z}\|_2^2$, we have: + + + + + +\begin{equation} +||\textbf{r}_{\textbf{z}_3}||_2^2 \doteq ||\textbf{r}_{\textbf{z}_1}||_2^2 + ||\textbf{r}_{\textbf{z}_2}||_2^2 +\label{eq:two_layer_add} +\end{equation} + +Detailed analysis can be found in Supplementary Material. +Eq.~(\ref{eq:two_layer_add}) +holds under the assumption that $\textbf{r}_{\textbf{z}_1}$ and $\textbf{r}_{\textbf{z}_2}$ are independent. This is reasonable in our case, as $\textbf{r}_{\textbf{z}_1}$ and $\textbf{r}_{\textbf{z}_2}$ are caused by $\textbf{r}_{W_1}$ and $\textbf{r}_{W_2}$ which are two independent quantization noises. This independence between $\textbf{r}_{\textbf{z}_1}$ and $\textbf{r}_{\textbf{z}_2}$ is also important for our proposed estimation method. + +We can extend Eq.~(\ref{eq:two_layer_add}) to the situation of $N$ layers: + +\begin{equation} +||\textbf{r}_{\textbf{z}}||_2^2 = \sum_{i=1}^{N}||\textbf{r}_{\textbf{z}_i}||_2^2 +\label{eq:multiple_layer_add} +\end{equation} + +If we consider the linearity and additivity of the proposed measurement, from Eq.~(\ref{eq:measurement_layer}) and Eq.~(\ref{eq:multiple_layer_add}), as well as the independence of the measurement among different layers, we have the measurement of the effect of quantization errors in all layers in DNN model: + +\begin{equation} +m_{all}=\sum_{i=1}^{N}m_i=\sum_{i=1}^{N}\frac{||\textbf{r}_{Z_i}||_2^2}{t_i} +\label{eq:measurement_all} +\end{equation} + +Eq.~(\ref{eq:measurement_all}) suggests that the noise effect of adding noise to each layer separately and independently, is equivalent to the effect of adding noise to all layers simultaneously. We use Eq.~(\ref{eq:measurement_layer}) as the measurement for noise effect on layer $i$, and the effect of adding noise to all layers can be predicted using Eq.~(\ref{eq:measurement_all}). +\section{Layer-wise bit-width optimization} +% +\label{sec:layer_wise_bit_width_optimization} + +In this section we show the approach for optimizing the layer-wise bit-width quantization to achieve an optimal compression ratio under certain accuracy loss. + +Following the discussion from the optimization problem in Eq.~(\ref{eq:optimization_0_change_1}), our goal is to constraint Eq.~(\ref{eq:measurement_all}) to be a small value while minimizing the model size. +\subsection{Adaptive quantization on multiple layers} +\label{ssec:adaptive_quantization_on_multiple_layers} + + + +Based on Eq.~(\ref{eq:noise_single}) and~(\ref{eq:measurement_all}), +the optimization Eq.~(\ref{eq:optimization_0_change_1}) can be expressed as: + +\begin{equation} +\begin{split} +&~min \sum_{i=1}^{N}s_i\cdot b_i \\ +s.t.& \sum_{i=1}^{N}\frac{p_i}{t_i}\cdot e^{-\alpha \cdot b_i}\leq C +\end{split} +\label{eq:optimization_1} +\end{equation} + + + + + +The optimal value of Eq.~(\ref{eq:optimization_1}) can be reached when: + +\begin{equation} +\frac{p_1\cdot e^{-\alpha \cdot b_1}}{t_1 \cdot s_1}=\frac{p_2\cdot e^{-\alpha \cdot b_2}}{t_2 \cdot s_2}=\cdots=\frac{p_N\cdot e^{-\alpha \cdot b_N}}{t_N \cdot s_N} +\label{eq:optimization_result} +\end{equation} + +The detailed analysis can be found in Supplementary Material. +\subsection{Optimal bit-width for each layer} +\label{ssec:optimal_bit-width_for_each_layer} + +From Eq.~(\ref{eq:optimization_result}) we can directly find the optimal bit-width for each layer using the following procedure: + +\begin{outline} +\1 Calculate $t_i$~(Eq.~(\ref{eq:calculate_t})): + \2 First, calculate the mean value of adversarial noise for the dataset: $mean_{\textbf{r}^*}=\frac{1}{|\mathcal{D}|}\sum_{\textbf{x}\in \mathcal{D}}\frac{(z_{(1)}-z_{(2)})^2}{2}$. + \2 Then, fix $\Delta_{acc}$ value. For example, $\Delta_{acc} = 10\%$. Note that the selection of $\Delta_{acc}$ value does not affect the optimization result. + \2 For each layer $i$, change the amount of noise $\textbf{r}_{W_i}$ added in weight $W_i$, until the accuracy degradation equals to $\Delta_{acc}$. Then, record the mean value of noise $\textbf{r}_{\textbf{z}_i}$ on the last feature map $Z$: $mean_{\textbf{r}_{\textbf{z}_i}}=\frac{1}{|\mathcal{D}|}\sum_{\textbf{x}\in \mathcal{D}}||\textbf{r}_{\textbf{z}_i}||_2^2$. + \2 The value $t_i$ can be calculated as: $t_i(\Delta_{acc}) = \frac{mean_{\textbf{r}_{\textbf{z}_i}}}{mean_{\textbf{r}^*}}$. + \2 The details for the calculation of $t_i$ can be found in Fig.~\ref{fig:fm_last_top1_noise}. +\1 Calculate $p_i$: + \2 First, for each layer $i$, fix $b_i$ value. For example, use $b_i=10$. + \2 Then, record the mean value of noise $\textbf{r}_{\textbf{z}_i}$ on the last feature map $Z$: $mean_{\textbf{r}_{\textbf{z}_i}}=\frac{1}{|\mathcal{D}|}\sum_{\textbf{x}\in \mathcal{D}}||\textbf{r}_{\textbf{z}_i}||_2^2$. + \2 The value $p_i$ can be calculated using Eq.~(\ref{eq:noise_single}): $mean_{\textbf{r}_{\textbf{z}_i}}=||\textbf{r}_{Z_i}||_2^2=p_i\cdot e^{-\alpha \cdot b_i}$. +\1 Calculate $b_i$: + \2 Fix the bitwidth for first layer $b_1$, for example, $b_1=10$. Then bitwidth for layer $i$ can be calculated using the Eq.~(\ref{eq:optimization_result}): $\frac{p_1\cdot e^{-\alpha \cdot b_1}}{t_1 \cdot s_1}=\frac{p_i\cdot e^{-\alpha \cdot b_i}}{t_i \cdot s_i}$ +\end{outline} + +The detailed algorithm about the above procedure can be found in Supplementary Material. Note that, by selecting different $b_1$, we achieve different quantization result. A lower value of $b_1$ results in higher compression rate, as well as higher accuracy degradation. +\subsection{Comparison with SQNR-based approach} +\label{ssec:comparison_with_SQNR-based_approach} + +Based on the SQNR-based approach~\cite{lin2016fixed}, the optimal bit-width is reached when: + +\begin{equation} +\frac{e^{-\alpha \cdot b_1}}{s_1}=\frac{e^{-\alpha \cdot b_2}}{s_2}=\cdots=\frac{e^{-\alpha \cdot b_N}}{s_N} +\label{eq:optimization_result_SQNR} +\end{equation} + +The proof can be found in Supplementary Material. Note that compared with our result in Eq.~(\ref{eq:optimization_result}), the parameters $p_i$ and $t_i$ are missing. This is consistent with the assumption of the SQNR-based approach, where two layers having the same bit-width for quantization would have the same SQNR value; hence the effects on accuracy are equal. This makes the SQNR-based approach a special case of our approach, when all layers in the DNN model have the equal effect on model accuracy under the same bit-width. +\section{Experimental results} +% +\label{sec:experimental_results} + +In this section we show empirical results that validate our assumptions in previous sections, and evaluate the proposed bit-width optimization approach. + +All codes are implemented using MatConvNet~\cite{vedaldi15matconvnet}. All experiments are conducted using a Dell workstation with E5-2630 CPU and Titan X Pascal GPU. +\subsection{Empirical results about measurements} +\label{ssec:empirical_results_about_measurements} + +To validate the effectiveness of the proposed accuracy estimation method, we conduct several experiments. These experiments validate the relationship between the estimated accuracy, the linearity of the measurement, and the additivity of the measurement. + +Here we use Alexnet~\cite{krizhevsky2012imagenet}, VGG-16~\cite{Simonyan14c}, GoogleNet~\cite{szegedy2015going}, and Resnet~\cite{he2016deep} as the model for quantization. Each layer of the model is quantized separately using uniform quantization, but possibly with different bit-width. The quantized model is then tested on the validation set of Imagenet~\cite{krizhevsky2012imagenet}, which contains 50000 images in 1000 classes. +\subsubsection{Calculate $t_i$} +\label{sssec:calculate_t_i} + +As Eq.~(\ref{eq:measurement_layer}) is proposed to measure the robustness of each layer, we conduct an experiment to find $t_i$ value. We use Alexnet as an example. + +First, we calculate the adversarial noise for Alexnet on the last feature vector $Z$. +The calculation is based on Eq.~(\ref{eq:calculate_t}). The mean value of $||\textbf{r}^*||_2^2$ for Alexnet is $mean_{\textbf{r}^*}=5.33$. The distribution of $||\textbf{r}^*||_2^2$ for Alexnet on Imagenet validation set can be found in Supplementary Material. + +After finding $||\textbf{r}^*||_2^2$ value, the value of $t_i$ is calculated based on Fig.~\ref{fig:fm_last_top1_noise_alex} and Eq.~(\ref{eq:calculate_t}). We set the accuracy degradation to be roughly half of original accuracy (57\%), which is $28\%$. Based on the values in Fig.~\ref{fig:fm_last_top1_noise_alex}, $t_1$ to $t_6$ are equal to +$5.2\times 10^2$, $t_7=1.3\times 10^3$, and $t_8=2.0\times 10^3$. + +Here we show the example for Alexnet of how to calculate the $t_i$ value. Note that for other networks like VGG-16, GoogleNet, and Resnet, we also observe that only the $t_i$ value for the last 1 or 2 layers are obviously different than the other $t_i$ values. During our calculation, we can thus focus on the $t_i$ values for the last several layers. Furthermore, in Fig.~\ref{fig:fm_last_top1_noise_alex}, we find the $||\textbf{r}_Z||_2^2-accuracy$ relationship for different amounts of noise, which requires a lot of calculations. In real cases, we use binary search to find appropriate points under the same accuracy degradation. This makes the process to calculate $t_i$ fast and efficient. Typically, for a deep model with $N$ layers, and dataset with $|\mathcal{D}|$ size, we require $O(\tau N|\mathcal{D}|)$ forward passes to calculate accuracy. Here $\tau$ is the trial times over one layer. We can reduce it to $O(\tau N'|\mathcal{D}|)$(with $N'<0𝜆0\lambda>0 is the regularization parameter. + +Similar to the matrix completion problem, the trace norm regularization has been used to enforce the low-rank constraint for the tensor completion problem.The works [THK10, TS13] discuss the overlapped and latent trace norm regularizations for tensors.In particular, [TS13, WST14] show that the latent trace norm has certain better tensor reconstruction bounds.The latent trace norm regularization learns the tensor as a sparse combination of different tensors.In our work, we empirically motivate the need for learning non-sparse combination of tensors and propose a variant of the latent trace norm that learns a non-sparse combination of tensors. We show a novel characterization of the solution space that allows for a compact storage of the tensor, thereby allowing to develop scalable optimization formulations.Concretely, we make the following contributions in this paper.•We propose a novel trace norm regularizer for low-rank tensor completion problem, which learns a tensor as a non-sparse combination of tensors. In contrast, the more popular latent trace norm regularizer [THK10, TS13, WST14] learns a highly sparse combination of tensors. Non-sparse combination helps in capturing information along all the modes.•We propose a dual framework for analyzing the problem formulation. This provides interesting insights into the solution space of the tensor completion problem, e.g., how the solutions along different modes are related, allowing a compact representation of the tensor.•Exploiting the characterization of the solution space, we develop a fixed-rank formulation. Our optimization problem is on Riemannian spectrahedron manifolds and we propose computationally efficient trust-region algorithm for our formulation. + +Numerical comparisons on real-world datasets for different applications such as video and hyperspectral-image completion, link prediction, and movie recommendation show that the proposed algorithm outperforms state-of-the-art latent trace norm regularized algorithms. + +The organization of the paper is as follows. Related works are discussed in Section 2. In Section 3, we study a particular trace norm based tensor completion formulation. Theorem 1 shows the characterization of the solution space. Building on this, we show two particular fixed-rank formulations. Both of these problems have the structure of optimization on Riemannian manifolds. The optimization related ingredients and their computational cost are subsequently discussed in Section 4. In Section 5, numerical comparisons on real data sets for three different applications: video and hyperspectral-image completion, link prediction, and movie recommendation, show that our proposed algorithms outperform various state-of-the-art latent trace norm regularized algorithms. + +The Matlab codes are available at https://pratikjawanpuria.com/. + +Trace norm regularized tensor completion formulations. The works [LMWY13, TS13, SDLS14, RpABbP13, CYZ+16] discuss the overlapped trace norm regularization for tensor learning. The overlapped trace norm is motivated as a convex proxy for minimizing the Tucker (multilinear) rank of a tensor. The overlapped trace norm is defined as: R(𝒲⇒≔∑∥​ℑ​∞𝒦∥𝒲∥∥⇑R(\ten{W})\coloneqq\sum_{k=1}^{K}\left\lVert\ten{W}_{k}\right\rVert_{*}, where 𝒲∥subscript𝒲∥\ten{W}_{k} is the mode-k𝑘k matrix unfolding of the tensor 𝒲𝒲\ten{W} [KB09] and ∥⋅∥∗subscriptdelimited-∥∥⋅\left\lVert\cdot\right\rVert_{*} denotes the trace norm regularizer. 𝒲∥subscript𝒲∥\ten{W}_{k} is a nk×Πj≠k​njsubscript𝑛𝑘subscriptΠ𝑗𝑘subscript𝑛𝑗n_{k}\times\Pi_{j\neq k}\,n_{j} matrix obtained by concatenating mode-k𝑘k fibers (column vectors) of the form 𝒲⇐​⟩∞​⇔​…​⇔​⟩∥​↖​∞​⇔​¬​⇔​⟩∥​⇓​∞​⇔​…​⇔​⟩𝒦​⇒subscript𝒲⇐subscript⟩∞⇔…⇔subscript⟩∥↖∞⇔¬⇔subscript⟩∥⇓∞⇔…⇔subscript⟩𝒦⇒\ten{W}_{(i_{1},\ldots,i_{k-1},:,i_{k+1},\ldots,i_{K})} [KB09]. + +Latent trace norm is another convex regularizer used for low-rank tensor learning [THK10, TSHK11, TS13, WST14, GYK17]. In this setting, the tensor 𝒲𝒲\ten{W} is modeled as sum of K𝐾K (unknown) tensors 𝒲⇐​∞​⇒​⇔​…​⇔​𝒲⇐​𝒦​⇒superscript𝒲⇐∞⇒⇔…⇔superscript𝒲⇐𝒦⇒\ten{W}^{(1)},\ldots,\ten{W}^{(K)} such that 𝒲∥⇐​∥​⇒superscriptsubscript𝒲∥⇐∥⇒\ten{W}_{k}^{(k)} are low-rank matrices. The latent trace norm is defined as:R(𝒲⇒≔inf∑∥​ℑ​∞𝒦𝒲⇐​∥​⇒​ℑ​𝒲​∅​ ​𝒲⇐​∥​⇒∈ℛ\∞×…×\𝒦∑∥​ℑ​∞𝒦∥𝒲∥⇐​∥​⇒∥⇑⇔R(\ten{W})\coloneqq{\underset{\sum_{k=1}^{K}\ten{W}^{(k)}=\ten{W};\text{~{}}\ten{W}^{(k)}\in\mathbb{R}^{n_{1}\times\ldots\times n_{K}}}{\inf}}\ \textstyle\sum_{k=1}^{K}\|\ten{W}^{(k)}_{k}\|_{*},(2)A variant of the latent trace norm (‖𝒲∥⇐​∥​⇒‖⇑subscriptnormsubscriptsuperscript𝒲⇐∥⇒∥⇑\|\ten{W}^{(k)}_{k}\|_{*} scaled by 1/nk1subscript𝑛𝑘1/\sqrt{n_{k}}) is analyzed in [WST14].Latent trace norm and its scaled variant achieve better recovery bounds than overlapped trace norm [TS13, WST14].Recently, [GYK17] proposed a scalable latent trace norm based Frank-Wolfe algorithm for tensor completion. + +The latent trace norm (2) corresponds to the sparsity inducing ℓ1subscriptℓ1\ell_{1}-norm penalization across ‖𝒲∥⇐​∥​⇒‖⇑subscriptnormsubscriptsuperscript𝒲⇐∥⇒∥⇑\|\ten{W}^{(k)}_{k}\|_{*}.Hence, it learns 𝒲𝒲\ten{W} as a sparse combination of 𝒲⇐​∥​⇒superscript𝒲⇐∥⇒\ten{W}^{(k)}. In case of high sparsity, it may result in selecting only one of the tensors 𝒲⇐​∥​⇒superscript𝒲⇐∥⇒\ten{W}^{(k)} as 𝒲𝒲\ten{W}, i.e., 𝒲​ℑ​𝒲⇐​∥​⇒𝒲ℑsuperscript𝒲⇐∥⇒\ten{W}=\ten{W}^{(k)} for some k𝑘k, in which case 𝒲𝒲\ten{W} is essentially learned as a low-rank matrix. In several real-world applications, tensor data cannot be mapped to a low-rank matrix structure and they require a higher order structure. Therefore, we propose a regularizer which learns a non-sparse combination of 𝒲⇐​∥​⇒superscript𝒲⇐∥⇒\ten{W}^{(k)}. Non-sparse norms have led to better generalization performance in other machine learning settings [CMR09, Suz11, JVN14]. + +We show the benefit of learning a non-sparse mixture of tensors as against a sparse mixture on two datasets: Ribeira and Baboon (refer Section 5 for details). Figures 1(a) and 1(b) show the relative sparsity of the optimally learned tensors in the mixture as learned by the ℓ1subscriptℓ1\ell_{1}-regularized latent trace norm based model (2) [TS13, WST14, GYK17] versus the proposed ℓ2subscriptℓ2\ell_{2}-regularized model (discussed in Section 3). The relative sparsity for each 𝒲⇐​∥​⇒superscript𝒲⇐∥⇒\ten{W}^{(k)} in the mixture is computed as ‖𝒲⇐​∥​⇒‖ℱ​∝​∑∥‖𝒲⇐​∥​⇒‖ℱsubscriptnormsuperscript𝒲⇐∥⇒ℱ∝subscript∥subscriptnormsuperscript𝒲⇐∥⇒ℱ\|\ten{W}^{(k)}\|_{F}/\sum_{k}\|\ten{W}^{(k)}\|_{F}. In both the datasets, our model learns a non-sparse combination of tensors, whereas the latent trace norm based model learns a highly skewed mixture of tensors.The proposed non-sparse tensor combination also leads to better generalization performance, as can be observed in the Figures 1(c) and 1(d).In the particular case of Baboon dataset, the latent trace norm essentially learns 𝒲𝒲\ten{W} as a low-rank matrix (𝒲​ℑ​𝒲⇐​∋​⇒𝒲ℑsuperscript𝒲⇐∋⇒\ten{W}=\ten{W}^{(3)}) and consequently obtains poor generalization. + +Other tensor completion formulations. Other approaches for low-rank tensor completion include tensor decomposition methods like Tucker and CP [KB09, CPZ+17a, CPZ+17b]. They generalize the notion of singular value decomposition of matrices to tensors. Recently, [KSV14] exploits the Riemannian geometry of fixed multilinear rank to learn factor matrices and the core tensor. They propose a computationally efficient non-linear conjugate gradient method for optimization over manifolds of tensors of fixed multilinear rank. [KM16] further propose an efficient preconditioner for low-rank tensor learning with the Tucker decomposition. [ZZC15] propose a Bayesian probabilistic CP model for performing tensor completion. Tensor completion algorithms based on tensor tubal-rank have been recently proposed in [ZEA+14, LAAW16]. + +We propose the following formulation for learning the low-rank tensor 𝒲𝒲\ten{W}min𝒲⇐​∥​⇒∈ℛ\∞×…×\𝒦∥𝒲Ω​↖​𝒴Ω∥F2+∑k1λk​∥𝒲∥⇐​∥​⇒∥∗2,subscriptminsuperscript𝒲⇐∥⇒superscriptℛsubscript\∞…subscript\𝒦superscriptsubscriptdelimited-∥∥subscript𝒲Ω↖subscript𝒴Ω𝐹2subscript𝑘1subscript𝜆𝑘superscriptsubscriptdelimited-∥∥subscriptsuperscript𝒲⇐∥⇒∥2missing-subexpressionmissing-subexpression{\begin{array}[]{lll}\mathop{\rm min}\nolimits\limits_{\ten{W}^{(k)}\in\mathbb{R}^{n_{1}\times\ldots\times n_{K}}}\ \left\lVert\ten{W}_{\Omega}-\ten{Y}_{\Omega}\right\rVert_{F}^{2}+\sum\limits_{k}\frac{1}{\lambda_{k}}\left\lVert\ten{W}^{(k)}_{k}\right\rVert_{*}^{2},\end{array}}(3)where 𝒲​ℑ​∑∥𝒲⇐​∥​⇒𝒲ℑsubscript∥superscript𝒲⇐∥⇒\ten{W}=\sum_{k}\ten{W}^{(k)} is the learned tensor. It should be noted that the proposed regularizer in (3) employs the ℓ2subscriptℓ2\ell_{2}-norm over ‖𝒲∥⇐​∥​⇒‖⇑subscriptnormsubscriptsuperscript𝒲⇐∥⇒∥⇑\|\ten{W}^{(k)}_{k}\|_{*}. In contrast, the latent trace norm regularizer (2) has the ℓ1subscriptℓ1\ell_{1}-norm over ‖𝒲∥⇐​∥​⇒‖⇑subscriptnormsubscriptsuperscript𝒲⇐∥⇒∥⇑\|\ten{W}^{(k)}_{k}\|_{*}. + +While the existing tensor completion approaches [KM16, GYK17, KSV14, LMWY13, TS13, SDLS14] mostly discuss a primal formulation similar to (1), we propose a novel dual framework for our analysis. The use of dual framework, e.g., in the matrix completion problem [XJ12, PTJY10, JM18], often leads to novel insights into the solution space of the primal problem. + +We begin by discussing how to obtain the dual formulation of (3). Later, we explain how the insights from the dual framework motivate us to propose two novel fixed-rank formulations for (3).As a first step, we exploit the following variational characterization of the trace norm studied in [AEP06, Theorem 4.1]. Given X∈ℝd×TXsuperscriptℝ𝑑𝑇\mbox{\bf X}\in\mathbb{R}^{d\times T}, the following result holds:∥X∥∗2=minΘ∈𝒫d,range​(X)⊆range​(Θ)​⟨Θ†,XX⊤⟩,superscriptsubscriptdelimited-∥∥X2formulae-sequenceΘsuperscript𝒫𝑑rangeXrangeΘminsuperscriptΘ†superscriptXXtop\left\lVert\mbox{\bf X}\right\rVert_{*}^{2}=\underset{\Theta\in\mathcal{P}^{d},{{\rm range}}(\mbox{\bf X})\subseteq{{\rm range}}(\Theta)}{\mathop{\rm min}\nolimits}\langle\Theta^{{\dagger}},\mbox{\bf X}\mbox{\bf X}^{\top}\rangle,(4)where 𝒫dsuperscript𝒫𝑑\mathcal{P}^{d} denotes the set of d×d𝑑𝑑d\times d positive semi-definite matrices with unit trace, Θ†superscriptΘ†\Theta^{{\dagger}} denotes the pseudo-inverse of ΘΘ\Theta, range​(Θ)={Θ​z:z∈ℝd}rangeΘconditional-setΘ𝑧𝑧superscriptℝ𝑑{{\rm range}}(\Theta)=\{\Theta z:z\in\mathbb{R}^{d}\}, and ⟨⋅,⋅⟩⋅⋅\langle\cdot,\cdot\rangle is the inner product. The expression for optimal Θ∗superscriptΘ{\Theta}^{*} is Θ∗=XX⊤/trace(XX⊤)\Theta^{*}={\sqrt{\mbox{\bf X}\mbox{\bf X}^{\top}}}/{{{\rm trace}}(\sqrt{\mbox{\bf X}\mbox{\bf X}^{\top})}} [AEP06], and hence the ranks of ΘΘ\Theta and X are equal at optimality. Thus, (4) implicitly transfers the low-rank constraint on 𝐗𝐗{\mathbf{X}} (due to trace norm) to an auxiliary variable Θ∈𝒫dΘsuperscript𝒫𝑑\Theta\in\mathcal{P}^{d}.It is well known that positive semi-definite matrix ΘΘ\Theta with unit trace constraint implies the ℓ1subscriptℓ1\ell_{1}-norm constraint on the eigenvalues of ΘΘ\Theta, leading to low-rankness of ΘΘ\Theta. + +Using the result (4) in (3) leads to K𝐾K auxiliary matrices, one Θk∈𝒫nksubscriptΘ𝑘superscript𝒫subscript𝑛𝑘\Theta_{k}\in\mathcal{P}^{n_{k}} corresponding to every 𝒲∥⇐​∥​⇒subscriptsuperscript𝒲⇐∥⇒∥\ten{W}^{(k)}_{k} (mode-k𝑘k matrix unfolding of the tensor 𝒲⇐​∥​⇒superscript𝒲⇐∥⇒\ten{W}^{(k)}). It should also be noted that Θk∈𝒫nksubscriptΘ𝑘superscript𝒫subscript𝑛𝑘\Theta_{k}\in\mathcal{P}^{n_{k}} are low-rank matrices. We now present the following theorem that states an equivalent minimax formulation of (3). + +We next present the following result related to the form of the optimal solution of (3). + +Instead of solving the minimax problem (5) directly, we solve the following equivalent min optimization problem:minθ∈𝒫n1×…×𝒫nK​f​(θ),𝜃superscript𝒫subscript𝑛1…superscript𝒫subscript𝑛𝐾min𝑓𝜃\underset{\theta\in\mathcal{P}^{n_{1}}\times\ldots\times\mathcal{P}^{n_{K}}}{\mathop{\rm min}\nolimits}\ f(\theta),(13)where θ=(Θ1,…,ΘK)𝜃subscriptΘ1…subscriptΘ𝐾\theta=(\Theta_{1},\ldots,\Theta_{K}) and f:𝒫n1×…×𝒫nK→ℝ:𝑓→superscript𝒫subscript𝑛1…superscript𝒫subscript𝑛𝐾ℝf:\mathcal{P}^{n_{1}}\times\ldots\times\mathcal{P}^{n_{K}}\rightarrow\mathbb{R} is the convex functionf​(θ)≔⇕​⊣​§𝒵∈𝒞​⟨𝒵​⇔​𝒴Ω⟩​↖​∞△​∥𝒵∥ℱ∈​↖​∑∥λ∥∈​⟨Θ∥​⇔​𝒵∥​𝒵∥⊤⟩​↙≔𝑓𝜃𝒵𝒞⇕⊣§delimited-⟨⟩𝒵⇔subscript𝒴Ω↖∞△superscriptsubscriptdelimited-∥∥𝒵ℱ∈↖subscript∥subscript𝜆∥∈delimited-⟨⟩subscriptΘ∥⇔subscript𝒵∥superscriptsubscript𝒵∥top↙missing-subexpressionmissing-subexpression\begin{array}[]{lll}f(\theta)\coloneqq\displaystyle\underset{\ten{Z}\in\mathcal{C}}{\mathop{\rm max}\nolimits}\ \langle\ten{Z},\ten{Y}_{\Omega}\rangle-\displaystyle\frac{1}{4}\left\lVert\ten{Z}\right\rVert_{F}^{2}-\displaystyle\sum\limits_{k}\frac{\lambda_{k}}{2}\langle\Theta_{k},\ten{Z}_{k}\ten{Z}_{k}^{\top}\rangle.\end{array}(14)The problem formulation (13) allows to decouple the structures of the min and max problems in (5). + +As discussed earlier in the section, the optimal Θk∗∈𝒫nksuperscriptsubscriptΘ𝑘superscript𝒫subscript𝑛𝑘\Theta_{k}^{*}\in\mathcal{P}^{n_{k}} is a low-rank positive semi-definite matrix for all k𝑘k.In spite of the low-rankness of the optimal solution, an algorithm for (5) need not produce intermediate iterates that are low rank. From the perspective of large-scale applications, this observation as well as other computational efficiency concerns discussed below motivate to exploit a fixed-rank parameterization of ΘksubscriptΘ𝑘\Theta_{k} for all k𝑘k. + +We propose to explicitly constrain the rank of ΘksubscriptΘ𝑘\Theta_{k} to rksubscript𝑟𝑘r_{k} as follows:Θk=Uk​Uk⊤,subscriptΘ𝑘subscriptU𝑘superscriptsubscriptU𝑘top\Theta_{k}=\mbox{\bf U}_{k}\mbox{\bf U}_{k}^{\top},(15)where Uk∈𝒮rknksubscriptU𝑘subscriptsuperscript𝒮subscript𝑛𝑘subscript𝑟𝑘\mbox{\bf U}_{k}\in\mathcal{S}^{n_{k}}_{r_{k}} and 𝒮rn≔{U∈ℝn×r:∥U∥F=1}≔subscriptsuperscript𝒮𝑛𝑟conditional-setUsuperscriptℝ𝑛𝑟subscriptdelimited-∥∥U𝐹1\mathcal{S}^{n}_{r}\coloneqq\{\mbox{\bf U}\in\mathbb{R}^{n\times r}:\left\lVert\mbox{\bf U}\right\rVert_{F}=1\}. In large-scale tensor completion problems, it is common to set rk≪nkmuch-less-thansubscript𝑟𝑘subscript𝑛𝑘r_{k}\ll n_{k}, where the fixed-rank parameterization (15) of ΘksubscriptΘ𝑘\Theta_{k} has a two-fold advantage. First, the search space dimension of (13) drastically reduces from nk​((nk+1)/2−1)subscript𝑛𝑘subscript𝑛𝑘121n_{k}((n_{k}+1)/2-1), which is quadratic in tensor dimensions, to nk​rk−1−rk​(rk−1)/2subscript𝑛𝑘subscript𝑟𝑘1subscript𝑟𝑘subscript𝑟𝑘12n_{k}r_{k}-1-r_{k}(r_{k}-1)/2, which is linear in tensor dimensions [JBAS10]. Second, enforcing the constraint Uk∈𝒮rknksubscriptU𝑘subscriptsuperscript𝒮subscript𝑛𝑘subscript𝑟𝑘\mbox{\bf U}_{k}\in\mathcal{S}^{n_{k}}_{r_{k}} costs O​(nk​rk)𝑂subscript𝑛𝑘subscript𝑟𝑘O(n_{k}r_{k}), which is linear in tensor dimensions and is computationally much cheaper than enforcing Θk∈𝒫nksubscriptΘ𝑘superscript𝒫subscript𝑛𝑘\Theta_{k}\in\mathcal{P}^{n_{k}} that costs O​(nk3)𝑂superscriptsubscript𝑛𝑘3O(n_{k}^{3}). + +A first formulation is obtained by employing the parameterization (15) directly in the problems (13) and (14). We subsequently solve the resulting problem as a minimization problem as followsProblem ​𝒟​¬⇕​⟩​\⊓∈𝒮∇∞\∞×…×𝒮∇𝒦\𝒦}​⇐​⊓​⇒​⇔Problem 𝒟¬subscript⇕⟩\⊓subscriptsuperscript𝒮subscript\∞subscript∇∞…subscriptsuperscript𝒮subscript\𝒦subscript∇𝒦}⇐⊓⇒⇔\text{Problem\ \ }\ten{D}:\qquad\displaystyle\mathop{\rm min}\nolimits\limits_{u\in\mathcal{S}^{n_{1}}_{r_{1}}\times\ldots\times\mathcal{S}^{n_{K}}_{r_{K}}}\quad g(u),(16)where u=(U1,…,UK)𝑢subscriptU1…subscriptU𝐾u=(\mbox{\bf U}_{1},\ldots,\mbox{\bf U}_{K}) and g:𝒮r1n1×…×𝒮rKnK→ℝ:𝑔→subscriptsuperscript𝒮subscript𝑛1subscript𝑟1…subscriptsuperscript𝒮subscript𝑛𝐾subscript𝑟𝐾ℝg:\mathcal{S}^{n_{1}}_{r_{1}}\times\ldots\times\mathcal{S}^{n_{K}}_{r_{K}}\rightarrow\mathbb{R} is the functiong​(u)≔⇕​⊣​§𝒵∈𝒞​⟨𝒵​⇔​𝒴Ω⟩​↖​∞△​∥𝒵∥ℱ∈​↖​∑∥λ∥∈​∥U∥⊤​𝒵∥∥ℱ∈​↙≔𝑔𝑢𝒵𝒞⇕⊣§delimited-⟨⟩𝒵⇔subscript𝒴Ω↖∞△superscriptsubscriptdelimited-∥∥𝒵ℱ∈↖subscript∥subscript𝜆∥∈superscriptsubscriptdelimited-∥∥superscriptsubscriptU∥topsubscript𝒵∥ℱ∈↙missing-subexpressionmissing-subexpression\begin{array}[]{lll}g(u)\coloneqq\displaystyle\underset{\ten{Z}\in\mathcal{C}}{\mathop{\rm max}\nolimits}\ \langle\ten{Z},\ten{Y}_{\Omega}\rangle-\displaystyle\frac{1}{4}\left\lVert\ten{Z}\right\rVert_{F}^{2}-\displaystyle\sum\limits_{k}\frac{\lambda_{k}}{2}\left\lVert{\mbox{\bf U}}_{k}^{\top}\ten{Z}_{k}\right\rVert_{F}^{2}.\end{array}(17)It should be noted that though (16) is a non-convex problem in u𝑢u, the optimization problem in (17) is strongly convex in 𝒵𝒵\ten{Z} for a given u𝑢u and has unique solution. + +The second formulation is motivated by the representer theorem (Corollary 1) and the fixed-rank parameterization (15). However, instead of solving (3), we take a more practical approach of solving the following low-rankProblem ​𝒫​¬⇕​⟩​\⊓∈𝒮∇∞\∞×…×𝒮∇𝒦\𝒦𝒵∈𝒞⟨​⇐​⊓​⇔​𝒵​⇒Problem 𝒫¬𝒵𝒞subscript⇕⟩\⊓subscriptsuperscript𝒮subscript\∞subscript∇∞…subscriptsuperscript𝒮subscript\𝒦subscript∇𝒦⟨⇐⊓⇔𝒵⇒\text{Problem\ \ }\ten{P}:\qquad\underset{\ten{Z}\in\mathcal{C}}{\mathop{\rm min}\nolimits\limits_{u\in\mathcal{S}^{n_{1}}_{r_{1}}\times\ldots\times\mathcal{S}^{n_{K}}_{r_{K}}}}\quad h(u,\ten{Z})(18)and h:𝒮r1n1×…×𝒮rKnK×𝒞→ℝ:ℎ→subscriptsuperscript𝒮subscript𝑛1subscript𝑟1…subscriptsuperscript𝒮subscript𝑛𝐾subscript𝑟𝐾𝒞ℝh:\mathcal{S}^{n_{1}}_{r_{1}}\times\ldots\times\mathcal{S}^{n_{K}}_{r_{K}}\times\mathcal{C}\rightarrow\mathbb{R} ish(u,𝒵⇒≔∥⇐∑∥λ∥⇐𝒵×∥U∥U∥⊤⇒⇒Ω↖𝒴Ω∥ℱ∈↙{h(u,\ten{Z})\coloneqq\left\lVert(\sum_{k}\lambda_{k}(\ten{Z}\times_{k}\mbox{\bf U}_{k}\mbox{\bf U}_{k}^{\top}))_{\Omega}-\ten{Y}_{\Omega}\right\rVert_{F}^{2}.}(19)where 𝒲​ℑ​∑∥𝒲⇐​∥​⇒𝒲ℑsubscript∥superscript𝒲⇐∥⇒\ten{W}=\sum_{k}\ten{W}^{(k)} and 𝒲⇐​∥​⇒​ℑ​λ∥​𝒵×∥U∥​U∥⊤subscript∥superscript𝒲⇐∥⇒ℑsubscript𝜆∥𝒵subscriptU∥superscriptsubscriptU∥top\ten{W}^{(k)}=\lambda_{k}\ten{Z}\times_{k}\mbox{\bf U}_{k}\mbox{\bf U}_{k}^{\top}. It should be noted that the objective function in (18) does not have an explicit regularizer as in (3) to ensure non-sparse 𝒲⇐​∥​⇒superscript𝒲⇐∥⇒\ten{W}^{(k)} and low-rank 𝒲∥⇐​∥​⇒superscriptsubscript𝒲∥⇐∥⇒\ten{W}_{k}^{(k)}. However, the regularizer is implicit since we employed the representer theorem and the fixed-rank parameterization (𝒵𝒵\ten{Z} is common for all 𝒲⇐​∥​⇒superscript𝒲⇐∥⇒\ten{W}^{(k)} and Uk∈𝒮rknksubscriptU𝑘subscriptsuperscript𝒮subscript𝑛𝑘subscript𝑟𝑘\mbox{\bf U}_{k}\in\mathcal{S}^{n_{k}}_{r_{k}}). + +In this section we discuss the optimization algorithms for 𝒟𝒟\ten{D} (16) and 𝒫𝒫\ten{P} (18). Both of these are of the typeminx∈ℳℓ​(x),subscriptmin𝑥ℳℓ𝑥\mathop{\rm min}\nolimits\limits_{x\in\mathcal{M}}\quad\ell(x),(20)where ℓ:ℳ→ℝ:ℓ→ℳℝ\ell:\mathcal{M}\rightarrow\mathbb{R} is a smooth loss and ℳℳ\mathcal{M} is the constraint set. For Problem 𝒟𝒟\ten{D}, ℳ≔𝒮r1n1×…×𝒮rKnK≔ℳsubscriptsuperscript𝒮subscript𝑛1subscript𝑟1…subscriptsuperscript𝒮subscript𝑛𝐾subscript𝑟𝐾\mathcal{M}\coloneqq\mathcal{S}^{n_{1}}_{r_{1}}\times\ldots\times\mathcal{S}^{n_{K}}_{r_{K}} and Problem 𝒫𝒫\ten{P}, ℳ≔𝒮r1n1×…×𝒮rKnK×𝒞≔ℳsubscriptsuperscript𝒮subscript𝑛1subscript𝑟1…subscriptsuperscript𝒮subscript𝑛𝐾subscript𝑟𝐾𝒞\mathcal{M}\coloneqq\mathcal{S}^{n_{1}}_{r_{1}}\times\ldots\times\mathcal{S}^{n_{K}}_{r_{K}}\times\mathcal{C}. + +In order to propose numerically efficient algorithms for optimization over ℳℳ\mathcal{M}, we exploit the particular structure of the set 𝒮rnsubscriptsuperscript𝒮𝑛𝑟\mathcal{S}^{n}_{r}, which is known as the spectrahedron manifold [JBAS10]. The spectrahedron manifold has the structure of a compact Riemannian quotient manifold [JBAS10]. Consequently, optimization on the spectrahedron manifold is handled in the Riemannian optimization framework. This allows to exploit the rotational invariance of the constraint ∥U∥F=1subscriptdelimited-∥∥U𝐹1\left\lVert\mbox{\bf U}\right\rVert_{F}=1 naturally. The Riemannian manifold optimization framework embeds the constraint ∥U∥F=1subscriptdelimited-∥∥U𝐹1\left\lVert\mbox{\bf U}\right\rVert_{F}=1 into the search space, thereby translating the constrained optimization problem into unconstrained optimization problem over the spectrahedron manifold. The Riemannian framework generalizes a number of classical first- and second-order (e.g., the conjugate gradient and trust-region algorithms) Euclidean algorithms to manifolds and provides concrete convergence guarantees [EAS98, AMS08, SKM17, ZRS16, SI13]. The work [AMS08] in particular shows a systematic way of implementing trust-region (TR) algorithms on quotient manifolds. A full list of optimization-related ingredients and their matrix characterizations for the spectrahedron manifold 𝒮rnsubscriptsuperscript𝒮𝑛𝑟\mathcal{S}^{n}_{r} is in Section B. Overall, the constraint ℳℳ\mathcal{M} is endowed a Riemannian structure. Figure 2 depicts a general overview of a gradient-based algorithm on ℳℳ\mathcal{M}. + +We implement the Riemannian TR (second-order) algorithm for (20). To this end, we require the notions of the Riemannian gradient (the first-order derivative of the objective function on the manifold), the Riemannian Hessian along a search direction (the covariant derivative of the Riemannian gradient along a tangential direction on the manifold), and the retraction operator which ensures that we always stay on the manifold (i.e., maintain strict feasibility). The Riemannian gradient and Hessian notions require computations of the standard (Euclidean) gradient ∇xℓ​(x)subscript∇𝑥ℓ𝑥\nabla_{x}\ell(x) and the directional derivative of this gradient along a given search direction v𝑣v denoted by D​∇xℓ​(x)​[v]Dsubscript∇𝑥ℓ𝑥delimited-[]𝑣{\rm D}\nabla_{x}\ell(x)[v], the expressions of which for 𝒟𝒟\ten{D} (16) and 𝒫​⇐𝒫⇐\ten{P}(18) are shown in Lemma 1 and Lemma 2, respectively. + +A key requirement in Lemma 1 is solving (17) for 𝒵^^𝒵\hat{\ten{Z}} computationally efficiently for a given u=(U1,…,UK)𝑢subscriptU1…subscriptU𝐾u=(\mbox{\bf U}_{1},\ldots,\mbox{\bf U}_{K}). It should be noted that (17) has a closed-form sparse solution, which is equivalent to solving the linear system𝒵^Ω+∑kλk​(𝒵^Ω×kUk​Uk⊤)Ω=𝒴Ω​↙subscript^𝒵Ωsubscript𝑘subscript𝜆𝑘subscriptsubscript𝑘subscript^𝒵ΩsubscriptU𝑘superscriptsubscriptU𝑘topΩsubscript𝒴Ω↙missing-subexpression{\begin{array}[]{ll}\hat{\ten{Z}}_{\Omega}+\sum_{k}\lambda_{k}(\hat{\ten{Z}}_{\Omega}\times_{k}\mbox{\bf U}_{k}{\mbox{\bf U}_{k}^{\top}})_{\Omega}=\ten{Y}_{\Omega}.\end{array}}(21)Solving the linear system (21) in a single step is computationally expensive (it involves the use of Kronecker products, vectorization of a sparse tensor, and a matrix inversion). Instead, we use an iterative solver that exploits the sparsity in the variable 𝒵𝒵\ten Z and the factorization form Uk​Uk⊤subscriptU𝑘superscriptsubscriptU𝑘top\mbox{\bf U}_{k}\mbox{\bf U}_{k}^{\top} efficiently. Similarly, given 𝒵^^𝒵\hat{\ten{Z}} and v𝑣v, 𝒵˙˙𝒵\dot{\ten{Z}} can be computed by solving𝒵˙Ω+∑kλk​(𝒵˙Ω×kUk​Uk⊤)Ω=−∑kλk​(𝒵^Ω×k(Vk​Uk⊤+Uk​Vk⊤))Ω.subscript˙𝒵Ωsubscript𝑘subscript𝜆𝑘subscriptsubscript𝑘subscript˙𝒵ΩsubscriptU𝑘superscriptsubscriptU𝑘topΩsubscript𝑘subscript𝜆𝑘subscriptsubscript𝑘subscript^𝒵ΩsubscriptV𝑘superscriptsubscriptU𝑘topsubscriptU𝑘superscriptsubscriptV𝑘topΩmissing-subexpression{\begin{array}[]{ll}\dot{\ten{Z}}_{\Omega}+\sum_{k}\lambda_{k}(\dot{\ten{Z}}_{\Omega}\times_{k}\mbox{\bf U}_{k}{\mbox{\bf U}_{k}^{\top}})_{\Omega}=-\sum_{k}\lambda_{k}(\hat{\ten{Z}}_{\Omega}\times_{k}(\mbox{\bf V}_{k}{\mbox{\bf U}_{k}^{\top}}+\mbox{\bf U}_{k}{\mbox{\bf V}_{k}^{\top}}))_{\Omega}.\end{array}}(22) + +The Riemannian TR algorithm solves a Riemannian trust-region sub-problem in every iteration [AMS08, Chapter 7]. The TR sub-problem is a second-order approximation of the objective function in a neighborhood, solution to which does not require inverting the full Hessian of the objective function. It makes use of the gradient ∇xℓsubscript∇𝑥ℓ\nabla_{x}\ell and its directional derivative along a search direction. The TR sub-problem is approximately solved with an iterative solver, e.g., the truncated conjugate gradient algorithm. The TR sub-problem outputs a potential update candidate for x𝑥x, which is then accepted or rejected based on the amount of decrease in ℓℓ\ell. Algorithm 1 summarizes the key steps of the TR algorithm for solving (20). + +Remark 2: In contrast to Problem 𝒟𝒟\ten{D}, where (17) is required to be solved for 𝒵𝒵\ten{Z} at a given u𝑢u, in Problem 𝒫𝒫\ten{P} both u𝑢u and 𝒵𝒵\ten{Z} are updated simultaneously. + +The per-iteration computational complexities of our Riemannian TR algorithms for both the formulations – 𝒟𝒟\ten{D} (16) and 𝒫𝒫\ten{P} (18) – are shown in Table 1. The computational complexity scales linearly with the number of known entries 𝒴Ωsubscript𝒴Ω\ten{Y}_{\Omega}, denoted by |Ω|Ω|\Omega|. + +In particular, the per-iteration computational cost depends on two sets of operations. First, on manifold related ingredients like the retraction operation. Second, the objective function related ingredients like the computation of the partial derivatives. + +The manifold related operations cost O​(∑knk​rk2+rk3)𝑂subscript𝑘subscript𝑛𝑘superscriptsubscript𝑟𝑘2superscriptsubscript𝑟𝑘3O(\sum_{k}n_{k}r_{k}^{2}+r_{k}^{3}) for 𝒟𝒟\ten{D} (16) and O​(|Ω|+∑knk​rk2+rk3)𝑂Ωsubscript𝑘subscript𝑛𝑘superscriptsubscript𝑟𝑘2superscriptsubscript𝑟𝑘3O(|\Omega|+\sum_{k}n_{k}r_{k}^{2}+r_{k}^{3}) for 𝒫𝒫\ten{P} (18). Specifically, the retraction on the spectrahedron manifold 𝒮rknksuperscriptsubscript𝒮subscript𝑟𝑘subscript𝑛𝑘\mathcal{S}_{r_{k}}^{n_{k}} costs O​(nk​rk)𝑂subscript𝑛𝑘subscript𝑟𝑘O(n_{k}r_{k}) as it needs to project a matrix of size nk×rksubscript𝑛𝑘subscript𝑟𝑘n_{k}\times r_{k} on to the set 𝒮rknksuperscriptsubscript𝒮subscript𝑟𝑘subscript𝑛𝑘\mathcal{S}_{r_{k}}^{n_{k}}, which costs O​(nk​rk)𝑂subscript𝑛𝑘subscript𝑟𝑘O(n_{k}r_{k}). + +The following are the computational cost for the objective function related ingredients.•Uk⊤​𝒵∥superscriptsubscriptU𝑘topsubscript𝒵∥\mbox{\bf U}_{k}^{\top}\ten{Z}_{k}. It involves computation of nk×rksubscript𝑛𝑘subscript𝑟𝑘n_{k}\times r_{k} matrix UksubscriptU𝑘\mbox{\bf U}_{k}with mode-k𝑘k unfolding of a sparse 𝒵𝒵\ten Z with |Ω|Ω|\Omega| non-zero entries. Such matrix-matrix operations are used in both 𝒟𝒟\ten{D} (16) and 𝒫𝒫\ten{P} (18).The computation of Uk⊤​𝒵∥superscriptsubscriptU𝑘topsubscript𝒵∥\mbox{\bf U}_{k}^{\top}\ten{Z}_{k} costs O​(|Ω|​rk)𝑂Ωsubscript𝑟𝑘O(|\Omega|r_{k}). It should be noted that although the dimension of 𝒵∥subscript𝒵∥\ten{Z}_{k} is nk×∏i=1,i≠kKnisubscript𝑛𝑘superscriptsubscriptproductformulae-sequence𝑖1𝑖𝑘𝐾subscript𝑛𝑖n_{k}\times{\prod_{i=1,i\neq k}^{K}n_{i}}, only a maximum of |Ω|Ω|\Omega| columns have non-zero entries. We exploit this property of 𝒵∥subscript𝒵∥\ten{Z}_{k} and have a compact memory storage of Uk⊤​𝒵∥superscriptsubscriptU𝑘topsubscript𝒵∥\mbox{\bf U}_{k}^{\top}\ten{Z}_{k}.•Computation of the solution 𝒵^^𝒵\hat{\ten{Z}} and 𝒵˙˙𝒵\dot{\ten{Z}} used in 𝒟𝒟\ten{D} (16). We use an iterative solver for (21) and (22), which requires computing the left hand side of (21) for a given candidate 𝒵𝒵\ten{Z}. If m𝑚m is the number of iterations allowed, then the computational cost is costs O​(m​|Ω|​∑krk)𝑂𝑚Ωsubscript𝑘subscript𝑟𝑘O(m|\Omega|\sum_{k}r_{k}).•Computation of g​(u)𝑔𝑢g(u) in 𝒟𝒟\ten{D} (16) and its partial derivatives. The computation of g​(u)𝑔𝑢g(u) relies on the solution of (21) and then explicitly computing the objective function in (17). This costs O​(m​|Ω|​∑krk+K​|Ω|)𝑂𝑚Ωsubscript𝑘subscript𝑟𝑘𝐾ΩO(m|\Omega|\sum_{k}r_{k}+K|\Omega|), where m𝑚m is the number of iterations to solve (21). The computation of ∇ugsubscript∇𝑢𝑔\nabla_{u}g requires the computation of terms like 𝒵^k​(𝒵^k⊤​Uk)subscript^𝒵𝑘superscriptsubscript^𝒵𝑘topsubscriptU𝑘\hat{\ten{Z}}_{k}({\hat{\ten{Z}}_{k}}^{\top}\mbox{\bf U}_{k}), and overall it costs O​(|Ω|​∑krk)𝑂Ωsubscript𝑘subscript𝑟𝑘O(|\Omega|\sum_{k}r_{k}). Given a search direction v𝑣v, the computation of D​∇ug​[v]Dsubscript∇𝑢𝑔delimited-[]𝑣{\mathrm{D}}\nabla_{u}g[v] costs O​(|Ω|​∑krk)𝑂Ωsubscript𝑘subscript𝑟𝑘O(|\Omega|\sum_{k}r_{k}).•Computation of h(u,𝒵⇒h(u,\ten{Z}) in 𝒫𝒫\ten{P} (18) and its partial derivatives. The computation of h(u,𝒵⇒h(u,\ten{Z}) costs O​(∑k|Ω|​rk)𝑂subscript𝑘Ωsubscript𝑟𝑘O(\sum_{k}|\Omega|r_{k}). Specifically, the computation of ℛℛ\ten{R} costs O​(|Ω|​∑krk)𝑂Ωsubscript𝑘subscript𝑟𝑘O(|\Omega|\sum_{k}r_{k}). The computations of ∇uhsubscript∇𝑢ℎ\nabla_{u}h and it directional derivatives require the computation of terms like symm(ℛ∥𝒵∥⊤⇒U∥\mathrm{symm}(\ten{R}_{k}\ten{Z}_{k}^{\top})\mbox{\bf U}_{k}, which costs O​(|Ω|​∑krk)𝑂Ωsubscript𝑘subscript𝑟𝑘O(|\Omega|\sum_{k}r_{k}). The same computational overhead is for ∇𝒵hsubscript∇𝒵ℎ\nabla_{\ten{Z}}h and its directional derivative. + +The memory cost for both algorithms is O​(|Ω|+∑knk​rk)𝑂Ωsubscript𝑘subscript𝑛𝑘subscript𝑟𝑘O(|\Omega|+\sum_{k}n_{k}r_{k}), where |Ω|Ω|\Omega| is linear in nksubscript𝑛𝑘n_{k}. + +The Riemannian TR algorithms come with rigorous convergence guarantees. [AMS08] discusses the rate of convergence analysis of manifold algorithms, which directly apply in our case. Specifically for trust regions, the global convergence to a first-order critical point is discussed in [AMS08, Section 7.4.1] and the local convergence to local minima is discussed in [AMS08, Section 7.4.2]. From an implementation perspective, we follow the existing approaches [KSV14, KM16, GYK17] and upper-limit the number of TR iterations. + +Our algorithms are implemented in the Manopt toolbox [BMAS14] in Matlab, which has off-the-shelf generic TR implementation. For efficient computation of certain sparse matrix-vector we make use of the mex support in Matlab. For solving (21) and (22), which are used in solving 𝒟𝒟\ten{D} (16), we rely on the conjugate gradients solver of Matlab. + +In this section, we evaluate the generalization performance and efficiency of the proposed algorithms against state-of-the-art in several tensor completion applications. We provide the experimental analysis of our proposed algorithms for the applications of video and hyperspectral-image completion, recommendation and link prediction. Table 2 provides the details of all the datasets we experiment with. We compare performance of the following trace norm based algorithms.1.TR-MM: our trust-region algorithm for the proposed formulation 𝒟𝒟\ten{D} (16).2.TR-LS: our trust-region algorithm for the proposed formulation 𝒫𝒫\ten{P} (18).3.Latent111http://tomioka.dk/softwares/ [THK10]: a convex optimization based algorithm with latent trace norm.4.Hard [SDLS14]: an algorithm based on a convex optimization framework with spectral regularization for tensor learning.5.HaLRTC222http://www.cs.rochester.edu/u/jliu/code/TensorCompletion.zip [LMWY13]: an ADMM based algorithm for tensor completion.6.FFW333http://home.cse.ust.hk/~qyaoaa/ [GYK17]: a Frank-Wolfe algorithm with scaled latent trace norm regularization. + +We denote our algorithms for Problem 𝒟𝒟\ten{D} (16) and Problem 𝒫𝒫\ten{P} (18) as TR-MM and TR-LS, respectively. For both of our algorithms, we set λk=λ​nksubscript𝜆𝑘𝜆subscript𝑛𝑘\lambda_{k}=\lambda n_{k} for all k𝑘k, which implies that in λ>0𝜆0\lambda>0 is the only hyper-parameter that needed to be tuned. We tune λ𝜆\lambda with 555-fold cross-validation on the train data of the split from the range {10−3,10−2,…,103}superscript103superscript102…superscript103\{10^{-3},10^{-2},\ldots,10^{3}\}. + +Latent trace norm based algorithms such as FFW [GYK17] and Latent [THK10], and overlapped trace norm based algorithms such as HaLRTC [LMWY13] and Hard [SDLS14] are the closest to our approach. FFW is a recently proposed state-of-the-art large scale tensor completion algorithm.Table 3 summarizes the baseline algorithms. + +The proposed algorithms are implemented using Manopt toolbox [BMAS14] in Matlab. All the experiments are run on an Intel Xeon CPU with 32GB RAM and 2.40GHz processor. + +We work with the following data sets for predicting missing values in multi-media data like videos and hyperspectral images. Ribeira: A hyperspectral image data set444http://personalpages.manchester.ac.uk/staff/d.h.foster/Hyperspectral_images_of_natural_scenes_04.html [FNA04] of size 1017×1340×3310171340331017\times 1340\times 33, where each slice represents a particular image measured at a different wavelength. We re-size this tensor to 203×268×3320326833203\times 268\times 33 [SDLS14, KSV14, KM16]. Following [KM16], the incomplete tensor as training data is generated by randomly sampling 10%percent1010\% of the entries and the evaluation (testing) of the learned tensor was done on another 10%percent1010\% of the entries. The experimented is repeated 101010 times. Figure 3(a) shows the Ribeira image.Tomato: A tomato video sequence data set555http://www.cs.rochester.edu/u/jliu/publications.html [LMWY13, CC14] of size 242×320×167242320167242\times 320\times 167. We follow the same experimental setup as for Ribeira data set discussed above. Baboon: An RGB image 666https://github.com/qbzhao/BCPF of a baboon used in [ZZC15] which is modeled as a 256×256×32562563256\times 256\times 3 tensor. The experimental setup is same as that for Ribeira. Figure 3(b) shows the image.Results. Table 4 reports the root mean squared error (RMSE) on the test set that is averaged over ten splits. Our algorithms, TR-MM and TR-LS, obtain the best results, outperforming other trace norm based algorithms on Ribeira, Tomato and Baboon data sets. Figure 4(a) shows the trade-off between the test RMSE and the training time of all the algorithms on Ribeira. It can be observed that both our algorithms converge to the lowest RMSE at a significantly faster rate compared to the other baselines. It is evident from the results that learning a mixture of non-sparse tensors, as learned by the proposed algorithms, helps in achieving better performance compared to the algorithms that learn a skewed sparse mixture of tensors. + +In this application, the task is to predict missing or new links in knowledge graphs, social networks, etc. We consider the following data sets.FB15k-237: FB15k-237777http://kristinatoutanova.com/ [TCP+15] is a subset of FB15k dataset [BUGD+13], containing facts of the form subject-predicate-object (RDF) triples from Freebase knowledge graph.The subject and object noun phrases are called entities and the predicates are the relationships among them. For instance, in the RDF triple {‘Obama’, ‘president of’, ‘United States’}, ‘Obama’ and ‘United States’ are entities, and ‘president of’ is a relationship between them. The task is to predict relationships (from a given set of relations) between a pair of entities.FB15k-237 contains 14 9511495114\,951 entities and 237237237 relationships. It has 310 116310116310\,116 observed relationships (links) between pairs of entities, which are positive samples. In addition, 516 606516606516\,606 negative samples are generated following the procedure described in [BUGD+13]. Negative samples are those {entitya, relationshipc, entityb} triples in which the relationshipc does not hold between entitya and entityb. We model this task as a 14 951×14 951×237149511495123714\,951\times 14\,951\times 237 tensor completion problem. 𝒴⇐​⊣​⇔​⌊​⇔​⌋​⇒​ℑ​∞subscript𝒴⇐⊣⇔⌊⇔⌋⇒ℑ∞\ten{Y}_{(a,b,c)}=1 implies that relationshipc exists between entitya and entityc (positive sample), and 𝒴⇐​⊣​⇔​⌊​⇔​⌋​⇒​ℑ​′subscript𝒴⇐⊣⇔⌊⇔⌋⇒ℑ′\ten{Y}_{(a,b,c)}=0 implies otherwise (negative sample). We keep 80%percent8080\% of the observed entries for training and the remaining 20%percent2020\% for testing. YouTube: This is a link prediction data set888http://leitang.net/data/youtube-data.tar [TWL09] having 5 types of interactions between 15 0881508815\,088 users. The task is to predict the interaction (from a given set of interactions) between a pair of users. We model it as a 15 088×15 088×51508815088515\,088\times 15\,088\times 5 tensor completion problem. All the entries are known in this case. We randomly sample 0.8%percent0.80.8\% of the data for training [GYK17] and another 0.8%percent0.80.8\% for testing. + +It should be noted that Hard, HaLRTC, and Latent do not scale to the full FB15k-237 and YouTube data sets as they need to store full tensor in memory. Hence, we follow [GYK17] to create a subset of the YouTube data set of size 1509×1509×51509150951509\times 1509\times 5 in which 1509 users with most number of links are chosen. We randomly sample 5%percent55\% of the data for training and another 5%percent55\% for testing. + +Results. All the above experiments are repeated on ten random train-test splits. Following [LZ11, GYK17], the generalization performance for link prediction task is measured by computing the area under the ROC curve on the test set (test AUC) for each algorithm. Table 5 report the average test AUC on YouTube (subset), Youtube (full) and FB15k-237 data sets. The TR-MM algorithm achieves the best performance in all the link prediction tasks, while TR-LS achieves competitive performance. This shows that the non-sparse mixture of tensors learned by TR-MM helps in achieving better performance. Figures 4 (b) & (c) plots the trade-off between the test AUC and the training time for FB15k-237 and YouTube, respectively. We can observe that TR-MM is the fastest to converge to a good AUC and take only a few iterations. + +We also conduct experiments to evaluate the performance of different algorithms in challenging scenarios when the amount of training data available is less. On the FB15k-237 data set, we vary the size of training data from 20%percent2020\% to 80%percent8080\% of the observed entries, and the remaining 20%percent2020\% of the observed entries is kept as the test set. Figure 4 (d) plots the performance of different algorithms on this experiment. We can observe that both our algorithms do significantly better than baselines in data scarce regimes. + +We also evaluate the algorithms on the MovieLens10M999http://files.grouplens.org/datasets/movielens/ml-10m-README.html data set [HK15]. This is a movie recommendation task — predict the ratings given to movies by various users. MovieLens10M contains 10 000 0541000005410\,000\,054 ratings of 10 6811068110\,681 movies given by 71 5677156771\,567 users.Following [KM16], we split the time into 7-days wide bins, forming a tensor of size 71 567×10 681×731715671068173171\,567\times 10\,681\times 731. For our experiments, we generate 101010 random train-test splits, where 80%percent8080\% of the observed entries is kept for training and remaining 20%percent2020\% is used for testing. Table 4 reports the average test RMSE on this task.It can be observed that the proposed algorithms outperform state-of-the-art latent and scaled latent trace norm based algorithms. + +In addition to the trace norm based algorithms, we also compare against the following tensor decomposition algorithms:1.Rprecon101010https://bamdevmishra.com/codes/tensorcompletion/ [KM16]: a Riemannian manifold preconditioning algorithm for the fixed multi-linear rank low-rank tensor completion problem.2.geomCG111111http://anchp.epfl.ch/geomCG [KSV14]: a fixed multi-linear rank low-rank tensor completion algorithm using Riemannian optimization on the manifold of fixed multi-linear rank tensors.3.Topt [FJ15]: a non-linear conjugate gradient algorithm for Tucker decomposition.4.T-svd121212http://www.ece.tufts.edu/~shuchin/software.html[ZEA+14]: a tubal rank based tensor completion algorithm.5.BayesCP131313https://github.com/qbzhao/BCPF[ZZC15]:a Bayesian CP algorithm for tensor completion which has inbuilt rank tuning. + +As can be observed from Tables 4 and 5, the proposed TR-MM and TR-LS achieve better results than the baseline algorithms. However for the movie recommendation task, Rprecon achieves better results. It should be noted that Topt, T-svd, and BayesCP are not scalable for large scale datasets. + +For all the datasets, we vary the rank between (3,3,3) and (25,25,25) for TR-MM and TR-LS algorithms. For Tucker based algorithms we vary the Tucker rank between (3,3,3) and (25,25,25). Table 6 shows the ranks at which the algorithms achieve best results with different datasets. + +Algorithms based on the Tucker decomposition [FJ15, KM16, KSV14] model the tensor completion problem as a factorization problem. Tucker decomposition is a form of higher order PCA [KB09], it decomposes a tensor into a core tensor multiplied by a matrix along each mode. Given the in complete tensor 𝒴Ωsubscript𝒴Ω\ten{Y}_{\Omega}, the Tucker decomposition based tensor completion problem is:⇕​⟩​\𝒢∈ℛ∇∞×…×∇𝒦Ak∈ℝnk×rk,k∈{1,…,K}​∥𝒴Ω​↖​⇐​𝒢×∞A∞×∈…×𝒦A𝒦​⇒Ω∥​⇔formulae-sequencesubscriptA𝑘superscriptℝsubscript𝑛𝑘subscript𝑟𝑘𝑘1…𝐾𝒢superscriptℛsubscript∇∞…subscript∇𝒦⇕⟩\delimited-∥∥subscript𝒦subscript∈subscript∞subscript𝒴Ω↖⇐𝒢subscriptA∞…subscriptA𝒦subscript⇒Ω⇔\underset{\mbox{\bf A}_{k}\in\mathbb{R}^{n_{k}\times r_{k}},k\in\{1,\dots,K\}}{\underset{\ten{G}\in\mathbb{R}^{r_{1}\times\ldots\times r_{K}}}{\mathop{\rm min}\nolimits}}\left\lVert\ten{Y}_{\Omega}-(\ten{G}\times_{1}\mbox{\bf A}_{1}\times_{2}\ldots\times_{K}\mbox{\bf A}_{K})_{\Omega}\right\rVert,where the multi-linear rank of the optimal solution is given by (r1,r2,…,rK)subscript𝑟1subscript𝑟2…subscript𝑟𝐾(r_{1},r_{2},\ldots,r_{K}), which is a user provided parameter in practical settings. CP based algorithms like BayesCP [ZZC15] are a special case of Tucker based modeling with 𝒢𝒢\ten{G} set to be super diagonal and r1=r2=…=rK=rsubscript𝑟1subscript𝑟2…subscript𝑟𝐾𝑟r_{1}=r_{2}=\ldots=r_{K}=r, which is a user provided parameter in practical setting. In particular, [ZZC15] discusses a probabilistic model. T-svd algorithm [ZEA+14] models the tensor completion problem using the tensor singular value decomposition, and the rank here is the tensor tubal rank. Finally, algorithms based on latent norm regularization [GYK17, LMWY13, SDLS14, THK10] model the completion problem by approximating the input tensor as a sum of individual tensors (3). Each of these individual tensors is constrained to have a low-rank in one mode. The low-rank constraint is enforced on a different mode for each tensor. Due to the fundamental difference in modeling of these algorithms, the tensor ranks of the optimal solution obtained from algorithms that follow one approach cannot be compared with that of the algorithms that follow the other approach. + +We also evaluate TR-MM and the baselines considered in Table 3 for outlier robustness on hyperspectal image completion and link prediction problems. In the Ribeira dataset, we add the standard Gaussian noise (N​(0,1))𝑁01(N(0,1)) to randomly selected x𝑥x fraction of the entries in the training set. The minimum and the maximum value of entries in the (original) Ribeira are 0.010.010.01 and 2.092.092.09, respectively.In FB15k-237 dataset, we flip randomly selected x𝑥x fraction of the entries in the training set, i.e., the link is removed if present and vice-versa. We experiment with x=0.05𝑥0.05x=0.05 and x=0.10𝑥0.10x=0.10. + +The results are reported in Table 7. We observe that our algorithm, TR-MM, obtains the best generalization performance and, hence, is the most robust to outliers. We also observe that trace norm regularized algorithms (TR-MM, FFW, Hard, HaLTRC, Latent) are relatively more robust to outliers than Tucker-decomposition based algorithms (Rprecon, geomCG, Topt), CP-decomposition based algorithm (BayesCP), and tensor tubal-rank based algorithm (T-svd). + +In this paper, we introduce a variant of trace norm regularizer for low-rank tensor completion problem which learns the tensor as a non-sparse combination of tensors. The number of tensors in this combination is equal to the number of modes (K𝐾K). Existing works [THK10, TS13, WST14, GYK17] learn a sparse combination of tensors, essentially learning the tensor as a low-rank matrix and losing higher order information in the available data. Hence, we recommend learning a non-sparse combination of tensors in trace norm regularized setting, especially since K𝐾K is typically a small integer in most real-world applications.In our experiments, we observe better generalization performance with the proposed regularization. Theoretically, we provide the following result on the reconstruction error in the context of recovering an unknown tensor 𝒲⇑superscript𝒲⇑\ten{W}^{*} from noisy observation. + +The proof of the above lemma is in Section A. A similar result on the latent trace norm, which learns a sparse combination of tensors, is presented in [TS13]. + +We present a dual framework to analyze the proposed tensor completion formulation.This leads to novel fixed-rank formulations, for which we exploit the Riemannian framework to develop scalable trust region algorithms.In experiments, our algorithm TR-MM obtains better generalization performance and is more robust to outliers than state-of-the-art low-rank tensor completion algorithms.Overall both TR-MM and TR-LS algorithms achieve better performance on various completions tasks. \ No newline at end of file diff --git a/1712.01493v3.txt b/1712.01493v3.txt new file mode 100644 index 0000000000000000000000000000000000000000..8fa7d3a6075a7c3fccb2fead4fd6098aefe16419 --- /dev/null +++ b/1712.01493v3.txt @@ -0,0 +1,73 @@ +Pedestrian attributes, e.g., age, gender and dressing, are searchable semantic elements to describe a person.In many scenarios we need to searchperson images in surveillance environment according to specific attribute descriptions provided by users, as depicted in Figure 1. We refer to this problem as the attribute-image person re-identification (attribute-image Re-ID). This task is significant in finding missing people with tens of thousands of surveillance cameras equipped in modern metropolises. Compared with conventional image-based Re-ID Zhao et al. (2014); Yang et al. (2016), attribute-image Re-ID has the advantage that its query is much easier to be obtained, e.g., it is more practical to search for criminal suspects when only verbal testimony about the suspects’ appearances is given. + +Despite the great significance, the attribute-image Re-ID is still a very open problem and has been rarely investigated before. While a lot of attribute person Re-ID models Lin et al. (2017); Layne et al. (2012a); Su et al. (2016); Layne et al. (2012b, 2014b, 2014a); Su et al. (2015a) have been developed recently, they are mainly used either for multi-task learning or for providing extra features so as to enhance the performance of image-image person Re-ID model. The most intuitive solution to attribute-image Re-ID might be to predict attributes for each person image, and search within the predicted attributes Siddiquie et al. (2011); Vaquero et al. (2009); Scheirer et al. (2012).If we can reliably recognize the attributes of each pedestrian image, this might be the best way to find the person corresponding to the query attributes.However, recognizing attributes from a person image is still an open issue, as pedestrian images from surveillance environment often suffer from low resolution, pose variations and illumination changes. The problem of imperfect recognition limits the intuitive methods in bridging the gap between the two modalities (attribute and image), which are heterogeneous from each other. In addition,very often in a large-scale scenario, the predicted attributes from two pedestrians are different but very similar, leading to a very small inter-class distance in the predicted attribute space. Therefore, the imperfect prediction deteriorate the reliability of these existing models. + +In this paper, we propose an adversarial attribute-image Re-ID framework.Intuitively, when we hold some attribute description in mind, e.g., “dressed in red”, we generate an obscure and vague imagination on how a person dressed in red may look like, which we refer to as a concept. Once a concrete image is given, our vision system automatically processes the low-level features (e.g., color and edge) to obtain some perceptions, and then try to judge whether the perceptions and the concept are consistent with each other. + +More formally, the goal of our adversarial attribute-image Re-ID framework is to learn a semantically discriminative joint space, which is regarded as a concept space (Figure 2), for generative adversarial architecture to generate some concepts that are very similar to the concepts extracted from raw person images.However, the generic adversarial architecture is still hard to fit the match between two extremely large discrepant modalities (attribute and image). For this problem, we impose a semantic consistency regularization across modalities in order to regularize the adversarial architecture, enhancing the learned joint space to build a bridge between the two modalities. + +In a word, our framework learns a semantically discriminative structure of low-level person images,and generate a correspondingly aligned image-analogous concept for high-level attribute towards image concept.By the proposed strategy, directly estimating the attributes of a person image is averted, and the problems of imperfect prediction and low semantic discriminability are naturally solved,because we learn a semantically discriminative joint space, rather than predicting and matching attributes. + +We have conducted experiments on three large-scale benchmark datasets, namely Duke Attribute Lin et al. (2017), Market Attribute Lin et al. (2017) and PETA Deng et al. (2014),to validate our model. By our study, some interesting findings are:(1) Compared with other related cross-modality models, we find the regularized adversarial learning framework is so far most effective for solving the attribute-image Re-ID problem.(2) For achieving better cross-modality matching between attribute and person image, it is more effective to use adversarial model to generate image-analogous concept and get it matched with image concept rather than doing this in reverse.(3) The semantic consistency as regularization on adversarial learning is important for the attribute-image Re-ID. + +While pedestrian attributes in most research are side information or mid-level representation to improve conventional image-image Re-ID tasks Lin et al. (2017); Layne et al. (2012a); Su et al. (2016); Layne et al. (2012b, 2014b, 2014a); Su et al. (2015a, b, 2018), only a few work Vaquero et al. (2009) has discussed attribute-image Re-ID problem.The work in Vaquero et al. (2009) is to form attribute-attribute matching. However,despite the improvement on performance achieved by attribute prediction methods Li et al. (2015), directly retrieving people according to their predicted attributes is still challenging, because the attribute prediction methods are still not robust to the cross-view condition changes like different lighting conditions and viewpoints. + +In this work, for the first time, we present extensive investigation on the attribute-image Re-ID problem under an adversarial framework. Rather than directly predicting attributes of an image, we cast the cross-view attribute-image matching as cross-modality matching by an adversarial learning problem. + +Our work is related to cross-modality content search, which aims to bridge the gap between different modalities Hotelling (1936); Mineiro and Karampatziakis (2014); Andrew et al. (2013); Kiros et al. (2014). The most traditional and practical solution to this task is Canonical Correlation Analysis (CCA) Hotelling (1936); Mineiro and Karampatziakis (2014); Andrew et al. (2013), which projects two modalities into a common space that maximizes their correlation. Ngiam et al. and Feng et al. also applied autoencoder-based methods to model the cross-modality correlation Ngiam et al. (2011); Feng et al. (2014), and Wei et al. proposed a deep semantic matching method to address the cross-modality retrieval problem with respect to samples annotated with one or multiple labelsWei et al. (2017). Recently, A. Eisenschtat and L. Wolf have designed a novel model of two tied pipelines that maximize the projection correlation using an Euclidean loss, which achieves state of the art results in some datasets Eisenschtat and Wolf (2017).Two most related works to ours are proposed in S.Li et al. (2017); Li et al. (2017), which retrieve pedestrian images using language descriptions.Compared with this setting, our attribute-image Re-ID has its own strength in embedding more pre-defined attribute descriptions for obtaining better performance. + +The adversarial model employed in this work is in line with the GAN methodsEric et al. (2017); Reed et al. (2016); Goodfellow et al. (2014), which has its strength in distribution alignment by a two player min-max game.As different modalities follow different distributions, our cross-modality attribute-image Re-ID problem is also related to the distribution alignment problem.For performing distribution alignment, there are other techniques called domain adaptation techniques Tzeng et al. (2014); Long and Wang (2015); Ganin and Lempitsky (2015). In domain adaptation, to align the distribution of data from two different domains, several works Tzeng et al. (2014); Long and Wang (2015) apply MMD-based loss, which minimize the norm of difference between means of the two distributions. Different from these methods, the deep Correlation Alignment(CORAL) Sun and Saenko (2016) method proposed to match both the mean and covariance of the two distributions.Our work is different from these methods as our framework not only bridges the gap between the two largely discrepant modalities, but also keeps the semantic consistency across them. + +Given an attribute description Aisubscript𝐴𝑖A_{i}, attribute-image Re-ID aims at re-identifying the matched pedestrian images Iisubscript𝐼𝑖I_{i} from an image database ℐ={Ii}i=1Nℐsuperscriptsubscriptsubscript𝐼𝑖𝑖1𝑁\mathcal{I}=\{I_{i}\}_{i=1}^{N} captured under real surveillance environment, where N𝑁N is the size of ℐℐ\mathcal{I}. Since different person images could have the same attribute description, the attribute-image Re-ID uses Semantic ID (i.e., attribute description) to group person images. That is, people with the same attribute description are of the same semantic ID. + +The goal of our method is to learn two mappings ΦIsubscriptΦ𝐼\Phi_{I} and ΦAsubscriptΦ𝐴\Phi_{A} that respectively map person images and high-level semantic attributes into a joint discriminative space, which could be regarded as the concept space as mentioned. That is, CiI=ΦI​(Ii)subscriptsuperscript𝐶𝐼𝑖subscriptΦ𝐼subscript𝐼𝑖C^{I}_{i}=\Phi_{I}(I_{i}) and CiA=ΦA​(Ai)subscriptsuperscript𝐶𝐴𝑖subscriptΦ𝐴subscript𝐴𝑖C^{A}_{i}=\Phi_{A}(A_{i}), whereCiIsubscriptsuperscript𝐶𝐼𝑖C^{I}_{i} and CiAsubscriptsuperscript𝐶𝐴𝑖C^{A}_{i} are the mid-level concept that is generated from the image Iisubscript𝐼𝑖I_{i} and attribute Aisubscript𝐴𝑖A_{i}, respectively.To achieve this, we form an image embedding network by CNN and an attribute-embedding network by a deep fully connected network. We parameterize our model by 𝚯𝚯\mathbf{\Theta}, and obtain 𝚯𝚯\mathbf{\Theta} by optimizing a concept generation objective Lc​o​n​c​e​p​tsubscript𝐿𝑐𝑜𝑛𝑐𝑒𝑝𝑡L_{concept}. Given training pairs of images and attributes (Ii,Ai)subscript𝐼𝑖subscript𝐴𝑖(I_{i},A_{i}), the optimization problem is formulated asmin𝚯Lc​o​n​c​e​p​tsubscript𝚯subscript𝐿𝑐𝑜𝑛𝑐𝑒𝑝𝑡\displaystyle\mathop{\min}_{\mathbf{\Theta}}L_{concept}=1N​∑i=1Nlc​o​n​c​e​p​t​(ΦI​(Ii),ΦA​(Ai)).absent1𝑁superscriptsubscript𝑖1𝑁subscript𝑙𝑐𝑜𝑛𝑐𝑒𝑝𝑡subscriptΦ𝐼subscript𝐼𝑖subscriptΦ𝐴subscript𝐴𝑖\displaystyle=\frac{1}{N}\sum\limits_{i=1}^{N}l_{concept}(\Phi_{I}(I_{i}),\Phi_{A}(A_{i})).(1) + +In this paper, we design lc​o​n​c​e​p​tsubscript𝑙𝑐𝑜𝑛𝑐𝑒𝑝𝑡l_{concept} as a combination of several loss terms, each of which formulates a specific aspect of consideration to jointly formulate our problem.The first consideration is that the concepts we extract from the low-level noisy person images should be semantically discriminative.We formulate it by image concept extraction loss lIsubscript𝑙𝐼l_{I}.The second consideration is that image-analogous concepts CAsuperscript𝐶𝐴C^{A} generated from attributes and image concepts CIsuperscript𝐶𝐼C^{I} should be homogeneous. Inspired by the powerful ability of generative adversary networks to close the gap between heterogeneous distributions, we propose to embed an adversarial learning strategy into our model.This is modelled by a concept generating objective lC​Gsubscript𝑙𝐶𝐺l_{CG}, which aims to generate concepts not only discriminative but also homogeneous with concepts extracted from images.Therefore, we havelc​o​n​c​e​p​t=lI+lC​G.subscript𝑙𝑐𝑜𝑛𝑐𝑒𝑝𝑡subscript𝑙𝐼subscript𝑙𝐶𝐺l_{concept}=l_{I}+l_{CG}.(2)In the following, we describe each of them in detail. + +Our image concept extraction loss lIsubscript𝑙𝐼l_{I} is based on softmax classification on the image concepts ΦI​(I)subscriptΦ𝐼𝐼\Phi_{I}(I).Since our objective is to learn semantically discriminative concepts that could distinguish different attributes rather than specific persons,we re-assign semantic IDs yisubscript𝑦𝑖y_{i} for any person image Iisubscript𝐼𝑖I_{i} according to its attributes rather than real person IDs, which means different people with the same attributes have the same semantic ID.We define the image concept extraction loss as a softmax classification objective on semantic IDs. Denoting ΨIsubscriptΨ𝐼\Psi_{I} as the classifier and I𝐼I as the input image, the image concept extraction loss is the negative log likelihood of predicted scores ΨI​(ΦI​(I))subscriptΨ𝐼subscriptΦ𝐼𝐼\Psi_{I}(\Phi_{I}(I)): + +lI=∑i−log⁡ΨI​(ΦI​(Ii))yIi,subscript𝑙𝐼subscript𝑖subscriptΨ𝐼subscriptsubscriptΦ𝐼subscript𝐼𝑖subscript𝑦subscript𝐼𝑖\displaystyle l_{I}=\sum_{i}-\log\Psi_{I}(\Phi_{I}(I_{i}))_{y_{I_{i}}},(3)where Iisubscript𝐼𝑖I_{i} is the it​hsuperscript𝑖𝑡ℎi^{th} input image, yIisubscript𝑦subscript𝐼𝑖y_{I_{i}} is the semantic ID of Iisubscript𝐼𝑖I_{i} and ΨI​(ΦI​(Ii))ksubscriptΨ𝐼subscriptsubscriptΦ𝐼subscript𝐼𝑖𝑘\Psi_{I}(\Phi_{I}(I_{i}))_{k} is the kt​hsuperscript𝑘𝑡ℎk^{th} element of ΨI​(ΦI​(Ii))subscriptΨ𝐼subscriptΦ𝐼subscript𝐼𝑖\Psi_{I}(\Phi_{I}(I_{i})). + +Image-analogous Concept Generation.We regard ΦAsubscriptΦ𝐴\Phi_{A} as a generative process, just like the process of people generating an imagination from an attribute description.As the semantically discriminative latent concepts could be extracted from images, they can also provide information to learn the image-analogous concepts ΦA​(A)subscriptΦ𝐴𝐴\Phi_{A}(A) for attributes as a guideline. + +Mathematically, the generated image-analogous concepts should follow the same distribution as image concepts, i.e., PI​(C)=PA​(C)subscript𝑃𝐼𝐶subscript𝑃𝐴𝐶P_{I}(C)=P_{A}(C), where C𝐶C denotes a concept in the joint concept space of ΦI​(I)subscriptΦ𝐼𝐼\Phi_{I}(I) and ΦA​(A)subscriptΦ𝐴𝐴\Phi_{A}(A) and PIsubscript𝑃𝐼P_{I}, PAsubscript𝑃𝐴P_{A} denote the distribution of image concepts and image-analogous concepts, respectively. We learn a function PI^^subscript𝑃𝐼\hat{P_{I}} to approximate image concept distribution PIsubscript𝑃𝐼P_{I}, and force the image-analogous concepts ΦA​(A)subscriptΦ𝐴𝐴\Phi_{A}(A) to follow distribtion PI^^subscript𝑃𝐼\hat{P_{I}}. It can be achieved by an adversarial training process of GAN, in which discriminator D𝐷D is regarded as PI^^subscript𝑃𝐼\hat{P_{I}} and the generator G𝐺G is regarded as image-analogous concept generator ΦAsubscriptΦ𝐴\Phi_{A}. + +In the adversary training process, we design a network structure (see Sec. 3.3) and train our concept generator ΦAsubscriptΦ𝐴\Phi_{A} with a goal of fooling a skillful concept discriminator D𝐷D that is trained to distinguish the image-analogous concept from the image concept,so that the generated image-analogous concept is aligned with the image concept.We design the discriminator network D𝐷D with parameters θDsubscript𝜃𝐷\theta_{D} and denote the parameters of ΦAsubscriptΦ𝐴\Phi_{A} as θGsubscript𝜃𝐺\theta_{G}.The adversarial min-max problem is formulated asminθG⁡maxθD⁡V​(D,G)=𝔼I∼pI​[log⁡D​(ΦI​(I))]+𝔼A∼pA​[log⁡(1−D​(ΦA​(A)))].subscriptsubscript𝜃𝐺subscriptsubscript𝜃𝐷𝑉𝐷𝐺subscript𝔼similar-to𝐼subscript𝑝𝐼delimited-[]𝐷subscriptΦ𝐼𝐼subscript𝔼similar-to𝐴subscript𝑝𝐴delimited-[]1𝐷subscriptΦ𝐴𝐴\begin{split}\min_{\theta_{G}}\max_{\theta_{D}}V(D,G)=&\mathbb{E}_{I\sim p_{I}}[\log D(\Phi_{I}(I))]+\\&\mathbb{E}_{A\sim p_{A}}[\log(1-D(\Phi_{A}(A)))].\end{split}(4)The above optimization problem is solved by iteratively optimizing θDsubscript𝜃𝐷\theta_{D} and θGsubscript𝜃𝐺\theta_{G}.Therefore, the objective can be decomposed into two loss terms la​d​vGsuperscriptsubscript𝑙𝑎𝑑𝑣𝐺l_{adv}^{G} and la​d​vDsuperscriptsubscript𝑙𝑎𝑑𝑣𝐷l_{adv}^{D}, whichare for training the concept generator ΦAsubscriptΦ𝐴\Phi_{A} and the discriminator D𝐷D, respectively. Then the whole objective during adversary training la​d​vsubscript𝑙𝑎𝑑𝑣l_{adv} could be formed by:la​d​v=λD​la​d​vD+λG​la​d​vG,subscript𝑙𝑎𝑑𝑣subscript𝜆𝐷subscriptsuperscript𝑙𝐷𝑎𝑑𝑣subscript𝜆𝐺subscriptsuperscript𝑙𝐺𝑎𝑑𝑣\displaystyle l_{adv}=\lambda_{D}l^{D}_{adv}+\lambda_{G}l^{G}_{adv},(5)wherela​d​vG=superscriptsubscript𝑙𝑎𝑑𝑣𝐺absent\displaystyle l_{adv}^{G}=−𝔼A∼pA​[log⁡D​(ΦA​(A))],subscript𝔼similar-to𝐴subscript𝑝𝐴delimited-[]𝐷subscriptΦ𝐴𝐴\displaystyle-\mathbb{E}_{A\sim p_{A}}[\log D(\Phi_{A}(A))],la​d​vD=superscriptsubscript𝑙𝑎𝑑𝑣𝐷absent\displaystyle l_{adv}^{D}=−𝔼I∼pI​[log⁡D​(ΦI​(I))]subscript𝔼similar-to𝐼subscript𝑝𝐼delimited-[]𝐷subscriptΦ𝐼𝐼\displaystyle-\mathbb{E}_{I\sim p_{I}}[\log D(\Phi_{I}(I))]−𝔼A∼pA​[log⁡(1−D​(ΦA​(A)))].subscript𝔼similar-to𝐴subscript𝑝𝐴delimited-[]1𝐷subscriptΦ𝐴𝐴\displaystyle-\mathbb{E}_{A\sim p_{A}}[\log(1-D(\Phi_{A}(A)))]. + +Semantic Consistency Constraint.The adversarial learning pattern la​d​vsubscript𝑙𝑎𝑑𝑣l_{adv} is important for generator ΦAsubscriptΦ𝐴\Phi_{A} to generate image-analogous concept with the same distribution of image concept ΦI​(I)subscriptΦ𝐼𝐼\Phi_{I}(I). Furthermore, we should generate meaningful concepts preserving the semantic discriminability of the attribute modality, i.e., PIs​i​d​(C)=PAs​i​d​(C)subscriptsuperscript𝑃𝑠𝑖𝑑𝐼𝐶subscriptsuperscript𝑃𝑠𝑖𝑑𝐴𝐶P^{sid}_{I}(C)=P^{sid}_{A}(C), where PIs​i​dsuperscriptsubscript𝑃𝐼𝑠𝑖𝑑P_{I}^{sid} and PAs​i​dsuperscriptsubscript𝑃𝐴𝑠𝑖𝑑P_{A}^{sid} denote the distributions of image concepts and image-analogous concepts of semantic ID s​i​d𝑠𝑖𝑑sid. If we analyze the image concept extraction loss lIsubscript𝑙𝐼l_{I} in Equation (3) independently, ΨIsubscriptΨ𝐼\Psi_{I} can be regarded as a function to approximate a set of distributions PIs​i​d​(C)superscriptsubscript𝑃𝐼𝑠𝑖𝑑𝐶P_{I}^{sid}(C) for each semantic ID s​i​d𝑠𝑖𝑑sid. With the assumption that the generated image-analogous concepts should be in the same concept space as image concepts, ΨIsubscriptΨ𝐼\Psi_{I} is shared by image concept extraction and image-analogous concept generation, so as to guarantee identical distribution of two modalities in semantic ID level.We integrate a semantic consistency constraint ls​csubscript𝑙𝑠𝑐l_{sc} using the same classifier for image concept ΨIsubscriptΨ𝐼\Psi_{I}:ls​c=∑i−log⁡ΨI​(ΦA​(Ai))yAi,subscript𝑙𝑠𝑐subscript𝑖subscriptΨ𝐼subscriptsubscriptΦ𝐴subscript𝐴𝑖subscript𝑦subscript𝐴𝑖\displaystyle l_{sc}=\sum_{i}-\log\Psi_{I}(\Phi_{A}(A_{i}))_{y_{A_{i}}},(6)where Aisubscript𝐴𝑖A_{i} is the it​hsuperscript𝑖𝑡ℎi^{th} input attribute, yAisubscript𝑦subscript𝐴𝑖y_{A_{i}} is the semantic ID of Aisubscript𝐴𝑖A_{i} and ΨI​(ΦA​(Ai))ksubscriptΨ𝐼subscriptsubscriptΦ𝐴subscript𝐴𝑖𝑘\Psi_{I}(\Phi_{A}(A_{i}))_{k} is the kt​hsuperscript𝑘𝑡ℎk^{th} element of ΨI​(ΦA​(Ai))subscriptΨ𝐼subscriptΦ𝐴subscript𝐴𝑖\Psi_{I}(\Phi_{A}(A_{i})).Thus the overall concept generating objective for attributes lC​Gsubscript𝑙𝐶𝐺l_{CG} becomes the sum of la​d​vsubscript𝑙𝑎𝑑𝑣l_{adv} and ls​csubscript𝑙𝑠𝑐l_{sc}:lC​G=la​d​v+ls​c.subscript𝑙𝐶𝐺subscript𝑙𝑎𝑑𝑣subscript𝑙𝑠𝑐\displaystyle{\color[rgb]{0,0,0}l_{CG}}=l_{adv}+l_{sc}.(7)By this way, we encourage our generative model to generate a more homogeneous image-analogous concept space, while at the same time correlate image-analogous concepts with semantically matched image concepts by maintaining semantic discriminability in the learned space. + +Our network architecture is shown in Figure 2. Firstly, the concept generator is particularly designed to have multiple fully connected layers in order to obtain enough capacity to generate image-analogous concepts which are highly heterogeneous from the input attribute. Details are shown in Table 1.Secondly, our concept discriminator is also a combination of fully connected layers, each followed by batch normalization and leaky reLU, except for the output layer, which is processed by the Sigmoid non-linearity.Finally, the concept extractor is obtained by removing the last Softmax classification layer of Resnet-50 and adding a 128-D fully connected layer. We regard the feature produced by the FC layer as the image concept. Note that the dimension of the last layer in the concept generator is also set to 128. + +As introduced above, we impose the semantic consistency constraint on attribute and thus we pass image-analogous concepts into the same Semantic ID classifier as that for image concepts.At the inference stage, we rank the gallery pedestrian image concepts CIsuperscript𝐶𝐼C^{I} according to their cosine distances to the query image-analogous concepts CAsuperscript𝐶𝐴C^{A} in the latent embedding space. + +Implementation Details.We first pre-trained our image network for 100 epochs using the semantic ID, with an adam optimizer Kingma and Ba (2015) with learning rate 0.01, momentum 0.9 and weight decay 5e-4. After that, we jointly train the whole network. We set λGsubscript𝜆𝐺\lambda_{G} in Eq. (2) as 0.001, and λDsubscript𝜆𝐷\lambda_{D} as 0.5, which will be discussed in Section 4.2. The total epoch was set to 300. During training, we set the learning rate of the attribute branch to 0.01, and set the learning rate of the image branch to 0.001 because it had been pre-trained. The batch size of training is 128 and the setting of optimizer is the same as that of pre-training. Hyper-parameters are fixed in comparisons across all the datasets. + +Datasets.We evaluate our approach and compare with related methods on three benchmark datasets, including Duke Attribute Lin et al. (2017), Market Attribute Lin et al. (2017), and PETA Deng et al. (2014).We tried to follow the setting in literatures.The Duke Attribute dataset contains 16522 images for training, and 19889 images for testing. Each person has 23 attributes. We labelled the images using semantic IDs according to their attributes. As a result, we have 300 semantic IDs for training and 387 semantic IDs for testing. Similar to Duke Attribute, the Market Attribute also has 27 attributes to describe a person, with 12141 images and 508 semantic IDs in the training set, and 15631 images and 484 semantic IDs in the test set. For PETA dataset, each person has 65 attributes (61 binary and 4 multi-valued).We used 10500 images with 1500 semantic IDs for training, and 1500 images with 200 semantic IDs for testing. + +Evaluation Metrics. We computed both Cumulative Match Characteristic (CMC) and mean average precision (mAP) as metrics to measure performances of the compared models. + +Adversarial vs. Other Distribution Alignment Techniques. For our attribute-image Re-ID, we employ the adversarial technique to make the image-analogous concepts generated from attribute aligned with the image concepts. While CCA is also an option and will be discussed when comparing our method with DCCA later, we examine whether other widely used alignment methods can work for our problem. We consider the MMD objective, which minimize difference between means of two distributions, and DeepCoral Sun and Saenko (2016), which matches both mean and covariance of two distributions, as traditional and effective distribution alignment baselines. Since their original models cannot be directly applied, we modify our model for comparison, that is we compare with 1) our model without the adversary learning but with an MMD objective(ours w/o adv+MMD); 2) our model without the adversary learning but with Coral objective(ours w/o adv+DeepCoral). We also provide the baseline that adversarial learning is not presented, denoted as “ours w/o adv”. + +Compared with the model that does not use adversarial learning (ours w/o adv), all the other baselines including our adversary method perform clearly better.Among all, the adversary learning framework generally performs better (with the best and second best performance)as shown in Table 2. + +With vs. Without Semantic Consistency Constraint. In our framework, we tested our performance when the semantic consistency constraint is not used, denoted as “ours w/o sc”. As reported in Table 2, without semantic consistency constraint the performance drops sharply. This is because although the distributions of two modalities are aligned, the corresponding pair is not correctly matched. Hence, the semantic consistency constraint actually regularizes the adversarial learning to avert this problem. As shown, with semantic consistency constraint but without adversarial learning (i.e., “ours w/o adv”) our model clearly performed worse than our full model.All the observations suggest the generic adversarial model itself does not directly fit the task of aligning two modalities which are highly discrepant, but the regularized one by semantic consistency constraint does. + +A2Img vs. Img2A.In our framework, we currently use the adversarial loss to align the generated image-analogous concept of attribute towards image concept, we call such case generation from attributes to image (A2Img). We now provide comparative results on generation from image to attriburtes (Img2A). As reported in Table 3,we find that Img2A is also effective, which even outperforms A2Img on the PETA dataset. But on larger datasets Market and Duke, A2Img performs better. The reason may be that the distribution of semantic IDs is much sparser than the distribution of images. Thus, estimating the manifold of images from the training data is more reliable than estimating that of attributes. But in PETA, the number of images is relatively small while semantic IDs are relatively abundant compared with the other two datasets. Moreover, PETA also has more complicated sceneries and larger number of attribute descriptions, which are more challenging for images to learn discriminative concepts. Thus learning generated attribute-analogous concepts and aligning with attribute concepts provides more discriminative information, and Img2A performs better on PETA. + +Generation in Concept Space or in Image Space.What if our model generates images instead of concepts, according to the attributes? We study how the generated image-analogous pattern (whether concepts or images) affects the effectiveness of our model. To this end, we use the conditional GAN in Reed et al. (2016) to generate fake image, which have aligned structure with real images, from our semantic attributes and a random noise input. We have modified some input dimension and added some convolution and deconvolution layers in Reed et al. (2016) to fit our setting. Firstly we train the generative models for 200 epochs, and then the classification loss isadded for another training of 200 epochs. + +We find the retrieval performance is worse than our original model, as shown in Table 3.This is probably because generating the whole pedestrian image introduces some noise, which is harmful in discriminative tasks like attribute-image Re-ID. In contrast, generating concepts which are relatively “clean” can avoid introducing unneccesary noise. Thus, generating image-analogous concepts in the discriminative concept space is more effective. + +Comparing with Attribute Prediction Method.As mentioned above, an intuitive method of attribute-image Re-ID is to predict attributes from person images and perform the matching between predicted attributes and query attributes. We compare our model with a classical attribute recognition model DeepMAR Li et al. (2015), which formulates attribute recognition as a muti-task learning problem and acts as an off-the-shelf attribute predictor in our experiment.As shown in Table 2, our model outperforms DeepMAR, and it is because DeepMAR still suffers from the problem of indiscriminative predicted attributes. Different from DeepMAR, we choose to learn latent representations as the bridge between the two modalities, where we successfully avert the problem caused by attribute prediction and learn more discriminative concepts using adversary training. + +Comparing with Cross Modality Retrieval Models. Since our problem is essentially a cross-modality retrieval problem, we compare our model with the typical and commonly used Deep canonical correlation analysis (DCCA) Andrew et al. (2013), Deep canonically correlated autoencoders (DCCAE) Wang et al. (2015) and a state-of-the-art model 2WayNet Eisenschtat and Wolf (2017).Deep CCA applies the CCA objective in deep neural networks in order to maximize the correlation between two different modalities. DCCAEWang et al. (2015) jointly models the cross-modality correlation and reconstruction information in the joint space learning process. 2WayNet is a recently proposed two-pipeline model which maximizes sample correlations. + +We show the comparative results in Table 2. From Table 2, we can observe that our model outperforms all the cross modality retrieval baselines on all three datasets by large margins. This is partially because our model not only learns to close the gap between the two modalities in the joint concept space, but also keeps the semantic consistency of the extracted and generated concepts. + +In addition, we compare our model with the most related one, i.e., the cross modality cross entropy (CMCE) model Li et al. (2017), which achieved a state-of-the-art result in text-based person retrieval.We train the CMCE model with semantic ID for fair comparison. The results in Table 2 show that our model is comparable (on Market) or more effective (on Duke and PETA) for the attribute-image Re-ID problem. + +Finally we present some further evaluations of our model. We first evaluate the effects of two important hyper-parameters λDsubscript𝜆𝐷\lambda_{D} and λGsubscript𝜆𝐺\lambda_{G}. We present the results on the Duke Attribute dataset in Figure 3. The trends are similar on other datasets, and therefore Figure 3 might be useful for determining the hyper-parameters on other datasets. + +Secondly, we conduct qualitative evaluations on our proposed model. Figure 4 shows examples of top-10 ranked images according to a query attribute description from the Market Attribute dataset.We find that fine-grained features of pedestrian images (e.g. stride of a backpack) are the main reasons that cause mistakes in our baseline (see ours w/o adv in the second row of Figure 4). But with the adversarial objective, our model could get an intuition and generate the concept of what a person wearing a backpack would look like, and then concentrate more on possible fine-grained features. + +The attribute-image Re-ID problem is a cross-modal matching problem that is realistic in practice, and it differs notably from the previous attribute-based person Re-ID problem that is still essentially an image-image Re-ID problem. In this work, we have identified its challenge through the experiments on three datasets. We have shown that an adversarial framework regularized by a semantic consistency constraint is so far the most effective way to solve the attribute-image Re-ID problem. Also, by our learning, we find that under the regularized adversarial learning framework, it is more useful to learn image-analogous concept from inquired attributes and make it aligned with the corresponding real image’s concept, as compared with its reverse. \ No newline at end of file diff --git a/1712.01586v1.txt b/1712.01586v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..bf7a039c77294dae38e5fb2f9af605fd174ae6a7 --- /dev/null +++ b/1712.01586v1.txt @@ -0,0 +1,309 @@ +\section{Introduction} +Semantic Role Labeling is a shallow semantic parsing task, whose goal is to determine essentially ``who did what to whom'', ``when'' and ``where''. Semantic roles indicate the basic event properties and relations among relevant entities in the sentence and provide an intermediate level of semantic representation thus benefiting many NLP applications, such as Information Extraction~\cite{Bastianelli-Basili-2013}, Question Answering~\cite{Surdeanu-Aarseth-ACL2003,Moschitti-Harabagiu-FLAIRS2003,Shen-Lapata-CONLL2007}, Machine Translation~\cite{knight1994building,ueffing2007transductive,wu2009semantic} and Multi-document Abstractive Summarization~\cite{genest2011framework}. + +Semantic roles are closely related to syntax. Therefore, traditional SRL approaches rely heavily on the syntactic structure of a sentence, which brings intrinsic complexity and restrains these systems to be domain specific. Recently, end-to-end models for SRL without syntactic inputs achieved promising results on this task~\cite{zhou2015end,marcheggiani2017simple,he2017deep}. As the pioneering work, Zhou and Xu~\shortcite{zhou2015end} introduced a stacked long short-term memory network (LSTM) and achieved the state-of-the-art results. He et al.,~\shortcite{he2017deep} reported further improvements by using deep highway bidirectional LSTMs with constrained decoding. These successes involving end-to-end models reveal the potential ability of LSTMs for handling the underlying syntactic structure of the sentences. + +Despite recent successes, these RNN-based models have limitations. RNNs treat each sentence as a sequence of words and recursively compose each word with its previous hidden state. The recurrent connections make RNNs applicable for sequential prediction tasks with arbitrary length, however, there still remain several challenges in practice. The first one is related to memory compression problem~\cite{cheng2016long}. As the entire history is encoded into a single fixed-size vector, the model requires larger memory capacity to store information for longer sentences. The unbalanced way of dealing with sequential information leads the network performing poorly on long sentences while wasting memory on shorter ones. The second one is concerned with the inherent structure of sentences. RNNs lack a way to tackle the tree-structure of the inputs. The sequential way to process the inputs remains the network depth-in-time, and the number of nonlinearities depends on the time-steps. + +To address these problems above, we present a deep attentional neural network (\textsc{DeepAtt}) for the task of SRL\footnote{Our source code is available at \url{https://github.com/XMUNLP/Tagger}}. Our models rely on the self-attention mechanism which directly draws the global dependencies of the inputs. In contrast to RNNs, a major advantage of self-attention is that it conducts direct connections between two arbitrary tokens in a sentence. Therefore, distant elements can interact with each other by shorter paths $\left(O(1) \ \textrm{v.s.}\ O(n)\right)$, which allows unimpeded information flow through the network. Self-attention also provides a more flexible way to select, represent and synthesize the information of the inputs and is complementary to RNN based models. Along with self-attention, \textsc{DeepAtt} comes with three variants which uses recurrent (RNN), convolutional (CNN) and feed-forward (FFN) neural network to further enhance the representations. + +Although \textsc{DeepAtt} is fairly simple, it gives remarkable empirical results. Our single model outperforms the previous state-of-the-art systems on the CoNLL-2005 shared task dataset and the CoNLL-2012 shared task dataset by $1.8$ and $1.0$ F$_1$ score respectively. It is also worth mentioning that on the out-of-domain dataset, we achieve an improvement upon the previous end-to-end approach~\cite{he2017deep} by $2.0$ F$_1$ score. The feed-forward variant of \textsc{DeepAtt} allows significantly more parallelization, and the parsing speed is 50K tokens per second on a single Titan X GPU. +\section{Semantic Role Labeling} +Given a sentence, the goal of SRL is to identify and classify the arguments of each target verb into semantic roles. For example, for the sentence \textit{``Marry borrowed a book from John last week.''} and the target verb \textit{borrowed}, SRL yields the following outputs: + +\begin{verse} +$[_{\textrm{ARG0}}$ Marry $] $ +$[_{\textrm{V}}$ borrowed $] $ +$[_{\textrm{ARG1}}$ a book $] $ \\ +$[_{\textrm{ARG2}}$ from John $] $ +$[_{\textrm{AM-TMP}}$ last week $]. $ +\end{verse} + +Here ARG0 represents the \textit{borrower}, ARG1 represents the \textit{thing borrowed}, ARG2 represents the \textit{entity borrowed from}, AM-TMP is an adjunct indicating the timing of the action and V represents the verb. + +Generally, semantic role labeling consists of two steps: identifying and classifying arguments. The former step involves assigning either a semantic argument or non-argument for a given predicate, while the latter includes labeling a specific semantic role for the identified argument. It is also common to prune obvious non-candidates before the first step and to apply post-processing procedure to fix inconsistent predictions after the second step. Finally, a dynamic programming algorithm is often applied to find the global optimum solution for this typical sequence labeling problem at the inference stage. + +\begin{figure}[!ht] +\begin{center} + \includegraphics[width=0.45\textwidth]{figures/arch.pdf} +\end{center} +\caption{An illustration of our deep attentional neural network. Original utterances and corresponding predicate masks are taken as the only inputs for our deep model. For example, \textit{love} is the predicate and marked as $1$, while other words are marked as $0$.} +\label{f:overall} +\end{figure} + +In this paper, we treat SRL as a BIO tagging problem. Our approach is extremely simple. As illustrated in Figure \ref{f:overall}, the original utterances and the corresponding predicate masks are first projected into real-value vectors, namely embeddings, which are fed to the next layer. After that, we design a deep attentional neural network which takes the embeddings as the inputs to capture the nested structures of the sentence and the latent dependency relationships among the labels. On the inference stage, only the topmost outputs of attention sub-layer are taken to a logistic regression layer to make the final decision~\footnote{In case of BIO violations, we simply treat the argument of the B tags as the argument of the whole span.}. +\section{Deep Attentional Neural Network for SRL} +In this section, we will describe \textsc{DeepAtt} in detail. The main component of our deep network consists of $N$ identical layers. Each layer contains a nonlinear sub-layer followed by an attentional sub-layer. The topmost layer is the softmax classification layer. +\subsection{Self-Attention} +Self-attention or intra-attention, is a special case of attention mechanism that only requires a single sequence to compute its representation. Self-attention has been successfully applied to many tasks, including reading comprehension, abstractive summarization, textual entailment, learning task-independent sentence representations, machine translation and language understanding~\cite{cheng2016long,parikh2016decomposable,lin2017structured,paulus2017deep,vaswani2017attention,shen2017disan}. + +\begin{figure*}[!ht] +\centering +\includegraphics[width=0.7\textwidth]{figures/att.pdf} +\caption{The computation graph of multi-head self-attention mechanism. All heads can be computed in parallel using highly optimized matrix multiplication codes.} +\label{fig:mhatt} +\end{figure*} + +In this paper, we adopt the multi-head attention formulation by Vaswani et al.~\shortcite{vaswani2017attention}. Figure \ref{fig:mhatt} depicts the computation graph of multi-head attention mechanism. The center of the graph is the scaled dot-product attention, which is a variant of dot-product (multiplicative) attention~\cite{luong2015effective}. Compared with the standard additive attention mechanism~\cite{bahdanau2014neural} which is implemented using a one layer feed-forward neural network, the dot-product attention utilizes matrix production which allows faster computation. Given a matrix of $n$ query vectors $\mathbf{Q} \in \mathbb{R}^{n \times d}$, keys $\mathbf{K} \in \mathbb{R}^{n \times d}$ and values $\mathbf{V} \in \mathbb{R}^{n \times d}$, the scaled dot-product attention computes the attention scores based on the following equation: +\begin{equation} +\textrm{Attention}(\mathbf{Q}, \mathbf{K}, \mathbf{V}) = \textrm{softmax}(\frac{\mathbf{Q}\mathbf{K}^T}{\sqrt{d}})\mathbf{V} +\end{equation} +where $d$ is the number of hidden units of our network. + +The multi-head attention mechanism first maps the matrix of input vectors $\mathbf{X} \in \mathbb{R}^{t \times d}$ to queries, keys and values matrices by using different linear projections. Then $h$ parallel heads are employed to focus on different part of channels of the value vectors. Formally, for the $i$-th head, we denote the learned linear maps by $\mathbf{W}_i^Q \in \mathbb{R}^{n \times d/h}$, $\mathbf{W}_i^K \in \mathbb{R}^{n \times d/h}$ and $\mathbf{W}_i^V \in \mathbb{R}^{n \times d/h}$, which correspond to queries, keys and values respectively. Then the scaled dot-product attention is used to compute the relevance between queries and keys, and to output mixed representations. The mathematical formulation is shown below: +\begin{equation} +\mathbf{M}_i = \textrm{Attention}(\mathbf{Q}\mathbf{W}_i^Q, \mathbf{K}\mathbf{W}_i^K, \mathbf{V}\mathbf{W}_i^V) +\end{equation} + +Finally, all the vectors produced by parallel heads are concatenated together to form a single vector. Again, a linear map is used to mix different channels from different heads: +\begin{align} +\mathbf{M} &= \textrm{Concat}(\mathbf{M}_1, \ldots, \mathbf{M}_h) \\ +\mathbf{Y} &= \mathbf{M}\mathbf{W} +\end{align} +where $\mathbf{M} \in \mathbb{R}^{n \times d}$ and $\mathbf{W} \in \mathbb{R}^{d \times d}$. + +The self-attention mechanism has many appealing aspects compared with RNNs or CNNs. Firstly, the distance between any input and output positions is 1, whereas in RNNs it can be $n$. Unlike CNNs, self-attention is not limited to fixed window sizes. Secondly, the attention mechanism uses weighted sum to produce output vectors. As a result, the gradient propagations are much easier than RNNs or CNNs. Finally, the dot-product attention is highly parallel. In contrast, RNNs are hard to parallelize owing to its recursive computation. +\subsection{Nonlinear Sub-Layers} +The successes of neural networks root in its highly flexible nonlinear transformations. Since attention mechanism uses weighted sum to generate output vectors, its representational power is limited. To further increase the expressive power of our attentional network, we employ a nonlinear sub-layer to transform the inputs from the bottom layers. In this paper, we explore three kinds of nonlinear sub-layers, namely recurrent, convolutional and feed-forward sub-layers. +\subsubsection{Recurrent Sub-Layer} +We use bidirectional LSTMs to build our recurrent sub-layer. Given a sequence of input vectors $\{\mathbf{x}_t\}$, two LSTMs process the inputs in opposite directions. To maintain the same dimension between inputs and outputs, we use the sum operation to combine two representations: +\begin{align} + \overrightarrow{\mathbf{h}}_t &= \textrm{LSTM}(\mathbf{x}_t, \overrightarrow{\mathbf{h}}_{t-1})\\ + \overleftarrow{\mathbf{h}}_t &= \textrm{LSTM}(\mathbf{x}_t, \overleftarrow{\mathbf{h}}_{t+1})\\ + \mathbf{y}_t &= \overrightarrow{\mathbf{h}}_t + \overleftarrow{\mathbf{h}}_t +\end{align} +\subsubsection{Convolutional Sub-Layer} +For convolutional sub-layer, we use the Gated Linear Unit (GLU) proposed by Dauphin et al.~\shortcite{dauphin2016language}. Compared with the standard convolutional neural network, GLU is much easier to learn and achieves impressive results on both language modeling and machine translation task~\cite{dauphin2016language,gehring2017convolutional}. Given two filters $\mathbf{W} \in \mathbb{R}^{k \times d \times d}$ and $\mathbf{V} \in \mathbb{R}^{k \times d \times d}$, the output activations of GLU are computed as follows: +\begin{equation} +\textrm{GLU}(\mathbf{X}) = (\mathbf{X}*\mathbf{W}) \odot \sigma(\mathbf{X}*\mathbf{V}) +\end{equation} +The filter width $k$ is set to 3 in all our experiments. +\subsubsection{Feed-forward Sub-Layer} +The feed-forward sub-layer is quite simple. It consists of two linear layers with hidden ReLU nonlinearity~\cite{nair2010rectified} in the middle. Formally, we have the following equation: +\begin{equation} +\textrm{FFN}(\mathbf{X}) = \textrm{ReLU}(\mathbf{X}\mathbf{W}_1)\mathbf{W}_2 +\end{equation} +where $\mathbf{W}_1 \in \mathbb{R}^{d \times h_f}$ and $\mathbf{W}_2 \in \mathbb{R}^{h_f \times d}$ are trainable matrices. Unless otherwise noted, we set $h_f = 800$ in all our experiments. +\subsection{Deep Topology} +Previous works pointed out that deep topology is essential to achieve good performance~\cite{zhou2015end,he2017deep}. In this work, we use the residual connections proposed by He et al.~\shortcite{he2016deep} to ease the training of our deep attentional neural network. Specifically, the output $\mathbf{Y}$ of each sub-layer is computed by the following equation: +\begin{equation} +\mathbf{Y} = \mathbf{X} + \textrm{Sub-Layer}(\mathbf{X}) +\end{equation} +We then apply layer normalization~\cite{ba2016layer} after the residual connection to stabilize the activations of deep neural network. +\subsection{Position Encoding} +The attention mechanism itself cannot distinguish between different positions. So it is crucial to encode positions of each input words. There are various ways to encode positions, and the simplest one is to use an additional position embedding. In this work, we try the timing signal approach proposed by Vaswani et al.~\shortcite{vaswani2017attention}, which is formulated as follows: +\begin{align} +\textrm{timing}(t, 2i) = \sin(t / 10000^{2i / d}) \\ +\textrm{timing}(t, 2i + 1) = \cos(t / 10000^{2i / d}) +\end{align} +The timing signals are simply added to the input embeddings. Unlike the position embedding approach, this approach does not introduce additional parameters. +\subsection{Pipeline} +The first step of using neural networks to process symbolic data is to represent them by distributed vectors, also called embeddings~\cite{Bengio-Janvin-JMLR2003}. We take the very original utterances and the corresponding predicate masks $\mathbf{m}$ as the input features. $m_t$ is set to $1$ if the corresponding word is a predicate, or $0$ if not. + +Formally, in SRL task, we have a word vocabulary $\mathcal{V}$ and mask vocabulary $\mathcal{C}=\{0,1\}$. Given a word sequence $\{x_1, x_2, \ldots, x_T\}$ and a mask sequence $\{m_1, m_2, ..., m_T\}$, each word $x_t \in \mathcal{V}$ and its corresponding predicate mask $m_t \in \mathcal{C}$ are projected into real-valued vectors $\mathbf{e}(x_t)$ and $\mathbf{e}(m_t)$ through the corresponding lookup table layer, respectively. The two embeddings are then concatenated together as the output feature maps of the lookup table layers. Formally speaking, we have $\mathbf{x}_t = \left[\mathbf{e}(w_t),\mathbf{e}(m_t)\right]$. + +We then build our deep attentional neural network to learn the sequential and structural information of a given sentence based on the feature maps from the lookup table layer. Finally, we take the outputs of the topmost attention sub-layer as inputs to make the final predictions. + +Since there are dependencies between semantic labels, most previous neural network models introduced a transition model for measuring the probability of jumping between the labels. Different from these works, we perform SRL as a typical classification problem. Latent dependency information is embedded in the topmost attention sub-layer learned by our deep models. This approach is simpler and easier to implement compared to previous works. + +Formally, given an input sequence $\bm{x} = \{x_1, x_2,\ldots,x_n\}$, the log-likelihood of the corresponding correct label sequence $\bm{y} = \{y_1, y_2, \ldots, y_n\}$ is +\begin{equation} +\log p(\bm{y} | \bm{x}; \bm{\theta}) = \sum_{t=1}^{n} \log p(y_t|\bm{x}; \bm{\theta}). +\end{equation} +Our model predict the corresponding label $y_t$ based on the representation $\mathbf{h}_t$ produced by the topmost attention sub-layer of \textsc{DeepAtt}: +\begin{eqnarray} + p(y_t|\bm{x}; \bm{\theta}) &=& p(y_t|\mathbf{h}_t; \bm{\theta}) \\ + &=& \textrm{softmax}(\mathbf{W}_o\mathbf{h}_t)^T\delta_{y_t}, +\end{eqnarray} +Where $W_o$ is the softmax matrix and $\delta_{y_t}$ is Kronecker delta with a dimension for each output symbol, so $\textrm{softmax}(\mathbf{W}_o\mathbf{h}_t)^T\delta_{y_t}$ is exactly the $y_t$'th element of the distribution defined by the softmax. Our training objective is to maximize the log probabilities of the correct output labels given the input sequence over the entire training set. +\section{Experiments} +We report our empirical studies of \textsc{DeepAtt} on the two commonly used datasets from the CoNLL-2005 shared task and the CoNLL-2012 shared task. +\subsection{Datasets} +The CoNLL-2005 dataset takes section 2-21 of the Wall Street Journal (WSJ) corpus as training set, and section 24 as development set. The test set consists of section 23 of the WSJ corpus as well as 3 sections from the Brown corpus~\cite{Carreras-CoNLL2005}. The CoNLL-2012 dataset is extracted from the OntoNotes v5.0 corpus. The description and separation of training, development and test set can be found in Pardhan et al.~\shortcite{Pradhan-CoNLL2013}. +\subsection{Model Setup} +\paragraph{Initialization} We initialize the weights of all sub-layers as random orthogonal matrices. For other parameters, we initialize them by sampling each element from a Gaussian distribution with mean $0$ and variance $\frac{1}{\sqrt{d}}$. The embedding layer can be initialized randomly or using pre-trained word embeddings. We will discuss the impact of pre-training in the analysis subsection.\footnote{To be strictly comparable to previous work, we use the same vocabularies and pre-trained embeddings as He et al.\shortcite{he2017deep}.} + +\paragraph{Settings and Regularization} The settings of our models are described as follows. The dimension of word embeddings and predicate mask embeddings is set to 100 and the number of hidden layers is set to 10. We set the number of hidden units $d$ to $200$. The number of heads $h$ is set to 8. We apply dropout~\cite{srivastava2014dropout} to prevent the networks from over-fitting. Dropout layers are added before residual connections with a keep probability of 0.8. Dropout is also applied before the attention softmax layer and the feed-froward ReLU hidden layer, and the keep probabilities are set to 0.9. We also employ label smoothing technique~\cite{szegedy2016rethinking} with a smoothing value of 0.1 during training. + +\paragraph{Learning} +Parameter optimization is performed using stochastic gradient descent. We adopt Adadelta \cite{zeiler2012adadelta} ($ \epsilon= 10^{−6}$ and $\rho = 0.95$) as the optimizer. To avoid exploding gradients problem, we clip the norm of gradients with a predefined threshold $1.0$~\cite{pascanu2013construct}. Each SGD contains a mini-batch of approximately 4096 tokens for the CoNLL-2005 dataset and 8192 tokens for the CoNLL-2012 dataset. The learning rate is initialized to 1.0. After training 400k steps, we halve the learning rate every 100K steps. We train all models for 600K steps. For \textsc{DeepAtt} with FFN sub-layers, the whole training stage takes about two days to finish on a single Titan X GPU, which is 2.5 times faster than the previous approach~\cite{he2017deep}. +\subsection{Results} +\begin{table*}[ht] +\centering +\resizebox{\linewidth}{!}{% +\begin{tabular}{cccccccccccccc} +\hline +\multirow{2}{*}{Model} & \multicolumn{4}{c}{Development} & \multicolumn{4}{c}{WSJ Test} & \multicolumn{4}{c}{Brown Test} & {Combined} \\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} \cmidrule(lr){10-13} \cmidrule(lr){14-14} + & P & R & F1 & Comp. & P & R & F1 & Comp. & P & R & F1 & Comp. & F1 \\ \hline +He et al. (Ensemble)~\shortcite{he2017deep} & 83.1 & 82.4 & 82.7 & 64.1 & 85.0 & 84.3 & 84.6 & 66.5 & \textbf{74.9} & 72.4 & 73.6 & 46.5 & 83.2 \\ +He et al. (Single)~\shortcite{he2017deep} & 81.6 & 81.6 & 81.6 & 62.3 & 83.1 & 83.0 & 83.1 & 64.3 & 72.8 & 71.4 & 72.1 & 44.8 & 81.6 \\ +Zhou and Xu~\shortcite{zhou2015end} & 79.7 & 79.4 & 79.6 & - & 82.9 & 82.8 & 82.8 & - & 70.7 & 68.2 & 69.4 & - & 81.1 \\ +FitzGerald et al. (Struct., Ensemble)~\shortcite{fitzgerald2015semantic} & 81.2 & 76.7 & 78.9 & 55.1 & 82.5 & 78.2 & 80.3 & 57.3 & 74.5 & 70.0 & 72.2 & 41.3 & - \\ +T\"{a}ckstr\"{o}m et al. (Struct.)~\shortcite{Tackstrom-Das-TACL2015} & 81.2 & 76.2 & 78.6 & 54.4 & 82.3 & 77.6 & 79.9 & 56.0 & 74.3 & 68.6 & 71.3 & 39.8 & - \\ +Toutanova et al. (Ensemble)~\shortcite{Toutanova-Manning-CL2008} & - & - & 78.6 & 58.7 & 81.9 & 78.8 & 80.3 & 60.1 & - & - & 68.8 & 40.8 & - \\ +Punyakanok et al. (Ensemble)~\shortcite{Punyakanok-Yih-2008} & 80.1 & 74.8 & 77.4 & 50.7 & 82.3 & 76.8 & 79.4 & 53.8 & 73.4 & 62.9 & 67.8 & 32.3 & 77.9 \\\hline +\textsc{DeepAtt} (RNN) & 81.2 & 82.3 & 81.8 & 62.4 & 83.5 & 84.0 & 83.7 & 65.2 & 72.5 & 73.4 & 72.9 & 44.7 & 82.3 \\ +\textsc{DeepAtt} (CNN) & 82.1 & 82.8 & 82.4 & 63.6 & 83.6 & 83.9 & 83.8 & 65.4 & 72.8 & 72.7 & 72.7 & 45.9 & 82.3 \\ +\textsc{DeepAtt} (FFN) & 82.6 & 83.6 & 83.1 & 65.2 & 84.5 & 85.2 & 84.8 & 66.4 & 73.5 & 74.6 & 74.1 & 48.4 & 83.4 \\ +\textsc{DeepAtt} (FFN, Ensemble) & \textbf{84.3} & \textbf{84.9} & \textbf{84.6} &\textbf{67.3} & \textbf{85.9} & \textbf{86.3} & \textbf{86.1} & \textbf{69.0} & 74.6 & \textbf{75.0} & \textbf{74.8} & \textbf{48.6} & \textbf{84.6} \\ \hline +\end{tabular} +} +\caption{\label{tab:Eval-05} Comparison with previous methods on the CoNLL-2005 dataset. We report the results +in terms of precision (P), recall (R), F$_1$ and percentage of completely correct predicates (Comp.). Our single and ensemble model lead to substantial improvements over the previous state-of-the-art results.} +\end{table*} + +\begin{table*}[ht] +\centering +\resizebox{0.8\linewidth}{!}{% +\begin{tabular}{ccccccccc} +\hline +\multirow{2}{*}{Model} & \multicolumn{4}{c}{Development} & \multicolumn{4}{c}{Test} \\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} + & P & R & F1 & Comp. & P & R & F1 & Comp. \\ \hline +He et al. (Ensemble)~\shortcite{he2017deep} & 83.5 & 83.2 & 83.4 & 67.5 & \textbf{83.5} & 83.3 & 83.4 & 68.5 \\ +He et al. (Single)~\shortcite{he2017deep} & 81.7 & 81.4 & 81.5 & 64.6 & 81.8 & 81.6 & 81.7 & 66.0 \\ +Zhou and Xu~\shortcite{zhou2015end} & - & - & 81.1 & - & - & - & 81.3 & - \\ +FitzGerald et al. (Struct., Ensemble)~\shortcite{fitzgerald2015semantic} & 81.0 & 78.5 & 79.7 & 60.9 & 81.2 & 79.0 & 80.1 & 62.6 \\ +T\"{a}ckstr\"{o}m et al. (Struct., Ensemble)~\shortcite{Tackstrom-Das-TACL2015} & 80.5 & 77.8 & 79.1 & 60.1 & 80.6 & 78.2 & 79.4 & 61.8 \\ +Pradhan et al.(Revised)~\shortcite{Pradhan-CoNLL2013} & - & - & - & - & 78.5 & 76.6 & 77.5 & 55.8 \\ \hline +\textsc{DeepAtt} (RNN) & 81.0 & 82.3 & 81.6 & 64.6 & 80.9 & 82.2 & 81.5 & 65.7 \\ +\textsc{DeepAtt} (CNN) & 80.1 & 82.5 & 81.3 & 65.0 & 79.8 & 82.6 & 81.2 & 66.1 \\ +\textsc{DeepAtt} (FFN) & 82.2 & 83.6 & 82.9 & 66.7 & 81.9 & 83.6 & 82.7 & 67.5 \\ +\textsc{DeepAtt} (FFN, Ensemble) & \textbf{83.6} & \textbf{84.7} & \textbf{84.1} & \textbf{68.7} & 83.3 & \textbf{84.5} & \textbf{83.9} & \textbf{69.3} \\ \hline +\end{tabular}} +\caption{\label{tab:Eval-12} Experimental results on the CoNLL-2012 dataset. The metrics are the same as above. Again, our model achieves the state-of-the-art performance.} +\end{table*} + +In Table \ref{tab:Eval-05} and \ref{tab:Eval-12}, we give the comparisons of \textsc{DeepAtt} with previous approaches. On the CoNLL-2005 dataset, the single model of \textsc{DeepAtt} with RNN, CNN and FFN nonlinear sub-layers achieves an F$_1$ score of $82.3$, $82.3$ and $83.4$ respectively. The FFN variant outperforms previous best performance by 1.8 F$_1$ score. Remarkably, we get 74.1 F$_1$ score on the out-of-domain dataset, which outperforms the previous state-of-the-art system by $2.0$ F$_1$ score. On the CoNLL-2012 dataset, the single model of FFN variant also outperforms the previous state-of-the-art by 1.0 F$_1$ score. When ensembling 5 models with FFN nonlinear sub-layers, our approach achieves an F$_1$ score of 84.6 and 83.9 on the two datasets respectively, which has an absolute improvement of 1.4 and 0.5 over the previous state-of-the-art. These results are consistent with our intuition that the self-attention layers is helpful to capture structural information and long distance dependencies. +\subsection{Analysis} +In this subsection, we discuss the main factors that influence our results. We analyze the experimental results on the development set of CoNLL-2005 dataset. + +\begin{table}[htb] +\centering +\resizebox{\linewidth}{!}{% +\begin{tabular}{llllcc|c} +\hline +\multicolumn{7}{c}{CoNLL-2005 Dataset} \\\hline\hline +\# & Nonlinearity & PE &Embedding & Width & Depth & F$_1$ \\\hline +1 & FFN & Timing & GloVe & 200 & 10 & 83.1 \\\hline +2 & FFN & Timing & GloVe & 200 &4& 79.9 \\ +3 & FFN & Timing & GloVe & 200 &6& 82.0 \\ +4 & FFN & Timing & GloVe & 200 &8& 82.8 \\ +5 & FFN & Timing & GloVe & 200 &12& 83.0 \\\hline +6 & FFN & Timing & GloVe & 400 & 10& 83.2 \\ +7 & FFN & Timing & GloVe & 600 & 10 & 83.4 \\\hline +8 & FFN & Timing & Random & 200 &10& 79.6 \\\hline +9 & FFN & None & GloVe & 200 &10& 20.0 \\ +10 & FFN & Embedding & GloVe & 200 & 10& 79.4 \\\hline +11 & None & Timing & GloVe & 200 & 10 & 79.9 \\\hline +\end{tabular}} +\caption{\label{tab:EXP-Group} Detailed results on the CoNLL-2005 development set. \textsc{PE} denotes the way to encoding word positions. GloVe refers to the GloVe embedding pre-trained on 6B tokens.} +\end{table} + +\paragraph{Model Depth} +Previous works~\cite{zhou2015end,he2017deep} show that model depth is the key to the success of end-to-end SRL approach. Our observations also coincide with previous works. Rows 1-5 of Table \ref{tab:EXP-Group} show the effects of different number of layers. For \textsc{DeepAtt} with 4 layers, our model only achieves 79.9 F$_1$ score. Increasing depth consistently improves the performance on the development set, and our best model consists of 10 layers. For \textsc{DeepAtt} with 12 layers, we observe a slightly performance drop of 0.1 F$_1$. + +\paragraph{Model Width} We also conduct experiments with different model widths. We increase the number of hidden units from $200$ to $400$ and $400$ to $600$ as listed in rows 1, 6 and 7 of Table \ref{tab:EXP-Group}, and the corresponding hidden size $h_f$ of FFN sub-layers is increased to 1600 and 2400 respectively. Increasing model widths improves the F$_1$ slightly, and the model with 600 hidden units achieves an F$_1$ of 83.4. However, the training and parsing speed are slower as a result of larger parameter counts. + +\paragraph{Word Embedding} +Previous works found that the performance can be improved by pre-training the word embeddings on large unlabeled data~\cite{Collobert-Ronan-JMLR2011,zhou2015end}. We use the GloVe~\cite{pennington2014glove} embeddings pre-trained on Wikipedia and Gigaword. The embeddings are used to initialize our networks, but are not fixed during training. Rows 1 and 8 of Table \ref{tab:EXP-Group} show the effects of additional pre-trained embeddings. When using pre-trained GloVe embeddings, the F$_1$ score increases from 79.6 to 83.1. + +\paragraph{Position Encoding} +From rows 1, 9 and 10 of Table \ref{tab:EXP-Group} we can see that the position encoding plays an important role in the success of \textsc{DeepAtt}. Without position encoding, the \textsc{DeepAtt} with FFN sub-layers only achieves $20.0$ F$_1$ score on the CoNLL-2005 development set. When using position embedding approach, the F$_1$ score boosts to $79.4$. The timing approach is surprisingly effective, which outperforms the position embedding approach by $3.7$ F$_1$ score. + +\paragraph{Nonlinear Sub-Layers} \textsc{DeepAtt} requires nonlinear sub-layers to enhance its expressive power. Row 11 of Table \ref{tab:EXP-Group} shows the performance of \textsc{DeepAtt} without nonlinear sub-layers. We can see that the performance of 10 layered \textsc{DeepAtt} without nonlinear sub-layers only matches the 4 layered \textsc{DeepAtt} with FFN sub-layers, which indicates that the nonlinear sub-layers are the essential components of our attentional networks. + +\begin{table}[!t] +\centering +\begin{tabular}{c|cc} +Decoding & F$_1$ & Speed \\\hline +Argmax Decoding & \textbf{83.1} & \textbf{50K} \\ +Constrained Decoding & 83.0 & 17K +\end{tabular} +\caption{Comparison between argmax decoding and constrained decoding on top of our model.} +\label{EXP:Decoding} +\end{table} + +\paragraph{Constrained Decoding} Table \ref{EXP:Decoding} show the effects of constrained decoding~\cite{he2017deep} on top of \textsc{DeepAtt} with FFN sub-layers. We observe a slightly performance drop when using constrained decoding. Moreover, adding constrained decoding slow down the decoding speed significantly. For \textsc{DeepAtt}, it is powerful enough to capture the relationships among labels. + +\begin{table}[!ht] +\centering +\resizebox{0.45\textwidth}{!}{% +\begin{tabular}{lcccccc}\cline{1-7} +\multirow{2}{*}{Label} & \multicolumn{3}{c}{He et al.~\shortcite{he2017deep}} & \multicolumn{3}{c}{\textsc{DeepAtt}}\\ +\cmidrule(lr){2-4} \cmidrule(lr){5-7} + & Precision & Recall & F$_1$ & Precision & Recall & F$_1$\\\hline +A0 & 89.6 & 90.7 & 90.2 & 91.0 & 91.9 & 91.4\\ +A1 & 84.2 & 84.6 & 84.4 & 86.2 & 86.9 & 86.6\\ +A2 & 73.6 & 72.7 & 73.2 & 75.0 & 77.0 & 76.0\\ +A3 & 76.6 & 63.2 & 69.2 & 77.1 & 73.7 & 75.3\\ +AM-ADV & 64.8 & 60.6 & 62.6 & 69.5 & 64.5 & 66.9\\ +AM-DIR & 48.3 & 38.9 & 43.1 & 54.8 & 47.2 & 50.8\\ +AM-LOC & 59.8 & 58.3 & 59.0 & 62.5 & 61.9 & 62.2\\ +AM-MNR & 70.4 & 57.0 & 63.0 & 70.4 & 62.0 & 65.9\\ +AM-PNC & 65.8 & 64.2 & 65.0 & 65.3 & 60.5 & 62.8\\ +AM-TMP & 80.5 & 85.7 & 83.0 & 81.7 & 87.9 & 84.7\\ +\hline +Overall & 83.1 & 82.4 & 82.7 & 84.3 & 84.9 & 84.6\\ +\hline +\end{tabular} +} +\caption{Detailed scores on the development set of CoNLL-2005 dataset. We also list the previous state-of-the-art model~\cite{he2017deep} for comparison.} +\label{EXP:detailed} +\end{table} + +\begin{table}[!t] +\centering +\begin{tabular}{c|cc} +Model & Constituents & Semantic Roles \\\hline +He et al.~\shortcite{he2017deep} & 91.87 & 87.10 \\ +\textsc{DeepAtt} & \textbf{91.92} & \textbf{88.88} \\ +\end{tabular} +\caption{Comparison with the previous work on identifying and classifying semantic roles. We list the percentage of correctly identified spans as well as the percentage of correctly classified semantic roles given the gold spans.} +\label{EXP:percentage} +\end{table} + +\paragraph{Detailed Scores} We list the detailed performance on frequent labels in Table \ref{EXP:detailed}. The results of the previous state-of-the-art~\cite{he2017deep} are also shown for comparison. Compared with He et al.~\shortcite{he2017deep}, our model shows improvement on all labels except AM-PNC, where He's model performs better. Table \ref{EXP:percentage} shows the results of identifying and classifying semantic roles. Our model improves the previous state-of-the-art on both identifying correct spans as well as correctly classifying them into semantic roles. However, the majority of improvements come from classifying semantic roles. This indicates that finding the right constituents remains a bottleneck of our model. + +\begin{table}[!ht] +\centering +\resizebox{0.45\textwidth}{!}{% +\begin{tabular}{c *{12}{Y}} + \multicolumn{1}{c}{pred./gold} & \multicolumn{1}{c}{A0} & \multicolumn{1}{c}{A1} + & \multicolumn{1}{c}{A2} & \multicolumn{1}{c}{A3} & \multicolumn{1}{c}{ADV} + & \multicolumn{1}{c}{DIR} & \multicolumn{1}{c}{LOC} & \multicolumn{1}{c}{MNR} + & \multicolumn{1}{c}{PNC} & \multicolumn{1}{c}{TMP} \\ + A0 & - \cellcolor[gray]{1.00} & 48 \cellcolor[gray]{0.51} & 12 \cellcolor[gray]{0.88} & 7 \cellcolor[gray]{0.93} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 7 \cellcolor[gray]{0.92} & 0 \cellcolor[gray]{1.00} \\ + A1 & 76 \cellcolor[gray]{0.23} & - \cellcolor[gray]{1.00} & 35 \cellcolor[gray]{0.65} & 0 \cellcolor[gray]{1.00} & 7 \cellcolor[gray]{0.92} & 16 \cellcolor[gray]{0.83} & 19 \cellcolor[gray]{0.81} & 2 \cellcolor[gray]{0.98} & 30 \cellcolor[gray]{0.69} & 0 \cellcolor[gray]{1.00} \\ + A2 & 10 \cellcolor[gray]{0.90} & 37 \cellcolor[gray]{0.62} & - \cellcolor[gray]{1.00} & 42 \cellcolor[gray]{0.57} & 15 \cellcolor[gray]{0.85} & 33 \cellcolor[gray]{0.67} & 28 \cellcolor[gray]{0.71} & 35 \cellcolor[gray]{0.64} & 38 \cellcolor[gray]{0.62} & 0 \cellcolor[gray]{1.00} \\ + A3 & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 5 \cellcolor[gray]{0.95} & - \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 2 \cellcolor[gray]{0.98} & 7 \cellcolor[gray]{0.92} & 0 \cellcolor[gray]{1.00} \\ +ADV & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & - \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 9 \cellcolor[gray]{0.90} & 26 \cellcolor[gray]{0.73} & 15 \cellcolor[gray]{0.85} & 58 \cellcolor[gray]{0.42} \\ +DIR & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 2 \cellcolor[gray]{0.97} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & - \cellcolor[gray]{1.00} & 9 \cellcolor[gray]{0.90} & 2 \cellcolor[gray]{0.98} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} \\ +LOC & 10 \cellcolor[gray]{0.90} & 10 \cellcolor[gray]{0.89} & 10 \cellcolor[gray]{0.90} & 7 \cellcolor[gray]{0.93} & 11 \cellcolor[gray]{0.88} & 16 \cellcolor[gray]{0.83} & - \cellcolor[gray]{1.00} & 15 \cellcolor[gray]{0.84} & 0 \cellcolor[gray]{1.00} & 8 \cellcolor[gray]{0.92} \\ +MNR & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 22 \cellcolor[gray]{0.78} & 28 \cellcolor[gray]{0.71} & 26 \cellcolor[gray]{0.73} & 0 \cellcolor[gray]{1.00} & 4 \cellcolor[gray]{0.95} & - \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 33 \cellcolor[gray]{0.67} \\ +PNC & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 10 \cellcolor[gray]{0.90} & 7 \cellcolor[gray]{0.93} & 0 \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} & 4 \cellcolor[gray]{0.95} & 2 \cellcolor[gray]{0.98} & - \cellcolor[gray]{1.00} & 0 \cellcolor[gray]{1.00} \\ +TMP & 3 \cellcolor[gray]{0.97} & 2 \cellcolor[gray]{0.97} & 2 \cellcolor[gray]{0.97} & 7 \cellcolor[gray]{0.93} & 38 \cellcolor[gray]{0.62} & 33 \cellcolor[gray]{0.67} & 23 \cellcolor[gray]{0.76} & 13 \cellcolor[gray]{0.87} & 0 \cellcolor[gray]{1.00} & - \cellcolor[gray]{1.00} \\ +\end{tabular} +} +\caption{Confusion matrix for labeling errors. Each cell shows the percentage of predicted labels for each gold label.} +\label{EXP:matrix} +\end{table} + +\paragraph{Labeling Confusion} +Table \ref{EXP:matrix} shows a confusion matrix of our model for the most frequent labels. We only consider predicted arguments that match gold span boundaries. Compared with the previous work~\cite{he2017deep}, our model still confuses ARG2 with AM-DIR, AM-LOC and AM-MNR, but to a lesser extent. This indicates that our model has some advantages on such difficult adjunct distinction~\cite{kingsbury2002adding}. +\section{Related work} +\paragraph{SRL} +Gildea and Jurafsky~\shortcite{gildea2002automatic} developed the first automatic semantic role labeling system based on FrameNet. Since then the task has received a tremendous amount of attention. The focus of traditional approaches is devising appropriate feature templates to describe the latent structure of utterances. Pradhan et al.~\shortcite{Pradhan-Jurafsky-Conll2005}; Surdeanu et al.~\shortcite{Surdeanu-Aarseth-ACL2003}; Palmer, Gildea, and Xue~\shortcite{Palmer-Xue-2010} explored the syntactic features for capturing the overall sentence structure. Combination of different syntactic parsers was also proposed to avoid prediction risk which was introduced by Surdeanu et al.~\shortcite{Surdeanu-Aarseth-ACL2003}; Koomen et al.~\shortcite{Koomen-Yih-CoNLL2005}; Pradhan et al.~\shortcite{Pradhan-CoNLL2013}. + +Beyond these traditional methods above, Collobert et al.~\shortcite{Collobert-Ronan-JMLR2011} proposed a convolutional neural network for SRL to reduce the feature engineering. The pioneering work on building an end-to-end system was proposed by Zhou and Xu~\shortcite{zhou2015end}, who applied an 8 layered LSTM model which outperformed the previous state-of-the-art system. He et al.\shortcite{he2017deep} improved further with highway LSTMs and constrained decoding. They used simplified input and output layers compared with Zhou and Xu~\shortcite{zhou2015end}. Marcheggiani, Frolov, Titov~\shortcite{marcheggiani2017simple} also proposed a bidirectional LSTM based model. Without using any syntactic information, their approach achieved the state-of-the-art result on the CoNLL-2009 dataset. + +Our method differs from them significantly. We choose self-attention as the key component in our architecture instead of LSTMs. Like He et al.~\shortcite{he2017deep}, our system take the very original utterances and predicate masks as the inputs without context windows. At the inference stage, we apply argmax decoding approach on top of a simple logistic regression while Zhou and Xu~\shortcite{zhou2015end} chose a CRF approach and He et al.~\shortcite{he2017deep} chose constrained decoding. This approach is much simpler and faster than the previous approaches. + +\paragraph{Self-Attention} Self-attention have been successfully used in several tasks. Cheng, Dong, and Lapata~\shortcite{cheng2016long} used LSTMs and self-attention to facilitate the task of machine reading. Parikh et al.~\shortcite{parikh2016decomposable} utilized self-attention to the task of natural language inference. Lin et al.~\shortcite{lin2017structured} proposed self-attentive sentence embedding and applied them to author profiling, sentiment analysis and textual entailment. Paulus, Xiong, and Socher~\shortcite{paulus2017deep} combined reinforcement learning and self-attention to capture the long distance dependencies nature of abstractive summarization. Vaswani et al.~\shortcite{vaswani2017attention} applied self-attention to neural machine translation and achieved the state-of-the-art results. Very recently, Shen et al.~\shortcite{shen2017disan} applied self-attention to language understanding task and achieved the state-of-the-art on various datasets. Our work follows this line to apply self-attention for learning long distance dependencies. Our experiments also show the effectiveness of self-attention mechanism on the sequence labeling task. +\section{Conclusion} +We proposed a deep attentional neural network for the task of semantic role labeling. We trained our SRL models with a depth of $10$ and evaluated them on the CoNLL-2005 shared task dataset and the CoNLL-2012 shared task dataset. Our experimental results indicate that our models substantially improve SRL performances, leading to the new state-of-the-art. +\section*{Acknowledgements} +This work was done while the first author's internship at Tencent Technology. This work is supported by the Natural Science Foundation of China (Grant No. 61573294, 61303082, 61672440), the Ph.D. Programs Foundation of Ministry of Education of China (Grant No. 20130121110040), the Foundation of the State Language Commission of China (Grant No. WT135-10) and the Natural Science Foundation of Fujian Province (Grant No. 2016J05161). We also thank the anonymous reviews for their valuable suggestions. + + +\bibliography{srl} +\bibliographystyle{aaai} diff --git a/1712.01643v1.txt b/1712.01643v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..91856c0222ee4635ea272bf3d8c6a4295e3af9d9 --- /dev/null +++ b/1712.01643v1.txt @@ -0,0 +1,476 @@ +\section{Introduction} +Recently, representation-based classifiers have attracted increasing attentions +of researchers, which can be roughly divided into two kinds: all-classes-based and single-class-based. In the first kind, the well-known method is sparse representation-based classification (SRC) \cite{SRC2}. It was developed to use the all-class-model to obtain the $L_1$-based sparse representation +for classification . To improve the computation efficiency, the collaborative representation-based classification (CRC) \cite{CRC} was proposed to address the $L_2$ +minimum problem. Later, several improved methods of SRC were proposed for image recognition \cite{RCR,KCSR,KRDU}, such as +manifold constraint transfer (MCT) \cite{MCT} applies a +strategy to produce new data for classification. Different from the all-class-model in SRC, some classifiers use single +class to obtain its representation. For example, linear regression-based +classification (LRC) \cite{LRC} was proposed for face identification, which was based on that samples from a specific object +class are known to lie on a linear subspace \cite{LRLS,PLRC,ILRC}. LRC solves the least square +errors and obtain the linear projection point as the representation for an independent +class-specific models. + +The common objective of existing representation-based methods is to find the best representation for classification. However, they have only obtained a roughly approximated representation. For example, +In ref.\cite{SRC2}, we know that the ideal representation of SRC is to solve the +$L_0$ minimum problem. In LRC, the regression projection is obtained by a matrix's pseudo-inverse. +Therefore, we know that they only obtain the approximated representation. +In order to find a better representation of an image, this paper proposes a +projection representation-based classification (PRC) for image recognition. +To approximate the 'ideal representation' of a sample point, PRC utilizes a +new mathematical model to iteratively compute the projection point of the +test sample towards a line linking a paired of specific points. This +mathematical model has been proved by a theorem. According to +the theorem, we know that the generated projection will be almost equal to +the 'ideal representation' after sufficient iterations. Moreover, the +discriminant PRC (DPRC) is further proposed, which obtains +the discriminant information by maximizing the ratio of the +between-class reconstruction error over the within-class re-construction error. +The main contributions of this paper are as follows: + +\vspace{0.02in} +$\odot$ Firstly, we propose a new mathematical model to obtain the projection of +a point on a hyper-space, and we prove this model mathematically. +\vspace{0.02in} + +$\odot$ Secondly, with the mathematical model, we propose the projection +representation-based classification (PRC) for image recognition tasks. The generated projection by PRC will be almost equal to +the 'ideal representation' after sufficient iterations. +\vspace{0.02in} + +$\odot$ In order to obtain an effective discriminant subspace for PRC, we +propose the discriminant PRC (DPRC). DPRC utilizes the labeled training samples set to constitute a more reliable subspace such that the effective discriminant information can be used for classification. +\vspace{0.02in} + +$\odot$ Experiments have been carried out on several challenging databases. The results show that the proposed PRC and DPRC outperform several state-of-the-art methods. +\\ +\\ +\textbf{Notation Summary}\\ +Let $X=\{x_i^c\in R^{q\times 1},i=1,2,\cdots,N_c,c=1,2,\cdots,M\}$ denote +the prototype data set, where $x_i^c$ is the $i^{\mbox{th}}$ sample of the $c^{\mbox{th}}$ class, $M$ is +the number of classes, $N_c$ is the number of samples of +the $c^{\mbox{th}}$ class and $q$ is the sample's dimension. The number of all the samples is $L=\sum\limits_{c = 1}^M N_c$. The prototype data set can be also described as +$X=\{x_i\in R^{q\times 1},i=1,2,\cdots,L\}$. +\section{Proposed Math Model } +Before introducing the math model, we describe the 'ideal projection' in Definition 1. +\\ +\\ +\textbf{Definition 1:} \emph{Suppose that there exists a test sample $x$ and a specific class $c$. If a point in the +hyper-space of the $\mbox{c}^{\mbox{th}}$ class is the nearest to test sample $x$, it is +treated as the 'ideal representation' or 'ideal projection' of the test sample $x$ on the hyper-space.} +\subsection{Math Model} +Given a point $x$ and a hyper-space $H$, the 'ideal projection' of $x$ on the +hyper-space $H$ may be gained by iteratively computing the projection point of $x$ +on a line of hyper-space $H$ with the proper strategy. It can be describe as +\begin{eqnarray} +p\{x,H\}\approx\underset{k\rightarrow+\infty}{repreat}~~p\{x,\overline{x_i^{c,k}x_{i^*}^{c,k}}\} +\end{eqnarray} +where $p\{*,\bigotimes\}$ denotes the projection of $*$ on $\bigotimes$, $x_i^{c,k}$, $x_{i^*}^{c,k}$ +are two points of the hyper-space $H$. $x_{i^*}^{c,k}$ is the nearest point among all known-distance points of $H$. +\subsection{Correctness of the Math Model} +Now, we know that the proposed model is quite useful for finding the better representation +of each class for classification. Therefore, the correctness of the proposed math model +will be an important problem. The Theorem 1 is provided to prove the proposed math model. +According to the Theorem 1, a projection point with the minimum distance can be obtained by iteratively computing the projection point of $x$ +on hyper-space's a line. Considering Definition 1, we know that the obtained projection point can be treated as +the projection of $x$ on the hyper-space. Therefore, the proposed math model is correct. +\\ +\\ +\textbf{Theorem 1:} \emph{Given a test sample $x$, and a specific class $c$ with $N_c$ training +samples. +Suppose the $\mbox{c}^{th}$ class in the first round of projection is +$X_c^0=[x_1^{c,0}~x_1^{c,0}~\cdots~x_{N_c}^{c,0}]$. Select the nearest training sample +$x_n^{c,0}$ and another training sample $x_i^{c,0}$, $i\neq n$ to form a line +$\overline{x_n^{c,0}x_i^{c,0}}$; Compute the projection point $x_p^{c,0}$ of the +test sample $x$ to the line $\overline{x_n^{c,0}x_i^{c,0}}$; and use $x_p^{c,0}$ to +replace $x_i^{c,0}$, $i\neq n$ as the new training set of the $c^{th}$ class. If +this projection operation was performed in sufficient times, the distance between the +test sample and new projection point closely approximates to a fixed constant, +which is the smallest distance between the test sample $x$ and the space of the $c^{th}$ class.} +\\ +\\ +\textbf{Proof:} Because $x_p^{c,0}$ is the projection of the test sample $x$ to the line +$\overline{x_n^{c,0}x_i^{c,0}}$, then +\begin{eqnarray} +\|x-x_p^{c,0}\|\leq\|x-x_n^{c,0}\|. +\end{eqnarray} +After the first projection procedure, $x_p^{c,0}$ replaces $x_n^{c,0}$ as the +new nearest sample and will be used to form the new line. Following this manner, +in the $k^{th}$ projection procedure, we have +\begin{eqnarray} +\|x-x_p^{c,k}\|\leq \|x-x_p^{c,k-1}\| +\end{eqnarray} +Because the distance between the test sample $x$ and the projection point is equal +or greater than 0, the projection points satisfy the following conditions. +\begin{eqnarray} +0\leq\|x-x_p^{c,k}\|\leq\|x-x_p^{c,k-1}\|,~k=1,2,\cdots,+\infty +\end{eqnarray} +That is, +\begin{eqnarray} +\lim\limits_{k\rightarrow+\infty}\|x-x_p^{c,k}\|=d +\end{eqnarray} +where $d$ is a constant that is the smallest distance between the test sample $x$ +and the subspace of the $c^{th}$ class. +\subsection{Proposed Math Model vs Linear Regression} +For a specific class subspace,the real projection point cannot be computed using the existing math knowledge because the class subspace is a hyper-space. + Ref. \cite{LRC} proposed LRC to solve the least square errors and obtain the linear projection point. LRC has the good performance. However, LRC obtains the linear projection point by a pseudo-inverse operation such that this point is only a roughly approximated projection point (exist the closer +point than the linear projection point), not the ideal projection point according to Definition 1. Therefore, +we intend to obtain a better projection point that is the nearest one to the 'ideal projection' point +by using the proposed math model. +\section{Proposed PRC} +Based on the concept of finding the best representation of each class, this +section proposes a new classifier, called projection representation-based +classification (PRC). +According to the proposed math model, PRC may obtain the approximated projection +point by computing the projection point of the test sample to a line linking with a +pair of training samples iteratively. The flowchart of PRC is shown in Figure \ref{fig_flowchart}. + + +\begin{figure}[t] +\begin{center} +\includegraphics[width=0.75\linewidth]{flowchart.eps} +\end{center} +\vspace{-0.1in} + \caption{The flowchart of the proposed PRC. $'e=0'$ means that PRC satisfies the stop condition. The detailed information of $e$ can be found in the stop condition.} +\label{fig_flowchart} +\end{figure} +\subsection{Projection Representation} +To find a point extremely close to the ‘ideal representation’ +of a sample point, PRC iteratively computes the projection point of the test +sample on a line. The final result will be treated as the projection representation for classification. +\subsubsection{Start the iteration} +For the first iteration, suppose that a class model $X_c^0$ is described as follows +\begin{eqnarray} +X_c^0=[x_1^{c,0}~~x_2^{c,0}~~\cdots~~x_{N_c}^{c,0}]\in R^{q\times N_c}, +\end{eqnarray} +where $x_i^{c,0}=x_i^c$, $i=1,2,\cdots,N_c$. We then select the nearest point $x_{i^*}^{c,0}$ from the class model $X_c^0$ as follow. +\begin{eqnarray} +i^*=\arg\min(\|x-x_i^{c,0}\|),~~i=1,2,\cdots,N_c +\end{eqnarray} +Use the nearest point $x_{i^*}^{c,0}$ and a training sample $x_i^{c,0}$, $i\neq i^*$ +to form a line $\overline{x_{i^*}^{c,0}x_i^{c,0}}$. Next, the projection point of the test +sample $x$ on the line $\overline{x_{i^*}^{c,0}x_i^{c,0}}$ can be computed by: + +\begin{eqnarray} +p_{i^*}^{c,0}=x_{i^*}^{c,0}+t^0(x_i^{c,0}-x_{i^*}^{c,0}) +\end{eqnarray} +where $t\in R$ is the position parameter. The vector $\overline{xp_{i^*}^{c,0}}$ +is orthogonal to $\overline{x_{i^*}^{c,0}x_i^{c,0}}$, that is, +$(x-p_{i^*}^{c,0})(x_i^{c,0}-x_{i^*}^{c,0})=0$ where ‘$\bullet$’ denotes the +dot product. Therefore, the position parameter can be computed as +\begin{eqnarray} +t^0=\frac{(x-x_{i^*}^{c,0})^T(x_i^{c,0}-x_{i^*}^{c,0})}{(x_i^{c,0}-x_{i^*}^{c,0})^T(x_i^{c,0}-x_{i^*}^{c,0})} +\end{eqnarray} + + +\begin{figure}[t] +\begin{center} +\includegraphics[width=1.0\linewidth]{converge_2.eps} +\end{center} +\vspace{-0.1in} + \caption{An example of convergence analysis: The distance’s variations between the test sample and approximation projection point in the iteration procedure.} +\label{fig_converge} +\end{figure} + + +For the $(k+1)$th ($k\geq1$) iteration, it is easy to know that the projection point +$p_{i^*}^{c,k-1}$ in the $k^{th}$ iteration is nearest point. That is, $x_{i^*}^{c,k}=p_{i^*}^{c,k-1}$. The projection point +$p_{i^*}^{c,k}$ in the $(k+1)^{th}$ iteration will be computed by $x$ and a line constituted +by $p_{i^*}^{c,k-1}$ and another train sample. The procedure of computing the +projection point of $x$ on a line is similar to the first iteration. +\vspace{+0.1in} +\\ +\textit{Rule:} All the projection procedure is similar. However, they need to satisfy the +following rule. The number of samples from the class subspace is fixed. The new +projection points will replace the farther point of the line because they are closer to the test sample. All +the samples of class subspace will be sequentially used to constitute the line (as farther point of the line) so that the projection point may contain the information +of all the training samples. +\subsubsection{Convergence Analysis and Stop Condition} +Because the number of iterations is unlimited, we need to determine the condition +for stopping the iteration processes. In order to obtain a good parameter for ending +of the process, an example is given as follows. The training set and test sample are +produced randomly, the dimension of each sample is 5000, and the number of training +samples is 20. Fig. \ref{fig_converge} shows that the distance between the test sample and the +projection point changes with the number of iterations. As can be seen, the +difference between two adjacent distances tends to zeros. Thus, the stop conditions +of the iteration process are described as follows.\vspace{+0.1in} + + \textit{Condition 1:} Suppose that $p_{i^*}^{c,k-1}$ and $p_{i^*}^{c,k}$ are two nearest +projection points in the $k$th and $(k+1)$th iterations. If $\delta<\delta_0$, the iteration +process stops, where $\delta_0$ is given before the iteration and the threshold +value $\delta$ can be computed as +\begin{eqnarray} +\delta=abs\left(\frac{\|x-p_{i^*}^{c,k-1}\|-\|x-p_{i^*}^{c,k}\|}{\|x-p_{i^*}^{c,k-1}\|+\|x-p_{i^*}^{c,k}\|} \right). +\end{eqnarray} +Besides, in order to avoid the unpredicted situation, another condition is described as follows.\vspace{+0.1in} +\\ +\textit{Condition 2:} Set the maximum iterative times $J$. Based on the Figure \ref{fig_converge}, we +suggest that $J$ is set no more than 100. Notice that this condition is rarely used. It can be treated as an insurance. +\vspace{+0.1in} +\\ +Set a stop parameter $e=1$, if one of the two stop conditions is satisfied, $e=0$, the iteration stops. Then the projection representation $p^c$ can be described as +\begin{eqnarray}\label{eq_pr} +p^c=p_{i^*}^{c,k}=x_{i^*}^{c,k}+t^k(x_i^{c,k}-x_{i^*}^{c,k}) +\end{eqnarray} +where +\begin{eqnarray} +t^k=\frac{(x-x_{i^*}^{c,k})^T(x_i^{c,k}-x_{i^*}^{c,k})}{(x_i^{c,k}-x_{i^*}^{c,k})^T(x_i^{c,k}-x_{i^*}^{c,k})} +\end{eqnarray} +\\ +Notice: For the example of convergence analysis in Figure \ref{fig_converge}, we repeat the experiment +more than one hundred times. The tendency of the distance variations is similar. Select only some valuable samples that is helpful for classification. +\subsubsection{Classification} +Using the Algorithm 1, the approximation projection $p^c$ is obtained for the $c^{th}$ class subspace. The distance between the test sample and the $c^{th}$ class subspace can be computed as +\begin{eqnarray} +d_c(x)=\|x-p^c\|. +\end{eqnarray} +PRC selects the class with the minimum distance +\begin{eqnarray} +\min \limits_{c^*}~d_c(x), c=1,2,\cdots,M. +\end{eqnarray} + + +\begin{algorithm} [t] +\small +\vspace{0.0in} \caption{Projection Representation} +\begin{description} + \item[Inputs] The entire training samples $x_i^c$, $c=1,2,\cdots,M$, $i=1,2,\cdots,N_c$ and a test image vector $x\in R^{q\times 1}$. The stop parameter $\delta_0$ and $J$. + \item[Output] The projection representation $p^c$. +\end{description} +\begin{enumerate} + \item Set $e=1$; $J=100$; ${\delta _0} = 0.01$ + + \textbf{Repeat} + + \item Find the nearest point $x_n^{c,k}$ from the class-models $X_c^k$ + \item Compute the projection point $p_{i*}^{c,k}$ of the test sample $x$ on the line $\overline{x_{i^*}^{c,k}x_i^{c,k}}$ ($i=1,2,\cdots,N_c$ and $i\neq i^*$) as \vspace{-0.05in} + \begin{eqnarray*} + \left\{{\begin{array}{*{20}{c}}{p_{i*}^{c,k} = x_{i*}^{c,k} + t^k(x_i^{c,k} - x_{{\rm{i*}}}^{c,k})}\\ +{t = \frac{{{{(x - x_{i*}^{c,k})}^T}(x_i^{c,k} - x_{i*}^{c,k})}}{{{{(x_i^{c,k} - x_{i*}^{c,k})}^T}(x_i^{c,k} - x_{i*}^{c,k})}}} +\end{array}} \right. + \end{eqnarray*}\vspace{-0.15in} + \item Update the class-models $X_c^k$ using the $p_{i^*}^{c,k}$ to replace the farther point $x_{i}^{c,k}$ of line $\overline{x_{i^*}^{c,k}x_i^{c,k}}$ as $X_c^{k+1}$ + \item Update the parameters $\delta$ by using the projection point $p_{i^*}^{c,k-1}$ in the last iteration and $p_{i^*}^{c,k}$ in this iteration as \vspace{-0.05in} + \begin{eqnarray*} + \delta=abs\left(\frac{\|x-p_{i^*}^{c,k-1}\|-\|x-p_{i^*}^{c,k}\|}{\|x-p_{i^*}^{c,k-1}\|+\|x-p_{i^*}^{c,k}\|}\right) + \end{eqnarray*}\vspace{-0.15in} + \item Update the parameter $J=J-1$. + \item Update the $e$ as\\ + ~~~~~~~~If ($\delta<\delta_0\|J<0$)\\ + ~~~~~~~~~~~~~~~~$e=0$; break;\\ + ~~~~~~~~end if \\ + \textbf{Until the $e=0$ and output the $p^c=p_{i*}^{c,k}$} +\end{enumerate} +\end{algorithm} +\subsection{Computational Complex} +Suppose the dimensional of each sample is $q$, it is easy to know that the computational cost of each projection operation is $O(q)$. +Therefore, the computational complex of PRC is $O(Kq)$ , $K$ is the number of projection operations. From the Figure \ref{fig_converge}, + we know that the iteration number is not large, that is to say, the computational cost of PRC is small. +\section{Proposed DPRC} +PRC obtains the 'ideal projection' while it doesn't use discriminant analysis for classification. Thus, this section pay attention to utilize the labeled training samples set to constitute a more reliable subspace such that the effective discriminant information can be used for classification. In order to obtain an effective discriminant subspace for PRC, we propose a novel method, called discriminant PRC (DPRC), which obtains the discriminant information by maximizing the ratio of the between-class reconstruction error over the within-class reconstruction error by the PRC. +\subsection{Optimization of DPRC} +The proposed DPRC approach is formulated as the optimization problem to maximize the objective function as, +\begin{eqnarray} +\mathop{\max }\limits_P J(P) = \mathop{\max }\limits_P \frac{{{J_b}}}{{{J_w}}} +\end{eqnarray} +where $P$ is the optimal projection matrix that we want to estimate, $J_b$ and $J_w$ denote the between-class and within-class reconstruction representative metrics, respectively. Then, the goal of the DPRC approach becomes to find an optimal mapping matrix, ${P^{}} = [{p_1},...,{p_k},...,{p_d}]$ which could project the original sample $x_i$ to a new data sample as ${w_i} = {P^T}{x_i}$ for $i = 1, 2... L$. The proposed projection reduces the dimension and is effective for classification. The above objective function can be also expressed as +\begin{equation} +\begin{split} +J(P) =& \frac{{{J_b}}}{{{J_w}}}\\ + =& \frac{{\frac{1}{{L(M - 1)}}\sum\limits_{i = 1}^L {\sum\limits_{j = 1,j \ne l({x_i})}^M {||{w_i} - w_{ij}^b||} } }}{{\frac{1}{L}\sum\limits_{i = 1}^L {||{w_i} - w_i^w||} }}\\ + =& \frac{{\frac{1}{{L(M - 1)}}\sum\limits_{i = 1}^L {\sum\limits_{j = 1,j \ne l({x_i})}^M {||{P^T}{x_i} - {P^T}x_{ij}^b||} } }}{{\frac{1}{L}\sum\limits_{i = 1}^L {||{P^T}{x_i} - {P^T}x_i^w||} }} +\end{split} +\end{equation} +where $w_{ij}^b = {P^T}x_{ij}^b$ , $w_{ij}^w = {P^T}x_{i}^w$, $x_{ij}^b$ and $x_{i}^w$ are the between-class and within-class projection vectors. That is, they are projection representation of $x_i$ on $X_j^b$ and $X_i^w$, respectively. They can be calculated by Algorithm 1 with the $x_i$, $X_i^w$ and $X_j^b$. $X_i^w$ denotes the $l(x_i)$-th class-model in (1) (don't include the sample $x_i$), $l(x_i)$ denotes the class label of $x_i$ , $X_j^b$ denotes the $j$-th ($j \ne l({x_i})$ ) class-model, With some algebraic derivations in matrices, we have +\begin{equation} +\begin{split} +J(P) =& \frac{{\frac{1}{L}\sum\limits_{i = 1}^L {\sum\limits_{j = 1,j \ne l({x_i})}^M {tr[{P^T}({x_i} - x_{ij}^b){{({x_i} - x_{ij}^b)}^T}P]} } }}{{\frac{1}{L}\sum\limits_{i = 1}^L {tr[{P^T}({x_i} - x_i^w){{({x_i} - x_i^w)}^T}P]} }}\\ + =& tr(\frac{{{P^T}{J_b}P}}{{{P^T}{J_w}P}}) +\end{split} +\end{equation} +where +\begin{equation}{J_b} = \frac{1}{L}\sum\limits_{i = 1}^L {\sum\limits_{j = 1,j \ne l({x_i})}^M {({x_i} - x_{ij}^b){{({x_i} - x_{ij}^b)}^T}} } +\end{equation} +and +\begin{equation}{J_w} = \frac{1}{L}\sum\limits_{i = 1}^L {({x_i} - x_i^w){{({x_i} - x_i^w)}^T}} +\end{equation} +Afterwards, the objective function can be expressed as +\begin{equation} +\begin{array}{l} +\mathop{\arg \max }\limits_P \frac{{{P^T}{J_b}{P^{}}}}{{{P^T}{J_w}{P^{}}}}\\ +\begin{array}{*{20}{c}}{s.t.}&{{P^T}P = I} +\end{array} +\end{array} +\end{equation} +In order to address the typical small sample size problem, the term $\varepsilon I$ is increased without affecting the subspace. Thus, the objective function can be rewritten as +\begin{equation} +\begin{array}{l} +\mathop{\arg \max }\limits_P \frac{{{P^T}{J_b}{P^{}}}}{{{P^T}({J_w} + \varepsilon I){P^{}}}}\\ +\begin{array}{*{20}{c}}{s.t.}&{{P^T}P = I} +\end{array} +\end{array} +\end{equation} +where $\varepsilon$ is a small number and $I$ is an identity matrix. By using Lagrange multiplier, the projection matrix ${P^{}} = [{p_1},...,{p_k},...,{p_d}]$ that maximizes the objective function, which can be gained by solving the eigen decomposition problem of $\frac{{{J_b}}}{{{J_w} + \varepsilon I}}$ as +\begin{equation} +\begin{array}{*{20}{c}}{{J_b}{p_k} = {\lambda _k}({J_w} + \varepsilon I){p_k}}&{,k = 1,2,...,d} +\end{array} +\end{equation} +where ${\lambda _1} \ge ... \ge{\lambda _k} \ge ... \ge{\lambda _d}$ is $d$ largest eigenvalues and their corresponding eigenvectors, ${p_1},...,{p_k},...,{p_d}$ of $\frac{{{J_b}}}{{{J_w}}}$. It is noted that ${P^{}} = [{p_1},...,{p_k},...,{p_d}]$ is a $q\times d$ projection matrix, which can project the original $q$-element data vector to the new $d$-element data vector as ${w_i} = {P^T}{x_i}$ for $i = 1, 2... L$. +\subsection{Classification} +In the above Section, DPRC obtains the effective discriminant space $W=\{w_i\in R^{d\times 1},i=1,2,\cdots,L\}$. Using the discriminant space $W$ and Algorithm 1, the approximation projection $p^c$ is obtained for the $c^{th}$ class subspace. The distance between the test sample and the $c^{th}$ class subspace can be computed as +\begin{eqnarray} +d_c(w)=\|w-p^c\|. +\end{eqnarray} +DPRC selects the class with the minimum distance +\begin{eqnarray} +\min \limits_{c^*}~d_c(w), c=1,2,\cdots,M. +\end{eqnarray} +where ${w} = {P^T}{x}$. +\subsection{DPRC vs ULDA } +This section compares DPRC with a discriminant-based method: Uncertain LDA (ULDA) \cite{UncLDA}. To better explain it, their similarity and difference are given as follows. +\begin{itemize} + \item Similarity: They both maximize the following objective function $\mathop{\max }\limits_P J(P) = \mathop{\max }\limits_P \frac{{{J_b}}}{{{J_w}}}$, where $J_b, J_w$ are the within-class and between-class scatters. This objective function is the same to that in LDA \cite{LDA}. + \item Difference: In ULDA, $J_b=S_b+U_b, J_w=S_w+U_w$, where $S_b, S_w$ are the within-class and between-class scatters in LDA. ULDA proposes the uncertain within-class and between-class scatters $U_b, U_w$. In DPRC, the $J_b, J_w$ can be treated as new projection-based within-class and between-class scatters, which has significantly difference to $S_b, S_w$ and $U_b, U_w$. +\end{itemize} +\section{Experimental Results} +This section evaluate the proposed PRC and DPRC on several vision recognition databases. +\subsection{Face recognition} +LFW-a database \cite{LFW} is used in this experiment. +Following \cite{MCT}, we apply 158 subjects that have no less than ten samples for evaluation. The experiment set: +5 samples are randomly selected to form the training set, while other 2 samples are exploited for testing. +The SRC \cite{SRC2}, SVM \cite{SVM}, FDDL \cite{FDDL}, MCT \cite{MCT}, RCR \cite{RCR}, ULDA \cite{UncLDA}, ProCRC \cite{ProCRC} and CRC \cite{CRC} algorithms are chosen for comparison. +Table \ref{t_lfw} illustrates the comparison results of all methods. DPRC obtains better performance than PRC. Compared to the exsiting methods, DPRC has more than 3\% improvement.. + +\begin{table} [htp] +\caption{The recognition rate (RR) of several classifiers on LFW face database} \label{t_lfw} +\begin{center} +\begin{tabular}{|l|c|l|c|} +\hline +Classifier & Accuracy & Classifier & Accuracy (\%) \\ +\hline\hline +SRC & 44.10 & CRC & 44.30 \\ +SVM & 43.30 & ULDA & 44.30 \\ +FDDL & 42.00 & ProCRC & 44.90 \\ +MCT & 44.90 & \bf PRC & \bf 46.84 \\ +RCR & 36.70 & \bf DPRC & \bf 47.90 \\ +\hline +\end{tabular} +\end{center} +\end{table} +\subsection{Scene classification} +The well-known 15 scene database contains 4,485 images of 15 scene categories \cite{KSPM}. Each image is transformed to spatial pyramid feature provided by \cite{LC-KSVD}. + The following experimental protocol is used \cite{LLKNNC}: 100 images per class are randomly chosen for training and the rest images are used for testing. + The D-KSVD \cite{D-KSVD}, LLC \cite{LLC}, LC-KSVD \cite{LC-KSVD}, ULDA \cite{UncLDA}, + LLNMC \cite{LLKNNC}, LLKNNC \cite{LLKNNC}, LRC \cite{LRC}, CRC \cite{CRC}, SRC \cite{SRC2}, ProCRC \cite{ProCRC}, DADL \cite{DADL} methods are chosen for comparison. + The average classification rate of 10 runs is used to evaluate all methods. From the results in Table \ref{t_15scenes}, our proposed PRC and DPRC obtain the best performance compared with other methods. + +\begin{table} [htp] +\begin{center} +\begin{tabular}{|l|c|l|c|} +\hline +Classifier & Accuracy & Classifier & Accuracy (\%) \\ +\hline\hline +LRC & 95.51 & CRC & 95.95 \\ +LLC & 80.57 & SSRC & 96.45 \\ +D-KSVD & 89.10 & SRC & 96.53\\ +LC-KSVD & 90.40 & ProCRC & 96.54 \\ +ULDA & 97.70 & DADL & 98.30 \\ +LLKNNC & 93.54 & \bf PRC & \bf 98.47 \\ +LLNMC & 97.45 & \bf DPRC & \bf 98.70 \\ +\hline +\end{tabular} +\end{center} +\vspace{-0.1in} +\caption{The recognition rate (RR) of several classifiers on the 15 scenes database.}\label{t_15scenes} +\end{table} +\subsection{Object Classification} +The Caltech101 dataset \cite{Caltech101} has 9,144 images with 102 classes. Following the common experimental settings, we train on 5 samples per class and the rest images are + used as the testing set. In the experiment, we utilize the 3000-dimension spatial pyramid feature provided by \cite{LC-KSVD} to represent the object image. + The DNNC \cite{DNNC}, SVM \cite{SVM}, FDDL \cite{FDDL}, D-KSVD \cite{D-KSVD}, + LRC \cite{LRC}, CRC \cite{CRC}, SRC \cite{SRC2}, SSRC \cite{SSRC}, ProCRC \cite{ProCRC} and ULDA \cite{UncLDA} methods are chosen for comparison. + The experiment results are shown in Table \ref{t_calt101}. + As can be observed, DPRC gains the best performance compared several popular methods. + +\begin{table} [htp] +\begin{center} +\begin{tabular}{|l|c|l|c|} +\hline +Classifier & Accuracy & Classifier & Accuracy(\%) \\ +\hline\hline +DNNC & 46.60 & SVM & 47.88 \\ +SRC & 48.80 & SSRC & 47.10 \\ +FDDL & 49.80 & ULDA & 48.54 \\ +D-KSVD & 49.60 & ProCRC & 47.80 \\ +CRC & 44.68 & \bf PRC & \bf 50.66 \\ +LRC & 47.54 & \bf DPRC & \bf 50.80 \\ +\hline +\end{tabular} +\end{center} +\vspace{-0.1in} +\caption{The recognition rate (RR) of several classifiers on the Caltech 101 database.}\label{t_calt101} +\end{table} +\subsection{Action Recognition} +The Ucf50 action dataset \cite{UCF50} has 6,680 action videos with 50 action categories, which was taken from YouTube. For fair comparison, we follow the ref. \cite{DADL}: +Divide the database into five folds, use four folds for training and one fold for testing. +We use PCA \cite{RPCA-AOM} to reduce the action bank features \cite{actionbank} to 5000 dimensions. + The CRC \cite{CRC}, SRC \cite{SRC2}, DLSI \cite{DLSI}, ULDA \cite{UncLDA}, SSRC \cite{SSRC} , FDDL \cite{FDDL}, LC-KSVD \cite{LC-KSVD}, DPL \cite{DPL}, ProCRC \cite{ProCRC} and DADL \cite{DADL} methods are chosen for comparison. + The experiment results are shown in Table \ref{t_ucf50}. + DPRC has the better performance than PRC and gains the best performance compared with several popular methods. + + \begin{table} [htp] +\begin{center} +\begin{tabular}{|l|c|l|c|} +\hline +Classifier & Accuracy & Classifier & Accuracy(\%) \\ +\hline\hline +CRC & 75.60 & DPL & 77.40 \\ +SSRC & 76.40 & ULDA & 77.60 \\ +SRC & 75.00 & ProCRC & 77.40 \\ +DLSI & 75.40 & DADL & 78.00 \\ +FDDL & 76.50 & \bf PRC & \bf 78.50 \\ +LC-KSVD & 70.10 & \bf DPRC & \bf 79.10 \\ +\hline +\end{tabular} +\end{center} +\vspace{-0.1in} +\caption{The recognition rate (RR) of several classifiers on the Ucf50 action database.}\label{t_ucf50} +\end{table} +\subsection{Compare with Deep Learning based Methods} +The Caltech-256 dataset \cite{Caltech256} has 30,608 object images of 256 object class, each class has at least 80 object images. To access the performance of PRC and DPRC for object recognition with the deep-learning-based feature, we follow Ref. \cite{NAC}, randomly select 60 images for training, the rest images are used for testing. Five deep learning based methods are used for comparison. They include NAC \cite{NAC}, CNN-S \cite{CNN-M}, ZF \cite{ZF}, CNN-M \cite{CNN-M} and VGG19 \cite{VGG19}. + The experiment results are shown in Table \ref{t_caltech256}. As we can see, the proposed methods with deep feature obtain the better performance than the deep learning based methods. The proposed DPRC has the better performance compared to proposed PRC. + + \begin{table} [h] +\begin{center} +\begin{tabular}{|l|c|} +\hline +Classification Methods & Accuracy (\%)\\ +\hline\hline +CNN-S & 77.6 \\ +ZF & 74.2 \\ +CNN-M & 75.5 \\ +VGG19+ SVM & 83.9 \\ +NAC & 84.1 \\ +\hline +\bf VGG19+PRC & \bf 84.9 \\ +\bf VGG19+DPRC & \bf 85.3 \\ +\hline +\end{tabular} +\end{center} +\vspace{-0.1in} +\caption{Accuracy of several methods on the Caltech 256 object database.}\label{t_caltech256} +\end{table} +\section{Conclusion} +In this paper, projection representation-based classification (PRC) has been proposed for image recognition. +The PRC uses the iteratively projection procedures to obtain a point to closely approximate the 'ideal representation'. +The objectives of PRC, SRC and LRC are similar but PRC gains the better representation. Based on PRC, the discriminant PRC (DPRC) is further proposed. +DPRC increase the discriminant information for PRC such that it obtains the better performance. +The experimental results on several well-known databases have confirmed the good performance of the proposed PRC and DPRC for face, +objection, scene and action recognitions. Moreover, PRC and DPRC with deep-learning-based feature can obtain the better performance than deep learning based methods +\\ +\section{Acknowledgments} +Thanks for the valuable suggestions of Editor and reviewers. +This work was supported in part by the Macau Science and Technology Development Fund under Grant FDCT/016/2015/A1 and by the Research Committee at University of Macau under Grants MYRG2014-00003-FST and MYRG2016-00123-FST. + + +\bibliography{egbib} +\bibliographystyle{aaai} diff --git a/1712.01651v1.txt b/1712.01651v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..66740ad86ba49995399a3419dc7a80c2fe480b86 --- /dev/null +++ b/1712.01651v1.txt @@ -0,0 +1,237 @@ +\section{Introduction} +The goal of 2D/3D medical image registration is to find the 6 Degree of Freedom (DoF) pose of a 3D volume (e.g. Computed Tomography (CT), Mangnetic Resonance Imaging (MRI) etc), to align its projections with given 2D X-ray images. Reliable 2D/3D registration is a key enabler for image-guided surgeries in modern operating rooms. It brings measurement and plannings done on the pre-operative data into the operating room, and fuse it with intra-operative live 2D X-ray images. It can be used to provide augmented reality image guidance for the surgery, or provide navigation for robotic surgery. Despite that 2D/3D registration has been actively researched for decades~\cite{markelj2012review}, it remains a very challenging and unsolved problem, especially in the complex environment of hybrid operating rooms. + \blfootnote{\textbf{Disclaimer}: This feature is based on research, and is not commercially available. Due to regulatory reasons its future availability cannot be guaranteed.} + + \begin{figure*} + \centering + \includegraphics[width=\linewidth]{example_images.png} + \caption{Example X-ray images (top row) and corresponding Digitally Reconstructed Radiographs (DRRs) (bottom row). The first four X-ray images are clinical data from spine surgery, which contain various highly opaque metal objects and have very different Field-of-Views (FoVs). The last three X-ray images are from CBCT data, which have a relatively low SNR due to a very small dynamic range.} + \label{fig:example_images} + \end{figure*} + + A Markov Decision Process (MDP) formulation for 3D/3D image registration was recently introduced and resulted in a significant robustness improvement~\cite{liao2017artificial}. The original formulation however has three major limitations that make it ineffective for 2D/3D registration in a clinical setup. First, it requires the rough location and size of the target object to be registered as a prior, in order to extract a local region around the target as the agent's observation. However, in 2D/3D registration, the location and size of the target object can vary significantly in 2D X-ray images, due to variations in C-arm geometry and imaging protocols such as collimation factors. Second, there could be various artifacts / interference coming from medical devices in 2D X-ray images and simulation of all of them in the training samples is not practical. Therefore an auto attention mechanism is needed in order to be able to inherently detect the regions with more reliable visual cues to drive registration, and this mechanism is not provided in ~\cite{liao2017artificial}. Third, training data need to be sampled extensively from the registration environment with a high DoF (i.e., environmental DoFs include location of agent's observation and pose of the 3D volume), which is associated with an high computational cost. In fact, five million samples are needed as reported in~\cite{liao2017artificial}, even after using location prior knowledge to reduce the DoF by 3. Since data sampling grows exponentially with the DoF, without the location prior knowledge, computational cost would be prohibitively high for our 2D/3D registration problem. + + In this paper, we propose a multi-agent system with an auto attention mechanism to address the above three limitations of agent-based registration, and apply it to a challenging 2D/3D registration application for minimally invasive spine surgery. In particular, multiple agents are employed to observe multiple regions of the image, and the system adaptively favors proposals from regions with more distinct visual cues for registration. We furthermore propose a policy network architecture with separate encoding of the fixed and moving images, and a dilated Fully Convolutional Network (FCN) based training strategy to train all observation regions in each back propagation. This strategy significantly reduces the DoFs of the registration environment, and as a result training efficiency is improved by an order of magnitude compared to standard CNN-based training method. The proposed FCN structure also naturally supports our multi-agent system in the application phase for efficient 2D/3D registration. We demonstrate that when there are severe image artifacts and occlusions, e.g. due to metal screws and guide wires, the proposed method significantly outperforms single agent-based method and other state-of-the-art optimization-based methods by reducing the gross failure rate (GRF) by 10 fold. +\section{Related Work} + +\subsection{Optimization-based 2D/3D Registration} +The most widely adopted formulation for 2D/3D registration is to solve it as an optimization problem to minimize a cost function that quantifies the quality of alignment between the images being registered~\cite{markelj2012review}\cite{gendrin2012monitoring}\cite{schmid2014segmentation}\cite{miao2011hybrid}. The success of these approaches depends on the global optimization of the cost function. Existing image-based cost functions are mostly based on low level metrics, e.g., Mutual Information (MI)~\cite{maes1997multimodality}, Cross Correlation (CC)~\cite{knaan2003effective}, Gradient Correlation (GC)~\cite{de20163d} and etc. These metrics compare images directly at the pixel level without understanding the higher level structures in the image. + As a result, on images with a low signal-to-noise ratio (SNR) and/or severe image artifacts like examples shown in \refFig{fig:example_images}, they often have numerous local minima, which makes it extremely challenging to locate the global solution using mathematical optimization strategy, e.g. Powell's method, Nelder-Mead, BFGS, CMA-ES. + Although there are global optimization methods, e.g., simulated annealing \cite{van1987simulated} and genetic algorithm \cite{deb2002fast}, they require comprehensive sampling of the parameter space, which leads to a prohibitively high computational cost. Few attempts have been made to seek heuristic semi-global optimization to seek a proper balance between robustness and computational cost~\cite{uneri2017intraoperative}\cite{lau2006global}. +\subsection{Learning-based Image Registration} +Several attempts have been made recently to tackle 2D/3D registration problems using learning-based approaches. Hand crafted features and simple regression modules like Multi-Layer Perceptron and linear regression were proposed to regress 2D/3D registration parameters~\cite{gouveia2015registration}~\cite{chou20132d}. A CNN-based regression approach was introduced in~\cite{miao2016cnn} to solve 2D/3D registration for 6 DoF device pose estimation from X-ray images, and later on a domain adaptation scheme was proposed ~\cite{zheng2017learning} to improve the performance generalization of the CNN model on unseen real data. In~\cite{wohlhart2015learning}, a range image descriptor was learned via CNN to differentiate 3D pose of the object, and was used for 6 DoF pose estimation. {While the CNN-based methods improve robustness of 2D/3D registration, they are limited to registering only highly opaque objects with a fixed shape described by a CAD model (e.g., rigid metal devices), because they aimed at explicitly modeling the appearance-pose relationship. Therefore, it cannot solve 2D/3D registration of anatomical structures with varying shapes across patients.} + + Learning-based approaches have also been explored for 2D/2D and 3D/3D image registration, where the goal is to find the spatial transformation to align images of the same dimension. Unsupervised learning using CNN was proposed in \cite{wu2006learning} to extract features for deformable registration. These features however were extracted separately from the image pairs and therefore may not be optimal for registration purpose. Optical flow estimation between 2D RGB images has been proposed using CNN via supervised learning in \cite{weinzaepfel2013deepflow}\cite{dosovitskiy2015flownet}\cite{ilg2016flownet}. A learnable module, called spatial transformer network (STN), was introduced in \cite{jaderberg2015spatial}. The focus of STN was not an accurate alignment of two images, but a rough transformation of a single input image to a canonical form. In a recent work, rigid-body 3D/3D image registration is formulated as a MDP and a policy network is trained to perform image registration~\cite{liao2017artificial}. Motivated by this work, we design a 2D/3D registration system by utilizing multiple agents coupled with an auto attention mechanism for high robustness, and train the agent using dilated FCN-based strategy for high efficiency. +\section{Background} + +\subsection{2D/3D Registration} +Given a 3D CT volume $J: \mathbb{R}^3 \to \mathbb{R}$, a projection image can be calculated following the X-ray imaging model~\cite{bushberg2011essential}: + \begin{equation} + H_T(\boldsymbol{p}) = \int{J \Big( T^{-1} \circ{\boldsymbol{L}(\boldsymbol{p},r)} \Big) dr}, + \label{eqn:xray3} + \end{equation} + where $I(\boldsymbol{p})$ is the intensity of the synthetic X-ray image at point $\boldsymbol{p}$, ${\boldsymbol{L}(\boldsymbol{p},r)}$ is the line connecting the X-ray source and the point $\boldsymbol{p}$, parameterized by $r$, and $T: \mathbb{R}^3 \to \mathbb{R}^3$ is the geometric transformation of the 3D volume. Such projection image is referred to as DRR, and can be computed using the Ray-Casting algorithm~\cite{kruger2003acceleration}. + + In 2D/3D registration problems, a 3D volume $J(\cdot)$, a 2D X-ray image $I(\cdot)$ and the camera model of the X-ray images $\boldsymbol{L}(\cdot)$ are given. The goal is to find the transformation $T$ that aligns the projection of the 3D volume $H_T(\cdot)$ with the X-ray image $I(\cdot)$. Due to the ambiguity in matching a 3D volume with a single projected 2D image, multiple X-ray images from different projection angles are often employed in 2D/3D registration. In such cases, the goal is to find the transformation $T$ that aligns all DRR and X-ray image pairs, denoted as $H_{i,T}(\cdot)$ and $I_i$, where $i$ denotes the index of the X-ray image. +\subsection{Special Euclidean Group SE(3)} +Special Euclidean group SE(3) is the set of $4\times4$ matrices corresponding to translations and rotations. The tangent space of SE(3) is described using the Lie algebra se(3), which has six generators corresponding to the derivatives of translation and rotation along/around each of the standard axes. An element of se(3) is then represented by multiples of the generators + \begin{align} + \boldsymbol{\delta} & = (\boldsymbol{u}, \boldsymbol{v}) \in \mathbb{R}^6 + \label{eqn:se3_params} \\ + \boldsymbol{\delta}_{\times} & = u_1 G_1 + u_2 G_2 + u_3 G_3 + \nonumber \\ + & v_1 G_4 + v_2 G_5 + v_3 G_6 \in \text{se}(3), + \end{align} + where $(G_1,G_2,G_3)$ are the translation generators, and $(G_4, G_5, G_6)$ are the rotation generators. Matrix exponential and logarithm can be taken to convert elements between SE(3) and se(3). +\section{Proposed Method} +\begin{figure} + \centering + \includegraphics[width=\linewidth]{system_overview.png} + \caption{Policy network with encoder CNN and decoder neural network (NN). An ROI centered on the projection of the agent's location is extracted from the X-ray image and DRR. The extracted regions are encoded using CNN to obtain feature vectors, which are concatenated and decoded by a NN to obtain reward estimation.} + \label{fig:system_overview} + \end{figure} +\subsection{Markov Decision Process} +We cast the problem of finding $T$ to align the DRR $H_T(\cdot)$ with a X-ray image $I(\cdot)$ as a MDP, which is defined by a 5-tuple $\{\mathcal{T}, \mathcal{A}, P_{\cdot}(\cdot), R_{\cdot}(\cdot), \gamma\}$, where $\mathcal{T}$ is the set of possible states (i.e., transformations in SE(3)), $\mathcal{A}$ is the set of actions (i.e., modification of the transformation), $P_A(T)$ is the state obtained by taking action $A$ in state $T$, $R_A(T)$ is the reward received by taking action $A$ in state $T$, and $\gamma$ is the discount factor that controls the importance of future rewards. + With the action space $\mathcal{A}$ and the reward scheme $R_\cdot(\cdot)$ defined (details are provided in the next sections), the core problem of MDP is to find a policy $\pi(\cdot)$ that specifies the optimal action $\pi(T_t)$ to be taken at state $T_t$ to maximize the long term reward: + \begin{equation} + \sum_{t=0}^{\inf} {\gamma^t R_{A_t}(T_t)}, \quad \text{where we choose }A_t=\pi(T_t). + \end{equation} +\subsection{Action Space} +To make the policy learnable, we define the action space based on the X-ray projection geometry such that each action is correlated with a specific appearance change of the DRR that is largely independent of C-arm geometry. Specifically, the transformation $T$ is described in the image coordinate system, which has its origin at the upper left corner of the image, its $(x,y)$ axes along the image edges, and its $z$ axes perpendicular to the image (illustrated in \refFig{fig:system_overview}). We further define an agent coordinate system with the same orientation as the image coordinate system and an origin that can be selected individually (details on the selection of the origin will be discussed later). The coordinate transform from the image coordinate system to the agent coordinate system is denoted as $E$. + The transformation $T_t$ is then describe in the agent coordinate system, written as $E \circ T_t$, and the action space is defined as small movements in the tangent space of SE(3) at $E \circ T_t$, parameterized by se(3). + Specifically, the action space contains 12 actions of positive and negative movements along the 6 generators of se(3): + \begin{equation} + \mathcal{A} = \{-\lambda_1 G_1, \lambda_1 G_1, \dots, -\lambda_6 G_6, \lambda_6 G_6\}, + \end{equation} + where $\lambda_i$ is the step size for the action along the generator $G_i$. Application of an action $A \in \mathcal{A}$ is represented as + \begin{equation} + T_{t+1}=E^{-1} \circ \exp(A) \circ E \circ T_t. + \end{equation} + Since the actions need relatively small step size in order to achieve high accuracy, we set $\lambda_{1,2,3}$ to be 1 to get a step size of 1 mm in translation, and $\lambda_{4,5,6}$ to be $\pi / 180=0.0174$ to get a step size of 1 degree in rotation. Our definition of the action space ensures that the translation actions causes 2D shift and zooming of the DRR, and rotation actions causes rotation of object in the DRR around the agent's origin. Therefore the image appearance change of the DRR for a given action is largely independent of the underlying C-arm geometry. Note there is no action for terminating the MDP. Instead, we run the agent for a fixed number of steps (i.e., 50 in our experiments). +\subsection{Reward System} +In standard MPD, the optimization target is a long term reward, i.e., an accumulation of discounted future reward, due to the difficulty of forging a reward system that directly associate the immediate reward with the long term goal. For 2D/3D registration, however, we can define a distance-based reward system such that the immediate reward is tied with the improvement of the registration. The reward scheme is defined as the reduction of distance to the ground truth transformation in the agent coordinate system: + \begin{equation} + R_A(T) = D(E\circ T, E\circ T_g) - D(E\circ T', E\circ T_g), + \label{eqn:reward} + \end{equation} + where $T$ and $T'$ are transformations before and after the action, $T_g$ is the ground truth transformation. The distance metric $D(\cdot, \cdot)$ is defined as the geodesic distance of two transformations on SE(3) \cite{hartley2011l1}: + \begin{equation} + \begin{split} + D(T_1, T_2) &= \| \log (T_2 \circ T_1^{-1}) \|_F \\ + &= \left( 2\| \boldsymbol{u} \|_2^2 + \| \boldsymbol{v} \|_2^2 \right) ^ {\frac{1}{2}}, + \end{split} + \label{eqn:tdist} + \end{equation} + where $\log(\cdot)$ takes $T_2 \circ T_1^{-1} \in \text{SE}(3)$ into se(3), $\boldsymbol{u}$ and $\boldsymbol{v}$ are rotation and translation coefficients of $\log (T_2 \circ T_1^{-1})$ as described in \refEqn{eqn:se3_params}. Because the units for rotation and translation are radian and mm, the distance impact of rotation is too small. Therefore, we scale the rotation coefficients $\boldsymbol{v}$ by $180/\pi$ to balance the impacts of rotation and translation. + + Since the distance $D(T, T_g)$ measures the distance to the ground truth, a greedy policy that maximizes the immediate reward (i.e., minimizes the distance to the ground truth) would lead to the correct registration. + \begin{equation} + \pi(T) = \argmax_A R_{A}(T). + \label{eqn:policy} + \end{equation} + It can also be seem as a special case of MPD with the discount factor $\gamma = 0$. +\subsection{Policy Learning via Dilated FCN} +\begin{figure*} + \centering + \includegraphics[width=0.78\linewidth]{fcn_system.png} + \caption{Training of the reward network using dilated FCN. The encoder CNN and decoder NN are converted to equivalent dilated FCNs. Densely overlapping ROIs are encoded to a dense feature vector map. The feature vector map of DRR is then randomly shifted N (N=4 in our experiments) times to simulate translations of the 3D volume in the imaging plane. A ground truth dense reward map is calculated from each 2D shift combined with the 3D transformation. Euclidean loss comparing the estimated and ground truth rewards is used for training.} + \label{fig:fcn_system} + \end{figure*} + + Since we seek a greedy policy that maximizes the immediate reward, we model the reward function as a deep neural network, as shown in \refFig{fig:system_overview}, which can be learned via supervised learning. + The input of the network is an observation of the current state, which consists of an observed region of fixed size (i.e. $61\times 61$ pixels with 1.5$\times$1.5 mm pixel spacing in our experiment) from both X-ray and DRR, referred to as Region of Interest (ROI). The ROI of an agent is centered on the projection of its origin, so that rotation actions cause rotations with respect to the center of the ROI. + Such ROI center ensures that the same action always cause the same visual change in the observation, leading to a consistent mapping between the observation and rewards of different actions that can be modeled by a neural network. + We propose a network architecture that encodes X-ray and DRR separately and decodes them jointly to obtain the estimated reward, as shown in \refFig{fig:system_overview} and \refTable{tab:netconfig}. + + \setlength{\tabcolsep}{7pt} + \begin{table}[t] + \centering + \caption{Layer configurations for encoder/decoder CNNs and their equivalent dilated FCNs. Parameters for convolutional layers are written as $m \times n \times f$, where $n \times m$ is the convolution kernal size, $f$ is the number of feature maps. s$k$ indicates that the layer has input stride $k$, and d$k$ indicates that the filter kernel is dilated $k$ times. All convolutional layers have zero padding. SELU activation function is applied after all layers except for the input and output layers. The column "output size" specifies the output sizes for CNN.} + \label{tab:netconfig} + \begin{tabular}{lllll} + \toprule + & \makecell{Layer \\ Name} & \makecell{Output \\ Size} & \makecell{Original \\ CNN} & \makecell{Equivalent \\ FCN} \\ \midrule + \multirow{11}{*}{\rotatebox[origin=c]{90}{Encoder}} + &input & 61x61 & - & - \\ \cline{2-5} + &conv1 & 59x59 & 3x3x32 & 3x3x32, \\ \cline{2-5} + &conv2 & 57x57 & 3x3x32 & 3x3x32, \\ \cline{2-5} + &conv3 & 27x27 & 3x3x64,s2 & 3x3x64,d2 \\ \cline{2-5} + &conv4 & 25x25 & 3x3x64 & 3x3x64,d2 \\ \cline{2-5} + &conv5 & 11x11 & 3x3x128,s2 & 3x3x128,d4 \\ \cline{2-5} + &conv6 & 9x9 & 3x3x128 & 3x3x128,d4 \\ \cline{2-5} + &conv7 & 3x3 & 3x3x256,s2 & 3x3x256,d8 \\ \cline{2-5} + &fc1 & 1x1 & 1024 & 3x3x1024,d8 \\ \cline{2-5} + &fc2 & 1x1 & 1024 & 1x1x1024,d8 \\ \cline{2-5} + &output & 1x1 & 128 & 1x1x128,d8 \\ \midrule + \multirow{4}{*}{\rotatebox[origin=c]{90}{Decoder}} + &input & 1x1 & - & - \\ \cline{2-5} + &fc1 & 1x1 & 1024 & 3x3x1024,d8 \\ \cline{2-5} + &fc2 & 1x1 & 1024 & 1x1x1024,d8 \\ \cline{2-5} + &output & 1x1 & 6 & 1x1x6,d8 \\ \bottomrule + \end{tabular} + \end{table} + + Such CNN can be trained by supervised learning on data randomly sampled from the registration environment, similar to \cite{liao2017artificial}. In particular, given one pair of 2D and 3D data, training data of the CNN can be generated with 8 DoFs, including 2 DoFs for $(x,y)$ of the agent's origin ($z$ is set to be the mid-point of the 3D volume) corresponding to the location of the agent, and 6 DoFs for the transformation $T$ corresponding to the pose of the 3D volume. The ground truth rewards can be calculated following \refEqn{eqn:reward}. To make the learned reward function generalizable to unseen data, all 8 DoFs need to be sufficiently sampled during training, which has a prohibitively high computational cost. In \cite{liao2017artificial}, five million samples are needed to cover training data of 6 DoFs, and the sampling requirement grows exponentially with the DoF. + + We propose a dilated FCN-based training mechanism to reduce the DoF of training data from 8 to 4. First, the encoder and decoder CNNs are converted to equivalent dilated FCNs. The filter dilation technique introduced in~\cite{long2015fully} is used to make each pixel in the FCN output exactly the same as that produced using the corresponding CNN on its receptive field in the input images. Layer to layer correspondence of CNN and dilated FCN is shown in \refTable{tab:netconfig}. Training using dilated FCN is illustrated in \refFig{fig:fcn_system}. Since the encoder FCN encodes all ROIs in the input image, it can replace sampling $(x,y)$ of the agent's origin. The $(x,y)$ translation part of $T$ creates 2D shift of the DRR, which can be replaced by shifting the encoded feature map of the DRR during training. Therefore, 4 DoFs of training data can be avoided by using FCN-based training, reducing the number of total DoFs from 8 to 4. Since the complexity of the environment grows exponentially with its DoF, reducing the DoF by 4 can significantly improve the training efficiency. + + In the FCN-based training, the ground truth reward map needs to be calculated during training, following \refEqn{eqn:reward} and \refEqn{eqn:tdist}. Given a X-ray/DRR pair with known $T_g$ and $T$, the agent coordinate system $\{E_i\}$ is calculated for all ROIs within the input image by tracing the pixel back to the 3D volume. For each ROI, $(\boldsymbol{u}_i, \boldsymbol{v}_i)$ of $\log \left(E_i \circ T \circ (E_i \circ T_g)^{-1} \right)$ is pre-calculated. The effect of 2D shift of the DRR feature map is essentially adding the translation to $T$, which is equivalent to updating $\boldsymbol{u}_i \leftarrow \boldsymbol{u}_i + \Delta \boldsymbol{u}$, where $\Delta \boldsymbol{u}$ is the 2D shift represented in mm. The distance before action is then calculated using $(\boldsymbol{u}_i, \boldsymbol{v}_i)$ following \refEqn{eqn:tdist} for each ROI. Similarly, the distance after action is calculated following the same steps by replacing $T$ with $T' = E_i^{-1} \circ \exp(A) \circ E_i \circ T$. Note that the expensive computation of matrix logarithms can be pre-calculated for each X-ray/DRR pair, as it does not depend on the 2D shift. +\subsection{Multi-agent System} +\begin{figure} + \centering + \includegraphics[width=\linewidth]{confidence_map.png} + \caption{Confidence map of densely overlapping ROIs within the image. Color of each pixel indicates the confidence value from the ROI centered on this pixel.} + \label{fig:conf_map} + \end{figure} + + Since X-ray images during surgery and interventions can have very different Field-of-View (FoV) and contain many structures that do not match with the 3D image (e.g., medical devices), there can be many ROIs that do not contain reliable visual cues for registration (as shown in \refFig{fig:example_images}). Therefore we propose a multi-agent system to provide auto attention and adaptively choose most reliable ROIs during registration. Specifically, the FCN policy network is applied on the X-ray and DRR to produce a dense reward map, which contains estimated rewards for agents with all possible ROIs from the input images, denoted as $R_{i}(A)$, where $i$ is the index of the agent and $A \in \mathcal{A}$ is the action. For every agent, the maximum reward is calculated and the action associated with it is selected: + \begin{equation} + \begin{split} + \hat{R}_i &= \max_{A\in \mathcal{A}}R_i(A), \\ + A_i &= \argmax_{A\in \mathcal{A}}R_i(A). + \end{split} + \end{equation} + Since $\hat{R}_i$ is the anticipated reward of its selected action $A_i$, it represents the agent's confidence on the action. \refFig{fig:conf_map} shows a strong correlation between the confidence score $\hat{R}_i$ and the quality of the corresponding ROI: for image with a large FoV, the confidence score is high on spine (i.e., good visual cue for registration) and low on soft tissue; when severe occlusion is presented due to medical devices, the occluded area has low confidence scores. + + \begin{figure} + \centering + \includegraphics[clip, trim=1mm 4mm 1mm 4mm, width=0.9\linewidth]{confidence_distribution.pdf} + \caption{\textbf{Left}: Confidence distribution of agents producing correct and wrong actions. \textbf{Right}: Relation between the percentage of correct action among selected action and the confidence threshold used for selecting action.} + \label{fig:conf_dist} + \end{figure} + + We propose to use the confidence score $\hat{R}_i$ to derive an attention mechanism that only selects agents with $\hat{R}_i$ above a certain confidence threshold. To determine the threshold, the behavior of the confidence score was analyzed on validation data. Actions are categorized into correct and wrong, based on their impact on the registration (i.e., increase or decrease the distance to ground truth). \refFig{fig:conf_dist} shows the distribution of the confidence scores from agents producing correct and wrong actions, and relation between the percentage of correction action among selected actions and the confidence threshold used for selecting actions. Based on the analysis, we selected a confidence threshold (i.e., 0.67 in our experiment) such that the correct rate of selected actions is above 95\%. To avoid the scenario that too few agents are selected for a given test image, if less than 10\% of the agents have a confidence score above this threshold, the top 10\% agents will then be selected. After the agents are selected, denoted as $\mathcal{I}$, actions from the selected agents are further aggregated by L2 chordal mean to obtain the final actions: + \begin{equation} + \hat{A} = \argmin_{A \in SE(3)} \sum_{i \in \mathcal{I}} \| A_i - A \|_F^2. + \label{eqn:aggregation} + \end{equation} + The L2 chordal mean can be solved globally in close form as described in \cite{hartley2011l1}. +\section{Experiment and Result} +We applied the proposed method on a clinical application of 2D/3D registration during minimally invasive spine surgery, which aims at registering spine in 3D cone beam CT (CBCT) and two X-ray images acquired from different angles. This is a challenging problem because surgical objects like screws and guide wires can be presented separately in the 3D and 2D images, creating severe image artifacts and occlusion of the target object (examples are shown in \refFig{fig:example_images}). +\subsection{Training} +During minimally invasive spine surgery, the initial pose offset between the CBCT and the X-ray images can be up to 20 mm in translation and 10 degrees in rotation. Therefore, we train the agents to perform registration starting from within this range. In particular, the X-ray/DRR pairs used for training have random rotation offset up to $10^\circ$, and the DRR feature map is randomly shifted up to 20 mm during training. The training data was generated from 77 CBCT data sets, where each CBCT data set consists of one CBCT and $\sim$350 X-ray images used for reconstructing the CBCT. From each CBCT data set, we extracted 350 X-ray/DRR pairs. Since the number of CBCTs is limited, we also generated pairs of synthetic X-ray image and DRR from 160 CTs as additional training data, where 200 pairs where generated from each CT. In total, our training data consist of 58,950 data, i.e., 26,950 CBCT data and 32,000 synthetic data. Training was performed on a Nvidia Titan Xp GPU using pyTorch. + + We compared training using CNN and the proposed dilated FCN. In the training of CNN, random ROIs are extracted from the X-ray and DRR as the CNN input, and ground truth rewards are calculated and used as supervision. Curves for the training loss and correct action rate using CNN-based and dilated FCN-based training are shown in \refFig{fig:train_speed}. {FCN-based training finished in 17 hours, with a testing loss of $\sim$0.13 and a testing correct action rate of $\sim$90\%. In comparison, CNN-based training after 17 hours reached a test loss of $\sim$0.22 and a testing correct action rate of $\sim$80\%, which is close to the performance of FCN-based method after 2 hours of training.} + + \begin{figure} + \centering + \includegraphics[clip, trim=1mm 2mm 1mm 2mm, width=0.9\linewidth]{training_curve.pdf} + \caption{Comparison of training speed using CNN-based training and dilated FCN-based training.} + \label{fig:train_speed} + \end{figure} +\subsection{Testing} +To evaluate the contribution of the multi-agent strategy, we tested the agent-based method in two modes: 1) using a single agent with an ROI at the center of the image, referred to as \textit{agt-s}, and 2) using the proposed multi-agent strategy, referred to as \textit{agt-m}. To apply the proposed method on 2D/3D registration with two X-ray images, in every step, one action is obtained from each X-ray image, and the obtained actions are applied sequentially. We also tested a combination of \textit{agt-m} and an optimization-based method, referred to as \textit{agt-m-opt}, where optimization of GC using BOBYQA optimizer was applied starting from the result of \textit{agt-m}. + We compared the agent-based method with state-of-the-art optimization-based methods. Multiple similarity measures were evaluated in \cite{de20163d} using CMA-ES optimizer for spine 2D/3D registration, and GC and GO were reported to achieve the best performance. Therefore, we evaluated CMA-ES optimization of GO and GC using the same parameters reported in ~\cite{de20163d}, referred to as \textit{ES-GO} and \textit{ES-GC}, respectively. + Registration error is measured by Target Registration Error (TRE), which is calculated as the Root Mean Square Error of the locations of seven anatomical landmarks located on spine vertebrae. +\subsubsection{CBCT Data} +Testing was first performed on 116 CBCT data sets via three-fold cross validation (77 used for training and 39 used for testing). {The typical size of the CBCT data is $512\times 512\times 389$ with a pixel spacing of 0.486 mm}. On each data set, 10 pairs of X-ray images that are $>$60$^\circ$ apart (common practice for spine surgery) were randomly selected, and 2D/3D registration was performed on each pair, starting from a perturbation of the ground truth transformation within 20 mm translation and 10$^\circ$ rotation, leading to 1,160 test cases. Note that X-ray images in CBCT data have a relatively low SNR with a faint spine as shown in \refFig{fig:example_images}. + + Experiment results are summarized in \refTable{tab:rotresult}. The two optimization-based methods, ES-GO and ES-GC, resulted in relatively high gross failure rate (account for TRE$>$10 mm, which is about 1/2 of a vertebrae and considered to be grossly off by our clinical collaborating partners). This is mainly due to the low image quality (e.g., low SNR, image artifacts in CBCT and etc.), which leads to a highly non-convex optimization problem using low level similarity measures like GC and GC. {In comparison, \textit{agt-m} achieved a much lower gross failure rate, demonstrating the robustness advantage of the agent-based method. Comparison of \textit{agt-s} and \textit{agt-m} shows that the multi-agent strategy can noticeably improve robustness by aggregating information from most confident agents.} The comparison of median TRE shows that while the agent-based method provides low failure rate, its accuracy is lower than that of optimization-based methods. This is primarily due to the discrete actions of 1 mm and 1 degree, and location information loss during stride in the CNN. By applying \textit{opt-local} to refine the result of \textit{agt-m}, \textit{apt-m-opt} achieved both low failure rate and high accuracy. + + \setlength{\tabcolsep}{4pt} + \begin{table}[t] + \centering + \caption{Experiment results on bi-plane 2D/3D registration on 1,160 test cases from 116 CBCT data sets, and 560 test cases from 28 clinical data sets. Gross failure rate (GFR) accounts for test cases with TRE$>$10 mm. Median, 75th percentile and 95th percentile TREs are reported.} + \label{tab:rotresult} + \begin{tabularx}{\linewidth}{llccYYc} + \toprule + & + \multirow{2}[2]{*}{Method} & + \multirow{2}[2]{*}{GFR} & + \multirow{2}[2]{*}{\makecell{Median \\ (mm)}} & + \multicolumn{2}{c}{Percentile (mm)} & + \multirow{2}[2]{*}{\makecell{Run \\ Time}} \\ \cmidrule(lr){5-6} + &&&& 75\% & 95\% & \\\midrule + \multirow{6}[2]{*}{\rotatebox[origin=c]{90}{CBCT Data}} + &Start & 93.4\% & 19.4 & 23.2 & 27.8 & - \\ + \cmidrule{2-7} + &ES-GC & 32.2\% & 1.67 & 22.1 & 44.1 & 18.7 s\\ + &ES-GO & 34.3\% & 1.81 & 21.0 & 38.6 & 33.9 s\\ + \cmidrule{2-7} + &agt-s & 17.2\% & 5.30 & 8.13 & 23.3 & 0.5 s \\ + &agt-m & 4.1\% & 3.59 & 5.30 & 8.98 & 2.1 s \\ + &agt-m-opt & \textbf{2.1\%} & \textbf{1.19} &\textbf{ 1.76} & \textbf{4.38} & 2.6 s \\ + \midrule + \multirow{6}[2]{*}{\rotatebox[origin=c]{90}{Clinical Data}} + &Start & 95.4\% & 20.4 & 23.1 & 26.8 & - \\ + \cmidrule{2-7} + &ES-GC & 49.3\% & 8.79 & 26.5 & 55.6 & 20.4 s\\ + &ES-GO & 42.1\% & 3.18 & 29.0 & 84.6 & 35.8 s\\ + \cmidrule{2-7} + &agt-s & 45.7\% & 8.42 & 14.2 & 26.4 & 0.6 s \\ + &agt-m & 6.8\% & 4.97 & 7.36 & \textbf{10.3} & 2.1 s \\ + &agt-m-opt & \textbf{6.1\%} & \textbf{1.99} & \textbf{2.76} & 10.8 & 2.7 s \\ + \bottomrule + \end{tabularx} + \end{table} +\subsubsection{Clinical Data} +To evaluate the proposed method in a real clinical setup, we blindly selected one trained model from the three-hold cross validation on CBCT data, and tested it on 28 clinical data sets collected from minimally invasive spine surgery. Each data set contains a CBCT acquired before the surgery and two X-ray images acquired during the surgery. Ground truth registration was manually annotated by experts. On each data set, 20 perturbations of the ground truth transformation were randomly generated as starting positions for 2D/3D registration, leading to 560 test cases. + + Experiment results on clinical data are summarized in ~\refTable{tab:rotresult}. Higher TREs are reported for all methods on clinical data than that on the CBCT data, primarily due to three reasons: 1) The ground truth registration for clinical data was manually annotated, which could bear 1$\sim$2 mm error; 2) The complexity of clinical data is much higher than the CBCT data (i.e., artifacts and occlusion caused by surgical devices, varying imaging FoVs and etc.); 3) For agent-based methods, the agent was trained without using any real clinical data from spine surgery. + We observed that due to the increased complexity, the heuristically selected ROI used in \textit{agt-s} (i.e., center of the image) become even less reliable. As a result, the robustness of \textit{agt-s} degrades significantly comparing to that on the CBCT data. The multi-agent system, \textit{agt-m}, in contrast achieved a much higher robustness than \textit{agt-s}, even though the individual agent was trained without using any clinical data from spine surgery, demonstrating the effectiveness of the multi-agent strategy in dealing with complex scenarios. +\section{Conclusion and Future Works} +In this paper, we formulated 2D/3D registration as a MDP, and proposed an multi-agent system to solve this challenging problem. A multi-agent action aggregation scheme is proposed to drive the registration with inherent attention focus. In addition, a dilated FCN-based training scheme is proposed to reduce the number of DoFs that need to be sampled in training from 8 to 4, which speeds up the training efficiency by an order of magnitude. On our experiments on both CBCT data and clinical data, the proposed method is shown to be able to achieve significantly higher robustness than the state-of-the-art 2D/3D registration methods. + + In our future works, we will explore the advantages provided by the proposed dilated FCN-based network structure for other general computer vision problems such as optical flow estimation and metric learning. Specifically, unlike FCN-based optical flow (e.g., FlowNet~\cite{dosovitskiy2015flownet}), where the pooling and uppooling layers inherently make the output insensitive to small motion, our network structure ensures that local image descriptor strictly follows the input ROI (i.e., 1 pixel shift of the ROI causes exactly 1 pixel shift of the descriptor), and therefore can potentially provide high accuracy for motion estimation. In addition, this property could be utilized for metric learning using triplet networks, i.e. embeding ROIs to feature vectors with Euclidean distances correlated with the physical distances of the ROIs. The dilated FCN based training scheme could in general be highly efficient by allowing training multiple displacements in each back propagation. These are currently under investigation. + + \bibliographystyle{aaai} + \bibliography{egbib} diff --git a/1712.01813v1.txt b/1712.01813v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..3741f10deb721309997581b59f98ab8fc080b6c9 --- /dev/null +++ b/1712.01813v1.txt @@ -0,0 +1,358 @@ +\section{Introduction} +Entity Linking (EL) is the task of associating a specific textual mention of an entity (henceforth query entity) in +a given document (henceforth query document) with an entry in a large target catalog of entities, often +called a knowledge base or KB, and is one of the major tasks in the +Knowledge-Base Population (KBP) track at the Text Analysis Conference (TAC) \cite{ji2014overview,ji2015overview}. +Most of the previous EL research \cite{2007-emnlp-conll-cucerzan-wikipedia-NE-disambig,2011-acl-illinois-wikifier,cikm-joint-nerel} have used Wikipedia as the target catalog of entities, because of its coverage and frequent updates made by the community of users. + +Some ambiguous cases for entity linking require computing fine-grained similarity between the context of the query mention and the title page of the disambiguation candidate. Consider the following examples:\\ +$e_1$: Alexander Douglas Smith is an American football quarterback for the Kansas City Chiefs of the National Football League (NFL).\\ +$e_2$: Edwin Alexander ``Alex" Smith is an American football tight end who was drafted by the Tampa Bay Buccaneers in the third round of the 2005 NFL Draft.\\ +$e_3$: Alexander Smith was a Scottish-American professional golfer who played in the late 19th and early 20th century.\\ +$q$: Last year, while not one of the NFL’s very best quarterbacks, Alex Smith did lead the team to a strong 12-4 season. + +Here, $e_1$, $e_2$ and $e_3$ refer to the Wikipedia pages of three sportsmen (only first sentence is shown), known as ``Alex Smith"; $q$ refers to the sentence for the query mention ``Alex Smith". Since words in $e_3$ belong to a different domain (golf) than $q$ (American football), simple similarity based methods \eg\ TF-IDF based cosine similarity will have no difficulty in discarding $e_3$ as disambiguation for $q$. But words in $e_1$ and $e_2$ contain significant overlap (both are American football players) even in key terms like NFL. Since ``Alex Smith'' in $q$ is a quarterback, correct disambiguation for $q$ is $e_1$. This requires fine-grained similarity computation between $q$ and the title page of $e_1$. In this paper, we propose \textit{training} state-of-the-art (SOTA) similarity models between the context of the query mention and the page of the disambiguation candidate from Wikipedia such that the similarity models can learn to correctly resolve such ambiguous cases. We investigate several ways of representing both the similarity and coherence between the query document and candidate Wikipedia pages. For this purpose, we extract contextual information at different levels of granularity using the entity coreference chain, as well as surrounding mentions in the query document, then use a combination of convolutional neural networks (CNN), LSTMs \cite{hochreiter1997long}, Lexical Composition and Decomposition \cite{wang2016sentence}, Multi-Perspective Context Matching (MPCM) \cite{wang2016multi}, and Neural Tensor Networks \cite{socher2013reasoning,socher2013tensor} to encode this information and ultimately perform EL. + + +The TAC community is also interested in cross-lingual EL \cite{tsai2016cross,sil2016one}: given a mention in a foreign language document \eg\ Spanish or Chinese, one has to find its corresponding link in the English Wikipedia. The main motivation of the task is to do Information Extraction (IE) from a foreign language for which we have extremely limited (or possibly even no) linguistic resources and no machine translation technology. The TAC 2017 pilot evaluation \footnote{http://nlp.cs.rpi.edu/kbp/2017/taskspec\_pilot.pdf} targets really low-resource languages like Northern Sotho or Kikuyu which only have about 4000 Wikipedia pages which is a significantly smaller size than the English Wikipedia. Recently, for cross-lingual EL, \cite{tsai2016cross} proposed a cross-lingual wikifier that uses multi-lingual embeddings. However, their model needs to be re-trained for every new language and hence is not entirely suitable/convenient for the TAC task. We propose a zero shot learning technique \cite{palatucci2009zero,socher2013zero} for our neural EL model: once trained in English, it is applied for cross-lingual EL without the need for re-training. We also compare three popular multi-lingual embeddings strategies and perform experiments to show which ones work best for the task of zero-shot cross-lingual EL. The results show that our methods not only obtain results that are better than published SOTA results on English, but it can also be applied on cross-lingual EL on Spanish and Chinese standard datasets, also yielding SOTA results. + + + + + + + + + + + + + + + + + + + + + + + +Previous works in EL \cite{2006-eacl-bunescu-wikipedia-ne-disambig,2007-cikm-mihalcea-wikify} involved finding the similarity of the context in the source document and the context of the candidate Wikipedia titles. Recent research +on EL has focused on sophisticated global disambiguation algorithms \cite{globerson2016collective,2008-cikm-milne-witten-wikifier,emnlp-chengroth-2013,cikm-joint-nerel} but are more expensive since they capture coherence among titles in the given document. +However, \cite{2011-acl-illinois-wikifier} argue that global systems provide a minor improvement over local systems. Our proposed EL system is a local system which comprises of a deep neural network architecture with various layers computing the semantic similarity of the source documents and the potential entity link candidates modeled using techniques like neural tensor network, multi-perspective cosine similarity and lexical composition and decomposition. + +Sun \etal\ (2015) used neural tensor networks for entity linking, between mention and the surrounding context. But this did not give good results in our case. Instead, the best results were obtained by composing the left and right contexts of all the mentions in the coreference chain of the target mention. In this work, we also introduced state-of-the-art similarity models like MPCM and LDC for entity linking. Combination of all these components helps our model score 3.5 absolute accuracy improvement over Sun \etal\ (2015). + +The cross-lingual evaluation at TAC KBP EL Track that started in 2011 \cite{jioverview2011,ji2015overview} has Spanish and Chinese as the +target foreign languages. One of the top performers \cite{sil2016one}, like most other participants, perform EL in the foreign language (with the corresponding foreign KB), and then find the corresponding English titles using Wikipedia inter-language links. Others \cite{2011cross} translate the query documents to English and do English EL. The first approach relies on a large enough KB in the foreign language, whereas the second depends on a good machine translation system. Similar to \cite{tsai2016cross}, the ideas proposed in this paper make significantly simpler assumptions on the availability of such resources, and therefore can also scale to lower resource languages, while doing very well also on high-resource languages. However, unlike our model they need to train and decode the model on the target language. Our model once trained on English can perform cross-lingual EL on any target language. + +Some recent work involves \cite{lin2017list} but is unrelated since it solves a different problem (EL from only lists) than generic EL and hence an apples-apples comparison cannot be done. \cite{pan2017cross} is related but their method prefers common popular entities in Wikipedia and they select training data based on the topic of the test set. Our proposed method is more generic and robust as it is once trained on the English Wikipedia and tested on any other language without re-training. \cite{tan2017entity} solves a different problem by performing EL for queries while we perform EL for generic documents like news. Recently \cite{gupta2017entity} propose an EL system by jointly encoding types from a knowledge-base. However, their technique is limited to only English and unlike us do not perform cross-lingual EL. +\section{Entity Linking Formulation} +We formalize the problem as follows: we are given +a document $D$ in any language, a set of mentions +$M_D = {m_1;\ldots;m_n}$ in $D$, and the English +Wikipedia. For each mention in the document, the +goal is to retrieve the English Wikipedia link that the +mention refers to. If the corresponding entity or concept +does not exist in the English Wikipedia, ``NIL” +should be the answer. + +Given a mention $m \in M_D$, the first step is to generate +a set of link candidates $L_m$. The goal of this +step is to use a {\em fast match} procedure to obtain a list of links which hopefully include the correct answer. We only look at the surface +form of the mention in this step, and use no contextual +information. +The second essential step is the ranking step where +we calculate a score for each title candidate $l_j^{(m)} \in L_m$, +which indicates how relevant it is to the given mention. We represent the mention using various contextual +clues and compute several similarity scores +between the mention and the English title candidates +based on multilingual word and title embeddings. A +ranking model learned from Wikipedia documents is +used to combine these similarity scores and output +the final score for each candidate. We then select +the candidate with the highest score as the answer, +or output NIL if there is no appropriate candidate. + +Formally, we assume that we have access to a snapshot of Wikipedia, in some language $en$\footnote{Deliberately using the symbol $en$ as it is the most widely chosen language in EL research.}, where $en \in X$, $X$ being the set of all languages in Wikipedia, as our knowledge-base $KB_{en}$ with titles also known as links denoted by ${L_1,\ldots,L_N}$. We can define the goal of Entity Linking (EL) as, given a textual mention $m$ and a document $D$, $m\in D$ and $m,D\in en$, to identify the best link $l_i$: +\begin{equation} +\hat{l}^{(m)} = \arg\max_{j}P(l_j^{(m)}|m,D) \label{eq1} +\end{equation} +Since computing $P\left(l_j^{(m)}|m,D\right)$ can be prohibitive over large datasets, we change the problem into computing \begin{equation} +\hat{l}^{m}=\arg\max_j P(C|m,D,l_j^{(m)}) \label{hans-eq2} +\end{equation} +where $C$ is a Boolean variable that measures how ``consistent" the pairs $(m,D)$ and $l^{(m)}_j$ are. As a further simplification, given $(m,D)$, we perform an Information Retrieval (IR)-flavored \textit{fast match} to identify the most likely candidate links ${l^{(m)}_{j_1},\ldots,l^{(m)}_{j_m}}$ for the input $(m,D)$, then find the $\arg\max$ over this subset. + +In cross-lingual EL, we assume that $m,D \in tr$, where $tr$ is some foreign language like Spanish or Chinese. However, we need to link $m$ to some target link $l^{(m)}_i$, where $l^{(m)}_i \in KB_{en}$. +\subsection{Fast Match Search} +\label{sec:fast-match} +The goal of the fast match search is to provide a set of candidates that can be re-scored to compute the $\arg\max$ in Equation (\ref{hans-eq2}). To be able to do this, we prepare an anchor-title index, computed from our Wikipedia snapshot, that +maps each distinct hyper-link anchor text to its target Wikipedia titles \eg\ the anchor text ``Titanic” is used in Wikipedia to refer both to the +famous ship and to the movie. To retrieve the disambiguation candidates $l_i$ for +a query mention $m$, we query the anchor-title index that we constructed. $l_i$ +is taken to be the set of titles most frequently linked to with anchor +text $m$ in Wikipedia. For cross-lingual EL, in addition to using the English Wikipedia index (built from the English snapshot), we also build an anchor-title index from the respective target language Wikipedia. Once we have that index, we rely on the inter-language links in Wikipedia to map all the non-English titles back to English. Hence, we have an additional anchor-title index where we have foreign hyper-links as surface forms but English titles as the targets e.g. the surface form ``Estados Unidos'' will have the candidate title \textit{United\_States} which is a title in the English Wikipedia. +\section{Embeddings} +Before delving into the model architecture, we briefly describe the word embeddings used in this work. +Since we are interested in performing cross-lingual EL, we make use of multi-lingual word embeddings, as shown below. +\label{sec:embeddings} +\subsection{Monolingual Word Embeddings} +\label{sec:mono-emb} +We use the widely used CBOW word2vec model \cite{mikolov2013efficient} to generate English mono-lingual word embeddings. +\subsection{Multi-lingual Embeddings} +\textbf{Canonical Correlation Analysis (CCA):} This technique is based on \cite{faruqui2014improving} who learn vectors by first performing SVD on +text in different languages, then applying CCA on pairs of vectors for the +words that align in parallel corpora. For cross-lingual EL, we use the embeddings provided by \cite{tsai2016cross}, built using the title mapping obtained from inter-language links in Wikipedia.\\ +\textbf{MultiCCA:} Introduced by \cite{ammar2016massively} this technique builds upon CCA and uses a linear operator to project pre-trained monolingual embeddings in each language (except English) to the vector space of pre-trained English word embeddings. +\\ +\textbf{Weighted Least Squares (LS):} Introduced by \cite{mikolov2013exploiting}, the foreign language embeddings are directly projected onto English, with the mapping being constructed through multivariate regression. +\\ +\subsection{Wikipedia Link Embeddings} +\label{sec:WikiEmbeddings} +We are also interested in embedding entire Wikipedia pages (links). In previous work, \cite{berkeleyNNEL} run CNNs over the entire article and output one fixed-size vector. However, we argue that this operation is too expensive, and it becomes more expensive for some very long pages (based on our experiments on the validation data). We propose a simpler, less expensive route of modeling the Wikipedia page of a target entity. For every Wikipedia title and using pre-trained word embeddings (obtained in Section \ref{sec:mono-emb}), we compute a weighted average of all the words in the Wikipedia page text. We use the inverse document frequency (IDF) of each word as a weight for its vector, to reduce the influence of frequent words. We compute the Wikipedia page embedding for page $p$ ($e_p$) as: +\begin{equation} +e_p = \dfrac{\sum_{w \in p}{e_{w}idf_w}}{\sum_{w \in p}{idf_w}} +\end{equation} +where $e_w$ and $idf_w$ are the embedding vector and the IDF for word $w$ respectively. +We further apply (and train) a fully connected \textit{tanh} activation layer to the embedding obtained this way, in order to allow the model to bring the mention context and the Wikipedia link embedding to a similar space before further processing. +\section{Modeling Contexts} +\label{sec:repr-details} +In this Section, we will describe how we build the sub-networks that encode the representation of query mention $m$ in the given query document $D$. This representation is then compared with the page embedding (through cosine similarity) and the result is fed into the higher network (Figure \ref{fig:nn-model}). + +Noting that the entire document $D$ might not be useful \footnote{Our experiments on the validation datasets made us think this way.} for disambiguating $m$, we choose to represent the mention $m$ based only on the surrounding sentences of $m$ in $D$, in contrast to \cite{he2013learning,berkeleyNNEL}, which chose to use the entire document for modeling. +Hence, following similar ideas in \cite{barrena2014one,lee2012joint}, we run a coreference resolution system \cite{luo2004mention} and assume a ``one link per entity" paradigm (similar to one sense per document \cite{gale1992one,yarowsky1993one}). We then use these to build a \emph{sentence-based} context representation of $m$ as well as its finer-grained context encoding, from only words within a window surrounding the mention occurrences. +\subsection{Modeling Sentences} +\label{sentence-repr} +We collect all the sentences that contain the mention or are part of the entity's coreference chain. Then we combine these sentences together and form a sequence of sentences containing all instances of mention $m$. We use a convolutional neural network (CNN) to produce fixed-size vector representations from the variable length sentences. +We first embed each word into a $d$-dimensional vector space using the embedding techniques described in the previous section . This results in a sequence of vectors $w_1$,...,$w_n$. We then map those words into a fixed-size vector using a Convolutional Neural Network (CNN) parameterized with a filter bank $V \in \mathbb{R}^{k \times dc}$, where $c$ is the width of the convolution (unigram, bigram, etc.) and $k$ is the number of filter maps. We apply a \textit{tanh} nonlinearity and aggregate the results with \textit{mean}-pooling. A similar CNN is used for building representations of the first paragraphs of a Wikipedia page which is taken to be the context of the candidate link. First paragraphs of an entity's Wikipedia page consists of one or more sentences. Note that this is different than running CNNs on the whole Wikipedia link embeddings described earlier. +\subsection{Fine-grained context modeling} +\label{context-repr} +While representing the context of a mention as the output of a CNN running over the sentences surrounding it, might allow for relevant patterns to fire, it is not clear if this type of a representation allows for finer-grained meaning distinctions. Furthermore, this does not exploit the fact that words closer to a mention, are stronger indicators of its meaning than words that are far away. Consider, for example, this sentence: \textit{``Ahmadinejad , whose country has been accused of stoking sectarian violence in Iraq, told ABC television that he did not fear an attack from the United States.''} If our query mention is ABC, only several words surrounding it are needed for a system to infer that ABC is referring to the \textit{American Broadcasting Company} (a television network), while modeling the entire sentence might lead to losing that signal. + +For that purpose, we consider \textit{context} to be the words surrounding a mention within a window of length \textit{n}. For our experiments, we chose \textit{n} to be 4. We collect all the left and right contexts separately, the left ending with the mention string and the right beginning with the mention string. +\begin{figure*} +\begin{center} +\includegraphics[width=0.9\textwidth]{figs/context-new-cropped} +\end{center} +\caption{Modeling of fine grained context using LSTMs and NTNs from the left and right contexts obtained from the coreference chain of the query entity.} +\label{fig:lstms} +\end{figure*} + + + + +In a first step, we run LSTMs on these contexts as follows: we run forward LSTMs on the left and backward on the right context and use element-wise mean pooling as the combination strategy. To detail: +using the condensed notations of \cite{DBLP:journals/corr/ChengDL16}, we run a forward LSTM network over each left context, and a backward LSTM network over each right context, and pool them over all the contexts of each mention. The resulting condensed representations are averaged and then combined using a neural tensor network, using the equation below (also see Figure \ref{fig:lstms}). +\begin{equation} +NTN(l,r;W) = f(\left[ \begin{array}{c}l \\ r \\\end{array}\right]^t W^{\{1,\ldots,k\}}\left[ \begin{array}{c}l \\ r \\\end{array}\right]) +\label{eq:NTN} +\end{equation} +Here $l$ and $r$ are the representations for the overall left and right context ($l,r \in \mathbb{R}^d$), $W$ is a tensor with $k$ slices with $W^i \in \mathbb{R}^{2d \times 2d}$, $f$ is a standard nonlinearity applied element wise (sigmoid in our case). The output of NTN is a vector $NTN(l, r;W) \in \mathbb{R}^k$ \footnote{We use $l$ to denote left context here for simplicity even when we have used it before to denote a link.}. +\section{Cross-Lingual Neural Entity Linking} +\label{sec:model} +\subsection{Neural Model Architecture} +The general architecture of our neural EL model is described in Figure \ref{fig:nn-model}. Our target is to perform ``zero shot learning'' \cite{socher2013zero,palatucci2009zero} for cross-lingual EL. Hence, we want to train a model on English data and use it to decode in any other language, provided we have access to multi-lingual embeddings from English and the target language. We allow the model to compute several similarity/coherence \textit{scores} $S$ (feature abstraction layer): which are several measures of similarity of the context of the mention $m$ in the query document and the context of the candidate link's Wikipedia page, described in details in the next section, which are fed to a feed-forward neural layer $H$ with weights $W_h$, bias $b_h$, and a \textit{sigmoid} non-linearity. The output of $H$ (denoted as $h$) is computed according to $h = \sigma(W_h S + b_h)$. +The output of the binary classifier $p(C|m,D,l)$ is the softmax over the output of the final feed-forward layer $O$ with weights $W_0$ and bias $b_0$. $p(C|m,D,L)$ represents the probability of the output class C taking a value of 1 (correct link) or 0 (incorrect link), and is computed as a 2 dimensional vector and given by: +\begin{equation} +p(C|m,D,l) = softmax(W_0h+b_0) +\end{equation} +\begin{figure}[t] +\begin{center} +\fbox{\includegraphics[trim = 1mm 2mm 0mm 1mm, clip,width=\columnwidth]{figs/model_new}} +\end{center} +\caption{\textbf{Architecture of our neural EL system.} The input to the system are: a document $D$ containing the query mention $m$ and the corresponding Wikipedia candidate link $l_i\in L$, where $L$ is the set of all possible links extracted from the fast match step described in Section \ref{sec:fast-match}.} +\label{fig:nn-model} +\end{figure} +\subsection{Feature Abstraction Layer} +\label{sec:feature-layer} +In this layer, we encode the similarity between the context of the mention in the source document and the context of the corresponding candidate Wikipedia links as obtained through fast match at multiple granularities, described below. \\\\ +\textbf{A. Similarity Features by comparing Context Representations}\\ +\textbf{1. ``Sentence context - Wiki Link" Similarity}: +The first input to this layer is the cosine similarity between the CNN representations of its \emph{relevant context} sentences and the embedding of the candidate Wikipedia link (both described in the Embeddings section).\\ +\textbf{2. ``Sentence context - Wiki First Paragraph'' Similarity}: The next input is the cosine similarity between the CNN representations of the sentential context of a mention and the first Wikipedia paragraph, following the intuition that often the first paragraph is a concise description of the main content of a page. Multiple sentences are composed using the same model as above.\\ +\textbf{3. ``Fine-grained context - Wiki Link'' Similarity}: +Next, we feed the similarity between the more fine-grained embedding of context described in the Embeddings section, Equation (\ref{eq:NTN}) and the embedding of the candidate page link.\\ +\textbf{4. Within-language Features}: We also feed in all the local features described in the LIEL system \cite{sil2016one}. LIEL uses several features such as ``how many words overlap between the mention and Wikipedia title match?'' or ``how many outlink names of the candidate Wikipedia title appear in the query document?'' that compares the similarity of the context of the entity under consideration from the source document and its target Wikipedia page. We also add a feature encoding the probability $P(l_i|m)$, the posterior of a Wikipedia title $l_i$ being the target page for the mention $m$, using solely the anchor-title index. This feature is a strong indicator to predict if a link $l_i$ is the correct target for mention $m$.\\ +\textbf{Multi-perspective Binning Layer:} Previous work \cite{liu2016neural} quantizes numeric feature values and then embeds the resulting bins into 10-dimensional vectors. In contrast, we propose a ``Multi-perspective Binning Layer'' (MPBL) which applies multiple Gaussian radial basis functions to its input, which can be interpreted as a smooth binning process. The above-described similarity values are fed into this MPBL layer, which maps each to a higher dimensional vector. Introducing this layer lets the model learn to respond differently to different values of the cosine input feature, in a neural network friendly way. Our technique differs from \cite{liu2016neural} in that it is able to automatically learn the important regions for the input numeric values.\\[12pt] +\textbf{B. Semantic Similarities and Dissimilarities}\\ +\textbf{1. Lexical Decomposition and Composition (LDC)}: We use the recently proposed LDC\footnote{Not to be confused with the Linguistic Data Consortium (https://www.ldc.upenn.edu/.)} model in \cite{wang2016sentence} to compare the contexts. For brevity, we only give a brief description of this feature - we direct the reader to the original paper. We represent the source context \ct{} and the Wikipedia paragraph \wpf{} as a sequence of pre-trained embeddings of words. \ct{} = [$\cti{}_1$, \ldots, $\cti{}_m$] and \wpf{}=[$\wpfi{}_1$, \ldots, $\wpfi{}_n$] where $\cti{}_i$ and $\wpfi{}_j$ are the pre-trained word embeddings for the $i$th and $j$th word from the source context and the Wikipedia paragraph respectively. +The steps of LDC are summarized below. +For each word $\cti{}_i$ in $\ct{}$, the semantic matching step finds a matching word $\hat{\cti{}_i}$ from $\wpf{}$. In the reverse direction, a matching word $\hat{\wpfi{}_j}$ is found for each $\wpfi{}_j$ in $\wpf{}$. For a word embedding, its matching word is the one with the highest cosine similarity. Hence, $\hat{\cti{}_i} = \wpfi{}_k \mbox{ where k = }\argmax_j \cosine(\cti{}_i,\wpfi{}_j)$ and $\hat{\wpfi{}_j} = \cti{}_k \mbox{ where k = }\argmax_i \cosine(\wpfi{}_j, \cti{}_i)$. +\begin{equation*} +\hat{\cti{}_i} = \wpfi{}_k \mbox{ where k = }\argmax_j \cosine(\cti{}_i,\wpfi{}_j) +\end{equation*} +\begin{equation*} +\hat{\wpfi{}_j} = \cti{}_k \mbox{ where k = }\argmax_i \cosine(\wpfi{}_j, \cti{}_i) +\end{equation*} +The next step is decomposition, where each word embedding $\cti{}_i$ (or $\wpfi{}_j$) is decomposed based on its semantic matching vector $\hat{\cti{}_i}$ (or $\hat{\wpfi{}_j}$) into two components: similar component $\cti{}_i^{+}$ (or $\wpfi{}_j^{+}$) and dissimilar component $\cti{}_i^{-}$(or $\wpfi{}_j^{-}$). We compute the cosine similarity between $\cti{}_i$ and $\hat{\cti{}_i}$ (or $\wpfi{}_i$ and $\hat{\wpfi{}_i}$) and decompose linearly. Hence, $(\cti{}_i^{+},\cti{}_i^{-})=(\alpha \cti{}_i, (\sqrt{1-\alpha^2}) \cti{}_i)$ and $(\wpfi{}_i^{+},\wpfi{}_i^{-})=(\alpha \wpfi{}_i, \sqrt{1-\alpha^2} \wpfi{}_i)$ where $\alpha = \cosine(\cti{}_i,\hat{\cti{}_i})$ and $\alpha = \cosine(\wpfi{}_i,\hat{\wpfi{}_i})$. +\begin{equation*} +(\cti{}_i^{+},\cti{}_i^{-})=(\alpha \cti{}_i, (1-\alpha) \cti{}_i) \mbox{ and } \alpha = \cosine(\cti{}_i,\hat{\cti{}_i}) +\end{equation*} +\begin{equation*} +(\wpfi{}_i^{+},\wpfi{}_i^{-})=(\alpha \wpfi{}_i, (1-\alpha) \wpfi{}_i) \mbox{ and } \alpha = \cosine(\wpfi{}_i,\hat{\wpfi{}_i}) +\end{equation*} +In the Composition step, the similar and dissimilar components are composed at different granularities using a two channel CNN and pooled using \textit{max}-pooling. The output vector is the representation of the similarity (and dis-similarity) of the source context of the mention with the Wikipedia page of the target entity.\\ +\textbf{2. Multi-perspective Context Matching (MPCM)}: Next, we input a series of weighted cosine similarities between the query mention context and the Wikipedia link embedding, as described in \cite{wang2016multi}. Our argument is that while cosine similarity finds semantically similar words, it has no relation to the classification task at hand. Hence, we propose to train weight vectors to re-weigh the dimensions of the input vectors and then compute the cosine similarity. The weight vectors will be trained to maximize the performance on the entity linking task. +We run CNNs to produce a fixed size representations for both query and candidate contexts from Section \ref{sec:repr-details}. We build a node computing the cosine similarity of these two vectors, parametrized by a weight matrix. Each row in the weight matrix is used to compute a score as $u_k = \cosine(w_k \circ v_1, w_k \circ v_2)$, where $v_1$ and $v_2$ are input $d$ dimensional vectors, $w_k$ $\in$ $\mathbb{R}^{d}$ is the $k^{\textnormal{th}}$ column in the matrix, $\mathbf{u}$ is a $l$-dimensional output vector, and $\circ$ denotes a element-wise multiplication. Note that re-weighting the input vectors is equivalent to applying a diagonal tensor with non-negative diagonal entries to the input vectors.\\ +\subsection{Training and Decoding} +To train the model described in Equation (\ref{hans-eq2}), the binary classification training set is prepared as follows. For each mention $m_{ij}\in D_i$ and its corresponding correct Wikipedia page $l^{(m_{ij})}$, we use our fast match strategy (discussed in Page 2) to generate $K_{ij}$ number of incorrect Wikipedia pages $(l_{ij_k})_k$. $l_i$ and $l_{ij_k}$ represent positive and negative examples for the binary classifier. Pairs in the list of $[(m_{ij},D,l_{ij}),(m_{ij},D,l_{ij_0}),\ldots,(m_{ij},D_i,l_{ij_{K_{ij}}})]$ will be used to produce the similarity/ dis-similarity vectors $S_{ij_k}$. Classification label $Y_{ij_k}$ that corresponds to input vector $(m_{ij},D_{i},l_{ij_k})$ will take the value of $1$ for the correct Wikipedia page and $0$ for incorrect ones. The binary classifier is trained with the training set $T$ which contains all the $(m,D,l,Y)$ data pairs\footnote{The ratio of positive to negative training events is controlled to produce a more balanced training data.}. + +Training is performed using stochastic gradient descent on the following loss function: +\begin{equation} +-\frac{1}{|T|}\sum_{(m_j,D_j,l_j,Y_j)\in T}\log P(C=Y_j|m_j,D_j,l_j) +\end{equation} + +Decoding a particular mention $m\in D$, is simply done by running fast match to produce a set of likely candidate Wikipedia pages, then generate the system output $\hat{l^{(m)}}$ as in Equation (\ref{hans-eq2}).\\ +Note that the model does all this by only computing similarities between texts in the same language, or by using cross-lingual embeddings, allowing it to transcend across languages. +\section{Experiments} +\label{sec:experiments} +We evaluate our proposed method on the benchmark datasets for English: CoNLL 2003 and TAC 2010 and Cross-Lingual: TAC 2015 Trilingual Entity Linking dataset. +\subsection{Datasets} +\textbf{English} (CoNLL \&\ TAC): The CoNLL dataset \cite{2011-emnlp-NE-disambig-yago} contains 1393 articles with about 34K mentions, +and the standard performance metric is +mention-averaged accuracy. The documents are +partitioned into train, test-a and test-b. Following previous work, we report performance on the 231 test-b +documents with 4483 linkable mentions. The TAC 2010 source collection includes news +from various agencies and web log data. Training +data includes a specially prepared set of 1,500 +web queries. Test data includes 2,250 queries – +1,500 news and 750 web log uniformly distributed +across person, organisation, and geo-political entities. \\ +\textbf{Cross-Lingual} (TAC): We evaluate our method on the TAC 2015 Tri-Lingual Entity Linking datasets which comprises of 166 Chinese documents (84 news and 82 discussion forum articles) and 167 Spanish documents (84 news +and 83 discussion forum articles). The mentions in +this dataset are all named entities of five types: Person, +Geo-political Entity, Organization, Location, +and Facility. + +We use standard train, validation and test splits if the datasets come with it, else we use the CoNLL validation data as dev. For the CoNLL experiments, in addition to the Wikipedia anchor-title index, we also use a alias-entity mapping previously used by \cite{pershina2015personalized,globerson2016collective,yamada2016joint}. We also use the mappings provided by \cite{2011-emnlp-NE-disambig-yago} obtained by extending the “means” tables +of YAGO \cite{hoffart2013yago2}. +\subsection{Hyperparameters} +We tune all our hyper-parameters on the development data. We run CNNs on the sentences and the Wikipedia embeddings with filter size of 300 and width 2. The non-linearity used is \textit{tanh}. For both forward (left) and backward (right) LSTMs, we use mean pooling. We tried max-pooling and also choosing the last hidden state of the LSTMs but mean pooling worked the best. We combine the LSTM vectors for all the left and all the right using mean pooling, as well. For the NTNs, we use sigmoid as the non-linearity and an output size of 10 and use $L2$ regularization with a value of 0.01. Finally, to compute the similarity we feed the output of the NTN to another hidden layer with sigmoid non-linearity for a final output vector of size 300. For the main model, we again use sigmoid non-linearity and an output size of 1000 with a dropout rate of 0.4. We do not update the Wikipedia page embeddings as they did not seem to provide gains in numbers while testing on development data. We also do not update the multi-lingual embeddings for the cross-lingual experiments. For the English experiments, we update the mono-lingual English word embeddings. For the MPBL node, the number of dimensions is 100. +\subsection{Comparison with the SOTA} +The current SOTA for English EL are \cite{globerson2016collective} and \cite{yamada2016joint}. We also compare with LIEL \cite{sil2016one} which is a language-independent EL system and has been a top performer in the TAC annual evaluations. For cross-lingual EL, our major competitor is \cite{tsai2016cross} who uses multi-lingual embeddings similar to us. We also compare with several other systems as shown in Table \ref{table:conll}, \ref{table:tac-en} and \ref{table:tac-es} along with the respective top ranked TAC systems. + +\begin{table*}[t] +\centering +\small +\subfloat[t][CoNLL2003]{ +\begin{tabular}{lcc} +\toprule +Systems & In-KB acc. \% \\ +\midrule +Hoffart \etal\ (2011) &82.5\\ +Gupta \etal (2017) & 82.9\\ +He \etal\ (2013) &85.6\\ +Francis-Landau \etal\ (2016) &85.5\\ +Sil \& Florian (2016) &86.2\\ +Lazic \etal\ (2015) &86.4\\ +Chisholm \& Hachey (2015) &88.7\\ +Ganea \etal\ (2015) &87.6\\ +Pershina \etal\ (2015) &91.8\\ +Globerson \etal\ (2016) &92.7\\ +Yamada \etal\ (2016) &93.1\\ +\midrule +\small +This work &92.1\\ +This work+CtxLSTMs &93.0\\ +This work+CtxLSTMs+LDC &93.4\\ +This work+CtxLSTMs+LDC+MPCM &\textbf{94.0}\\ +\bottomrule +\end{tabular} +\label{table:conll} +} +\subfloat[t][TAC2010]{ +\begin{tabular}{lcc} +\toprule +Systems & In-KB acc. \% \\ +\midrule +TAC Rank 1 &79.2\\ +TAC Rank 2 &71.6\\ +Sil \& Florian (2016) &78.6\\ +He \etal\ (2013) &81.0\\ +Chisholm \& Hachey (2015) &80.7\\ +Sun \etal\ (2015) &83.9\\ +Yamada \etal\ (2016) &85.2\\ +Globerson \etal\ (2016) &87.2\\ +\midrule +\small +This work &85.0\\ +This work+CtxLSTMs &86.3\\ +This work+CtxLSTMs+LDC &86.9\\ +This work+CtxLSTMs+LDC+MPCM &\textbf{87.4}\\ +\bottomrule +\end{tabular} +\label{table:tac-en} +} +\caption{\textbf{Performance comparison on the CoNLL 2003 testb and TAC2010 datasets.} Our system outperforms all EL systems, including the only other multi-lingual system, \cite{sil2016one}.} +\end{table*} +\subsection{English Results} +Table \ref{table:conll} shows our performance on the CoNLL dataset along with recent competitive systems in terms of micro-average accuracy. We outperform \cite{globerson2016collective} by an absolute average of 1.27\% and \cite{yamada2016joint} by 0.87\%. Globerson \etal\ use a multi-focal attention model to select specific context words that are essential for linking a mention. Our model with the lexical decomposition and composition and the multi-perspective context matching layers seems to be more beneficial for the task of EL. + + +Table \ref{table:tac-en} shows our results when compared with the top systems in the evaluation along with other SOTA systems on the TAC2010 dataset. Encouragingly, our model’s performance is slightly better than the top performer, Globerson (2016), and outperforms both the top rankers from this challenging annual evaluation by 8\% absolute percentage points. Note that in both the datasets, our model obtains 7.77\% (on CoNLL) and 8.75\% (on TAC) points better than \cite{sil2016one}, which is a SOTA multi-lingual system. Another interesting fact we observe is that our full model outperforms \cite{sun2015modeling} by 3.5\% points, where they employ NTNs to model the semantic interactions between the context and the mention. Our model uses NTNs to model the left and right contexts from the full entity coreference chain in a novel fashion not used previously in the EL research and seems highly useful for the task. +Interestingly, we observe that the recent \cite{gupta2017entity} EL system performs rather poorly on the CoNLL dataset (7.5\% lower than our model) even when their system employ entity type information from a KB which our system does not. + +While doing ablation study, we notice that adding the LDC layer provides a boost to our model in both the datasets, and the multi-perspective context matching (MPCM) layer provides an additional 0.5\% (average) points improvement. We see that adding in the context LSTM based layer (fine-grained context) adds almost 1\% point (in both the datasets) over the base similarity features. +\subsection{Cross-lingual Results} +\textbf{Spanish:} Table \ref{table:tac-es} shows our performance on cross-lingual EL on the TAC2015 Spanish dataset. The experimental setup is similar as in the TAC diagnostic evaluation, where systems need to predict a link as well as produce the type for a query mention. We use an entity type classifier to attach the entity types to the predicted links as described in our previous work in \cite{sil2015ibm}. We compare our performance to \cite{sil2016one}, which was the top ranked system in TAC 2015, and the cross-lingual wikifier \cite{tsai2016cross}. We see that our zero-shot model trained with the multi-CCA embeddings is 1.32\% and 1.85\% percentage points better than the two competitors respectively.\\ +\textbf{Chinese:} Table \ref{table:tac-zh} displays our performance on the TAC2015 Chinese dataset. +Our proposed model is 0.73\% points better than \cite{tsai2016cross}. In both cross-lingual experiments, the multi-CCA embeddings outperform LS and CCA methods. In Spanish, LS and CCA are tied but in Chinese, CCA performs better than LS. Note that ``this work'' in Table 2 indicates our full model with LDC and MPCM. +\begin{table*} +\centering +\small +\subfloat[t][Spanish]{ +\begin{tabular}{lcc} +\toprule +Systems & Linking Acc \% \\ +\midrule +Sil \& Florian (2016) / TAC Rank 1 &80.4\\ +Tsai \& Roth (2016) &80.9\\ +\midrule +This Work (LS) &81.9\\ +This Work (CCA) &81.8\\ +This Work (Multi-CCA) &\textbf{82.3}\\ +\bottomrule +\end{tabular} +\label{table:tac-es} +}\quad \quad +\subfloat[t][Chinese]{ +\small +\begin{tabular}{lcc} +\toprule +Systems & Linking Acc \% \\ +\midrule +TAC Rank 1 &83.1\\ +Tsai \& Roth (2016) &83.6\\ +\midrule +This Work (LS) &84.1\\ +This Work (CCA) &84.3\\ +This Work (Multi-CCA) &\textbf{84.4}\\ +\bottomrule +\end{tabular} +\label{table:tac-zh} +} +\caption{\textbf{Performance comparison on the TAC 2015 Spanish and Chinese datasets.} Our system outperforms all the previous EL systems.} + +\end{table*} +\section{Related Work\label{sec:related-work} } +Previous works in EL \cite{2006-eacl-bunescu-wikipedia-ne-disambig,2007-cikm-mihalcea-wikify} involved finding the similarity of the context in the source document and the context of the candidate Wikipedia titles. Recent research +on EL has focused on sophisticated global disambiguation algorithms \cite{globerson2016collective,2008-cikm-milne-witten-wikifier,emnlp-chengroth-2013,cikm-joint-nerel} but are more expensive since they capture coherence among titles in the given document. +However, \cite{2011-acl-illinois-wikifier} argue that global systems provide a minor improvement over local systems. Our proposed EL system is a local system which comprises of a deep neural network architecture with various layers computing the semantic similarity of the source documents and the potential entity link candidates modeled using techniques like neural tensor network, multi-perspective cosine similarity and lexical composition and decomposition. + +Sun \etal\ (2015) used neural tensor networks for entity linking, between mention and the surrounding context. But this did not give good results in our case. Instead, the best results were obtained by composing the left and right contexts of all the mentions in the coreference chain of the target mention. In this work, we also introduced state-of-the-art similarity models like MPCM and LDC for entity linking. Combination of all these components helps our model score 3.5 absolute accuracy improvement over Sun \etal\ (2015). + +The cross-lingual evaluation at TAC KBP EL Track that started in 2011 \cite{jioverview2011,ji2015overview} has Spanish and Chinese as the +target foreign languages. One of the top performers \cite{sil2016one}, like most other participants, perform EL in the foreign language (with the corresponding foreign KB), and then find the corresponding English titles using Wikipedia inter-language links. Others \cite{2011cross} translate the query documents to English and do English EL. The first approach relies on a large enough KB in the foreign language, whereas the second depends on a good machine translation system. Similar to \cite{tsai2016cross}, the ideas proposed in this paper make significantly simpler assumptions on the availability of such resources, and therefore can also scale to lower resource languages, while doing very well also on high-resource languages. However, unlike our model they need to train and decode the model on the target language. Our model once trained on English can perform cross-lingual EL on any target language. + +Some recent work involves \cite{lin2017list} but is unrelated since it solves a different problem (EL from only lists) than generic EL and hence an apples-apples comparison cannot be done. \cite{pan2017cross} is related but their method prefers common popular entities in Wikipedia and they select training data based on the topic of the test set. Our proposed method is more generic and robust as it is once trained on the English Wikipedia and tested on any other language without re-training. \cite{tan2017entity} solves a different problem by performing EL for queries while we perform EL for generic documents like news. Recently \cite{gupta2017entity} propose an EL system by jointly encoding types from a knowledge-base. However, their technique is limited to only English and unlike us do not perform cross-lingual EL. +\section{Conclusion} +\label{sec:conclusion} +Recent EL research, that we compare against, have produced models that achieve either SOTA mono-lingual performance or cross-lingual performance, but not both. We produce a model that performs zero-shot learning for the task of cross-lingual EL: once trained on English, the model can be applied to any language, as long as we have multi-lingual embeddings for the target language. Our model makes effective use of % +the similarity models (LDC, MPCM) and composition methods (neural tensor network) to capture similarity/dissimilarity between the query mention's context and the target Wikipedia link's context. We test three methods of generating multi-lingual word embeddings and determine that the MultiCCA-generated embeddings perform best for the task of EL for both Spanish and Chinese. Our model has strong experimental results, outperforming all the previous SOTA systems in both mono and cross-lingual experiments. Also, with the increased focus on cross-lingual EL in future TAC evaluations, we believe that this zero-shot learning technique would prove useful for low-resource languages: train one model and use it for any other language. +\section{Acknowledgements} +We thank Zhiguo Wang for the help with the LDC and MPCM node. We also thank Georgiana Dinu and Waleed Ammar for providing us with the multi-lingual embeddings. We are grateful to Salim Roukos for the helpful discussions, and the anonymous reviewers for their suggestions. + + +\bibliographystyle{aaai} +\bibliography{sil} diff --git a/1712.01907v1.txt b/1712.01907v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..ee8cb4703a2e41771d811aafb543432a7adedbf0 --- /dev/null +++ b/1712.01907v1.txt @@ -0,0 +1,755 @@ +\section{Introduction} +Recent advances in the field of computer vision have provided highly cost-effective solutions for developing advanced driver assistance systems (ADAS) for automobiles. +Furthermore, computer vision components are becoming indispensable to improve safety and to achieve AI in the form of fully automated, self-driving cars. +This is mostly by virtue of the success of deep learning, which is regarded to be due to the presence of large-scale supervised data, proper computation power and algorithmic advances~\cite{book_deeplearn}. + +Among all ADAS related problems, in this paper, we tackle unseen traffic sign recognition. +A distinctive difference related to this problem as regards traditional recognition problems is that synthetic traffic-sign templates are exploited as representative anchors, whereby classification can be done for an actual query image by finding the minimum distance to the templates of each class (\ie, few-shot learning with domain difference). + + +In reality, traffic signs differ depending on the country, but one may obtain synthetic templates from traffic-related public agencies. +Nonetheless, the diversity of templates for a single class is limited; hence, we focus on scenarios of challenging one-shot classification~\cite{kochsiamese,lake2015human,miller2000learning} with domain adaptation, where a machine learning model must generalize to new classes not seen in the training phase given only a few examples of each of these classes but from different domains. + +In practice, this type of model is especially useful for ADAS in that: 1) one can avoid high cost re-training from scratch, 2) one can avoid annotating large-scale supervised data, and 3) it is readily possible to adapt the model to other environments. + + +Given the success of deep learning, a naive approach for the few-shot problem would be to re-train a deep learning model on a new scarce dataset. However, in this limited data regime, this type of naive method will not work well, likely due to severe over-fitting~\cite{lake2015human}. +While people have an inherent ability to generalize from only a single example with a high degree of accuracy, the problem is quite difficult for machine learning models~\cite{lake2015human}. + + + + +\begin{figure*} + \centering{\includegraphics[width=1\linewidth]{./figure/codomain_idea2}}\hspace{2mm} + \caption{Illustration of a synthetic template and real image co-domain mapping.} + \label{fig:idea} +\end{figure*} + + + +Thus, our approach is based on the following hypotheses: 1) the existence of a co-embedding space for synthetic and real data, and 2) the existence of an embedding space where real data is condensed around a synthetic anchor for each class. We illustrate the idea in \Fref{fig:idea}. +Taking these into account, we learn two non-linear mappings using a neural network. The first involves mapping for a real sample into an embedding space, and the second involves mapping of a synthetic anchor onto the same metric space. +We leverage the quadruplet relationship to learn non-linear mappings, which can provide rich information to learn generalized and discriminative embeddings. +Classification is then performed for an embedded query point by simply finding the nearest class anchor. +Despite its simplicity, our method outperforms with a margin in the unseen data regime. +\section{Related work} +Our problem can be summarized as a modified one-shot learning problem that involves heterogeneous domain datasets. +This type of problem has gained little attention. Furthermore, to the best of our knowledge, our work is the first to tackle unseen traffic sign recognition with heterogeneous domain data; +we therefore summarize the work most relevant to our proposed method in this section. + + +Non-parametric models such as nearest neighbors are useful in few-shot classification~\cite{vinyals2016matching,santoro2016meta}, in that they can be naturally adapted to new data and do not require training of the model. However, the performance depends on the chosen metric~\cite{atkeson1997locally}.\footnote{For up-to-date thorough surveys on metric learning, please refer to \cite{kulis2013metric,bellet2015metric}.} +To overcome this, +Goldberger~\etal\cite{goldberger2004neighbourhood} propose the neighborhood components analysis (NCA) and that learns the Mahalanobis distance to maximize the accuracy of the $K$-nearest-neighbor ($K$-NN). +Weinberger~\etal\cite{weinberger2009distance}, who studied large margin nearest neighbor (LMNN) classification, also maximize the $K$-NN accuracy with a hinge loss that encourages the local neighborhood of a point to contain other points with identical labels with some margin, and vice versa. +Our work also adopts the hinge loss with a margin in the same spirit of Weinberger~\etal +Because NCA and LMNN are limited on linear model, each is extended to a non-linear model using a deep neural network in \cite{salakhutdinov2007learning} and \cite{min2009deep} respectively. + + + +Our work may be regarded as a non-linear and quadruple extension of +Mensink~\etal\cite{mensink2013distance} and +Perrot~\etal\cite{perrot2015regressive} to one-shot learning, +in that they leverage representative auxiliary points for each class instead of individual examples of each class. +These approaches are developed to adapt to new classes rapidly without re-training; however, they are designed to handle cases where novel classes come with a large number of samples. +In contrast, in our scenario, a representative example is given explicitly as a template image of a traffic sign. +Given such a template, we learn non-linear embedding in an end-to-end manner without pre-processing necessary in both Mensink~\etal and Perrot~\etal to obtain the representatives. + + + + + + +All of these NN classification schemes learn the metric via a pairwise relationship. +In the recent metric learning literature, there have been attempts~\cite{wang2014learning,hoffer2015deep,law2016learning,chen2017beyond,huang2016learning} to go beyond learning metrics using only a pairwise relationship (\ie, 2-tuple, \eg, Siamese~\cite{bromley1993signature,chopra2005learning,hadsell2006dimensionality}): triplet~\cite{weinberger2009distance,wang2014learning,hoffer2015deep}, quadruplet~\cite{law2016learning} and quintuplet~\cite{huang2016learning}. +The use of tuples of more than a triple relationship may be inspired from the argument of Kendall and Gibbons~\cite{kendall1990rank}, who argued that humans are better at providing relative (\ie, at least triplet-wise) comparisons than absolute comparisons (\ie, pairwise). +While our method also exploits a quadruple relationship, the motivation behind this composition is rather specific for our problem definition, in which two samples from template sets and two samples from real sets have clear combinatorial pairwise relationships. More details will be described later. + + + + + + + + +Other one-shot learning approaches take wholly different notions. +Koch~\etal\cite{kochsiamese} uses Siamese network to classify whether two images belong to the same class. +To address one-shot learning for character recognition, Late~\etal\cite{lake2015human} devise a hierarchical Bayesian generative model with knowledge of how a hand written character is created. +A recent surge of models, such as a neural Turing machine~\cite{graves2014neural}, stimulate the meta-learning paradigm~\cite{santoro2016meta,vinyals2016matching,ravi2017fewshot} for few-shot learning. +Comparing to these works that have limited memory capacities, +the NN classifier has an unlimited memory and can, automatically store and retrieve all previously seen examples. +Furthermore, in the few-shot scenario, the amount of data is very small to the extent that a simple inductive bias appears to work well without the need to learn complex input-sensitive embedding~\cite{vinyals2016matching,santoro2016meta,ravi2017fewshot}, as we do so. +This provides the $k$-NN with a distinct advantage. + + + + + +Moreover, because we have two data sources, synthetic templates and real examples, a domain difference is naturally introduced in our problem. +There is a large amount of research that smartly solves domain adaptation (refer to the survey by Csurka~\etal\cite{book_DA} for a thorough review), but we deal with this by simply decoupling the network parameters from each other, the template and the real domains. +This method is simple, but in the end it generalizes well owing to the richer back-propagation gradients from the quadruple combinations. +\section{Quadruple network for jointly adapting domain and learning embedding} +Our goal is to learn embeddings, such that different domain examples are embedded into a common metric space and where their embedded features favor to be generalized as well as discriminative. + +To this end, we leverage a quadruplet relationship, consisting of two anchors of different classes and two others for examples corresponding to the anchors. We first describe the quadruple (4-tuple) construction in the following section. Subsequently, we define the embeddings followed by the +objective functions and quadruplet network. + + + + +\noindent\textbf{Notation}\quad +We consider two imagery datasets: the template set $\mathcal{T}{=} \{ (\bT, y) \}$, where each $\bT$ denotes a representative template image and $y{\in}\{1, \dots, C\}$ is the corresponding label (out of the $C$ class), and the real example set $\mathcal{X}{=} \{ \mathcal{X}_k \}_{k=1}^C$, where $\mathcal{X}_k$ is the set of real images $\{\bX\}$ of class-$k$. +For simplicity, we use $\bT_k$ ($\bX_k$) to denote a sample labeled with class-$k$. + + +We define Euclidean embeddings as $f(\cdot)$, where $f(\mathbf{x})$ maps a high-dimensional vector $\mathbf{x}$ into a $D$-dimensional feature space, \ie, $\mathbf{e}{=} f(\mathbf{x}) \in \R^D$. +\subsection{Quadruple (4-tuple) construction} +% +Our idea is to embed template and real domain data into the same feature space such that a template sample acts as an anchor point on the feature space and real samples relevant to the anchor form a cluster around it, as illustrated in \Fref{fig:idea}. +Specifically, we aim to achieve two properties for an embedded feature space: 1) distinctiveness between anchors is favored, and 2) real samples must be mapped close to the anchor that corresponds to the same class. + +To leverage the relational information, we define a quadruple, a basic element, by packing two template images from different classes and two real images corresponding to respective template classes, \ie, for simplicity, two classes $A$ and $B$ are considered, then $(\bT_A, \bT_B, \bX_A, \bX_B)$. +From pairwise combinations within the quadruple, we can reveal several types of relational information as follows:\\[3pt] +\noindent +\tcircled{1} $\bT_A$ should be far from $\bT_B$ in an embedding space, \\ +\noindent +\tcircled{2} $\bX_A$ should be far from $\bX_B$ in an embedding space, \\ +\noindent +\tcircled{3} $\bX_A$ (or $\bX_B$) should be close to $\bT_A$ (or $\bT_B$) in an embedding space,\\ +\noindent +\tcircled{4} $\bT_A$ (or $\bT_B$) should be far from $\bX_B$ (or $\bX_A$) in an embedding space,\\ +whereby we derive the final objective function. +These relations depicted in \Fref{fig:quadruplet_relation}. + + + + + +\paragraph{Quadruple sampling} +We sampled two templates $(\bT_{A}, y)$ and $(\bT_{B}, y')$ from template set $\mathcal{T}$ while guaranteeing two different classes, followed by the two real images of $\bX_{A} \in \mathcal{X}_{y}$ and $\bX_{B} \in \mathcal{X}_{y'}$. + + + + +\paragraph{Comparison to other tuple approaches} +In metric learning, the most common approaches would be the Siamese~\cite{bromley1993signature,chopra2005learning,hadsell2006dimensionality} and triplet~\cite{weinberger2009distance,wang2014learning,hoffer2015deep}, which typically use 2- and 3-tuples, respectively. +From the given tuple, they optimize with the pairwise differences. This concept can be viewed as follows: given a tuple, the Siamese has only a single source of loss (and its gradient), while triplets utilize two sources, \ie, (query, positive) and (query, negative). +With this type of simple comparison, we can intuitively conjecture higher stability or performance of triplet network over Siamese network. + +Law~\etal\cite{law2016learning} deal with a particular ambiguous quadruple relationship $(\mathsf{a}) {\prec}(\mathsf{b}){\simeq}(\mathsf{c}){\prec}(\mathsf{d})$ by forcing the difference between $(\mathsf{b})$ and $(\mathsf{c})$ to be smaller than the difference between $(\mathsf{a})$ and $(\mathsf{d})$. +Huang~\etal\cite{huang2016learning} (quintuplet, 5-tuple) is devised a means to handle class imbalance issues by leveraging the relationships among three levels (\eg, strong, weaker and weakest in terms of a cluster analysis) of positives and negatives. +Comparing the motivations of these approaches, for instance indefinite relativeness, our quadruple comes from a specific relationship, \ie, heterogeneous domain data. +Moreover, it is important to note that our quadruple provides richer information (a total of $6$ pairwise information) compared to the method of Law~\etal (quadruplet) which leverages a single constraint from a quadruple. It is even richer than Huang~\etal (quintuplet), who provides $3$ constraints. +\subsection{Quadruplet Network} +\label{sec:quad_loss} + +Given the defined quadruple, we propose a quadruple metric learning that learns to embed template images and real images into a common metric space, say $\R^D$, through an embedding function. +In order to deal with non-linear mapping, the embedding $f$ is modeled as a neural network, of which set of weight parameters are denoted as $\btheta$. +Since we deal with data from two different domains, template and real images, we simply use two different neural networks $\btheta_\mathsf{T}$ and $\btheta_\mathsf{R}$ for the template and real images respectively, expressed as $f_\mathsf{T}(\cdot) {=} f(\cdot\,; \btheta_\mathsf{T})$ and $f_\mathsf{R}(\cdot) {=} f(\cdot\,; \btheta_\mathsf{R})$, such that we can adapt both domains. Now, we are ready to define the proposed quadruple network. + +The proposed quadruple network $Q$ is composed of two Siamese networks, the weights of which are shared within each pair. +One part embeds features from template images and the other part for real images. +Quadruple images from each domain are fed into the corresponding Siamese networks (depicted in \Fref{fig:quadruplet_structure}), and denoted as +\begin{equation} +\begin{aligned} +&Q\big( \left( \bT_A,\bT_B,\bX_A,\bX_B \right); \btheta_\mathsf{T}, \btheta_\mathsf{R} \big) \\ +&=\big[ f_\mathsf{T}(\bT_A), f_\mathsf{T}(\bT_B), f_\mathsf{R}(\bX_A), f_\mathsf{R}(\bX_B) \big] \\ +&= \big[ \mathbf{e}_\mathsf{T}^A, \mathbf{e}_\mathsf{T}^B, \mathbf{e}_\mathsf{X}^A, \mathbf{e}_\mathsf{X}^B \big], +\end{aligned} +\label{eqn:quad} +\end{equation} +for two different arbitrary classes $A$ and $B$, +where $\mathbf{e}{\in} \R^d$ represents the embedded vector mapped by the embedding function $f$. + + +\begin{figure}[t] + \centering + \captionsetup[subfigure]{aboveskip=4pt} + \begin{tabular}{c@{\hspace{0mm}}c@{\hspace{0mm}}} + \subcaptionbox{\label{fig:quadruplet_structure}}{\includegraphics[width=0.95\linewidth]{./figure/QuadNet_structure}} + \\ + \subcaptionbox{\label{fig:quadruplet_relation}}{\includegraphics[width=0.7\linewidth]{./figure/QuadNet_relations2}} + \end{tabular} + \caption{(a) Quadruplet network structure. (b) pairwise relations of embedded vectors.} + \label{fig:QuadNet} +\end{figure} + + + + +\paragraph{Loss function} + +We mainly utilize the $l_2$ hinge embedding loss with a margin to train the proposed network. +Given outputs quadruplet features $\big[ \mathbf{e}_\mathsf{T}^A, \mathbf{e}_\mathsf{T}^B, \mathbf{e}_\mathsf{R}^A, \mathbf{e}_\mathsf{R}^B \big]$, +we have up to six pairwise relationships, as shown in \Fref{fig:quadruplet_relation}), and obtain six pairwise Euclidean feature distances as $\{d(\mathbf{e}_\mathsf{j}^k, \mathbf{e}_\mathsf{j'}^{k'})\}_{j,j' \in \{\mathsf{T},\mathsf{R}\}}^{k,k' \in \{A,B\}}$, where $d(\mathsf{a},\mathsf{b}) = \|\mathsf{a}{-}\mathsf{b}\|_2$ denotes the Euclidean distance. +Let $h_m(d)$ denote the hinge loss with margin $m$ as $h_m(d) = \max(0,m{-}d)$, where $d$ is the distance value. +We then encourage the embedded vectors with the same label pairs (\ie, if $k = k'$) to be close by applying the loss $h_{-m}(-d)$, while pushing away the different label pairs by applying $h_{m'}(d)$. + + + + +To induce the embedded feature space with the aforementioned two properties in the \emph{Quadruple Construction} section, the minimum number of necessary losses is three, while we can exploit up to six losses; hence, we have several choices to formulate the final loss function, as described below: + + + +\begin{eqnarray} +&\hspace{-4mm}\textsf{HingeM-3}: {L3_{m,m'}} {=}&\hspace{-2mm} h_m\left( d\left(\mathbf{e}_\mathsf{T}^A, \mathbf{e}_\mathsf{T}^{B} \right) \right) \nonumber\\ +&& +\hspace{-24mm}{+}{h_{-m'}}\left( d\left(\mathbf{e}_\mathsf{T}^A, \mathbf{e}_\mathsf{X}^{A} \right) \right) ++ +h_{-m'}\left( d\left(\mathbf{e}_\mathsf{T}^B, \mathbf{e}_\mathsf{X}^{B} \right) \right), +\label{eqn:loss3}\\ +&\hspace{-4mm}\textsf{HingeM-5}: {L5}_{m,m'} {=}&\hspace{-2mm}{L3}_{m,m'} + h_{m}\left( d\left(\mathbf{e}_\mathsf{T}^A, \mathbf{e}_\mathsf{X}^{B} \right) \right) \nonumber\\ +&&+ +h_{m}\left( d\left(\mathbf{e}_\mathsf{X}^A, \mathbf{e}_\mathsf{T}^{B} \right) \right), +\label{eqn:loss5}\\ +&\hspace{-4mm}\textsf{HingeM-6}: {L6}_{m,m'} {=}&\hspace{-2mm}{L5}_{m,m'} + h_{m}\left( d\left(\mathbf{e}_\mathsf{X}^A, \mathbf{e}_\mathsf{X}^{B} \right) \right). +\label{eqn:loss6} +\end{eqnarray} + + + +In addition, inspired by the contrastive loss~\cite{chopra2005learning}, we also adopt an alternative loss by replacing the $h_{-m}(-d)$ terms in \Eref{eqn:loss3} with directly minimizing $d$.\footnote{This can be viewed as a $l_1$ version of the contrastive loss~\cite{chopra2005learning}; this is how \texttt{HingeEmbeddingCriterion} is implemented for the pairwise loss in \texttt{Torch7}~\cite{collobert2011torch7}.} +We denote this alternative loss simply as \textsf{contrastive} with a slight abuse of the terminology. +We will compare these losses in the \emph{Experiments} section. Analogous to traditional deep metric learning, training with these losses can be done with a simple SGD based method. +By using shared parameter networks, the back-propagation algorithm updates the models \wrt several relationships; \eg, in the \textsf{HingeM-6} case, the template tower is updated \wrt 5 pairwise relationships (\ie, $(\mathsf{T}^A, \mathsf{T}^B), (\mathsf{T}^A, \mathsf{X}^A), +(\mathsf{T}^B, \mathsf{X}^B), (\mathsf{T}^A, \mathsf{X}^B), (\mathsf{X}^A, \mathsf{T}^B)$), analogously for the real tower. +\section{Experiments} + +\subsection{Experiment setup} +\paragraph{Competing methods} +We compare the proposed method with other deep neural network based previous works and the additionally devised baseline, as follows: +{ + \setdefaultleftmargin{4mm}{}{}{}{}{} + \begin{itemize} + \item[-] \emph{IdsiaNet}~\cite{cirecsan2012multi} is a competition winner of the German Traffic-Sign Recognition Benchmark~\cite{stallkamp2012man} (GTSRB). We directly used an improved implementation~\cite{impidsia:repository}.\footnote{The improved performance is reported in \cite{impidsia:repository} with an even simpler architecture and without using ensemble. For brevity, we denote this improved version simply as \emph{IdsiaNet}. Detailed information can also be found in the supplementary material.} + For all of the experiments, IdsiaNet is exhaustively compared as a supervised model baseline, in the same philosophy of the deep generic feature~\cite{donahue2014decaf}. Moreover, templates are not used for training. + For a fair comparison, the architecture itself is adopted as the base network for the following models. + \item[-] \emph{Triplet}~\cite{hoffer2015deep} (Hoffer~\etal) is similar to our model but with triplet data. + Three weight shared networks are used, while in training, we randomly sampled triplets within the real image set with labels, such that no template image is exposed during triplet training. This training method is consistent with Hoffer~\etal + + \item[-] \emph{Triplet-DA} (domain adaptation) is a variant devised by us to test our hypothesis that involving different domain templates as an anchor is beneficial. + Three weight shared networks are used, and for triplet sampling, we sample one template $(\bT, y)$ from template set $\mathcal{T}$ and then sample positive and negative real images from $\mathcal{X}_y$ and $\mathcal{X}_{k \neq y}$ respectively. + \end{itemize} +} + + + +\paragraph{Implementation details} For fairness, all of the details are equally applied unless otherwise specified. All input images are resized to $48{\times} 48$ and the mean intensity of training set is subtracted. +We did not perform any further preprocessing, data augmentation, or ensemble approach. + +We use the same improved IdsiaNet~\cite{impidsia:repository} for the base network of \emph{Triplet}, \emph{Triplet-DA} and our \emph{Quadruplet}, but replace the output dimension of the final layer \texttt{FC2} to be $\R^D$ without a softmax layer. Every model is trained from scratch. Most of the hyper parameters are based on the implementation~\cite{impidsia:repository} with a slight modification (\ie, fixed learning rates: $10^{-3}$, momentum: $0.9$, weight decay: $10^{-4}$, mini-batch size: 100, optimizer: stochastic gradient descent). +Models are trained until convergence is reached, \ie, $\tfrac{L_t - L_{t-1}}{L_{t-1}}{<} 5\%$ where $L_t$ denotes the loss value at $t$-th iteration. We observed that the models typically converged at around $15k$-$20k$ iterations. +All networks were implemented using \texttt{Torch7}~\cite{collobert2011torch7}. +\subsection{Dataset} +We use two traffic-sign datasets, GTSRB~\cite{stallkamp2012man} and Tsinghua-Tencent 100K~\cite{zhu2016traffic} (TT100K). +Since our motivation can be considered to involve dealing with a deficient data regime and a data imbalance caused by rare classes, we additionally introduce a subset split from GTSRB, referred to here as GTSRB-sub. +To utilize the dataset properly for our evaluation schemes, given the train and test set splits provided by the authors, we further split them into seen, unseen and validation partitions, as illustrated in \Fref{fig:datapartition}. +The validation set is constructed by random sampling from the given training set. +A description of the dataset construction process follows. +{For more details,} the reader can refer to the supplementary material. + +\begin{wrapfigure}[9]{R}{0.23\textwidth} +\centering +\includegraphics[width=0.9\linewidth]{./figure/dataset_partition} +\caption{Partitions of dataset.} +\label{fig:datapartition} +\end{wrapfigure} + + +\noindent\textbf{GTSRB-all}\quad +GTSRB contains 43 classes. The dataset contains severe illumination variation, blur, partial shadings and low-resolution images. The benchmark provides partitions into {training} and {test} sets. The training set contains $39k$ images, where $30$ consecutively captured images are grouped, called a ``track''. The test set contains $12k$ images without continuity and, thus does not form tracks. +We selected 21 classes that have the fewest samples as unseen classes with the remaining 22 classes as the seen classes. Template images are involved in the dataset. + + + +\noindent\textbf{GTSRB-sub}\quad{ + To analyze the performance of the deficient data regime, we created a subset of GTSRB-all, forming a smaller but class-balanced training set with sharing the test set of GTSRB-all. Hence, numeric results will be compatibly comparable to that from GTSRB-all. For the training set, we randomly select 7 tracks (\ie, 210 images) for each seen classes.} + +\noindent\textbf{TT100K-c}\quad{ The TT100K detection dataset includes over 200 sign classes. + We cropped traffic sign instances from the scenes to build the classification dataset (called TT100K-c). + Although it contains the huge number of classes, most of the classes do not have enough instances to conduct the experiment. + We only selected classes having official templates\footnote{The official templates are provided by the Beijing Traffic Management Bureau at, + \url{http://www.bjjtgl.gov.cn/english/traffic signs/index.html}.} available and a sufficient number of instances. + We split \hbox{TT100K-c} into the train and test set according to the number of instances. + We set 24 classes with ${\geq} 100$ instances for seen classes and select 12 unseen classes as those having $50$-$100$ instances. + The {training} set includes half of the seen class samples, and the other half is sorted into the test set. +} +\subsection{One-shot classification} +We perform one-shot classification by 1-nearest neighbor (1-NN) classification. +For 1-NN, the Euclidean distance is measured between embedding vectors by forward-feeding a query (real image) and the anchors (template images) to the network, after which the most similar anchor out of the $C$ classes is found ($C$-way classification). +For the NN performance, we measure the average accuracy for each class. +The seen class performance is also reported for a reference purpose. + + + +\paragraph{Self-Evaluation} +\label{sec:selfeval} + +\begin{table}[t] + \centering + + \caption{Evaluations of the proposed quadruplet network with varying parameters. Evaluation is conducted on the validation set of GTSRB-all. Accuracy ($\%$) on validation set is reported.} + \label{table:selfeval} + + \begin{subtable}[h]{0.3\textwidth} + \centering + \resizebox{!}{0.2\textwidth}{% + \begin{tabular}{cccc} + \toprule + \multirow{3}{*}{\begin{tabular}[c]{@{}c@{}}Embedding dim\\( HingeM-5 ) \end{tabular}} + & \multicolumn{3}{c}{Top1 NN} \\ + \cmidrule{2-4} + & Avg. & Seen & Unseen \\ \midrule + $D=50$ & 67.1 & 92.2 & 40.8 \\ + $D=100$ & 69.1 & 95.3 & 41.6 \\ + $D=150$ & 68.9 & 94.2 & 42.4 \\ + \bottomrule + \end{tabular} + } + \caption{Varying embedding dimension $d$.} + \label{tab:selfeval_dim} + \end{subtable} + + \begin{subtable}[h]{0.3\textwidth} + \centering + \resizebox{!}{0.2\textwidth}{% + \begin{tabular}{cccc} + \toprule + \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}Loss terms\\(dim 100) \end{tabular}} + & \multicolumn{3}{c}{Top1 NN} \\ + \cmidrule{2-4} + & Avg. & Seen & Unseen \\ \midrule + \textsf{HingeM}-3 & 67.3 & 93.1 & 40.3 \\ + \textsf{HingeM}-5 & 69.1 & 95.3 & 41.6 \\ + \textsf{HingeM}-6 & 68.9 & 97.3 & 39.2 \\ + \bottomrule + \end{tabular} + } + \caption{Varying number of pairwise loss terms.} + \label{tab:selfeval_loss} + \end{subtable} +\end{table} + + +\begin{figure}[t] + \centering +\includegraphics[width=0.7\linewidth]{./figure/failure} + \caption{Some of failure cases for unseen recognition.} + \label{fig:failurecase} +\end{figure} + + + + + +The proposed \emph{Quadruplet} network has two main factors: the embedding dimension $D$ and the number of pairwise loss terms. +We evaluate these on the validation sets $\Psi_s$ and $\Psi_u$ of GTSRB-all. +The \emph{Quadruplet} network is trained only with the seen training set $\Phi _s$. + +\emph{Embedding dimension}: +We conduct the evaluation while varying the embedding dimension $D$, as reported in \Tref{tab:selfeval_dim}. +We vary $D$ from $50$ to $150$ and measure the one-shot classification accuracy. +We observed that the overall average accuracy across the seen and unseen classes peaked at $D{=}100$. +While the unseen performance may increase further beyond $D=150$, since this sacrifices the seen performance, we select the dimension with the best average accuracy, \ie, $D=100$, as the reference henceforth. + + +\emph{pairwise loss terms}: +The quadruplet model gives 6 possible pairwise distances between outputs. Intuitively, three possible options, \ie, \textsf{HingeM-3}, \textsf{HingeM-5} and \textsf{HingeM-6} in +Eqs.~(\ref{eqn:loss3}-\ref{eqn:loss6}), satisfy our co-domain embedding property. +The results in \Tref{tab:selfeval_loss} show a trade-off between different losses. \textsf{HingeM-3} performs worse on both seen and unseen classes than the others, while the other two have a clear trade-off. This implies that \textsf{HingeM-3} is not producing enough information (\ie, gradients) to learn a good feature space. \textsf{HingeM-5} outperforms Loss6 on unseen classes but \textsf{HingeM-6} is better on seen classes. We suspect that complex pairwise relationships among real samples may lead to a feature space which is overly adapted to seen classes. +This trade off can be used to adjust between improving the seen class performance or regularizing the model for greater flexibility. +We report the following results based on \textsf{HingeM-5} hereafter. + + + + + + + + + +\begin{table} + \centering + + \caption{One-shot classification (Top 1-NN) accuracy ($\%$) on the unseen classes. Performance on seen classes are shown as an additional reference.} + \label{tbl:top1_nn} + + \resizebox{1\linewidth}{!}{% + \begin{tabular}{cccccccccc} + \toprule + \multirow{3}{*}{Network type} & & \multicolumn{6}{c}{Datasets} \\ \cmidrule{3-10} + & Anchor & \multicolumn{2}{c}{GTSRB} & \multicolumn{2}{c}{GTSRB subset} & \multicolumn{2}{c}{TT100K}\\ + \cmidrule(l{2pt}r{2pt}){3-4} \cmidrule(l{2pt}r{2pt}){5-6} \cmidrule(l{2pt}r{2pt}){7-8} \cmidrule(l{2pt}r{0pt}){9-10} + & & Seen & Unseen & Seen & Unseen & Seen & Unseen \\ + \midrule + IdsiaNet & $\times$ & 74.6 & 40.2 & 59.4 & 34.7 & 87.7 & 14.6 \\ + Triplet & Real & 62.6 & 33.9 & 54.9 & 23.5 & 5.9 & 1.0 \\ \midrule + Triplet-DA & Template & 86.0 & \textbf{54.5} & 60.8 & 47.6 & 86.2 & 67.1 \\ + \midrule + Quad.+\textsf{contrastive-5} & Template & \textbf{92.4} & 42.7 & 69.2 & 41.8 & 92.0 & \textbf{67.5} \\ + Quad.+\textsf{hingeM} & Template & 90.8 & 45.2 & \textbf{70.1} & \textbf{47.8} & \textbf{94.9} & 67.3 \\ + \bottomrule + \end{tabular} + } + + + \caption{One-shot classification (Top 1-NN) accuracy ($\%$) from GTSRB-all to TT100K-c.} + \label{table:transfer} + + \resizebox{0.7\linewidth}{!}{% + \begin{tabular}{cc} + \toprule + \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}} Network trained on GTSRB \end{tabular}} & Top1 NN \\ & sample average + \\ \midrule + IdsiaNet & 36.5 \\ + Triplet DA & 34.1 \\ + Quadruple+\textsf{hingeM} & \textbf{42.3} \\ + \bottomrule + \end{tabular} + } +\end{table} + + + + + + + + + +\paragraph{Comparison to other methods} +We compare the results here with those of other methods on the test sets $\Omega_s$ and $\Omega_u$ of three datasets. +All networks are trained only with the seen training and validation set ${\Phi _s} \cup {\Psi _s}$ of respective datasets. + + +For \emph{IdsiaNet}, we use the activation of \texttt{FC1} for feature embedding. +For the other networks, we use the final embedding vectors. +For the \emph{Quadruplet} network, we test two cases with \textsf{contrastive-5} and \textsf{HingeM-5}. + + +\Tref{tbl:top1_nn} shows the results on the three datasets, where \emph{Triplet} has the lowest performance, while \emph{Triplet-DA} performs well. Moreover, our quadruplet network outperforms \emph{Triplet-DA} in most of cases for both seen and unseen classes. This supports our hypothesis that the template (also a different domain) anchor based metric learning and the quadruplet relationship may be helpful for generalization purposes. + +To check the embedding capability of each approach further, we trained each model on GTSRB ${\Phi _s} \cup {\Psi _s}$ and tested on TT100K-c ${\Omega_s} \cup {\Omega_u}$. This experiment qualifies how the networks perform on two completely different traffic sign datasets. \Tref{table:transfer} shows the top1-NN performance of each model. Our model performs best tn the transfer scenario, which implies that good feature representation is learned. + +In order to demonstrate quantitatively the behavior of the \emph{Quadruplet} network, we visualize unseen examples that are often confused by \emph{Quadruplet} in \Fref{fig:failurecase}. +The unseen classes of examples that are highly similar to other classes are challenging even for humans; furthermore due to the poor illumination condition, motion blur and low resolution. +\subsection{Learned representation evaluation} +In this experiment, we evaluate the generalization behavior of the proposed quadruple network, which is analyzed by comparing the representation power of each network over unseen regimes (and seen class cases as a reference). +In order to assess the representation quality of each method purely, we pre-train competing models and our model for ${\Phi _s} \cup {\Psi _s}$ of each dataset (\ie, only on seen classes), fix the weights of these models, and use the activations of \texttt{FC1} (350 dimensions) of them as a feature. +Given the features extracted by each model, we measure the representation performance by separately training the standard multi-class SVM~\cite{chang2011libsvm} with the radial basis kernel such that the performance heavily relies on feature representation itself. +\footnote{We follow an evaluation method conducted in \cite{tran2015learning}, where the qualities of deep feature representations are evaluated in the same way.} + +We use identical SVM parameters (nonlinear RBF kernel, $C=100, tol=0.001$) in all experiments. +In contrast to \texttt{FC1} trained only on seen data, the SVM model is trained on both \emph{seen} and \emph{unseen} classes with an equal number of instances per class, and we vary the number of per class training samples: 10, 50, 100, and 200. SVM training samples are randomly sampled from the set ${\Phi _s} \cup {\Psi _s} \cup {\Phi _u} \cup {\Psi _u}$ (\Fref{fig:datapartition}), and the entire test set ${\Omega_s} \cup {\Omega_u}$ is used for the evaluation. We report the average score and confidence interval by repeating the experiments 100 times for the case of [No. instances$/$class: 10] and 10 times for the cases of [No. instances$/$class: 50, 100, 200]. For each sampling, we fix a random seed and test each model with the same data for a fair comparison. + +With the three datasets, we show the results of the unseen ${\Omega_u}$ and seen ${\Omega_s}$ test cases in Table~\ref{tbl:svm} and \ref{tbl:svm_seen}, respectively. +The unseen and seen class datasets are mutually exclusive; hence, the errors should be compared in each dataset independently, \eg, the numbers in \Tref{tbl:svm}-(a) are not directly comparable with those in \Tref{tbl:svm_seen}-(a). +Instead, we can observe the algorithmic behavior difference by comparing Table~\ref{tbl:svm} and \ref{tbl:svm_seen} with respect to the relative performance. + + + + + +\begin{table}[t] + \centering + \caption{Feature representation quality comparison for \textbf{unseen classes}. SVM classification errors ($\%$) are reported with the datasets, GTSRB-all, GTSRB-sub and TT100K-c, and according to the number of SVM training instances per class. +Notice that, for all the networks, the classes evaluated in this experiment are not used for training the networks, \ie, \textbf{unseen classes} are used only for SVM training. +Marked in bold are the best results for each scenario, as well as other results with an overlapping confidence interval with 95$\%$. +} + \label{tbl:svm} + + \begin{subtable}[h]{1\linewidth} + \centering + \resizebox{1\linewidth}{!}{% + \begin{tabular}{ccccccccccc} + \toprule + \multirow{2}{*}{Network} & \multicolumn{4}{c}{No. instances$/$class} \\ \cmidrule{2-5} + & 200 & 100 & 50 & 10 \\ % + \midrule + IdsiaNet + & 6.14 ($\pm$0.50) & 6.82 ($\pm$0.57) & 7.82 ($\pm$0.64) & 11.01 ($\pm$0.31) \\ + Triplet & 7.22 ($\pm$0.33) & 7.94 ($\pm$0.33) & 8.79 ($\pm$0.40) & 15.83 ($\pm$0.38) \\ + Triplet-DA & 9.04 ($\pm$0.30) & 9.35 ($\pm$0.42) & 10.26 ($\pm$0.63) & 15.17 ($\pm$0.29) \\ + \midrule + Quad.+\textsf{cont.} & 5.30 ($\pm$0.14) & 6.09 ($\pm$0.39) & 6.96 ($\pm$0.37) & 9.59 ($\pm$0.23) \\ + Quad.+\textsf{hingeM} & \textbf{3.77 ($\pm$0.29)} & \textbf{3.86 ($\pm$0.27)} & \textbf{4.13 ($\pm$0.30)} & \textbf{7.69 ($\pm$0.28)} \\ + \bottomrule + \end{tabular} + } + \caption{GTSRB-all.} + \label{tbl:gtsrb_all} + \end{subtable} + + + \begin{subtable}[h]{1\linewidth} + \centering + \resizebox{1\linewidth}{!}{% + \begin{tabular}{ccccccccccc} + \toprule + \multirow{2}{*}{Network} & \multicolumn{4}{c}{No. instances$/$class} \\ \cmidrule{2-5} + & 200 & 100 & 50 & 10 \\ + \midrule + IdsiaNet + & 17.89 ($\pm$0.41) & 18.28 ($\pm$0.60) & 18.34 ($\pm$0.79) & 25.84 ($\pm$1.52) \\ + Triplet & 17.39 ($\pm$0.67) & 18.22 ($\pm$0.92) & 20.49 ($\pm$1.64) & 30.53 ($\pm$2.47) \\ + Triplet-DA & 15.84 ($\pm$0.38) & 16.77 ($\pm$0.73) & 18.24 ($\pm$0.48) & 28.43 ($\pm$1.61) \\ + \midrule + Quad.+\textsf{cont.} & \textbf{12.12 ($\pm$0.33)} & \textbf{11.72 ($\pm$0.40)} & \textbf{12.83 ($\pm$0.43)} & \textbf{18.83 ($\pm$1.35)} \\ + Quad.+\textsf{hingeM} & 13.81 ($\pm$0.31) & 14.26 ($\pm$0.38) & 15.59 ($\pm$0.52) & 24.31 ($\pm$0.45) \\ + \bottomrule + \end{tabular} + } + \caption{GTSRB-sub.} + \label{tbl:gtsrb_sub} + \end{subtable} + + \begin{subtable}[h]{0.8\linewidth} + \centering + \resizebox{1\linewidth}{!}{% + \begin{tabular}{ccccccccccc} + \toprule + \multirow{2}{*}{Network} & \multicolumn{1}{c}{No. instances$/$class} \\ \cmidrule{2-2} + & 20 \\ + \midrule + IdsiaNet~\cite{cirecsan2012multi} + & 3.71 ($\pm$0.35) \\ + Triplet~\cite{hoffer2015deep} & 3.70 ($\pm$0.30) \\ + Triplet-DA & 5.05 ($\pm$0.45) \\ + \midrule + Quad.+\textsf{cont.} & \textbf{2.97 ($\pm$0.31)} \\ + Quad.+\textsf{hingeM} & \textbf{2.87 ($\pm$0.24)} \\ + \bottomrule + \end{tabular} + } + \caption{TT100k-c.} + \label{tt100k_all} + \end{subtable} +\end{table} + + + + + + + + + +\begin{table}[t] + \centering + \caption{Feature representation quality comparison for \textbf{seen classes}. +SVM classification errors ($\%$) are reported with the datasets, GTSRB-all, GTSRB-sub and TT100K-c, and according to the number of SVM training instances per class. +Marked in bold are the best results for each scenario, as well as other results with an overlapping confidence interval with 95$\%$. +} + \label{tbl:svm_seen} + + \begin{subtable}[h]{1\linewidth} + \centering + \resizebox{1\linewidth}{!}{% + \begin{tabular}{ccccccccccc} + \toprule + \multirow{2}{*}{Network type} & \multicolumn{4}{c}{No. instances$/$class} \\ \cmidrule{2-5} + & 200 & 100 & 50 & 10 \\ % + \midrule + IdsiaNet & \textbf{3.70 ($\pm$0.09)} & \textbf{4.24 ($\pm$0.14)} & \textbf{4.72 ($\pm$0.18)} & 6.52 ($\pm$0.10) \\ + Triplet & 5.00 ($\pm$0.08) & 5.51 ($\pm$0.12) & 6.22 ($\pm$0.16) & 9.11 ($\pm$0.15) \\ + Triplet-DA & 4.75 ($\pm$0.12) & 5.30 ($\pm$0.10) & 6.08 ($\pm$0.22) & 8.99 ($\pm$0.13) \\ + \midrule + Quad.+\textsf{cont.} & 4.49 ($\pm$0.09) & \textbf{4.50 ($\pm$0.12)} & \textbf{4.65 ($\pm$0.11)} & \textbf{5.61 ($\pm$0.13)} \\ + Quad.+\textsf{hingeM} & 4.46 ($\pm$0.08) & 4.63 ($\pm$0.12) & \textbf{4.81 ($\pm$0.15)} & 5.98 ($\pm$0.08) \\ + \bottomrule + \end{tabular} + } + \caption{GTSRB-all.} + \label{tbl:gtsrb_all_seen} + \end{subtable} + + + \begin{subtable}[h]{1\linewidth} + \centering + \resizebox{1\linewidth}{!}{% + \begin{tabular}{ccccccccccc} + \toprule + \multirow{2}{*}{Network type} & \multicolumn{4}{c}{No. instances$/$class} \\ \cmidrule{2-5} + & 200 & 100 & 50 & 10 \\ + \midrule + IdsiaNet & 7.55 ($\pm$0.25) & 8.64 ($\pm$0.22) & 10.13 ($\pm$0.43) & 17.19 ($\pm$0.23) \\ + Triplet & 10.88 ($\pm$0.25) & 12.35 ($\pm$0.31) & 14.28 ($\pm$0.27) & 24.50 ($\pm$0.30) \\ + Triplet-DA & 8.78 ($\pm$0.30) & 10.44 ($\pm$0.2) & 12.80 ($\pm$0.37) & 21.15 ($\pm$0.28) \\ + \midrule + Quad.+\textsf{cont.} & \textbf{6.04 ($\pm$0.16)} & \textbf{6.88 ($\pm$0.11)} & \textbf{7.92 ($\pm$0.28)} & \textbf{12.51 ($\pm$0.21)} \\ + Quad.+\textsf{hingeM} & 6.57 ($\pm$0.15) & 7.54 ($\pm$0.23) & 8.87 ($\pm$0.31) & 14.02 ($\pm$0.20) \\ + \bottomrule + \end{tabular} + } + \caption{GTSRB-sub.} + \label{tbl:gtsrb_sub_seen} + \end{subtable} + + \begin{subtable}[h]{0.8\linewidth} + \centering + \resizebox{1\linewidth}{!}{% + \begin{tabular}{ccccccccccc} + \toprule + \multirow{2}{*}{Network type} & \multicolumn{1}{c}{No. instances$/$class} \\ \cmidrule{2-2} + & 20 \\ + \midrule + IdsiaNet~\cite{cirecsan2012multi} & \textbf{4.23 ($\pm$0.22)} \\ + Triplet~\cite{hoffer2015deep} & 5.30 ($\pm$0.14) \\ + Triplet-DA (100) & 5.53 ($\pm$0.17) \\ + \midrule + Quad.+\textsf{cont.} & 5.39 ($\pm$0.23) \\ + Quad.+\textsf{hingeM} & \textbf{4.33 ($\pm$0.14)} \\ + \bottomrule + \end{tabular} + } + \caption{TT100k-c.} + \label{tbl:tt100k_all_seen} + \end{subtable} +\end{table} + +In the unseen case in \Tref{tbl:svm}, for all of the results, the proposed \emph{Quadruplet} variants outperform the other competing methods, supporting the fact that our method generalizes well in limited sample regimes by virtue of the richer information from the quadruples. +As an addendum, interestingly, \emph{Triplet-DA} performs better than \emph{Triplet} only with GTSRB-sub. We postulate that, in terms of feature description with some amount of strong supervision support, \emph{Triplet} generalizes better than \emph{Triplet-DA}, due +inherently to the number of possible triplet combinations of \emph{Triplet-DA} ($|\mathcal{T}|{\cdot}|\mathcal{X}|^2$, and generally $|\mathcal{T}| {\ll} |\mathcal{X}|$) is much smaller than that of \emph{Triplet} due to the use of a template anchor as an element of triplet, while \emph{Triplet} improves all the pairwise possibility of real data (\ie, $|\mathcal{X}|^3$). +For the quadruplet case, more pairwise relationships results in higher number of tuple combinations and leads to better generalization, even with the use of templates. + + + + + + + +In the seen class case in \Tref{tbl:svm_seen}, our method and \emph{IdsiaNet} show comparable performance outcomes with the best accuracy levels, while \emph{Triplet} and \emph{Triplet-DA} do not perform as well. +We found that the proposed \emph{Quadruplet} performs better than the other approaches when the number of training instances is very low, \ie, 10 samples per class. +More specifically, \emph{IdsiaNet} performs well in the seen class case, but not in the unseen class case compared to \emph{Quadruplet}. +This indicates that the embedding of IdsiaNet is trapped in seen classes rather than in general traffic sign appearances. +On the other hand, the proposed method learns more general representation in that its performance in both cases is higher than those of its counterparts. +We believe that this is due to the regularization effect caused by the usage of templates. +\section{Conclusion} +In this study, we have proposed a deep quadruplet for one-shot learning and demonstrated its performance on the unseen traffic-sign recognition problem with template signs. +The idea is that by composing a quadruplet with a template and real examples, the combinatorial relationships enable not only domain adaptation via co-embedding learning, but also generalization to the unseen regime. +Because the proposed model is very simple, it can be extended to other domain applications, where any representative anchor can be given. +We think that $N>4$-tuple generalization is interesting as a future direction in that there must be a trade-off between over-fitting and memory capacities. +\section*{Acknowledgment} +This work was supported by DMC R\&D Center of Samsung Electronics Co. + +{ +\bibliographystyle{aaai} +\bibliography{egbib} +} + + + + + + + +\cleardoublepage +\section*{Supplementary Materials} +Here, we present additional details of the baseline network and datasets that could not be included in the main text due to space constraints. All figures and references in this supplementary file are consistent with the main paper. +\section{Base neural network architecture} +\paragraph{Base network} +We select the network based on classification performance under the assumption that high classification performance stems from good feature embedding capabilities. +The Idsia network\cite{cirecsan2012multi} is a winner in a German Traffic Sign Recognition Benchmark (GTSRB) competition. It was reported that variants of the Idsia network perform even better. The variant IdsiaNet uses a deeper convolution kernel size for each layer (\Tref{tbl:idsianet-layers}). We use the best performing Idsia-like network~\footnote{IdsiaNet~\cite{cirecsan2012multi} is tuned to achieve better performance. Please check the repository, \url{https://github.com/moodstocks/gtsrb.torch\#gtsrbtorch}} for all three embedding schemes in the experiments. + + + +\begin{table}[h] + \centering + \caption{Variant IdsiaNet structure. Zero pad 2 before each conv layers. (LCN: local contrast normalization)} + \label{tbl:idsianet-layers} + \begin{tabular}{|c|c|c|c|} + \hline + Layer & Type & Size & kernel size \\ \hline + 0 & input & 48x48x3 & - \\ \hline + 1 & conv1 & 46x46x150 & 7x7 \\ + 2 & ReLU & 46x46x150 & - \\ + 3 & Max pooling & 23x23x150 & 2x2 \\ + 4 & LCN & 23x23x150 & 7x7 \\ \hline + 5 & conv2 & 24x24x200 & 4x4 \\ + 6 & ReLU & 24x24x200 & - \\ + 7 & Max pooling & 12x12x200 & 2x2 \\ + 8 & LCN & 12x12x200 & 7x7 \\ \hline + 9 & conv3 & 13x13x300 & 4x4 \\ + 10 & ReLU & 13x13x300 & - \\ + 11 & Max pooling & 6x6x300 & 2x2 \\ + 12 & LCN & 6x6x300 & 6x6 \\ \hline + 13 & fc1 & 350 & 10800 $\to$ 350 \\ + 14 & ReLU & 350 & - \\ + 15 & fc2 & 43 & 350 $\to$ 43 \\ + 16 & softmax & 43 & - \\ + \hline + \end{tabular} +\end{table} +\section{Details of datasets} +\paragraph{GTSRB-all}~{GTSRB~\cite{stallkamp2012man} has been the most widely used and largest dataset for traffic-sign recognition. It contains 43 classes categorized into three super categories: \emph{prohibitory}, \emph{danger} and \emph{mandatory}. The dataset contains illumination variations, blur, partial shadings and low-resolution images. The benchmark is partitioned into \emph{training} and \emph{test} sets. The training set contains 39,209 images, with 30 consecutively captured images grouped, which is referred to here at a track. The test set contains 12,630 images without continuity and thus does not form tracks. The number of samples per class varies, and the sample size also has a wide range (\Fref{fig:GTSRB_class} \& \Fref{fig:GTSRB_size}). + To validate the embedding capability of the proposed model, we split the training set into two sets: seen and unseen (\Fref{fig:GTSRB_template}). Our motivation is to overcome the data imbalance caused by rare classes. We selected 21 classes that have the fewest samples as the unseen class, using the remaining 22 classes as the seen class. For training, we only used seen classes in the training set.} + +\paragraph{GTSRB-sub}~{ + To analyze the performance on a dataset with a limited size, we created a subset of GTSRB-all, forming a smaller size, as a class balanced training set. For the training set, we randomly selected seven tracks for each of the seen classes. For the test set, we used the same set as used in GTSRB-all; hence results will be compatible with and comparable to those of GTSRB-all.} + +\paragraph{TT100K-c}~{ Tsinghua-Tencent 100K~\cite{zhu2016traffic} (TT100K) is a chinese traffic sign detection dataset that includes more than 200 sign classes. + We cropped traffic sign instances from scenes to build a classification dataset (called TT100K-c) to validate our model. Although it contains numerous classes, most of those in each class do not have enough instances to allow the experiment to be conducted. + We only selected classes with official templates\footnote{The official templates are provided by Beijing Traffic Management Bureau, + \url{http://www.bjjtgl.gov.cn/english/traffic signs/index.html}.} available and a sufficient number of instances. We filtered out instances that have side lengths of less than $20$ pixels, as they are unrecognizable. + We split TT100K-c into the training and test set according to the number of instances. We set 24 classes that have more than 100 instances as the seen classes, and assign 12 classes with between 50 and 100 instances as the unseen class (\Fref{fig:TT100K_template}). The \emph{training} set includes half of the seen class samples, with the other half going to the test set. + All of the unseen class samples belong to the \emph{test} set. The size distribution and the number of samples per class are provided in \Fref{fig:TT100K_class} and \Fref{fig:TT100K_size}, respectively. +} + + +\begin{figure}[p] + \begin{center}{\includegraphics[width=1.0\linewidth]{./figure/GTSRB_templates}}\hspace{2mm} + \end{center} + \vspace{-1mm} + \caption{GTSRB template images.} + \label{fig:GTSRB_template} + \vspace{-1mm} +\end{figure} + + +\begin{figure}[p] + \begin{center}{\includegraphics[width=1.0\linewidth]{./figure/GTSRB_class_dist}}\hspace{2mm} + \end{center} + \vspace{-1mm} + \caption{GTSRB class sample distribution. \textcolor{blue}{Blue}: seen classes (\#22). \textcolor{orange}{Orange}: unseen classes (\#21).} + \label{fig:GTSRB_class} + \vspace{-1mm} +\end{figure} + +\begin{figure}[p] + \begin{center}{\includegraphics[width=1.0\linewidth]{./figure/GTSRB_size_dist}}\hspace{2mm} + \end{center} + \vspace{-1mm} + \caption{GTSRB size distribution. $Side length=(height+width)/2$} + \label{fig:GTSRB_size} + \vspace{-1mm} +\end{figure} + + +\begin{figure}[p] + \begin{center}{\includegraphics[width=1.0\linewidth]{./figure/TT100K_templates}}\hspace{2mm} + \end{center} + \vspace{-1mm} + \caption{TT100K template images.} + \label{fig:TT100K_template} + \vspace{-1mm} +\end{figure} + + +\begin{figure}[p] + \begin{center}{\includegraphics[width=1.0\linewidth]{./figure/TT100K_class_dist}}\hspace{2mm} + \end{center} + \vspace{-1mm} + \caption{TT100K class sample distribution. \textcolor{blue}{Blue}: seen classes (\#24). \textcolor{orange}{Orange}: unseen classes (\#12).} + \label{fig:TT100K_class} + \vspace{-1mm} +\end{figure} + +\begin{figure}[p] + \begin{center}{\includegraphics[width=1.0\linewidth]{./figure/TT100K_size_dist}}\hspace{2mm} + \end{center} + \vspace{-1mm} + \caption{TT100K size distribution. $Side length=(height+width)/2$} + \label{fig:TT100K_size} + \vspace{-3mm} +\end{figure} diff --git a/1712.01969v2.txt b/1712.01969v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..53afd79dffba68fe2d7efad5f445528c744d34fc --- /dev/null +++ b/1712.01969v2.txt @@ -0,0 +1,61 @@ +There has been significant recent interest in simplequestion answering over knowledge graphs, where a natural languagequestion such as “Where was Sasha Vujacic born?” can be answeredvia the lookup of a simple fact—in this case, the “place of birth”property of the entity “Sasha Vujacic”. Analysis of an existingbenchmark dataset Yao (2015) and real-world userquestions Dai et al. (2016); Ture and Jojic (2017)show that such questions cover a broad range of users’ needs. + +Most recent work on the simple QA task involves increasinglycomplex neural network (NN) architectures that yieldprogressively smaller gains over the previous state of the art (see§2 for more details). Lost in this push, weargue, is an understanding of what exactly contributes to theeffectiveness of a particular NN architecture.In many cases, the lack of rigorous ablation studies furthercompounds difficulties in interpreting results and credit assignment.To give two related examples: Melis et al. (2017) reported that standardLSTM architectures, when properly tuned, outperform some more recentmodels; Vaswani et al. (2017) showed that the dominant approach tosequence transduction using complex encoder–decoder networks withattention mechanisms work just as well with the attention module only,yielding networks that are far simpler and easier to train. + +In line with an emerging thread of research that aims to improveempirical rigor in our field by focusing on knowledge andinsights, as opposed to simply “winning” Sculley et al. (2018),we take the approach of peeling away unnecessary complexity until wearrive at the simplest model that works well.On the SimpleQuestions dataset,we find that baseline NN architectures plus simple heuristicsyield accuracies that approach the state of the art. Furthermore, weshow that a combination of simple techniques that do not involve neural networks canstill achieve reasonable accuracy. These results suggest that whileNNs do indeed contribute to meaningful advances on thistask, some models exhibit unnecessary complexity and thatthe best models yield at most modest gains over strong baselines. + +The problem of question answering on knowledge graphs dates backat least a decade, but the most relevant recent work in the NLPcommunity comes from Berant et al. (2013).This thread of work focuseson semantic parsing, where a question is mapped to itslogical form and then translated to a structuredquery, cf. Berant and Liang (2014); Reddy et al. (2014).However, the more recent SimpleQuestions dataset Bordes et al. (2015)has emerged as the de factobenchmark for evaluating simple QA over knowledge graphs. + +The original solution of Bordes et al. (2015) featured memorynetworks, but over the past several years, researchers have appliedmany NN architectures for tackling thisproblem: Golub and He (2016) proposed a character-levelattention-based encoder-decoder framework; Dai et al. (2016)proposed a conditional probabilistic framework using BiGRUs.Lukovnikov et al. (2017) used a hierarchical word/character-levelquestion encoder and trained a neural network in an end-to-end manner.Yin et al. (2016) applied acharacter-level CNN for entity linking and a separate word-levelCNN with attentive max-pooling for fact selection.Yu et al. (2017) used a hierarchical residual BiLSTMfor relation detection, the results of which were combinedwith entity linking output. These approaches can be characterizedas exploiting increasingly sophisticated modeling techniques(e.g., attention, residual learning, etc.). + +In this push toward complexity, we do not believe that researchershave adequately explored baselines, and thus it is unclear how muchvarious NN techniques actually help. To this end, our workbuilds on Ture and Jojic (2017), who adopted a straightforwardproblem decomposition with simple NN models to argue thatattention-based mechanisms don’t really help. We take this one step furtherand examine techniques that do not involve neural networks.Establishing strong baselines allows us to objectively quantify thecontribution of various deep learning techniques. + +We begin with minimal preprocessing on questions: downcasing andtokenizing based on thePenn TreeBank. As is common in the literature, we decompose the simple QAproblem into four tasks: entity detection, entitylinking, relation prediction, and evidence integration, detailed below.All our code is available open source onGitHub.111http://buboqa.io/ + +Given a question, the goal of entity detection is to identify theentity being queried. This is naturally formulated as asequence labeling problem, where for each token, the task is to assignone of two tags, either Entity or NotEntity. + +Recurrent Neural Networks (RNNs): Themost obvious NN model for this task is to use RNNs;we examined both bi-directional LSTM and GRU variants over aninput matrix comprised of word embeddings from the inputquestion. Following standard practice, the representation of eachtoken is a concatenation of the hidden states from the forward andbackward passes. This representation is then passed through a linearlayer, followed by batch normalization, ReLU activation, dropout, anda final layer that maps into the tag space. Note that since we’reexamining baselines, we do not layer a CRF on topof the BiLSTM Lample et al. (2016); Ma and Hovy (2016). + +Conditional Random Fields (CRFs): Priorto the advent of neural techniques, CRFs represented the state of theart in sequence labeling, and therefore it makes sense to explore howwell this method works. We specifically adopt the approach ofFinkel et al. (2005), who used features such as wordpositions, POS tags, character n-grams, etc. + +The output of entity detection is a sequence of tokens representing acandidate entity. This still needs to be linked to an actual node inthe knowledge graph. In Freebase, each node is denoted by a Machine Identifier, or MID. Ourformulation treats this problem as fuzzy string matching and does notuse neural networks. + +For all the entities in the knowledge graph (Freebase), we pre-built an invertedindex over n𝑛n-grams n∈{1,2,3}𝑛123n\in\{1,2,3\} in an entity’s name. Atlinking time, we generate all corresponding n𝑛n-grams from thecandidate entity and look them up in the inverted index for allmatches. Candidate entity MIDs are retrieved from the index andappended to a list, and an early termination heuristic similar toTure and Jojic (2017) is applied. We start with n=3𝑛3n=3 and if we findan exact match for an entity, we do not further consider lower-ordern𝑛n-grams, backing off otherwise. Once all candidate entitieshave been gathered, they are thenranked by Levenshtein Distance to the MID’s canonical label. + +The goal of relation prediction is to identify the relation beingqueried. We view this as classification over the entirequestion. + +RNNs: Similar to entity detection, weexplored BiLSTM and BiGRU variants. Since relationprediction is over the entire question, we base theclassification decision only on the hidden states (forward andbackward passes) of the final token, but otherwise the modelarchitecture is the same as for entity detection. + +Convolutional Neural Networks (CNNs):Another natural model is to use CNNs, whichhave been shown to perform well for sentence classification. We adopt themodel of Kim (2014), albeit slightly simplified in that weuse a single static channel instead of multiple channels.Feature maps of widths two tofour are applied over the input matrix comprised of input tokenstransformed into word embeddings, followed by max pooling, afully-connected layer and softmax to output the final prediction.Note this is a “vanilla” CNN without any attentionmechanism. + +Logistic Regression (LR): Beforethe advent of neural networks, the most obvious solutionto sentence classification would be to apply logistic regression.We experimented with two feature sets over the questions: (1) tf-idf onunigrams and bigrams and (2) word embeddings +relation words. In (2), we averaged the word embeddings of each token in the question,and to that vector, we concatenated the one-hot vectorcomprised of the top 300 most frequent terms from the names of the relations(e.g., people/person/place_of_birth),which serve as the dimensions of the one-hot vector.The rationale behind this hybridrepresentation is to combine the advantages of word embeddings incapturing semantic similarity with the ability of one-hot vectors toclearly discriminate strong “cue” tokens in the relation names. + +Given the top m𝑚m entities and r𝑟r relations fromthe previous components, the final task is to integrate evidence toarrive at a single (entity, relation) prediction. We begin bygenerating m×r𝑚𝑟m\times r (entity, relation) tuples whose scores are theproduct of their component scores. Since both entity detection/linkingand relation prediction are performed independently, manycombinations are meaningless (e.g., no such relation existsfor an entity in the knowledge graph); these are pruned. + +After pruning, we observe many scoring ties, which arise from nodes inthe knowledge graph that share the exact same label, e.g., all personswith the name “Adam Smith”. We break ties byfavoring more “popular” entities, using the number of incoming edges tothe entity in the knowledge graph (i.e., entity in-degree)as a simple proxy. We further break ties by favoring entitiesthat have a mapping to Wikipedia, and hence are “popular”.Note that these heuristics for breaking scoring ties are based on thestructure of the knowledge graph, as neither of these signals areavailable from the surface lexical forms of the entities. + +We conducted evaluations on the SimpleQuestionsdataset Bordes et al. (2015), comprised of 75.9k/10.8k/21.7ktraining/validation/test questions. Eachquestion is associated with a (subject, predicate,object) triple from a Freebase subset that answers the question. The subject isgiven as an MID, but the dataset does not identify the entity inthe question, which is needed for our formulation of entity detection.For this, we used the names fileby Dai et al. (2016) to backproject the entity names ontothe questions to annotate each token as either Entity orNotEntity. This introduces some noise, as in some cases thereare no exact matches—for these, we back off to fuzzy matchingand project the entity onto the n𝑛n-gram sequence with thesmallest Levenshtein Distance to the entity name. As with previous work, wereport results over the 2M-subset of Freebase. + +For entity detection, we evaluate by extracting every sequence ofcontiguous Entity tags and compute precision, recall, andF1 against the ground truth. For both entity linking and relationprediction, we evaluate recall at N𝑁N (R@N𝑁N), i.e., whether thecorrect answer appears in the top N𝑁N results. For end-to-endevaluation, we follow the approach of Bordes et al. (2015) andmark a prediction as correct if both the entity and the relationexactly match the ground truth. The main metric is accuracy,which is equivalent to R@1. + +Our models were implemented in PyTorch v0.2.0 withCUDA 8.0 running on an NVIDIA GeForce GTX 1080 GPU.GloVe embeddings Pennington et al. (2014) of size 300 served as theinput to our models. We used negative log likelihood loss to optimizemodel parameters using Adam, with an initial learning rate of 0.0001. Weperformed random search over hyperparameters, exploring a range thatis typical of NNs for NLP applications; the hyperparameters wereselected based on the development set. In our final model, all LSTMand GRU hidden states sizes and MLP hidden sizes were set to 300. Forthe CNNs, we used a size 300 output channel. Dropout rate for the CNNs was0.5 and 0.3 for the RNNs.For the CRF implementation, we used the Stanford NERtagger Finkel et al. (2005). For LR, we used thescikit-learn package in Python. For Levenshtein Distance,we used the ratio function inthe “fuzzywuzzy” Python package.Evidence integration involvescrossing m𝑚m candidate entities with r𝑟r candidate relations,tuned on the validation set. + +We begin with results on individual components. To alleviate theeffects of parameter initialization, we ran experiments with n𝑛ndifferent random seeds (n=20𝑛20n=20 for entity detection and n=50𝑛50n=50 forrelation prediction). Following Reimers and Gurevych (2017),and due to questions about assumptions of normality, we simply reportthe mean as well as the minimum and maximum scores achieved in squarebrackets. + +For entity detection, on the validation set, the BiLSTM (whichoutperforms the BiGRU) achieves 93.1​[92.8​93.4]93.1delimited-[]92.893.493.1~{}[92.8~{}93.4] F1, compared to theCRF at 90.2.Entity linking results (R@N𝑁N) are shown inTable 1 for both the BiLSTM and the CRF.We see that entity linking using the CRF achieves comparable accuracy,even though the CRF performs slightly worse on entity detection alone;entity linking appears to be the bottleneck.Error analysis shows that there is a long tail of highly-ambiguousentities—that is, entities in the knowledge graph that have thesame label—and that even at depth 50, we are unable to identifythe correct entity (MID) more than 10% of the time. + +Results of relation prediction are shown inTable 2 on the validationset. Ture and Jojic (2017) conducted the same component-levelevaluation, the results of which we report (but none else that wecould find). We are able to achieve slightly better accuracy.Interestingly, we see that the CNN slightly outperforms the BiGRU(which beats the BiLSTM slightly; not shown) on R@1,but both give essentially the same results for R@5.Compared to LR, it seems clear that for this task NNs forma superior solution. + +Finally, end-to-end results on the test set are shown inTable 3 for various combinations of entity detection/linking andrelation prediction. We found that crossing 50 candidate entities withfive candidate relations works the best. To compute the [min,max] scores, we crossed 10 randomly-selected entity models with 10relation models. The best model combination is BiLSTM (for entitydetection/linking) and BiGRU (for relation prediction), which achieves anaccuracy of 74.9, competitive with a cluster of recent top results.Ture and Jojic (2017) reported a muchhigher accuracy, but we have not been able to replicate theirresults (and their source code does not appear to be available online).Setting aside that work, we are two points away from thenext-highest reported result in the literature. + +Replacing the BiLSTM with the CRF for entity detection/linkingyields 73.7, which is only a 1.2 absolute decrease in end-to-endaccuracy. Replacing the BiGRU with the CNN for relation predictionhas only a tiny effect on accuracy (0.2 decrease at most).Results show that the baselines that don’t use neural networks (CRF + LR)perform surprisingly well: combining LR (GloVe+rel) or LR (td-idf)for relation prediction with CRFs for entity detection/linkingachieves 69.9 and 67.3, respectively. Arguably, the former stilltakes advantages of neural networks since it uses word embeddings, butthe latter is unequivocally a “NN-free” baseline. We note that thisfigure is still higher than the original Bordes et al. (2015)paper. Cast in this light, our results suggest thatneural networks have indeed contributed to real and meaningful improvements inthe state of the art according to this benchmark dataset, but that theimprovements directly attributable to neural networks are far moremodest than previous papers may have led readers to believe. + +One should further keep in mind an important caveat in interpreting theresults in Table 3: AsReimers and Gurevych (2017) have discussed, non-determinismassociated with training neural networks can yield significantdifferences in accuracy. Crane (2018) furtherdemonstrated that for answer selection in question answering, a rangeof mundane issues such as software versions can have a significantimpact on accuracy, and these effects can be larger than incrementalimprovements reported in the literature. We adopt the emergingbest practice of reporting results from multiple trials, but thismakes comparison to previous single-point results difficult. + +It is worth emphasizing that all NN models we have examined canbe characterized as “Deep Learning 101”: easily within the grasp ofa student after taking an intro NLP course. Yet, our strong baselinescompare favorably with the state of the art. It seems that somerecent models exhibit unnecessarycomplexity, in that they perform worse than our baseline.State-of-the-art NN architectures only improve uponour strong baselines modestly, and at the cost of introducingsignificant complexity—i.e., they are “doing a lot” for onlylimited gain. In real-world deployments, there are advantages torunning simpler models even if they may perform slightlyworse. Sculley et al. (2014) warned that machine-learnedsolutions have a tendency to incur heavy technical debt in termsof ongoing maintenance costs at the systems level. The fact thatNetflix decided not to deploy the winner of the Netflix Prize (acomplex ensemble of many different models) is a real-world example. + +Moving forward, we are interested in more formally characterizingcomplexity–accuracy tradeoffs and their relation to the amount oftraining data necessary to learn a model. It is perhaps self-evidentthat our baseline CNNs and RNNs are “less complex” than other recentmodels described in the literature, but how can we compare modelcomplexity objectively in a general way? The number of modelparameters provides only a rough measure, and does not capture thefact that particular arrangements of architectural elements makecertain linguistic regularities much easier to learn. We seek to gaina better understanding of these tradeoffs. One concrete empiricalapproach is to reintroduce additional NN architectural elements in acontrolled manner to isolate their contributions. With a strongbaseline to build on, we believe that such studies can be executedwith sufficient rigor to yield clear generalizations. + +To conclude, we offer the NLP community three points ofreflection: First, at least for the task of simple QA over knowledgegraphs, in our rush to explore ever sophisticated deep learningtechniques, we have not adequately examined simple, strong baselinesin a rigorous manner. Second, it is important to consider baselinesthat do not involve neural networks, even though it is easy to forgetthat NLP existed before deep learning. Our experimental results showthat, yes, deep learning is exciting and has certainly advanced thestate of the art, but the actual improvements are far more modest thanthe literature suggests. Finally, in our collective frenzy to improveresults on standard benchmarks, we may sometimes forget that theultimate goal of science is knowledge, not owning the top entry in aleaderboard. + +This research was supported by the Natural Sciences and EngineeringResearch Council (NSERC) of Canada. \ No newline at end of file diff --git a/1712.02016v1.txt b/1712.02016v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..c84cadda34ceb4d8190c28b227bc2495672123c8 --- /dev/null +++ b/1712.02016v1.txt @@ -0,0 +1,553 @@ +\section{Introduction} +\begin{table}[t] +\footnotesize +\centering +\scalebox{0.90}{ +\begin{tabular}{ l | l } +\hline +\multicolumn{2}{ l }{ Microsoft Surface Pro 4 (128 GB, 4 GB RAM, Intel Core i5) } \\ +\hline +Q: & Can the M processor \textbf{handle} \underline{photoshop}? \\ +A: & It \textit{does} run Photoshop \textit{very well} on our internal test unit.\\ +\hline +Q: & Does the surface pro 4 \textbf{support} the \underline{Google Play app store}? \\ +A: & \textit{No}, it does not support Google Play. \\ +\hline +Q: & can this \textbf{run} \underline{fallout 4} \\ +A: & +\begin{tabular}[t]{@{}l@{}} +It \textit{struggles} graphically with Fallout 4 on \\low graphics settings. \\ +\end{tabular} \\ +\hline +Q: & Does this \textbf{connect to} a \underline{5G home wireless network}? \\ +A: & +\begin{tabular}[t]{@{}l@{}} +We connect to a Comcast high speed wireless router for \\ +Internet access and it seems to work well.\\ +I \textit{can not speak} \textit{to the specific network}\\ +in the question. \\ +\end{tabular} \\ +\hline +Q: & Can you \textbf{use} this \textbf{for} \underline{sketching}? \\ +A: & +\begin{tabular}[t]{@{}l@{}} +To some extent .\\ +It \textit{depends upon the degree to} which you intend to create . \\ +\end{tabular} \\ +\hline +\end{tabular} + +} +\caption{An example of QA pairs for a tablet PC: function targets (the first 4 are complementary entities) are underlined in questions; function words are bolded; keywords that indicating compatibility or satisfiability are italicized.} +\label{table:sample} +\end{table} + +Learning about the compatibility of a product that is functionally complementary to a to-be-purchased product +is an important task in e-commerce. +For customers, before they purchase a product (e.g., a mouse), it is natural for them to ask whether the to-be-purchased one can work properly with the intended complementary product (e.g., a laptop). +Such a query is driven by customers' needs on product functionality, where compatibility can be viewed as a special group of functions. +In fact, a function need is the very first step of purchase decision process. +Whether a product can satisfy some function needs or not (a.k.a. satisfiability of a function need) even leads to the definition of \textit{product}. +In marketing, \textit{product} is defined as ``anything that can be offered to a market for attention, acquisition, use or consumption that might satisfy a want or need'' \cite{kotler2010principles}. +For sellers or manufacturers, satisfiability on function needs are equally important as being fully-aware of existing and missing functions is crucial in increasing sales and improve products. +Therefore, exchanging the information about functions is important to customers, sellers, and manufacturers. + +Given its importance, however, such function (we omit ``need'' for simplicity) information is not fully available in product descriptions. +Just imagine the cost of compatibility test over the huge number of products, or sellers' intention of hiding missing functions. +Fortunately, +customers may occasionally exchange such knowledge online with other customers or sellers. +This allows us to adopt an NLP-based approach to automatically sense and harvest this knowledge on a large scale. + +In this paper, we address two (2) closely related novel NLP tasks: \textit{product compatibility analysis} and \textit{product function satisfiability analysis}. They are defined as following.\\ +\textbf{Product Compatibility Analysis}: +Given a corpus of texts, identify all tuples $(p_1$, $p_2$, $c)$, +where $p_1$ and $p_2$ are a pair of complementary products (entities), and $c\in\{1,2,3\}$ indicates +whether the two entities are compatible (1), not (2) or uncertain (3).\\ +Note that two \emph{complementary entities} can be \emph{incompatible}. +For example, a mouse is a product functionally complementary to ``Microsoft Surface Pro 4'', as Surface Pro 4 doesn't +come with a mouse. +However, due to different interfaces, not all mouse models can work with Surface Pro 4 properly. +By slightly extending $p_2$ to a function expression (e.g., identifying ``work with Microsoft Surface Pro 4'' instead of ``Microsoft Surface Pro 4''), we have a more general task.\\ +\textbf{Product Function Satisfiability Analysis}: +Given the same corpus, identify all tuples $(p_1$, $f$, $s)$, +where $f$ is a function expression, and $s\in\{1,2,3\}$ indicates +whether $p_1$ can satisfy (1) the function $f$ or not (2), or uncertain (3).\\ +Note that functions derived from complementary entites are just one type of function called \textit{extrinsic function}s. +Functions in $f$ may also include functions derived from the product $p_1$ itself as \textit{intrinsic function}s. +For example, ``draw a picture'' is an intrinsic function for ``Microsoft Surface Pro 4''. +A function expression may consist a \textit{function word} (e.g., ``work with'' or ``draw'') and a \textit{function target} (e.g., ``Microsoft Surface Pro 4'' or ``picture''). +So function target is a general term of complementary entity. + +Two challenges come immediately after formalizing these two tasks. +First, the quality of the tuples depends on the data source (namely, the corpus). +Corpora that are dense and accurate regarding compatibility and functionality information are preferred. +Second, although general information extraction models are available, novel models that can jointly identify the entities (or function expressions) and compatibility (or satisfiability) in an end-to-end manner are preferred. + +We address the first challenge by annotating a high-quality corpus. +In particular, Amazon.com allows potential consumers to communicate with existing product owners or sellers via Product Community Question Answering (PCQA). +As an example, in Table \ref{table:sample} we show 5 QA pairs addressing the functionality of Microsoft Surface Pro 4 ($p_1$). +We can see that the first 4 questions address the extrinsic functions (on complementary entities) and the last one is an intrinsic function. +Specifically, ``photoshop'' is a \emph{compatible entity}, ``Google Play app store'' and ``fallout 4'' are \emph{incompatible entities}, ``5G home wireless network'' is a complementary entity with \emph{uncertain} compatibility, and ``use for sketching'' is an \emph{uncertain} function. +Observe that the to-be-purchased product $p_1$ can be identified using the product title of the product page. +We focus on extracting $p_2$ or $f$ from the question and detect $c$ or $s$ from the answers. +We leave infrequently-asked open questions (e.g., ``what products can this tablet work with?'') to future work and only focus on yes/no questions. +The details of the annotated corpus can be found in Section Experimental Result. + +Given the corpus, we address the second challenge by formulating these two (2) tasks as sequence labeling problems, which fuse the information from both the questions and the answers. +We propose a model called Dual Attention Network (DAN) to solve the sequence labeling problems. +DAN addresses two technical challenges. +First, the questions and answers are usually brief~\footnote{the longest question has only 82 words} with rather limited context. +Second, the polarity information in many answers are implicit (without an explicit ``Yes'' or ``No'' in the very beginning, e.g., the 1st and 3rd answers in Table \ref{table:sample}). +DAN resolves these challenges by taking the question and the answer together as a QA story (or document) and perform two reading comprehensions \cite{richardson-burges-renshaw:2013:EMNLP,rajpurkar-EtAl:2016:EMNLP2016} on such a story as side information for sequence labeling. +For example, it may not be obvious that ``photoshop'' is a complementary entity by reading the question only. +However, the word ``run'' in the answer is a strong indicator that ``photoshop'' is a complementary entity and the word ``well'' indicates a positive polarity. +We conduct experiments quantitatively and qualitatively to show the performance of DAN. +The proposed dual attention architecture is not limited to the proposed tasks, but may potentially be applied to other QA tasks. +\section{Related Work} +\label{sec:rw} +Complementary products are studied in the context of recommender system \cite{McAPanLes15}. +In~\cite{McAPanLes15}, topic models are used to predict substitutes and complements (without compatibility) of a product. +But their work takes the outputs of Amazon's recommender system as the ground truths for complements, which can be inaccurate. +Instead, we take an information extraction approach similar to the Complementary Entity Recognition (CER) task in~\cite{xu2016CER,xu2017supervised}. +But we perform in a supervised setting on an annotated QA corpus \cite{McAYan16,xu2016pcqa}. +We further generalize to a more fundamental task: function satisfiability analysis. +Although \cite{xu2017Fun} has a preliminary study on product functions, to the best of our knowledge, this is the first time to study a fully end-to-end model with satisfiability analysis. + +Deep neural network \cite{lecun2015deep,Goodfellow-et-al-2016-Book} has drawn attention in the past few years due to its impressive performance on NLP tasks. +Long Short-Term Memory (LSTM) \cite{hochreiter1997long} is shown to achieve the state-of-the-art results on many NLP tasks \cite{greff2015lstm,lample2016neural,tan2015lstm,nassif2016learning,wang2015long}. +Attention mechanism \cite{NIPS2010_4089,denil2012learning} is effective in NLP tasks, such as machine translation\cite{bahdanau2014neural}, sentence summarization \cite{rush2015neural}, sentiment analysis \cite{tang-qin-liu:2016:EMNLP2016}, question and answering \cite{li2016dataset} and reading comprehension \cite{kumar2015ask,xiong2016dynamic}. +There are also studies of neural sequence labeling \cite{lample2016neural,ma2016end}. +However, traditional sequence labeling takes a single sequence as the to-be-labeled input. +The proposed task naturally has two inputs: the question with the to-be-labeled tokens and the answers with the polarity. +Inspired by the task of reading comprehension, we take one more step to fuse the question and the answer together as a story and perform reading comprehension on such a QA story. +Instead of learning question-aware representations of the story as in reading comprehension, we learn question-aware (or answer-aware) representations of the QA story as the side information to enrich the representation of the question (or the answer, resp.). +\section{Model Overview and Preliminary} +Formally, we define the 2 inputs sequence labeling problem as following. +Given a QA pair $(\mathbf{x}^q, \mathbf{x}^a)$ (we use bold symbols to indicate sequences), +we label each word in the question $\mathbf{x}^q$ as a label sequence $\mathbf{y}=(y_1, \dots, y_t, \dots, y_{T_q})$, where +$y_t\in L$ and $T_q$ is the length of the question. +Here $L$ is the label space and the two proposed tasks only differ in the label space $L$. +For product compatibility analysis, the label space is $L^c=\{\textit{O, C, I, U}\}$, indicating \textit{\underline{O}ther} non-entity words, \textit{\underline{C}ompatible}, \textit{\underline{I}ncompatible} and \textit{\underline{U}ncertain} entity words. +For product satisfiability analysis, the label space is $L^s=\{\textit{O, S, UN, U, F-S, F-UN, F-U}\}$, indicating \textit{\underline{O}ther} non-function words, \textit{\underline{S}atisfiable}, \textit{\underline{UN}satisfiabile}, \textit{\underline{U}ncertain} function target words, and \textit{\underline{S}atisfiable}, \textit{\underline{UN}satisfiabile}, \textit{\underline{U}ncertain} \textit{\underline{F}}unction words. + +\begin{figure}[t] + \centering + \includegraphics[width=3.2in]{dan.png} + \caption{Dual Attention Network: given a question ``Works with iphone ?'' and its answer ``Yes, it is'', ``Works with iphone ?'' is can be labeled as $(\textit{F-S, F-S, S, O})$ for satisfiability analysis (or $(\textit{O, O, C, O})$ for compatibility analysis). ``Works with iphone'' is labeled as a satisfiable function expression, where ``iphone'' is a \underline{S}atifiable function targets (or \underline{C}ompatible entity) ) and ``Works with'' is labeled as satisfiable function words (\textit{F-S}). The details of question attention (and similarly for answer attention) is shown in Figure \ref{fig}.} + \label{fig:fr} + \end{figure} + +The proposed network is illustrated in Figure~\ref{fig:fr}. +The question and the answer are first concatenated to form a QA story $\mathbf{x}^\textit{qa}$. +Then the QA pair $(\mathbf{x}^q, \mathbf{x}^a)$ and the story $\mathbf{x}^\textit{qa}$ are passed into a shared embedding layer (not shown in the figure), followed by three respective BLSTM (Bidirectional Long Short-Term Memory \cite{hochreiter1997long,schuster1997bidirectional}) Context Layers to obtain contextual representations. +So the vector representation at each position is encoded with the information from nearby words. +The contextual representation of the QA story is attended (read) by the contextual representations of the question and the answer, respectively. +This is done via two separate attention modules. +The attention process can be viewed as both the question and the answer read the QA story to form their corresponding side information. +Then the side information is concatenated with the original contextual representation for the question and the answer, respectively. +Now we call them QA-augmented question and answer. +Later, we pass the QA-augmented question and answer representations to the Question Context 2 layer and the Answer Context 2 layer, respectively. +The second context layers here are used to learn the representations encoding both the original context representations and the QA story. +Note that we only learn a single vector from the Answer Context 2 layer as the \emph{polarity vector} since we need a single vector to represent the polarity of the whole answer sequence. +Lastly, the polarity vector is duplicated $T_q$ times, each of which is concatenated to the representation of each word in the question, and output the label sequence $\mathbf{y}$ via a dense+softmax layer shared for each word in the question. +Thus, both the question and the answer help to decide the output labels in an end-to-end manner. + +Note that more complicated deep architecture for sequence labeling can be leveraged (e.g., modeling label dependency using CRF or learning better features from character-level embedding as in LSTM-CRF \cite{lample2016neural} or LSTM-CNNs-CRF \cite{ma2016end}), and here we mainly focus on how to leverage a QA story to augment side information and perform sequence labeling. Next, we briefly introduce preliminary layers that are common in most NLP models. + +\textbf{Input Layers} +Let the sequence $\mathbf{x}^q=(x_1^q, \dots, x_{T_q}^q )$ and $\mathbf{x}^a=(x_1^a, \dots, x_{T_a}^a )$ denote the question and the answer, respectively, where $T_a$ denote the length of the answer. +A question (or an answer) may contain multiple sentences and we simply concatenate them into a single sequence. +We set $T_q=82$ as the maximum number of words in any question; since an answer can be as long as more than 2000 words, we simply make the answer the same length as the question ($T_a=82$) by removing words beyond the first 82 words. +Intuitively, the beginning of an answer is more informative. + +We transform $\mathbf{x}^q$ ($\mathbf{x}^a$ and $\mathbf{x}^{qa}$, resp.) into an embedded representation $\boldsymbol{e}^q$ ($\boldsymbol{e}^a$ and $\boldsymbol{e}^{qa}$, resp.) via a word embedding matrix $W_e \in \mathbb{R}^{d_e \times V}$, and $d_e$ is the dimension (we set it as 300) of word vectors. +We pre-train the word embedding matrix $W_e$ via fasttext model \cite{bojanowski2016enriching} and fine tune the embeddings when optimizing the proposed model. +The fasttext model allows us to obtain embeddings for out-of-vocabulary words (which is common in product QAs) from character n-grams embeddings. +The pre-training is discussed in Section Experimental Result. + +\textbf{BLSTM Context Layers} +The embedded word sequences ($\boldsymbol{e}^q$, $\boldsymbol{e}^a$ and $\boldsymbol{e}^\textit{qa}$) are fed into the Question Context 1 layer, the Answer Context 1 layer, and the QA Story Context layer, respectively. +BLSTM \cite{hochreiter1997long,schuster1997bidirectional} is an important variant of RNN due to its ability to model long-term dependencies and contexts in both forward and backward directions in a sequence. +The key component of an LSTM unit is the memory cell, which avoids overwriting the hidden state at every time step. +An LSTM unit decides to update the memory cell via input, forget and output gates. +We set all the output dimensions of BLSTM layers as 128. +We omit the details of the update mechanism and interested readers may refer to \cite{hochreiter1997long} for details. +Note that other variants of RNN such as GRU \cite{chung2014empirical} can also be used, here we mainly focus on how attention mechanism can help improve the performance. +After passing the question and the answer embedding through these BLSTM layers, we have the hidden representations $\boldsymbol{h}^{q, 1}$, $\boldsymbol{h}^{a, 1}$ and $\boldsymbol{h}^\textit{qa}$ for the question, answer and QA story, respectively. +\section{Dual Attention Network} +\label{sec:dan} +\subsection{Attention-based Module} +Next, we leverage attention mechanism to allow both the question and the answer to enrich their representations. +Attention mechanism \cite{NIPS2010_4089,denil2012learning} is popular in recent years due to its capability of modeling variable length memories rather than fixed-length memory. +We utilize attention mechanism to synthesize side information from the QA story. +We introduce two attention mechanisms: \emph{question attention} and \emph{answer attention}. +By reading the QA story, they both get side information by the fact that the question and the answer in a QA pair are connected. +Intuitively, the words in the answer depend on the question and the question can help infer compatibility information from the answer. +According to our experience of dataset annotation, we find that some entities are hard to label by reading only the question or the answer. +However, if we read the question and answer as a whole, more often we get the idea of what the QA pair discusses about. +For example, a question like ``straight talk?'' for a cell phone can be hard to label. +If we have an answer ``yes, it works with straight talk well.'', we can somehow guess ``straight talk'' should be a carrier. +Similarly, the ``straight talk'' indicated by the question also helps us to identify the polarity word ``well'' in the answer. +This is very important in identifying implicit polarities in the answer. +We mimic this procedure of human's reading comprehension using the following attention mechanism. + +\begin{figure} + \centering + \includegraphics[width=3.2in]{atten.png} + \caption{Question Attention: each word in the question attends on each word in the QA story.} + \label{fig} +\end{figure} + +Let the output from the QA story Context layer be $\boldsymbol{h}^\textit{qa}=(h_1^\textit{qa}, \dots, h_{T_q}^\textit{qa}, h_{T_q+1}^\textit{qa}, \dots, h_{T_q+T_a}^\textit{qa} )$. +For the question (answer) attention, we obtain the attention weight for the $t$-th question (answer) word when reading the $u$-th word in the QA story via a dot product and further normalized by a softmax function: +\begin{equation} +\begin{split} +a_{t, u}^q=\frac{\exp{\big((h_t^{q,1})^T h_u^{\textit{qa}}\big)} }{\sum_{u'=1}^{T_q+T_a} \exp{\big((h_t^{q,1})^T h_{u'}^{\textit{qa}}\big)} } . +\end{split} +\end{equation} +Then the contextual information for the $t$-th word in the question (or answer) is the weighted sum over all words in the QA story: +\begin{equation} +\begin{split} +c_t^q=\sum_{u=1}^{T_q+T_a} a_{t, u}^q h_u^{\textit{qa}}. +\end{split} +\end{equation} +We concatenate $c_t^q$ with $h_t^{q,1}$ as the representation of the $t$-th word in the question (answer): $h_t^{q,2}=h_t^{q,1} \oplus c_t^q$. +Similarly, we have another answer attention module to obtain a sequence of answer word representations and the $t$-th word in the answer is denoted as $h_t^{a,2}=h_t^{a,1} \oplus c_t^a$. +\subsection{Stacked Structures} +Next, $\bm{h}^{q,2}$ and $\bm{h}^{a,2}$ are fed into the Question Context 2 layer and the Answer Context 2 layer, respectively, which are similar to the stacked BLSTM \cite{el1995hierarchical} to obtain better representation of the sequences. +We utilize two structures of BLSTMs: the many-to-many structure on questions and the many-to-one structure for learning the answer representation since we care about the answer polarity more than word-by-word representations. +The answer representation is a concatenation of the last and the first outputs of a forward and backward LSTMs, respectively. Finally, we have $\boldsymbol{h}^{q,3}$ for the question sequence and $h^{a,3}$ for the polarity representation of the whole answer. +\subsection{Joint Model} +Now we form the joint model in an end-to-end manner, by merging the question branch and the answer branch into prediction $\hat{\mathbf{y} }$. +So the labels for each word in question can affect both the question and answer branches to learn better representations. +To match the output length of the answer branch to the output length of the question branch, we obtain $T_q$ copies of $h^{a,3}$ and concatenate each copy with the output of the question branch at each word position. +Then we reduce the dimension of each concatenated output to $|L|$ via a fully-connected layer by weights $W$ and bias $b$ shared among all positions of the question: + +\begin{equation} +\begin{split} +s_t^q & =W[ h_{t}^{q,3} \oplus h^{a, 3} ]+b , \\ +\end{split} +\end{equation} +where $s_t^q \in \mathbb{R}^{|L|}$ is the representation the $t$-th position in question. +We output the probability distribution over label space $L$ for the $t$-th question word via a softmax function: +\begin{equation} +\begin{split} +p^q(\hat{y}_t=l; \Theta) & =\frac{\exp(s_{t, l}^q)}{\sum_{k=1}^{\left\vert{L}\right\vert}\exp(s_{t, k}^q)} , +\end{split} +\end{equation} +where $\Theta$ represents all trainable parameters. + +Finally, we optimize the cross entropy loss function: +\begin{equation} \label{eq:opt} +\begin{split} +J(\Theta)=-\sum_m^{|M|} \sum_t^{|T_q|} \sum_l^{|L|} y_{t, l}^{(m)} \log p^q(\hat{y}_t^{(m)}=l; \Theta) , +\end{split} +\end{equation} +where $M$ represents all the training examples and $y_{t, l}^{(m)} \in \{0, 1\}$ is the ground truth for the $t$-th question word and label $l$ in the $m$-th training example. So $y_t^{(m)}$ is a one-hot vector. +We leverage Adam optimizer \cite{kingma2014adam} to optimize this loss function and set the learning rate as 0.001 and keep other parameters the same as the original paper. +We set the dropout rate to 0.1. The batch size is set to 128. + +During testing, the prediction for each position in the question is computed as: +\begin{equation} \label{eq:pred} +\begin{split} +\hat{y_t}=\operatorname*{arg\,max}_{l \in L} p^q(\hat{y}_t=l; \Theta) . +\end{split} +\end{equation} +Lastly, for function satisfiability analysis, we extract function words and function targets with polarities over label space $L^s$; +for compatibility analysis, we extract complementary entities with polarities over label space $L^c$. +\section{Experimental Result} +\label{sec:exp} +In this section, we discuss the details of the annotated corpus, and experimentally demonstrate the superior performance of DAN. +\subsection{Corpus Annotation and Analysis} +\label{sec:data} + +\begin{table} +\footnotesize +\centering +\scalebox{0.95}{ +\begin{tabular}{ l | c | c | c | c } +\hline +Product & QA & \% with Fun. & Intr. Fun. & Extr. Fun. \\ +\hline +DSLR & 319 & 27.9 & 57 & 32 \\ +E-Reader & 270 & 44.07 & 48 & 71 \\ +Speaker & 153 & 38.56 & 14 & 45 \\ +Tablet & 300 & 41.67 & 31 & 94 \\ +Cellphone 1 & 168 & 60.12 & 6 & 95 \\ +Cellphone 2 & 321 & 43.61 & 25 & 115 \\ +Laptop 1 & 289 & 25.26 & 42 & 31 \\ +Laptop 2 & 404 & 58.17 & 56 & 179 \\ +Netbook & 194 & 46.91 & 15 & 76 \\ +TV & 291 & 49.48 & 21 & 123 \\ +TV Console & 167 & 50.9 & 7 & 78 \\ +Gaming Console & 204 & 75.49 & 14 & 140 \\ +Apple Watch & 324 & 37.65 & 55 & 67 \\ +\hline +VR Headset & 438 & 76.94 & 12 & 325 \\ +Stylus & 260 & 72.69 & 13 & 176 \\ +Micro SD Card & 281 & 81.85 & 1 & 229 \\ +Mouse & 254 & 74.41 & 30 & 159 \\ +Tablet Stand & 212 & 88.68 & 3 & 185 \\ +\hline +\end{tabular} +} +\caption{Function statistics of 18 selected labeled products. QAs: number of QA pairs; \% with Fun.: percentage of QA pairs containing function needs; Intr. Fun.: QAs about intrinsic functions; Extr. Fun.: QAs about extrinsic functions.} +\label{table:dataset_fun} +\end{table} + +We crawled about 1 million QA pairs from the web pages of products in the electronics department of Amazon. +These 1 million QAs combined with all electronics customer reviews \cite{McAPanLes15} are used to train word embeddings. +We use customer reviews because the texts in QAs are too short to train good quality embeddings. +The combined corpus is 4 GB. + +We select 42 products with 7969 QA pairs in total as the to-be-annotated corpus. +The corpus is labeled by 3 annotators independently. The general annotation guidelines are as the following: +\begin{enumerate} +\item only yes/no QAs should be labeled; +\item a function expression should be labeled as either intrinsic function or extrinsic function; +\item each function expression is labeled with separate function words and function targets; +\item function words are verbs and prepositions around the function targets; +\item function targets are token spans containing nouns, adjectives, or model numbers; +\item abstract entities such as ``picture'', ``video'', etc. are considered as function targets for intrinsic functions; +\item specific entities are considered as complementary entities (function targets for extrinsic functions). They are not limited to products from Amazon, but also include general entities like ``phone'', or service providers like ``AT\&T''; +\item implicit yes/no answers should also be labeled to increase the recall rate; +\item implicit answers without direct experience on the target product are labeled as uncertain answers (e.g., ``I am not sure but it works for my android phone.''). +\end{enumerate} +All annotators initially agreed on their annotations on 83\% of all QA pairs. +Disagreements are then resolved to reach final consensus annotations. + +\begin{table} +\footnotesize +\centering +\scalebox{0.95}{ +\begin{tabular}{ l | c | c | c | c } +\hline +Product & Satis. & Unsatis. & Uncertain & \#Desc. \\ +\hline +DSLR & 62 & 9 & 18 & 7\\ +E-Reader & 66 & 35 & 18 & 8\\ +Speaker & 35 & 16 & 8 & 7\\ +Tablet & 76 & 22 & 27 & 7\\ +Cellphone 1 & 88 & 2 & 11 & 6\\ +Cellphone 2 & 63 & 47 & 30 & 39\\ +Laptop 1 & 59 & 3 & 11 & 4\\ +Laptop 2 & 98 & 88 & 49 & 5\\ +Netbook & 59 & 12 & 20 & 11\\ +TV & 84 & 38 & 22 & 21\\ +TV Console & 46 & 27 & 12 & 21\\ +Gaming Console & 78 & 29 & 47 & 19\\ +Apple Watch & 70 & 40 & 12 & 8\\ +\hline +VR Headset & 106 & 200 & 31 & 8\\ +Stylus & 97 & 24 & 68 & 13\\ +Micro SD Card & 168 & 16 & 46 & 9\\ +Mouse & 106 & 36 & 47 & 5\\ +Tablet Stand & 95 & 30 & 63 & 55\\ +\hline +\end{tabular} +} +\caption{Statistics of 18 selected labeled products on satisfiability. Satis.: satisfiable function needs; Unsatis.: unsatisfiable function needs; Uncertain: uncertain function needs; \#Desc.: number of compatible products mentioned in the corresponding product descriptions.} +\label{table:dataset_s} +\end{table} + +Due to limited space, the statistics of 18 selected products with annotations are shown in Table \ref{table:dataset_fun} and \ref{table:dataset_s}. +We can see that the majority functions are extrinsic functions, indicating the importance of product compatibility analysis. +This is close to our common sense as complementary entities can be unlimited, whereas the intrinsic functions are usually limited. +We observe that accessories (the last 5 products) have a higher percentage of +functionality related questions than main products (the first 13 products). +This is as expected since accessories are poorly described in the product description and accessories usually have many complementary entities. +From Table \ref{table:dataset_s}, we can see that +the polarity distribution is not even: most products have more satisfiable functions than unsatisfiable or uncertain ones. +This is because customers are more likely to ask a question to confirm functionality before purchasing, and many unsatisfiable functions are thus identified in advance without asking a question. +The only exception is the relatively new product \textit{VR headset}, which is problematic due to its short time of testing on the market. + +We further investigate product descriptions of these 18 products and count the number of compatible products mentioned, as shown in the last column of Table \ref{table:dataset_s}. +Interestingly, no incompatible entities can be found, justifying the need for compatibility analysis on incompatible products from user-generated data. + +The corpus is preprocessed using Stanford CoreNLP \footnote{http://stanfordnlp.github.io/CoreNLP/} regarding sentence segmentation, tokenization, POS-tagging, lemmatizing and dependency parsing. +The last 3 steps provide features for the Conditional Random Fields (CRF) \cite{lafferty2001conditional} baseline. +We shuffle all QA pairs and select 70\% of QA pairs for training, 10\% for validation and 20\% for testing. +\subsection{Baselines} +We compare DAN with the following baselines.\\ +\textbf{CRF}: This baseline is to show that a traditional sequence labeling model performs poorly. +Note that CRF \cite{lafferty2001conditional} can only be evaluated on extraction without polarity detection since it cannot incorporate the answer into the model. +We train CRF models using Mallet\footnote{\url{http://mallet.cs.umass.edu/}}. +We use the following features: the words within a 5-word window, the POS tags within a 5-word window, the number of characters, binary indicators (camel case, digits, dashes, slashes and periods), and dependency relations for the current word obtained via dependency parsing.\\ +\textbf{QA S-BLSTM}: This baseline does not have any attention module. We use it to show that attention mechanism improves the results.\\ +\textbf{QA CoAttention}: This baseline is inspired by \cite{xiong2016dynamic}, where the question and the answer part directly attend to each other, without form the QA story. We use this baseline to demonstrate that attending on a QA story is better.\\ +\textbf{DAN (-) Answer Attention}: This baseline does not have the answer attention module in DAN. We use this baseline to show that the answer attention also helps to improve the performance on polarity detection. +\subsection{Product Compatibility Analysis} +\begin{table}[t] +\small +\centering +\scalebox{1}{ +\begin{tabular}{ l | c | c | c } +\hline +Method & PCA $\mathcal{F}_1$ & CER $\mathcal{F}_1$ & Polar. Acc. \\ +\hline +CRF & - & 71.0 & -\\ +\hline +QA S-BLSTM & 61.3 & 78.0 & 81.6 \\ +\hline +QA CoAttention & 62.9 & 79.8 & 82.4 \\ +\hline +DAN (-) Ans. Attention & 63.9 & 80.2 & 81.5 \\ +\hline +DAN & \textbf{64.8} & \textbf{80.9} & \textbf{82.5} \\ +\hline +\end{tabular} +} +\caption{Performance on Product Compatibility Analysis (PCA): PCA $\mathcal{F}_1$ is the averaged $\mathcal{F}_1$ scores over 3 types (compatible, incompatible and uncertain) of complementary entities; CER $\mathcal{F}_1$ only evaluates the performance of \underline{C}omplementary \underline{E}ntity \underline{R}ecognition without considering the polarity; Polarity Accuracy only evalutes the polarity detection given successfully identified complementary entities. } +\label{table:pca} +\end{table} + +We first evaluate the performance of product compatibility analysis. +Note that the label space of this task is $L^c=\{\textit{O, C, I, U}\}$, as described in Section Model Overview and Preliminary. +We consider an extracted entity that has more than or equal to 50\% overlapping words with the ground truth entity as a \textit{positive extraction}. +The polarity of a positive extraction is computed as the majority type voted from all words in such a positive extraction. +So a \textit{true positive example} must have at least 50\% overlapping words and a match on polarity. +Any positive extraction with no corresponding ground truth entity is considered as a \textit{false positive example}. +Any example with mismatched polarity or negative extraction is considered as a \textit{false negative example}. +We average the $\mathcal{F}_1$ computed from the above definition as the PCA $\mathcal{F}_1$ column, shown in Table \ref{table:pca}. +Further, by only considering a positive extraction as a true positive and a negative extraction as a false negative, we compute CER $\mathcal{F}_1$ for complementary entity recognition. +Given a positive extraction, we further compute the classification accuracy over 3 polarity types to show the effectiveness of polarity detection. + +\textbf{Result Analysis}: +We can see that the performance of DAN outperforms other baselines on PCA $\mathcal{F}_1$, CER $\mathcal{F}_1$, and polarity accuracy. +The attention mechanism boosts the performance of CER a lot. +With the attention on the answer, the polarity is more accurate when DAN is compared with DAN (-) Answer Attention. +The baseline QA CoAttention indicates that attending on the QA story is better than attending the question or the answer alone. +Lastly, CRF performs poorly on learning better word representations. +\subsection{Product Function Satisfiability Analysis} +\begin{table}[t] +\small +\centering +\scalebox{1}{ +\begin{tabular}{ l | c | c | c } +\hline +Method & FSA $\mathcal{F}_1$ & FNR $\mathcal{F}_1$ & Polar. Acc. \\ +\hline +CRF & - & 70.2 & -\\ +\hline +QA S-BLSTM & 61.1 & 77.0 & 82.2 \\ +\hline +QA CoAttention & 61.7 & 77.4 & 81.3 \\ +\hline +DAN (-) Ans. Attention & 62.5 & 78.0 & 83.0 \\ +\hline +DAN & \textbf{63.9} & \textbf{78.2} & \textbf{84.3} \\ +\hline +\end{tabular} +} +\caption{Performance on product Function Satisfiability Analysis (FSA): FSA $\mathcal{F}_1$ is the averaged $\mathcal{F}_1$ scores over 3 types (satisfiable, unsatisfiable and uncertain) of extracted function expressions; FNR $\mathcal{F}_1$ only evaluates the performance of \underline{F}unction \underline{N}eed (function expression) \underline{R}ecognition without considering the polarity; Polarity Accuracy only evalutes the polarity detection given successfully identified function needs. } +\label{table:fsa} +\end{table} + +We then evaluate the performance of product function satisfiability analysis, which requires the label space of all models to be $L^s=\{\textit{O, S, UN, U, F-S, F-UN, F-U}\}$. +Similar to the previous task, we consider an extracted function target that has more than or equal to 50\% overlapping words with the ground truth function target as a \textit{positive function target extraction}. +If there is at least one function words that are correctly predicted, or the function word from the ground truth is missing, we consider such case as a \textit{positive function word extraction}. +A \textit{true positive extraction} is generated when both a positive function target extraction and a positive function word extraction happen. +The rest of evaluation metrics is the same as in the previous subsection except the change of corresponding terms, as shown in Table \ref{table:fsa}. + +\textbf{Result Analysis}: +We can see that the performance of DAN outperforms other baselines. +DAN improves over DAN (-) Answer Attention a little for function need recognition, but a lot for polarity detection due to answer attention. +The baseline QA CoAttention indicates that the QA story in DAN is better given the longer QA story rather than the question or the answer alone. +Further, we notice that the performance of QA S-BLSTM and QA CoAttention are close. +So the short question or answer alone may not have enough information. +Sometimes it may even introduce noise. +Lastly, CRF performs poorly because of its poor representation learning capability. +\subsection{Qualitative Analysis} +To get a better sense of the extracted function expressions (or needs), we sample a few predictions for 5 popular products from DAN, as shown in Table \ref{table:qua}. +We observe that many function needs are indeed customers' high priority needs. +Most function needs are extrinsic functions and their function targets can be interpreted as complementary products. +For example, it is important to know that the Tablet is not designed for high-performance games like ``fallout 4'', +or google apps are not runnable on Cellphone 1. +Intrinsic functions are also identified, such as ``waterproof'' or ``support multi pairing''. +Knowing whether Apple Watch is waterproof or not is very important when deciding whether to buy such a product. + +\begin{table} +\footnotesize +\centering +\scalebox{0.85}{ +\begin{tabular}{ l | l | l } +\hline +Product & Satisfiable & Unsatisfiable \\ +\hline +Tablet & +\begin{tabular}[c]{@{}l@{}} +\textbf{run} \underline{itunes} \\ +\textbf{read} \underline{kindle books} \\ +\end{tabular} +& +\begin{tabular}[c]{@{}l@{}} +\textbf{play} \underline{Xbox One games} \\ +\textbf{run} \underline{fallout 4} \\ +\end{tabular} +\\ +\hline +Cellphone 1 & +\begin{tabular}[c]{@{}l@{}} +\textbf{work on} \underline{cricket} \\ +\textbf{run} \underline{Gmail} \\ +\end{tabular} +& +\begin{tabular}[c]{@{}l@{}} +\textbf{get} \underline{google apps} \\ +\textbf{support} \underline{SD card} \\ +\end{tabular} +\\ +\hline +Laptop 1 & +\begin{tabular}[c]{@{}l@{}} +\textbf{Install} \underline{Windows} \\ +\textbf{install} \underline{adobe flash player} \\ +\end{tabular} +& +\begin{tabular}[c]{@{}l@{}} +\textbf{use with} \underline{HDMI}\\ +\textbf{support} \underline{Appleworks} \\ +\end{tabular} +\\ +\hline +Apple Watch & +\begin{tabular}[c]{@{}l@{}} +\textbf{work on} \underline{IPhone 6 plus} \\ +\textbf{comp. with} \underline{apple comp.} \\ +\end{tabular} +& +\begin{tabular}[c]{@{}l@{}} +\textbf{comp. with} \underline{android phones} \\ +\underline{waterproof} \\ +\end{tabular} \\ +\hline +Mouse & +\begin{tabular}[c]{@{}l@{}} +\underline{mac} \textbf{compatible} \\ +\underline{Android} \\ +\end{tabular} +& +\begin{tabular}[c]{@{}l@{}} +\textbf{work on} \underline{glass table} \\ +\textbf{support} \underline{multi pairing} \\ +\end{tabular} +\\ +\hline +\end{tabular} +} +\caption{Satisfiable function needs and unsatisfiable function needs from 5 popular products: the function word are bolded and the function targets are underlined.} +\label{table:qua} +\end{table} +\section{Conclusion} +In this paper, we propose two closely related problems: +product compatibility analysis and function satisfiability analysis, where the second problem is a generalization of the first problem. +We address this problem by first creating an annotated corpus based on Product Community Question and Answering (PCQA). +Then we propose a neural Dual Attention Network (DAN) to solve these two (2) problems in an end-to-end manner. +Experiments demonstrate that DAN is superior to a wide spectrum of baselines. +Applications of this model can be found in e-commerce websites and recommender systems. +\section{ Acknowledgments} +This work is supported in part by NSF through grants IIS-1526499, CNS-1626432, and NSFC 61672313. +We would also like to thank anonymous reviewers for their valuable feedback to improve this paper. + +\bibliography{aaai2018} +\bibliographystyle{aaai} diff --git a/1712.02046v2.txt b/1712.02046v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..0147cff1fcc2d17bafdbc1db5c86e21300881d25 --- /dev/null +++ b/1712.02046v2.txt @@ -0,0 +1,107 @@ +Probabilistic graphical models with latent variables are powerful in modeling many important problems in machine learning and artificial intelligence (?; ?). The existence of latent variables in such models provides us with the ability to capture richer statistical dependencies among observed variables. However, learning latent-variable graphical models is often difficult, due to the non-convex nature of their parameter learning problem and the intractability in the corresponding inference procedure. + +Currently, there are two main types of learning algorithms for latent-variable graphical models. The first one is the Expectation-Maximization algorithm (?), which transforms the parameter learning problem into an iterative procedure that maximizes a non-convex objective function. However, the EM algorithm only provides weak theoretical guarantees, can lead to bad local optima and has slow convergence. To address these problems of EM, recently a second type of methods called spectral learning has been proposed (?; ?; ?). Spectral learning algorithms are based on the idea of method of moments and reparametrize the latent graphical models such that the learning procedure can be performed through tensor algebra using only observed quantities. Although spectral algorithms enjoy the benefits of being provably consistent, computationally efficient and local-optima-free, they have three key limitations. First, most spectral learning algorithms only apply to restricted types of latent structures (mostly trees), and are hard to generalize to more complicated latent structures beyond trees (e.g. loopy graphs). Second, most spectral learning algorithms can only deal with discrete random variables and cannot be easily extended to handle continuous random variables. Third, the current spectral algorithms are generally idiosyncratic to the specific model structures that they are targeted to learn, and thus cannot provide a flexible learning framework to incorporate different prior knowledge and probabilistic assumptions when facing different learning scenarios. + +In order to overcome these limitations of previous methods, in this paper we propose a new algorithm for learning general latent-variable graphical models that applies to all different types of latent structures, can handle both discrete and continuous variables of arbitrary forms of probability distribution in a nonparametric fashion, and allows us to incorporate different types of prior knowledge into the learning process, while still remaining provably consistent, local-optima-free and fast to compute. To achieve this, we introduce a new way of formulating message-passing inference over junction trees called predictive belief propagation. In contrast to conventional formulations of message passing, which treat a message as a direct summary of all the probabilistic information seen in the past, we instead think of a message as encoding our predictions about the probabilistic information of all the variables in the future part of the graphical model given what we have seen in the past. This new perspective allows us to systematically reparametrize message passing inference on latent junction trees purely in terms of observable variables, and to directly learn this alternative parametrization from observed quantities in training data. During learning, our algorithm first converts a latent graphical model into its corresponding latent junction tree, and then reduces the parameter learning problem down to a sequence of regression problems using a simple and fast approach called Two-Stage Regression, which also allows us to incorporate prior knowledge into the learning process. Moreover, our proposed learning algorithm is also flexible enough to allow us to easily extend it to handle graphical models with continuous random variables using the technique of Hilbert Space Embeddings. When dealing with continuous variables, we first embed their distributions into reproducing-kernel Hilbert spaces, and then use the kernel trick to perform all necessary learning operations over latent junction trees via tensor algebra. + +The main contributions of our work are: + +(1) We introduce a novel formulation of message-passing inference over latent-variable junction trees named predictive belief propagation (Section 3), and then propose a new algorithm for learning general latent-variable graphical models based on it using Two-Stage Regression (Section 3 and 4). Our new algorithm overcomes many severe limitations faced by previous methods for learning latent graphical models, including EM and the spectral algorithms, and provides a general algorithmic framework that unifies the learning of all different kinds of latent graphical models. + +(2) We prove the correctness of our new algorithm by showing that it learns to compute a statistically consistent estimator of any conditional probability distribution over observable variables that we may query in a latent-variable graphical model during inference (Appendix A.5). + +(3) We extend our algorithm from discrete domain to continuous domain using Hilbert Space Embeddings of distributions (Section 5). + +(4) We demonstrate that our learning algorithm outperforms both the EM algorithm and the spectral algorithm and runs significantly faster in experiments on both synthetic and real datasets (Section 6). + +Previously, Parikh et al. proposed a spectral algorithm (?) for learning latent junction trees based on an alternative tensor parameterization. However, the algorithm in (?) can only yield the marginal joint probability of all the observable variables in a latent graphical model together, without the ability to flexibly compute the posterior probability of arbitrary observable variables given other observed variables as evidence in a tractable manner. In contrast, our new algorithm overcomes this limitation and supports arbitrary inference in tractable forms by introducing a more flexible predictive message-passing paradigm. Moreover, our algorithm provides the ability to freely incorporate prior knowledge and to handle continuous variables, which also cannot be achieved by the spectral algorithm in (?). + +The central machine learning problem that we are dealing with in this paper is to learn general latent-variable probabilistic graphical models such that we can perform accurate inference over them among the observable variables. Traditionally, latent-variable graphical models are often parametrized using a set of local conditional probability tables (CPTs) that are associated with the edges in the graphs, and learning these models would mean to explicitly recover their CPT parameters from training data (?). However, in most cases of application, the primary goal of learning a latent-variable graphical model is to be able to make accurate inference and predictions over its observable variables, and recovering its original CPT parameters is not needed at all. Therefore, in this paper we develop a new learning method that learns an alternative parametrization of general latent-variable graphical models purely based on observable quantities, such that we can directly perform accurate probabilistic inference on them using the learned alternative parametrization. We don’t aim to learn the original CPT parameters of latent graphical models, and bypass them using our alternative parametrization. + +For a latent-variable probabilistic graphical model G𝐺G of arbitrary graph structure, let 𝒪𝒪\mathscr{O} denote the set of all observable variables in G𝐺G: 𝒪={X1,…,X|𝒪|}𝒪subscript𝑋1…subscript𝑋𝒪\mathscr{O}=\{X_{1},...,X_{|\mathscr{O}|}\}, and let ℋℋ\mathscr{H} denote the set of all latent variables in G𝐺G: ℋ={X|𝒪|+1,…,X|𝒪|+|ℋ|}ℋsubscript𝑋𝒪1…subscript𝑋𝒪ℋ\mathscr{H}=\{X_{|\mathscr{O}|+1},...,X_{|\mathscr{O}|+|\mathscr{H}|}\}. Now our learning and inference problem at hand can be mathematically formulated as the following desired input-output behavior: + +Input: given a training dataset of N𝑁N i.i.d.formulae-sequence𝑖𝑖𝑑i.i.d. samples of the set of all observable variables {x1d,…,x|𝒪|d}d=1Nsuperscriptsubscriptsuperscriptsubscript𝑥1𝑑…superscriptsubscript𝑥𝒪𝑑𝑑1𝑁\{x_{1}^{d},...,x_{|\mathscr{O}|}^{d}\}_{d=1}^{N}, a set of observed evidence {Xi=xi}i∈ℰsubscriptsubscript𝑋𝑖subscript𝑥𝑖𝑖ℰ\{X_{i}=x_{i}\}_{i\in\mathcal{E}} (here ℰℰ\mathcal{E} denotes the set of index for the set of observable variables that are observed as evidence), and the index Q𝑄Q of the query node XQsubscript𝑋𝑄X_{Q}. + +Output: calculate an estimate of the posterior distribution of the query node conditioned on the observed evidence: ℙ^​[XQ∣{Xi=xi}i∈ℰ]^ℙdelimited-[]conditionalsubscript𝑋𝑄subscriptsubscript𝑋𝑖subscript𝑥𝑖𝑖ℰ\widehat{\mathbb{P}}[X_{Q}\mid\{X_{i}=x_{i}\}_{i\in\mathcal{E}}]. + +Here the variables in G𝐺G can be either discrete-valued or continuous-valued, and if the variables are continuous-valued, they are not restricted to have any specific functional forms of probability density function. Our algorithm can handle all of them gracefully in a nonparametric fashion. + +Here we first introduce two important notions that will be used throughout this paper. + +Sufficient Statistics Feature Vector  In statistics and machine learning, the sufficient statistics feature vector of a random variable X𝑋X is such a feature vector v​(X)𝑣𝑋v(X) that knowing its expectation 𝔼X∼p​[v​(X)]subscript𝔼similar-to𝑋𝑝delimited-[]𝑣𝑋\mathbb{E}_{X\sim p}[v(X)] under X𝑋X’s probabilistic distribution p𝑝p would completely determine that distribution p𝑝p. And similarly, the sufficient statistics feature vector of a group of random variables {X1,…,Xk}subscript𝑋1…subscript𝑋𝑘\{X_{1},...,X_{k}\} is such a feature vector v​({X1,…,Xk})𝑣subscript𝑋1…subscript𝑋𝑘v(\{X_{1},...,X_{k}\}) that knowing its expectation 𝔼{X1,…,Xk}∼p​[v​({X1,…,Xk})]subscript𝔼similar-tosubscript𝑋1…subscript𝑋𝑘𝑝delimited-[]𝑣subscript𝑋1…subscript𝑋𝑘\mathbb{E}_{\{X_{1},...,X_{k}\}\sim p}[v(\{X_{1},...,X_{k}\})] under {X1,…,Xk}subscript𝑋1…subscript𝑋𝑘\{X_{1},...,X_{k}\}’s joint probabilistic distribution p𝑝p would completely determine that joint distribution p𝑝p. For example, if X𝑋X is a discrete random variable, then its sufficient statistics feature vector v​(X)𝑣𝑋v(X) can be the vector of indicator functions whose i𝑖i-th entry is 1 if X𝑋X takes the i𝑖i-th value, and is 0 if otherwise. And for a group of discrete-valued random variables, their sufficient statistics feature vector can be the vectorized version of the outer product of all their individual vectors of indicator functions. See Appendix A.4 for the continuous-valued case. + +Junction Trees  In probabilistic graphical models, junction trees are a classical type of transformation that allows efficient message-passing inference algorithms to be performed over loopy graphical models. In order to design a learning and inference algorithm for general latent-variable graphical models, which may have loopy or non-loopy graph structures, we need to first resort to the junction tree algorithm (?) to transform latent graphical models into their corresponding latent junction tree representations, over which we can perform message-passing inference. Consider the latent graphical model G𝐺G defined in Section 2. We first run the junction tree algorithm to convert G𝐺G into a latent junction tree T𝑇T, and then associate each observable variable in G𝐺G with one leaf clique in T𝑇T. Now pick a non-leaf clique node Crsubscript𝐶𝑟C_{r} as the root of T𝑇T, which naturally sets a topological order over T𝑇T. Then for each separator set S𝑆S in T𝑇T, we define its inside tree I​n​(S)𝐼𝑛𝑆In(S) to be the subtree rooted at S𝑆S, and define its outside tree O​u​t​(S)𝑂𝑢𝑡𝑆Out(S) to be the rest of T𝑇T excluding S𝑆S and I​n​(S)𝐼𝑛𝑆In(S). See Figure 2 and 3 for an example. + +In conventional methods for running belief propagation inference over junction trees, such as the Shafer-Shenoy algorithm (?) and the Hugin algorithm (?; ?), the messages are defined to integrate together all the local probabilistic information from the past part of the junction tree in the form of partial results of sum-product calculations and send this compact summary of the past to the future part of the junction tree.111Formally, when we pass a message across a separator set in a junction tree, we can split the junction tree from this separator set into two separate subtrees. We refer to the subtree that the message-passing direction is pointing toward as the future part of the junction tree, and the other subtree as the past part of the junction tree. See Figure 3 for an example. This requires the learning algorithm to be able to estimate the innate parametrization of the original latent graphical model, in the form of local conditional probability tables or local potential functions, directly from the training data. However, the innate parametrization of latent graphical models heavily involves hidden variables that we cannot observe, which makes it hard to directly learn this parametrization from training data. This discrepancy gives rise to the key difficulty in learning general latent graphical models, and forces previous methods to resort to inefficient local search heuristics such as EM. + +To overcome this difficulty, we draw inspiration from the notion of predictive state representations (PSRs) (?; ?), which are a popular class of models for discrete-time dynamical systems. The key idea behind PSRs is to represent the state of a dynamical system as a set of predictions of features of observable variables in the future, which distinguishes them from the traditional history-based models and hidden-state-based models (?). Such an alternative representation of state based on observable quantities allows us to directly learn to perform filtering and prediction over dynamical systems from training data in a fast, provably consistent and local-optima-free fashion (?). + +In essence, the state of a system is a time bottleneck that compactly summarizes everything we need to know about the past in order to predict the future. From this viewpoint, when we perform belief propagation over a latent junction tree, the message that we send across a separator set can be viewed as the current state of the junction tree inference system at that particular separator set. Therefore, in analogy to PSRs, we can let the messages to encode our posterior predictions about the probabilistic information of the observable variables in the future part of the junction tree, given the observed evidence that we have absorbed from the past part of the junction tree. In PSRs, a common approach is to use a vector of sufficient statistics for a finite window of future observations to represent the state of a dynamical system. And analogously, in our case, at each separator set we can use a vector containing features of sufficient statistics for a subset of core observable variables in the future part of the junction tree to represent the message that we send across that separator set. Then during inference, we pass these predictive messages around over the latent junction tree to collect and propagate information we observe from evidence nodes and to compute the results of our inference queries. This forms our central idea of predictive belief propagation, which is the foundation of our new algorithm for learning latent-variable graphical models. The major advantage of this new way of thinking about message passing from a predictive perspective is that it enables us to efficiently learn general latent graphical models directly from observed quantities under a unified framework. Figure 1 provides an illustration of the comparison between predictive belief propagation and conventional belief propagation. + +Now under the predictive belief propagation (PBP) framework, we first need to define what exactly are the predictive messages that we pass around over a latent junction tree during inference. As discussed above, the predictive messages in PBP are analogous to the predictive states in PSRs. In PSRs, a common approach is to use a vector of sufficient statistics (called the core set of tests) for a finite window of future observations to represent the predictive state of a dynamical system, because the infinite system-dynamics matrix can often be proven to have finite rank. Then analogously, in our PBP case, at each separator set we can use a sufficient statistics feature vector for a group of core observable variables in the future part of the junction tree to represent the predictive message that we send across that separator set. Now we make the following two key definitions: + +Definition 1. We define the core group of observable variables α​(S)𝛼𝑆\alpha(S) for each separator set S𝑆S to be a subset of all the observable variables that are associated with the leaf clique nodes in I​n​(S)𝐼𝑛𝑆In(S) whose posterior joint distribution conditioned on evidence from O​u​t​(S)𝑂𝑢𝑡𝑆Out(S) completely determines the posterior joint distribution of all the observable variables that are associated with the leaf clique nodes in I​n​(S)𝐼𝑛𝑆In(S). More formally, let 𝐎𝐕​[I​n​(S)]𝐎𝐕delimited-[]𝐼𝑛𝑆\mathbf{OV}[In(S)] denote all the observable variables that are associated with the leaf clique nodes in the inside tree I​n​(S)𝐼𝑛𝑆In(S), and let 𝐎𝐕​[O​u​t​(S)]𝐎𝐕delimited-[]𝑂𝑢𝑡𝑆\mathbf{OV}[Out(S)] denote all the observable variables that are associated with the leaf clique nodes in the outside tree O​u​t​(S)𝑂𝑢𝑡𝑆Out(S), then the core group α​(S)𝛼𝑆\alpha(S) satisfies the conditional independence property that: {𝐎𝐕​[I​n​(S)]∖α​(S)}⟂⟂𝐎𝐕​[O​u​t​(S)]∣α​(S)perpendicular-toabsentperpendicular-to𝐎𝐕delimited-[]𝐼𝑛𝑆𝛼𝑆conditional𝐎𝐕delimited-[]𝑂𝑢𝑡𝑆𝛼𝑆\{\mathbf{OV}[In(S)]\setminus\alpha(S)\}\mathrel{\perp\mspace{-10.0mu}\perp}\mathbf{OV}[Out(S)]\mid\alpha(S). + +Such a core group of observable variables α​(S)𝛼𝑆\alpha(S) always exists for each separator set S𝑆S, since at least the set 𝐎𝐕​[I​n​(S)]𝐎𝐕delimited-[]𝐼𝑛𝑆\mathbf{OV}[In(S)] would certainly qualify as being α​(S)𝛼𝑆\alpha(S), by definition. But in order to reduce the computational complexity of our learning and inference algorithm, it is desirable to find the minimal core group α​(S)𝛼𝑆\alpha(S) for each S𝑆S. We present the process for determining the minimal core group in Appendix A.2. + +Definition 2. Let θS​[α​(S)]superscript𝜃𝑆delimited-[]𝛼𝑆\theta^{S}[\alpha(S)] denote a sufficient statistic feature vector for α​(S)𝛼𝑆\alpha(S), and let ΩΩ\Omega denote the evidence information that we observe from O​u​t​(S)𝑂𝑢𝑡𝑆Out(S). Then we define the predictive message that we send across each separator set S𝑆S to be the conditional expectation of θS​[α​(S)]superscript𝜃𝑆delimited-[]𝛼𝑆\theta^{S}[\alpha(S)] conditioned on ΩΩ\Omega, i.e. 𝔼​[θS​[α​(S)]∣Ω]𝔼delimited-[]conditionalsuperscript𝜃𝑆delimited-[]𝛼𝑆Ω\mathbb{E}\big{[}\theta^{S}[\alpha(S)]\mid\Omega\big{]}. + +Now the goal of our learning algorithm is to learn how these predictive messages relate to each other during PBP inference over a latent junction tree from training data. Without loss of generality, let’s consider a non-leaf separator set S𝑆S in a latent junction tree T𝑇T, where S𝑆S is connected with K𝐾K child separator sets {S1,S2,…,SK}subscript𝑆1subscript𝑆2…subscript𝑆𝐾\{S_{1},S_{2},...,S_{K}\} below it through a clique node C𝐶C. According to the definition of core groups in Definition 1, since α​(S1)𝛼subscript𝑆1\alpha(S_{1}), α​(S2)𝛼subscript𝑆2\alpha(S_{2}), … , α​(SK)𝛼subscript𝑆𝐾\alpha(S_{K}) are all contained in I​n​(S)𝐼𝑛𝑆In(S), their posterior joint distributions ℙ​[α​(S1)∣Ω],ℙ​[α​(S2)∣Ω],…,ℙ​[α​(SK)∣Ω]ℙdelimited-[]conditional𝛼subscript𝑆1Ωℙdelimited-[]conditional𝛼subscript𝑆2Ω…ℙdelimited-[]conditional𝛼subscript𝑆𝐾Ω\mathbb{P}\big{[}\alpha(S_{1})\mid\Omega\big{]},\mathbb{P}\big{[}\alpha(S_{2})\mid\Omega\big{]},...,\mathbb{P}\big{[}\alpha(S_{K})\mid\Omega\big{]} are thus all completely determined by ℙ​[α​(S)∣Ω]ℙdelimited-[]conditional𝛼𝑆Ω\mathbb{P}\big{[}\alpha(S)\mid\Omega\big{]}. Therefore, the conditional expectations 𝔼​[θS1​[α​(S1)]∣Ω],𝔼​[θS2​[α​(S2)]∣Ω],…,𝔼​[θSK​[α​(SK)]∣Ω]𝔼delimited-[]conditionalsuperscript𝜃subscript𝑆1delimited-[]𝛼subscript𝑆1Ω𝔼delimited-[]conditionalsuperscript𝜃subscript𝑆2delimited-[]𝛼subscript𝑆2Ω…𝔼delimited-[]conditionalsuperscript𝜃subscript𝑆𝐾delimited-[]𝛼subscript𝑆𝐾Ω\mathbb{E}\big{[}\theta^{S_{1}}[\alpha(S_{1})]\mid\Omega\big{]},\mathbb{E}\big{[}\theta^{S_{2}}[\alpha(S_{2})]\mid\Omega\big{]},...,\mathbb{E}\big{[}\theta^{S_{K}}[\alpha(S_{K})]\mid\Omega\big{]}, as well as their outer product, must also be fully determined by the conditional expectation 𝔼​[θS​[α​(S)]∣Ω]𝔼delimited-[]conditionalsuperscript𝜃𝑆delimited-[]𝛼𝑆Ω\mathbb{E}\big{[}\theta^{S}[\alpha(S)]\mid\Omega\big{]} (because all the θ𝜃\theta’s here are sufficient statistics feature vectors). That is to say, there exists a linear operator 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} in the form of a (K𝐾K+1)-th order tensor with each mode corresponding to S,S1,S2,…,SK𝑆subscript𝑆1subscript𝑆2…subscript𝑆𝐾S,S_{1},S_{2},...,S_{K} respectively, such that:⊗k=1K𝔼​[θSk​[α​(Sk)]∣Ω]=𝒲S×S𝔼​[θS​[α​(S)]∣Ω]superscriptsubscripttensor-product𝑘1𝐾𝔼delimited-[]conditionalsuperscript𝜃subscript𝑆𝑘delimited-[]𝛼subscript𝑆𝑘Ωsubscript𝑆superscript𝒲𝑆𝔼delimited-[]conditionalsuperscript𝜃𝑆delimited-[]𝛼𝑆Ω\operatorname*{\otimes}\limits_{k=1}^{K}\mathbb{E}\big{[}\theta^{S_{k}}[\alpha(S_{k})]\mid\Omega\big{]}=\mathcal{W}^{S}\times_{S}\mathbb{E}\big{[}\theta^{S}[\alpha(S)]\mid\Omega\big{]}for any outside tree evidence ΩΩ\Omega, where ⊗tensor-product\otimes denotes outer product and ×Ssubscript𝑆\times_{S} denotes mode-specific tensor multiplication222For a detailed introduction to tensor algebra, we refer the readers to (?). In this paper we adopt the notations from (?) to label the modes of tensors with random variables. along mode S𝑆S. + +Therefore, the predictive messages in PBP relate to each other through 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} according to Eq. (1). This linear operator 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} essentially acts as a message processor and distributor during PBP inference. + +Therefore, the major goal of our learning algorithm is to learn the linear operator 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} for each non-leaf separator set S𝑆S in T𝑇T from training data. Previously, (?) proposed a method named Two-Stage Regression (2SR) to learn PSRs of linear dynamical systems. 2SR learns PSRs by solving a sequence of regression problems, and is fast and statistically consistent. The key idea of 2SR is to use instrumental variable regression (?) to recover an unbiased estimate of the linear mappings in PSRs. Here we generalize 2SR to latent junction trees to learn 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S}. First, pick a feature vector for O​u​t​(S)𝑂𝑢𝑡𝑆Out(S) and denote it by ηS​[O​u​t​(S)]superscript𝜂𝑆delimited-[]𝑂𝑢𝑡𝑆\eta^{S}[Out(S)]. Then using ηS​[O​u​t​(S)]superscript𝜂𝑆delimited-[]𝑂𝑢𝑡𝑆\eta^{S}[Out(S)] as our instrumental variable, we can perform our Two-Stage Regression to learn 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} in three steps: (1) regress θS​[α​(S)]superscript𝜃𝑆delimited-[]𝛼𝑆\theta^{S}[\alpha(S)] on ηS​[O​u​t​(S)]superscript𝜂𝑆delimited-[]𝑂𝑢𝑡𝑆\eta^{S}[Out(S)]; (2) regress ⊗k=1KθSk​[α​(Sk)]superscriptsubscripttensor-product𝑘1𝐾superscript𝜃subscript𝑆𝑘delimited-[]𝛼subscript𝑆𝑘\operatorname*{\otimes}\limits_{k=1}^{K}\theta^{S_{k}}[\alpha(S_{k})] on ηS​[O​u​t​(S)]superscript𝜂𝑆delimited-[]𝑂𝑢𝑡𝑆\eta^{S}[Out(S)]; (3) run a linear regression from the predictions obtained in step (1) to the predictions obtained in step (2) to recover an unbiased estimate of 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S}. These three steps of supervised learning constitute our new Two-Stage Regression approach for latent junction trees, which will manifest itself in the learning algorithm in Section 4. + +We are now ready to present our new algorithm for learning general latent-variable probabilistic graphical models based on the framework of predictive belief propagation. It has two components: a learning algorithm and a corresponding inference algorithm that allows us to perform probabilistic inference over latent graphical models using the results learned from the learning algorithm. Here we first describe the basic version of our algorithm for the case where all observable variables in a graphical model are discrete-valued. Then we show how to extend our algorithm to handle graphical models with continuous-valued variables in Section 5. See Appendix A.3 for a pseudocode summary of our algorithm and see Appendix A.5 for the proof of consistency of our algorithm. + +Step 1. Model Construction:Run the junction tree algorithm to convert G𝐺G into an appropriate latent-variable junction tree T𝑇T and pick a root Crsubscript𝐶𝑟C_{r} for T𝑇T, such that each observable variable in G𝐺G can be associated with one leaf clique in T𝑇T. See Figure 2(a) and 2(b) for a concrete example. + +Step 2. Model Specification:For each separator set S𝑆S in T𝑇T, among all the observable variables that are associated with the leaf clique nodes in its inside tree I​n​(S)𝐼𝑛𝑆In(S), determine its minimal core group α​(S)={A1,A2,…,A|α​(S)|}𝛼𝑆subscript𝐴1subscript𝐴2…subscript𝐴𝛼𝑆\alpha(S)=\{A_{1},A_{2},...,A_{|\alpha(S)|}\} using the procedure described in Appendix A.2. And among all the observable variables associated with its outside tree O​u​t​(S)𝑂𝑢𝑡𝑆Out(S), select a subset of variables β​(S)={B1,B2,…,B|β​(S)|}𝛽𝑆subscript𝐵1subscript𝐵2…subscript𝐵𝛽𝑆\beta(S)=\{B_{1},B_{2},...,B_{|\beta(S)|}\} (this can be any subset). (See Figure 3 for a concrete example.) Now pick a feature vector θS​[α​(S)]superscript𝜃𝑆delimited-[]𝛼𝑆\theta^{S}[\alpha(S)] for α​(S)𝛼𝑆\alpha(S) and a feature vector ηS​[β​(S)]superscript𝜂𝑆delimited-[]𝛽𝑆\eta^{S}[\beta(S)] for β​(S)𝛽𝑆\beta(S), where we require that θSsuperscript𝜃𝑆\theta^{S} must be a sufficient statistics feature vector for α​(S)𝛼𝑆\alpha(S) and ηSsuperscript𝜂𝑆\eta^{S} can be any feature vector. For discrete-valued α​(S)𝛼𝑆\alpha(S), this sufficient statistic feature vector can simply be the (vectorized) outer product of the vectors of indicator functions of all the variables in α​(S)𝛼𝑆\alpha(S); and for continuous-valued α​(S)𝛼𝑆\alpha(S), this sufficient statistic feature vector can be the (vectorized) outer product of the implicit feature map of characteristic kernels of all the variables in α​(S)𝛼𝑆\alpha(S) (see Appendix A.4). + +Step 3. Stage 1A Regression (S1A):At each non-leaf separator set S𝑆S in T𝑇T, learn a (possibly non-linear) regression model to estimate θS¯=𝔼​[θS∣ηS]¯superscript𝜃𝑆𝔼delimited-[]conditionalsuperscript𝜃𝑆superscript𝜂𝑆\bar{\theta^{S}}=\mathbb{E}[\theta^{S}\mid\eta^{S}]. The training data for this regression model is {(θS​[α​(S)d],ηS​[β​(S)d])}d=1Nsuperscriptsubscriptsuperscript𝜃𝑆delimited-[]𝛼superscript𝑆𝑑superscript𝜂𝑆delimited-[]𝛽superscript𝑆𝑑𝑑1𝑁\big{\{}\big{(}\theta^{S}[\alpha(S)^{d}],\eta^{S}[\beta(S)^{d}]\big{)}\big{\}}_{d=1}^{N} across all N𝑁N i.i.d.formulae-sequence𝑖𝑖𝑑i.i.d. training samples. + +Step 4. Stage 1B Regression (S1B):At each non-leaf separator set S𝑆S in T𝑇T, where S𝑆S is connected with K𝐾K child separator sets {S1,S2,…,SK}subscript𝑆1subscript𝑆2…subscript𝑆𝐾\{S_{1},S_{2},...,S_{K}\} below it, learn a (possibly non-linear) regression model to estimate ⊗k=1KθSk¯=𝔼​[⊗k=1KθSk∣ηS]¯superscriptsubscripttensor-product𝑘1𝐾superscript𝜃subscript𝑆𝑘𝔼delimited-[]conditionalsuperscriptsubscripttensor-product𝑘1𝐾superscript𝜃subscript𝑆𝑘superscript𝜂𝑆\bar{\operatorname*{\otimes}\limits_{k=1}^{K}\theta^{S_{k}}}=\mathbb{E}[\operatorname*{\otimes}\limits_{k=1}^{K}\theta^{S_{k}}\mid\eta^{S}]. The training data for this regression model are {(⊗k=1KθSk​[α​(Sk)d],ηS​[β​(S)d])}d=1Nsuperscriptsubscriptsuperscriptsubscripttensor-product𝑘1𝐾superscript𝜃subscript𝑆𝑘delimited-[]𝛼superscriptsubscript𝑆𝑘𝑑superscript𝜂𝑆delimited-[]𝛽superscript𝑆𝑑𝑑1𝑁\big{\{}\big{(}\operatorname*{\otimes}\limits_{k=1}^{K}\theta^{S_{k}}[\alpha(S_{k})^{d}],\eta^{S}[\beta(S)^{d}]\big{)}\big{\}}_{d=1}^{N} across all N𝑁N i.i.d.formulae-sequence𝑖𝑖𝑑i.i.d. training samples. + +Note: In the S1A and S1B regression steps above, we can use any supervised learning algorithm as our regression model. This provides us with the flexibility to incorporate different prior knowledge into our learning process. + +Step 5. Stage 2 Regression (S2):At each non-leaf separator set S𝑆S in T𝑇T, use the feature expectations estimated in S1A and S1B to train a linear regression model to predict ⊗k=1KθSk¯=𝒲S×SθS¯¯superscriptsubscripttensor-product𝑘1𝐾superscript𝜃subscript𝑆𝑘subscript𝑆superscript𝒲𝑆¯superscript𝜃𝑆\bar{\operatorname*{\otimes}\limits_{k=1}^{K}\theta^{S_{k}}}=\mathcal{W}^{S}\times_{S}\bar{\theta^{S}}, where 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} is the linear operator associated with S𝑆S. Output the learned parameter tensor 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S}. The training data for this linear regression model are estimates of (⊗k=1KθSk¯,θS¯)¯superscriptsubscripttensor-product𝑘1𝐾superscript𝜃subscript𝑆𝑘¯superscript𝜃𝑆\big{(}\bar{\operatorname*{\otimes}\limits_{k=1}^{K}\theta^{S_{k}}},\bar{\theta^{S}}\big{)} for all the training samples that we obtained from S1A and S1B regressions. + +Step 6. Root Tensor Estimation:At the root Crsubscript𝐶𝑟C_{r}, estimate the expectation of the outer product of the inside tree feature vectors of all adjacent separator sets that are connected with Crsubscript𝐶𝑟C_{r} by taking average across all the N𝑁N i.i.d.formulae-sequence𝑖𝑖𝑑i.i.d. training samples: 𝒯Cr=𝔼^​[⊗S∈γ​(Cr)θS​[α​(S)]]=1N​∑d=1N⊗S∈γ​(Cr)θS​[α​(S)d]superscript𝒯subscript𝐶𝑟^𝔼delimited-[]subscripttensor-product𝑆𝛾subscript𝐶𝑟superscript𝜃𝑆delimited-[]𝛼𝑆1𝑁superscriptsubscript𝑑1𝑁subscripttensor-product𝑆𝛾subscript𝐶𝑟superscript𝜃𝑆delimited-[]𝛼superscript𝑆𝑑\mathcal{T}^{C_{r}}=\widehat{\mathbb{E}}\big{[}\operatorname*{\otimes}\limits_{S\in\gamma(C_{r})}\theta^{S}[\alpha(S)]\big{]}=\dfrac{1}{N}\sum\limits_{d=1}^{N}\operatorname*{\otimes}\limits_{S\in\gamma(C_{r})}\theta^{S}[\alpha(S)^{d}] where γ​(Cr)𝛾subscript𝐶𝑟\gamma(C_{r}) denotes the set of all separator sets that are connected to Crsubscript𝐶𝑟C_{r}. Output the learned parameter tensor 𝒯Crsuperscript𝒯subscript𝐶𝑟\mathcal{T}^{C_{r}}. This root tensor 𝒯Crsuperscript𝒯subscript𝐶𝑟\mathcal{T}^{C_{r}} will later serve the function of exchanging information at the root clique Crsubscript𝐶𝑟C_{r} during Step 3(2) of the inference algorithm below. + +Output: The final outputs of our learning algorithm are the linear operators 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} for each non-leaf separator set that we obtained from Step 5 above, and the root tensor 𝒯Crsuperscript𝒯subscript𝐶𝑟\mathcal{T}^{C_{r}} that we obtained from Step 6 above. These 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} and 𝒯Crsuperscript𝒯subscript𝐶𝑟\mathcal{T}^{C_{r}} essentially serve as an alternative parametrization of the latent-variable graphical model G𝐺G that supports inference based on predictive belief propagation. In our inference algorithm below, we will use 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} and 𝒯Crsuperscript𝒯subscript𝐶𝑟\mathcal{T}^{C_{r}} to build our message-passing protocols and to calculate the result of our inference query. + +Our inference algorithm uses the learned alternative parametrization 𝒲Ssuperscript𝒲𝑆\mathcal{W}^{S} and 𝒯Crsuperscript𝒯subscript𝐶𝑟\mathcal{T}^{C_{r}} outputed by the learning algorithm above to compute inference query through predictive belief propagation. + +Step 1. Leaf Tensor Construction:For each leaf separator set Slsubscript𝑆𝑙S_{l} of T𝑇T, whose core group is α​(Sl)={A1,A2,…,A|α​(Sl)|}𝛼subscript𝑆𝑙subscript𝐴1subscript𝐴2…subscript𝐴𝛼subscript𝑆𝑙\alpha(S_{l})=\{A_{1},A_{2},...,A_{|\alpha(S_{l})|}\}, construct a leaf tensor ΦSlsuperscriptΦsubscript𝑆𝑙\Phi^{S_{l}} with modes θSlsuperscript𝜃subscript𝑆𝑙\theta^{S_{l}}, A1subscript𝐴1A_{1}, A2subscript𝐴2A_{2}, …, A|α​(Sl)|subscript𝐴𝛼subscript𝑆𝑙A_{|\alpha(S_{l})|} and dimensions l​e​n​g​t​h​(θSl)×𝒩​(A1)×𝒩​(A2)×…×𝒩​(A|α​(Sl)|)𝑙𝑒𝑛𝑔𝑡ℎsuperscript𝜃subscript𝑆𝑙𝒩subscript𝐴1𝒩subscript𝐴2…𝒩subscript𝐴𝛼subscript𝑆𝑙length(\theta^{S_{l}})\times\mathcal{N}(A_{1})\times\mathcal{N}(A_{2})\times...\times\mathcal{N}(A_{|\alpha(S_{l})|}), where 𝒩​(X)𝒩𝑋\mathcal{N}(X) denotes the number of values for a discrete random variable X𝑋X. Each fiber333As explained in (?), a fiber of a tensor is a higher-order analogue of matrix rows and columns. A fiber along a mode is defined by fixing every mode of the tensor except for that one. of the tensor ΦSlsuperscriptΦsubscript𝑆𝑙\Phi^{S_{l}} along mode θSlsuperscript𝜃subscript𝑆𝑙\theta^{S_{l}} takes the value of the feature vector θSlsuperscript𝜃subscript𝑆𝑙\theta^{S_{l}} evaluated at the corresponding values of variables A1,A2,…,A|α​(Sl)|subscript𝐴1subscript𝐴2…subscript𝐴𝛼subscript𝑆𝑙A_{1},A_{2},...,A_{|\alpha(S_{l})|}, i.e.,ΦSl​(:,ℐ​(a1),ℐ​(a2),…,ℐ​(a|α​(Sl)|))=θSl​[a1,a2,…,a|α​(Sl)|]superscriptΦsubscript𝑆𝑙:ℐsubscript𝑎1ℐsubscript𝑎2…ℐsubscript𝑎𝛼subscript𝑆𝑙superscript𝜃subscript𝑆𝑙subscript𝑎1subscript𝑎2…subscript𝑎𝛼subscript𝑆𝑙\quad\Phi^{S_{l}}\big{(}:,\mathcal{I}(a_{1}),\mathcal{I}(a_{2}),...,\mathcal{I}(a_{|\alpha(S_{l})|})\big{)}=\theta^{S_{l}}[a_{1},a_{2},...,a_{|\alpha(S_{l})|}]where ℐ​(a)ℐ𝑎\mathcal{I}(a) denotes the order index of a value a𝑎a in all the possible values of A𝐴A. The purpose of these leaf tensors ΦSlsuperscriptΦsubscript𝑆𝑙\Phi^{S_{l}} is to completely encode the sufficient statistic feature information of all the observable variables in G𝐺G into our PBP inference system. + +Step 2. Initial Leaf Message Generation:At each leaf clique node Clsubscript𝐶𝑙C_{l} in T𝑇T, let δ​(C)𝛿𝐶\delta(C) denote the set of all observable variables that are associated with Clsubscript𝐶𝑙C_{l}, and let Slsubscript𝑆𝑙S_{l} denote the separator set right above Clsubscript𝐶𝑙C_{l}. We define a function ζ​(X)𝜁𝑋\zeta(X) of an observable variable X𝑋X that evaluates to an all-one vector if X𝑋X is not observed in the evidence and evaluates to a one-hot-encoding value indicator vector exsubscript𝑒𝑥e_{x} if X𝑋X is observed to have value x𝑥x in the set of observed evidence444For example, if X𝑋X is a discrete random variable that can take 6 possible values {1,2,3,4,5,6}123456\{1,2,3,4,5,6\}, and X is observed to have value 3 in the evidence, then e3=[0,0,1,0,0,0]subscript𝑒3001000e_{3}=[0,0,1,0,0,0]. That is to say:ζ​(X)={1→,if ​X​ is not observedex,if ​X​ is observed to have value ​x𝜁𝑋cases→1if 𝑋 is not observedsubscript𝑒𝑥if 𝑋 is observed to have value 𝑥\zeta(X)=\begin{cases}\vec{1},&\text{if }X\text{ is not observed}\\e_{x},&\text{if }X\text{ is observed to have value }x\end{cases}Then the upward message that we send from Clsubscript𝐶𝑙C_{l} to its parent clique node Cpsubscript𝐶𝑝C_{p} can be calculated as:mCl→Cp=ΦSl†×{δ​(C)}[⊗X∈δ​(C)ζ​(X)]subscript𝑚→subscript𝐶𝑙subscript𝐶𝑝subscript𝛿𝐶superscriptΦsuperscriptsubscript𝑆𝑙†delimited-[]subscripttensor-product𝑋𝛿𝐶𝜁𝑋m_{C_{l}\rightarrow C_{p}}=\Phi^{S_{l}^{\dagger}}\times_{\{\delta(C)\}}\big{[}\operatorname*{\otimes}\limits_{X\in\delta(C)}\zeta(X)\big{]}where ††{\dagger} denotes Moore-Penrose pseudoinverse. This step serves the purpose of collecting all the observed information in the evidence. + +Step 3. Message Passing: + +(1) From leaf to root (the upward phase):  For each non-root parent clique node C𝐶C in T𝑇T where it is separated by a separator set S𝑆S from its parent node Cpsubscript𝐶𝑝C_{p}, once it has received the messages from all of its child nodes C1,C2,…,CKsubscript𝐶1subscript𝐶2…subscript𝐶𝐾C_{1},C_{2},...,C_{K}, which are separated from it by separator sets S1,S2,…,SKsubscript𝑆1subscript𝑆2…subscript𝑆𝐾S_{1},S_{2},...,S_{K} respectively, compute and send the upward message:mC→Cp=𝒲S​×Sjj∈{1,2,…,K}⁡mCj→Csubscript𝑚→𝐶subscript𝐶𝑝superscript𝒲𝑆subscriptsubscriptsubscriptSj𝑗12…𝐾subscript𝑚→subscript𝐶𝑗𝐶m_{C\rightarrow C_{p}}=\mathcal{W}^{S}\operatorname*{\times_{S_{j}}}\limits_{j\in\{1,2,...,K\}}m_{C_{j}\rightarrow C}This step gradually collects all the local observed evidence information from all the leaf cliqes up to the root clique. + +(2) At the Root:  At the root clique node Crsubscript𝐶𝑟C_{r} of T𝑇T, which is surrounded by its K𝐾K child nodes C1,…,CKsubscript𝐶1…subscript𝐶𝐾C_{1},...,C_{K} (each separated from it by separator sets S1,…,SKsubscript𝑆1…subscript𝑆𝐾S_{1},...,S_{K} respectively), for each k∈{1,2,…,K}𝑘12…𝐾k\in\{1,2,...,K\}, once Crsubscript𝐶𝑟C_{r} has received all the K−1𝐾1K-1 upward messages from all of its other K−1𝐾1K-1 child nodes except for Cksubscript𝐶𝑘C_{k}, compute and send the downward message:mCr→Ck=𝒯Cr​×Sjj∈({1,2,…,K}\k)⁡mCj→Crsubscript𝑚→subscript𝐶𝑟subscript𝐶𝑘superscript𝒯subscript𝐶𝑟subscriptsubscriptsubscriptSj𝑗\12…𝐾𝑘subscript𝑚→subscript𝐶𝑗subscript𝐶𝑟m_{C_{r}\rightarrow C_{k}}=\mathcal{T}^{C_{r}}\operatorname*{\times_{S_{j}}}\limits_{j\in(\{1,2,...,K\}\backslash k)}m_{C_{j}\rightarrow C_{r}}This step summarizes and exchanges evidence information from different subtrees at the root clique. + +(3) From root to leaf (the downward phase):  For each non-root parent clique node C𝐶C in T𝑇T where it is separated from its parent node Cpsubscript𝐶𝑝C_{p} by a separator set S𝑆S and separated from its K𝐾K child nodes C1,C2,…,CKsubscript𝐶1subscript𝐶2…subscript𝐶𝐾C_{1},C_{2},...,C_{K} by separator sets S1,S2,…,SKsubscript𝑆1subscript𝑆2…subscript𝑆𝐾S_{1},S_{2},...,S_{K} respectively, once it has received the downward message mCp→Csubscript𝑚→subscript𝐶𝑝𝐶m_{C_{p}\rightarrow C} from Cpsubscript𝐶𝑝C_{p}, for each k∈{1,2,…,K}𝑘12…𝐾k\in\{1,2,...,K\}, compute and send the downward message:mC→Ck=𝒲S×SmCp→C​×Sjj∈({1,2,…,K}\k)⁡mCj→Csubscript𝑚→𝐶subscript𝐶𝑘subscript𝑆superscript𝒲𝑆subscript𝑚→subscript𝐶𝑝𝐶subscriptsubscriptsubscriptSj𝑗\12…𝐾𝑘subscript𝑚→subscript𝐶𝑗𝐶m_{C\rightarrow C_{k}}=\mathcal{W}^{S}\times_{S}m_{C_{p}\rightarrow C}\operatorname*{\times_{S_{j}}}\limits_{j\in(\{1,2,...,K\}\backslash k)}m_{C_{j}\rightarrow C}This step is the core operation of predictive belief propagation. We gradually compute predictive messages level by level from the root clique down to the leaf cliques. All the downward messages mC→Cksubscript𝑚→𝐶subscript𝐶𝑘m_{C\rightarrow C_{k}} in this step are predictive messages, as defined in Definition 2. + +Step 4. Computing Query Result:For the query node XQsubscript𝑋𝑄X_{Q} associated with CQsubscript𝐶𝑄C_{Q}, denote CQsubscript𝐶𝑄C_{Q}’s parent node as Cpsubscript𝐶𝑝C_{p} and the separator set between them as SQsubscript𝑆𝑄S_{Q}. First use the leaf tensor ΦSQsuperscriptΦsubscript𝑆𝑄\Phi^{S_{Q}} and its Moore-Penrose pseudoinverse ΦSQ†superscriptΦsuperscriptsubscript𝑆𝑄†\Phi^{S_{Q}^{\dagger}} to transform the downward incoming message mCp→CQsubscript𝑚→subscript𝐶𝑝subscript𝐶𝑄m_{C_{p}\rightarrow C_{Q}} and the upward outgoing message mCQ→Cpsubscript𝑚→subscript𝐶𝑄subscript𝐶𝑝m_{C_{Q}\rightarrow C_{p}}, respectively, and then compute the Hadamard product of these transformed versions of the two messages to obtain an estimate of the unnormalized conditional probability of δ​(CQ)𝛿subscript𝐶𝑄\delta(C_{Q}) given all the evidence {Xi=xi}i∈ℰsubscriptsubscript𝑋𝑖subscript𝑥𝑖𝑖ℰ\{X_{i}=x_{i}\}_{i\in\mathcal{E}}:ℙ^​[δ​(CQ)∣{Xi=xi}i∈ℰ]∝(mCp→CQ×SQΦSQ†)∘(ΦSQ×SQmCQ→Cp)proportional-to^ℙdelimited-[]conditional𝛿subscript𝐶𝑄subscriptsubscript𝑋𝑖subscript𝑥𝑖𝑖ℰsubscriptsubscript𝑆𝑄subscript𝑚→subscript𝐶𝑝subscript𝐶𝑄superscriptΦsuperscriptsubscript𝑆𝑄†subscriptsubscript𝑆𝑄superscriptΦsubscript𝑆𝑄subscript𝑚→subscript𝐶𝑄subscript𝐶𝑝\widehat{\mathbb{P}}[\delta(C_{Q})\mid\{X_{i}=x_{i}\}_{i\in\mathcal{E}}]\propto\big{(}m_{C_{p}\rightarrow C_{Q}}\times_{S_{Q}}\Phi^{S_{Q}^{\dagger}}\big{)}\circ\big{(}\Phi^{S_{Q}}\times_{S_{Q}}m_{C_{Q}\rightarrow C_{p}}\big{)} + +Now we marginalize out the variables in δ​(CQ)\XQ\𝛿subscript𝐶𝑄subscript𝑋𝑄\delta(C_{Q})\backslash X_{Q} and renormalize to obtain the final query result - the estimate of the conditional probability distribution of the query variable XQsubscript𝑋𝑄X_{Q} given all the evidence: ℙ^​[XQ∣{Xi=xi}i∈ℰ]^ℙdelimited-[]conditionalsubscript𝑋𝑄subscriptsubscript𝑋𝑖subscript𝑥𝑖𝑖ℰ\widehat{\mathbb{P}}[X_{Q}\mid\{X_{i}=x_{i}\}_{i\in\mathcal{E}}]. + +[Additional Note]: Another important type of query that we can also compute here is the joint probability of all the observed evidence: ℙ^​[{Xi=xi}i∈ℰ]^ℙdelimited-[]subscriptsubscript𝑋𝑖subscript𝑥𝑖𝑖ℰ\widehat{\mathbb{P}}[\{X_{i}=x_{i}\}_{i\in\mathcal{E}}]. In Step 4 above, before marginalization and renormalization, the Hadamard product is indeed equal to ℙ^​[δ​(CQ),{Xi=xi}i∈ℰ]^ℙ𝛿subscript𝐶𝑄subscriptsubscript𝑋𝑖subscript𝑥𝑖𝑖ℰ\widehat{\mathbb{P}}[\delta(C_{Q}),\{X_{i}=x_{i}\}_{i\in\mathcal{E}}] (see Appendix A.5 for the proof). We can marginalize out all the variables in δ​(CQ)𝛿subscript𝐶𝑄\delta(C_{Q}) from it to obtain ℙ^​[{Xi=xi}i∈ℰ]^ℙdelimited-[]subscriptsubscript𝑋𝑖subscript𝑥𝑖𝑖ℰ\widehat{\mathbb{P}}[\{X_{i}=x_{i}\}_{i\in\mathcal{E}}]. For example, this type of query is used for classification in the handwritten digit recognition task in the experiment in Section 6. + +One of the biggest advantages of our new algorithm compared to previous methods is that it can be seamlessly extended from discrete domain to continuous domain in a nonparametric fashion using the technique of kernel embeddings. When encountering continuous random variables in a latent graphical model, we use reproducing-kernel Hilbert space (RKHS) embeddings (?; ?; ?; ?) of distributions as sufficient statistic features and express all the learning and belief propagation operations as tensor algebra in the infinite-dimensional Hilbert space, and then employ the kernel trick to transform these operations back into tractable finite-dimensional linear algebra calculations over Gram matrices (?; ?). We present our full derivation of this extension in Appendix A.4. + +We design two sets of experiments to evaluate the performance of our proposed algorithm, one using synthetic data and the other one using real data. + +In this experiment, we test the performance of our algorithm on the task of learning and running inference on the discrete-valued latent-variable graphical model depicted in Figure 4 using artificially generated synthetic data and compare it with both the standard EM algorithm (?) and the stepwise online EM algorithm (?). + +We randomly initialize all the conditional probability tables in this model as the ground truth parameters, and then sample a dataset containing joint observations of the observable variables. Next we apply our proposed algorithm to learn this model, and evaluate its performance on the task of inferring the posterior distribution of variable D𝐷D given the observed values at variables G𝐺G, H𝐻H, and E𝐸E. In our experiment, we use ridge regression (?) for S1A and S1B. We compute the Kullback-Leibler divergence between our algorithm’s inferred posterior and the ground truth posterior calculated using the exact Shafer-Shenoy algorithm and average across all possible joint realizations of the variables (g,h,e)𝑔ℎ𝑒(g,h,e). We report the results in Figure 5, where we see that the average KL divergence between our algorithm’s results and the ground truth posterior quickly decreases and approaches 0 as the size of the training data increases. This result demonstrates that our algorithm learns quickly to perform accurate inference over latent graphical models. + +We also run the standard EM algorithm (?) and the stepwise online EM algorithm (?) to learn the same model with the same synthetic dataset, and compare their performance and training time with our algorithm (Figure 5).555In our experiment, we give both EM and online EM 10 random restarts and take the best ones as their performance evaluation. Our algorithm achieves equally good learning performance as EM and online EM do, but is much faster to train than both of them. The spectral algorithms can not perform such inference task on individual observable variables in a tractable manner, so we didn’t include them as our baselines here. + +In this experiment we consider the task of recognizing handwritten digits using the Pen-Based Recognition of Handwritten Digits dataset in the UCI machine learning repository (?). This dataset collected 10992 handwritten digit samples from 44 writers on a tablet with 500×500500500500\times 500 pixel resolution and then normalized all the coordinates into integer values between 0 and 100. It then used spatial resampling to obtain 8 regularly spaced points to represent each handwritten digit, and the feature vector for each digit is the 16-dimensional vector consisting of the (x,y)𝑥𝑦(x,y) coordinates of the 8 representative points. In order to learn to classify these handwritten digits, we design a latent variable graphical model structure (shown in Figure 6) to model the generative process of the 16-dimensional feature vectors of handwritten digits. The blue nodes indicate observable variables that corresponds to the coordinate values, and the orange nodes indicate latent variables. We apply our learning algorithm to learn a different generative model for each of the 10 digit categories, and then during test time, we use our inference algorithm to calculate the probability that a test instance is generated from each of the 10 different models, and choose the one with the highest probability as our predicted category. Here we use 7000 samples as our training set, 494 samples as our validation set, and the other 3498 samples as our testing set. In our experiment, we use Gaussian radial basis function kernel embeddings with bandwidth parameter σ=10𝜎10\sigma=10 as our feature vectors, and use ridge regression (?) with regularization parameter λ=0.1𝜆0.1\lambda=0.1 for S1A and S1B. + +We also run the standard EM algorithm (?), a stepwise online EM algorithm (?), and a spectral algorithm as the baselines to learn the same model, and compare their classification accuracy and training time with our algorithm (Figure 7). From the experimental results we can clearly see that our learning algorithm performs much better and is much faster to train than both the spectral algorithm and the two EM algorithms on this handwritten digit classification task. And moreover, we observe that our algorithm is also very robust and yields good performance even when the size of the training data is relatively small, while the other three algorithms all perform poorly in this scenario. + +In this paper, we have introduced predictive belief propagation as a new formulation of message-passing inference over latent junction trees and developed a new algorithm for learning general latent-variable graphical models based on it. Our new algorithm unifies the learning and inference of all different types of latent graphical models under a single flexible framework, and overcomes many severe limitations faced by previous methods like EM and spectral algorithms (see Appendix A.1 for a detailed comparison between our algorithm and previous algorithms). We also proved that our new algorithm gives a consistent estimator of inference queries over all latent graphical models. We evaluated its performance on both synthetic and real datasets, and showed that it learns different types of latent graphical models efficiently and achieves superior inference performance. Therefore, we believe that our algorithm provides a powerful and flexible new learning framework for general latent-variable graphical models. \ No newline at end of file diff --git a/1712.02099v2.txt b/1712.02099v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..9cc723003396294432202bf470aacb782f717974 --- /dev/null +++ b/1712.02099v2.txt @@ -0,0 +1,87 @@ +Computer vision algorithms generally rely on the assumption that the value of each pixel is a function of the radiance of a single area in the scene. Semi-reflectors, such as typical windows or glass doors, break this assumption by creating a superposition of the radiance of two different objects: the one behind the surface and the one that is reflected.It is virtually impossible to avoid semi-reflectors in man-made environments, as can be seen in Figure 1(a), which shows a typical downtown area.Any multi-view stereo or SLAM algorithm would be hard-pressed to produce accurate reconstructions on this type of images. + +Several methods exist that attempt to separate the reflection and transmission layers. + +At a semi-reflective surface, the observed image can be modeled as a linear combination of the reflection and the transmission images: Io=αr​Ir+αt​Itsubscript𝐼𝑜subscript𝛼𝑟subscript𝐼𝑟subscript𝛼𝑡subscript𝐼𝑡I_{o}=\alpha_{r}I_{r}+\alpha_{t}I_{t}.The inverse problem is ill-posed as it requires estimating multiple unknowns from a single observation.A solution, therefore, requires additional priors or data. Indeed, previous works rely on assumptions about the appearance of the reflection (e.g., it is blurry), about the shape and orientation of the surface (e.g., it is perfectly flat and exactly perpendicular to the principal axis of the camera), and others.Images taken in the wild, however, regularly break even the most basic of these assumptions, see Figure 1(b), causing the results of state-of-the-art methods [2, 3, 4] to deteriorate even on seemingly simple cases, as shown in Figure Separating Reflection and Transmission Images in the Wild, which depicts a fairly typical real-world scene. + +One particularly powerful tool is is polarization: images captured through a polarizer oriented at different angles offer additional observations.Perhaps surprisingly, however, our analysis of the state-of-the-art methods indicates that the quality of the results degrades significantly when moving from synthetic to real data, even when using polarization.This is due to the simplifying assumptions that are commonly made, but also to an inherent issue that is all too often neglected: a polarizer’s ability to attenuate reflections greatly depends on the viewing angle [5].The attenuation is maximal at an angle called the Brewster angle, θBsubscript𝜃𝐵\theta_{B}. However, even when part of a semi-reflector is imaged at θBsubscript𝜃𝐵\theta_{B}, the angle of incidence in other areas is sufficiently different from θBsubscript𝜃𝐵\theta_{B} to essentially void the effect of the polarizer, as clearly shown in Figure 2.Put differently, because of the limited signal-to-noise ratio, for certain regions in the scene, the additional observations may not be independent. + +We present a deep-learning method capable of separating the reflection and transmission components of images captured in the wild.The success of the method stems from our two main contributions. First, rather than requiring a network to learn the reflected and transmitted images directly from the observations, we leverage the properties of light polarization and use a residual representation, in which the input images are projected onto the canonical polarization angles (Section 3.1 and 3.2).Second, we design an image-based data generator that faithfully reproduces the image formation model (Section 3.3). + +We show that our method can successfully separate the reflection and transmission layers even in challenging cases, on which previous works fail. To further validate our findings, we capture the Urban Reflections Dataset, a polarization-based dataset of reflections in urban environments that can be used to test reflection removal algorithms on realistic images.Moreover, to perform a thorough evaluation against state-of-the-art methods whose implementation is not publicly available, we re-implemented several representative methods.As part of our contribution, we release those implementations for others to be able to compare against their own methods [1]. + +There is a rich literature of methods dealing with semi-reflective surfaces, which can be organized in three main categories based on the assumptions they make. + +Single-image methods can leverage gradient information to solve the problem. Levin and Weiss, for instance, require manual input to separate gradients of the reflection and the transmission [6].Methods that are fully automated can distinguish the gradients of the reflected and transmitted images by leveraging the defocus blur [7]: reflections can be blurry because the subject behind the semi-reflector is much closer than the reflected image [4], or because the camera is focused at infinity and the reflected objects are close to the surface [8].Moreover, for the case of double-pane or thick windows, the reflection can appear “doubled” [9], and this can be used to separate it from the transmitted image [10].While these methods show impressive results, their assumptions are stringent and do not generalize well to real-world cases, causing them to fail on common cases. + +Multiple images captured from different viewpoints can also be used to remove reflections.Several methods propose different ways to estimate the relative motion of the reflected and transmitted image, which can be used to separate them [11, 12, 13, 14, 15].It is important to note that these methods assume static scenes—the motion is the apparent motion of the reflected layer relative to the transmitted layer, not scene motion.Other than that, these methods make assumptions that are less stringent than those made by single-image methods.Nonetheless, these algorithms work well when reflected and transmitted scenes are shallow in terms of depth, so that their velocity can be assumed uniform.For the case of spatially and temporally varying mixes, Kaftory and Zeevi propose to use sparse component analysis instead [16]. + +Multiple images captured under different polarization angles offer a third venue to tackle this problem.Assuming that images taken at different polarization angles offer independent measurements of the same scene, reflection and transmission can be separated using independent component analysis [17, 18, 19].An additional prior that can be leveraged is given by double reflections, when the semi-reflective surface generates them [9].Under ideal conditions, and leveraging polarization information, a solution can also be found in closed form [2, 3].In our experiments, we found that most of the pictures captured in unconstrained settings break even the well-founded assumptions used by these papers, as shown in Figure 1. + +We address the problem of layer decomposition by leveraging the ability of a semi-reflector to polarize the reflected and transmitted layers differently.Capturing multiple polarization images of the same scene, then, offers partially independent observations of the two layers.To use this information, we take a deep learning approach.Since the ground truth for this problem is virtually impossible to capture, we synthesize it.As for any data-driven approach, the realism of the training data is paramount to the quality of the results.In this section, after reviewing the image formation model, we give an overview of our approach, we discuss the limitations of the assumptions that are commonly made, and how we address them in our data generation pipeline. Finally, we describe the details of our implementation. + +Consider two points, PRsubscript𝑃𝑅P_{R} and PTsubscript𝑃𝑇P_{T} such that PR′subscriptsuperscript𝑃′𝑅P^{{}^{\prime}}_{R}, the reflection of PRsubscript𝑃𝑅P_{R}, lies on the line of sight of PTsubscript𝑃𝑇P_{T}, and assume that both emit unpolarized light, see Figure 2.After being reflected or transmitted, unpolarized light becomes polarized by an amount that depends on θ𝜃\theta, the angle of incidence (AOI). + +At point PSsubscript𝑃𝑆P_{S}, the intersection of the line of sight and the surface, the total radiance L𝐿L is a combination of the reflected radiance LRsubscript𝐿𝑅L_{R}, and the transmitted radiance LTsubscript𝐿𝑇L_{T}. Assume we place a linear polarizer with polarization angle ϕitalic-ϕ\phi in front of the camera. If we integrate over the exposure time, the intensity at each pixel x𝑥x isIϕ​(x)=α​(θ,ϕ⟂,ϕ)⋅IR​(x)2+(1−α​(θ,ϕ⟂,ϕ))⋅IT​(x)2,subscript𝐼italic-ϕ𝑥⋅𝛼𝜃subscriptitalic-ϕperpendicular-toitalic-ϕsubscript𝐼𝑅𝑥2⋅1𝛼𝜃subscriptitalic-ϕperpendicular-toitalic-ϕsubscript𝐼𝑇𝑥2\displaystyle I_{\phi}(x)=\alpha(\theta,\phi_{\perp},\phi)\cdot\frac{I_{R}(x)}{2}+\left(1-\alpha(\theta,\phi_{\perp},\phi)\right)\cdot\frac{I_{T}(x)}{2},{}(1)where the mixing coefficient α​(⋅)∈[0,1]𝛼⋅01\alpha(\cdot)\in[0,1], the angle of incidence θ​(x)∈[0,π/2]𝜃𝑥0𝜋2\theta(x)\in[0,\nicefrac{{\pi}}{{2}}], the p−limit-from𝑝p-polarization direction [2] ϕ⟂​(x)∈[−π/4,π/4]subscriptitalic-ϕperpendicular-to𝑥𝜋4𝜋4\phi_{\perp}(x)\in[-\nicefrac{{\pi}}{{4}},\nicefrac{{\pi}}{{4}}], and the reflected and transmitted images at the semi-reflector, IR​(x)subscript𝐼𝑅𝑥I_{R}(x) and IT​(x)subscript𝐼𝑇𝑥I_{T}(x), are all unknown. + +At the Brewster angle, θBsubscript𝜃𝐵\theta_{B}, the reflected light is completely polarized along ϕ⟂subscriptitalic-ϕperpendicular-to\phi_{\perp}, i.e. in the direction perpendicular to the incidence plane111The incidence plane is defined by the direction in which the light is traveling and the semi-reflector’s normal., and the transmitted light along ϕ∥subscriptitalic-ϕparallel-to\phi_{\parallel}, the direction parallel to the plane of incidence. The angles ϕ⟂subscriptitalic-ϕperpendicular-to\phi_{\perp} and ϕ∥subscriptitalic-ϕparallel-to\phi_{\parallel} are called the canonical polarization angles.In the unique condition in which θ​(x)=θB𝜃𝑥subscript𝜃𝐵\theta(x)=\theta_{B}, two images captured with the polarizer at the canonical polarization angles offer independent observations that are sufficient to disambiguate between IRsubscript𝐼𝑅I_{R} and ITsubscript𝐼𝑇I_{T}. Unless the camera or the semi-reflector are at infinity, however, θ​(x)=θB𝜃𝑥subscript𝜃𝐵\theta(x)=\theta_{B} only holds for few points in the scene, if any, as shown in Figure 2.To complicate things, for curved surfaces, θ​(x)𝜃𝑥\theta(x) varies non-linearly with x𝑥x.Finally, even for arbitrarily many acquisitions at different polarization angles, ϕjsubscriptitalic-ϕ𝑗\phi_{j}, the problem remains ill-posed as each observation Iϕjsubscript𝐼subscriptitalic-ϕ𝑗I_{\phi_{j}} adds new pixel-wise unknowns α​(θ,ϕ⟂,ϕj)𝛼𝜃subscriptitalic-ϕperpendicular-tosubscriptitalic-ϕ𝑗\alpha(\theta,\phi_{\perp},\phi_{j}). + +When viewed through a polarizer oriented along direction ϕitalic-ϕ\phi, IRsubscript𝐼𝑅I_{R} and ITsubscript𝐼𝑇I_{T}, which are the reflected and transmitted images at the semi-reflector, produce image Iϕsubscript𝐼italic-ϕI_{\phi} at the sensor.Due to differences in dynamic range, as well as noise, in some regions the reflection may dominate Iϕsubscript𝐼italic-ϕI_{\phi}, or vice versa, see Section 3.3.1.Without hallucinating content, one can only aim at separating R𝑅R and T𝑇T, which we define to be the observable reflected and transmitted components.For instance, T𝑇T may be zero in regions where R𝑅R dominates, even though ITsubscript𝐼𝑇I_{T} may be greater than zero in those regions.To differentiate them from the ground truth, we refer to our estimates as R^^𝑅\widehat{R} and T^^𝑇\widehat{T}. + +To recover R^^𝑅\widehat{R} and T^^𝑇\widehat{T}, we use an encoder-decoder architecture, which has been shown to be particularly effective for a number of tasks, such as image-to-image translation [20], denoising [21], or deblurring [22].Learning to estimate R^^𝑅\widehat{R} and T^^𝑇\widehat{T} directly from images taken at arbitrary polarization angles does not produce satisfactory results.One main reason is that parts of the image may be pure reflections, thus yielding no information about the transmission, and vice versa. + +To address this issue, we turn to the polarization properties of reflected and transmitted images.Recall that R𝑅R and T𝑇T are maximally attenuated, though generally not completely removed, at ϕ∥subscriptitalic-ϕ∥\phi_{\|} and ϕ⟂subscriptitalic-ϕperpendicular-to\phi_{\perp} respectively.The canonical polarization angles depend on the geometry of the scene, and are thus hard to capture directly.However, we note that an image Iϕ​(x)subscript𝐼italic-ϕ𝑥I_{\phi}(x) can be expressed as [3]:Iϕ​(x)=I⟂​(x)​cos2⁡(ϕ−ϕ⟂​(x))+I∥​(x)​sin2⁡(ϕ−ϕ⟂​(x)).subscript𝐼italic-ϕ𝑥subscript𝐼perpendicular-to𝑥superscript2italic-ϕsubscriptitalic-ϕperpendicular-to𝑥subscript𝐼∥𝑥superscript2italic-ϕsubscriptitalic-ϕperpendicular-to𝑥I_{\phi}(x)=I_{\perp}(x)\cos^{2}(\phi-\phi_{\perp}(x))+I_{\|}(x)\sin^{2}(\phi-\phi_{\perp}(x)).(2)Since Equation 2 has three unknowns, I⟂subscript𝐼perpendicular-toI_{\perp}, ϕ⟂subscriptitalic-ϕperpendicular-to\phi_{\perp}, and I∥subscript𝐼∥I_{\|}, we can use three different observations of the same scene, {Iϕi​(x)}i={0,1,2}subscriptsubscript𝐼subscriptitalic-ϕ𝑖𝑥𝑖012\left\{I_{\phi_{i}}(x)\right\}_{i=\{0,1,2\}}, to obtain a linear system that allows to compute I⟂​(x)subscript𝐼perpendicular-to𝑥I_{\perp}(x) and I∥​(x)subscript𝐼∥𝑥I_{\|}(x). To further simplify the math we capture images such that ϕi=ϕ0+i⋅π/4subscriptitalic-ϕ𝑖subscriptitalic-ϕ0⋅𝑖𝜋4\phi_{i}=\phi_{0}+i\cdot\nicefrac{{\pi}}{{4}}. + +For efficiency, we implement the projection onto the canonical views as a network layer in TensorFlow. The canonical views and the actual observations are then stacked in a 15-channel tensor and used as input to our network.Then, instead of training the network to learn to predict R^^𝑅\widehat{R} and T^^𝑇\widehat{T}, we train it to learn the residual reflection and transmission layers.More specifically, we train the network to learn an 8-channel output, which comprises the residual images T~​(x)~𝑇𝑥\widetilde{T}(x), R~​(x)~𝑅𝑥\widetilde{R}(x), and the two single-channel weights ξ∥​(x)subscript𝜉∥𝑥\xi_{\|}(x) and ξ⟂​(x)subscript𝜉perpendicular-to𝑥\xi_{\perp}(x). Dropping the dependency on pixel x𝑥x for clarity, we can then compute:R^=ξ⟂​R~+(1−ξ⟂)​I⟂andT^=ξ∥​T~+(1−ξ∥)​I∥.formulae-sequence^𝑅subscript𝜉perpendicular-to~𝑅1subscript𝜉perpendicular-tosubscript𝐼perpendicular-toand^𝑇subscript𝜉∥~𝑇1subscript𝜉∥subscript𝐼∥\displaystyle\widehat{R}=\xi_{\perp}\widetilde{R}+(1-\xi_{\perp})I_{\perp}\qquad\text{and}\qquad\widehat{T}=\xi_{\|}\widetilde{T}+(1-\xi_{\|})I_{\|}.(3)While ξ⟂subscript𝜉perpendicular-to\xi_{\perp} and ξ∥subscript𝜉∥\xi_{\|} introduce two additional unknowns per pixel, they significantly simplify the prediction task in regions where the canonical projections are already good predictors of R^^𝑅\widehat{R} and T^^𝑇\widehat{T}.We use an encoder-decoder with skip connections [23] that consists of three down-sampling stages, each with two ResNet blocks [24]. The corresponding decoder mirrors the encoding layers using a transposed convolution with two ResNet blocks.We use an ℓ2subscriptℓ2\ell_{2} loss on R^^𝑅\widehat{R} and T^^𝑇\widehat{T}. We also tested ℓ1subscriptℓ1\ell_{1} and a combination of ℓ1subscriptℓ1\ell_{1} and ℓ2subscriptℓ2\ell_{2}, which did not yield significant improvements. + +The use of the canonical projection layer, as well as the parametrization of residual images is key for the success of our method. We show this in the Supplementary, where we compare the output of our network with the output of the exact same architecture trained to predict R^^𝑅\widehat{R} and T^^𝑇\widehat{T} directly from the three polarization images Iϕi​(x)subscript𝐼subscriptitalic-ϕ𝑖𝑥I_{\phi_{i}}(x). + +The ground truth data to estimate R^^𝑅\widehat{R} and T^^𝑇\widehat{T} is virtually impossible to capture in the wild.Recently, Wan et al. released a dataset for single-image reflection removal [25], but it does not offer polarization information.In principle, Equation 1 could be used directly to generate, from any two images, the data we need. The term α𝛼\alpha in the equation, however, hides several subtleties and nonidealities. For instance, previous polarization-based works use it to synthesize data by assuming uniform AOI, perfectly flat surfaces, comparable power for the reflected and transmitted irradiance, or others. This generally translates to poor results on images captured in the wild: Figures Separating Reflection and Transmission Images in the Wild and 1 show common scenes that violate all of these assumptions. + +We propose a more accurate synthetic data generation pipeline, see Figure 4. Our pipeline starts from two randomly picked images from the PLACE2 dataset [26], IRsubscript𝐼𝑅I_{R} and ITsubscript𝐼𝑇I_{T}, which we treat as the image of reflected and transmitted scene at the surface. From those, we model the behaviors observed in real-world data, which we describe as we “follow” the path of the photons from the scene to the camera. + +To simulate realistic reflections, the dynamic range (DR) of the transmitted and reflected images at the surface must be significantly different. This is because real-world scenes are generally high-dynamic-range (HDR). Additionally, the light intensity at the surface drops with the distance from the emitting object, further expanding the combined DR.However, our inputs are low-dynamic-range images because a large dataset of HDR images is not available.We propose to artificially manipulate the DR of the inputs so as to match the appearance of the reflections we observe in real-world scenes. + +Going back to Figure 2 (right), we note that for regions whereLT≈LRsubscript𝐿𝑇subscript𝐿𝑅L_{T}\approx L_{R}, a picture taken without a polarizer will capture a smoothly varying superposition of the images of PRsubscript𝑃𝑅P_{R} and PTsubscript𝑃𝑇P_{T} (Figure 1 3). For areas of the surface where LR≫LTmuch-greater-thansubscript𝐿𝑅subscript𝐿𝑇L_{R}\gg L_{T}, however, the total radiance is L≈LR𝐿subscript𝐿𝑅L\approx L_{R}, and the semi-reflector essentially acts as a mirror (Figure 1 2). The opposite situation is also common (Figure 1 1).To allow for these distinct behaviors, we manipulate the dynamic range of the input images with a random factor β∼𝒰​[1,K]similar-to𝛽𝒰1𝐾\beta\sim\mathcal{U}[1,K]:I~R=β​IR1/γandI~T=1β​IT1/γ,formulae-sequencesubscript~𝐼𝑅𝛽superscriptsubscript𝐼𝑅1𝛾andsubscript~𝐼𝑇1𝛽superscriptsubscript𝐼𝑇1𝛾\displaystyle\tilde{I}_{R}=\beta I_{R}^{1/\gamma}\qquad\text{and}\qquad\tilde{I}_{T}=\frac{1}{\beta}I_{T}^{1/\gamma},(4)where 1/γ1𝛾1/\gamma linearizes the gamma-compressed inputs222Approximating the camera response function with a gamma function does not affect the accuracy of our results, as we are not trying to produce data that is radiometrically accurate with respect to the original scenes.. We impose that K>1𝐾1K>1 to compensate for the fact that a typical glass surface transmits a much larger portion of the incident light than it reflects333At an angle of incidence of π/4𝜋4\nicefrac{{\pi}}{{4}}, for instance, a glass surface reflects less than 16%percent1616\% of the incident light.. + +Images I~Rsubscript~𝐼𝑅\tilde{I}_{R} and I~Tsubscript~𝐼𝑇\tilde{I}_{T} can reproduce the types of reflections described above, but are limited to those cases for which LR−LTsubscript𝐿𝑅subscript𝐿𝑇L_{R}-L_{T} changes smoothly with PSsubscript𝑃𝑆P_{S}.However, as shown inFigure 1 5,the reflection can drop abruptly following the boundaries of an object. This may happen when an object is much closer than the rest of the scene, or when its radiance is larger than the surrounding objects.To properly model this behavior, we treat it as a type of reflection on its own, which we apply to a random subset of the image whose range we have already expanded.Specifically, we set to zero the regions of the reflection or transmission layer, whose intensity is below T=mean​(I~R+I~T)𝑇meansubscript~𝐼𝑅subscript~𝐼𝑇T=\text{mean}(\tilde{I}_{R}+\tilde{I}_{T}), similarly to the method proposed by Fan et al. [4]. + +Our approach requires images captured under three different polarization angles. While cameras that can simultaneously capture multiple polarization images exist [27, 28, 29], they are not widespread. To date, the standard way to capture different polarization images is sequential; this causes complications for non-static scenes.As mentioned in Section 2, if multiple pictures are captured from different locations, the relative motion between the transmitted and reflected layers can help disambiguate them.Here, however, “non-static” refers to the scene itself, such as is the case when a tree branch moves between the shots.Several approaches were proposed that can deal with dynamic scenes in the context of stack-based photography [30].Rather than requiring some pre-processing to fix artifacts due to small scene changes at inference time, however, we propose to synthesize training data that simulates them, such as local, non-rigid deformations.We first define a regulargrid over a patch, and then we perturb each one of the grid’s anchors by (d​x,d​y)𝑑𝑥𝑑𝑦(dx,dy), both sampled from a Gaussian with variance σNR2superscriptsubscript𝜎NR2\sigma_{\text{NR}}^{2}, which is also drawn randomly for each patch.We then interpolate the position of the rest of the pixels in the patch.For each input patch, we generate three different images, one per polarization angle. We only apply this processing to a subset of the synthesized images—the scene is not always dynamic. Figure 5(a) and (b) show an example of original and distorted patch respectively. + +The images synthesized up to this point can be thought of as the irradiance of the unpolarized light at the semi-reflector. After bouncing off of, or going through, the surface, light becomes polarized as described in Section 3.1. The effect of a linear polarizer placed in front of the camera and oriented at a given polarization angle, depends on the angle of incidence (AOI) of the specific light ray. Some previous works assume this angle to be uniform over the image, which is only true if the camera is at infinity, or if the surface is flat. + +We observe that real-world surfaces are hardly ever perfectly flat. Many common glass surfaces are in fact designed to be curved, as is the case of car windows, see Figure Separating Reflection and Transmission Images in the Wild. Even when the surfaces are meant to be flat, the imperfections of the glass manufacturing process introduce local curvatures, seeFigure 1  4. + +At training time, we could generate unconstrained surface curvatures to account for this observation. However, it would be difficult to sample realistic surfaces. Moreover, the computation of the AOI from the surface curvature may be non-trivial.As a regularizer, we propose to use a parabola. When the patches are synthesized, we just sample four parameters: the camera position C𝐶C, a point on the surface PSsubscript𝑃𝑆P_{S}, a segment length, ℓℓ\ell, and the convexity as ±1plus-or-minus1\pm 1, Figure 5(c). Since the segment is always mapped to the same output size, this parametrization allows to generate a number of different, realistic curvatures.Additionally, because we use a parabola, we can quickly compute the AOI in closed form, from the sample parameters, see Supplementary. + +From the output of the pipeline described so far, the simulated AOI, and a random polarization angle ϕ0subscriptitalic-ϕ0\phi_{0}, the polarization engine generates three observations with polarization angles separated by π/4𝜋4\nicefrac{{\pi}}{{4}}, see Figure 4.In practice, the polarizer angles ϕisubscriptitalic-ϕ𝑖\phi_{i} will be inaccurate for real data due to the manual adjustments of the polarizer rotation. We account for this by adding noise within ±4∘plus-or-minussuperscript4\pm 4^{\circ} to each polarizer angle ϕisubscriptitalic-ϕ𝑖\phi_{i}.Additionally we set β∼𝒰​[1,2.8]similar-to𝛽𝒰12.8\beta\sim\mathcal{U}[1,2.8].The input for our neural network is ℝB×128×128×9superscriptℝ𝐵1281289\mathbb{R}^{B\times 128\times 128\times 9} when trained on 128×128128128128\times 128 patches, where B=32𝐵32B=32 is the batch size. We trained the model from scratch with a learning rate 5⋅10−3⋅5superscript1035\cdot 10^{-3} using ADAM. See the Supplementary for more details about the architecture.The colors of the network predictions might be slightly desaturated [31, 32, 4]. We use a parameter-free color-histogram matching against one of the observations to obtain the final results. + +In this section we evaluate our method and data modeling pipeline on both synthetic and real data.For the latter, we introduce the Urban Reflections Dataset (URD), a new dataset of images containing semi-reflectors captured with polarization information.A fair evaluation can only be done against other polarization-based methods, which use multiple images.However, we also compare against single-image methods for completeness. + +For practical relevance, we compile a dataset of 28 high-resolution RAW images (24MP) that are taken in urban environments using two different consumer cameras (Alpha 6000 and Canon EOS 7D, both ASP-C sensors), and which we make publicly available. The Supplementary shows all the pictures in the dataset.This dataset includes examples taken with a wide aperture, and while focusing on the plane of the semi-reflector, thus meeting the assumptions of Fan et al. [4]. + +Due to the need for ground-truth, a large-scale numerical evaluation can only be performed on synthetic data. For this task we take two datasets, the VOC2012 [33] and the PLACE2 [26] datasets. A comparison with state-of-the-art methods shows that our method outperforms the second best method by a significant margin in terms of PSNR: ∼2similar-toabsent2\sim 2 dB, see Table 1.For a numerical evaluation on real data, we set up a scene with a glass surface and objects causing reflections. After capturing polarization images of the scene, we removed the glass and captured the ground truth transmission, Tgtsubscript𝑇gtT_{\text{gt}}. Figure 6 shows the transmission images estimated by different methods. Our method achieves the highest PSRN, and the least amount of artifacts. + +We also thoroughly validate our data-generation pipeline. Using both synthetic and real data, we show that the proposed non-rigid deformation (NRD) procedure and the local curvature generation (LCG) are effective and necessary. To do this, we train our network until convergence on three types of data: data generated only with the proposed dynamic range manipulation, DR for short, data generated with DR++NRD, and data generated with DR++NRD++LCG. + +We evaluate these three models on a hold-out synthetic validation set that features all the transformations from Figure 4.The table in Figure 4.2 shows that the PSNR drops significantly when only part of our pipeline is used to train the network.Unfortunately, a numerical evaluation is only possible when the ground truth is available.However, Figure 4.2 shows the output of the three models on the real image from Figure Separating Reflection and Transmission Images in the Wild. The benefits of using the full pipeline are apparent. + +A visual inspection of Figure Separating Reflection and Transmission Images in the Wild allows to appreciate that, thanks to our ability to deal with curved surfaces and dynamic scenes, we achieve better performance than the state-of-the-art methods. + + + +ModelPSNRDR28.17 dBDR+NRD30.44 dBDR+NRD+LCG31.18 dB + +\captionoffigureOur reflection estimation (left) on a real-world curved surface and synthetic data (right Table) using the same network architecture trained on different components of our data pipeline. Only when using the full pipeline (DR+NRD+LCG) the reflection layer is estimated correctly. Note how faint the reflection is in the inputs (bottom row). + +We extensively evaluate our method against previous work on the proposed URD.For fairness towards competing methods, which make stronger assumptions or expect different input data, we slightly adapt them, or run them multiple times with different parameters retaining only the best result.Due to space constraints, Figure 8 only shows seven of the results.We refer the reader to the Supplementary for the rest of the results and for a detailed explanation about how we adapted previous methods.One important remark is in order. Although the images we use include opaque objects, i.e. the semi-reflector does not cover the whole picture, the methods against which we compare are local: applying the different algorithms to the whole image and cropping a region is equivalent to applying the same algorithms to the cropped region directly, Figure 7. + +Figure 8, Curved Window shows a challenging case in which the AOI is significantly different from θBsubscript𝜃𝐵\theta_{B} across the whole image, thus limiting the effect of the polarizer in all of the inputs.Moreover, the glass surface is slanted and locally curved, which breaks several of the assumptions of previous works. As a result, other methods completely fail at estimating the reflection layer, the transmission layer, or both.On the contrary, our method separates T^^𝑇\widehat{T} and R^^𝑅\widehat{R} correctly, with only a slight halo of the reflection in T^^𝑇\widehat{T}. In particular, notice the contrast of the white painting with the stars, as compared with other methods.While challenging, this scene is far from uncommon. + +Figure 8, Bar shows another result on which our method performs significantly better than most related works. On this example, the method by Schechner et al. [2] produces results comparable to ours. However, recall that, to be fair towards their method, we exhaustively search the parameter space and hand-pick the best result.Another thing to note is that our method may introduce artifacts in a region for which there is little or no information about the reflected or transmitted layer in any of the inputs, such as the case in the region marked with the red square on our T^^𝑇\widehat{T}. + +We also show an additional comparison showing the superiority of our method (Figure 8, Paintings) and a few more challenging cases.We note that in a few examples, our method may fail at removing part of the “transmitted” objects from R^^𝑅\widehat{R}, as is the case in Figure 8, Chairs. + +Since we do not have the ground truth for real data, we evaluate our method against previous results by means of a thorough user study. We asked 434343 individuals not involved with the project, to rank our results against the state-of-the-art [17, 4, 7, 2, 3].In our study, we evaluate R^^𝑅\widehat{R} and T^^𝑇\widehat{T} as two separate tasks, because different methods may perform better on one or the other.For each task, the subjects were shown the three input polarization images, and the results of each method on the same screen, in randomized order. They were given the task to rank the results 111–666, which took, on average, 35 minutes per subject.We measure the recall rate in ranking, R​@​k𝑅@𝑘R@k, i.e. the fraction of times a method ranks among the top-k𝑘k results. Table 2 reports the recall-rates.Two conclusions emerge from analyzing the table. First, and perhaps expected, polarization-based methods outperform the other methods.Second, our method ranks higher than related works by a significant margin. + +Separating the reflection and transmission layers from images captured in the wild is still an open problem, as state-of-the-art methods fail on many real-world images.Rather than learning to estimate the reflection and the transmission directly from the observations, we propose a deep learning solution that leverages the properties of polarized light: it uses a Canonical Projection Layer, and it learns the residuals of the reflection and transmission relative to the canonical images.Another key ingredient to the success of our method is the definition of an image-synthesis pipeline that can accurately reproduce typical nonidealities observed in everyday pictures.We also note that the non-rigid deformation procedure that we propose can be used for other stack-based methods where non-static scenes may be an issue.To evaluate our method, we also propose the Urban Reflection Dataset, which we will make available upon publication.Using this dataset, we extensively compare our method against a number of related works, both visually and by means of a user study, which confirms that our approach is superior to the state-of-the-art methods.Finally, the code for most of the existing methods that separate reflection and transmission is not available: to perform an accurate comparison, we re-implemented representative, state-of-the-art works, and make our implementation of those algorithms available to the community, to enable more comparisons. \ No newline at end of file diff --git a/1712.02109v1.txt b/1712.02109v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..2d61bd41daf2d1a6fed4e133f5fd5eca6ec2d1f9 --- /dev/null +++ b/1712.02109v1.txt @@ -0,0 +1,389 @@ +\section{Introduction} +Attention-based neural machine translation has arguably the most effective architecture for neural machine translation (NMT), outperforming conventional statistical machine translation (SMT) systems on many language pairs \cite{uedin-nmt:2017}. The superiority of attention-based model over canonical encoder-decoder model~\cite{sutskever2014sequence} lies in the fact that it can dynamically retrieve relevant pieces of the source (much isomorphic to alignment in SMT) through a relatively simple matching function. In other words, attention-based model benefits from a richer representation of source sentence with its flexibility representing local structure. + + +In a typical attention-based NMT system, a bidirectional recurrent neural networks (biRNN) \cite{schuster1997bidirectional} is used to encode the source, yielding a sequence of vectors from the RNN, which can be roughly interpreted as context-aware embedding of the words in the source sentence. With this design, the encoder learns relatively uniform composition of the sentence, despite the RNN in the encoder are already equipped with some advanced gating mechanism, such as long short term memory (LSTM) \cite{hochreiter1997long} network and gated recurrent unit (GRU) \cite{cho2014learning}. For translation, it is common that we hope the decoder to take pieces of source sentence at varying composition levels suiting its own linguistic structure. This need can be illustrated through the following two examples +\begin{itemize} +\item we may want to take the entity name in the source in its raw form while taking an idiom as a densely composed unit; +\item when we translating the substantive, we may again want to know the surrounding words of the noun and then determine its singular or plural forms. +\end{itemize} + +Motivated by this demand, we propose Multi-channel Encoder (MCE), which takes encoding components with different levels of composition. More specifically, in addition to the hidden state of encoding RNN, MCE takes the original word embedding for raw encoding with no composition, and a particular design of external memory in NTM \cite{graves2014neural} for more complex composition, in a way analogous to visual channels with different frequency. All three encoding strategies are properly blended during decoding controlled by parameters can be learned in an end-to-end fashion. More specifically, we design a gate that can automatically tunes the weights of different encoding channels. +\begin{figure*}[t] +\centering +\includegraphics[width=7in]{main1.png} + +\caption{Left is the conventional attention-based NMT which consists of encoder, decoder and an attention mechanism. Right is our novel NMT model with multiple channel encoder, which consists of hidden state from biRNN, external memory in the NTM and embeddings directly from the input sequence. A gated annotation is designed to automatically learn the weights for different encoding components.} +\label{fig:main} +\end{figure*} + +In this paper, we also empirically investigate MCE on different translation tasks. We first test our models on the NIST Chinese-English machine translation tasks, achieving an average improvement by 6.52 BLEU over the strong DL4MT system. Furthermore, experiments on the WMT2014 English-French machine translation task show that our single shallow model obtains a BLEU score of 38.8, which is comparable to the state-of-the-art models. + +The reminder of this paper is organized as follows: in the next section, we will briefly introduce the basics of conventional attention-based NMT. After that, we will present MCE in more details. After that, we will report extensive experimental results and conclude the paper in the last section. +\section{Attention-based Neural Machine Translation} +\label{section2} +In recent years, researchers have proposed excellent works to improve the performance of NMT. Most state-of-the-art NMT systems are based on the attention-based encoder-decoder architecture. +Figure {\ref{fig:main}} (a) illustrates the attention-based encoder-decoder architecture, which consists of three parts: an encoder, a decoder and an attention mechanism that building relationships between encoder and decoder. + +In more details, the first step of NMT systems is to convert each atomic symbol into a corresponding continuous vector, named word embedding. This step is done for each source word independently of the other words and results in a source sequence of word embeddings. +Above the embedding layer, a biRNN is designed to learn the representation of the whole sequence after running on some time steps. Between the encoder and decoder, an attention mechanism is employed to fuse all time steps of the input sequence and draw the attention for current time step in the decoder. During the generation of the target word, the controller will consider the suggestion from last generated word, current hidden state, and the context computed by the attention mechanism to decide the next word. + +Formally, given a source sequence $x=(x_1, ..., x_t)$ and previous translated words $({y_1}, ..., {y_{j-1}})$, the probability of next word $y_j$ is calculated as: +\begin{equation} +p(y_{j}|s_j,y_{j-1},c_j) = \mathrm{softmax}(t_jW_o) +\label{eq:py_j} +\end{equation} +and +\begin{equation} +t_j = \mathrm{tanh}(s_jW_{t1}+e_{y_{j-1}}W_{t2}+c_jW_{t3}) +\label{eq:t_j} +\end{equation} +where $W_{t1}$, $W_{t2}$, $W_{t3}$, $W_o$ are the trained model parameters. +$e_{x_t}$, $e_{y_{j-1}}$ are the embedding representation of $x_t$ and $y_{j-1}$ respectively, which is usually initialized with a one-hot embedding vector. $s_j$ is the hidden state in the decoder at time step $j$, which is computed as: +\begin{equation} +s_j = g(s_{j-1}, e_{y_{j-1}}, c_j) +\label{eq:s_j} +\end{equation} + +Here $g$ is a nonlinear transform function, which can be implemented as LSTM or GRU, and $c_j$ is a distinct context vector at time +step $j$, which can be obtained by an attention mechanism. Normally, $c_j$ is calculated as a weighted sum of the input annotations $\mathrm{h}_i$: +\begin{equation} +c_i = \sum_{i}^{Tx} \alpha_{ij}\mathrm{h}_i +\label{eq:c_i} +\end{equation} + +where $\mathrm{h}_i = [\overrightarrow{\mathrm{h}_{i}^T}, \overleftarrow{\mathrm{h}_{i}^T}]^T$ is the annotation of $x_i$ from a biRNN and $Tx$ is the length of the source sequence. +The normalized weight $\alpha_{ij}$ for $\mathrm{h}_i$ is calculated as: +\begin{eqnarray} +\label{eq:alpha_ij} +\alpha_{ij} &=& \frac{\mathrm{exp}(e_{ij})}{\sum_{k=1}^{Tx}\mathrm{exp}(e_{kj})} \\ +\label{eq:e_ij} +e_{ij} &=& V^{T}_{a}\mathrm{tanh}(U_{a}s^{'}_{j}+W_{a}h_{i}) +\end{eqnarray} +where $V_a$, $U_a$ and $W_a$ are the trainable parameters. All of the parameters in the +NMT model are optimized to maximize the following +conditional log-likelihood of the M sentence +aligned bilingual samples: +\begin{equation} +\ell(\theta) = \frac{1}{M}\sum^M_{m=1}{\sum^{Ty}_{j=1}{\mathrm{log}p(y_{j}|s_j,y_{j-1},c_j)}} +\label{eq:loss} +\end{equation} + +Here, all the biases are omitted for simplify. +\section{Multi-channel Encoder} +\label{sec:3} +As an important part of the attention-based NMT models, the RNN encodes the representation of the source sequence which is lately used by the attention mechanism. +Nevertheless, as we have mentioned in the first section, it is difficult for the conventional RNN to encode sequence with different levels of composition which is necessary during the translation. Thus, we propose to use multiple-channel to enhance the encoder and the attention mechanism. Figure \ref{fig:main} (b) illustrates the overall architecture of our model, where an external memory is designed to co-operate with the RNN on leaning complex compositions. Additionally, the hidden state of RNN together with external memory in NTM and sequence of embedding vectors are gathered to generate the gated annotation used by the attention mechanism. + +On the other hand, incorporating the embeddings into the attention mechanism can also be viewed as building a shortcut connections that has been proved to alleviate the underlying degradation problem \cite{he2016deep}. Moreover, shortcut connections have an added benefit of not adding any extra parameters or computational complexity. +\subsection{External Memory in NTM} +\label{sec:3_1} +In the conventional RNN based NTM systems, a RNN is used to learn the representation of the sequence. +Concretely, in the RNN, at each time step $t_i$, the current state $s_i$ is depending on the input $e_i$ from the embedding layer, and the last state $s_{i-1}$. To measure the importance of the input and the historical states, a non-linear function is used to learn the weights of the two parts. In NMT task, most researchers prior to use the GRU benefiting from its simple form. Following the original definition of the GRU, the value of $s_i$ could be calculated as: + \begin{eqnarray} +s_i &=& \mathrm{GRU}(e_i, s_{i-1}) \\ + &=&(1-z_i) \odot s^{'}_{i} + z_{i} \odot s_{i-1} +\label{eqn:gru} +\end{eqnarray} + + and + + \begin{eqnarray} +s^{'}_{i} &=& \mathrm{tanh}(We_{i} + r_{i} \odot (Us_{i-1})) \\ +r_{i} & =& \sigma(W_{r}e_{i}+U_{r}s_{i-1}) \\ +z_{i} &=& \sigma(W_{z}e_{i}+U_{z}s_{i-1}) +\label{eqn:gru_detail} +\end{eqnarray} + +where $W$, $U$, $W_{r}$, $U_{r}$, $W_z$, $U_z$ are trainable parameters. + +However, as equation (\ref{eqn:gru}) and (\ref{eqn:gru_detail}) indicates, the current state is depending on the current input embeddings and historical state. In this situation, the RNN has difficulty in well learning both the current lexical semantics and historical dependent relationships. Another drawback is that the RNN knowing nothing about the future information when generating the current state that potentially affects the capturing of long distance dependent relationships. + +\begin{figure}[tp] +\centering +\includegraphics[width=3.2in]{ntm.png} + +\caption{Illustration of NTM in the encoder. The RNN reads and writes from the NTM at each time step. } +\label{fig:encoder} +\end{figure} + +To enable the encoder to represent the lexical semantics as well as complex composition, our solution is to develop multi-channel encoder that consists of embeddings from original sentence and an external memory in NTM as well as hidden state from the RNN. Most inspired by the design of neural turing machine \cite{graves2014neural} and recent excellent works on external memories for NMT \cite{meng2015deep,wang2016memory,feng2017memory}, we present a \textbf{Read-Write} memory to enhance the GRU in the RNN and intend to capture more complex compositional relationships. + +In order to better understand the whole process, Figure \ref{fig:encoder} illustrates the detailed structure of the encoder. At each time step, the state in RNN queries the external memory using an attention-based addressing mechanism and reads the context of the memory. Instead of directly using the last state to feed the GRU, we use the last state to query the external memory and fetch the contextual memory as the state input of the GRU. This operation guarantees that the controller knowing more contextual information before generating the current state which may potentially assist the decision of GRU. + +Besides the \textbf{Read} operation, we also design a \textbf{Write} operation. The motivation of adding a \textbf{Write} operation is that we expect the RNN and NTM to learn different types of relationships respectively via different updating strategies. + +Formally, let $\mathrm{M}_t \in \mathbb{R}^{n \times m}$ representing the memory in time $t$ after the update of encoding state, where $n$ is the number of memory cells and $m$ is the dimension of vector in each cell. +We initialize the $\mathrm{M}^0$ by the sequence of embedding vector $\mathrm{E}=[e_1, e_2, ..., e_t]$. + +Inspired by the work of interactive attention \cite{meng2016interactive}, at each time step $t$, we first generate the \textbf{Read} memory $\tilde{\mathrm{M}}_t$ as follows, +\begin{equation} +\tilde{\mathrm{M}}_t = \mathrm{M}_{t-1}(w^{R}_{t} \odot \mathrm{R}_t) +\label{eq:read_memory} +\end{equation} + +where $\mathrm{M}_{t-1}$ is the content of the memory in the last time step, and $w^{\mathrm{R}}_{t} \in \mathbb{R}^n$ specifies the normalized weights assigned to the cells in $\mathrm{M}_{t-1}$. As described in \citeauthor{graves2014neural}, we can use context-based or address-based addressing mechanism to determine $w^{\mathrm{R}}_{t}$. In practice, we found that a conventional attention model work well in our model, thus we compute the $w^{\mathrm{R}}_{t}$ as described in equation (\ref{eq:alpha_ij}) and (\ref{eq:e_ij}). In addition, $\mathrm{R}_t$ is similar to the read gate in the GRU, which determines the content to be read from memory cells. More specifically, it can be defined as, + +\begin{equation} +\mathrm{R}_t = \sigma (W_rs_{t-1}) +\label{eq:read_gate} +\end{equation} + + where $s_{t-1}$ is the state of the last time step in the encoder, and $W_r \in \mathbb{R}^{m \times m}$ is trainable parameter. + +Once we have obtained the \textbf{Read} memory $\tilde{\mathrm{M}}_t$, we use it to fetch the context $c_t$, similar to the computation specified in equation (\ref{eq:c_i}). +\begin{equation} +c_t = \sum^{T_x}_iw^{R}_{t}\tilde{\mathrm{M}}_t +\label{eq:ntm_c_t} +\end{equation} + +After that, $c_t$ is combined with embedding vector $e_t$ and used to update the new state +\begin{equation} +s_t = \mathrm{GRU}(c_t, e_t) +\label{eq:ntm_state} +\end{equation} + +Finally, the new state $s_t$ is used to update the external memory by writing to it to finish the round of state-update. + \begin{equation} +\mathrm{M}^t = \tilde{\mathrm{M}}_t + w^{W}_{t} \odot \mathrm{U}_t +\label{eq:ntm_write} +\end{equation} + +where $U_t = \sigma(W_us_t)$ is the update gate, and is parameterized with $W_u \in \mathbb{R}^{m \times m}$. +Meanwhile, in our experiments, the weights for reading $w^R_t$ and writing $w^W_t$ at time $t$ are shared, that means we compute it using the formulas in equation (\ref{eq:alpha_ij}) and (\ref{eq:e_ij}) with the same state $s_{t-1}$ and the memory $\mathrm{M}_{t-1}$. + +It is worth noting, since we use biRNN to represent the source sequence, we will obtain two external memories: $\overrightarrow{\mathrm{M}}$ and $\overleftarrow{\mathrm{M}}$, which is originated from the forward RNN and the backward RNN, respectively. Similar to the method presented in the traditional NMT, we concatenate the two types of hidden states. We equally concatenate two external memories and use it as one annotation for the attention mechanism. +\subsection{Gated Annotation} +\label{sec:3_2} +As described in the beginning of the section, we design multiple encoding components in our encoder. Consequently, we will obtain multiple annotations from the encoder, including $\mathrm{M}_t$ from external memory in NTM, $\mathrm{h}_t$ from the hidden state of the RNN and the sequence of embedding vectors $\mathrm{E}=[e_{x_1}, ..., e_{x_t}]$ from the original source input respectively. + +To utilize multiple annotations, one feasible solution is summing or concatenating of them. In this paper, motivated by the design of GRU, we propose an alternative reasonable solution. Since in prior, we can not determine which encoding component is better for the translation, the best decision is to let the model learning the weight between two annotations automatically. + +Formally, given the external memory $\mathrm{M} \in \mathbb{R}^{n \times 2 \times m}$ in NTM, and the hidden state $\mathrm{h} \in \mathbb{R}^{n \times 2 \times d}$ in RNN, in which $d$ indicates the hidden size. \footnote{Since we have concatenated the memories and the annotations of the forward and the backward RNN, thus the dimension of two units should be multiplied by two.} +The computation of annotation which will be further utilized by the attention mechanism can be specified as, +\begin{equation} +\mathrm{h}_{rnn\_ntm} = g_0 \odot \mathrm{M} + (1-g_0) \odot \mathrm{h} +\label{eq:rnn_ntm} +\end{equation} + +where $g_0$ is the gated unit, calculated as, +\begin{equation} +g_0 = \sigma(W_{g_0}\mathrm{M}+U_{g_0}\mathrm{h}) +\label{eq:gate_g} +\end{equation} +where $W_{g_0}$ and $U_{g_0}$ are trainable parameters. + +In the experimental section, we will investigate which type of encoding component plays an important role in improving the translation, thus we will validate various of combination of annotations. + +Besides the combination of external memory in NTM and hidden state in RNN, we also generate the following combinations: + \begin{eqnarray} + \label{eq:rnn_emb} +\mathrm{h}_{rnn\_emb} &=& g_1 \odot \mathrm{E} + (1-g_1) \odot \mathrm{h} \\ +\label{eq:ntm_emb} +\mathrm{h}_{ntm\_emb} &=& g_2 \odot \mathrm{E} + (1- g_2) \odot \mathrm{M} \\ +\label{eq:ntm_rnn_emb} +\mathrm{h}_{ntm\_rnn\_emb} &=& g_3 \odot \mathrm{E} + (1-g_3) \odot \mathrm{h}_{rnn\_ntm} +\end{eqnarray} + +and + \begin{eqnarray} + \label{eq:rnn_emb_gate1} +g_1 &=& \sigma(W_{g_1}\mathrm{E}+U_{g_1}\mathrm{h}) \\ +\label{eq:rnn_emb_gate2} +g_2 &=& \sigma(W_{g_2}\mathrm{E}+U_{g_2}\mathrm{M}) \\ +\label{eq:rnn_emb_gate3} +g_3 &=& \sigma(W_{g_3}\mathrm{E}+U_{g_3}\mathrm{h}_{rnn\_ntm}) +\end{eqnarray} + +where $W_{g_1}$, $U_{g_1}$,$W_{g_2}$, $U_{g_2}$, $W_{g_3}$ and $U_{g_3}$ are trainable parameters. +\section{Experiments} +We mainly evaluate our approaches on the widely used NIST Chinese-English translation task. In order to compare our model to the previous works, we also provide results on the WMT English-French translation task. +For Chinese-English task, we apply case-insensitive NIST BLEU. For English-French, we tokenize the reference and evaluate the performance with multi-bleu.pl\footnote{\url{https://github.com/moses-smt/\\mosesdecoder/blob/master/scripts/generic/multi-bleu.perl}}. The metrics are exactly the same as in the previous literatures. +\subsection{Data sets} +\noindent +\textbf{NIST Chinese-English.} +We use a subset of the data available for NIST OpenMT08 task \footnote{1LDC2002E18, LDC2002L27, LDC2002T01, +LDC2003E07, LDC2003E14, LDC2004T07, LDC2005E83, +LDC2005T06, LDC2005T10, LDC2005T34, LDC2006E24, +LDC2006E26, LDC2006E34, LDC2006E86, LDC2006E92, +LDC2006E93, LDC2004T08(HK News, HK Hansards )}. The parallel training corpus contains 1.5 million sentence pairs after we filter with +some simple heuristic rules, such as sentence being too long or containing messy codes. We choose NIST 2006 (NIST06) dataset as our development +set, and the NIST 2003 (NIST03), 2004 (NIST04) +2005 (NIST05), 2008 (NIST08) and 2012 (NIST12) datasets as our +test sets. We use a source and target vocabulary with 30K most frequent words and filter the sentences longer than 50. + +\noindent +\textbf{WMT'14 English-French.} +We use the full WMT' 14 parallel corpus as our training data. The detailed data sets are Europarl v7, Common Crawl, UN, News Commentary, Gigaword. In total, it includes 36 million sentence pairs. The news-test-2012 and news-test-2013 are concatenated as our development set, and the news-test-2014 is the test set. Our data partition and data preprocess is consistent with previous works on NMT \cite{luong2015effective,jean2014using} to ensure fair comparison. As vocabulary we use 40K sub-word tokens \cite{DBLP:journals/corr/SennrichHB15} based on byte-pair encoding and filter the sentences longer than 120. +\subsection{Model Settings} +For the Chinese-English task, we run widely used open source toolkit DL4MT together with two recently published strong open source toolkits T2T \footnote{\url{https://github.com/tensorflow/tensor2tensor}} and ConvS2S \footnote{\url{https://github.com/facebookresearch/fairseq}} on the same experimental settings to validate the performance of our models\footnote{Parameters for DL4MT: `dim': 1000, `optimizer': `adadelta', `dim\_word': 620, `clip-c': 1.0, `n-words': 30000, `learning-rate': 0.0001, `decay-c': 0.0 \\Parameters for T2T: `model': `transformer', `hparams\_set': `transformer\_base\_single\_gpu' \\Parameters for ConvS2S: `model': `fconv', `nenclayer': 12, `nlayer': 12, `dropout': 0.2, `optim': `nag', `lr': 0.25, `clip': 0.1, `momentum': 0.99, `bptt': 0, `nembed': 512, `noutembed': 512, `nhid': 512}. Beyond that, we also reimplement an attention-based NMT written in tensorflow \footnote{\url{https://www.tensorflow.org/} }as our baseline system. + +To measure the importance of different encoding component on the quality of translation, we validate our approach with different model implements, which includes: +\begin{itemize} +\item DL4MT: an open source toolkit. + +\item RNN: an in house implemented attention-based RNN written in tensorflow, and the annotation for attention mechanism consists of only the hidden state of RNN. +\item NTM: using the external memory in NTM directly as the annotation. +\item EMB: using the sequence of embedding vectors as the annotation. +\item NTM-EMB: using the combination of external memory in NTM and embeddings described in the equation (\ref{eq:ntm_emb}). +\item NTM-RNN: using the combination of external memory in NTM and hidden states of RNN described in the equation (\ref{eq:rnn_ntm}). +\item RNN-EMB: using the combination of annotation from hidden state of RNN and embeddings described in the equation (\ref{eq:rnn_emb}). +\item NTM-RNN-EMB: using the combination of overall three encoding components described in the equation (\ref{eq:ntm_rnn_emb}). +\item T2T: an open source toolkit\cite{DBLP:journals/corr/VaswaniSPUJGKP17} . +\item ConvS2S: an open source toolkit\cite{gehring2017convolutional} . +\end{itemize} + +In that the main intent of our work is to confirm that using multiple-channel encoder do help on the quality of translation, thus we utilize the empirical hyper parameters according to our previous research. +In more details, we use 512 dimensional word embeddings for both the source and target languages. All hidden layers both in the encoder and the decoder, have 512 memory cells. The output layer size is the same as the hidden size. The dimension of $c_j$ is 1024. + +\begin{table*}[htb] + +\begin{center} +\begin{tabular}{c|r|c|c|c|c|c|c} +SYSTEMS &PARAMETERS& NIST03 & NIST04 & NIST05 & NIST08 & NIST12 & AVG \\ +\hline +DL4MT &- &31.82 &34.86 &31.81 &24.71 &20.47 &28.73 \\ + + \hline +RNN&56,314,881 &36.65 &39.86 &36.75 & 29.76& 25.34&33.67(+4.94) \\ +NTM&59,988,995 &37.73 &40.03 &36.06 &29.19 &25.12 &33.63(+4.90) \\ +EMB&58,416,131 &21.43 &24.38 &20.58 &16.71 &14.48 &19.52 \\ +\hline +NTM-EMB&63,135,747 &36.97 &40.05 & 36.35&29.87 &25.51 &33.75(+5.02) \\ +NTM-RNN &64,184,323 &37.63 & 40.44&37.77 &30.44 &25.38 &34.33(+5.60) \\ +RNN-EMB&59,461,633 &37.98 &40.90 &37.59 &30.58 &25.99 &34.61(+5.88) \\ +\hline +NTM-RNN-EMB&67,331,075 &38.56 &40.79 &38.49 &31.51 &26.90 &\textbf{35.25(+6.52)}\\ +\hline +T2T &-&38.11&41.41 &38.12 &31.53 &25.55 &34.94 \\ +ConvS2S &-&38.85&40.79 &37.44 &30.60 &26.08 &34.75 \\ + +\end{tabular} +\end{center} + +\caption{Performance of different systems on the NIST Chinese-to-English translation tasks. Compared to the strong open source system DL4MT, our models achieve significant improvements. We also list results from another two recently published open source toolkits T2T and ConvS2S for comparison. Remember that both T2T and ConvS2S are deep models with multiple layers.} +\label{tbl:zh-en} +\end{table*} +\subsection{Training Details} +Inspired by the work of GNMT \cite{DBLP:journals/corr/WuSCLNMKCGMKSJL16}, +we initialize all trainable parameters uniformly between [-0.04, 0.04]. As is common wisdom in training +RNN models, we apply gradient clipping: all gradients are uniformly scaled down such that +the norm of the modified gradients is no larger than a fixed constant, which is 1.0 in our case. + +Following the work of \cite{DBLP:journals/corr/VaswaniSPUJGKP17}, we use the Adam optimizer with $\beta_1=0.9$, $\beta_2=0.98$ and $\epsilon=10^{-9}$. We use the similar learning rate setting with minor modification to adapt our parallel training equipment. +Over the course of training, the learning rate is calculated according to the formula: +\begin{eqnarray} +lrate &=& d^{-0.5} \cdot \mathrm{min}(\alpha^{-0.5}, \alpha \cdot \beta^{-1.5}) \\ +\alpha &=& \mathrm{step\_num} / \mathrm{num\_gpus} +\label{eq:lrate} +\end{eqnarray} +\begin{table*}[htp] + +\begin{center} +\begin{tabular}{l|l|c} +SYSTEMS & Voc. & En-Fr \\ +\hline + + \multicolumn{3}{c}{Existing RNN systems} \\ + \hline +LSTM (6 layers)\cite{luong2015effective} & 80K & 31.50 \\ +LSTM (6 layers + PosUNK)\cite{luong2015effective} & 80K & 33.10 \\ +Deep-Att\cite{zhou2016deep} & 80K & 37.70 \\ +Deep-Att + PosUnk\cite{zhou2016deep} & 80K& \textbf{39.20} \\ +GNMT WPM-32K\cite{DBLP:journals/corr/WuSCLNMKCGMKSJL16} & 80K & 38.95 \\ +DeepLAU + PosUNK trained on 12M data\cite{wang2017deep} & 80K &35.10 \\ +GNMT WPM-32K, HyperLSTM \cite{DBLP:journals/corr/HaDL16} & 80K & \textbf{40.03} \\ +\hline + \multicolumn{3}{c}{Existing Other systems} \\ + \hline + ConvS2S (15 layers) + BPE-40K\cite{gehring2017convolutional} & 40K & 40.46 \\ + Transformer(base)\cite{DBLP:journals/corr/VaswaniSPUJGKP17} & - & 38.10\\ + Transformer(big)\cite{DBLP:journals/corr/VaswaniSPUJGKP17} & - & \textbf{41.00}\\ +\hline + \multicolumn{3}{c}{Our system} \\ + \hline + RNN + BPE-40K & 40K & 38.19 \\ + MCE + BPE-40K & 40K & 38.80 \\ +\end{tabular} +\end{center} + +\caption{English-to-French task: BLEU scores. The \textit{RNN} is our basic RNN model, and the \textit{MCE} model combines three encoding components from embeddings, hidden state from RNN, external memory in NTM. Noting that our model does not perform PosUNK and use small size of vocabulary.} +\label{tbl:ef-eg} +\end{table*} + +where we set the $\beta=6000$ represents the warm steps with the same meaning in the original work. +Since we train our model with parallelization at the data batch level, we penalize the number of steps by the division of the number of GPUs used in our model. +As we set the batch size to 128, on Chinese-English task it takes around 1 day to train the basic model on 8 NIVDIA P40 GPUs and on English-French task it takes around 7 days. + +Additionally, translations are generated by a beam search and log-likelihood scores are normalized by sentence length. And we use a beam width of 10 in all the experiments. Moreover, dropout is also applied on the output layer to avoid over-fitting and we set the dropout rate to 0.5. +\subsection{Results on Chinese-to-English} +Table \ref{tbl:zh-en} lists the overall results on each Chinese-English evaluation tasks. To confirm that our system is strong enough, we also report performance of an open source system: DL4MT. +At first, we find that there is a significant improvements of our systems over the DL4MT. +Compared to the DL4MT, our basic \textit{RNN} system achieves an improvement by 4.94 BLEU points. +Although our \textit{RNN} is a basic attention-based NMT, we assemble it with some advanced techniques, such as initialization all parameters uniformly, adding biases for the embedding vectors, using the output of forward RNN as the input of the backward RNN and training with dynamic learning rate. +Whatever, we give the comparison between our basic \textit{RNN} system and open source toolkits is to prove that our baseline is strong enough, and all improvements over baseline system are reliable. + +Unsurprisingly, the \textit{EMB} model which only using embeddings as the annotation obtains a very low performance due to the encoding of no composition of the sentence. More interesting, any complex encoding component combined with embeddings, such as \textit{NTM-EMB} and \textit{RNN-EMB} receives better performance against the individual one. The reason is although both the external memory in NTM and the RNN encode lexical semantics and complex compositions, however at each time step, the lexical semantics will be blended by the history state, thus it is difficult for them to encode the sequence at varying levels. +While under the architecture of our MCE, it is possible for the decoder to take the source word directly from the embedding component. + +We also notice that the performance of \textit{NTM} is almost equal to the \textit{RNN} while the performance of \textit{RNN-EMB} is relatively much better than the \textit{NTM-EMB}. One explanation is that the external memory in NTM is initialized with the embeddings, and at each time step an attention-based content addressing mechanism is employed to update the contents of the memory. That means, compared to the RNN, the external memory records more lexical semantics with no composition. Thus when combined with the embeddings encoding component, the RNN can focus on learning compositional relationships and yielding more improvements. + +Lastly, when using three encoding components, our best model achieves 1.58 improvements over the strong baseline system and 6.52 BLEU points over the DL4MT, which proves that our model is effective in practice. Noting that, the performance of our best system is also slightly better than the T2T. +\subsection{Results on English-French} +The results on English-French translation are presented in table \ref{tbl:ef-eg}. We compare our NMT systems with various other systems including Deep RNN model, Deep CNN model and Deep Attention model. For fair comparison, here we just list the single system results reported in their papers. On the English-French translation task, a promising founding is that our system achieves comparable performance over the state-of-the-art systems, even compared with the deep models. Besides, compared to other RNN models, our system is very competitive, although our system is a shallow model. + +Noting that, the best reported result of single system on this dataset is from the work of \cite{DBLP:journals/corr/VaswaniSPUJGKP17}, where they build a big attention neural networks with the depth of 6 layers and 16 heads. Compared to the basic version of them: \textit{Transformer(base)}, the performance of our system is even better despite our model is a shallow networks and their system is more deeper. + +Clearly, compared to the previous reported works, our model seems being competitive both on the small and large training data. More important, our model is easy to implement. One thing we could conclude is that when installed with advanced training techniques and innovative model designs, RNN based model is still competitive to other models especially on the large scale training corpus. + +\begin{figure}[tbp] +\centering +\includegraphics[width=3.2in]{length.png} + +\caption{Performance on different sentence length.} +\label{fig:length} +\end{figure} +\subsection{Analysis} +On the Chinese-English translation task, we randomly select 1000 sentences from the different testing sets and split the testing set into the different parts according to the length of the sentences. +In particular, we test the BLEU scores on sentences longer than {10; 20; 30; 40; 50; 60} on the test set shown in figure \ref{fig:length}. Clearly, in all curves, +performance degrades with increased sentence length. However, our best model assembled with multiple encoding components yield +consistently higher BLEU scores than the baseline model on longer sentences. These observations are consistent with our intuition +that the MCE can encodes sentence at varying levels which is useful during the translation of long sentence. +\subsection{Translation Sample} +Table \ref{tbl:sample} shows a particular translation case in which indicates that our model could take pieces of source sentence at varying composition levels. In this translation case, the model should learn the translation of two named entities `\textbf{Hua Ren Zhi Ye}' and `\textbf{Gao Sheng Ou Zhou Zong Bu}'. Moreover, there is one long distance reordering relationship between `\textbf{Gao Jia}' and `{\textbf{Mai Xia}'. Thus it is challenging for models to translate this sentence correctly. + +From the table \ref{tbl:sample} we find that one-channel models \textit{RNN} and \textit{NTM} failed to translate the `\textbf{Gao Jia}', while the multi-channel models excepts \textit{NTM-RNN} successfully capture the reordering relationship and translate the `\textbf{Gao Jia}' in correct form. One reason for the poor performance of \textit{NTM-RNN} is that it lacks one component to take the original word embedding for raw encoding with no composition, thus affects the NTM and RNN components to learn the long distance compositional relationship. +\begin{table*}[htp] + +\begin{center} +\begin{tabular}{r|l} +Source: & {\color{blue} Hua Ren Zhi Ye} {\color{green} Gao Jia} {\color{red}Mai Xia} Gao Sheng Ou Zhou Zong Bu . \\ +Reference: & {\color{blue} Chinese Estates} {\color{red} buys} Goldman’ European Headquarters {\color{green}at high price} . \\ +\hline +RNN: & {\color{blue}Chinese Home Buyers} {\color{red}purchase} {\color{green}high prices of} OOV european headquarters . \\ +NTM: & {\color{blue}Chinese Home Buyers} {\color{red}buy} OOV european headquarters . \\ +NTM-RNN: & {\color{blue}Chinese} {\color{red}purchase} {\color{green}prices at high price} {\color{red}to buy} OOV headquarters in europe .\\ +\hline +RNN-EMB: & {\color{blue}China’s Home Buyers} {\color{red}purchased} OOV european headquarters {\color{green}at high price} .\\ +NTM-EMB: & {\color{blue}Chinese} {\color{red}bought} OOV european headquarters {\color{green}at high price} .\\ +\hline +NTM-RNN-EMB: & {\color{blue}Chinese Home Buyers} {\color{red}purchase} OOV european headquarters {\color{green}at high price} .\\ +\end{tabular} +\end{center} +\caption{Translation results for each models. OOV represents the word which is out of vocabulary.} +\label{tbl:sample} +\end{table*} + +\section{Conclusion and Future Work} +In this paper, we have proposed multiple-channel encoder to enhance the encoder and the attention mechanism of attention-based neural machine translation. +To enable the encoder to represent the sentence at varying levels, beside the hidden state of the RNN, we employ the original word embedding for raw encoding with no composition, and design a particular external memory in Neural Turing Machine for more complex composition. A gated annotation mechanism is developed to learn the weights of different encoding components automatically. +Experiments on extensive Chinese-English translation tasks show that MCE improve the quality of translation and our best model beat the DL4MT by 6.52 BLEU points. And fair comparison on English-French translation indicates that our shallow RNN based model obtain the comparable performance against the previous reported literatures. + +In the future, we will attempt to develop more encoding components, such as CNN \cite{lecun1995convolutional} and self-attentive structure\cite{DBLP:journals/corr/LinFSYXZB17} . +\section{Acknowledgements} +This research is supported by the National Basic Research +Program of China (973 program No. 2014CB340505). We +would like to thank Zhengdong Lu, Daqi Zheng and the anonymous reviewers +for their insightful comments. +\bibliographystyle{aaai} +\bibliography{aaai} diff --git a/1712.02121v2.txt b/1712.02121v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..29df409e6b9309a48eb5cdd9dcfe77e210b75539 --- /dev/null +++ b/1712.02121v2.txt @@ -0,0 +1,43 @@ +Large-scale knowledge bases (KBs), such as YAGO (Suchanek et al., 2007), Freebase (Bollacker et al., 2008) and DBpedia (Lehmann et al., 2015), are usually databases of triples representing the relationships between entities in the form of fact (head entity, relation, tail entity) denoted as (h, r, t), e.g., (Melbourne, cityOf, Australia).These KBs are useful resources in many applications such as semantic searching and ranking (Kasneci et al., 2008; Schuhmacher and Ponzetto, 2014; Xiong et al., 2017), question answering (Zhang et al., 2016; Hao et al., 2017) and machine reading (Yang and Mitchell, 2017).However, the KBs are still incomplete, i.e., missing a lot of valid triples (Socher et al., 2013; West et al., 2014).Therefore, much research work has been devoted towards knowledge base completion or link prediction to predict whether a triple (h, r, t) is valid or not (Bordes et al., 2011). + +Many embedding models have proposed to learn vector or matrix representations for entities and relations, obtaining state-of-the-art (SOTA) link prediction results Nickel et al. (2016a). In these embedding models, valid triples obtain lower implausibility scores than invalid triples.Let us take the well-known embedding model TransE (Bordes et al., 2013) as an example. In TransE, entities and relations are represented by k𝑘k-dimensional vector embeddings.TransE employs a transitional characteristic to model relationships between entities, in which it assumes that if (h, r, t) is a valid fact, the embedding of head entity hℎh plus the embedding of relation r𝑟r should be close to the embedding of tail entity t𝑡t, i.e. 𝒗hsubscript𝒗ℎ\boldsymbol{v}_{h} + 𝒗rsubscript𝒗𝑟\boldsymbol{v}_{r} ≈\approx 𝒗tsubscript𝒗𝑡\boldsymbol{v}_{t}(here, 𝒗hsubscript𝒗ℎ\boldsymbol{v}_{h}, 𝒗rsubscript𝒗𝑟\boldsymbol{v}_{r} and 𝒗tsubscript𝒗𝑡\boldsymbol{v}_{t} are embeddings of hℎh, r𝑟r and t𝑡t respectively). That is, a TransE score ‖𝒗h+𝒗r−𝒗t‖ppsuperscriptsubscriptnormsubscript𝒗ℎsubscript𝒗𝑟subscript𝒗𝑡𝑝𝑝\|\boldsymbol{v}_{h}+\boldsymbol{v}_{r}-\boldsymbol{v}_{t}\|_{p}^{p} of the valid triple (h, r, t) should be close to 00 and smaller than a score ‖𝒗h′+𝒗r′−𝒗t′‖ppsuperscriptsubscriptnormsubscript𝒗superscriptℎ′subscript𝒗superscript𝑟′subscript𝒗superscript𝑡′𝑝𝑝\|\boldsymbol{v}_{h^{\prime}}+\boldsymbol{v}_{r^{\prime}}-\boldsymbol{v}_{t^{\prime}}\|_{p}^{p} of an invalid triple (h’, r’, t’).The transitional characteristic in TransE also implies the global relationships among same dimensional entries of 𝒗hsubscript𝒗ℎ\boldsymbol{v}_{h}, 𝒗rsubscript𝒗𝑟\boldsymbol{v}_{r} and 𝒗tsubscript𝒗𝑡\boldsymbol{v}_{t}. + +Other transition-based models extend TransEto additionally use projection vectors or matrices to translate head and tail embeddings into the relation vector space, such as: TransH (Wang et al., 2014), TransR (Lin et al., 2015b), TransD (Ji et al., 2015), STransE (Nguyen et al., 2016b) and TranSparse (Ji et al., 2016).Furthermore, DISTMULT (Yang et al., 2015) and ComplEx (Trouillon et al., 2016) use a tri-linear dot product to compute the score for each triple.Recent research has shown that using relation paths between entities in the KBs could help to get contextual information for improving KB completion performance (Lin et al., 2015a; Luo et al., 2015; Guu et al., 2015; Toutanova et al., 2016; Nguyen et al., 2016a). See other embedding models for KB completion in Nguyen (2017). + +Recently, convolutional neural networks (CNNs), originally designed for computer vision (LeCun et al., 1998), have significantly received research attention in natural language processing (Collobert et al., 2011; Kim, 2014).CNN learns non-linear features to capture complex relationships with a remarkably less number of parameters compared to fully connected neural networks.Inspired from the success in computer vision, Dettmers et al. (2018) proposed ConvE—the first model applying CNN for the KB completion task.In ConvE, only 𝒗hsubscript𝒗ℎ\boldsymbol{v}_{h} and 𝒗rsubscript𝒗𝑟\boldsymbol{v}_{r} are reshaped and then concatenated into an input matrix which is fed to the convolution layer.Different filters of the same 3×3333\times 3 shape are operated over the input matrix to output feature map tensors. These feature map tensors are then vectorized and mapped into a vector via a linear transformation.Then this vector is computed with 𝒗tsubscript𝒗𝑡\boldsymbol{v}_{t} via a dot product to return a score for (h, r, t). See a formal definition of the ConvE score function in Table 1.It is worth noting that ConvE focuses on the local relationships among different dimensional entries in each of 𝒗hsubscript𝒗ℎ\boldsymbol{v}_{h} or 𝒗rsubscript𝒗𝑟\boldsymbol{v}_{r}, i.e., ConvE does not observe the global relationships among same dimensional entries of an embedding triple (𝐯hsubscript𝐯ℎ\boldsymbol{v}_{h}, 𝐯rsubscript𝐯𝑟\boldsymbol{v}_{r}, 𝐯tsubscript𝐯𝑡\boldsymbol{v}_{t}), so that ConvE ignores the transitional characteristic in transition-based models, which is one of the most useful intuitions for the task. + +In this paper, we present ConvKB—an embedding model which proposes a novel use of CNN for the KB completion task. In ConvKB, each entity or relation is associated with an unique k𝑘k-dimensional embedding. Let 𝒗hsubscript𝒗ℎ\boldsymbol{v}_{h}, 𝒗rsubscript𝒗𝑟\boldsymbol{v}_{r} and 𝒗tsubscript𝒗𝑡\boldsymbol{v}_{t} denote k𝑘k-dimensional embeddings of hℎh, r𝑟r and t𝑡t, respectively.For each triple (h, r, t), the corresponding triple of k𝑘k-dimensional embeddings (𝒗hsubscript𝒗ℎ\boldsymbol{v}_{h}, 𝒗rsubscript𝒗𝑟\boldsymbol{v}_{r}, 𝒗tsubscript𝒗𝑡\boldsymbol{v}_{t}) is represented as a k×3𝑘3k\times 3 input matrix.This input matrix is fed to the convolution layer where different filters of the same 1×3131\times 3 shape are used to extract the global relationships among same dimensional entries of the embedding triple.That is, these filters are repeatedly operated over every row of the input matrix to produce different feature maps. The feature maps are concatenated into a single feature vector which is then computed with a weight vector via a dot product to produce a score for the triple (h, r, t).This score is used to infer whether the triple (h, r, t) is valid or not. + +Our contributions in this paper are as follows:•We introduce ConvKB—a novel embedding model of entities and relationships for knowledge base completion.ConvKB models the relationships among same dimensional entries of the embeddings. This implies that ConvKB generalizes transitional characteristics in transition-based embedding models.•We evaluate ConvKB on two benchmark datasets: WN18RR (Dettmers et al., 2018) and FB15k-237 (Toutanova and Chen, 2015). Experimental results show that ConvKB obtains better link prediction performance than previous SOTA embedding models. In particular, ConvKB obtains the best mean rank and the highest Hits@10 on WN18RR, and produces the highest mean reciprocal rank and highest Hits@10 on FB15k-237. + +A knowledge base 𝒢𝒢\mathcal{G} is a collection of valid factual triples in the form of (head entity, relation, tail entity) denoted as (h,r,t)ℎ𝑟𝑡(h,r,t) such that h,t∈ℰℎ𝑡ℰh,t\in\mathcal{E} and r∈ℛ𝑟ℛr\in\mathcal{R} where ℰℰ\mathcal{E} is a set of entities and ℛℛ\mathcal{R} is a set of relations.Embedding models aim to define a score function f𝑓f giving an implausibility score for each triple (h,r,t)ℎ𝑟𝑡(h,r,t) such that valid triples receive lower scores than invalid triples.Table 1 presents score functions in previous SOTA models. + +We denote the dimensionality of embeddings by k𝑘k such that each embedding triple (𝒗hsubscript𝒗ℎ\boldsymbol{v}_{h}, 𝒗rsubscript𝒗𝑟\boldsymbol{v}_{r}, 𝒗tsubscript𝒗𝑡\boldsymbol{v}_{t}) are viewed as a matrix 𝑨=[𝒗h,𝒗r,𝒗t]∈ℝk×3𝑨subscript𝒗ℎsubscript𝒗𝑟subscript𝒗𝑡superscriptℝ𝑘3\boldsymbol{A}=[\boldsymbol{v}_{h},\boldsymbol{v}_{r},\boldsymbol{v}_{t}]\in\mathbb{R}^{k\times 3}.And 𝑨i,:∈ℝ1×3subscript𝑨𝑖:superscriptℝ13\boldsymbol{A}_{i,:}\in\mathbb{R}^{1\times 3} denotes the i𝑖i-th row of 𝑨𝑨\boldsymbol{A}.Suppose that we use a filter 𝝎∈ℝ1×3𝝎superscriptℝ13\boldsymbol{\omega}\in\mathbb{R}^{1\times 3} operated on the convolution layer.𝝎𝝎\boldsymbol{\omega} is not only aimed to examine the global relationships between same dimensional entries of the embedding triple (𝒗hsubscript𝒗ℎ\boldsymbol{v}_{h}, 𝒗rsubscript𝒗𝑟\boldsymbol{v}_{r}, 𝒗tsubscript𝒗𝑡\boldsymbol{v}_{t}), but also to generalize the transitional characteristics in the transition-based models.𝝎𝝎\boldsymbol{\omega} is repeatedly operated over every row of 𝑨𝑨\boldsymbol{A} to finally generate a feature map 𝒗=[v1,v2,…,vk]∈ℝk𝒗subscript𝑣1subscript𝑣2…subscript𝑣𝑘superscriptℝ𝑘\boldsymbol{v}=[v_{1},v_{2},...,v_{k}]\in\mathbb{R}^{k} as:vi=g​(𝝎⋅𝑨i,:+b)subscript𝑣𝑖𝑔⋅𝝎subscript𝑨𝑖:𝑏v_{i}=g\left(\boldsymbol{\omega}\cdot{\boldsymbol{A}_{i,:}}+b\right)where b∈ℝ𝑏ℝb\in\mathbb{R} is a bias term and g𝑔g is some activation function such as ReLU. + +Our ConvKB uses different filters ∈ℝ1×3absentsuperscriptℝ13\in\mathbb{R}^{1\times 3} to generate different feature maps.Let Ωdouble-struck-Ω\mathbb{\Omega} and τ𝜏\tau denote the set of filters and the number of filters, respectively, i.e. τ=|Ω|𝜏double-struck-Ω\tau=|\mathbb{\Omega}|, resulting in τ𝜏\tau feature maps.These τ𝜏\tau feature maps are concatenated into a single vector ∈ℝτ​k×1absentsuperscriptℝ𝜏𝑘1\in\mathbb{R}^{\tau k\times 1} which is then computed with a weight vector 𝕨∈ℝτ​k×1𝕨superscriptℝ𝜏𝑘1\mathbb{w}\in\mathbb{R}^{\tau k\times 1} via a dot product to give a score for the triple (h,r,t)ℎ𝑟𝑡(h,r,t). Figure 1 illustrates the computation process in ConvKB. + +Formally, we define the ConvKB score function f𝑓f as follows:f​(h,r,t)=𝖼𝗈𝗇𝖼𝖺𝗍​(g​([𝒗h,𝒗r,𝒗t]∗Ω))⋅𝕨𝑓ℎ𝑟𝑡⋅𝖼𝗈𝗇𝖼𝖺𝗍𝑔∗subscript𝒗ℎsubscript𝒗𝑟subscript𝒗𝑡double-struck-Ω𝕨f(h,r,t)=\mathsf{concat}\left(g\left([\boldsymbol{v}_{h},\boldsymbol{v}_{r},\boldsymbol{v}_{t}]\ast\mathbb{\Omega}\right)\right)\cdot\mathbb{w}where Ωdouble-struck-Ω\mathbb{\Omega} and 𝕨𝕨\mathbb{w} are shared parameters, independent of hℎh, r𝑟r and t𝑡t; ∗∗\ast denotes a convolution operator; and 𝖼𝗈𝗇𝖼𝖺𝗍𝖼𝗈𝗇𝖼𝖺𝗍\mathsf{concat} denotes a concatenation operator. + +If we only use one filter 𝝎𝝎\boldsymbol{\omega} (i.e. using τ=1𝜏1\tau=1) with a fixed bias term b=0𝑏0b=0 and the activation function g​(x)=|x|𝑔𝑥𝑥g(x)=|x| or g​(x)=x2𝑔𝑥superscript𝑥2g(x)=x^{2}, and fix 𝝎=[1,1,−1]𝝎111\boldsymbol{\omega}=[1,1,-1] and 𝕨=1𝕨1\mathbb{w}=\textbf{1} during training, ConvKB reduces to the plain TransE model (Bordes et al., 2013). So our ConvKB model can be viewed as an extension of TransE to further model global relationships. + +We use the Adam optimizer (Kingma and Ba, 2014) to train ConvKB by minimizing the loss function ℒℒ\mathcal{L} (Trouillon et al., 2016) with L2subscript𝐿2L_{2} regularization on the weight vector 𝕨𝕨\mathbb{w} of the model:ℒℒ\displaystyle\mathcal{L}=∑(h,r,t)∈{𝒢∪𝒢′}log⁡(1+exp⁡(l(h,r,t)⋅f​(h,r,t)))absentsubscriptℎ𝑟𝑡𝒢superscript𝒢′1⋅subscript𝑙ℎ𝑟𝑡𝑓ℎ𝑟𝑡\displaystyle=\sum_{\begin{subarray}{c}(h,r,t)\in\{\mathcal{G}\cup\mathcal{G}^{\prime}\}\end{subarray}}\log\left(1+\exp\left(l_{(h,r,t)}\cdot f\left(h,r,t\right)\right)\right)+λ2​‖𝕨‖22𝜆2subscriptsuperscriptnorm𝕨22\displaystyle\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ +\frac{\lambda}{2}\|\mathbb{w}\|^{2}_{2}in which, ​l(h,r,t)={1​for ​(h,r,t)∈𝒢−1​for ​(h,r,t)∈𝒢′in which, subscript𝑙ℎ𝑟𝑡cases1for ℎ𝑟𝑡𝒢1for ℎ𝑟𝑡superscript𝒢′\text{in which, }l_{(h,r,t)}=\left\{\begin{array}[]{l}1\;\text{for }(h,r,t)\in\mathcal{G}\\-1\;\text{for }(h,r,t)\in\mathcal{G}^{\prime}\end{array}\right.here 𝒢′superscript𝒢′\mathcal{G}^{\prime} is a collection of invalid triples generated by corrupting valid triples in 𝒢𝒢\mathcal{G}. + +We evaluate ConvKB on two benchmark datasets: WN18RR (Dettmers et al., 2018) and FB15k-237 (Toutanova and Chen, 2015).WN18RR and FB15k-237 are correspondingly subsets of two common datasets WN18 and FB15k (Bordes et al., 2013).As noted by Toutanova and Chen (2015), WN18 and FB15k are easy because they contain many reversible relations. So knowing relations are reversible allows us to easily predict the majority of test triples, e.g. state-of-the-art results on both WN18 and FB15k are obtained by using a simple reversal rule as shown in Dettmers et al. (2018).Therefore, WN18RR and FB15k-237 are created to not suffer from this reversible relation problem in WN18 and FB15k, for which the knowledge base completion task is more realistic.Table 2 presents the statistics of WN18RR and FB15k-237. + +In the KB completion or link prediction task (Bordes et al., 2013), the purpose is to predict a missing entity given a relation and another entity, i.e, inferring hℎh given (r,t)𝑟𝑡(r,t) or inferring t𝑡t given (h,r)ℎ𝑟(h,r).The results are calculated based on ranking the scores produced by the score function f𝑓f on test triples. + +Following Bordes et al. (2013), for each valid test triple (h,r,t)ℎ𝑟𝑡(h,r,t), we replace either hℎh or t𝑡t by each of other entities in ℰℰ\mathcal{E} to create a set of corrupted triples.We use the “Filtered” setting protocol (Bordes et al., 2013), i.e., not taking any corrupted triples that appear in the KB into accounts.We rank the valid test triple and corrupted triples in ascending order of their scores.We employ three common evaluation metrics: mean rank (MR), mean reciprocal rank (MRR), and Hits@10 (i.e., the proportion of the valid test triples ranking in top 10 predictions).Lower MR, higher MRR or higher Hits@10 indicate better performance. + +We use the common Bernoulli trick (Wang et al., 2014; Lin et al., 2015b) to generate the head or tail entities when sampling invalid triples. We also use entity and relation embeddings produced by TransE to initialize entity and relation embeddings in ConvKB. We employ a TransE implementation available at: https://github.com/datquocnguyen/STransE.We train TransE for 3,000 epochs,using a grid search of hyper-parameters: the dimensionality of embeddings k∈{50,100}𝑘50100k\in\{50,100\}, SGD learning rate ∈{1​e−4,5​e−4,1​e−3,5​e−3}absent1superscript𝑒45superscript𝑒41superscript𝑒35superscript𝑒3\in\{1e^{-4},5e^{-4},1e^{-3},5e^{-3}\}, l1subscript𝑙1\mathit{l}_{1}-norm or l2subscript𝑙2\mathit{l}_{2}-norm, and margin γ∈{1,3,5,7}𝛾1357\gamma\in\{1,3,5,7\}.The highest Hits@10 scores on the validation set are when using l1subscript𝑙1\mathit{l}_{1}-norm, learning rate at 5​e−45superscript𝑒45e^{-4}, γ𝛾\gamma = 5 and k𝑘k = 50 for WN18RR, and using l1subscript𝑙1\mathit{l}_{1}-norm, learning rate at 5​e−45superscript𝑒45e^{-4}, γ𝛾\gamma = 1 and k = 100 for FB15k-237. + +To learn our model parameters including entity and relation embeddings, filters 𝝎𝝎\boldsymbol{\omega} and the weight vector 𝕨𝕨\mathbb{w}, we use Adam (Kingma and Ba, 2014) and select its initial learning rate ∈{5​e−6,1​e−5,5​e−5,1​e−4,5​e−4}absent5superscript𝑒61superscript𝑒55superscript𝑒51superscript𝑒45superscript𝑒4\in\{5e^{-6},1e^{-5},5e^{-5},1e^{-4},5e^{-4}\}. We use ReLU as the activation function g𝑔g.We fix the batch size at 256 and set the L2subscript𝐿2L_{2}-regularizer λ𝜆\lambda at 0.001 in our objective function.The filters 𝝎𝝎\boldsymbol{\omega} are initialized by a truncated normal distribution or by [0.1,0.1,−0.1]0.10.10.1[0.1,0.1,-0.1].We select the number of filters τ∈{50,100,200,400,500}𝜏50100200400500\tau\in\{50,100,200,400,500\}.We run ConvKB up to 200 epochs and use outputs from the last epoch for evaluation.The highest Hits@10 scores on the validation set are obtained when using k𝑘k = 50, τ=500𝜏500\tau=500, the truncated normal distribution for filter initialization,and the initial learning rate at 1​e−41superscript𝑒41e^{-4} on WN18RR; and k = 100, τ=50𝜏50\tau=50, [0.1,0.1,−0.1]0.10.10.1[0.1,0.1,-0.1] for filter initialization, and the initial learning rate at 5​e−65superscript𝑒65e^{-6} on FB15k-237. + +Table 3 compares the experimental results of our ConvKB model with previous published results, using the same experimental setup. Table 3 shows that ConvKB obtains the best MR and highest Hits@10 scores on WN18RR and also the highest MRR and Hits@10 scores on FB15k-237. + +ConvKB does better than the closely related model TransE on both experimental datasets, especially on FB15k-237 where ConvKB gains significant improvements of 347−257=9034725790347-257=90 in MR (which is about 26% relative improvement) and 0.396−0.294=0.1020.3960.2940.1020.396-0.294=0.102 in MRR (which is 34+% relative improvement), and also obtains 51.7−46.5=5.251.746.55.251.7-46.5=5.2% absolute improvement in Hits@10.Previous work shows that TransE obtains very competitive results Lin et al. (2015a); Nickel et al. (2016b); Trouillon et al. (2016); Nguyen et al. (2016a).However, when comparing the CNN-based embedding model ConvE with other models,Dettmers et al. (2018) did not experiment with TransE.We reconfirm previous findings that TransE in fact is a strong baseline model, e.g., TransE obtains better MR and Hits@10 than ConvE on WN18RR. + +ConvKB obtains better scores than ConvE on both datasets (except MRR on WN18RR and MR on FB15k-237), thus showing the usefulness of taking transitional characteristics into accounts. In particular, on FB15k-237, ConvKB achieves improvements of 0.394−0.316=0.0780.3940.3160.0780.394-0.316=0.078 in MRR (which is about 25% relative improvement) and 51.7−49.1=2.651.749.12.651.7-49.1=2.6% in Hits@10, while both ConvKB and ConvE produce similar MR scores. ConvKB also obtains 25% relatively higher MRR score than the relation path-based model KBLRN on FB15k-237. In addition, ConvKB gives better Hits@10 than KBLRN, however, KBLRN gives better MR than ConvKB. We plan to extend ConvKB with relation path information to obtain better link prediction performance in future work. + +In this paper, we propose a novel embedding model ConvKB for the knowledge base completion task.ConvKB applies the convolutional neural network to explore the global relationships among same dimensional entries of the entity and relation embeddings, so that ConvKB generalizes the transitional characteristics in the transition-based embedding models.Experimental results show that our model ConvKB outperforms other state-of-the-art models on two benchmark datasets WN18RR and FB15k-237. Our code is available at: https://github.com/daiquocnguyen/ConvKB. + +We also plan to extend ConvKB for a new application where we could formulate data in the form of triples. For example, inspired from the work by Vu et al. (2017) for search personalization, we can also apply ConvKB to model user-oriented relationships between submittedqueries and documents returned by search engines, i.e. modeling triple representations (query, user, document). \ No newline at end of file diff --git a/1712.02679v1.txt b/1712.02679v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..a479189e58d2d8ae2b38c758057b65b605cbfa78 --- /dev/null +++ b/1712.02679v1.txt @@ -0,0 +1,240 @@ +\section{Introduction} +Over the past decade, Deep Learning (DL) has emerged as the dominant Machine Learning algorithm showing remarkable success in a wide spectrum of application domains ranging from image processing \cite{he2016deep}, machine translation \cite{wu2016google}, speech recognition \cite{xiong2017microsoft} and many others. In each of these domains, DNN’s achieve superior accuracy through the use of very large and deep models - necessitating up to 100’s of ExaOps of computation during training (on GPUs) and GB’s of model and data storage. + +In order to improve the training time over single-node systems, distributed algorithms \cite{chilimbi2014project}, \cite{ho2013more}, \cite{lian2015asynchronous} are frequently employed to distribute the training data over multiple CPUs or GPUs - using data parallelism \cite{gupta2016model}, model parallelism \cite{dean2012large} and pipeline parallelism \cite{wu2016google} techniques. Data parallelism techniques are widely applied to distribute convolutional layers while model and pipeline parallelism approaches are more effective for fully-connected and recurrent layers of a neural net. All 3 techniques necessitate very high interconnect bandwidth between the GPUs (in order to communicate the necessary parameters) and impose limits on peak system utilization and model training time. A variety of system topologies have also been explored to efficiently implement distributed training using data parallelism techniques ranging from simple parameter-server based approaches to the recently proposed Wild-Fire technique \cite{raviWildfire} that allows direct exchange of weights during reduction. Recently, ring-based system topologies \cite{fastmultiGPU} have been proposed to maximally utilize inter-accelerator bandwidths by connecting all accelerators in the system in a ring network. The accelerator then transports it’s computed weight gradients (from its local mini-batch) directly to the adjacent accelerator (without the use of centralized parameter servers). However, as the number of learners increases, distribution of the minibatch data under strong scaling conditions has the adverse effect of significantly increasing the demand for communication bandwidth between the learners while proportionally decreasing the FLOPs needed in each learner - creating a severe computation to communication imbalance. + + +Simultaneously, there has been a renaissance in the computational throughput (TeraOps per second) of DL training accelerators - with accelerator throughputs exceeding 100’s of TeraOps/s expected in the next few years \cite{voltaGPU}, \cite{googleTPU}. Exploiting hardware architectures based on reduced precision \cite{gupta2015deep}, \cite{courbariaux2014training}, these accelerators promise dramatic reduction in training times in comparison to commercially available GPUs today. For a given DL network and distribution approach, the bandwidth needed for inter-accelerator communication (in GB/s) scales up directly with raw hardware performance as well as the number of learners. In order to guarantee high system performance, radically new compression techniques are therefore needed to minimize the amount of data exchanged between accelerators. Furthermore, the time required for compression needs to be significantly smaller than the computational time required for back-propagation. Section 2 discusses various prior compression techniques - most of which were applied to Fully Connected (FC) layers of DL networks. But high computational capacity and wide distribution necessitates compression of convolutional layers in addition to the fully-connected ones. Extending this need to networks that have a mix of fully-connected, convolutional and recurrent layers, it is desirable to have a universally applicable and computationally-friendly compression scheme that does not impact model convergence and has minimal new hyper-parameters. In this paper, we propose a new gradient-weight compression scheme for distributed deep-learning training platforms that fully satisfies these difficult constraints. Our primary contributions in this work include: +\begin{itemize} +\item We explore the limitations of current compression schemes and conclude that they are not robust enough to handle the diversity seen in typical neural networks. +\item We propose a novel computationally-friendly gradient compression scheme, based on simple local sampling, called AdaComp. We show that this new technique, remarkably, self-adapts its compression rate across mini-batches and layers. +\item We also demonstrate that the new technique results in a very high net compression rate ( ${\sim}200\times$ in FC and LSTM layers and ${\sim}40\times$ in convolution layers), with negligible accuracy and convergence rate loss across several network architectures (CNNs, DNNs, LSTMs), data sets (MNIST, CIFAR10, ImageNet, BN50, Shakespeare), optimizers (SGD with momentum, ADAM) and network-parameters (mini-batch size and number of learners). +\end{itemize} +\section{Residual gradient compression} + +\subsection{Background} +Given the popularity of distributed training of deep networks, a number of interesting techniques for compressing FC weight gradients have been proposed \cite{seide20141}, \cite{strom2015scalable}, \cite{dryden2016communication}. Siede \cite{seide20141} proposed a one-bit quantization scheme for gradients, which locally stores quantization errors, and reconstruction values are computed using the mean of the gradient values. This scheme achieves a fixed compression rate of 32x applicable only to FC layers. Strom \cite{strom2015scalable} proposed a thresholding technique for FC layers that is somewhat similar in approach but can provide much higher compression rates. Only gradient values that exceed a given threshold are quantized to one bit and subsequently propagated to the parameter server along with their indices. These schemes preserve quantization error information in order to reduce the impact of thresholding on the accuracy of the trained model. Furthermore, these papers do not discuss techniques for determining an optimal threshold value. Dryden \cite{dryden2016communication} proposed a ``best of both worlds'' approach, by combining the one-bit quantization and thresholding ideas. Instead of using a fixed threshold, they propagate a fixed percentage of the gradients, and use the mean of the propagated values for reconstruction. This technique requires sorting of the entire gradient vector which is a computationally expensive task, particularly on a special-purpose accelerator. All the three techniques above are aimed at reducing weight update traffic in deep multi-layer perceptrons composed of fully-connected layers. One common principle that allows these compression techniques to work without much loss of accuracy is that each learner maintains an accumulated gradient (that we refer to as \textbf{residual gradients}) comprising of the gradients that have not yet been updated centrally. We exploit a similar principle in our work. +\subsection{Related work} +For convolutional neural networks (CNNs), the primary motivation for reducing the size of the network has stemmed from the desire to have small efficient models for inference and not from training efficiency point of view. Han et al. \cite{han2015deep} combine network pruning along with quantization and Huffman encoding to decrease the total size of the weights in the model. This is useful as a fine-tuning technique after a trained network is available. Similarly, Molchanov \cite{molchanov2016pruning} presented a technique for pruning feature maps while adapting a trained CNN model for distinct tasks using transfer learning. + +Recently, a ternary scheme was proposed \cite{wen2017terngrad} to compress communicated gradients while training CNNs for image processing. Without the use of sparsity, the compression rate in their approach is limited to $16\times$ for both fully connected and convolutional layers. Much higher compression rates (${\sim}100\times$) will be needed in the future to balance computation and communication for emerging deep learning accelerators \cite{voltaGPU}. Furthermore, their technique showed significant (${\sim}1.5\%$) degradation in large networks including GoogLeNet. In our work, we apply a novel scheme that exploits both sparsity and quantization to achieve much higher end-to-end compression rates and demonstrate that \textless 1\% degradation is achievable in many state of art networks (e.g. ResNet50 for ImageNet) as well as other application domains (including speech and language). In addition, our approach focuses on compression, which is complimentary to the techniques used by Goyal \cite{goyal2017accurate} and Minsik \cite{cho2017powerai} on their use of large minibatches for highly distributed training of deep networks. +\subsection{Observations} +We first note that most of the residual gradient compression techniques discussed in Background section do not work well for convolutional layers during training - especially when we also compress the fully connected layers of the same model. As Fig. 1 shows, even for a simple dataset like CIFAR10 \cite{krizhevsky2009learning} \cite{jia2014caffe}, when the fully connected layer is compressed, a simple 1-bit quantization based compression scheme \cite{seide20141} for the convolutional layer significantly worsens model accuracy. What is desired is a universal technique that can compress all kinds of layers (including convolutional layers) without degrading model convergence. + +\begin{figure}[h] + \centering + \includegraphics[height=43.5mm]{AAAI18_FIG1.png} + \caption{For the CIFAR10 dataset and a network similar to the one in Caffe \cite{jia2014caffe}, compressing the FC layer only by sending the top 0.3\% of the gradients \cite{dryden2016communication} results in a modest degradation in test accuracy (20\% vs. 18\%). Furthermore, additionally compressing the convolutional layer using a 1-bit quantization scheme \cite{seide20141} results in complete model divergence.} +\end{figure} + + +Our first observation, inspired by \cite{molchanov2016pruning}, is that the best pruning techniques consider not only the magnitude of the weights, but also the mini-batch data (and their impact on input feature activities) to maximize pruning efficiency. However, prior work in the compression space assumes that the magnitude of the residue is the only metric indicative of its overall importance. For example, in \cite{strom2015scalable} a fixed gradient value is used as the threshold, and in \cite{dryden2016communication} a fixed portion of the top gradients are communicated. Intuitively, picking residues with maximum value for any layer may miss lower-magnitude (but critically important) residual gradients that are connected to high activity input features. We also note (empirically) that accumulated residual gradients show little to no correlation with feature activations - which raises further questions about the efficacy of simply picking high valued gradients in any layer. + +The second key observation is that neural networks have different activities in different layers depending on overall network architecture, layer types, mini-batch sizes and other parameters, and all of these factors have a direct impact on compression rate. Since compression during training has the potential to dramatically affect convergence, we note that new techniques are desired that automatically and universally adapt to all of these variations without necessitating a whole new set of hyper-parameters. + +Finally, it is critical to minimize the computational overhead for any new compression technique given the dramatic reduction in the training time per mini-batch with new high TeraOp/s accelerators. This constraint automatically precludes techniques that require globally sorting of the residue vectors, and instead drives us towards techniques that are accelerator friendly and localized (in terms of memory accesses). +\subsection{Adaptive Residual Gradient Compression (AdaComp) Technique} +Given the lack of correlation between the activity of the input features and the residual gradients in any layer, we conjecture that it is important to have a small enough sampling window that can effectively capture the right residues across the entire layer. To facilitate this, we divide the entire residue vector for each layer (laid out as $NumOutMaps\times NumInpMaps\times KernelRows\times KernelCols$) uniformly into several bins - where the fixed length bin size, {${\rm \textbf{ L}}_{\rm \small{\textbf{ T}}}$} is a new hyper-parameter. In each bin, we first find the maximum of the absolute value of the residues. In addition to this value, we found that it was also important to send several other residues that are relatively similar in magnitude to this maximum. There are several ways to find such important gradients inside each bin. In this paper, we propose a relatively simple self-adjusting scheme. Recall that in each mini-batch, the residue is computed as the sum of the previous residue and the latest gradient value obtained from back-propagation. If the sum of its previous residue plus the latest gradient multiplied by a scale-factor exceeds the maximum of the bin, we include these additional residues in the set of values to be sent (and centrally updated). Empirically, we studied a range of choices for the scale factor (from 1.5 - 3.0$\times$) and chose 2$\times$ primarily for computational ease (simple additions vs. multiplications). The primary intuition here is that since the residues are empirically much larger than the gradients, this scheme allows us to send a whole list of important residues close to the {local maximum}. Furthermore, we quantize the compressed residue vector in order to increase the overall compression rate. AdaComp is applied to every layer separately - and each learner sends a scale-factor in addition to the compressed sparse vector. + +This approach to ``threshold'' the selection is self-adjusting in 3 ways. First, it allows some bins to send more gradients than others - as many as are needed to accurately represent each bin. Secondly, since the residues are small in the early epochs, more gradients are automatically transmitted in comparison with later epochs. Third, as will be shown in later sections, in comparison to other schemes, this technique minimizes the chances of model divergence that result from an explosion in the residual gradient values and gradient staleness. Thus, AdaComp adaptively adjusts compression ratios in different mini-batches, epochs, network layers and bins. These characteristics provide automatic tuning of the compression ratio, resulting in robust model convergence. We observe that just one hyper-parameter (\textbf{${\rm L}_{\rm T}$}) is sufficient to achieve high compression rates without loss of accuracy. +Finally, it should also be noted that AdaComp, unlike \cite{dryden2016communication}, does not require any sorting (or approximations to sorting) and is therefore computationally very efficient (O(N)) for high-performance systems. +\subsection{Pseudo code} +\label{subsec:Pseudo-code} +The following pseudo code describes two algorithms. Algorithm 1 shows the gradient weight communication scheme we used to test AdaComp, and algorithm 2 is the AdaComp algorithm we propose. Note that our algorithm is not limited to a particular quantization function. In this work, the quantization function uses a sign bit and a scale value to represent the original number. In addition, we use a single scale value for the entire layer - calculated as the average of the absolute values of all the elements in the ${\rm \text g}_{\rm \small{\text max}}$ vector. For simplicity of exposition Algorithm 2 assumes that the threshold T evenly divides the $length(G)$. + +\begin{algorithm} +\caption{Computation Steps} + \begin{algorithmic} + \State $\texttt{\small{learningNoUpdate()}}$ \Comment{\small{Forward/Backward only} } + \State $\texttt{serializeGrad()}$ \Comment{Collect grad of each layer as a vector} + \State $\texttt{pack()}$ \Comment{AdaComp Compression for each layer} + \State $\texttt{exchange()}$\Comment{Learner receives packed grads from others} + \State $\texttt{unpack()}$ \Comment{AdaComp Decompression for each layer} + \State $\texttt{averageGradients()}$ \Comment{Average among all learners} + \State $\texttt{updateWeights()}$ \Comment{Performed locally at each learner} + \end{algorithmic} +\end{algorithm} + +\begin{algorithm} +\caption{Details of pack()} +\label{alg:Details-of-pack} + \begin{algorithmic} + \State\small{$G\gets residue + dW$} \Comment{\small{dW is from \texttt{serializeGrad()}}} + \State$H\gets G + dW$ \Comment{\small{H = Residue + 2*dW}} + \State$\textit{Divide G into bins of size T}$ + \For{$i \gets 1, length(G)/T$} \Comment Over all bins + \State $\textit{Calculate }g_{max}(i);$ \Comment Get largest absolute value in each bin + \EndFor + \For{$i \gets 1, length(G)/T$} \Comment Over all bins + \For{$j \gets 1,T$} \Comment Over all indices within each bin + \State$index\gets (i-1)*T+j$ + \If{$\mid H(index)\mid \geq g_{max}(i)$} \Comment Local max compare + \State$Gq(index)\gets \textit{Quantize(G(index))}$ + \State$\textit{add Gq(index) to a pack vector (sent in exchange())}$ + \State$residue(index)\gets G(index)-Gq(index)$ + \Else + \State$residue(index)\gets G(index)$ \Comment No transmission + \EndIf + \EndFor + \EndFor + \end{algorithmic} +\end{algorithm} +\section{Experiments} +We performed a suite of experiments using the AdaComp algorithm. That algorithm is encapsulated within two functions, pack() and unpack(), inserted into the standard DL flow between the backward pass and the weight-update step (Algorithm 1). The pack/unpack algorithms are independent of the exchange() function which depends on the topology (ring-based vs. parameter-server based), and therefore the exchange() function is not a subject of this paper. +AdaComp impacts 4 critical parameters during DL training: 1) communication overheads, 2) extra time spent executing the pack() and unpack() functions, 3) convergence, and 4) compression ratios. In this paper, we evaluate convergence and compression (items 3 and 4) - but do not report the impact on run-time (items 1 and 2). +\subsection{Methodology} +Experiments were done using IBM SoftLayer cloud servers where each server node is equipped with two Intel Xeon E5-2690-V3 processors and two NVIDIA Tesla K80 cards. Each Xeon processor has 12 cores running at 2.66GHz and each Tesla K80 card contains two K40 GPUs each with 12GB of GDDR5 memory. +The software platform is an in-house distributed deep learning framework (\cite{gupta2016model}, \cite{raviWildfire}). The exchange of gradients is done in a peer-to-peer fashion using MPI. In addition, we use synchronous SGD - where all the learners always have identical weights at each step. + + + +Table~\ref{tab:data_model} records the details of the datasets and neural network models we use in this paper. Here we briefly describe the network architectures used in our experiments. + + + + + +\begin{itemize} +\item MNIST-CNN \cite{lecun1998gradient}: 2 convolutional layers (with 5x5 filters and Relu activation functions), 2 FC layers, and a 10-way softmax. +\item CIFAR-CNN \cite{krizhevsky2009learning}: 3 convolutional layers (with 5x5 filters and Relu activation function), 1 FC layer, and a 10-way softmax. +\item AlexNet \cite{krizhevsky2012imagenet}: 5 convolutional layers and 3 FC layers. The output layer is a 1K softmax layer. +\item ResNet18 \cite{he2016deep}: 8 ResNet blocks totaling 16 convolutional layers with 3x3 filters, batch normalization, Relu activation and a final FC layer with a 1K softmax. +\item ResNet50 \cite{he2016deep}: 16 bottleneck ResNet blocks totaling 48 convolutional layers with 3x3 or 1x1 filters, batch normalization, Relu activation and a final FC layer with a 1K softmax. +\item BN50-DNN \cite{van2017training}: 6 FC layers (440x1024, 1024x1024, 1024x1024, 1024x1024, 1024x1024, 1024x5999) and a 5999-way softmax. +\item LSTM \cite{multiRNN}: 2 LSTM layers (67x512, 512x512), 1 FC layer (512x67) and a 67-way softmax. +\end{itemize} + + + + + + + + + +\begin{table}[] +\small +\centering +\caption{Dataset and Model} +\label{tab:data_model} +\begin{tabular}{@{}lcclcl@{}} +\toprule +\multicolumn{3}{c}{Dataset} & \multicolumn{2}{c}{Model} & \\ +\multicolumn{1}{c}{Name} & \multicolumn{1}{l}{\#Sample} & Size & \multicolumn{1}{c}{Name} & Size & \\ \midrule +MNIST & 60k & 181MB +& CNN & 1.7MB & \\ \midrule +CIFAR10 & 50k & 1GB +& CNN & 0.3MB & \\ \midrule +\multirow{3}{*}{ImageNet } & \multirow{3}{*}{1.2M} & \multirow{3}{*}{140GB} & AlexNet & 288MB & \\ + &&& ResNet18 & 44.6MB & \\ + &&& ResNet50 & 98MB & \\ \midrule +BN50 & ~16M & 28GB & DNN & 43MB & \\ \midrule +Shakespeare & 50k & 4MB & LSTM & 13MB & \\ \bottomrule +\end{tabular} +\end{table} + +\begin{table*}[ht!] +\small{ + \caption{CNN, MLP, and LSTM results } + \label{sample-table} + \centering + \begin{tabular}{llllllll} + \toprule + \multicolumn{8}{c}{Compression hyper-parameters: convolution layer ${\rm L}_{\rm T}$: 50 and fully connected layer ${\rm L}_{\rm T}$: 500} \\ + \cmidrule{1-8} + Model & MNIST-CNN & CIFAR10-CNN & AlexNet & ResNet18 & ResNet50 & BN50-DNN & LSTM \\ + \midrule + Dataset & MNIST & CIFAR10 & ImageNet & ImageNet & ImageNet & BN50 & Shakespeare \\ + Mini-Batch size & 100 & 128 & 256 & 256 & 256 & 256 & 10 \\ + Epochs & 100 & 140 & 45 & 80 & 75 & 13 & 45 \\ + Baseline (top-1) & 0.88\% & 18\% & 42.7\% & 32.41\% & 28.91\% & 59.8\% & 1.73\% \\ + Our method (top-1) & 0.85\% (8L) & 18.4\%(128L) & 42.9\%(8L) & 32.87\%(4L) & 29.15\%(4L) & 59.8\% (8L) & 1.75\% (8L) \\ + Learner number & 1,8 & 1,8,16,64,128 & 8 & 4 & 4 & 1,4,8 & 1,8 \\ + \bottomrule + \end{tabular} + } +\end{table*} + +\begin{figure*}[htb!] + \centering + \subfloat[CIFAR10-CNN for CIFAR10 dataset: For Stress test under Extreme Compression, \textbf{${\rm L}_{\rm T}$} = 800 is used for CONV and 8000 is used for FC layers]{\includegraphics[height=43.5mm]{AAAI18_FIG2a.png}} \hspace{0.192cm} + \subfloat[AlexNet for ImageNet dataset: For Stress test under Extreme Compression, \textbf{${\rm L}_{\rm T}$} = 500 was used for both CONV and FC layers.]{\includegraphics[height=43.5mm]{AAAI18_FIG2b.png}} + + \subfloat[ResNet18 for ImageNet dataset]{\includegraphics[height=43.5mm]{AAAI18_FIG2c.png}} + \subfloat[ResNet50 for ImageNet dataset]{\includegraphics[height=43.5mm]{AAAI18_FIG2d.png}} + + \subfloat[LSTM for Shakespeare dataset]{\includegraphics[height=43.5mm]{AAAI18_FIG2e.png}} + \subfloat[BN50-DNN for BN50 speech dataset]{\includegraphics[height=43.5mm]{AAAI18_FIG2f.png}} + + \caption{{Model convergence results for different networks, datasets and learner numbers. In all tests (except for the Stress Tests) the same compression hyper-parameters are used: ${\rm L}_{\rm T}$ of 50 for CONV layers and 500 for FC/LSTM layers. Excellent compression ratios of $40\times$ for CONV layers and $200\times$ for FC/LSTM layers are obtained with no degradation in model convergence or accuracy. Stress tests are also shown for CIFAR10-CNN and AlexNet to demonstrate the limits of compression. + }} +\end{figure*} + + +\begin{figure}[h] + \centering + \includegraphics[height=4.4cm]{AAAI18_FIG3.png} + \caption{This work (AdaComp) achieves similar effective compression rates ($40\times$ for CONV layers and $200\times$ for FC/LSTM layers) with Adam, and had no impact on convergence or test error (Adam: baseline:18.1\% vs compression:18.3\%). In comparison to SGD, Adam exhibited faster initial convergence but similar final accuracy.} +\end{figure} +\subsection{Experiment Results} +To demonstrate the robustness as well as the wide applicability of the proposed AdaComp scheme, we tested it comprehensively on all 3 major kinds of neural networks: CNNs, DNNs, and LSTMs. For CNN, five popular networks for image classification were tested: MNIST-CNN, CIFAR10-CNN, AlexNet, ResNet18, and ResNet50. We also included in our tests two pure DNNs (BN50-DNN for speech and MNIST-DNN (not shown)), and an RNN (LSTM). In all these experiments we used the same hyper-parameters as the baseline (i.e., no compression). The selection of ${\rm L}_{\rm T}$ is empirical and is a balance between communication time and model accuracy; the same values are used across all models: ${\rm L}_{\rm T}$ is set to 50 for convolutional layers and to 500 for FC and LSTM layers. + +The experimental results are summarized in Table 2, while the detailed convergence curves are shown in Fig. 2. The proposed AdaComp scheme, on every single network (with different datasets, models and layers - CNNs, DNNs and LSTMs), tested under a wide range of distributed system settings (from 1 to 128 learners), achieved almost identical test errors compared with the non-compressed baseline. + +In addition to the conventional SGD with momentum optimizer, we also applied the AdaComp technique to other optimizers such as Adam \cite{kingma2014adam}. We ran experiments in Adam for the CIFAR10-CNN model and found that our compression scheme achieved similar compression ratios with Adam. In addition, the compression technique had no impact on model convergence or test error (Adam: baseline:18.1\% vs compression:18.3\%). As shown in Fig. 3, in comparison to SGD, as expected, Adam exhibited faster initial convergence but similar final accuracy. Intuitively, this result is consistent with the AdaComp algorithm which should be agnostic to the optimizer used (SGD with momentum vs. Adam vs. rmsprop) - with a detailed analysis presented in the next section. + +Overall, our experimental results indicate that the AdaComp scheme is remarkably robust across application domains, layer types, learner numbers, and the choice of the optimizer. For the above ${\rm L}_{\rm T}$ choices of 50 and 500, the AdaComp algorithm typically selects only up to 5 elements within each bin (through sparsity). For ${\rm L}_{\rm T}$ sizes \textless 64, a sparse-indexed representation of 8-bits could be used effectively, while 16-bits of representation would be needed for larger ${\rm L}_{\rm T}$ sizes (up to 16K elements) - where 2-bits (out of 8 or 16) would be used to represent the ternarized data values. Therefore, in comparison with traditional 32-bit floating-point representations, the AdaComp scheme achieves an excellent \textbf{Effective Compression Rate} of $\mathbf{40\times}$ for convolutional layers and $\mathbf{200\times}$ for fully connected and recurrent layers. +\section{Discussions} + +\subsection{Robustness of the AdaComp Technique} +To understand the robustness of the different Residual Gradient compression schemes, 3 different methods are compared in Fig. \ref{fig:cifar10-cnn-comp-vs-testerr} - Dryden \cite{dryden2016communication}, Local Selection (LS), and this work (AdaComp). The LS technique refers to a scheme similar to AdaComp's local selection scheme, but without applying a soft-threshold to self-adjust the compression rate. This allows us to evaluate the importance of the self-adjustable nature of AdaComp. For each compression scheme, the CIFAR10-CNN model is trained using SGD with momentum (=0.9) and varying ${\rm L}_{\rm T}$ (and hence compression rates), reporting the final test error after 140 epochs. The 3 convolutional layers and the fully connected layer are all compressed at the same rate. As shown in Fig. \ref{fig:cifar10-cnn-comp-vs-testerr}, when the compression rate is less than 250, all methods achieve test errors close to (or slightly above) the baseline. While the test errors for Dryden's method and LS increase significantly as the effective compression rate increases, the AdaComp method is remarkably robust to ultra-high compression rates (reaching only 22\% test-errors for compression rates exceeding $2000\times$). We also show that this result extends to other optimizers including Adam - which shows even higher resilience (when compared to SGD) at high compression rates. + +\begin{figure}[h] + \centering + \includegraphics[height=4.2cm]{AAAI18_FIG4.png} + \caption{\label{fig:cifar10-cnn-comp-vs-testerr} Comparing CIFAR10 test-errors vs. effective compression rates for 3 different schemes - Dryden's method, Local Selection (LS) and the AdaComp technique trained by SGD. AdaComp is remarkably resilient to the compression rate while high compression rates cause LS and Dryden's schemes to diverge. AdaComp is also tested using Adam and exhibits even higher resiliency.} +\end{figure} + +To understand why the LS scheme fails when the compression rate is high, we focus on experiments where the FC layer alone is compressed using LS. In Fig. \ref{fig:positive-feedback}, we plot the value of the 95 percentile of the gradient (dW) and the Residual Gradient (RG) during the training process. When the compression rate is small (e.g. LS with ${\rm L}_{\rm T}$=200), the magnitude of RG and dW is stable during training, leading to successful convergence with test errors (17.84\%) close to the baseline. However, as the compression rate increases (e.g., LS with ${\rm L}_{\rm T}$=300), the magnitude of RG and dW appears to increase exponentially, resulting in complete divergence. This exponential increase can be understood as a positive feedback effect - where an increase in RG results in higher training error, leading to further increase in dW. Since dW is accumulated into RG, this feedback loop further expedites the growth of RG. As a result, both RG and dW grow exponentially over epochs. + +The key factor that makes the AdaComp technique robust is the self-adjustable threshold. The positive feedback in LS occurs because insufficient number of gradients are sent after each mini-batch. The difficult challenge with the LS and Dryden schemes is to find which and how many gradients need to be sent - since this number can be layer, network and hyper-parameter dependent. Recall that the AdaComp scheme sends a few additional residual gradients close to the local maximum in each bin - and can therefore automatically adapt to the number of important gradients in that set. Even if the compression rate is high, soft-threshold avoids the exponential increase in RG and dW - by being adaptive to the number of gradients being sent. This is demonstrated in Fig. \ref{fig:positive-feedback}, where RG for AdaComp with ${\rm L}_{\rm T}$=5000 slightly increases in the beginning, but stabilizes after that. Note that the compression rate using AdaComp (${\rm L}_{\rm T}$=5000) is ${\sim}2000\times$, which is much higher than ${\sim}600\times$ obtained with the LS scheme (${\rm L}_{\rm T}$=300). + +To illustrate how the self-adjustable threshold impacts the magnitude of RG, we plot the histogram of RG for LS and AdaComp at epoch 120 in Fig. \ref{fig:histogram_ls-vs-ll}. For the LS scheme, only a finite number of gradients are sent, increasing the RG of the remaining gradients. Therefore, it is observed that RG exponentially increases (ranging from -240K to 239K), shaping the histogram to have a very long tail at both ends. However for the AdaComp scheme, the gradients with large RG are all sent altogether, drastically shortening the tails. Therefore, RG for AdaComp does not increase over epochs. + + +\begin{figure}[h] + \centering + \includegraphics[ + height=44mm + ]{AAAI18_FIG5.png} + \caption{\label{fig:positive-feedback}Comparison of the magnitude of Residual Gradients (RG) for the local selection scheme (without adaptive soft-threshold) and the proposed AdaComp scheme. RG values are very sensitive to ${\rm L}_{\rm T}$ when local selection is used: larger ${\rm L}_{\rm T}$ (corresponding to higher compression rate) causes exponential increases in RG and results in model divergence. In comparison, AdaComp is very resilient to high ${\rm L}_{\rm T}$ values. } +\end{figure} + +\begin{figure}[h] + \centering + \includegraphics[width=0.7\linewidth]{AAAI18_FIG6.png} + \caption{\label{fig:histogram_ls-vs-ll}Comparing histograms of the Residual Gradients (RG) at epoch 120: Local Selection (LS) technique (top) and the AdaComp technique (bottom). AdaComp reduces RG by many orders of magnitude in comparison to LS.} +\end{figure} +\subsection{Impact of mini-batch size and number of learners} +Empirically, as shown in Fig. 7(a), we observe that increasing the mini-batch size reduces the achievable compression rate (while preserving model fidelity); this is true for previous work \cite{dryden2016communication} as well as the AdaComp compression scheme. Recall that the advantage of AdaComp over Dryden's scheme is its ability to locally sample the residue vector and thereby effectively capture high activities in the input features. When the mini-batch size increases, we expect the input features at every layer to see higher activity. This causes the compression rate for Dryden's technique to suffer dramatically, because relatively small residues (or gradients) now become increasingly important. In contrast, AdaComp locally selects elements, so while the compression rate does degrade, it still does a far better job at capturing all of the important residues. This results in a ${\sim}5-10\times$ improved compression rate for AdaComp (Fig. 7(a)). + +Consistent with the explanation above, we also observe (in Fig, 7(b)) that the compression rate for CIFAR10-CNN dramatically scales with the number of learners in the distributed system (while proportionally reducing the mini-batch size per learner). With more learners, each learner sees a smaller local mini-batch size and therefore compression rate is enhanced due to lower feature activity. + + + +\begin{figure}[htb!] + \centering + \subfloat[Compression rate comparisons for different minibatch sizes.]{\includegraphics[ height=44mm]{AAAI18_FIG7a.png}} + + \subfloat[Achievable compression rate for AdaComp with varying number of learners. Super-minibatch size (across learners) = 128.]{\includegraphics[ height=44mm]{AAAI18_FIG7b.png}} + + \caption{\label{fig:mb-ln-comp-rate} Impact of mini-batch size and the number of learners on the compression rate for CIFAR10-CNN. Compared to previous work \cite{dryden2016communication}, AdaComp is more resilient to large minibatch size (a) and shows higher compression rate for large number of learners (b) - while maintaining test error degradation within the acceptable range (\textless 1\%).} + \end{figure} +\section{Conclusions} +A new algorithm, Adaptive Residual Gradient Compression (\textbf{AdaComp}), for compressing gradients in distributed training of DL models, has been presented. The key insight behind AdaComp is that it is critical to consider both input feature activities as well as accumulated residual gradients for maximum compression. This is accomplished very effectively through a local sampling scheme combined with an adjustable (soft) threshold, which automatically handles variations in layers, mini-batches, epochs, optimizers, and distributed system parameters (i.e., number of learners). Unlike previously published compression schemes, our technique only needs 1 new hyper-parameter, is more robust, and allows us to simultaneously compress different types of layers in a deep neural network. Exploiting both sparsity and quantization, our results demonstrate a significant improvement in end-to-end compression rates: ${\sim}200\times$ for fully-connected and recurrent layers, and ${\sim}40\times$ for convolutional layers; all without any noticeable degradation in test accuracy. +These compression techniques will be foundational as we move towards an era where the communication bottlenecks in distributed systems get exacerbated due to the availability of specialized high-performance hardware for DL training. +\section{Acknowledgments} +The authors would like to thank Naigang Wang, Vijayalakshmi Srinivasan, Swagath Venkataramani, Pritish Narayanan, and I-Hsin Chung for helpful discussions and supports. This research was supported by IBM Research AI, IBM SoftLayer, and IBM Congnitive Computing Cluster (CCC). + +\bibliography{aaai2018} +\bibliographystyle{aaai} diff --git a/1712.02779v4.txt b/1712.02779v4.txt new file mode 100644 index 0000000000000000000000000000000000000000..a2c82ff98798b006177e6be6f1299c0c9ac8965c --- /dev/null +++ b/1712.02779v4.txt @@ -0,0 +1,87 @@ +Neural networks are now widely embraced as dominant solutions in computervision (Krizhevsky et al., 2012; He et al., 2016), speechrecognition (Graves et al., 2013), and natural languageprocessing (Collobert & Weston, 2008). However, while their accuracy scoresoften match (and sometimes go beyond) human-level performance on keybenchmarks (He et al., 2015; Taigman et al., 2014), models experience severe performancedegradation in the worst case. + +In this case, models are vulnerable to so-called adversarial examples, orslightly perturbed inputs that are almost indistinguishable from natural data toa human but cause state-of-the-art classifiers to make incorrectpredictions (Szegedy et al., 2014; Goodfellow et al., 2015). This raises concerns aboutthe use of neural networks in contexts where reliability, dependability, andsecurity are important. + +There is a long line of work on methods for constructing adversarialperturbations in varioussettings (Szegedy et al., 2014; Goodfellow et al., 2015; Kurakin et al., 2017; Sharif et al., 2016; Moosavi-Dezfooli et al., 2016; Carlini & Wagner, 2017; Papernot et al., 2017; Madry et al., 2018; Athalye et al., 2018).However, these methods largely rely on perturbations that are quite contrivedand hence unlikely to exist in the real world.For example, in the context of image recognition, a large body of work hasfocused on fooling models with carefully crafted, ℓpsubscriptℓ𝑝\ell_{p}-boundedperturbations in pixel-space. + +As such, one may suspect that adversarial examples are a problem only in thepresence of a truly malicious attacker, and are unlikely to arise in more benignenvironments. However, recent work has shown that neural network–based visionclassifiers are vulnerable to input images that have been spatiallytransformed through small rotations, translations, shearing, scaling, andother natural transformations (Fawzi & Frossard, 2015; Kanbak et al., 2018; Xiao et al., 2018; Tramèr & Boneh, 2017).Such transformations are pervasive in vision applications and hence quite likelyto naturally occur in practice.The vulnerability of neural networks tosuch transformations raises a natural question: + +How can we build spatially robust classifiers? + +We address this question by first performing an in-depth study of neuralnetwork–based classifier robustness to two basic image transformations:translations and rotations. While these transformations appear natural to ahuman, we show that small rotations and translations alone cansignificantly degrade accuracy. These transformations are particularly relevantfor computer vision applications since real-world objects do not always appearperfectly centered. + +Our goal is to obtain a fine-grained understanding of the spatial robustness ofstandard, near state-of-the-art image classifiers for theMNIST (LeCun, 1998), CIFAR10 (Krizhevsky, 2009), andImageNet (Russakovsky et al., 2015) datasets. + +We find that small rotations and translations consistently andsignificantly degrade accuracy of image classifiers on a number of tasks, asillustrated in Figure 1.Our results suggest that classifiers are highly brittle: even small random transformations can degrade accuracy by up to 30%.Such brittleness to random transformations suggests that these models might beunreliable even in benign settings. + +We then perform a thorough analysis comparing the abilities of variousadversaries—first-order, random, and grid-based—to fool models with smallrotations and translations.In particular, we find that exhaustive grid search-based adversaries are muchmore powerful than first-order adversaries.This is in stark contrast to results in the ℓpsubscriptℓ𝑝\ell_{p}-bounded adversarial exampleliterature, where first-order methods can consistently find approximatelyworst-case inputs (Carlini & Wagner, 2017; Madry et al., 2018). + +To understand why such a difference occurs, we delve deeper into the classifiersto try and understand the failure modes induced by such natural transformations.We find that the loss landscape of classifiers with respect to rotations andtranslations is highly non-concave and contains many spurious maxima.This is, again, in contrast to the ℓpsubscriptℓ𝑝\ell_{p}-bounded setting, in which,experimentally, the value of different maxima tend to concentratewell (Madry et al., 2018).Our loss landscape results thus demonstrate that any adversary relying on firstorder information might be unable to reliably find misclassifications.Consequently, rigorous evaluation of model robustness in this spatial settingrequires techniques that that go beyond what was needed to induce ℓpsubscriptℓ𝑝\ell_{p}-basedadversarial robustness. + +We then develop methods for alleviating these vulnerabilities using insightsfrom our study.As a natural baseline, we augment the training procedure with rotations andtranslations.While this does largely mitigate the problem on MNIST, additional dataaugmentation only marginally increases robustness on CIFAR10 and ImageNet.We thus propose two natural methods for further increasing the robustness ofthese models, based on robust optimization and aggregation of random inputtransformations.These methods offer significant improvements in classification accuracy againstboth adaptive and random attackers when compared to both standard models andthose trained with additional data augmentation.In particular, on ImageNet, our best model attains a top1 accuracy of56% against the strongest adversary, versus 34% for astandard network with additional data augmentation. + +Finally, we examine the interplay between spatial andℓ∞subscriptℓ\ell_{\infty}-based perturbations.We observe that robustness to these two classes of input perturbations islargely orthogonal.In particular, pixel-based robustness does not imply spatial robustness, whilecombining spatial and ℓ∞subscriptℓ\ell_{\infty}-bounded transformations seems to have acumulative effect in reducing classification accuracy.This emphasizes the need to broaden the notions of image similarity in theadversarial examples literature beyond the common ℓpsubscriptℓ𝑝\ell_{p}-balls. + +The fact that small rotations and translation can fool neural networks on MNISTand CIFAR10 was, to the best of our knowledge, first observed in (Fawzi & Frossard, 2015).They compute the minimum transformation required to fool the model and use it as a measure for a quantitative comparison of different architectures and training procedures.The main difference to our work is that we focus on the optimization aspect of the problem.We show that a few random queries usually suffice for a successful attack, while first-order methods are ineffective.Moreover, we go beyond standard data augmentation and evaluate the effectiveness of natural baseline defenses. + +The concurrent work of Kanbak et al. (2018) proposes a different first-order method to evaluate the robustness of classifiers based on geodesic distances on a manifold.This metric is harder to interpret than our parametrized attack space.Moreover, given our findings on the non-concavity of the optimization landscape, it is unclear how close their method is to the ground truth (exhaustive enumeration).While they perform a limited study of defenses (adversarial fine-tuning) using their method, it appears to be less effective than our baseline worst-of-10 training.We attribute this difference to the inherent obstacles first-order methods face in this optimization landscape. + +Recently, Xiao et al. (2018) and Tramèr & Boneh (2017) observedindependently that it is possible to use various spatial transformations toconstruct adversarial examples for naturally and ℓ∞subscriptℓ\ell_{\infty}-adversarially trained models.The main difference from our work is that we show even very simple transformations (translations and rotations) are sufficient to break a variety of classifiers, while the transformations employed in (Xiao et al., 2018) and (Tramèr & Boneh, 2017) are more involved.The transformation in (Xiao et al., 2018) is based on performing a displacement of individual pixels in the original image constrained to be globally smooth and then optimized for misclassification probability.Tramèr & Boneh (2017) consider an ℓ∞subscriptℓ\ell_{\infty}-bounded pixel-wise perturbation of a version of the original image that has been slightly rotated and in which a few random pixels have been flipped.Both of these methods require direct access to the attacked model (or a surrogate) to compute (or at least estimate) the gradient of the loss function with respect to the model’s input.In contrast, our attacks can be implemented using only a small number of random,non-adaptive inputs. + +Recall that in the context of image classification, an adversarial example for a given input image x𝑥x and a classifier C𝐶C is an image x′superscript𝑥′x^{\prime} that satisfies two properties:(i) on the one hand, the adversarial example x′superscript𝑥′x^{\prime} causes the classifier C𝐶C to output a different label on x′superscript𝑥′x^{\prime} than on x𝑥x, i.e., we have C​(x)≠C​(x′)𝐶𝑥𝐶superscript𝑥′C(x)\neq C(x^{\prime}).(ii) On the other hand, the adversarial example x′superscript𝑥′x^{\prime} is “visually similar” to x𝑥x. + +Clearly, the notion of visual similarity is not precisely defined here.In fact, providing a precise and rigorous definition is extraordinarily difficult as it would require formally capturing the notion of human perception.Consequently, previous work largely settled on the assumption that x′superscript𝑥′x^{\prime} is a valid adversarial example for x𝑥x if and only if ‖x−x′‖p≤εsubscriptnorm𝑥superscript𝑥′𝑝𝜀\|x-x^{\prime}\|_{p}\leq\varepsilon for some p∈[0,∞]𝑝0p\in[0,\infty] and ε𝜀\varepsilon small enough.This convention is based on the fact that two images are indeed visually similar when they are close enough in some ℓpsubscriptℓ𝑝\ell_{p}-norm.However, the converse is not necessarily true.A small rotation or translation of an image usually appears visually similar to a human, yet can lead to a large change when measured in an ℓpsubscriptℓ𝑝\ell_{p}-norm.We aim to expand the range of similarity measures considered in the adversarial examples literature by investigating robustness to small rotations and translations. + +Our first goal is to develop sufficiently strong methods for generating adversarial rotations and translations.In the context of pixel-wise ℓpsubscriptℓ𝑝\ell_{p}-bounded perturbations, the most successfulapproach for constructing adversarial examples so far has been to employoptimization methods on a suitable loss function(Szegedy et al., 2014; Goodfellow et al., 2015; Carlini & Wagner, 2017).Following this approach, we parametrize our attack method with a set of tunable parameters and then optimize over these parameters. + +First, we define the exact range of attacks we want to optimize over.For the case of rotation and translation attacks, we wish to find parameters (δ​u,δ​v,θ)𝛿𝑢𝛿𝑣𝜃(\delta u,\delta v,\theta) such that rotating the original image by θ𝜃\theta degrees around the center and then translating it by (δ​u,δ​v)𝛿𝑢𝛿𝑣(\delta u,\delta v) pixels causes the classifier to make a wrong prediction.Formally, the pixel at position (u,v)𝑢𝑣(u,v) is moved to the following position (assuming the point (0,0)00(0,0) is the center of the image):[u′v′]=[cos⁡θ−sin⁡θsin⁡θcos⁡θ]⋅[uv]+[δ​uδ​v].matrixsuperscript𝑢′superscript𝑣′⋅matrix𝜃𝜃𝜃𝜃matrix𝑢𝑣matrix𝛿𝑢𝛿𝑣\begin{bmatrix}u^{\prime}\\v^{\prime}\end{bmatrix}=\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}\cdot\begin{bmatrix}u\\v\end{bmatrix}+\begin{bmatrix}\delta u\\\delta v\end{bmatrix}.We implement this transformation in a differentiable manner using the spatialtransformer blocks of (Jaderberg et al., 2015) 222We used the opensource implementation found here: https://github.com/tensorflow/models/tree/master/research/transformer..In order to handle pixels that are mapped to non-integer coordinates, thetransformer units include a differentiable bilinear interpolation routine.Since our loss function is differentiable with respect to the input and thetransformation is in turn differentiable with respect to its parameters, we can obtain gradients of the model’s loss function w.r.t. the perturbation parameters.This enables us to apply a first-order optimization method to our problem. + +By defining the spatial transformation for some x𝑥x as T​(x;δ​u,δ​v,θ)𝑇𝑥𝛿𝑢𝛿𝑣𝜃T(x;\delta u,\delta v,\theta), we construct an adversarial perturbation for x𝑥x bysolving the problemmaxδ​u,δ​v,θ⁡ℒ​(x′,y),for​x′=T​(x;δ​u,δ​v,θ),subscript𝛿𝑢𝛿𝑣𝜃ℒsuperscript𝑥′𝑦forsuperscript𝑥′𝑇𝑥𝛿𝑢𝛿𝑣𝜃\max_{\delta u,\delta v,\theta}\mathcal{L}(x^{\prime},y),\quad\textrm{for}\ x^{\prime}=T(x;\delta u,\delta v,\theta)\;,(1)where ℒℒ\mathcal{L} is the loss function of the neural network333The lossℒℒ\mathcal{L} of the classifier is a function from images to real numbers thatexpresses the performance of the network on the particular example x𝑥x (e.g., the cross-entropy between predicted and correct distributions)., and y𝑦y is thecorrect label for x𝑥x. + +We compute the perturbation from Equation 1 in three distinct ways:•First-Order Method (FO):Starting from a random choice of parameters, we iteratively take steps in the direction of the gradient of the loss function.This is the direction that locally maximizes the loss of the classifier (as a surrogate for misclassification probability).Since the maximization problem we are optimizing is non-concave, there are no guarantees for global optimality, but the hope is that the local maximum solution closely approximates the global optimum.Note that unlike the ℓpsubscriptℓ𝑝\ell_{p}-norm case, we are not optimizing in the pixelspace but in the latent space of rotation and translation parameters.•Grid Search: We discretize the parameter space and exhaustively examine every possible parametrization of the attack to find one that causes the classifier to give a wrong prediction (if such a parametrization exists).Since our parameter space is low-dimensional enough, this method is computationally feasible (in contrast to a grid search for ℓpsubscriptℓ𝑝\ell_{p}-based adversaries).•Worst-of-k𝑘k: We randomly sample k𝑘k different choices of attack parameters and choose the one on which the model performs worst.As we increase k𝑘k, this attack interpolates between a random choice and grid search. + +We remark that while a first-order attack requires full knowledge of the model to compute the gradient of the loss with respect to the input, the other two attacks do not.They only require the outputs corresponding to chosen inputs, which can be done with only query access to the target model. + +As we will see in Section 5, augmenting the training set with random rotations and translations does improve the robustness of the model against such random transformations.However, data augmentation does not significantly improve the robustness against worst-case attacks and sometimes leads to a drop in accuracy on unperturbed images.To address these issues, we explore two simple baselines that turn out to be surprisingly effective. + +Instead of performing standard empirical risk minimization to train the classification model, we utilize ideas from robust optimization.Robust optimization has a rich history (Ben-Tal et al., 2009) and has recently beenapplied successfully in the context of defending neural networks againstadversarialexamples (Madry et al., 2018; Sinha et al., 2018; Raghunathan et al., 2018; Wong & Kolter, 2018).The main barrier to applying robust optimization for spatial transformations is the lack of an efficient procedure to compute the worst-case perturbation of a given example.Performing a grid search (as described in Section 3) is prohibitive as this would increase the training time by a factor close to the grid size, which can easily be a factor 100 or 1,000.Moreover, the non-convexity of the loss landscape prevents potentially more efficient first-order methods from discovering (approximately) worst-case transformations (see Section 5 for details). + +Given that we cannot fully optimize over the space of translations and rotations, we instead use a coarse approximation provided by the worst-of-10 adversary (as described in Section 3).So each time we use an example during training, we first sample 10 transformations of the example uniformly at random from the space of allowed transformations.We then evaluate the model on each of these transformations and train on the one perturbation with the highest loss.This corresponds to approximately minimizing a min-max formulation of robustaccuracy similar to (Madry et al., 2018).Training against such an adversary increases the overall time by a factor of roughly six.444We need to perform 10 forward passes and one backwards pass instead of one forward and one backward pass required for standard training. + +As Section 5 shows, the accuracy against a random transformation is significantly higher than the accuracy against the worst transformation in the allowed attack space.This motivates the following inference procedure: compute a (typically small)number of random transformations of the input image and output the label thatoccurs the most in the resulting set of predictions.We constrain these random transformations to be within 5%percent55\% of the input image size in each translation direction and up to 15​°15°15\degree of rotation.555Note that if an adversary rotates an image by 30​°30°30\degree (a valid attack in our threat model), we may end up evaluating the image on rotations of up to 45​°45°45\degree.The training procedure and model can remain unchanged while the inference time is increased by a small factor (equal to the number of transformations we evaluate on). + +The two methods outlined above are orthogonal and in some sense complementary.We can therefore combine robust training (using a worst-of-k adversary) and majority inference to further increase the robustness of our models. + +We evaluate standard image classifiers for the MNIST (LeCun, 1998),CIFAR10 (Krizhevsky, 2009) andImageNet (Russakovsky et al., 2015) datasets.In order to determine the extent to which misclassification is caused by insufficient data augmentation during training, we examine various data augmentation methods.We begin with a description of our experimental setup. + +For MNIST, we use a convolutional neural network derived from the TensorFlow Tutorial (Abadi et al., 2016).In order to obtain a fully convolutional version of the network, we replace the fully-connected layer by two convolutional layers with 128 and 256 filters each, followed by a global average pooling.For CIFAR10, we consider a standard ResNet (He et al., 2016) model with 4 groups of residual layers with filter sizes [16, 16, 32, 64] and 5 residual units each.We use standard and ℓ∞subscriptℓ\ell_{\infty}-adversarially trained models similar to thosestudied by Madry et al. (2018).666https://github.com/MadryLab/cifar10_challenge,777https://github.com/MadryLab/mnist_challengeFor ImageNet, we use a ResNet-50 (He et al., 2016) architecture implemented inthe tensorpack repository (Wu et al., 2016).We did not modify the model architectures or training procedures. + +In order to maintain the visual similarity of images to the natural ones we restrict the space of allowed perturbations to be relatively small.We consider rotations of at most 30​°30°30\degree and translations of at most (roughly) 10% percent of the image size in each direction.This corresponds to 3 pixels for MNIST (image size 28×28282828\times 28) and CIFAR10 (image size 32×32323232\times 32), and 24 pixels for ImageNet (image size 299×299299299299\times 299).For grid search attacks, we consider 5 values per translation direction and 31 values for rotations, equally spaced.For first-order attacks, we use 200200200 steps of projected gradient descent of step size 0.010.010.01 times the parameter range.When rotating and translating the images, we fill the empty space with zeros (black pixels). + +We consider five variants of training for our models.•Standard training: The standard training procedure for the respective model architecture.•ℓ∞subscriptℓ\ell_{\infty}-bounded adversarial training: The classifier is trained on ℓ∞subscriptℓ\ell_{\infty}-bounded adversarial examples that are generated with projected gradient descent.•No random cropping: Standard training for CIFAR-10 and ImageNet includes data augmentation via random crops. We investigate the effect of this data augmentation scheme by also training a model without random crops.•Random rotations and translations: At each training step, we perform a uniformly random perturbation from the attack space on each training example.•Random rotations and translations from larger intervals: As before, we perform uniformly random perturbations, but now from a superset of the attack space (40​°40°40\degree, ±plus-or-minus\pm 13% pixels). + +We evaluate all models against random and grid search adversaries with rotations and translations considered both separately and together.We report the results in Table 1.We visualize a random subset of successful attacks in Figures 5, 6, and 7 of Appendix A. + +Despite the high accuracy of standard models on unperturbed examples and their reasonable performance on random perturbations, a grid search can significantly lower the classifiers’ accuracy on the test set.For the standard models, accuracy drops from 99% to 26% on MNIST, 93% to 3% on CIFAR10, and 76% to 31% on ImageNet (Top 1 accuracy). + +The addition of random rotations and translations during training greatly improves both the random and adversarial accuracy of the classifier for MNIST and CIFAR10, but less so for ImageNet.For the first two datasets, data augmentation increases the accuracy against a grid adversary by 60% to 70%, while the same data augmentation technique adds less than 3% accuracy on ImageNet. + +We perform a fine-grained investigation of our findings:•In Figure 3 we examine how many examples can be fooled by (i) rotations only, (ii) translations only, (iii) neither transformation, or (iv) both.•We visualize the set of fooling angles for a random sample of therotations-only grid in Figure 4 on ImageNet, and providemore examples in the appendix in Figure 10. We observe that the set of fooling angles is nonconvex and not contiguous.•To investigate how many transformations are adversarial per image, we analyze the percentage of misclassified grid points for each example in Figure 11.While the majority of images has only a small number of adversarial transformations, a significant fraction of images is fooled by 20% or more of the transformations. + +A natural question is whether the reduced accuracy of the models is due to the cropping applied during the transformation.We verify that this is not the case by applying zero and reflection padding to the image datasets.We note that the zero padding creates a “black canvas” version of the dataset, ensuring that no information from the original image is lost after a transformation.We show a random set of adversarial examples in this setting in Figure 8 and a full evaluation in Table 4.We also provide more details regarding reflection padding in Section B and provide an evaluation in Table 6.All of these are in Appendix A. + +In Table 2 we compare different attack methods on various classifiers and datasets.We observe that worst-of-10 is a powerful adversary despite its limited interaction with the target classifier.The first-order adversary performs significantly worse.It fails to approximate the ground-truth accuracy of the models and performs significantly worse than the grid adversary and even the worst-of-10 adversary. + +The fact that first-order methods fail to reliably find adversarial rotationsand translations is in sharp contrast to previous work onℓpsubscriptℓ𝑝\ell_{p}-robustness (Carlini & Wagner, 2017; Madry et al., 2018).For ℓpsubscriptℓ𝑝\ell_{p}-bounded perturbations parametrized directly in pixel space, prior work found the optimization landscape to be well-behaved which allowed first-order methods to consistently find maxima with high loss.In the case of spatial perturbations, we observe that the non-concavity of the problem is a significant barrier for first-order methods.We investigate this issue by visualizing the loss landscape.For a few random examples from the three datasets, we plot the cross-entropy loss of the examples as a function of translation and rotation.Figure 2 shows one example for each dataset and additional examples are visualized in Figure 12 of the appendix.The plots show that the loss landscape is indeed non-concave and contains many local maxima of low value.The low-dimensional problem structure seems to make non-concavity a crucial obstacle.Even for MNIST, where we observe fewer local maxima, the large flat regions prevent first-order methods from finding transformations of high loss. + +Given its limited interaction with the model, the worst-of-10 adversary achieves a significant reduction in classification accuracy.It performs only 10 random, non-adaptive queries to the model and is still able to find adversarial examples for a large fraction of the inputs (see Table 2).The low query complexity is an important baseline for black-box attacks on neural networks, which recently gained significant interest (Papernot et al., 2017; Chen et al., 2017; Bhagoji et al., 2017; Ilyas et al., 2018).Black-box attacks rely only function evaluations of the target classifier, without additional information such as gradients.The main challenge is to construct an adversarial example from a small number of queries.Our results show that it is possible to find adversarial rotations and translations for a significant fraction of inputs with very few queries. + +Table 1 shows that models trained to be robust toℓ∞subscriptℓ\ell_{\infty}-bounded perturbations do not achieve higher robustness to spatial perturbations.This provides evidence that the two families of perturbation are orthogonal to each other.We further investigate this possibility by considering a combined adversary that utilizes ℓ∞subscriptℓ\ell_{\infty}-bounded perturbations on top of rotations and translations.The results are shown in Figure 13.We indeed observe that these combined attacks reduce classification accuracy in an (approximately) additive manner. + +As we see in Table 1, training with a worst-of-10 adversary significantly increases the spatial robustness of the model, also compared to data augmentation with random transformations.We conjecture that using more reliable methods to compute the worst-case transformations will further improve these results.Unfortunately, increasing the number of random transformations per training example quickly becomes computationally expensive.And as pointed out above, current first-order methods also appear to be insufficient for finding worst-case transformations efficiently. + +Our results for majority-based inference are presented in Table 5 of Appendix A.By combining these two defenses, we improve the worst-case performance of the models from 26% to 98% on MNIST, from 3% to 82% on CIFAR10, and from 31% to 56% on ImageNet (Top 1). + +We examined the robustness of state-of-the-art image classifiers to translations and rotations.We observed that even a small number of randomly chosen perturbations of the input are sufficient to considerably degrade the classifier’s performance. + +The fact that common neural networks are vulnerable to simple and naturally occurring spatial transformations (and that these transformations can be found easily from just a few random tries) indicates that adversarial robustness should be a concern not only in a fully worst-case security setting.We conjecture that additional techniques need to be incorporated in the architecture and training procedures of modern classifiers to achieve worst-case spatial robustness.Also, our results underline the need to consider broader notions of similarity than only pixel-wise distances when studying adversarial misclassification attacks.In particular, we view combining the pixel-wise distances with rotations and translations as a next step towards the “right” notion of similarity in the context of images. \ No newline at end of file diff --git a/1712.02831v1.txt b/1712.02831v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..d46b80dd487c30c03c220e6e1bdd8cd59f4be15d --- /dev/null +++ b/1712.02831v1.txt @@ -0,0 +1,330 @@ +\section{Introduction} +Multi-relational data cannot be directly fed into traditional machine learning approaches such as logistic regression, SVMs, random forests, etc. +Statistical relational AI (StarAI) \cite{StarAI-Book} aims at developing models that work directly with relational data by capturing the interdependence among properties of the objects and the relationships they are involved in. + +In relational data, there are usually several classes of objects, each class has certain properties defined for its members, and there are (various) relationships among the objects. +Many works on learning from relational data focus only on predicting new relationships among objects given known relationships, and ignore predicting object properties. +For the works that do consider predicting object properties, a recent comparative study shows that none of them perform well and that this problem is still only poorly understood \cite{kazemi2017comparing}. In this paper, we focus (primarily) on predicting a property of the objects in one class based on the rest of the data (e.g., predicting the gender of people given the movies they like). This problem is challenging when the property of each object in the class depends on a varying number of other objects' properties and relationships. In the StarAI community, this problem is known as \emph{aggregation}. + +With numerous advances in learning deep networks for many different applications, using deep neural approaches for relational data has been the focus of several recent studies. In this paper, we develop a framework for learning first-order deep neural models to learn from and reason with relational data. +Our model is developed through deepening relational logistic regression (RLR) models \cite{Kazemi:2014}, the directed analogue of Markov logic \cite{Richardson:2006aa}, by enabling them to learn latent object properties both directly and through general rules, and connecting multiple RLR layers as a graph to produce relational neural networks (RelNNs). Similar to \cite{niepert2016learning,pham2017column}, we identify the relationship between our model and convolutional neural networks (ConvNets). Identifying this relationships allows RelNNs to be understood and implemented using well-known ConvNet primitives. +Each training iteration of RelNNs is order of the amount of data times the size of the RelNN, making RelNNs highly scalable. + +We evaluate RelNNs on three real-world datasets and compare them to well-know relational learning algorithms. +We show how RelNNs address a relational learning issue raised in \cite{Poole:2014} who showed that as the population size increases, the probabilities of many variables go to $0$ or $1$, making the model over-confident. +Obtained results indicate that RelNNs are promising models for relational learning. +\section{Relational Logistic Regression and Markov Logic Networks} +StarAI models aim at modelling the probabilities about relations among objects. Before knowing anything about the objects, these models treat them identically and apply tied parameters to them. In order to describe these models, first we need to introduce some definitions and terminologies. + +A {\bf population} is a finite set of {\bf objects}. +\textbf{Logical variables} (logvars) start with lower-case letters, and \textbf{constants} denoting objects start with upper-case letters. +Associated with a logvar $\lv{x}$ is a population $\pop{x}$ with $|\pop{x}|$ representing the cardinality of the population. +A lower-case letter in bold refers to a tuple of logvars. +An upper-case letter in bold refers to a tuple of constants. +An \textbf{atom} is of the form $\pred{S}(t_1, \dots, t_k)$ where $\pred{S}$ is a predicate symbol and each $t_i$ is a logvar or a constant. +We write a \textbf{substitution} as $\theta=\{\langle \lv{x_1}, \dots, \lv{x_k} \rangle \slash \langle t_1, \dots, t_k \rangle\}$ where each $\lv{x_i}$ is a different logvar and each $t_i$ is a logvar or a constant in $\pop{x_i}$. +A \textbf{grounding} of an atom with logvars $\{\lv{x_1}, \dots, \lv{x_k}\}$ is a substitution $\theta=\{\langle \lv{x_1}, \dots, \lv{x_k} \rangle \slash \langle \const{X_1}, \dots, \const{X_k} \rangle\}$ mapping each of its logvars $\lv{x_i}$ to an object $\const{X_i} \in \pop{x_i}$. Given a set $\atoms{A}$ of atoms, we denote by $\grounds{A}$ the set of all possible groundings for the atoms in $\atoms{A}$. +A \textbf{literal} is an atom or its negation. +A \textbf{formula} $\varphi$ is a literal, a disjunction $\varphi_1\vee\varphi_2$ of formulas or a conjunction $\varphi_1\wedge\varphi_2$ of formulas. +A \textbf{conjunctive formula} has no disjunctions. +Applying a \textbf{substitution} $\theta=\{\langle \lv{x_1}, \dots, \lv{x_k} \rangle \slash \langle t_1, \dots, t_k \rangle\}$ on a formula $\varphi$ (written as $\varphi\theta$) replaces each $\lv{x_i}$ in $\varphi$ with $t_i$. +A {\bf weighted formula (WF)} is a tuple $\WF{\varphi}{w}$ where $\varphi$ is a formula and $w$ is a weight. + +Let $\pred{Q}(\lvs{x})$ be an atom whose probability depends on a set $\atoms{A}$ (not containing $\pred{Q}$) of atoms (called the parents of \pred{Q}), $\psi$ be a set of WFs containing only atoms from $\atoms{A}$, $\hat{I}$ be a function from groundings in $\grounds{A}$ to truth values, $\inds{X}$ be an assignment of objects to $\lvs{x}$, and $\theta=\{\lvs{x} \slash \inds{X}\}$. +{\bf Relational logistic regression (RLR)} \cite{Kazemi:2014} defines the probability of $\pred{Q}(\inds{X})$ given $\hat{I}$ as follows: +\begin{align}\label{RLR-EQ} +Prob(\pred{Q}(\inds{X})=True \mid \hat{I}) = sigmoid\big(sum \big) +\end{align} +where, +\begin{align}\label{RLR-SUM} +sum = \sum_{\WF{\varphi}{w} \in \psi}{w * \counter{\varphi\theta}{\hat{I}}} +\end{align} +where $\counter{\varphi\theta}{\hat{I}}$ is the number of instances of $\varphi\theta$ that are true w.r.t. $\hat{I}$. +Note that $\counter{\true}{\hat{I}}=1$. Following \cite{Kazemi:2014}, w.l.o.g we assume the formulae of all WFs for RLR models are conjunctive. + +Markov logic networks (MLNs) \cite{Richardson:2006aa} use WFs to define a probability distribution over ground atoms. +As shown in \cite{Poole:2014}, when all groundings in $\grounds{A}$ are observed, an RLR model is identical to an MLN with corresponding WFs. We use RLR/MLN when the two models are identical. + +\begin{example}\label{happy-example} +Let \pred{Happy}(\lv{x}) be an atom which depends on $\atoms{A}=\{\pred{Friend}(\lv{x},\lv{y}), \pred{Kind}(\lv{y})\}$, and let $\hat{I}$ be a function from \grounds{A} to truth values. Let an RLR/MLN model define the conditional probability of \pred{Happy} using WFs in \fig{KindFriend}. +According to this model: +$Prob(\pred{Happy}(\ind{X})=True \mid \hat{I}) = sigmoid(-4.5 + 1*\counter{\pred{Friend}(\lv{y},\ind{X})\wedge \pred{Kind}(\lv{y})}{\hat{I}})$, +where $\counter{\pred{Friend}(\lv{y},\ind{X})\wedge \pred{Kind}(\lv{y})}{\hat{I}}= \#\ind{Y} \in \pop{y}$ s.t. $\pred{Friend}(\ind{Y},\ind{X}) \wedge \pred{Kind}(\ind{Y})$ according to $\hat{I}$, corresponding to the number of friends of $\ind{X}$ that are kind. When this count is greater than or equal to 5, the probability of $\ind{X}$ being happy is closer to one than zero; otherwise, the probability is closer to zero than one. Therefore, the two WFs model ``someone is happy if they have at least 5 friends that are kind''. +\end{example} + +\begin{figure} +\begin{center} +\includegraphics[width=\columnwidth]{KindFriend} +\end{center} +\caption{An RLR model taken from \cite{Kazemi:2014}.} +\label{KindFriend} +\end{figure} + +\textbf{Continuous atoms:} The RLR model defined above only works with Boolean or multi-valued parents. In order to allow for parents with continuous atoms, we use \citeauthor{fatemi2016learning} (\citeyear{fatemi2016learning})'s proposal. If \true\ and \false\ are associated with $1$ and $0$, $\wedge$ in WFs can be substituted with $*$. Then continuous atoms may be used in WFs. For example if for some $\ind{X} \in \pop{x}$ we have $\hat{I}(\pred{R}(\ind{X}))=1$, $\hat{I}(\pred{S}(\ind{X}))=0$, and $\hat{I}(\pred{T}(\lv{X}))=0.2$, then \WF{w}{\pred{R}(\ind{X}) *\pred{S}(\ind{X})} evaluates to $0$, \WF{w}{\pred{R}(\ind{X}) * \neg \pred{S}(\ind{X})} evaluates to $w$, and \WF{w}{\pred{R}(\ind{X}) * \neg \pred{S}(\ind{X}) * \pred{T}(\ind{X})} evaluates to $0.2*w$. + +\begin{figure*}[t] +\begin{center} +\includegraphics[width=0.9\textwidth]{RLR-RelNN} +\end{center} +\caption{An RLR and a RelNN models for predicting the gender of users in a movie rating system with a layer-wise architecture.} +\label{RLR-RelNN} +\end{figure*} +\section{Relational Neural Networks} +We encode RLR/MLN models with a layer-wise architecture by designing relational counterparts of the linear layer (LL), activation layer (AL), and error layer (EL) in neural networks. This enables building relational neural nets (RelNNs) by connecting several relational LLs and relational ALs as a graph. It also enables utilizing the \emph{back propagation} algorithm for training these models by adding a relational EL at the end of the graph, feeding the data forward, calculating the prediction errors, back propagating the derivatives with respect to errors, and updating the parameters. + +Let $\atoms{A_{\mathnormal{in}}}$ and $\atoms{A_{\mathnormal{out}}}$ represent two distinct sets of atoms, and $E$ represent an error function. +Let $\hat{I}$ be a function from $\pred{P}(\inds{X})\in\grounds{A_{\mathnormal{in}}}$ to values. Let $\hat{O}$ be a function from $\pred{Q}(\inds{X})\in\grounds{A_{\mathnormal{out}}}$ to values. Let $\Din$ be a function from $\pred{Q}(\inds{X})\in\grounds{A_{\mathnormal{out}}}$ to $\frac{\partial E}{\partial \pred{Q}(\inds{X})}$. Let $\Dout$ be a function from $\pred{P}(\inds{X})\in\grounds{A_{\mathnormal{in}}}$ to $\frac{\partial E}{\partial \pred{P}(\inds{X})}$. + +A \emph{layer} is a generic box that given $\hat{I}$ as input, outputs $\hat{O}$ based on $\hat{I}$ and its internal structure, and given $\Din$, updates its internal weights and outputs $\Dout$ using the chain rule. + +A \emph{relational linear unit} for an atom $\pred{Q}(\lvs{x})$ is identical to the linear part of RLR in Eq.~(\ref{RLR-SUM}). +A \emph{relational LL (RLL)} consists of $t$ $>$ $0$ \emph{relational linear units} with the $j$-th unit having atom $\pred{Q_j}(\lvs{x_j})$ and a set $\psi_j=\{\WF{w_{j1}}{\varphi_{j1}}, \WF{w_{j2}}{\varphi_{j2}}, \dots, \WF{w_{jm_j}}{\varphi_{jm_j}}\}$ of $m_j$ WFs. +$\atoms{A_{\mathnormal{in}}}$ for an RLL contains all atoms in $\psi_j$s and $\atoms{A_{\mathnormal{out}}}$ contains all $\pred{Q_j}(\lvs{x_j})$s. $\hat{I}$ comes from input data or from the layers directly connected to the RLL. +For any $\pred{Q}(\inds{X})\in\grounds{A_{\mathnormal{out}}}$, $\hat{O}(\pred{Q}(\inds{X}))$ is calculated using the linear part of Eq.~(\ref{RLR-EQ}) with respect to $\hat{I}$ and $\psi_j$. +An RLL can be seen as general rules with tied parameters applied to every object. + +\begin{example} +Consider an RLL with $\atoms{A_{\mathnormal{in}}}=\{\pred{Friend(\lv{x},\lv{y})},\pred{Kind(\lv{y})}\}$, $\atoms{A_{\mathnormal{out}}}=\{\pred{Happy}(\lv{x})\}$, and with the WFs in Example~\ref{happy-example}. +Suppose there are $10$ objects: $\pop{x}=\{\const{X_1}, \const{X_2}, \dots, \const{X_{10}}\}$. Let $\hat{I}$ be a function from $\grounds{A_{\mathnormal{in}}}$ to values according to which $\const{X_1}, \const{X_2}, \dots, \const{X_{10}}$ have $3$, $0$, $\dots$, and $7$ friends that are kind respectively. +$\hat{O}$ for this RLL is a function from groundings in $\grounds{A_{\mathnormal{out}}}$ to values as $\hat{O}(\pred{Happy}(\const{X_1})) \rightarrow -1.5, \hat{O}(\pred{Happy}(\const{X_2})) \rightarrow -4.5, \dots, \hat{O}(\pred{Happy}(\const{X_{10}}))\rightarrow 2.5$. +\end{example} + +Consider the $j$-th relational linear unit. +For each assignment of objects $\inds{X_{ju}}$ to $\lvs{x_j}$, let $\theta_{ju}=\{\lvs{x_j}\slash\inds{X_{ju}}\}$. +The derivative with respect to each weight $w_{jk}$ can be calculated as $\sum_{\inds{X_{ju}}} \counter{\varphi_{jk}\theta_{ju}}{\hat{I}} * \Din(Q_j(\inds{X_{ju}}))$. +To show how $\Dout$ is calculated, for ease of exposition we assume no predicate appears twice in a formula (i.e. no self-joins). +It is straight-forward to relax this assumption. +Let $\varphi\backslash \pred{P}$ represent formula $\varphi$ with any atom with predicate $\pred{P}$ (or its negation) removed from it. +For each assignment of objects $\inds{X_{iv}}$ to the logvars $\lvs{x_{i}}$ of \pred{P}, let $\theta_{iv}=\{\lvs{x_i}\slash\inds{X_{iv}}\}$. +Then $\Dout(\pred{P}(\inds{X_{iv}}))=\sum_{j}\sum_{\inds{X_{ju}}}\sum_{k=1,\pred{P}\in \varphi_{jk}}^{m_j} w_{jk} * \counter{((\varphi_{jk}\backslash \pred{P})\theta_{ju})\theta_{iv}}{\hat{I}} * \Din(\pred{Q_j}(\inds{X_{ju}}))$. + +The \emph{relational AL (RAL)} and \emph{relational EL (REL)} are similar to their non-relational counterparts. RAL applies an activation function $A$ (e.g., $sigmoid$, $tanh$, or $ReLU$) to its inputs and outputs the activations. REL compares the inputs to target labels, finds the prediction errors based on an error function $E$, and outputs the prediction errors made by the model for each target object. + +A \textbf{relational neural network (RelNN)} is a structure containing several RLL and RALs connected to each other as a graph. In our experiments, we consider the activation function to be the sigmoid function. During training, an REL is also added at the end of the sequence. +\fig{RLR-RelNN} represents an example of an RLR and a simple RelNN model for predicting the gender of users based on their age, occupation, and the movies they like. We use boxes with solid lines for RLLs and boxes with dashed lines for RALs. For the first RLL, $\atoms{A_{\mathnormal{in}}}=\{\pred{Likes}(\lv{u},\lv{m}), \pred{Action}(\lv{m}), \pred{Drama}(\lv{m})$\} and all values in $\hat{I}$ come from the observations. For this RLL, $\atoms{A_{\mathnormal{out}}}= \{\pred{S1}(\lv{u}), \pred{S2}(\lv{u})\}$. For the second RLL, $\atoms{A_{\mathnormal{in}}}=\{\pred{Old}(\lv{u}),\pred{Teacher}(\lv{u}),\pred{H1}(\lv{u}),\pred{H2}(\lv{u})\}$ and $\hat{I}$ for the first two atoms comes from observations, and for the last two comes from the layers directly connected to the RLL. +\fig{KDD15-RelNN} shows a more complicated RelNN structure for gender predicting in PAKDD-15 competition. + +\begin{figure*}[t] +\begin{center} +\includegraphics[width=0.85\textwidth]{RelNN_KDD2} +\end{center} +\caption{RelNN structure for predicting the gender in PAKDD15 dataset.} +\label{KDD15-RelNN} +\end{figure*} +\subsection{Motivations for hidden layers} +\begin{motivation} \label{motiv1} +Consider the model in \fig{RLR-RelNN}(a) and let $n_\const{U}$ represent the number of action movies that user $\const{U}$ likes. +As \citeauthor{Poole:2014} (\citeyear{Poole:2014}) point out, if the probability of maleness depends on $n_\const{U}$, as $n_\const{U}$ increases the probability of maleness either goes to $0$ or $1$. +This causes the model to become over-confident of its predictions when there exists many ratings and do a poor job, especially in terms of log loss. +This is, however, not the case for RelNNs. +In the RelNN model in \fig{RLR-RelNN}(b), the probability of maleness depends on $w_5*sigmoid(w_0 + w_1n_\const{U})$. +$w_1$ controls the steepness of the slope of the sigmoid, $w_0$ moves the slope around, and $w_5$ controls the importance of the slope in the final prediction. +With this model, as $n_\const{U}$ increases, the probability of maleness may converge to any number in the $[0,1]$ interval. Furthermore, this model enables learning of the critical zones. +\end{motivation} + +\begin{motivation} +Suppose the underlying truth for the models in \fig{RLR-RelNN} is that males correspond to users who like at least $p$ action movies such that each movie has less than $q$ likes. +A typical RLR/MLN model cannot learn such a model because first it needs to learn something about movies (i.e. having less than $q$ likes), combine it with being \emph{action} and count them. +However, this can be done using a RelNN (the hidden layer should contain a relational linear unit with atom $\pred{H}(\lv{m})$ and WFs \WF{w_1}{\pred{Likes}(\lv{u},\lv{m})} and \WF{w_2}{\true}). +Thus, hidden layers increase the modelling power by enabling the model to learn generic rules and categorize the objects accordingly, then treat objects in different categories differently. +\end{motivation} + +\begin{motivation} +\citeauthor{Kazemi:2014} (\citeyear{Kazemi:2014}) show how different types of existing explicit aggregators can be represented using RLR. +However, some of those cases (e.g., noisy-or and mode $=t$) require two RLLs and two RALs, i.e. RelNNs. +\end{motivation} +\subsection{Learning latent properties directly} +Objects may contain latent properties that cannot be specified using general rules, +but can be learned directly from data during training. +Such properties have proved effective in many tasks (e.g., recommendation systems \cite{koren2009matrix}). +These properties can be also viewed as soft clustering the objects into different categories. +We call the latent properties specifically learned for each object \emph{numeric latent properties} and the general latent properties learned through WFs in RLLs \emph{rule-based latent properties} to distinguish between the two. In the RelNN in \fig{KDD15-RelNN}, for instance, $\pred{S1}(\lv{i})$, $\pred{S4}(\lv{u})$ and $\pred{S7}(\lv{u})$ are the outputs of RALs and so are rule-based latent properties whereas $\pred{N2}(\lv{b})$ and $\pred{N4}(\lv{a})$ are numeric latent properties. + +Consider the models in \fig{RLR-RelNN} and let $\pred{Latent}(\lv{m})$ be a numeric latent property of the movies whose value is to be learned during training. +One may initialize $\pred{Latent}(\lv{m})$ with random values for each movie and add a WF \WF{w}{\pred{Likes}(\lv{u},\lv{m}) * \pred{Latent}(\lv{m})} to the first RLL. +As mentioned before, during the back propagation phase, an RLL provides the derivatives with respect to each of the inputs. +This means for each grounding $\pred{Latent}(\ind{M})$, we will have $\Dout(\pred{Latent}(\ind{M}))$. +Therefore, these numeric latent values can also be updated during learning using gradient descent. +\section{From ConvNet Primitives to RelNNs} +\citeauthor{niepert2016learning} (\citeyear{niepert2016learning}) and \citeauthor{pham2017column} (\citeyear{pham2017column}) explain why their relational learning models for graphs can be viewed as instances of ConvNet. We explain why RelNNs can also be viewed as an instance of ConvNets. Compared to prior work, we go into more details and provide more intuition. Such a connection offers the benefit of understanding and implementing RelNNs using ConvNet primitives. + +The cells in input matrices of ConvNets (e.g., image pixels) have spatial correlation and spatial redundancy: cells closer to each other are more dependent than cells farther away. +For instance if $M$ represents an input channel of an image, the dependence between $M[i,j]$ and $M[i+1,j+1]$ may be much more than the dependence between $M[i, j]$ and $M[i, j + 20]$. +To capture this type of dependency, convolution filters are usually small squared matrices. +Convolution filters contain tied parameters so different regions of the input matrices are treated identically. + +For relational data, the dependencies in the input matrices (the relationships) are different: the cells in the same row or column (i.e. relationships of the same object) have higher dependence than the cells in different rows and columns (i.e. relationships of different objects). +For instance for a matrix $L$ representing which users like which movies, the dependence between $L[i,j]$ and $L[i+1, j+1]$ (different people and movies) may be far less than the dependence between $L[i, j]$ and $L[i, j + 20]$ (same person and different movies). +A priori, all rows and columns of the input matrices are exchangeable. +Therefore, to adapt ConvNets for relational data, we need vector-shaped filters that are invariant to row and column swapping and better capture the relational dependence and the exchangeability assumption. + +One way to modify ConvNets to be applicable to relational data is as follows. +We consider relationships as inputs to the network. +We apply vector-shaped convolution filters on the rows and columns of the relationship matrices. +For instance for gender prediction from movie ratings, a convolution filter may be a vector with size equal to the number of the movies. +The values of these filters can be learned during training (like ConvNet filters), or can be fixed in which case they correspond to observed properties (e.g., a vector representing which movies are action movies). +Convolving each filter with each matrix produces a vector. These vectors go through an activation layer and are used as a filter in the next layers. +Besides convolving a filter with a matrix, one can join two matrices and produce a new matrix for the next layer. Joining two matrices $R(x, m)$ and $T(m, a)$ produces a new matrix $S(x, a)$ where for some $X \in x$ and $A \in a$, $S(X, A)=\sum_{M \in m} R(X, M)*T(M,A)$. +The filters in the next layers can be applied to either input matrices, or the ones generated in previous layers. +By constructing an architecture and training the network, the learned filters identify low and high level features from the input matrices. + +While these operations are modifications of ConvNet operations, they all correspond to the operations in our RLR/MLN perspective. +Vector-shaped filters correspond to including numeric latent properties in WFs. +Fixed filters correspond to including observed atoms with a single logvar in WFs. +Joining matrices corresponds to using two binary atoms in a WF. + +\begin{figure*}[t] +\begin{center} +\includegraphics[width=\textwidth]{RelCNN} +\end{center} +\caption{An example of a layer of a RelNN demonstrated with ConvNet operations.} +\label{RelCNN} +\end{figure*} + +\begin{example} +Suppose we want to predict the gender of users in a movie rating system based on the movies they like, whether the movie is action or not, and whether the user is old or not. \fig{RelCNN} shows one layer of a RelNN for this problem in terms of ConvNet operations. The binary relation $\pred{Likes}(\lv{u}, \lv{m})$ is considered as the input. Three filters have been applied to this matrix: one filter with fixed values corresponding to $\pred{Action}(\lv{m})$, one filter with fixed values corresponding to $\pred{Old(\lv{u})}$, and one filter to be learned corresponding to a numeric latent property $\pred{N}(\lv{m})$. Note that $\pred{Action}(\lv{m})$ and $\pred{N}(\lv{m})$ are row-shaped filters and $\pred{Old}(\lv{u})$ is column-shaped. Convolving these filters with $\pred{Likes}(\lv{u}, \lv{m})$ and sending the resulting vectors through an activation layer is equivalent to having an RLL with three relational linear units: the first unit contains: +\begin{center} +$\WF{\true}{w_0}$\\ +$\WF{\pred{Likes}(\lv{u}, \lv{m})*\pred{Action}(\lv{m})}{w_1}$ +\end{center} +and the other ones have $\pred{Old(\lv{u})}$ and $\pred{N}(\lv{m})$ instead of $\pred{Action}(\lv{m})$ respectively. The obtained vectors after activation can be used as filters for the next layers, or for making the final predictions. +\end{example} +\section{Empirical Results} +\label{experiments-section-RelNNs} +In our experiments, we tend to answer these questions: \textbf{Q1:} how does RelNN's performance compare to other well-known relational learning algorithms, \textbf{Q2:} how numeric and rule-based latent properties affect the performance of the RelNNs, and \textbf{Q3:} how well RelNNs extrapolate to unseen cases and address the population size issue pointed out in \cite{Poole:2014} and discussed in Motivation~\ref{motiv1}. + +\textbf{Datasets:} We use three real-world datasets in our experiments. Our first dataset is the Movielens 1M dataset \cite{harper2015movielens} ignoring the actual ratings and only considering if a movie has been rated or not, and considering only action and drama genres. Our second dataset is from PAKDD15 gender prediction competition\footnote{\url{https://knowledgepit.fedcsis.org/contest/view.php?id=107}} but we only considered the $A$, $B$, and $C$ prefixes of the items and ignored the $D$ prefix because each $D$ prefix is on average seen by $\approx 1.5$ people. We also ignored the information within the sequence of the items viewed by each user. Our third dataset contains all Chinese and Mexican restaurants in Yelp dataset challenge\footnote{\url{https://www.yelp.com/dataset_challenge}} (ignoring the ones that have both Chinese and Mexican foods), and the task is to predict if a restaurant is Chinese or Mexican given the people who reviewed them, and whether they have fast food and/or seafoods or not. + +\begin{table*}[t] +\scriptsize + \caption{Performance of different learning algorithms based on accuracy, log loss, and MSE $\pm$ standard deviation on three different tasks. \emph{NA} means the method is not directly applicable to the prediction task/dataset. The best performing method is shown in bold. For models where standard deviation was zero, we did not report it in the table. + } + \label{comparison-results} + \centering + \begin{tabular}{cccccccc} + \toprule + & & \multicolumn{6}{c}{Learning Algorithm} \\ + \cmidrule{3-8} + Task & Measure & Mean & Matrix Factorization & Collaborative Filtering & RDN-Boost & RLR/MLN & RelNN \\ + \midrule + MovieLens & \multicolumn{1}{c|}{Accuracy} & 0.7088 & 0.7550 $\pm$ 0.0073 & 0.7510 & 0.7234 & 0.7073 $\pm$ 0.0067 & \textbf{0.7902 $\pm$ 0.0051}\\ + Gender & \multicolumn{1}{c|}{Log Loss} & 0.8706 & 0.7318 $\pm$ 0.0073 & 0.7360 & 0.8143 & 0.8441 $\pm$ 0.0255 & \textbf{0.6548 $\pm$ 0.0026} \\ + & \multicolumn{1}{c|}{MSE} & 0.2065 & 0.1649 $\pm$ 0.0026 & 0.1675 & 0.1904 & 0.1987 $\pm$ 0.0067 & \textbf{0.1459 $\pm$ 0.0009} \\ + + \midrule + + PAKDD & \multicolumn{1}{c|}{Accuracy} & 0.7778 & NA & 0.8806 & 0.7778 & 0.8145 $\pm$ 0.0388 & \textbf{0.8853 $\pm$ 0.0002}\\ + Gender & \multicolumn{1}{c|}{Log Loss} & 0.7641 & NA & 0.5135 & 0.8039 & 0.7224 $\pm$ 0.0548 & \textbf{0.5093 $\pm$ 0.0037}\\ + & \multicolumn{1}{c|}{MSE} & 0.1728 & NA & 0.1026 & 0.1842 & 0.1522 $\pm$ 0.0185 & \textbf{0.1009 $\pm$ 0.0008}\\ + \midrule + + Yelp & \multicolumn{1}{c|}{Accuracy} & 0.6168 & 0.6154 $\pm$ 0.0041 & 0.6712 & 0.6156 & 0.6168 $\pm$ 0.000 & \textbf{0.6927 $\pm$ 0.0077}\\ + Business & \multicolumn{1}{c|}{Log Loss} & 0.9604 & 0.9394 $\pm$ 0.0033 & 0.8757 & 0.9458 & 0.9435 $\pm$ 0.0034 & \textbf{0.8531 $\pm$ 0.0090}\\ + Prediction & \multicolumn{1}{c|}{MSE} & 0.2364 & 0.2300 $\pm$ 0.0012 & 0.2084 & 0.2316 & 0.2309 $\pm$ 0.0010 & \textbf{0.2023 $\pm$ 0.0024}\\ + \midrule + + MovieLens Age & \multicolumn{1}{c|}{MSE} & 156.0507 & 104.5967 $\pm$ 0.9978 & 90.8742 & NA & 156.0507 $\pm$ 0.000 & \textbf{62.7000 $\pm$ 0.7812}\\ + \bottomrule + \end{tabular} +\end{table*} + +\begin{figure*}[t] +\begin{center} +\includegraphics[width=0.6\textwidth]{RelNN_Yelp} +\end{center} +\caption{RelNN structure used for Yelp dataset. $\pred{N}1(\lv{u})$ and $\pred{N}2(\lv{u})$ are numeric latent properties.} +\label{Yelp-RelNN} +\end{figure*} + +\textbf{Learning algorithms and learning methodology:} Traditional machine learning approaches are not directly applicable to our problems. Also due to the large size of the datasets, some relational models do not scale to our problems. For instance, we tried Problog \cite{DeRaedt:2007}, but the software crashed after running for a few days even for simple models. The reason for scalability issues with many existing models (e.g., MLNs and Problog) is because they consider probabilistic (instead of neural) units and do inference and learning using EM. It took a day for an analogous EM-based implementation of RelNNs to learn a model for a synthetic dataset with 100 relations, whereas our current model (which is neural and uses back propagation) took under an hour for a million relations. We tried several baselines and only reported the ones that performed best on our datasets. \citeauthor{kazemi2017comparing} (\citeyear{kazemi2017comparing}) explain why each of the existing baselines for aggregation perform poorly and why this problem is still poorly understood. + +In our baselines, \emph{mean} corresponds to always predicting the mean of the training data. The \emph{matrix factorization} corresponds to the best performing matrix factorization model according to \citeauthor{kazemi2017comparing} (\citeyear{kazemi2017comparing})'s experiments: the relation matrix is factorized into object latent properties using the factorization technique in \cite{koren2009matrix}, then, using Weka \cite{hall2009weka}, a linear/logistic regression model is learned over the latent and observed properties of the target objects. We also tried several other variants (including RESCAL's algorithm \cite{nickel2012factorizing}), but \citeauthor{kazemi2017comparing} (\citeyear{kazemi2017comparing})'s model was the best performing. The \emph{RDN-Boost} \cite{natarajan2012gradient} model can be viewed as an extension of random forests with ways to aggregate over multiple observations, thus enabling random forests to be applicable to relational data. The \emph{k-nearest neighbors collaborative filtering} model finds $k$ objects with observed labels that are similar to the target object in terms of the relationships they participate in, creates a feature as the weighted mean of the labels of the similar objects, and feeds this label along with other features of the target object to a classification/regression model. For MovieLens and Yelp datasets, collaborative filtering produces one feature and for PAKDD dataset, it produces three features, one for each item prefix. We used cosine similarity function. The value of $k$ was set using cross validation. Similar to matrix factorization, linear and logistic regression of Weka were used for classification and regression. + +For all RelNN and RLR/MLN models in our experiments, we used fixed structures (i.e. fixed set of WFs and connections among them) and learned the parameters using back-propagation with multiple restarts. The structure of the RelNN model for Movielens dataset is that of \fig{RLR-RelNN}(b) extended to include all ages and occupations with $2$ numeric latent properties, $3$ RLLs and $3$ RALs. The structure of the RelNN model used for PAKDD15 and Yelp datasets is as in \fig{KDD15-RelNN} and \fig{Yelp-RelNN} respectively. +We leave the problem of learning these structures automatically from data as future work. +The structure of the RLR/MLN models are similar to the RelNN models but without hidden layers and numeric latent properties. Back propagation for the RLR/MLN case corresponds to the discriminative parameter learning of \cite{Huynh:2008}. To avoid numerical inconsistencies when applying our models to PAKDD15 dataset, we assumed there exist a male and a female in the training set who have viewed all items. For all experiments, we split the data into 80/20 percent train/test. + +We imposed a Laplacian prior on all our parameters (weights and numeric latent properties). +For classification, we further regularized our model predictions towards the mean of the training set using a hyper-parameter $\lambda$ as: +$Prob = \lambda * mean + (1 - \lambda) * (ModelSignal)$. +This regularization alleviates the over-confidence of the model and avoids numerical inconsistencies arising when taking the logs of the predictions. Note that this regularization corresponds to adding an extra layer to the network. +We reported the \emph{accuracy} indicating the percentage of correctly classified instances, the \emph{mean squared errors (MSE)}, and the \emph{log loss}. +We conducted each experiment 10 times and reported the mean and standard deviation. + +\textbf{Experiments:} Our experiments include predicting the gender for the Movielens and PAKDD15 datasets, predicting the age for Movielens dataset, and predicting the type of food for the Yelp restaurants dataset. +Even though the age is divided into 7 categories in the MovieLens dataset, we assume it is a continuous variable to see how RelNNs perform in predicting continuous variables. +To make the categories more realistic, for people in age category/interval [i, j], we assume the age is $(i+j)/2$, i.e. the mean of the interval. +For the first and last categories, we used $16$ and $60$ as the ages. + +Table~\ref{comparison-results} compares RelNNs with other well-known relational learning algorithms as well as a baseline. +It can be viewed from the table how RelNNs outperform well-known relational learning models in terms of all three performance metrics. Note that all baselines use the same observed features. Manual feature engineering from relations is very difficult, so the challenge for the models is to extract useful features from relations. As explained in \cite{kazemi2017comparing}, the problem with the baselines is with their lower modeling power and inappropriate implicit assumptions, and not with engineering features. +The results in Table~\ref{comparison-results} answer \textbf{Q1}. + +For \textbf{Q2}, we changed the number of hidden layers and numeric latent properties in RelNN to see how they affect the performance. +The obtained results for predicting the gender and age in the Movielens dataset can be viewed in \fig{GenderResults}. +The results show that both hidden layers and numeric latent properties (especially the first one of each) have a great impact on the performance of the model. +When hidden layers are added, as we conjectured in motivation~\ref{motiv1}, the log loss and MSE improve substantially as the over-confidence of the model decreases. +Note that adding layers only adds a constant number of parameters, but adding $k$ numeric latent properties adds $k * |\pop{m}|$ parameters. In \fig{GenderResults}, a RelNN with 2 hidden layers and 1 numeric latent property has many fewer parameters than a MLN/RLR with no hidden layers and 2 numeric latent properties, but outperforms it. + +\begin{figure}[t] +\begin{center} +\includegraphics[width=\columnwidth]{latents} +\end{center} +\caption{Predicting (a) gender and (b) age on MovieLens using RelNNs with different number of numeric latent properties and hidden layers.} +\label{GenderResults} +\end{figure} + +For \textbf{Q3}, we conduct two experiments: 1- we train a RelNN on a large population, and test it on a small population, and 2- we train a RelNN on a small population and test it on a large population. +The first experiment can be also seen as how severely each model suffers from the cold start problem. +The second experiment can be also seen as how well these models extrapolate to larger populations. +For the first experiment, we trained two models for predicting the gender of the users in the MovieLens dataset both containing one numeric latent property, but one containing no hidden layers and the other containing one hidden layer. +We only gave the first $k$ ratings of the test users to the model and recorded the log loss of the two models. We did this for different values of $k$ and plotted the results. Obtained results can be viewed in \fig{Extrapolation1}. +Note that since in MovieLens dataset all users have rated at least 20 movies, the model has not seen a case where a user has rated less than $20$ movies. That is, the model has been trained on large population sizes ($\geq 20$). In this experiment, the cases in \fig{Extrapolation1} where $k < 20$ correspond to small populations (and cold start). + +When $k=0$ (i.e. we ignored all ratings of the test users), both models had almost the same performance ($log loss \approx -0.9176$)\footnote{This is not shown in the diagram in \fig{Extrapolation1} as the x-axis of the diagram is in log scale.}. +As soon as we add one rating for the test users, the performance of RelNN substantially improves, but the performance of the RLR/MLN model is not affected much. +According to the plot, the gap between the two models is more when the test users have fewer ratings (i.e. unseen cases), but it gets less and becomes steady as the number of ratings increases and becomes closer to the number of ratings in the train set. + +\begin{figure}[t] +\begin{center} +\includegraphics[width=0.8\columnwidth]{Extra} +\end{center} +\caption{Results on predicting the gender when we only use the first $k$ (on the x-axis) ratings of the test users and use all ratings in train set for learning.} +\label{Extrapolation1} +\end{figure} + +\begin{figure}[t] +\begin{center} +\includegraphics[width=0.8\columnwidth]{Extra2} +\end{center} +\caption{Results on predicting the gender when we only use the first $k$ (on the x-axis) ratings of the test users and use $0\leq r \leq20$ ratings of each user ($r$ is generated randomly for each user) in the train set for learning.} +\label{Extrapolation2} +\end{figure} + +For the second experiment, for each user in the train set we kept only the first $r$ ratings where $0\leq r \leq 20$ was generated randomly for each user. +For the new dataset, we repeated the previous experiment and obtained the diagram in \fig{Extrapolation2}. +It can be viewed in this diagram that the RLR/MLN model works best when we keep the first $15$ ratings of the test users (i.e. $k=15$), but for higher values of $k$, its performance starts to deteriorate. +The performance of the RelNN model, on the other hand, improves even until $k=30$. +After this point as $k$ increases, the performance of both models deteriorates, but the gap between the two models becomes much more for larger values of $k$, as the RLR/MLN model becomes over-confident. +These results validate the hypothesis in \cite{Poole:2014} that as the population size grows, RLR/MLN becomes over-confident and predicts with probabilities close to $0$ and $1$. The results also show how RelNNs address this issue and validate our Motivation~\ref{motiv1}. +\section{Related Work} +Recently, there has been a great body of research on learning from relational data using \emph{tensor factorization}. These methods learn embeddings for each object and each relationship. The probability of two objects participating in a relation is a simple function of the objects' and relation's embeddings (e.g., the sum of the element-wise product of the embeddings). Well-known tensor factorization works include \cite{nickel2012factorizing,bordes2013translating,socher2013reasoning,neelakantan2015compositional,trouillon2016complex} with a recent survey in \cite{nguyen2017overview}. Except RESCAL \cite{nickel2012factorizing}, all other works along this line only focus on predicting new relations from existing ones (cf. \cite{nickel2016review} section X.A). As described in \cite{kazemi2017comparing}, for aggregation problems studied in this work, RESCAL's proposal ends up memorizing the training labels and does not generalize to unseen cases. The same issue exists for other tensor factorization algorithms thus making them unsuitable for aggregation. + +Besides tensor factorization models, several other relational learning models only focus on predicting relations and ignore properties, or, relying on embeddings, suffer from the same issues as tensor factorization algorithms. Examples of these works include path-constrained random walks (e.g., \cite{lao2010relational,lao2011random}), and several hybrid approaches (e.g., \cite{das2016chains,rocktaschel2017end,yang2017differentiable,wang2017relational}). + +Several works on predicting object properties based on deep learning consider only a subset of relational data such as set data \cite{zaheer2017deep} or graph data \cite{pham2017column} (where there can be multiple relationships among objects, but all objects belong to the same class). Several works on predicting object properties are based on recurrent neural networks (RNNs) (see e.g., \cite{uwents2005classifying,moore2017deep}). \citeauthor{zaheer2017deep} (\citeyear{zaheer2017deep}) show that RNN based methods do not perform well for set data (a restricted form of relational data) as RNN-based models consider the input data to be a sequence and do not generalize to unseen orders. + +When a target variable depends on a population, the \emph{rule combining} \cite{kersting2001adaptive,natarajan2010exploiting} approaches learn a distribution $D$ for the target given only one object in the population, and then combine these distributions using an explicit aggregator (e.g., \emph{mean} or \emph{noisy-OR}). These models have three limitations compared to RelNNs: 1- they correspond to only two (non-flexible) layers, one for learning $D$ and one for combining the predictions, 2- since $D$ is learned separately for each object in the population, the interdependence among these objects is ignored, and 3- they rely on explicit aggregation function rather than learning the aggregator from the data. + +\emph{Predicate invention} approaches \cite{kemp2006learning,kok2007statistical} cluster the objects, their properties, and relationships such that the values of the target(s) depends on their clustering. +Such a clustering can be implemented as one layer of a RelNN. Since latent variables in these works are probabilistic (rather than neural as in RelNNs), these works typically result in expensive models such that in practice clustering is limited to hard rather than soft clusters, and they have been applied to small domains with around $10k$ observations (which is far less than, say, the $1M$ observations in our datasets). + +There are also several other works for learning deep networks from relational data, but they are all limited in terms of modelling power or scalability. The works in \cite{garcez2012neural,francca2014fast,serafini2016logic}, for instance, propositionalize the data and miss the chance to learn specifically about objects. We show in our experiments that learning about objects substantially improves performance. \citeauthor{lodhi2013deep} (\citeyear{lodhi2013deep}) first learns features from relational data then feeds it into a standard neural network, thus learning features and the model independently. The same issue exists with methods such as DeepWalk \cite{perozzi2014deepwalk} which first learn embeddings for nodes regardless of the prediction task, and then use the embeddings for making predictions. \citeauthor{vsourek2015lifted} (\citeyear{vsourek2015lifted})'s models are the closest proposals to RelNNs, but RelNNs are more flexible in terms of adding new types of layers in a modular way. +These works are also limited in one or more of the following ways: 1- the model is limited to only one input relation, 2- the structure of the model is highly dependent on the input data, 3- the model allows for only one hidden layer, 4- the model cannot learn hidden object properties through general rules, or 5- the model does not scale to large domains. +\section{Conclusion} +In this paper, we developed a deep neural model for learning from relational data. We showed that our model outperforms several existing models on three relational learning benchmarks. Our work can be advanced in several ways. +The current implementation of our model is a fresh non-parallelized code. It could be speeded up by parallelization (e.g., by using TensorFlow \cite{TensorFlow} as backbone), by compilation relational operations to lower-level languages (similar to \cite{LRC2CPP}), or by using advanced database query operations. +Learning the structure of the RelNN and the WFs automatically from data (e.g., by extending the structure learning algorithm in \cite{fatemi2016learning}), developing and adding relational versions of regularization techniques such as (relational) dropout \cite{dropout,kazemi2017comparing} and batch normalization \cite{ioffe2015batch} are other directions for future research. + +\bibliography{MyBib} +\bibliographystyle{AAAI} diff --git a/1712.02979v1.txt b/1712.02979v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..fb4f39b4acd78650afcf27b897ad31a4a2b8cfe0 --- /dev/null +++ b/1712.02979v1.txt @@ -0,0 +1,588 @@ +\section{Introduction} +Data clustering is one of the most fundamental topics in unsupervised learning and has been widely applied in computer vision, data mining and many others. Clustering aims to divide the unlabeled data +set into groups which consist of similar data points. +Many clustering methods have been proposed up to now, +e.g. k-means, spectral clustering \cite{ng2002spectral,shi2000normalized} and nonnegative +matrix factorization \cite{lee2001algorithms}. The Spectral Clustering (SC) is one of the most widely used methods and it has a lot of applications in computer vision and signal analysis, e.g., image segmentation \cite{shi2000normalized}, motion segmentation \cite{lu2012robust}, and co-clustering problems of words and documents \cite{dhillon2001co}. + +Assume that we are given $n$ data points $X=[x_1,\cdots,x_n]=[X_1,\cdots,X_k]\in\mathbb{R}^{d\times n}$, where $X_j\in\mathbb{R}^{d\times n_j}$ denotes the $j$-th group with $n_j$ points, $\sum_{j=1}^kn_j=n$ and $k$ is the number of clusters. SC \cite{ng2002spectral} partitions these $n$ points into $k$ clusters by the following procedures: First, +compute an affinity matrix $W\in\mathbb{R}^{n\times n}$ with its element $w_{ij}$ measuring the similarity between $x_i$ and $x_j$. Second, construct the normalized Laplacian matrix $L=I-D^{-\frac{1}{2}}W D^{-\frac{1}{2}}$, where $D$ is a diagonal matrix with each diagonal element $d_{ii}=\sum_{j=1}^nw_{ij}$ and $I$ is the identity matrix. Third, compute $U\in\mathbb{R}^{n\times k}$ by solving +\begin{equation}\label{sc} +\min_{U\in\mathbb{R}^{n\times k}} \ \langle UU^\top,L\rangle, \ \st \ U^\top U=I. +\end{equation} +Finally, compute $\hat{ U}\in\mathbb{R}^{n\times k}$ by normalizing each row of $ U$ to have unit Euclidean length, treat the rows of $\hat{ U}$ as data points in $\mathbb{R}^k$, and cluster them into $k$ groups by k-means. +Due to the significance of SC, many variants of SC have been proposed based on different ways of affinity matrix $W$ construction and different normalizations of the Laplacian matrix $L$ \cite{shi2000normalized,von2007tutorial}. + +A recent work \cite{lu2016convex} proposes the Sparse Spectral Clustering (SSC) method which computes the low-dimensional embedding $U$ in a different way: +\begin{align}\label{ssc0} +\min_{U\in\mathbb{R}^{n\times k}} \ \inproduct{L}{\UU} + \beta \norm{\UU}_0, \ \st \ U^\top U=I, +\end{align} +where $\beta>0$ and $\norm{\cdot}_0$ is the $\ell_0$-norm which encourages $\UU$ to be sparse. The motivation for such a sparse regularizer is that $\UU$ is block diagonal (thus sparse) when $W$ is block diagonal in the ideal case. +Consider the ideal case that the affinity matrix $W$ is block diagonal, i.e., $w_{ij}=0$ if $x_i$ and $x_j$ are from different clusters. Let $C\in\mathbb{R}^{n\times k}$ denotes the indicator matrix whose row entries indicate to which group the points belong. That is, if $x_i$ belongs to the group $l$, $c_{il}=1$ and $c_{ij}=0$ for all $j\neq l$. Then, for any orthogonal matrix $R\in\mathbb{R}^{k\times k}$, we have $\hat{U}=C R$. +In this case, $ \hatU\hatU^\top$ is block diagonal, i.e., +\begin{equation*} +\hatU\hatU^\top=CC^\top=\begin{bmatrix} +\1_{n_1}\1_{n_1}^\top & \0 & \cdots & \0 \\ +\0 & \1_{n_2}\1_{n_2}^\top & \cdots & \0 \\ +\vdots & \vdots & \ddots & \vdots \\ +\0 & \0 & \cdots & \1_{n_k}\1_{n_k}^\top +\end{bmatrix}, +\end{equation*} +where $\1_m$ denotes the all one vector of length $m$ and $\0$ is all one vector/matrix of proper size. +Hence, $\hatU\hatU^\top$ implies the true membership of the data clusters and it is naturally {sparse}. Note that $\hat{U}$ is obtained by normalizing each row of $U$ and thus $\UU$ is also sparse. However, such a block diagonal or sparse property may not appear in real applications since the affinity matrix $W$ is usually not block diagonal. This motivates the sparse regularization on $\UU$ and thus leads to the SSC model in (\ref{ssc0}). However, the key challenge is that problem (\ref{ssc0}) is nonconvex and difficult to solve. The work \cite{lu2016convex} proposes a convex relaxation formulation as follows +\begin{equation}\label{cssc} +\min_{ P\in\mathbb{R}^{n\times n}} \langle P,L\rangle+\beta\|P\|_1, \ \ \text{s.t.} \ \ \0\preceq P\preceq I,\ \Tr(P)=k, +\end{equation} +where the $\ell_1$-norm $\norm{\cdot}_1$ is used as a surrogate of $\ell_0$-norm while the nonconvex constraint consisting of all the fixed rank projection matrices, i.e., $\{\UU|U^\top U=I\}$, is replaced as its convex hull $\{P\in\mathbb{S}^{n\times n}| 0\preceq P\preceq I, \Tr(P)=k\}$ \cite{fillmore1971some}. Here, $\mathbb{S}^n$ denotes the set of symmetric matrices. For $A,B\in\mathbb{S}^n$, $A\preceq B$ means that $B-A$ is positive semi-definite. Problem (\ref{cssc}) is convex and the optimal solution can be computed by Alternating Direction Method of Multipliers (ADMM) \cite{gabay1976dual,lu2017unified}, which is efficient in practice. +After solving (\ref{cssc}) with the solution $P^*$, the low-dimensional embedding $U$ of data $X$ can be approximated by using the first $k$ eigenvectors corresponding to the largest $k$ eigenvalues of $P$. This is equivalent to computing $U$ by solving +\begin{equation}\label{computUssc} +\min_{U\in\mathbb{R}^{n\times k}} \ \norm{P^* - \UU}, \ \st \ U^\top U = I, +\end{equation} +where $\norm{\cdot}$ denotes the Frobenius norm of a matrix. +After obtaining $U$, one is able to cluster the data points into $k$ groups as that in SC. + + +From the above discussions, it can be seen that a main limitation of the convex SSC relaxation (\ref{cssc}) is that the obtained solution may be far from optimal to (\ref{ssc0}). The reason is that the difference $\norm{P^* - \UU}$ in (\ref{computUssc}) is not guaranteed to be 0 or sufficiently small. Thus, enforcing $P$ to be sparse in (\ref{cssc}) does not guarantee a sparse $\UU$ in (\ref{computUssc}). It is obvious that such an issue is mainly caused by the usage of the relaxation of the convex hull $\{P\in\mathbb{S}^{n\times n}| 0\preceq P\preceq I, \Tr(P)=k\}$ instead of $\{\UU|U^\top U=I\}$. + +In this work, we aim to address the above possibly loose relaxation issue of the convex SSC model by directly solving the following nonconvex problem +\begin{align}\label{ncvxssc} +\min_{U\in\mathbb{R}^{n\times k}} \ \inproduct{L}{\UU} + g(\UU), \ \st \ U^\top U=I, +\end{align} +where $g:\mathbb{R}^{n\times n}\rightarrow \mathbb{R}$ is a sparse regularizer. The choice of the spare regularizer is not very important in SSC. We allow $g$ to be nonconvex (see more detailed assumption in the next section). Problem (\ref{ncvxssc}) is nonconvex and challenging to solve due to the orthogonal constraint and the complex term $g(\UU)$. This work proposes to solve it by Alternating Direction Method of Multipliers (ADMM) and provide the convergence guarantee. Our proposed ADMM is flexible as we allow the stepsize in ADMM to be monotonically increasing (but upper bounded). Such a choice of stepsize is widely used and has been verified to be effective in improving the convergence of ADMM for convex optimization. Note that we are the first one to use such a choice of stepsize in ADMM for nonconvex problems and provide its support in theory. When characterizing the convergence of ADMM, we show that the augmented Lagrangian function value is monotonically decreasing. This further guarantees that the sequences generated by the proposed ADMM are bounded and there always exists a limit point and any limit point is a stationary point. + + + +\begin{algorithm}[t] + \caption{Solve (\ref{pro}) by ADMM} + \textbf{Initialize:} $\rho>1$, $\mu_{\max}$, $k=0$, $\Pk$, $\Uk$, $\Yk$, $\muk$. \\ + \textbf{while} not converged \textbf{do} + \begin{enumerate} + \item Compute $\Ukk$ by solving (\ref{updateU}); + \item Compute $\Pkk$ by solving (\ref{updateP}); + \item Compute $\Ykk$ by (\ref{updateY}); + \item Compute $\mukk$ by (\ref{updatemu}); + \item $k=k+1$. + \end{enumerate} + \textbf{end while}\label{admm} +\end{algorithm} +\section{The Proposed ADMM Algorithm} +In this section, we present the ADMM algorithm for solving the nonconvex problem (\ref{ncvxssc}). We first reformulate it as the following equivalent problem +\begin{equation}\label{pro} +\begin{split} +&\min_{P\in\mathbb{R}^{n\times n},U\in\mathbb{R}^{n\times k}} \ \inproduct{L}{\UU} + g(P), \\ +& \st \ P = \UU, \ U^\top U=I. +\end{split} +\end{equation} +The standard augmented Lagrangian function is +\begin{align*} +&\Lag(P,U,Y_1,Y_2,\mu) = \inproduct{L}{\UU} + g(P) + \inproduct{Y_1}{P-\UU}\notag \\ +&+\inproduct{Y_2}{\UU-I} + \frac{\mu}{2} \norm{P-\UU}^2 + \frac{\mu}{2} \norm{U^\top U-I}^2, +\end{align*} +where $Y_1$ and $Y_2$ are the dual variables and $\mu>0$. However, it is difficult to update $U$ by minimizing the above augmented Lagrangian function when fixing other variables. To update $U$ efficiently, we instead use the following +\emph{partial} augmented Lagrangian function +\begin{align} +\Lag(P,U,Y,\mu) = & \inproduct{L}{\UU} + g(P) + \inproduct{Y}{P-\UU}\notag \\ +& + \frac{\mu}{2} \norm{P-\UU}^2. +\end{align} +Then we can solve problem (\ref{pro}) by Alternating Direction Method of Multipliers by the following rules. + +\noindent 1. Fix $P=\Pk$ and update $U$ by +\begin{align} +\Ukk = & \argmin_{U\in\mathbb{R}^{n\times k}} \ \Lag(\Pk,U,\Yk,\muk), \ \st \ U^\top U=I. \notag \\ += & \argmin_{U} \ \norm{\UU - \Pk +(L-\Yk)/\muk }^2, \label{updateU}\\ +& \st \ U^\top U=I. \notag +\end{align} +2. Fix $U=\Ukk$ and update $P$ by +\begin{align} +\Pkk =& \argmin_{P} \ \Lag(P,\Ukk,\Yk,\muk) \notag \\ += & \argmin_{P} \ g(P) + \frac{\muk}{2} \norm{P-\UUkk+\Yk/\muk}^2. \label{updateP} +\end{align} +3. Update the dual variable by +\begin{equation}\label{updateY} +\Ykk = \Yk + \muk (\Pkk - \UUkk). +\end{equation} +4. Update the stepsize $\mu$ by +\begin{equation}\label{updatemu} +\mukk = \min(\mu_{\max},\rho\muk), \ \rho > 1. +\end{equation} +The whole procedure of ADMM for (\ref{pro}) is given in Algorithm \ref{admm}. It can be seen that the $U$-subproblem (\ref{updateU}) has a closed form solution. The $P$-subproblem (\ref{updateP}) requires computing the proximal mapping of $g$. It usually has a closed form solution when $g$ is simple. + + +We would like to emphasize that, for nonconvex optimization, our ADMM allows the stepsize $\muk$ to be increasing (but upper bounded), while previous nonconvex ADMM methods have to fix it. Such a choice of stepsize has been verified to be effective in improving the convergence of ADMM for convex optimization in practice and the convergence guarantee is also known \cite{lu2017unified,lin2010augmented}. To the best of our knowledge, this is the first work which uses varying stepsize in ADMM for nonconvex problems and the convergence analysis for supporting this is also different from the convex case. +\section{Main Result: The Convergence Analysis} +The most important contribution is the convergence analysis of the proposed ADMM in Algorithm \ref{admm} for nonconvex problems which is generally challenging. This section gives the details of the convergence results. +We first introduce the subgradient of any function \cite{rockafellar2009variational}, which will be used later. + +\begin{definition} + Let $S\subseteq \mathbb{R}^m$ and ${x}_0\in S$. A vector $v$ is normal to $S$ at $x_0$ in the regular sense, denoted as $v\in \hat{N}_S(x_0)$, if + \begin{equation*} + \inproduct{v}{x-x_0} \leq o(\norm{x-x_0}), \ x\in S, + \end{equation*} + where $o(\norm{y})$ is defined by $\lim\limits_{\norm{y}\rightarrow0} \frac{o(\norm{y})}{\norm{y}}=0$. A vector is normal to $S$ at $x_0$ in the general sense, denoted as $v\in N_S(x_0)$, if there exist sequences $\{x^k\}\subset S$, $\{v^k\}$ such that $x^k\rightarrow x_0$ and $v^k\rightarrow v$ with $v^k\in \hat{N}_S(x^k)$. The cone $N_S(x_0)$ is called the normal cone to $S$ at $x_0$. +\end{definition} + +\begin{definition} + Consider a lower semi-continuous function $h: \mathbb{R}^m\rightarrow (-\infty,+\infty]$ and a point $x_0$ with $h(x_0)$ finite. For a vector $v\in\mathbb{R}^m$, one says that + \begin{enumerate}[(a)] + \item $v$ is a regular subgradient of $h$ at $x_0$, denoted as $v\in\hat{\partial} h(x_0)$, if + \begin{equation*} + h(x) \geq h(x_0) + \inproduct{v}{x-x_0} + o(\norm{x-x_0}); + \end{equation*} + \item $v$ is a (general) subgradient of $h$ at $x_0$, denoted as $v\in \partial h(x_0)$, if there exist sequences $\{x^k\}$, $\{v^k\}$ such that $x^k\rightarrow x_0$, $h(x_k)\rightarrow h(x_0)$ and $v^k\in \hat{\partial} h(x^k)$ with $v^k\rightarrow v$. + \end{enumerate} +\end{definition} + +Let $S$ be a closed non-empty subset of $\mathbb{R}^m$ and its indicator function be +\begin{equation*} +\iota_S(x) = \begin{cases} +0, \qquad \text{if } x \in S,\\ ++\infty,\quad \text{otherwise.} +\end{cases} +\end{equation*} +Then its subgradient is +$\partial \iota_S(x_0) = N_S(x_0), x_0\in S.$ +In this work, we denote $\mathcal{O} = \{ U\in\mathbb{R}^{n\times k} | U^\top U = I\}$ and the indicator function as $\iota_{\mathcal{O}}(U)$. + +To guarantee the convergence, we need some assumptions for problem (\ref{pro}) as follows: +\begin{itemize} + \item[\textbf{ A1.}] $L$ is positive semi-definite. + \item[\textbf{A2.}]$g: \mathbb{R}^{n\times n}\rightarrow R$ is lower bounded, differential and $\nabla g$ is Lipschitz continuous, i.e., there exists $ l >0$ such that + \begin{equation*} + \norm{\nabla g(X) - \nabla g(Y)} \leq l \norm{X-Y}, \ \forall X,Y\in\mathbb{R}^{n\times n}. + \end{equation*} + \item[\textbf{A3.}] The stepsize $\muk$ is chosen large enough such that + \begin{enumerate}[(1)] + \item The $P$-subproblem (\ref{updateP}) is strongly convex with modulus $\gammak$. + \item $\muk\gammak > l^2(\rho+1)$ and $\muk\geq l$. + \end{enumerate} +\end{itemize} + +We have some remarks regarding the above assumptions. First, A1 holds for the SSC model since $L$ is the normalized Laplacian matrix; Second, $g$ can be nonconvex. In SSC, one may use convex or nonconvex sparse regularizer $g$. But $g$ should be Lipschitz differential which can be achieved by using the smoothing technique \cite{nesterov2005smooth} if necessary (see an example in the Experiment section); Third, the $P$-subproblem (\ref{updateP}) is eventually strongly convex when $\muk$ is large enough. + +At the following, we will prove several properties of Algorithm \ref{admm} and give the convergence results. + +\begin{lem}\label{lema1} + Under assumptions A1-A3, all the subproblems in Algorithm \ref{admm} are well defined. +\end{lem} +\begin{proof} + The $P$-subproblem (\ref{updateP}) is well defined since $g$ is lower bounded under assumption A2. Also, it is obvious that the $U$-subproblem (\ref{updateU}) is well defined. +\end{proof} + +\begin{lem}\label{lem2} + Under assumptions A1-A3, we have + \begin{equation}\label{boundYdiff} + \norm{\Yk-\Ykk}^2 \leq l^2\norm{\Pk-\Pkk}^2. + \end{equation} +\end{lem} +\begin{proof} + From the $P$-subproblem (\ref{updateP}), we have the following optimality condition + \begin{equation}\label{optcondPP} + \nabla g(\Pkk) + \Yk + \muk(\Pkk-\UUkk) = 0. + \end{equation} + By using $\Ykk = \Yk + \muk (\Pkk - \UUkk)$ in (\ref{updateY}), we have + \begin{equation}\label{optcondP} + \nabla g(\Pkk) =-\Ykk. + \end{equation} + Then we have + \begin{align*} + \norm{\Ykk-\Yk} = \norm{\nabla g(\Pkk) - \nabla g(\Pk)} \leq l \norm{\Pkk-\Pk}, + \end{align*} + where the last inequality uses assumption A2. + The proof is completed. +\end{proof} + + + + +\begin{lem}\label{lem3} + Under assumptions A1-A3, the sequences $\{\Pk,\Uk,\Yk\}$ generated by Algorithm \ref{admm} satisfy + \begin{itemize} + \item[(a)] $\Lag(\Pk,\Uk,\Yk,\muk)$ is monotonically decreasing, i.e., + \begin{align} + &\Lag(\Pkk,\Ukk,\Ykk,\mukk) - \Lag(\Pk,\Uk,\Yk,\muk) \notag \\ + \leq & - \left( \frac{\gammak}{2} - \frac{l^2(\rho+1)}{2\muk} \right) \norm{\Pkk-\Pk}^2. \label{profdecresL} + \end{align} + \item[(b)] $\lim\limits_{k\rightarrow +\infty}\Lag(\Pk,\Uk,\Yk,\muk)=\Lag^*$ for some constant $\Lag^*$. + \item[(c)] When $k\rightarrow+\infty$, $\Pkk-\Pk\rightarrow0$, $\Ykk-\Yk\rightarrow0$ and $\Pk-\UUk\rightarrow0$. + \item[(d)] The sequences $\{\Pk\}$, $\{\Uk \}$ and $\{\Yk \}$ are bounded. + \item[(e)] There exists $G=[G_P \ G_U \ G_Y]$, where + \begin{align*} + G_P =& \partial_P \Lag(\Pkk,\Ukk,\Ykk,\muk),\\ + G_U \in& \partial_U \Lag(\Pkk,\Ukk,\Ykk,\muk)+\partial_U \iota_{\mathcal{O}}(\Ukk),\\ + G_Y = &\partial_Y \Lag(\Pkk,\Ukk,\Ykk,\muk), + \end{align*} + + such that + \begin{align} + \norm{G}^2 \leq & (8d+1+\frac{1}{\mu_0^2})\norm{\Yk-\Ykk}^2 \notag\\ + &+ 8d\mu_{\max}^2\norm{\Pk-\Pkk}^2.\label{eqboundsubgr} + \end{align} + \end{itemize} +\end{lem} +The proof of Lemma \ref{lem3} can be found in the supplementary material. The property (\ref{boundYdiff}) is important for proving (\ref{profdecresL}), which guarantees that $\Lag(\Pk,\Uk,\Yk,\muk)$ is monotonically decreasing due to the choice of $\muk$ in assumption A3. This combined with the lower bounded property guarantees that $\Lag(\Pk,\Uk,\Yk,\muk)$ converges to some $\Lag^*>0$. For convex problems, there have several different quantities to characterize the convergence of ADMM, see \cite{lu2017unified,he20121,liu2013linearized}. However, they are not applicable to ADMM for nonconvex problems. Here, the convergence is characterizing based on a different way by using the decreasing sequence $\Lag(\Pk,\Uk,\Yk,\muk)$. Note that the decreasing property of $\Lag(\Pk,\Uk,\Yk,\muk)$ does not necessary hold for ADMM for convex optimization. This difference implies that the nonconvex problems which can be solved by ADMM are relatively limited and the convergence guarantee of ADMM for nonconvex problems is much more challenging. Based on (\ref{profdecresL}), many other properties are proved. For example, Lemma \ref{lem3} (c) gives some necessary results when the algorithm converges and (d) and (e) are important for proving the convergence to stationary point shown below. + + + + + + +\begin{theorem}\label{thm1} Assume that the assumptions A1-A3 are satisfied. + Let $(P^*,U^*,Y^*)$ denotes any limit point of the sequence $\{\Pk,\Uk,\Yk\}$ generated by Algorithm \ref{admm}. Then the limit point is a stationary point of problem (\ref{pro}), i.e., + \begin{align} + & 0\in \partial_U\Lag(P^*,U^*,Y^*,\mu^*) +\partial_U \iota_{\mathcal{O}}(U^*),\label{eqnthm1stapoint1}\\ + & 0 = \partial_P\Lag(P^*,U^*,Y^*,\mu^*),\label{eqnthm1stapoint2}\\ + & 0 = \partial_Y\Lag(P^*,U^*,Y^*,\mu^*) = P^* - U^*{U^*}^\top.\label{eqnthm1stapoint3} + \end{align} +\end{theorem} +\begin{proof} From the boundedness of $\{\Pk,\Uk,\Yk,\muk\}$ in Lemma \ref{lem3}, there exists a convergent subsequence and a limit point, denoted by $(P_{k_j}, U_{k_j},Y_{k_j},\mu_{k_j}) \rightarrow (P^*,U^*,Y^*,\mu^*)$ as $j\rightarrow +\infty$. Then, by using $\Pkk-\Pk\rightarrow0$, $\Ykk-\Yk\rightarrow0$ and (\ref{eqboundsubgr}) in Lemma \ref{lem3}, for $k\geq1$, there exists $G_{k}\in\partial \Lag(\Pk,\Uk,\Yk,\mu_{k-1})$ such that $\norm{G_k}\rightarrow 0$. In particular, $\norm{G_{k_j}}\rightarrow 0$ as $j\rightarrow+\infty$. By the definition of general subgradient, we have $0\in \partial\Lag(P^*,U^*,Y^*,\mu^*)$. This implies that (\ref{eqnthm1stapoint1})-(\ref{eqnthm1stapoint3}) hold. Thus, any limit point is a stationary point. +\end{proof} + + + + +\begin{theorem}\label{thm2} + For every $K\geq 1$, the sequences $\{\Pk,\Uk,\Yk\}$ generated by Algorithm \ref{admm} satisfies + \begin{align*} + \min_{0\leq k\leq K} \norm{\Pkk-\Pk}^2 &\leq \frac{\Lag(P_0,U_0,Y_0,\mu_0) - \Lag^*}{(K+1)c_K},\\ + \min_{0\leq k\leq K} \norm{\Ykk-\Yk}^2 &\leq \frac{l^2(\Lag(P_0,U_0,Y_0,\mu_0) - \Lag^*)}{(K+1)c_K}, \\ + \min_{0\leq k\leq K} \norm{\Pkk-\UUkk}^2 &\leq \frac{l^2(\Lag(P_0,U_0,Y_0,\mu_0) - \Lag^*)}{(K+1)c_K\mu_0^2}, + \end{align*} + where $c_K = \min_{0\leq k\leq K} \left( \frac{\gammak}{2} - \frac{l^2(\rho+1)}{2\muk} \right)>0$. +\end{theorem} +\begin{proof} + From (\ref{profdecresL}) and the definition of $c_K>0$, we have + \begin{align*} + & c_K \norm{\Pkk-\Pk}^2 \\ + \leq &\Lag(\Pk,\Uk,\Yk,\muk) - \Lag(\Pkk,\Ukk,\Ykk,\mukk). + \end{align*} + Summing the above equality over $k=0,\cdots,K$, we obtain + \begin{align*} + &\sum_{k=0}^{K} c_K \norm{\Pkk-\Pk}^2 \\ + \leq & \Lag(P_0,U_0,Y_0,\mu_0) - \Lag(\Pkk,\Ukk,\Ykk,\mukk) \\ + \leq & \Lag(P_0,U_0,Y_0,\mu_0) - \Lag^*. + \end{align*} + Thus, we have + \begin{align*} + &\min_{0\leq k\leq K} \norm{\Pkk-\Pk}^2 \\ + \leq & \frac{1}{K+1} \sum_{k=0}^{K} \norm{\Pkk-\Pk}^2 + \leq \frac{\Lag(P_0,U_0,Y_0,\mu_0) - \Lag^*}{(K+1)c_K}. + \end{align*} + The proof is completed by further using (\ref{boundYdiff}) and (\ref{updateY}). +\end{proof} +Theorem \ref{thm2} gives the $O(1/K)$ convergence rate of our proposed ADMM based on the smallest difference of iterates of $\Pk$, $\Yk$ and the residual. +To the best of our knowledge, this is the first convergence rate of ADMM for nonconvex problems. In theory, such a result is relatively weaker than the convex case since the used measure is $\min_{0\leq k\leq K} \norm{\Pkk-\Pk}^2$ but not $\norm{P_{K+1}-P_K}^2$. But in practice, we observe that the sequence $\norm{P_{k+1}-P_k}^2$ seems to decrease (see Figure \ref{fig_convergence} (b) in the Experiment section), though this is currently not clear in theory. This observation in practice implies that the above convergence rate makes sense. + + +It is worth mentioning that the convergence guarantee of ADMM for convex problems has been well established \cite{lu2017unified,he20121,liu2013linearized}. However, for nonconvex cases, the convergence analysis of ADMM for different nonconvex problems is quite different. There are some recent works \cite{hong2016convergence,wang2015global} which apply ADMM to solve nonconvex problems and provide some analysis. However, these works are not able to solve our problem (\ref{pro}) since the constraints in their considered problems should be relatively simple while our problem has a special nonconvex constraint $P=\UU$. The work \cite{hong2016convergence} is not applicable to our problem since it requires all the subproblems to be strongly convex while our $U$-subproblem (\ref{updateU}) is nonconvex. When considering to apply the method in \cite{wang2015global} to solve (\ref{ncvxssc}), one has to exactly solve the problem of the following type +\begin{equation*} +\min_{P} \ g(PP^\top) + \frac{1}{2}\norm{P-B}^2, +\end{equation*} +in each iteration. This is generally very chellenging even when $g$ is convex. Also, we would like to emphasize that our ADMM allows the stepsize $\muk$ to be increasing (but upper bounded), while previous nonconvex ADMM algorithms simply fix it. Though our considered problem is specific, the analysis for the varying stepsize $\muk$ is applicable to other nonconvex problems in \cite{hong2016convergence}. In practice, the convergence speed of ADMM is sensitive to the choice of $\mu$, but it is generally difficult to find a proper constant stepsize for fast convergence. Our choice of $\muk$ has been shown to be effective in improving the convergence speed and widely used in convex optimization \cite{lu2017unified,lin2010augmented}. In practice, we find that such a technique is also very useful for fast implementation of ADMM for nonconvex problems. We are also the first one to give the convergence rate (in the sense of Theorem \ref{thm2}) of ADMM for nonconvex problems. +\section{Experiments} +In this section, we conduct some experiments to analyze the convergence of the proposed ADMM for nonconvex SSC and show its effectiveness for data clustering. We consider to solve the following nonconvex SSC model +\begin{equation}\label{prosmooth} +\begin{split} +&\min_{P\in\mathbb{R}^{n\times n},U\in\mathbb{R}^{n\times k}} \ \inproduct{L}{\UU} + g_\sigma(P), \\ +& \st \ P = \UU, \ U^\top U=I, +\end{split} +\end{equation} +where $g_\sigma$ is the smoothed $\ell_1$-norm $\beta \norm{P}_1$ with a smoothness parameter $\sigma>0$ defined as follows +\begin{equation} +g_\sigma(P) = \max_Z \inproduct{P}{Z} - \frac{\sigma}{2}\norm{Z}^2, \ \st \ \norm{Z}_\infty \leq \beta, +\end{equation} +where $\norm{Z}_\infty=\max_{ij}|z_{ij}|$. According to Theorem 1 in \cite{nesterov2005smooth}, the gradient of $ g_\sigma(P)$ is given by $\nabla g_\sigma(P) = \min\{\beta,\max\{ P/\sigma,-\beta\} \}$ and is Lipschitz continuous with Lipschitz constant $l=1/\sigma$. Note that $g_\sigma$ is convex. So we set +$\mu_0=1.01(l\sqrt{\rho+1})$, which guarantees the assumption A3 holds. In Algorithm \ref{admm}, we set $\rho{=1.05}$, $\mu_{\max}=1e10$, and $U_0$ is initialized as the $k$ eigenvectors associated to the $k$ smallest eigenvalues of $L$, where $k$ is the number of the clusters and $L$ is the normalized Laplacian matrix constructed based on the given affinity matrix $W$. Then we set $P_0=U_0U_0^\top$ and $Y_0=0$. We use the following stopping criteria for Algorithm \ref{admm} +\begin{equation}\label{stopc} +\max\{\norm{\Pkk-\Pk}_\infty,\norm{\Pkk-\UUkk}_\infty\} \leq 10^{-6}, +\end{equation} +which is implied by our convergence analysis. +For all the experiments, we use $\sigma = 0.01$ (in practice, we find that the clustering performance is not sensitive when $\sigma\leq 0.01$). + + + + + + + +We conduct two experiments based on two different ways of affinity matrix construction. The first experiment considers the subspace clustering problem in \cite{elhamifar2013sparse}. A \textit{sparse} affinity matrix $W$ is computed by using the sparse subspace clustering method ($\ell_1$-graph) \cite{elhamifar2013sparse}, and then it is used as the input for SC, convex SSC \cite{lu2016convex} and our nonconvex SSC model solved by ADMM. The second experiment instead uses the Gaussian kernel to construct the affinity matrix which is generally \textit{dense}. We will show the effectiveness of nonconvex SSC in both settings. + + + + +\begin{table}[] + \small + \centering + \caption{ Clustering errors ($\%$) on the Extended Yale B database based on the \textit{sparse} affinity matrix $W$ constructed by the $\ell_1$-graph.} + \vspace{-0.2em} + \label{tab_resyaleb} + \begin{tabular}{c|c|c|c|c} + \hline + $\#$ of & \multirow{2}{*}{SC} & \multirow{2}{*}{SSC} & SSC- & SSC- \\ + subjects & & & PG & ADMM \\ \hline + 2 & 1.56$\pm$2.95 & 1.80$\pm$2.89 & 1.37$\pm$3.15 & \textbf{1.21$\pm$2.10} \\ \hline + 3 & 3.26$\pm$7.69 & 3.36$\pm$7.76 & 3.12$\pm$6.23 & \textbf{2.40$\pm$4.92} \\ \hline + 5 & 6.33$\pm$5.36 & 6.61$\pm$5.93 & 5.65$\pm$4.33 & \textbf{3.86$\pm$2.82} \\ \hline + 8 & 8.93$\pm$6.11 & 4.98$\pm$4.00 & 4.95$\pm$3.36 & \textbf{4.67$\pm$3.40} \\ \hline + 10 & 9.94$\pm$4.57 & \textbf{4.60$\pm$2.59} & 5.91$\pm$4.52 & 5.84$\pm$3.43 \\ \hline + \end{tabular} + \vspace{-1em} +\end{table} +\subsection{Affinity matrix construction by the $\ell_1$-graph } +For the first experiment, we consider the case that the affinity matrix is constructed by the $\ell_1$-graph \cite{elhamifar2013sparse}. We test on the Extended Yale B database \cite{YaleBdatabase} to analyze the effectiveness of our nonconvex SSC model in (\ref{prosmooth}). The Extended Yale B dataset consists of 2,414 face images of 38 subjects. Each subject has 64 faces. We resize the images to $32\times 32$ and vectorized them as 1,024-dimensional data points. We construct 5 subsets which consist of all the images of the randomly selected 2, 3, 5, 8 and 10 subjects of this dataset. For each trial, we follow the settings in \cite{elhamifar2013sparse} to construct the affinity matrix $W$ by solving a sparse representation model (or $\ell_1$-graph), which is the most widely used method. Based on the learned affinity matrix by $\ell_1$-graph, the following three methods are compared to find the final clustering results: +\begin{itemize} + \item SC: traditional spectral clustering method \cite{ng2002spectral}. + \item SSC: convex SSC model \cite{lu2016convex}. + \item SSC-ADMM: our nonconvex SSC model solved by the proposed ADMM in Algorithm \ref{admm}. + \item SSC-PG: our nonconvex SSC model (\ref{ncvxssc}) can also be solved by the Proximal Gradient (PG) \cite{beck2009fast} method (a special case of Algorithm 1 in~\cite{mairal2013optimization}). In each iteration, PG updates $\Ukk$ by + \begin{align*} + \Ukk&=\argmin_{U\in\mathbb{R}^{n\times k}} g(\UUk)+ \inproduct{\nabla g(\UUk)}{UU^\top-\UUk} \\ + &+\frac{l}{2}\norm{UU^\top-\UUk}^2+\inproduct{L}{UU^\top} \\ + & \st \ \ \ U^\top U = I. + \end{align*} + It is easy to see that the above problem has a closed form solution. We use the stopping criteria $\norm{\Uk-\Ukk}_\infty\leq 10^{-6}$. We name the above method as SSC-PG. +\end{itemize} +Note that all the above four methods use the same affinity matrix as the input and their main difference is the different ways of learning of low-dimensional embedding $U$. In the nonconvex model (\ref{prosmooth}), we set $\beta=0.01$. The experiments are repeated 20 times and the mean and standard deviation of the clustering error rates (see the definition in \cite{elhamifar2013sparse}) are reported. + + + +\begin{figure}[!t] + \centering + \begin{subfigure}[b]{0.23\textwidth} + \centering + \includegraphics[width=\textwidth]{figures/fig_W.pdf} + \caption{$W$ learned by the $\ell_1$-graph} + \end{subfigure} + \begin{subfigure}[b]{0.23\textwidth} + \centering + \includegraphics[width=\textwidth]{figures/fig_uut_sc.pdf} + \caption{$\UU$ by SC} + \end{subfigure} + \begin{subfigure}[b]{0.23\textwidth} + \centering + \includegraphics[width=\textwidth]{figures/fig_uut_convexssc.pdf} + \caption{$\UU$ by convex SSC} + \end{subfigure} + \begin{subfigure}[b]{0.23\textwidth} + \centering + \includegraphics[width=\textwidth]{figures/fig_uut_nonconvexssc.pdf} + \caption{$\UU$ by SSC-ADMM} + \end{subfigure} + \caption{ An example with 5 subjects from the Extended Yale B database. (a) Plot of the affinity matrix $W$ learned by the $\ell_1$-graph \cite{elhamifar2013sparse}; (b) Plot of $\UU$ with $U$ learned by SC in (\ref{sc}); (c) Plot of $\UU$ with $U$ learned by convex SSC in (\ref{computUssc}); (d) Plot of $\UU$ with $U$ learned by SSC-ADMM in (\ref{pro}). Each matrix is normalized to [0,1] for better visualization. }\label{fig_matrixyaleb} + \vspace{-1em} +\end{figure} + + +\begin{figure}[!t] + \centering + \begin{subfigure}[b]{0.3\textwidth} + \centering + \includegraphics[width=\textwidth]{figures/fig_convergence_Laugfunc.pdf} + \caption{$\Lag(\Pk,\Uk,\Yk,\muk)$ } + \end{subfigure} + \begin{subfigure}[b]{0.3\textwidth} + \centering + \includegraphics[width=\textwidth]{figures/fig_convergence_stopC.pdf} + \caption{stopping criteria} + \end{subfigure} + \caption{ Plots of (a) convergence of $\Lag(\Pk,\Uk,\Yk,\muk)$ v.s. $k$ and (b) convergence of the stopping criteria in (\ref{stopc}) v.s. $k$. The used data is a 5 subjects subset of Extended Yale B database. }\label{fig_convergence} + \vspace{-1em} +\end{figure} + + + +The clustering results are shown in Table \ref{tab_resyaleb}. +It can be seen that our nonconvex SSC models outperform convex SSC in most cases. The main reason is that nonconvex SSC is able to directly encourage $\UU$ to be sparse while SSC achieves this in a two-stage way (required solving (\ref{cssc}) and (\ref{computUssc})). Considering a clustering example with $k=5$ subjects from the Yale B dataset, Figure \ref{fig_matrixyaleb} plots the learned affinity matrix $W$ by $\ell_1$-graph, and $\UU$ learned by SC, SSC and SSC-ADMM, respectively. Note that $\UU$ is important for data clustering since $\hatU\hatU^\top$ ($\hatU$ is the row normalization of $U$) implies the true membership of the data clusters in the ideal case (see the discussions in the Introduction section). +It can be seen that $\UU$ by SSC-ADMM looks more discriminative since the within-cluster connections are much stronger than the between-cluster connections. Also, for the convergence of the proposed ADMM, we plot the augmented Lagrangian function $\Lag(\Pk,\Uk,\Yk,\muk)$ and the stopping criteria in (\ref{stopc}). It can be seen that $\Lag$ is monotonically decreasing and the stopping criteria converges towards 0. The convergence behavior is consistent with our theoretical analysis. +\subsection{Affinity matrix construction by the Gaussian kernel } +For the second experiment, we consider the case that the affinity matrix is constructed by the Gaussian kernel. We test on 10 datasets which are of different sizes and are widely used in pattern analysis. They include 5 datasets (Wine, USPS, Glass, Letter, Vehicle) from the UCI website \cite{ucidataset}\footnote{\url{https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/}.}, +UMIST\footnote{\url{https://www.sheffield.ac.uk/eee/research/iel/research/face}}, PIE \cite{sim2002cmu}, COIL20\footnote{\url{http://www1.cs.columbia.edu/CAVE/software/softlib/coil-20.php}}, CSTR\footnote{\url{http://www.cs.rochester.edu/trs/}} and AR~\cite{martinez1998ar}. For some datasets, e.g., USPS and Letter, we use a subset instead due to the relatively large size. For some image datasets, e.g., UMIST, PIE, and COIL20, the images are resized to $32\times 32$ and then vectorized as features. The statistics of these datasets are summarized in Table \ref{tab_dataset}. The key difference of this experiment from the first one is that we use the Gaussian kernel instead of the sparse subspace clustering to construct the affinity matrix $W$. + + + + +\begin{table}[t] + \small + \centering + \caption{ Statistics of 10 datasets. } + \vspace{-1.em} + \begin{tabular}{c|c|c|c}\hline + dataset & $\#$ samples & $\#$ features & $\#$ clusters \\\hline\hline + Wine & 178 & 13 & 3 \\\hline + USPS & 1,000 & 256 & 10 \\\hline + Glass & 214 & 9 & 6 \\ \hline + Letter & 1,300 & 16 & 26 \\ \hline + Vehicle & 846 & 18 & 4 \\\hline + UMIST & 564 & 1,024 & 20 \\\hline + PIE & 1,428 & 1,024 & 68 \\\hline + COIL20 & 1,440 & 1,024 & 20 \\\hline + CSTR & 476 & 1,000 & 4 \\\hline + AR & 840 & 768 & 120 \\\hline + \end{tabular} \label{tab_dataset} +\end{table} + +\begin{table}[] + \small + \centering + \caption{ Clustering accuracy on 10 datasets. In this table, SC, SSC, SSC-PG and SSC-ADMM use the \textit{dense} affinity matrix $W$ constructed by the Gaussian kernel.} + \vspace{-1.em} + \label{tab_otherdatsets} + \begin{tabular}{c|c|c|c|c|c|c} + \cline{1-7} + \multirow{2}{*}{} & \multirow{2}{*}{k-means} & \multirow{2}{*}{NMF} & \multirow{2}{*}{SC} & \multirow{2}{*}{SSC} & SSC- & SSC- \\ + & & & & & PG & ADMM \\ \hline + Wine & 94.4 & 96.1 & 94.9 & \multicolumn{1}{c|}{96.1} & \multicolumn{1}{c|}{96.6} & \multicolumn{1}{c}{\textbf{97.2}} \\ \hline + USPS & 67.3 & 69.2 & 71.2 & \multicolumn{1}{c|}{73.4} & \multicolumn{1}{c|}{\textbf{76.8}} & \multicolumn{1}{c}{\textbf{76.8}} \\ \hline + Glass & 40.7 & 39.3 & 41.1 & \multicolumn{1}{c|}{43.0} & \multicolumn{1}{c|}{44.9} &\multicolumn{1}{c}{\textbf{45.3}} \\ \hline + Letter & 27.1 & 30.4 & 31.8 & \multicolumn{1}{c|}{35.3} & \multicolumn{1}{c|}{\textbf{36.4}}& \multicolumn{1}{c}{{36.0}} \\ \hline + Vehicle & 62.1 & 61.3 & 67.0 & \multicolumn{1}{c|}{70.0} & \multicolumn{1}{c|}{{73.0}} & \multicolumn{1}{c}{\textbf{73.4}} \\ \hline + \multicolumn{1}{c|}{UMIST} & \multicolumn{1}{c|}{52.1} & \multicolumn{1}{c|}{63.8} & \multicolumn{1}{c|}{63.3} & \multicolumn{1}{c|}{64.2} & \multicolumn{1}{c|}{{65.1}} & \multicolumn{1}{c}{\textbf{66.1}} \\ \hline + \multicolumn{1}{c|}{PIE} & \multicolumn{1}{c|}{35.4} & \multicolumn{1}{c|}{37.9} & \multicolumn{1}{c|}{42.0} & \multicolumn{1}{c|}{46.7} & \multicolumn{1}{c|}{{46.8}} & \multicolumn{1}{c}{\textbf{51.1}} \\ \hline + \multicolumn{1}{c|}{COIL20} & \multicolumn{1}{c|}{59.0} & \multicolumn{1}{c|}{46.2} & \multicolumn{1}{c|}{63.1} & \multicolumn{1}{c|}{64.5} & \multicolumn{1}{c|}{\textbf{69.1}} & \multicolumn{1}{c}{{67.9}} \\ \hline \multicolumn{1}{c|}{CSTR} & \multicolumn{1}{c|}{65.0} & \multicolumn{1}{c|}{70.0} & \multicolumn{1}{c|}{68.9} & \multicolumn{1}{c|}{72.7} & \multicolumn{1}{c|}{{71.0}} & \multicolumn{1}{c}{\textbf{76.3}}\\ \hline + \multicolumn{1}{c|}{AR} & \multicolumn{1}{c|}{24.2} & \multicolumn{1}{c|}{35.0} & \multicolumn{1}{c|}{36.1} & \multicolumn{1}{c|}{37.1} & \multicolumn{1}{c|}{{37.7}} & \multicolumn{1}{c}{\textbf{39.0}}\\ \hline + \end{tabular} + \vspace{-1em} +\end{table} + + +The Gaussian kernel parameter is tuned by the grid $\{10^{-3},10^{-2},10^{-1},10^0\}$. We use the same affinity matrix $W$ as the input of SC, SSC \cite{lu2016convex}, SSC-PG and SSC-ADMM. The parameter $\beta$ in SSC, SSC-PG and SSC-ADMM is searched from $\{10^{-4},10^{-3},10^{-2}\}$. We further compare the these methods with k-means and Nonnegative Matrix Factorization (NMF). Under each parameter setting of each method mentioned above, we repeat the clustering for 20 times, and compute the average result. We report the best average accuracy for each method in Table \ref{tab_otherdatsets}. + +From Table \ref{tab_otherdatsets}, we have the following observations. First, it can be seen that the SSC models (SSC, SSC-PG and SSC-ADMM) improve the traditional SC and our SSC-ADMM achieves the best performances in most cases. Second, this experiment not only verifies the superiority of SSC over SC, but also shows the importance of the nonconvex SSC and the effectiveness of our solver. Third, this experiment implies that the nonconvex SSC improves the convex SSC when given the dense affinity matrix constructed by the Gaussian kernel which is different from the sparse $\ell_1$-graph in the first experiment. Beyond the accuracy, we further compare the efficiency of SSC-PG and SSC-ADMM which use different solvers for the equivalent nonconvex SSC model. Figure \ref{fig_timecomp} gives the average running time of both methods. It can be seen that SSC-ADMM is much more efficient than SSC-PG. The main reason behind is that SSC-PG has to construct a relatively loose majorant surrogate for $g$ in each iteration \cite{mairal2013optimization} and thus requires many more (usually more than $1,000$) iterations. Note that the same phenomenon appears in the convex optimization \cite{lin2010augmented}. + + + + + + +\begin{figure}[!t] + \centering + \includegraphics[width=0.32\textwidth]{figures/fig_timecomp.pdf} + \caption{\small Comparison of the average running time (in second) of SSC-ADMM and SSC-PG on 10 datasets.}\label{fig_timecomp} +\end{figure} +\section{Conclusion and Future Work} +This paper addressed the loose convex relaxation issue of SSC proposed in \cite{lu2016convex}. We proposed to use ADMM to solve the nonconvex SSC problem (\ref{pro}) directly instead of the convex relaxation. More importantly, we provided the convergence guarantee of ADMM for such a nonconvex problem which is challenging and has not been addressed before. It is worth mentioning that our ADMM method and analysis allow the stepsize to be monotonically increased (but upper bounded). Such a technique has been verified to be effective in improving the convergence in practice for convex optimization and this is the first work which introduces it to ADMM for nonconvex optimization. Also, our convergence guarantee generally requires relatively weak assumptions, e.g., no assumption on the iterates and the subproblems are not necessarily to be strongly convex. Thus it is more practical and can be used to solve other related problems. Beyond the convergence guarantee, we also gave some experimental studies to verify our analysis and the clustering results on several real datasets demonstrated the improvement of nonconvex SSC over convex SSC. + +There have some interesting future works. Though the solved nonconvex problem in this work is specific, the problems with nonconvex orthogonal constraint are interesting and such a nonconvex constraint or related ones appear in many models in component analysis. It will be interesting to apply ADMM to solve other problems with similar constraints and provide the convergence guarantee. +It will be also interesting to apply our technique to solve some other nonconvex low rank minimization models in \cite{lu2016nonconvex,lu2015generalized}. +\section{Acknowledgements} +J. Feng is partially supported by National University of Singapore +startup grant R-263-000-C08-133 and Ministry of Education of +Singapore AcRF Tier One grant R-263-000-C21-112. Z. Lin is +supported by National Basic Research Program of China (973 Program) (Grant no. 2015CB352502) and National Natural Science +Foundation (NSF) of China (Grant nos. 61625301 and 61731018). + + + + +{ + + \bibliographystyle{aaai} + \bibliography{bibfile} +} + + +\newpage +\onecolumn +~\ +\begin{center} + \LARGE\textbf{Supplementary Material} +\end{center} +\section*{Proof of Lemma \ref{lem3}} +\begin{proof} \textbf{Proof of (a).} + We deduce + \begin{align} + &\Lag(\Pkk,\Ukk,\Ykk,\mukk) - \Lag(\Pk,\Uk,\Yk,\muk) \notag \\ + = & \Lag(\Pkk,\Ukk,\Ykk,\mukk) - \Lag(\Pkk,\Ukk,\Yk,\muk) \notag\\ + & + \Lag(\Pkk,\Ukk,\Yk,\muk) - \Lag(\Pk,\Uk,\Yk,\muk).\label{lem3prf1} + \end{align} + Consider the first two terms in (\ref{lem3prf1}), we have + \begin{align} + & \Lag(\Pkk,\Ukk,\Ykk,\mukk) - \Lag(\Pkk,\Ukk,\Yk,\muk) \notag \\ + = & \inproduct{\Ykk-\Yk}{\Pkk-\UUkk} \notag \\ + & + \frac{\mukk-\muk}{2} \norm{\Pkk-\UUkk}^2 \notag\\ + \overset{\text{\ding{172}}}{=} & \left( \frac{1}{\muk} + \frac{\mukk-\muk}{2\muk^2} \right) \norm{\Ykk-\Yk}^2\notag \\ + \overset{\text{\ding{173}}}{\leq} & \frac{\rho+1}{2\muk} \norm{\Ykk-\Yk}^2 + \overset{\text{\ding{174}}}{\leq} \frac{l^2(\rho+1)}{2\muk} \norm{\Pkk-\Pk}^2, \label{lem3prf3} + \end{align} + where \ding{172} uses (\ref{updateY}), \ding{173} uses the fact $\mukk \leq \rho \muk$ due to (\ref{updatemu}), and \ding{174} uses (\ref{boundYdiff}). + + Now, let us bound the last two terms in (\ref{lem3prf1}). By the optimality of $\Ukk$ to problem (\ref{updateU}), we have + \begin{equation} \label{lem3prf44} + \Lag(\Pk,\Ukk,\Yk,\muk) \leq \Lag(\Pk,\Uk,\Yk,\muk). + \end{equation} + Consider the optimality of $\Pkk$ to problem (\ref{updateP}), note that $\Lag(P,\Ukk,\Yk,\muk)$ is strongly convex with modulus $\gammak$, we have + \begin{align} + &\Lag(\Pkk,\Ukk,\Yk,\muk)\notag \\ + \leq & \Lag(\Pk,\Ukk,\Yk,\muk) - \frac{\gammak}{2}\norm{\Pkk-\Pk}^2, \label{lem3prf5} + \end{align} + where we uses the Lemma B.5 in \cite{mairal2013optimization}. + + + Combining (\ref{lem3prf1})-(\ref{lem3prf5}) leads to + \begin{align*} + & \Lag(\Pkk,\Ukk,\Ykk,\mukk) - \Lag(\Pk,\Uk,\Yk,\muk) \notag \\ + \leq & - \left( \frac{\gammak}{2} - \frac{l^2(\rho+1)}{2\muk} \right) \norm{\Pkk-\Pk}^2. + \end{align*} + By the choice of $\muk$ and $\gammak$ in assumption A3 and (\ref{profdecresL}), we can see that $\Lag(\Pk,\Uk,\Yk,\muk)$ is monotonically decreasing. + + \textbf{Proof of (b).} + To show that $\Lag(\Pk,\Uk,\Yk,\muk)$ converges to some constant $\Lag^*>-\infty$, we only need to show that $\Lag(\Pk,\Uk,\Yk,\muk)$ is lower bounded. Indeed, + \begin{align*} + & \Lag(\Pkk,\Ukk,\Ykk,\mukk) \\ + = & \inproduct{L}{\UUkk} + g(\Pkk) + \inproduct{\Ykk}{\Pkk-\UUkk} \notag \\ + &+ \frac{\mukk}{2} \norm{\Pkk-\UUkk}^2\\ + \overset{\text{\ding{175}}}{=} & \inproduct{L}{\UUkk} + \inproduct{\nabla g(\Pkk)}{\UUkk-\Pkk} \notag\\ + & + g(\Pkk) + \frac{\mukk}{2} \norm{\Pkk-\UUkk}^2\\ + \overset{\text{\ding{176}}}{\geq} & \inproduct{L}{\UUkk} + g(\UUkk). + \end{align*} + where \ding{175} uses (\ref{optcondP}) and \ding{176} uses the Lipschitz continuous gradient property of $g$ and $\mukk\geq l$ by assumption A3. + Note that $\inproduct{L}{\UUkk} \geq0$ since $L\succeq 0$ by assumption A1. This combines with the lower bounded assumption of $g$ in assumption A2 implies that $L(\Pkk,\Ukk,\Ykk,\mukk)$ is lower bounded. + + \textbf{Proof of (c).} Summing over both sides of (\ref{profdecresL}) from 0 to $+\infty$ leads to + \begin{align*} + & \sum_{k=0}^{+\infty} \left( \frac{\gammak}{2} - \frac{l^2(\rho+1)}{2\muk} \right) \norm{\Pkk-\Pk}^2 \\ + \leq &\Lag(P_0,U_0,Y_0,\mu_0) - \Lag^*. + \end{align*} + This implies that $\Pkk-\Pk\rightarrow0$ under assumption A3. Thus $\Ykk-\Yk\rightarrow0$ due to (\ref{boundYdiff}). Finally, $\Pkk-\UUkk = \frac{1}{\muk}(\Ykk-\Yk)\rightarrow0$ since $\muk$ is bounded ($\mu_0\leq\muk\leq \mu_{\max}$). + + \textbf{Proof of (d).} First, it is obvious that $\{\Uk\}$ is bounded due to the constraint $U_k^\top U_k = I$. Thus, $\UUk$ is bounded. Then, we deduce + \begin{align*} + \norm{\Pk} = \norm{\Pk-\UUk+\UUk} \leq \norm{\Pk-\UUk} + \norm{\UUk}. + \end{align*} + Note that $\norm{\Pk-\UUk}$ is bounded since $\Pk-\UUk\rightarrow0$. Hence, $\{\Pk\}$ is bounded. Considering that $\nabla g(P)$ is Lipschitz continuous, i.e., $\norm{\nabla g(P_{k_1})-\nabla g(P_{k_2})}\leq l \norm{P_{k_1}-P_{k_2}}$, this implies that $\nabla g(\Pk)$ is bounded. Thus, $\{\Yk\}$ is bounded due to (\ref{optcondP}). + + \textbf{Proof of (e).} First, from the optimality of $\Ukk$ to problem (\ref{updateU}), there exists $G_O\in\partial_U\iota_O(\Ukk)$ such that + \begin{align*} + &{\partial_U \Lag(\Pk,\Ukk,\Yk,\muk)} + G_O \\ + = &2 (L-\Yk-\muk\Pk)\Ukk + G_O =0. + \end{align*} + Thus, accordingly, there exists $G_U$ such that + \begin{align} + &G_U = {\partial_U \Lag(\Pkk,\Ukk,\Ykk,\muk)} + G_O \notag\\ + = & 2 (L-\Ykk-\muk\Pkk)\Ukk + G_O \notag \\ + = & 2 (L-\Yk-\muk\Pk)\Ukk + G_O + 2(\Yk-\Ykk)\Ukk \notag \\ + &+2\muk(\Pk-\Pkk)\Ukk \notag\\ + = & 2((\Yk-\Ykk)+\muk(\Pk-\Pkk))\Ukk. \label{profeu} + \end{align} + Second, by using the optimality of $\Pkk$ given in (\ref{optcondPP}), we have + \begin{align} + &G_P = {\partial_P \Lag(\Pkk,\Ukk,\Ykk,\muk)} \notag\\ + = & \nabla g(\Pkk) + \Ykk + \muk(\Pkk-\UUkk) \notag\\ + = & \nabla g(\Pkk) + \Yk + \muk(\Pkk-\UUkk) + \Ykk-\Yk \notag\\ + = & \Ykk-\Yk. \label{profep} + \end{align} + Third, by direction computation, we have + \begin{align} + & G_Y = {\partial_Y \Lag(\Pk,\Ukk,\Yk,\muk)} \notag \\ + = & \Pkk-\UUkk + = \frac{1}{\muk}(\Ykk-\Yk).\label{profey} + \end{align} + Finally, combing (\ref{profeu})-(\ref{profey}), we obtain + \begin{align*} + &\norm{G}^2 =\norm{[G_P \ G_U \ G_Y]}^2 \\ + \leq & \norm{2((\Yk-\Ykk)+\muk(\Pk-\Pkk))\Ukk}^2 \notag\\ + &+ (1+\frac{1}{\muk^2}) \norm{\Ykk-\Yk}^2 \\ + \leq & (8d+1+\frac{1}{\muk^2})\norm{\Yk-\Ykk}^2 + 8d\muk^2\norm{\Pk-\Pkk}^2\\ + \leq & (8d+1+\frac{1}{\mu_0^2})\norm{\Yk-\Ykk}^2 + 8d\mu_{\max}^2\norm{\Pk-\Pkk}^2. + \end{align*} + The proof is completed. +\end{proof} diff --git a/1712.03010v2.txt b/1712.03010v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..32e3c6dbc006d8b175a8382b11d36a6b870f06cd --- /dev/null +++ b/1712.03010v2.txt @@ -0,0 +1,79 @@ +Most supervised learning algorithms minimize an empirical risk cost function over a dataset.Designing fast optimization algorithms for these cost functions is crucial, especially as the size of datasets continues to increase.(Regularized) empirical risk cost functions can often be written asF​(𝒙)=f​(A​𝒙)+∑i=1dgi​(xi),𝐹𝒙𝑓𝐴𝒙superscriptsubscript𝑖1𝑑subscript𝑔𝑖subscript𝑥𝑖F(\bm{x})=f(A\bm{x})+\sum_{i=1}^{d}g_{i}(x_{i}),(1)where f​(⋅):ℝn⟶ℝ:𝑓⋅⟶superscriptℝ𝑛ℝf(\cdot):\mathbb{R}^{n}\longrightarrow\mathbb{R} is a smooth convex function, d𝑑d is the number of decision variables (coordinates) on which the cost function is minimized, which are gathered in vector 𝒙∈ℝd𝒙superscriptℝ𝑑\bm{x}\in\mathbb{R}^{d}, gi​(⋅):ℝ⟶ℝ:subscript𝑔𝑖⋅⟶ℝℝg_{i}(\cdot):\mathbb{R}\longrightarrow\mathbb{R} are convex functions for all i∈[d]𝑖delimited-[]𝑑i\in[d], and A∈ℝn×d𝐴superscriptℝ𝑛𝑑A\in\mathbb{R}^{n\times d} is the data matrix.As a running example, consider Lasso: if 𝒀∈ℝn𝒀superscriptℝ𝑛\bm{Y}\in\mathbb{R}^{n} are the labels, f​(A​𝒙)=1/2​n​‖𝒀−A​𝒙‖2𝑓𝐴𝒙12𝑛superscriptnorm𝒀𝐴𝒙2f(A\bm{x})=\nicefrac{{1}}{{2n}}\|\bm{Y}-A\bm{x}\|^{2}, where ∥⋅∥\|\cdot\| stands for the Euclidean norm, and gi​(xi)=λ​|xi|subscript𝑔𝑖subscript𝑥𝑖𝜆subscript𝑥𝑖g_{i}(x_{i})=\lambda|x_{i}|.When Lasso is minimized, d𝑑d is the number of features, whereas when the dual of Lasso is minimized, d𝑑d is the number of datapoints. + +The gradient descent method is widely used to minimize (1). However, computing the gradient of the cost function F​(⋅)𝐹⋅F(\cdot) can be computationally prohibitive. To bypass this problem, two approaches have been developed: (i)Stochastic Gradient Descent (SGD) selects one datapoint to compute an unbiased estimator for the gradient at each time step, and(ii) Coordinate Descent (CD) selects one coordinate to optimize over at each time step.In this paper, we focus on improving the latter technique. + +When CD was first introduced, algorithms did not differentiate between coordinates; each coordinate i∈[d]𝑖delimited-[]𝑑i\in[d] was selected uniformly at random at each time step (see, e.g., [19, 20]).However, recent works (see, e.g., [10, 24, 15]) have shown that exploiting the structure of the data and sampling the coordinates from an appropriate non-uniform distribution can result in better convergence guarantees, both in theory and practice.The challenge is to find the appropriate non-uniform sampling distribution with a lightweight mechanism that maintains the computational tractability of CD. + +In this work, we propose a novel adaptive non-uniform coordinate selection method that can be applied to both the primal and dual forms of a cost function. The method exploits the structure of the data to optimize the model by finding and frequently updating the most predictive decision variables.In particular, for each i∈[d]𝑖delimited-[]𝑑i\in[d] at time t𝑡t, a lower bound ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i} is derived (which we call the marginal decrease) on the amount by which the cost function will decrease when only the it​hsuperscript𝑖𝑡ℎi^{th} coordinate is updated. + +The marginal decrease ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i} quantifies by how much updating the it​hsuperscript𝑖𝑡ℎi^{th} coordinate is guaranteed to improve the model.The coordinate i𝑖i with the largest ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i} is then the one that is updated by the algorithm max_r, described in Section 2.3.This approach is particularly beneficial when the distribution of ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i}s has a high variance across i𝑖i; in such casesupdating different coordinates can yield very different decreases in the cost function.For example, if the distribution of ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i}s has a high variance across i𝑖i, max_r is up to d2superscript𝑑2d^{2} times better than uniform sampling, whereas state-of-the-art methods can be at most d3/2superscript𝑑32d^{3/2} better than uniform sampling in such cases (see Theorem 2 in Section 2.3).More precisely, in max_r the convergence speed is proportional to the ratio of the duality gap to the maximum coordinate-wise duality gap.max_r is able to outperform existing adaptive methods because it explicitly finds the coordinates that yield a large decrease of the cost function, instead of computing a distribution over coordinates based on an approximation of the marginal decreases. + +However, the computation of the marginal decrease ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i} for all i∈[d]𝑖delimited-[]𝑑i\in[d] may still be computationally prohibitive.To bypass this obstacle, we adopt in Section 2.4 a principled approach (B_max_r) for learning the best ritsuperscriptsubscript𝑟𝑖𝑡r_{i}^{t}s, instead of explicitly computing all of them: At each time t𝑡t, we choose a single coordinate i𝑖i and update it. Next, we compute the marginal decrease ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i} of the selected coordinate i𝑖i and use it as feedback to adapt our coordinate selection strategy using a bandit framework.Thus, in effect, we learn estimates of the ritsuperscriptsubscript𝑟𝑖𝑡r_{i}^{t}s and simultaneously optimize the cost function (see Figure 1).We prove that this approach can perform almost as well as max_r, yet decreases the number of calculations required by a factor of d𝑑d (see Proposition 2). + +We test this approach on several standard datasets, using different cost functions (including Lasso, logistic and ridge regression) and for both the adaptive setting (the first approach) and the bandit setting (the second approach).We observe that the bandit coordinate selection approach accelerates the convergence of a variety of CD methods (e.g., StingyCD [11] for Lasso in Figure 2, dual CD [18] for L1subscript𝐿1L_{1}-regularized logistic-regression in Figure 3, and dual CD [13] for ridge-regression in Figure 3).Furthermore, we observe that in most of the experiments B_max_r (the second approach) converges as fast as max_r (the first approach), while it has the same computational complexity as CD with uniform sampling (see Section 4). + +Consider the following primal-dual optimization pairsmin𝒙∈ℝd⁡F​(𝒙)=f​(A​𝒙)+∑i=1dgi​(xi),min𝒘∈ℝn⁡FD​(𝒘)=f⋆​(𝒘)+∑i=1dgi⋆​(−𝒂i⊤​𝒘),formulae-sequencesubscript𝒙superscriptℝ𝑑𝐹𝒙𝑓𝐴𝒙superscriptsubscript𝑖1𝑑subscript𝑔𝑖subscript𝑥𝑖subscript𝒘superscriptℝ𝑛subscript𝐹𝐷𝒘superscript𝑓⋆𝒘superscriptsubscript𝑖1𝑑subscriptsuperscript𝑔⋆𝑖superscriptsubscript𝒂𝑖top𝒘\displaystyle\min_{\bm{x}\in\mathbb{R}^{d}}F(\bm{x})=f(A\bm{x})+\sum_{i=1}^{d}g_{i}(x_{i}),\hskip 10.00002pt\min_{\bm{w}\in\mathbb{R}^{n}}F_{D}(\bm{w})=f^{\star}(\bm{w})+\sum_{i=1}^{d}g^{\star}_{i}(-\bm{a}_{i}^{\top}\bm{w}),(2)where A=[𝒂1,…,𝒂d]𝐴subscript𝒂1…subscript𝒂𝑑A=[\bm{a}_{1},\ldots,\bm{a}_{d}], 𝒂i∈ℝnsubscript𝒂𝑖superscriptℝ𝑛\bm{a}_{i}\in\mathbb{R}^{n}, and f⋆superscript𝑓⋆f^{\star} and gi⋆subscriptsuperscript𝑔⋆𝑖g^{\star}_{i} are the convex conjugates of f𝑓f and gisubscript𝑔𝑖g_{i}, respectively.111Recall that the convex conjugate of a function h​(⋅):ℝd⟶ℝ:ℎ⋅⟶superscriptℝ𝑑ℝh(\cdot):\mathbb{R}^{d}\longrightarrow\mathbb{R} is h⋆​(𝒙)=sup𝒗∈ℝd{𝒙⊤​𝒗−h​(𝒗)}superscriptℎ⋆𝒙subscriptsupremum𝒗superscriptℝ𝑑superscript𝒙top𝒗ℎ𝒗h^{\star}(\bm{x})=\sup_{\bm{v}\in\mathbb{R}^{d}}\{\bm{x}^{\top}\bm{v}-h(\bm{v})\}.The goal is to find 𝒙¯≔argmin𝒙∈ℝd​F​(𝒙)≔¯𝒙subscriptargmin𝒙superscriptℝ𝑑𝐹𝒙\bar{\bm{x}}\coloneqq\text{argmin}_{\bm{x}\in\mathbb{R}^{d}}F(\bm{x}).In rest of the paper, we will need the following notations.We denote by ϵ​(𝒙)=F​(𝒙)−F​(𝒙¯)italic-ϵ𝒙𝐹𝒙𝐹¯𝒙\epsilon(\bm{x})=F(\bm{x})-F(\bar{\bm{x}}) the sub-optimality gap of F​(𝒙)𝐹𝒙F(\bm{x}), and by G​(𝒙,𝒘)=F​(𝒙)−(−FD​(𝒘))𝐺𝒙𝒘𝐹𝒙subscript𝐹𝐷𝒘G(\bm{x},\bm{w})=F(\bm{x})-(-F_{D}(\bm{w})) the duality gap between the primal and the dual solutions, which is an upper bound on ϵ​(𝒙)italic-ϵ𝒙\epsilon(\bm{x}) for all 𝒙∈ℝd𝒙superscriptℝ𝑑\bm{x}\in\mathbb{R}^{d}.We further use the shorthand G​(𝒙)𝐺𝒙G(\bm{x}) for G​(𝒙,𝒘)𝐺𝒙𝒘G(\bm{x},\bm{w}) when 𝒘=∇f​(A​𝒙)𝒘∇𝑓𝐴𝒙\bm{w}=\nabla f(A\bm{x}).For 𝒘=∇f​(A​𝒙)𝒘∇𝑓𝐴𝒙\bm{w}=\nabla f(A\bm{x}), using the Fenchel-Young property f​(A​𝒙)+f⋆​(𝒘)=(A​𝒙)⊤​𝒘𝑓𝐴𝒙superscript𝑓⋆𝒘superscript𝐴𝒙top𝒘f(A\bm{x})+f^{\star}(\bm{w})=(A\bm{x})^{\top}\bm{w}, G​(𝒙)𝐺𝒙G(\bm{x}) can be written asG​(𝒙)=∑i=1dGi​(𝒙)𝐺𝒙superscriptsubscript𝑖1𝑑subscript𝐺𝑖𝒙G(\bm{x})=\sum_{i=1}^{d}G_{i}(\bm{x}) where Gi​(𝒙)=(gi⋆​(−𝒂i⊤​𝒘)+gi​(xi)+xi​𝒂i⊤​𝒘)subscript𝐺𝑖𝒙subscriptsuperscript𝑔⋆𝑖superscriptsubscript𝒂𝑖top𝒘subscript𝑔𝑖subscript𝑥𝑖subscript𝑥𝑖superscriptsubscript𝒂𝑖top𝒘G_{i}(\bm{x})=\left(g^{\star}_{i}(-\bm{a}_{i}^{\top}\bm{w})+g_{i}(x_{i})+x_{i}\bm{a}_{i}^{\top}\bm{w}\right) is the it​hsuperscript𝑖𝑡ℎi^{th} coordinate-wise duality gap. Finally, we denote by κi=u¯−xisubscript𝜅𝑖¯𝑢subscript𝑥𝑖\kappa_{i}=\bar{u}-x_{i} the it​hsuperscript𝑖𝑡ℎi^{th} dual residue where u¯=arg​minu∈∂gi⋆​(−𝒂i⊤​𝒘)⁡|u−xi|¯𝑢subscriptargmin𝑢subscriptsuperscript𝑔⋆𝑖subscriptsuperscript𝒂top𝑖𝒘𝑢subscript𝑥𝑖\bar{u}=\operatorname*{arg\,min}_{u\in\partial g^{\star}_{i}(-\bm{a}^{\top}_{i}\bm{w})}|u-x_{i}| with 𝒘=∇f​(A​𝒙)𝒘∇𝑓𝐴𝒙\bm{w}=\nabla f(A\bm{x}). + +Our coordinate selection approach works for a class ℋℋ\mathcal{H} of update rules for the decision variable xisubscript𝑥𝑖x_{i}.For the ease of exposition, we defer the formal definition of the class ℋℋ\mathcal{H} (Definition 4) to the supplementary materials and give here an informal but more insightful definition.The class ℋℋ\mathcal{H} uses the following reference update rule for xisubscript𝑥𝑖x_{i}, when f​(⋅)𝑓⋅f(\cdot) is 1/β1𝛽1/\beta-smooth and gisubscript𝑔𝑖g_{i} is μisubscript𝜇𝑖\mu_{i}-strongly convex: xit+1=xit+sit​κitsuperscriptsubscript𝑥𝑖𝑡1superscriptsubscript𝑥𝑖𝑡superscriptsubscript𝑠𝑖𝑡superscriptsubscript𝜅𝑖𝑡x_{i}^{t+1}=x_{i}^{t}+s_{i}^{t}\kappa_{i}^{t}, where + +sit=min⁡{1,Git+μi​|κit|2/2|κit|2​(μi+‖𝒂i‖2/β)}.superscriptsubscript𝑠𝑖𝑡1superscriptsubscript𝐺𝑖𝑡subscript𝜇𝑖superscriptsuperscriptsubscript𝜅𝑖𝑡22superscriptsuperscriptsubscript𝜅𝑖𝑡2subscript𝜇𝑖superscriptnormsubscript𝒂𝑖2𝛽s_{i}^{t}=\min\left\{1,\frac{G_{i}^{t}+\mu_{i}|\kappa_{i}^{t}|^{2}/2}{|\kappa_{i}^{t}|^{2}(\mu_{i}+\|\bm{a}_{i}\|^{2}/\beta)}\right\}.(3)κitsubscriptsuperscript𝜅𝑡𝑖\kappa^{t}_{i}, the it​hsuperscript𝑖𝑡ℎi^{th} dual residue at time t𝑡t, and Gitsuperscriptsubscript𝐺𝑖𝑡G_{i}^{t}, the it​hsuperscript𝑖𝑡ℎi^{th} coordinate-wise duality gap at time t𝑡t, quantify the sub-optimality along coordinate i𝑖i.Because of (3), the effect of sitsubscriptsuperscript𝑠𝑡𝑖s^{t}_{i} is to increase the step size of the update of xitsubscriptsuperscript𝑥𝑡𝑖x^{t}_{i} when Gitsuperscriptsubscript𝐺𝑖𝑡G_{i}^{t} is large.The class ℋℋ\mathcal{H} contains also all update rules that decrease the cost function faster than the reference update rule (see two criteria (11) and (12) in Definition 4 in the supplementary materials.For example, the update rules in [18] and [11] for Lasso, the update rules in [20] for hinge-loss SVM and ridge regression, the update rule in [6] for the strongly convex functions, in addition to the reference update rule defined above, belong to this class ℋℋ\mathcal{H}. + +We begin our analysis with a lemma that provides the marginal decrease ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i} of updating a coordinate i∈[d]𝑖delimited-[]𝑑i\in[d] according to any update rule in the class ℋℋ\mathcal{H}. + +In the proof of Lemma 1 in the supplementary materials, the decrease of the cost function is upper-bounded using the smoothness property of f​(⋅)𝑓⋅f(\cdot) and the convexity of gi​(⋅)subscript𝑔𝑖⋅g_{i}(\cdot) for any update rule in the class ℋℋ\mathcal{H}. + +In first setting, which we call full information setting, we assume that we have computed ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i} for all i∈[d]𝑖delimited-[]𝑑i\in[d] and all t𝑡t (we will relax this assumption in Section 2.4).Our first algorithm max_r makes then a greedy use of Lemma 1, by simply choosing at time t𝑡t the coordinate i𝑖i with the largest ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i}. + +If functions gi​(⋅)subscript𝑔𝑖⋅g_{i}(\cdot) are strongly convex (i.e., μi>0subscript𝜇𝑖0\mu_{i}>0), then max_r results in a linear convergence rate and matches the lower bound in [2]. + +Now, if functions gi​(⋅)subscript𝑔𝑖⋅g_{i}(\cdot) are not necessary strongly convex (i.e., μi=0subscript𝜇𝑖0\mu_{i}=0), max_r is also very effective and outperforms the state-of-the-art. + +To make the convergence bounds (6) and (7) easier to understand, assume that μi=μ1subscript𝜇𝑖subscript𝜇1\mu_{i}=\mu_{1} and that the data is normalized, so that ‖𝒂i‖=1normsubscript𝒂𝑖1\|\bm{a}_{i}\|=1 for all i∈[d]𝑖delimited-[]𝑑i\in[d].First, by letting η=O​(d)𝜂𝑂𝑑\eta=O(d) be an upper bound on mini∈[d]⁡G​(𝒙t)/Gi​(𝒙t)subscript𝑖delimited-[]𝑑𝐺superscript𝒙𝑡subscript𝐺𝑖superscript𝒙𝑡\min_{i\in[d]}\nicefrac{{G(\bm{x}^{t})}}{{G_{i}(\bm{x}^{t})}} for all iterations l∈[t]𝑙delimited-[]𝑡l\in[t],Theorem 1 results in a linear convergence rate, i.e., ϵ​(𝒙t)=O​(exp⁡(−c1​t/η))italic-ϵsuperscript𝒙𝑡𝑂subscript𝑐1𝑡𝜂\epsilon(\bm{x}^{t})=O\left(\exp(-c_{1}t/\eta)\right) for some constant c1>0subscript𝑐10c_{1}>0 that depends on μ1subscript𝜇1\mu_{1} and β𝛽\beta, whereas Theorem 2 provides a sublinear convergence guarantee, i.e., ϵ​(𝒙t)=O​(η2/t)italic-ϵsuperscript𝒙𝑡𝑂superscript𝜂2𝑡\epsilon(\bm{x}^{t})=O\left(\eta^{2}/t\right). + +Second, note that in both convergence guarantees, we would like to have a small η𝜂\eta. The ratio η𝜂\eta can be as large as d𝑑d, when the different coordinate-wise gaps Gi​(𝒙t)subscript𝐺𝑖superscript𝒙𝑡G_{i}(\bm{x}^{t}) are equal. In this case, non-uniform sampling does not bring any advantage over uniform sampling, as expected.In contrast, if for instance c⋅G​(𝒙t)≤maxi∈[d]⁡Gi​(𝒙t)⋅𝑐𝐺superscript𝒙𝑡subscript𝑖delimited-[]𝑑subscript𝐺𝑖superscript𝒙𝑡c\cdot G(\bm{x}^{t})\leq\max_{i\in[d]}G_{i}(\bm{x}^{t}) for some constant 1/d≤c≤11𝑑𝑐1\nicefrac{{1}}{{d}}\leq c\leq 1, then choosing the coordinate with the largest ritsuperscriptsubscript𝑟𝑖𝑡r_{i}^{t} results in a decrease in the cost function, that is 1≤c⋅d1⋅𝑐𝑑1\leq c\cdot d times larger compared to uniform sampling.Theorems 1 and 2 are proven in the supplementary materials. + +Finally, let us compare the bound of max_r given in Theorem 2 with the state-of-the-art bounds of ada_gap in Theorem 3.7 of [15] and of CD algorithm in Theorem 2 of [8]. For the sake of simplicity, assume that ‖𝒂i‖=1normsubscript𝒂𝑖1\|\bm{a}_{i}\|=1 for all i∈[d]𝑖delimited-[]𝑑i\in[d].When c⋅G​(𝒙t)≤maxi∈[d]⁡Gi​(𝒙t)⋅𝑐𝐺superscript𝒙𝑡subscript𝑖delimited-[]𝑑subscript𝐺𝑖superscript𝒙𝑡c\cdot G(\bm{x}^{t})\leq\max_{i\in[d]}G_{i}(\bm{x}^{t}) and some constant 1/d≤c≤11𝑑𝑐1\nicefrac{{1}}{{d}}\leq c\leq 1,the convergence guarantee for ada_gap is 𝔼​[ϵ​(𝒙t)]=O​(d​L2/β​(c2+1/d)3/2​(2​d+t))𝔼delimited-[]italic-ϵsuperscript𝒙𝑡𝑂𝑑superscript𝐿2𝛽superscriptsuperscript𝑐21𝑑322𝑑𝑡\mathbb{E}\left[\epsilon(\bm{x}^{t})\right]=O\left(\nicefrac{{\sqrt{d}L^{2}}}{{\beta(c^{2}+1/d)^{3/2}(2d+t)}}\right) and the convergence guarantee of the CD algorithm in [8] is 𝔼​[ϵ​(𝒙t)]=O​(d​L2/β​c​(2​d+t))𝔼delimited-[]italic-ϵsuperscript𝒙𝑡𝑂𝑑superscript𝐿2𝛽𝑐2𝑑𝑡\mathbb{E}\left[\epsilon(\bm{x}^{t})\right]=O\left(\nicefrac{{dL^{2}}}{{\beta c(2d+t)}}\right),which are much tighter than the convergence guarantee of CD with uniform sampling𝔼​[ϵ​(𝒙t)]=O​(d2​L2/β​(2​d+t))𝔼delimited-[]italic-ϵsuperscript𝒙𝑡𝑂superscript𝑑2superscript𝐿2𝛽2𝑑𝑡\mathbb{E}\left[\epsilon(\bm{x}^{t})\right]=O\left(\nicefrac{{d^{2}L^{2}}}{{\beta(2d+t)}}\right).In contrast, the convergence guarantee of max_r isϵ​(𝒙t)=O​(L2/β​c2​(2​d+t))italic-ϵsuperscript𝒙𝑡𝑂superscript𝐿2𝛽superscript𝑐22𝑑𝑡\epsilon(\bm{x}^{t})=O\left(\nicefrac{{L^{2}}}{{\beta c^{2}(2d+t)}}\right),which is d/c𝑑𝑐\sqrt{d}/c times better than ada_gap, d​c𝑑𝑐dc times better than the CD algorithm in [8] and c2​d2superscript𝑐2superscript𝑑2c^{2}d^{2} times better than uniform sampling for the same constant c≥1/d𝑐1𝑑c\geq\nicefrac{{1}}{{d}}. + +State-of-the-art algorithms and max_r require knowing a sub-optimality metric (e.g., Gitsuperscriptsubscript𝐺𝑖𝑡G_{i}^{t} in [15, 8], the norm of gradient ∇iF​(𝒙t)subscript∇𝑖𝐹superscript𝒙𝑡\nabla_{i}F(\bm{x}^{t}) in [13], the marginal decreases ritsuperscriptsubscript𝑟𝑖𝑡r_{i}^{t} in this work) for all coordinates i∈[d]𝑖delimited-[]𝑑i\in[d], which can be computationally expensive if the number of coordinates d𝑑d is large. To overcome this problem, we use a novel approach inspired by the bandit framework that learns the best coordinates over time from the partial information it receives during the training. + +Multi-armed Bandit: In a multi-armed bandit (MAB) problem, there are d𝑑d possible arms (which are here the coordinates) that a bandit algorithm can choose from for a reward (ritsuperscriptsubscript𝑟𝑖𝑡r_{i}^{t} in this work) at time t𝑡t.The goal of the MAB is to maximize the cumulative rewards that it receives over T𝑇T rounds (i.e., ∑i=1Trittsuperscriptsubscript𝑖1𝑇superscriptsubscript𝑟subscript𝑖𝑡𝑡\sum_{i=1}^{T}r_{i_{t}}^{t}, where itsubscript𝑖𝑡i_{t} is the arm (coordinate) selected at time t𝑡t).After each round, the MAB only observes the reward of the selected arm itsubscript𝑖𝑡i_{t}, and hence has only access to partial information, which it then uses to refine its arm (coordinate) selection strategy for the next round. + +In our second algorithm B_max_r, the marginal decreases ritsuperscriptsubscript𝑟𝑖𝑡r_{i}^{t} computed for all i∈[d]𝑖delimited-[]𝑑i\in[d] at each round t𝑡t by max_r are replaced by estimates r¯isubscript¯𝑟𝑖\bar{r}_{i} computed by an MAB as follows. First, time is divided into bins of size E𝐸E. At the beginning of a bin tesubscript𝑡𝑒t_{e}, the marginal decreases ritesubscriptsuperscript𝑟subscript𝑡𝑒𝑖r^{t_{e}}_{i} of all coordinates i∈[d]𝑖delimited-[]𝑑i\in[d] are computed, and the estimates are set to these values (r¯it=ritesuperscriptsubscript¯𝑟𝑖𝑡subscriptsuperscript𝑟subscript𝑡𝑒𝑖\bar{r}_{i}^{t}=r^{t_{e}}_{i} for all i∈[d]𝑖delimited-[]𝑑i\in[d]). At each iteration te≤t≤te+Esubscript𝑡𝑒𝑡subscript𝑡𝑒𝐸t_{e}\leq t\leq t_{e}+E within that bin, with probability ε𝜀\varepsilon a coordinate it∈[d]subscript𝑖𝑡delimited-[]𝑑i_{t}\in[d] is selected uniformly at random, and otherwise (with probability (1−ε)1𝜀(1-\varepsilon)) the coordinate with the largest r¯itsuperscriptsubscript¯𝑟𝑖𝑡\bar{r}_{i}^{t} is selected.Coordinate itsubscript𝑖𝑡i_{t} is next updated, as well as the estimate of the marginal decrease r¯itt+1=ritt+1superscriptsubscript¯𝑟subscript𝑖𝑡𝑡1subscriptsuperscript𝑟𝑡1subscript𝑖𝑡\bar{r}_{i_{t}}^{t+1}=r^{t+1}_{i_{t}}, whereas the other estimates r¯jt+1superscriptsubscript¯𝑟𝑗𝑡1\bar{r}_{j}^{t+1} remain unchanged for j≠it𝑗subscript𝑖𝑡j\neq{i_{t}}.The algorithm can be seen as a modified version of ε𝜀\varepsilon-greedy (see [3]) that is developed for the setting where the reward of arms follow a fixed probability distribution,ε𝜀\varepsilon-greedy uses the empirical mean of the observed rewards as an estimate of the rewards. In contrast, in our setting, the rewards do not follow such a fixed probability distribution and the most recently observed reward is the best estimate of the reward that we could have.In B_max_r, we choose E𝐸E not too large and ε𝜀\varepsilon large enough such that every arm (coordinate) is sampled often enough to maintain an accurate estimate of the rewards ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i} (we use E=O​(d)𝐸𝑂𝑑E=O(d) and ε=1/2𝜀12\varepsilon=\nicefrac{{1}}{{2}} in the experiments of Section 4). + +The next proposition shows the effect of the estimation error on the convergence rate. + +What is the effect of c​(E,ε)𝑐𝐸𝜀c(E,\varepsilon)?In Proposition 2, c=c​(E,ε)𝑐𝑐𝐸𝜀c=c(E,\varepsilon) upper bounds the estimation error of the marginal decreases ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i}.To make the effect of c​(E,ε)𝑐𝐸𝜀c(E,\varepsilon) on the convergence bound (8) easier to understand, let ε=1/2𝜀12\varepsilon=\nicefrac{{1}}{{2}}, thenα∼1/(1/d2+1/η2​c)similar-to𝛼11superscript𝑑21superscript𝜂2𝑐\alpha\sim\nicefrac{{1}}{{\left(\nicefrac{{1}}{{d^{2}}}+\nicefrac{{1}}{{\eta^{2}c}}\right)}}.We can see from the convergence bound (8) and the value of α𝛼\alpha that if c𝑐c is large, the convergence rate is proportional to d2superscript𝑑2d^{2} similarly to uniform sampling (i.e., ϵ​(𝒙t)∈O​(d2/t)italic-ϵsuperscript𝒙𝑡𝑂superscript𝑑2𝑡\epsilon(\bm{x}^{t})\in O(\nicefrac{{d^{2}}}{{t}})).Otherwise, if c𝑐c is small, the convergence rate is similar to max_r (ϵ​(𝒙t)∈O​(η2/t)italic-ϵsuperscript𝒙𝑡𝑂superscript𝜂2𝑡\epsilon(\bm{x}^{t})\in O(\nicefrac{{\eta^{2}}}{{t}}), see Theorem 2). + +How to control c=c​(E,ε)𝑐𝑐𝐸𝜀c=c(E,\varepsilon)?We can control the value of c𝑐c by varying the bin size E𝐸E.Doing so, there is a trade-off between the value of c𝑐c and the average computational cost of an iteration.On the one hand, if we set the bin size to E=1𝐸1E=1 (i.e., full information setting), then c=1𝑐1c=1 and B_max_r boils down to max_r, while the average computational cost of an iteration is O​(n​d)𝑂𝑛𝑑O(nd).On the other hand, if E>1𝐸1E>1 (i.e., partial information setting), then c≥1𝑐1c\geq 1, while the average computational complexity of an iteration is O​(n​d/E)𝑂𝑛𝑑𝐸O(\nicefrac{{nd}}{{E}}). In our experiments, we find that by setting d/2≤E≤d𝑑2𝐸𝑑\nicefrac{{d}}{{2}}\leq E\leq d, B_max_r converges faster than uniform sampling (and other state-of-the-art methods) while the average computational cost of an iteration is O​(n+log⁡d)𝑂𝑛𝑑O(n+\log d), similarly to the computational cost of an iteration of CD with uniform sampling (O​(n)𝑂𝑛O(n)), see Figures 2 and 3.We also find that any exploration parameter ε∈[0.2,0.7]𝜀0.20.7\varepsilon\in[0.2,0.7] in B_max_r works reasonably well.The proof of Proposition 2 is similar to the proof of Theorem 2 and is given in the supplementary materials. + +Non-uniform coordinate selection has been proposed first for constant (non-adaptive) probability distributions p𝑝p over [d]delimited-[]𝑑[d].In [24], pisubscript𝑝𝑖p_{i} is proportional to the Lipschitz constant of gi⋆subscriptsuperscript𝑔⋆𝑖g^{\star}_{i}.Similar distributions are used in [1, 23] for strongly convex f𝑓f in (1). + +Time varying (adaptive) distributions, such as pit=|κit|/(∑j=1d|κjt|)subscriptsuperscript𝑝𝑡𝑖subscriptsuperscript𝜅𝑡𝑖superscriptsubscript𝑗1𝑑subscriptsuperscript𝜅𝑡𝑗p^{t}_{i}=|\kappa^{t}_{i}|/(\sum_{j=1}^{d}|\kappa^{t}_{j}|) [6], andpit=Gi​(𝒙t)/G​(𝒙t)subscriptsuperscript𝑝𝑡𝑖subscript𝐺𝑖superscript𝒙𝑡𝐺superscript𝒙𝑡p^{t}_{i}=G_{i}(\bm{x}^{t})/G(\bm{x}^{t}) [15, 14], have also been considered.In all these cases, the full information setting is used, which requires the computation of the distribution ptsuperscript𝑝𝑡p^{t} (Ω​(n​d)Ω𝑛𝑑\Omega(nd) calculations) at each step.To bypass this problem, heuristics are often used; e.g., ptsuperscript𝑝𝑡p^{t} is calculated once at the beginning of an epoch of length E𝐸E and is left unchanged throughout the remainder of that epoch. This heuristic approach does not work well in a scenario where Gi​(𝒙t)subscript𝐺𝑖superscript𝒙𝑡G_{i}(\bm{x}^{t}) varies significantly.In [8] a similar idea to max_r is used with risubscript𝑟𝑖r_{i} replaced by Gisubscript𝐺𝑖G_{i}, but only in the full information setting. Because of the update rule used in [8], the convergence rate is O​(d⋅max⁡Gi​(𝒙t)/G​(𝒙t))𝑂⋅𝑑subscript𝐺𝑖superscript𝒙𝑡𝐺superscript𝒙𝑡O\left(d\cdot\max G_{i}(\bm{x}^{t})/G(\bm{x}^{t})\right) times slower than Theorem 2 (see also the comparison at the end of Section 2.3).The Gauss-Southwell rule (GS) is another coordinate selection strategy for smooth cost functions [21] and its convergence is studied in [13] and [22]. GS selects the coordinate to update as the one that maximizes |∇iF​(𝒙t)|subscript∇𝑖𝐹superscript𝒙𝑡|\nabla_{i}F(\bm{x}^{t})| at time t𝑡t.max_r can be seen as an extension of GS to a broader class of cost functions (see Lemma 2 in the supplementary materials). Furthermore, when only sub-gradients are defined for gi​(⋅)subscript𝑔𝑖⋅g_{i}(\cdot), GS needs to solve a proximal problem. To address the computational tractability of GS, in [22], lower and upper bounds on the gradients are computed (instead of computing the gradient itself) and used for selecting the coordinates, but these lower and upper bounds might be loose and/or difficult to find.For example, without a heavy pre-processing of the data, ASCD in [22] converges with the same rate as uniform sampling when the data is normalized and f​(A​𝒙)=‖A​𝒙−𝒀‖2𝑓𝐴𝒙superscriptnorm𝐴𝒙𝒀2f(A\bm{x})=\|A\bm{x}-\bm{Y}\|^{2}. + +In contrast, our principled approach leverages a bandit algorithm to learn a good estimate of ritsubscriptsuperscript𝑟𝑡𝑖r^{t}_{i}; this allows for theoretical guarantees and outperforms the state-of-the-art methods, as we will see in Section 4.Furthermore, our approach does not require the cost function to be strongly convex (contrary to e.g., [6, 13]) + +Bandit approaches have very recently been used to accelerate various stochastic optimization algorithms; among these works [12, 17, 16, 4] focus on improving the convergence of SGD by reducing the variance of the estimator for the gradient.A bandit approach is also used in [12] to sample for CD.However, instead of using the bandit to minimize the cost function directly as in B_max_r, it is used to minimize the variance of the estimated gradient. This results in a O​(1/t)𝑂1𝑡O(1/\sqrt{t}) convergence, whereas the approach in our paper attains an O​(1/t)𝑂1𝑡O(1/t) rate of convergence.In [16] bandits are used to find the coordinate i𝑖i whose gradient has the largest magnitude (similar to GS). At each round t𝑡t a stochastic bandit problem is solved from scratch, ignoring all past information prior to t𝑡t, which, depending on the number of datapoints, might require many iterations. In contrast, our method incorporates past information and needs only one sample per iteration. + +We compare the algorithms from this paper with the state-of-the-art approaches, in two ways.First, we compare the algorithm (max_r) for full information setting as in Section 2.3 against other state-of-the-art methods that similarly use O​(d⋅z¯)𝑂⋅𝑑¯𝑧O(d\cdot\bar{z}) computations per epoch of size d𝑑d, where z¯¯𝑧\bar{z} denotes the number of non-zero elements of A𝐴A.Next, we compare the algorithm for partial information setting as in Section 2.4 (B_max_r) against other methods with appropriate heuristic modifications that also allow them to use O​(z¯)𝑂¯𝑧O(\bar{z}) computations per epoch.The datasets we use are found in [5]; we consider usps, aloi and protein for regression, and w8a and a9a for binary classification (see Table 2 in the supplementary materials for statistics about these datasets). + +Various cost functions are considered for the experiments, including a strongly convex cost function (ridge regression) and non-smooth cost functions (Lasso and L1subscript𝐿1L_{1}-regularized logistic regression).These cost functions are optimized using different algorithms, which minimize either the primal or the dual cost function. The convergence time is the metric that we use to evaluate different algorithms. + +Benchmarks for Adaptive Algorithm (max_r):•uniform [18]: Sample a coordinate i∈[n]𝑖delimited-[]𝑛i\in[n] uniformly at random.333If ‖𝒂i‖=‖𝒂j‖normsubscript𝒂𝑖normsubscript𝒂𝑗\|\bm{a}_{i}\|=\|\bm{a}_{j}\| ∀i,j∈[n]for-all𝑖𝑗delimited-[]𝑛\forall i,j\in[n], importance sampling method in [24] is equivalent to uniform in Lasso and logistic regression.•ada_gap [15]: Sample a coordinate i∈[n]𝑖delimited-[]𝑛i\in[n] with probability Gi​(𝒙t)/G​(𝒙t)subscript𝐺𝑖superscript𝒙𝑡𝐺superscript𝒙𝑡G_{i}(\bm{x}^{t})/G(\bm{x}^{t}). + +Benchmarks for Adaptive-Bandit Algorithm (B_max_r):For comparison, in addition to the uniform sampling, we consider the coordinate selection method that has the best performance empirically in [15] and two accelerated CD methods NUACDM in [1] and Approx in [9].•gpe [15]: This algorithm is a heuristic version of ada_gap, where the sampling probabilitypit=Gi​(𝒙t)/G​(𝒙t)subscriptsuperscript𝑝𝑡𝑖subscript𝐺𝑖superscript𝒙𝑡𝐺superscript𝒙𝑡p^{t}_{i}=G_{i}(\bm{x}^{t})/G(\bm{x}^{t}) for i∈[d]𝑖delimited-[]𝑑i\in[d] is re-computed once at the beginning of each bin of length E𝐸E.•NUACDM [1]:Sample a coordinate i∈[d]𝑖delimited-[]𝑑i\in[d] with probability proportional to the square root of smoothness of the cost function along the it​hsuperscript𝑖𝑡ℎi^{th} coordinate, then use an unbiased estimator for the gradient to update the decision variables.•Approx [9]: Sample a coordinate i∈[d]𝑖delimited-[]𝑑i\in[d] uniformly at random, then use an unbiased estimator for the gradient to update the decision variables.NUACDM is the state-of-the-art accelerated CD method (see Figures 2 and 3 in [1]) for smooth cost functions.Approx is an accelerated CD method proposed for cost functions with non-smooth gi​(⋅)subscript𝑔𝑖⋅g_{i}(\cdot) in (1). We implemented Approx for such cost functions in Lasso and L1subscript𝐿1L_{1}-reguralized logistic regression.We also implemented Approx for ridge-regression but NUACDM converged faster in our setting, whereas for the smoothen version of Lasso but Approx converged faster than NUACDM in our setting.The origin of the computational cost is two-fold: Sampling a coordinate i𝑖i and updating it.The average computational cost of the algorithms for E=d/2𝐸𝑑2E=d/2 is depicted in Table 1. Next, we explain the setups and update rules used in the experiments. + +For Lasso F​(𝒙)=1/2​n​‖𝒀−A​𝒙‖2+∑i=1nλ​|xi|𝐹𝒙12𝑛superscriptnorm𝒀𝐴𝒙2superscriptsubscript𝑖1𝑛𝜆subscript𝑥𝑖F(\bm{x})=\nicefrac{{1}}{{2n}}\|\bm{Y}-A\bm{x}\|^{2}+\sum_{i=1}^{n}\lambda|x_{i}|.We consider the stingyCD update proposed in [11]: xit+1=arg​minz⁡[f​(A​𝒙t+(z−xit)​𝒂i)]+gi​(xi)superscriptsubscript𝑥𝑖𝑡1subscriptargmin𝑧𝑓𝐴superscript𝒙𝑡𝑧subscriptsuperscript𝑥𝑡𝑖subscript𝒂𝑖subscript𝑔𝑖subscript𝑥𝑖x_{i}^{t+1}=\operatorname*{arg\,min}_{z}\left[f(A\bm{x}^{t}+(z-x^{t}_{i})\bm{a}_{i})\right]+g_{i}(x_{i}).In Lasso, the gisubscript𝑔𝑖g_{i}s are not strongly convex (μi=0subscript𝜇𝑖0\mu_{i}=0).Therefore, for computing the dual residue, the Lipschitzing technique in [7] is used, i.e., gi​(⋅)subscript𝑔𝑖⋅g_{i}(\cdot) is assumed to have bounded support of size B=F​(𝒙0)/λ𝐵𝐹superscript𝒙0𝜆B=\nicefrac{{F(\bm{x}^{0})}}{{\lambda}} and gi⋆​(ui)=B​max⁡{|ui|−λ,0}subscriptsuperscript𝑔⋆𝑖subscript𝑢𝑖𝐵subscript𝑢𝑖𝜆0g^{\star}_{i}(u_{i})=B\max\left\{|u_{i}|-\lambda,0\right\}. + +For logistic regression F​(𝒙)=1/n​∑i=1nlog⁡(1+exp⁡(−yi⋅𝒙⊤​𝒂i))+∑i=1nλ​|xi|𝐹𝒙1𝑛superscriptsubscript𝑖1𝑛1⋅subscript𝑦𝑖superscript𝒙topsubscript𝒂𝑖superscriptsubscript𝑖1𝑛𝜆subscript𝑥𝑖F(\bm{x})=\nicefrac{{1}}{{n}}\sum_{i=1}^{n}\log\left(1+\exp(-y_{i}\cdot\bm{x}^{\top}\bm{a}_{i})\right)+\sum_{i=1}^{n}\lambda|x_{i}|.We consider the update rule proposed in [18]: xit+1=s4​λ​(xit−4​∂f​(A​𝒙t)/∂xi)superscriptsubscript𝑥𝑖𝑡1subscript𝑠4𝜆superscriptsubscript𝑥𝑖𝑡4𝑓𝐴superscript𝒙𝑡subscript𝑥𝑖x_{i}^{t+1}=s_{4\lambda}(x_{i}^{t}-4\partial f(A\bm{x}^{t})/\partial x_{i}), where sλ​(q)=sign​(q)​max⁡{|q|−λ,0}subscript𝑠𝜆𝑞sign𝑞𝑞𝜆0s_{\lambda}(q)=\text{sign}(q)\max\{|q|-\lambda,0\}. + +For ridge regression F​(𝒙)=1/n​‖𝒀−A​𝒙‖2+λ/2​‖𝒙‖2𝐹𝒙1𝑛superscriptnorm𝒀𝐴𝒙2𝜆2superscriptnorm𝒙2F(\bm{x})=\nicefrac{{1}}{{n}}\|\bm{Y}-A\bm{x}\|^{2}+\nicefrac{{\lambda}}{{2}}\|\bm{x}\|^{2} and it is strongly convex.We consider the update proposed for the dual of ridge regression in [20], hence B_max_r and other adaptive methods select one of the dual decision variables to update. + +In all experiments, λ𝜆\lambdas are chosen such that the test and train errors are comparable, and all update rules belong to ℋℋ\mathcal{H}.In addition, in all experiments, E=d/2𝐸𝑑2E=d/2 in B_max_r and gap_per_epoch. Recall that when minimizing the primal, d𝑑d is the number of features and when minimizing the dual, d𝑑d is the number of datapoints. + +Figure 2 shows the result for Lasso. Among the adaptive algorithms, max_r outperforms the state-of-the-art (see Figures 2(a), 2(b) and 2(c)).Among the adaptive-bandit algorithms, B_max_r outperforms the benchmarks (see Figures 2(d), 2(e) and 2(f)).We also see that B_max_r converges slower than max_r for the same number of iterations, but we note that an iteration of B_max_r is O​(d)𝑂𝑑O(d) times cheaper than max_r.For logistic regression, see Figures 3(a), 3(b), 3(e) and 3(f).Again, those algorithms outperform the state-of-the-art. We also see that B_max_r converges with the same rate as max_r.We see that the accelerated CD method Approx converges faster than uniform sampling and gap_per_epoch, but using B_max_r improves the convergence rate and reaches a lower sub-optimality gap ϵitalic-ϵ\epsilon with the same number of iterations.For ridge regression, we see in Figures 3(c), 3(d) that max_r converges faster than the state-of-the-art ada-gap.We also see in Figures 3(g), 3(h) that B_max_r converges faster than other algorithms.gap_per_epoch performs poorly because it is unable to adapt to the variability of the coordinate-wise duality gaps Gisubscript𝐺𝑖G_{i} that vary a lot from one iteration to the next.In contrast, this variation slows down the convergence of B_max_r compared to max_r, but B_max_r is still able to cope with this change by exploring and updating the estimations of the marginal decreases.In the experiments we report the sub-optimality gap as a function of the number of iterations, but the results are also favourable when we report them as a function of actual time. To clarify, we compare the clock time needed by each algorithm to reach a sub-optimality gap ϵ​(𝒙t)=exp⁡(−5)italic-ϵsuperscript𝒙𝑡5\epsilon(\bm{x}^{t})=\exp(-5) in Table 1.444In our numerical experiments, all algorithms are optimized as much as possible by avoiding any unnecessary computations, by using efficient data structures for sampling, by reusing the computed values from past iterations and (if possible) by writing the computations in efficient matrix form. + +Next, we study the choice of parameters ε𝜀\varepsilon and E𝐸E in Algorithm 1. As explained in Section 2.4 the choice of these two parameters affect c𝑐c in Proposition 2, hence the convergence rate. To test the effect of ε𝜀\varepsilon and E𝐸E on the convergence rate, we choose a9a dataset and perform a binary classification on it by using the logistic regression cost function. Figure 4(a) depicts the number of iterations required to reach the log-suboptimality gap log⁡ϵitalic-ϵ\log\epsilon of −55-5. In the top-right corner, ε=1𝜀1\varepsilon=1 and B_max_r becomes CD with uniform sampling (for any value of E𝐸E).As expected, for any ε𝜀\varepsilon, the smaller E𝐸E, the smaller the number of iterations to reach the log-suboptimality gap of −55-5. This means that c​(ε,E)𝑐𝜀𝐸c(\varepsilon,E) is a decreasing function of E𝐸E. Also, we see that as ε𝜀\varepsilon increases, the convergence becomes slower. That implies that for this dataset and cost function c​(ε,E)𝑐𝜀𝐸c(\varepsilon,E) is close to 1 for all ε𝜀\varepsilon hence there is no need for exploration and a smaller value for ε𝜀\varepsilon can be chosen.Figure 4(b) depicts the per epoch clock time for ε=0.5𝜀0.5\varepsilon=0.5 and different values of E𝐸E. Note that the clock time is not a function of ε𝜀\varepsilon. As expected, a smaller bin size E𝐸E results in a larger clock time, because we need to compute the marginal decreases for all coordinates more often. After E=2​d/5𝐸2𝑑5E=2d/5 we see that clock time does not decrease much, this can be explained by the fact that for large enough E𝐸E computing the gradient takes more clock time than computing the marginal decreases. + +In this work, we propose a new approach to select the coordinates to update in CD methods.We derive a lower bound on the decrease of the cost function in Lemma 1, i.e., the marginal decrease, when a coordinate is updated, for a large class of update methods ℋℋ\mathcal{H}.We use the marginal decreases to quantify how much updating a coordinate improves the model.Next, we use a bandit algorithm to learn which coordinates decrease the cost function significantly throughout the course of the optimization algorithm by using the marginal decreases as feedback (see Figure 1).We show that the approach converges faster than state-of-the-art approaches both theoretically and empirically.We emphasize that our coordinate selection approach is quite general and works for a large class of update rules ℋℋ\mathcal{H}, which includes Lasso, SVM, ridge and logistic regression, and a large class of bandit algorithms that select the coordinate to update. + +The bandit algorithm B_max_r uses only the marginal decrease of the selected coordinate to update the estimations of the marginal decreases.An important open question is to understand the effect of having additional budget to choose multiple coordinates at each time t𝑡t. The challenge lies in designing appropriate algorithms to invest this budget to update the coordinate selection strategy such that B_max_r performance becomes even closer to max_r. \ No newline at end of file diff --git a/1712.03087v1.txt b/1712.03087v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..2844c1e6be358796f9ab3de1e69b91bb98cb8fd8 --- /dev/null +++ b/1712.03087v1.txt @@ -0,0 +1,405 @@ +\section{Introduction} +With the coming of knowledge economy era, the competition for skilled talents becomes extremely severe. Indeed, talents who are qualified with employer-targeted skills will get hired easily and obtain attractive reward, such as high compensation and quick promotion. However, there still exists a ``Skill Gap''~\cite{skillgap} between employers and job seekers. Specifically, on the one hand, companies are urgent to seek highly-skilled talents, especially when their demands of job skills change frequently due to the severe business campaigns. On the other hand, to compete against other candidates and outstand from the large personnel pool, job seekers have to acquire certain job skills that target companies pay the most attention on. Such situation is especially significant in massive-population countries like China, where 6 million fresh-graduate students enter the job market every year~\cite{chinagraduate}, far exceeding the number of available jobs on the recruitment market. Therefore, it is very appealing to timely measure the popularity of job skills in recruitment market to guide the employment. + +Indeed, the analysis of job skills with measuring their popularity is not novel. Currently, many organizations like Linkedin~\cite{linkedin} and ComputerWorld~\cite{computerworld} have released annual reports for the hottest job skills, which provide insightful guidance for job seekers. However, there still exists several critical challenges along this line. First, in practice, different people tend to have different criteria for their dream jobs, e.g., some applicants pursue high salary, so they choose the big companies in huge cities, while some others tend to select small companies in hometown, even with lower income. Second, job skills are not isolated, but mutually connected to form the latent connections, e.g., skills like ``Javascript'', ``PHP'' and ``Node.js'' usually appeared together, as they are all necessary for the ``Web Front-End Development''. Therefore, hierarchical structure with mutual connections should be integrated when measuring popularity of jobs skills. + +To address the aforementioned issues, in this paper, we propose a data-driven approach for measuring the popularity of the job skills based on the analysis of large-scale recruitment data. Specifically, we first build a job skill network ``\textbf{Skill-Net}'' by exploring a large corpus of job postings in recruitment market. Then, we develop a novel \textbf{S}kill \textbf{P}opularity based \textbf{T}opic \textbf{M}odel (\textbf{SPTM}) for modeling the generation of job skills. Particularly, SPTM can integrate different criteria of jobs (e.g., salary level, company size), skill categories, and the latent connections within skills. Therefore, with the help of SPTM, we can effectively rank the job skills based on their multi-perspective popularity. Finally, we evaluate the proposed model with real-world recruitment data and extensive experiments. Specifically, the contribution of this paper can be summarized as follows: + +\begin{itemize} + \item We explore to measure the popularity of job skills in recruitment market with a multi-criteria perspective, which can help to eliminate the ``Skill Gap'' between employers and job seekers in talent recruitment. + \item We propose a novel SPTM model based on the analysis of large-scale recruitment data, which can effectively model the relations between categorical skills and job criteria. + \item We evaluate the proposed model with real-world recruitment data and extensive experiments. The experimental results clearly validate the effectiveness of SPTM, and further reveal some interesting discoveries. +\end{itemize} + +\begin{table*}[!t] +\centering +\footnotesize +\caption{A toy example of our job posting dataset.} +\begin{tabular}{ccccccc} +\hline +Post ID & Company Scale & Salary & Location & Financial Round & Work Type & Job Description \\ \hline +1000037 & Medium & Low & Huge Cities & A Round & Fulltime & Familiar with Python... \\ +1000046 & Medium & Very Low & Huge Cities & B Round & Fulltime & Development of Android...\\ +1000082 & Small & Low & Big Cities & D Round & Fulltime & CS Bachelor Degree required...\\ +1000144 & Very Big & High & Huge Cities & Listed & Fulltime & Web-design oriented...\\ +1000268 & Big & Medium & Normal Cities & D Round & Fulltime & Sufficient with Java...\\ +1000462 & Big & High & Huge Cities & Listed & Fulltime & Programming within Linux...\\ +\hline +\end{tabular} +\label{Job Posting Dataset} +\end{table*} + +\begin{figure}[!b] +\centering +\subfigure[Location]{ +\includegraphics[width=3.8cm]{1.png}}\hspace{-2mm} +\subfigure[Company]{ +\includegraphics[width=4cm]{2.png}} +\subfigure[Salary]{ +\includegraphics[width=3.8cm]{3.png}}\hspace{-2mm} +\subfigure[Post Date]{ +\includegraphics[width=4cm]{4.jpg}} +\caption{The distributions of job postings with respect to different information categories.} +\label{histgram} +\end{figure} +\section{Data Description} +In this paper, we attempt to develop a data-driven approach for comprehensively measuring the job skill popularity. Specially, to deal with this task, we collected two real-world recruitment data sets, including a large-scale job posting data set with detailed requirement for providing job criteria and training model, as well as a pre-defined categorical skill list to generate the ``Skill-Net". +\subsection{Job posting Dataset} +\label{sec:JD} +To be specific, we extracted the job posting dataset from a famous online recruiting market~\cite{Zhu2016Recruitment}, ranging from 2013 to 2015, which contains 892,454 job postings in total. Among them, 381,578 records are selected with including at least one detailed skill requirement in their job descriptions. Some examples of job posting in our dataset is presented in Table \ref{Job Posting Dataset}, in which we mainly list the criteria of jobs, while the details of job requirement is omitted. Besides, the distributions of job postings with respect to different information categories are illustrated in Figure~\ref{histgram}. + +Specifically, to summarize the criteria of jobs, we conclude 5 categories of criteria labels as follows: + +\begin{itemize} +\item \textbf{Salary}: Divided into 5 levels (Very High, High, Medium, Low, Very Low), corresponding to monthly salary $>$30k, 20k-30k, 10k-20k, 5k-10k, $<$ 5k respectively. +\item \textbf{Company Scale}: Divided into 5 categories (Very Big, Big, Medium, Small, Very Small), corresponding to the number of employees $>$2000, 500-2000, 100-500, 50-100, $<$ 50, respectively. +\item \textbf{Location}: Divided into 3 categories (Huge Cities, Big Cities, Normal Cities), corresponding to the scale of located cities. +\item \textbf{Financing Round}: Divided into 7 categories (Angel, A, B, C, D, Listed, Unknown), corresponding to the different status of financial round. +\item \textbf{Work Type}: Divided into 3 categories (Fulltime, Part-time, Intern), corresponding to the type of jobs. +\end{itemize} +\subsection{Skill List and ``Skill-Net"} +At the same time, for describing the job skills, we extracted a list of pre-defined skills from an online IT community in China~\cite{skillbase}, including two levels of skills, i.e., the \textbf{skill categories}, and the \textbf{detailed skills} which belongs to one category. Totally, 1,729 skills within 54 categories were extracted. To ensure the quality of our analysis, we have removed several detailed skills that are not well defined or too sparse to be shown in a job description, and then built the standard ``\emph{dictionary}" of job skills for modeling. The frequencies of skills in our job posting dataset and its log form ($e$ as the base) are shown in Figure~\ref{skill distribution}, which indicates the skills suffer a significant \emph{long tail effect}, i.e., only a few job skills are popular in recruitment market. + +\begin{figure}[t] +\centering +\subfigure[Frequency of skills]{ +\includegraphics[width=4cm]{figure_1.png}}\hspace{-2mm} +\subfigure[Frequency of skills - Log]{ +\includegraphics[width=4cm]{figure_2.png}}\hspace{-2mm} +\caption{The distribution of skills frequency, in which Y-axis indicates how many postings contain the skill.} +\label{skill distribution} +\end{figure} + +At the same time, this data set will not only provide the category of skills, but also help to generate the ``\textbf{Skill-Net}''. As mentioned above, job skills are not isolated, but mutually connected following latent hierarchical structure, which cannot be neglected when measuring skill popularity. Unfortunately, no exposed relationship between skills could be directly extracted from original data. Thus, in this paper, based on the standard ``dictionary" above, we pick up the pre-defined skills in each job posting, and then build the ``Skill-Net'' following the heuristic method which is commonly used in social network analysis~\cite{Xu-KDD-2016}. Particularly, we assume that if two skills co-occur in the same job posting, they will be mutually connected. Figure~\ref{Skill Net} shows a snapshot of the ``Skill-Net'', which is generated based on our real-world recruitment dataset. + +\begin{figure}[t] +\centering +\includegraphics[width=6cm]{skillnet.png} +\caption{The snapshot of ``Skill-Net''.} +\label{Skill Net} +\end{figure} +\section{Popularity Modeling for Job Skills} +\begin{figure*}[!t] +\centering +\includegraphics[width=17cm]{resume.jpg}\\ +\caption{The overview of our approach for measuring the popularity of job skills.} +\label{jd} +\end{figure*} + +As the data sets and ``Skill-Net'' are prepared, in this section, we turn to introduce the details of our novel SPTM approach for effectively measuring the popularity of job skills. To facilitate the understanding, we illustrate the overview of our approach for measuring the skill popularity in Figure~\ref{jd}. + +\begin{figure}[t] +\centering +\includegraphics[width=6.5cm]{generate.png} +\caption{The generation of documents in SPTM.} +\label{generation} +\end{figure} +\subsection{Overview of SPTM Model} +Generally, we target at measuring the popularity of skills under different criteria (e.g., salary level, company size, etc.). Therefore, we propose the SPTM approach to learn the latent skill topics combining multi-criteria and hierarchical categories of job skills, which could be used to estimate the popularity of a job skill under certain criteria, via estimating the probability of skill in corresponding topic. + +Specially, in SPTM, we treat each skill, named \textbf{central skill} in our paper, as a ``\emph{document}'' in ``Skill-Net''. Also, those neighboring skills, named \textbf{skill tokens}, are regarded as corresponding ``\emph{word tokens}'' within, which is similar with the basic idea of Topic Model. Figure~\ref{generation} shows an example of the document generation process in SPTM, in which each line of the right part indicates a ``document''. Besides, as we known each job can be classified by some standard criteria. And we further think if a central skill has appeared in a job posting, it should has some relationships with the criteria labels of the job (e.g., very high salary, very big company, etc.). By this assumption, we generate a set of \textbf{criteria labels} for each central skill. + +Just as in LDA, we also use $\theta_{m}$ and $\phi_{k}$ to represent the distribution over topics for $m$-th central skill and the distribution over skills for $k$-th topics. +Besides, to model the connection between criteria labels and central skills, we follow the ideas in~\cite{ramage2009labeled} and associate each topic with a criteria label. Specially, we have $\Lambda_{m_{\star}}$ to presents the criteria labels of $m$-th central skill, where $\Lambda_{m_{\star}}$ is a binary topic presence/absence vector and each $\Lambda_{m_{k}} \in \{0,1\}$. Then to keep the above hypothesis, we generate the $m$-th central skill's distribution over topic $\theta_{m}$ by $Dir(\cdot|\alpha \times \Lambda_{m_{\star}})$. + +Besides, according to our basic assumptions, the popularity of skills will be affected not only by mutual connections and criteria, but also corresponding skill categories, which can further help us understand hierarchical skill relationship from macro perspective. We follow the ideas in~\cite{huai2014toward} and hypothesize each central skill also has a distribution over skill categories. $l_{s}$ is used to represent the skill category of skill $s$ (e.g., the category of skill ``CNN'' is ``machine learning''). Thus the skill token $w_{m,i}$ is finally generated by $Multi(\cdot|\phi_{z_{m,i},l_{m,i}})$. + +The detailed generation process of SPTM is illustrated in Algorithm~\ref{alg:SPTM}, and related mathematical notations are summarized in Table~\ref{notation}. + + +\begin{table}[t!] +\centering +\caption{Mathematical Notations.}\label{notation} +\footnotesize +\begin{tabular}{cc} +\hline +\textbf{Symbol} & \textbf{Description} \\ \hline +$\alpha$ & Dirichlet prior for generating $\theta$ \\ +$\beta$ & Dirichlet prior for generating $\phi$ \\ +$\delta$ & Dirichlet prior for generating $\pi$ \\ +$\gamma$ & Distribution parameters for generating $\Lambda_{m_{\star}}$ \\ +$\pi$ & Distribution parameters for generating $\Lambda_{l_{\star}}$ \\ +$\Lambda_{m_{\star}}$ & Topic presence/absence vector of $m$-th central skill \\ +$\theta_{m}$ & Distribution over topics for $m$-th central skill \\ +$z_{m,i}$ & Topic label of $i$-th skill token of $m$-th central skill \\ +$l_{m,i}$ & skill category of $i$-th skill token of $m$-th central skill \\ +$l_{s}$ & skill category of $s$-th skill \\ +$w_{m,i}$ & $i$-th skill token of $m$-th central skill \\ +$\phi_{k,l}$ & Distribution over skills for $k$-th topic and $l$-th category \\ +$K$ & Number of topics/criteria \\ +$S$ & Number of skills \\ +$L$ & Number of skill categories \\ +$M$ & Number of central skills \\ +$N_m$ & Number of skill tokens of $m$-th central skill \\ +\hline +\end{tabular} +\end{table} + +\begin{algorithm}[t] +\centering +\footnotesize +\caption{The Generation Process of SPTM.}\label{alg:SPTM} +\begin{algorithmic}[1] +\For{each topic $k \in \left\{{1,2,\cdots,K}\right\}$} +\State Generate $\phi_{k} \sim Dir(\cdot|\beta)$ +\EndFor + +\For{each central skill $m \in \left\{{1,2,\cdots,M}\right\}$} +\For{each topic $k \in \left\{{1,2,\cdots,K}\right\}$} +\State Generate $\Lambda_{m_{k}} \in \{0,1\} \sim Bernoulli(\cdot|\gamma_{k})$ +\EndFor +\State Generate $\pi_{m} \sim Dir(\cdot|\delta)$ +\State Generate $\theta_{m} \sim Dir(\cdot|\alpha \times \Lambda_{m_{\star}})$ +\For{each skill token $i \in \left\{{1,2,\cdots,N_{m}}\right\}$} +\State Generate $z_{m,i} \sim Multi(\cdot|\theta_{m})$ +\State Generate $l_{m,i} \sim Multi(\cdot|\pi_{m})$ +\State Generate $w_{m,i} \sim Multi(\cdot|\phi_{z_{m,i},l_{m,i}})$ +\EndFor +\EndFor +\end{algorithmic} +\end{algorithm} +\subsection{Model Inference} +Then, we will introduce the technical solution of model inference. Specially, we use collapsed Gibbs sampling for training, where the sampling probability of $z_{m,i}$, which indicates the topic of $i$-th skill token in $m$-th central skill, is given by: +\begin{footnotesize} +\begin{eqnarray} +P(z_{m,i}=j|z_{m,-i},w_{m,i},l_{m,i})~~~~~~~~~~~~~~~~~~~~~~~ \nonumber\\ +\propto P(w_{m,i},l_{m,i}|z_{m,i}=j,z_{m,-i},w_{m,-i},l_{m,-i})P(z_{m,i}=j|z_{m,-i}), +\end{eqnarray} +\end{footnotesize} + +where $w_{m,-i}$ is all of skill tokens of $m$-th central skill except $i$-th one and $l_{m, -i}$ is similar. $z_{m,-i}$ is the topic labels of $w_{m,-i}$. +Here $P(w_{m,i},l_{m,i}|z_{m,i}=j,z_{m,-i},w_{m,-i},l_{m,-i})$ stands for the appearance probability of the skill token $w_{m,i}$ and its category $l_{m,i}$ given $z_{m,i}=j$, and $P(z_{m,i}=j|z_{m,-i})$ represents the probability of $z_{m,i}=j$ in $m$-th central skill regardless of $i$-th skill token. Then we can calculate these two probabilities as follows: +\begin{footnotesize} +\begin{eqnarray} +\footnotesize +&P(w_{m,i},l_{m,i}|z_{m,i}=j,z_{m,-i},w_{m,-i},l_{m,-i}) \nonumber \\ +&=\frac{n_{w_{m,i},l_{m,i},j,-(m,i)}+\beta_{w}}{\sum_{s=1}^{S}(n_{s,l_{s},j,-(m,i)}+\beta_{s})} \cdot \frac{n_{m,l_{m,i},-(m,i)}+\delta_{l_{m,i}}}{\sum_{l^{'}=1}^{L}(n_{m,l^{'},-(m,i)}+\delta_{l^{'}})}, \\ +&P(z_{m,i}=j|z_{m,-i}) = \frac{(n_{m,j,-(m,i)}+\alpha_{j}) \cdot \Lambda_{m_{j}}}{N_{m}-1+\sum_{k=1}^{K}\alpha_{k}\cdot \Lambda_{m_{k}}}, +\end{eqnarray} +\end{footnotesize} +where $n_{s,l,j,-(m,i)}$ is count of $s$-th skill in $l$-th skill category and $j$-th topic regardless of skill token $w_{m,i}$ and $n_{m,j,-(m,i)}$ is count of $j$-th topic appearing in $m$-th central skill expect $w_{m,i}$. $n_{m,l,-(m,i)}$ is the count of $l$-th skill category appearing in $m$-th central skill expect $w_{m,i}$. +After several iterations of Gibbs sampling, we could then estimate the conditional probability of a skill $w$ and the corresponding skill category $l$ within each topic as follows: +\begin{footnotesize} +\begin{eqnarray} +P(w,l|z=j) = P(s|l,z=j)P(l), ~~~~~~~~~~~~~~~\nonumber \\ +~~~~~~~~~~~= \frac{n_{w,l,j}+\beta_{w} }{\sum_{s^{'}=1}^{S}(n_{s^{'},l_{s^{'}},j}+\beta_{s^{'}})} \frac{n_{m,l}+\delta_{l}}{\sum_{l^{'}=1}^{L}(n_{m,l^{'}}+\delta_{l^{'}})}, +\end{eqnarray} +\end{footnotesize} + +After learning and inferencing of SPTM, we could now measure the popularity of a job skill under different criteria. Specially, given a specific group of criteria $\Delta=\{\Lambda_{m_{i}}\}$, in which each indicates a criterion, (e.g. salary, location, company scale, financial round or work type), considering that different criteria are independent with each other, we can estimate the popularity of skill $w$ and the corresponding skill category $l$ via Bayes' Formula by: +\begin{footnotesize} +\begin{eqnarray} +P(w,l|\Delta) = \sum_{\Lambda_{m_i}\in \Delta}\Big(P(\Lambda_{m_i})\cdot ~~~~~~~~~~~~~~~~~~ \nonumber \\ + ~~~~~~~~~~ \big( \sum_{j=1}^{K}P(z=j|\Lambda_{m_{i}})P(w,l|z=j) \big)\Big). +\end{eqnarray} +\end{footnotesize} +\section{Experiments} +In this section, we will evaluate the effectiveness of our purposed model. Specially, our SPTM will be validated on real-world recruitment data sets compared with two typical baselines. After that, we discuss about the experimental results with capturing some interesting rules, and a case study will be conducted to further confirm our basic ideas. +\subsection{Experimental Setup} +Firstly, we summarize the details of experimental setup in this subsection, including data pre-processing, parameter setting and baseline methods. + +\vspace{2mm} +\noindent\textbf{Data Pre-processing.} +As introduced in Section 2, we conducted our experiments on the real-world dataset collected from an online recruiting market and IT community. To ensure the effectiveness and avoid missing values, we filtered out those job-description records without any detailed skill, which compose of 57.24\% of the original data. Correspondingly, those skills which never appear in job-description records will also be removed. + +\vspace{2mm} +\noindent\textbf{Parameter Setting.} +In our SPTM model, three sets of parameters should be preset. First, for the generation process of SPTM, we manually selected the values for Dirichlet prior with ($\delta$=1, $\alpha$,$\beta$,$\gamma$=0.01) based on multiple optimizations. Second, we set to the number of topic $K$ as 23, corresponding to the 23 unique criteria within 5 different categories mentioned in \emph{Data Description}. Finally, for the model training process, the maximal iteration times was set as 800, and threshold of stop condition was set as $10^{-3}$. + +\vspace{2mm} +\noindent\textbf{Baseline Methods.} +To validate the performance of SPTM for measuring skill popularity, two typical baseline methods are selected as baseline methods as follows: +\begin{itemize} +\item \textbf{Frequency.} The intuitive technique to measure the popularity of job skills. Specially, we calculated the appearance of each skill under different criteria labels, and then used the normalization of skill frequency as conditional probability for ranking the popularity. +\item \textbf{LLDA.} Labeled-LDA (LLDA)~\cite{ramage2009labeled} is a topic model similar with our SPTM, which however does not consider the skill categories and mutual connections within skills. We used the same feature labels and identical parameters as SPTM for training L-LDA. +\end{itemize} +\subsection{Experimental Results} +For the comprehensive validation of SPTM, two kinds of experiments were executed, i.e., skill-oriented topic evaluation, and job skill recommendation for a given job posting. + +\vspace{2mm} +\noindent\textbf{Skill-oriented Topic Evaluation.} +To evaluate the effectiveness of our SPTM approach, especially for the topic modeling performance, we picked up the top 8 skills of each topic listed by all the three techniques, and then asked 5 senior HR experts to judge the correctness. In detail, two factors will be considered, namely the \emph{Validity Measure} (\textbf{VM}) which measures how many topics extracted are \emph{valid} (i.e., at least 4 skills among 8 skills are mutually coherent in job recruitment), and the \emph{Coherence Measure} (\textbf{CM}), which counts how many skills are relevant to the other 7 skills in the same topic. These two metrics could be calculated as follows: +\begin{footnotesize} +\begin{equation} +VM=\frac{\#~of~ \emph{valid}~topics}{\#~of~topics}, CM=\frac{\#~of~\emph{relevant}~skills}{\#~of~skills}. +\end{equation} +\end{footnotesize} + +The average results of 5 experts are shown in Table~\ref{Comparison}, in which our SPTM outperforms all the baselines in terms of both VM and CM metrics. Moreover, as we only selected the top 8 skills of each topic, the ranking performance of job skills via our SPTM approach has been also validated. + +\vspace{2mm} +\noindent\textbf{Job Skill Recommendation.} +Then, we turn to evaluate the job skill recommendation task. As SPTM could measure the popularity of job skills with different criteria, it is intuitive to recommend appropriate job skills with given job description. Definitely, these results will be beneficial for both employers and job seekers, since they could offer guidance for companies to follow the trends, and also help the candidates to select the proper positions, or prepare for the interview. + +Specially, for the evaluation, we select the test set formed by 50,000 job postings excluded from the training set, which contains 623 different combination of criteria, and then use the log-likelihood as measurement to evaluate the performance. The results are shown in Table~\ref{Log Likelihood}, which indicates that our SPTM approach performs better with recommending more appropriate job skills compared with the baselines. + +\begin{table}[t] +\centering +\footnotesize +\caption{Average VM/CM Comparison}\label{Comparison} +\begin{tabular}{ccc} +\hline +Model & VM & CM \\ \hline +SPTM & \textbf{0.835} & \textbf{0.625}\\ +Labeled-LDA & 0.700 & 0.300 \\ +Frequency & 0.575 & 0.325 \\ \hline +\end{tabular} +\label{Comparison} +\end{table} + +\begin{table}[t] +\centering +\footnotesize +\caption{Recommendation performance in log-likelihood} +\begin{tabular}{cc} +\hline +Model & log-likelihood \\ \hline +SPTM & \textbf{-6320262.155}\\ +Labeled-LDA & -7065396.092\\ +Frequency & -6511843.161\\ +\hline +\end{tabular} +\label{Log Likelihood} +\end{table} +\subsection{Discussion and Insights} +As the effectiveness of SPTM has been validated, in this subsection, we will further discuss about some interesting discoveries as follows. Specially, we list the top 8 skills ranked by our SPTM framwork for different job criteria in Figure~\ref{ResultsComScale} and \ref{ResultsSalary}, in which the size indicates the ranking of skill. + +\begin{figure}[!b] +\centering +\subfigure[Very Big Company]{ +\includegraphics[width=4cm]{TopComScaleVB.png}}\hspace{-2mm} +\subfigure[Very Small Company]{ +\includegraphics[width=4cm]{TopComScaleVS.png}}\hspace{-2mm} +\caption{Top 8 popular job skills (Company Scale).}\label{ResultsComScale} +\end{figure} + +\begin{figure}[!b] +\centering +\subfigure[Very High Salary]{ +\includegraphics[width=4cm]{TopHighSalary.png}}\hspace{-2mm} +\subfigure[Very Low Salary]{ +\includegraphics[width=4cm]{TopLowSalary.png}}\hspace{-2mm} +\caption{Top 8 popular job skills (Salary).}\label{ResultsSalary} +\end{figure} + + +\vspace{2mm} +\noindent $\diamond$ \textbf{Q1: Will different companies lead to different skills?}\\ + +Indeed, the impact of different companies depends on the business range, which is usually related to the scale of companies. For instance, as shown in Figure~\ref{ResultsComScale}, big companies like Google and Baidu usually hold a wide range of business and large amount of users, which result in the massive data. Thus, technical skills like ``Oracle'' to manage database, ``Python" for data analysis, or even ``Hadoop'' for distributed computing are required. On the contrary, the small companies usually focus on a certain application field, thus ``HTML'' for front-end designing, or ``Android'' and ``iOS'' for mobile App developer are required, which are shown in. Thus, the skills for different company scale could be significantly different. + +\vspace{2mm} +\noindent $\diamond$ \textbf{Q2: What are the ``salary-oriented'' skills, and why?}\\ + +As shown in Figure~\ref{ResultsSalary}, we can find that job skills related to design and development in mobile services, like ``Android'', ``iOS'' and ``Web-App'' tend to receive higher salary, which require not only technical training, but also inspiration and innovation. Meanwhile, the increasing development of mobile internet also stimulate the popularity of corresponding skills. On the contrary, the basic skills with less techniques, like ``Service'' and ``Edit'', lead to relatively lower salary. Clearly, the irreplaceable quality of a certain skill could possibly affect the reward it gains. + +\begin{table}[t] +\centering +\footnotesize +\caption{Changes of top 10 popular job skills.}\label{Q4} +\begin{tabular}{c|c|c} +\hline + 2015 & 2014 & 2013 \\ \hline + SQL & Software & Test \\ + Database & Class & Hardware \\ + IO & Framework & Data Analysis \\ + Framework & Mathematics & Communication \\ + Data Structure & Android & IO \\ + Python & Management & Relation \\ + Search Engine & Data Analysis & Network \\ +Software& Algorithm & UI \\ + Network & Data Structure & Framework \\ +\hline +\end{tabular} +\end{table} + + +\vspace{2mm} +\noindent $\diamond$ \textbf{Q3: How does the popularity of job skills change over different years?}\\ + +In Table~\ref{Q4}, we present the comparison of popular skills in the past three years by jointly considering positive job criteria (i.e., Very High Salary, Very Big Company, Huge City, Listed and Fulltime). Without considering the common skills, like Development and C, which keep relatively stable, we can see a clear increasing demand of data-driven skills compared with several years ago. On the contrary, the network-related skills decline, and we could witness the transfer of market trends from hardware-oriented job skills to software-oriented job skills. +\subsection{Case Study: Will Talents with Popular Skills Get Hired Easily?} +Finally, we will present a case study showing the relationship between our modeling results and realistic recruiting results with a real-world recruitment data set. + +\vspace{2mm} +\noindent \textbf{Recruitment Dataset.} The dataset was provided by an IT company in China, which contains 140,757 resumes that have applied for technical jobs in this company. Specially, all the resumes had been scored by the Human Resource Department as follows: +\begin{small} +\begin{itemize} +\item \textbf{Score 0:} \emph{Candidate was failed without interview}. +\item \textbf{Score 1:} \emph{Candidate was failed in the interview}. +\item \textbf{Score 2:} \emph{Candidate was admitted but failed to join the company}. +\item \textbf{Score 3:} \emph{Candidate was admitted and joined the company}. +\end{itemize} +\end{small} + +\begin{figure}[b] +\centering +\includegraphics[width=6.5cm]{distribution.png} +\caption{The distribution of the number of different resume scores in our recruitment dataset.} +\label{Recruiting Dataset} +\end{figure} +The distribution of each label in our dataset is listed as histogram in Figure~\ref{Recruiting Dataset}, which indicates that around 85\% of candidates are filtered out before receiving interview. + +\vspace{2mm} +\noindent \textbf{Correlation Measurement.} +According to our basic assumptions, the candidates with popular job skills will be more probable to be enrolled. As the effectiveness of our model has been confirmed, we now apply SPTM for resume analysis to simulate the recruitment process. To be specific, we first extracted the corresponding skills from resumes, and then calculated the ``skill score'' for each resume, which is defined by the following formula: +\begin{footnotesize} +\begin{align} +Score_{Skill}=\sum_w |w|\times P(w|\Lambda_{m_{\star}}), +\end{align} +\end{footnotesize} +\noindent where $w$ is a job skill appeared in the resume, and $|w|$ is the frequency acting as the weight. Besides, considering the status of this company, the criteria labels $\Lambda_{m_{\star}}$ are set as (Very High Salary, Huge City, Big Compay, Listed). + +To validate the performance, we introduce the Spearman correlation coefficient and Kendall's $\tau$ to measure the correlation between ``skill score'' and corresponding resume scores. The correlation measurements are shown in Table~\ref{Correlation Measurement}, in which the ``skill score'' by our SPTM holds much stronger correlation with resume scores than all the baselines. + +\vspace{2mm} +\noindent \textbf{Hypothesis Test.} +Besides, hypothesis test on Kendall's $\tau$ indicates that resume ranking obtained by our SPTM is statistically significant, which further proves the practicability of our model. Specially, the sampling distribution of Kendall's $\tau$ could be estimated by the normal distribution, with mean as 0 and variance as $\frac{2(2N+5)}{9N(N-1)}$, where $N$ equals to the number of samples. Thus, we conducted the $z$-test on $\tau$ obtained by SPTM, and the $z$-value could be calculated by the formula below, which validates the result with high confidence: +\begin{footnotesize} +\begin{eqnarray} +z_{value}=\frac{3\times\tau\sqrt{N(N-1)}}{\sqrt{2(2N+5)}} \nonumber \\ +=156.748 \ge z_{0.0001}. +\end{eqnarray} +\end{footnotesize} + +In summary, based on the above experiments, we prove that talents with popular skills indeed get hired easily. Also, we realize that our SPTM approach has potential for facilitating the process of resume screening in talent recruitment. + +\begin{table}[t] +\centering +\footnotesize +\caption{The results of correlation analysis.} +\begin{tabular}{cccc} +\hline +Measurement|Model & SPTM & LLDA & Frequency\\ \hline +Spearman & \textbf{0.3002} & 0.1855 & 0.2015 \\ +Kendall's $\tau$ & \textbf{0.2452} & 0.1528 & 0.1603 \\ +\hline +\end{tabular} +\label{Correlation Measurement} +\end{table} +\section{Related Work} +In this section, we summarize the related works following three aspects, namely Skill Ranking, Recruitment Market Analysis and Topic Models. +\subsection{Skill Ranking} +Skill ranking of IT techniques has attracted growing interest in the last decade. Previous study in 2005~\cite{Prabhakar2005IT} discussed about the changing tendency of 14 different IT skills using their percentage in job postings during a certain period, where Web programming, Unix, C++, Java, SQL programming, and Oracle database were listed as the top six skills. Recently, some online recruiting companies also publish their annual report for the hottest skills like~\cite{Miller2005Skill} and~\cite{Skomoroch2012SKILL}. For example, in~\cite{linkedin}, Linkedin predicted top skills that can get people hired in 2017, based on the ranking results of hiring and recruiting activities. Also, in~\cite{computerworld}, Computerworld published an article illustrating 10 hottest tech skills for 2017 based on the evaluations and judgements of experts. + +However, the prior arts above not only fail to provide description of detailed skills to be learned (instead, they provide only rough category of skills), but also lack of interpretability and scalability in modeling, especially for describing the structure of ``Skill Net''. +\subsection{Recruitment Market Analysis} +Recruitment market analysis has always been an appealing topic for applied business researchers, dating back from Adam Smith and his \emph{The Wealth}, for labor distribution is a crucial element in the development of modern society. Economists look into the problem from two different prospective: Macro prospective~\cite{Encyclopedias2015Encyclopedia}, where Solow proposed his growth model, and others study topics about the demographic structure and participation rate of labor, the relation between inflation and unemployment rate and how labor contributes in gross productivity or expenditures, etc. Micro prospective, where studies are all based on the basic market cleaning framework, stating that all employees choose their best balance between leisure and work, while all employers hire with budget constrain, and consequently the wage is derived as the marginal labor cost. + +Recently, researchers are devoted to combining data mining techniques with recruitment market analysis, including offer categorization~\cite{Malherbe2015Bringing}, talent career path analysis~\cite{li2017prospecting}, market trend analysis~\cite{Zhu2016Recruitment,Lin-AAAI-2017}, and talent circles~\cite{Xuhuang-KDD2016}. However, few of them studied the problem of measuring the popularity of job skill in recruitment market, not to mention the multi-faceted popularity ranking, which is the focus of this paper. +. +\subsection{Topic Models} +Topic models have been successfully applied to problems in a variety of fields, such as marketing campaign~\cite{liu2014discovering}, emotion recognition~\cite{zhu2016tracking}, biometrics~\cite{Wang2011Finding}, genetics~\cite{Blei2007Correction}, social media~\cite{xu2014learning} and mobile data mining~\cite{Farrahi2012Extracting,zhu2015popularity}. + +In the past years, a number of variations of the classical Latent Dirichlet Allocation (LDA)~\cite{blei2003latent} have been proposed for solving different kinds of problems. To utilize the existing document labels, supervised LDA models~\cite{mcauliffe2008supervised} have shown the effectiveness on classification and regression tasks, while they are limited to assign one topic for each document. To this end, Labeled-LDA~\cite{ramage2009labeled} has emancipated this limitation by allowing multiple topics for a single document, thus outperforms the previous supervised models. However, the above models cannot take the hierarchical information of words into account. Therefore, some hierarchical topic models have been proposed, such as Hierarchical LDA~\cite{griffiths2004hierarchical}, and LDAC (Latent Dirichlet Allocation on Context)~\cite{Bao2010An}. + +In this paper, different from the above studies, the proposed model SPTM can integrate both job criteria labels and skill categories for modeling the generation of job skills, and then measure the popularity. Further, the ``documents" here are generated by ``central skills" and their neighboring nodes in ``Skill-Net'', which reflects the connections within skills. +\section{Conclusion} +In this paper, we proposed a data-driven approach for measuring the popularity of job skills based on the analysis of large-scale recruitment data. Specifically, we first built a job skill network by exploring a large corpus of job postings in recruitment market. Then, we developed a Skill Popularity based Topic Model (SPTM) for modeling the generation of skill network. A unique perspective of SPTM is that it can integrate different criteria of jobs and the hierarchical dependence of skills. Therefore, with the help of SPTM, we can effectively rank the job skills based on their multi-perspective popularity. Extensive experiments on real-world recruitment data validated the effectiveness, and also revealed some recruitment-oriented rules, which proved the potential of SPTM for measuring the popularity of job skills. + +In the future, we will consider more ``personalized" factors for companies, i.e., to reveal their preference or business range of job skills, as well as latent business competition between them. Also, we plan to study more real-world applications based on the skill popularity obtained by our approach, such as resume screening and talent recommendation. Besides, more comprehensive studies will be conducted, such as the job-candidate mapping performance, and the popularity of job skills in other professional domains. +\section{ Acknowledgments} +This research was partially supported by grants from the National Natural Science Foundation of China (Grant No. U1605251, 71531001, 61703386 and 61325010), the Anhui Provincial Natural Science Foundation (Grant No. 1708085QF140), and the Fundamental Research Funds for the Central Universities (Grant No. WK2150110006). + +\bibliography{sigproc} +\bibliographystyle{aaai} diff --git a/1712.03333v4.txt b/1712.03333v4.txt new file mode 100644 index 0000000000000000000000000000000000000000..74381741413ff442b40017c93acbb09ed362b5b2 --- /dev/null +++ b/1712.03333v4.txt @@ -0,0 +1,61 @@ +Bayesian reinforcement learning is a classic reinforcement learning (RL) technique that utilizes Bayesian inference to integrate new experiences with prior information about the problem in a probabilistic distribution. It explicitly quantifies the uncertainty of the learning parameters unlike standard RL approaches in which uncertainty is unaccounted for. Explicit quantification of the uncertainty can help guide policies that consider the exploration-exploitation trade-off by exploring actions with higher uncertainty more often [25, 26]. Moreover, it can also regularize posterior updates by properly accounting for uncertainty. + +Motivated by these advantages, a number of algorithms have been proposed in both model-based [7, 30, 9, 15, 28] and model-free Bayesian RL [6, 10, 11, 12, 5, 13].However, Bayesian approaches to off-policy temporal difference (TD) learning have been less studied compared to alternative methods due to difficulty in handling the max non-linearity in the Bellman optimality equation. Previous studies such as Dearden’s Bayesian Q-learning [6] and Kalman Temporal Difference Q-learning (KTD-Q) [12] suffer from their computational complexity and scalability. Yet off-policy TD methods such as Q-learning [33] have been widely used in standard RL, including extensions integrating neural network function approximations such as Deep Q-Networks (DQN) [22]. + +In this paper, we introduce a novel approximate Bayesian Q-learning algorithm, denoted as ADFQ, which updates belief distributions of Q𝑄Q (action-value function) and approximates their posteriors using an online Bayesian inference algorithm known as assumed density filtering (ADF). In order to reduce the computational burden of estimating parameters of the approximated posterior, we propose a method to analytically estimate the parameters. Unlike Q-learning, ADFQ executes a non-greedy update by considering all possible actions for the next state and returns a soft-max behavior and regularization determined by the uncertainty measures of the Q-beliefs. This alleviates overoptimism and instability issues from the greedy update of Q-learning which have been discussed in a number of papers [16, 32, 17, 18]. We prove the convergence of ADFQ to the optimal Q-values by showing that ADFQ becomes identical to Q-learning as all state and action pairs are visited infinitely often. + +ADFQ is computationally efficient and is extended to complex environments with a neural network. There are previous works that implement Bayesian approaches to Deep RL by using uncertainty in the neural network weights and show promising performance in several Atari games [1, 23, 27]. However, these approaches only focus on exploration and uncertainty information does not directly applied to updating RL parameters. Our method differs from these approaches as it explicitly computes the variances of the Q-beliefs and uses them both for exploration and in the value update. Another recent work [2] proposed a gradient-based categorical DQN algorithm using a distributional perspective. The value distribution in their work represents the inherent randomness of the agent’s interactions with its environment. In contrast, the Q-belief defined in ADFQ is a belief distribution of a learning agent on a certain state-action pair. Therefore, only ϵitalic-ϵ\epsilon-greedy is used in their experiments. We evaluate ADFQ with Thompson sampling (TS) [31] as well as ϵitalic-ϵ\epsilon-greedy methods in various Atari games and they outperform DQN and Double DQN [17]. Particularly, the non-greedy update in ADFQ dramatically improves the performance in domains with a large number of actions and higher stochasticity. Example source code is available online (https://github.com/coco66/ADFQ). + +Assumed density filtering (ADF) is a general technique for approximating the true posterior with a tractable parametric distribution in Bayesian networks. It has been independently rediscovered for a number of applications and is also known as moment matching, online Bayesian learning, and weak marginalization [24, 3, 21]. Suppose that a hidden variable 𝐱𝐱\mathbf{x} follows a tractable parametric distribution p​(𝐱|θt)𝑝conditional𝐱subscript𝜃𝑡p(\mathbf{x}|\theta_{t}) where θtsubscript𝜃𝑡\theta_{t} is a set of parameters at time t𝑡t. In the Bayesian framework, the distribution can be updated after observing some new data (Dtsubscript𝐷𝑡D_{t}) using Bayes’ rule, p^​(𝐱|θt,Dt)∝p​(Dt|𝐱,θt)​p​(𝐱|θt)proportional-to^𝑝conditional𝐱subscript𝜃𝑡subscript𝐷𝑡𝑝conditionalsubscript𝐷𝑡𝐱subscript𝜃𝑡𝑝conditional𝐱subscript𝜃𝑡\hat{p}(\mathbf{x}|\theta_{t},D_{t})\propto p(D_{t}|\mathbf{x},\theta_{t})p(\mathbf{x}|\theta_{t}). In online settings, a Bayesian update is typically performed after a new data point is observed, and the updated posterior is then used as a prior for the following iteration. + +When the posterior computed by Bayes’ rule does not belong to the original parametric family, it can be approximated by a distribution belonging to the parametric family. In ADF, the posterior is projected onto the closest distribution in the family chosen by minimizing the reverse Kullback-Leibler divergence denoted as KL(p^||p)KL(\hat{p}||p) where p^^𝑝\hat{p} is the original posterior distribution and p𝑝p is a distribution in a parametric family of interest. Thus, for online Bayesian filtering, the parameters for the ADF estimate is given by θt+1=argminθKL(p^(⋅|θt,Dt)||p(⋅|θ))\theta_{t+1}=\operatornamewithlimits{argmin}_{\theta}KL(\hat{p}(\cdot|\theta_{t},D_{t})||p(\cdot|\theta)). + +RL problems can be formulated in terms of an MDP described by the tuple, M=⟨𝒮,𝒜,𝒫,R,γ⟩𝑀𝒮𝒜𝒫𝑅𝛾M=\langle\mathcal{S},\mathcal{A},\mathcal{P},R,\gamma\rangle where 𝒮𝒮\mathcal{S} and 𝒜𝒜\mathcal{A} are the state and action spaces, respectively, 𝒫:𝒮×𝒜×𝒮→[0,1]:𝒫→𝒮𝒜𝒮01\mathcal{P}:\mathcal{S}\times\mathcal{A}\times\mathcal{S}\rightarrow[0,1] is the state transition probability kernel, R:𝒮×𝒜→I​R:𝑅→𝒮𝒜𝐼𝑅R:\mathcal{S}\times\mathcal{A}\rightarrow I\!\!R is a reward function, and γ∈[0,1)𝛾01\gamma\in[0,1) is a discount factor. The value function is defined as Vπ​(s)=𝔼π​[∑t=0∞γt​R​(st,at)|s0=s]superscript𝑉𝜋𝑠subscript𝔼𝜋delimited-[]conditionalsubscriptsuperscript𝑡0superscript𝛾𝑡𝑅subscript𝑠𝑡subscript𝑎𝑡subscript𝑠0𝑠V^{\pi}(s)=\mathbb{E}_{\pi}[\sum^{\infty}_{t=0}\gamma^{t}R(s_{t},a_{t})|s_{0}=s] for all s∈𝒮𝑠𝒮s\in\mathcal{S}, the expected value of cumulative future rewards starting at a state s𝑠s and following a policy π𝜋\pi thereafter. The state-action value (Q𝑄Q) function is defined as the value for a state-action pair, Qπ​(s,a)=𝔼π​[∑t=0∞γt​R​(st,at)|s0=s,a0=a]superscript𝑄𝜋𝑠𝑎subscript𝔼𝜋delimited-[]formulae-sequenceconditionalsubscriptsuperscript𝑡0superscript𝛾𝑡𝑅subscript𝑠𝑡subscript𝑎𝑡subscript𝑠0𝑠subscript𝑎0𝑎Q^{\pi}(s,a)=\mathbb{E}_{\pi}[\sum^{\infty}_{t=0}\gamma^{t}R(s_{t},a_{t})|s_{0}=s,a_{0}=a] for all s∈𝒮,a∈𝒜formulae-sequence𝑠𝒮𝑎𝒜s\in\mathcal{S},a\in\mathcal{A}. The objective of a learning agent in RL is to find an optimal policy π∗=argmaxπVπsuperscript𝜋subscriptargmax𝜋superscript𝑉𝜋\pi^{*}=\operatornamewithlimits{argmax}_{\pi}V^{\pi}. Finding the optimal values, V∗​(⋅)superscript𝑉⋅V^{*}(\cdot) and Q∗​(⋅,⋅)superscript𝑄⋅⋅Q^{*}(\cdot,\cdot), requires solving the Bellman optimality equation:Q∗​(s,a)=𝔼s′∼P(⋅|s,a)​[R​(s,a)+γ​maxb∈𝒜⁡Q∗​(s′,b)]Q^{*}(s,a)=\mathbb{E}_{s^{\prime}\sim P(\cdot|s,a)}[R(s,a)+\gamma\max_{b\in\mathcal{A}}Q^{*}(s^{\prime},b)](1)and V∗​(s)=maxa∈𝒜​(s)⁡Q∗​(s,a)superscript𝑉𝑠subscript𝑎𝒜𝑠superscript𝑄𝑠𝑎V^{*}(s)=\max_{a\in\mathcal{A}(s)}Q^{*}(s,a) ∀s∈𝒮for-all𝑠𝒮\forall s\in\mathcal{S} where s′superscript𝑠′s^{\prime} is the subsequent state after executing the action a𝑎a at the state s𝑠s. Q-learning is the most popular off-policy TD learning technique due to its relatively easy implementation and guarantee of convergence to an optimal policy [33, 19]. At time step t𝑡t, Q-learning updates Q​(st,at)𝑄subscript𝑠𝑡subscript𝑎𝑡Q(s_{t},a_{t}) after observing a reward rtsubscript𝑟𝑡r_{t} and the next state st+1subscript𝑠𝑡1s_{t+1} (one-step TD learning). The update is based on the TD error – a difference between the TD target, rt+γ​maxb⁡Q​(st+1,b)subscript𝑟𝑡𝛾subscript𝑏𝑄subscript𝑠𝑡1𝑏r_{t}+\gamma\max_{b}Q(s_{t+1},b), and the current estimate on Q​(st,at)𝑄subscript𝑠𝑡subscript𝑎𝑡Q(s_{t},a_{t}) with a learning rate α∈(0,1]𝛼01\alpha\in(0,1]:Q​(st,at)←Q​(st,at)+α​(rt+γ​maxb⁡Q​(st+1,b)−Q​(st,at))←𝑄subscript𝑠𝑡subscript𝑎𝑡𝑄subscript𝑠𝑡subscript𝑎𝑡𝛼subscript𝑟𝑡𝛾subscript𝑏𝑄subscript𝑠𝑡1𝑏𝑄subscript𝑠𝑡subscript𝑎𝑡Q(s_{t},a_{t})\leftarrow Q(s_{t},a_{t})+\alpha\left(r_{t}+\gamma\max_{b}Q(s_{t+1},b)-Q(s_{t},a_{t})\right) + +We define Qs,asubscript𝑄𝑠𝑎Q_{s,a} as a Gaussian random variable with mean μs,asubscript𝜇𝑠𝑎\mu_{s,a} and variance σs,a2superscriptsubscript𝜎𝑠𝑎2\sigma_{s,a}^{2} corresponding to the action value function Q​(s,a)𝑄𝑠𝑎Q(s,a) for all s∈𝒮𝑠𝒮s\in\mathcal{S} and a∈𝒜𝑎𝒜a\in\mathcal{A}. We assume that the random variables for different states and actions are independent and have different means and variances, Qs,a∼𝒩​(μs,a,σs,a2)similar-tosubscript𝑄𝑠𝑎𝒩subscript𝜇𝑠𝑎superscriptsubscript𝜎𝑠𝑎2Q_{s,a}\sim\mathcal{N}(\mu_{s,a},\sigma_{s,a}^{2}) where μs,a≠μs′,a′subscript𝜇𝑠𝑎subscript𝜇superscript𝑠′superscript𝑎′\mu_{s,a}\neq\mu_{s^{\prime},a^{\prime}} if s≠s′​ or ​a≠a′𝑠superscript𝑠′ or 𝑎superscript𝑎′s\neq s^{\prime}\text{ or }a\neq a^{\prime} ∀s∈𝒮,∀a∈𝒜formulae-sequencefor-all𝑠𝒮for-all𝑎𝒜\forall s\in\mathcal{S},\forall a\in\mathcal{A}.According to the Bellman optimality equation in Eq.1, we can define a random variable for V​(s)𝑉𝑠V(s) as Vs=maxa⁡Qs,asubscript𝑉𝑠subscript𝑎subscript𝑄𝑠𝑎V_{s}=\max_{a}Q_{s,a}. In general, the probability density function for the maximum of Gaussian random variables, M=max1≤k≤N⁡Xk𝑀subscript1𝑘𝑁subscript𝑋𝑘M=\max_{1\leq k\leq N}X_{k} where Xk∼𝒩​(μk,σk2)similar-tosubscript𝑋𝑘𝒩subscript𝜇𝑘subscriptsuperscript𝜎2𝑘X_{k}\sim\mathcal{N}(\mu_{k},\sigma^{2}_{k}), is no longer Gaussian:p​(M=x)=∑i=1N1σi​ϕ​(x−μiσi)​∏j≠iNΦ​(x−μjσj)𝑝𝑀𝑥subscriptsuperscript𝑁𝑖11subscript𝜎𝑖italic-ϕ𝑥subscript𝜇𝑖subscript𝜎𝑖subscriptsuperscriptproduct𝑁𝑗𝑖Φ𝑥subscript𝜇𝑗subscript𝜎𝑗p\left(M=x\right)=\sum^{N}_{i=1}\frac{1}{\sigma_{i}}\phi\left(\frac{x-\mu_{i}}{\sigma_{i}}\right)\prod^{N}_{j\neq i}\Phi\left(\frac{x-\mu_{j}}{\sigma_{j}}\right)(2)where ϕ​(⋅)italic-ϕ⋅\phi(\cdot) is the standard Gaussian probability density function (PDF) and Φ​(⋅)Φ⋅\Phi(\cdot) is the standard Gaussian cumulative distribution function (CDF) (derivation details are provided in Appendix A). + +For one-step Bayesian TD learning, the beliefs on 𝐐={Qs,a}∀s∈𝒮,∀a∈𝒜𝐐subscriptsubscript𝑄𝑠𝑎formulae-sequencefor-all𝑠𝒮for-all𝑎𝒜\mathbf{Q}=\{Q_{s,a}\}_{\forall s\in\mathcal{S},\forall a\in\mathcal{A}} can be updated at time t𝑡t after observing a reward rtsubscript𝑟𝑡r_{t} and the next state st+1subscript𝑠𝑡1s_{t+1} using Bayes’ rule. In order to reduce notation, we drop the dependency on t𝑡t denoting st=ssubscript𝑠𝑡𝑠s_{t}=s, at=asubscript𝑎𝑡𝑎a_{t}=a, st+1=s′subscript𝑠𝑡1superscript𝑠′s_{t+1}=s^{\prime}, rt=rsubscript𝑟𝑡𝑟r_{t}=r, yielding the causally related 4-tuple τ=\mathbf{\tau}=. We use the one-step TD target with a small Gaussian white noise, r+γ​Vs′+W𝑟𝛾subscript𝑉superscript𝑠′𝑊r+\gamma V_{s^{\prime}}+W where W∼𝒩​(0,σw2)similar-to𝑊𝒩0subscriptsuperscript𝜎2𝑤W\sim\mathcal{N}(0,\sigma^{2}_{w}), as the likelihood for Qs,asubscript𝑄𝑠𝑎Q_{s,a}. The noise parameter, σwsubscript𝜎𝑤\sigma_{w}, reflects stochasticity of an MDP.We will first derive the belief updates on Q-values with σw=0subscript𝜎𝑤0\sigma_{w}=0 for simplicity and then extend the result to the general case. The likelihood distribution can be represented as a distribution over Vs′subscript𝑉superscript𝑠′V_{s^{\prime}} as p​(r+γ​Vs′|q,θ)=pVs′​((q−r)/γ|s′,θ)𝑝𝑟conditional𝛾subscript𝑉superscript𝑠′𝑞𝜃subscript𝑝subscript𝑉superscript𝑠′conditional𝑞𝑟𝛾superscript𝑠′𝜃p(r+\gamma V_{s^{\prime}}|q,\mathbf{\theta})=p_{V_{s^{\prime}}}((q-r)/\gamma|s^{\prime},\mathbf{\theta}) where q𝑞q is a value corresponding to Qs,asubscript𝑄𝑠𝑎Q_{s,a} and θ𝜃\mathbf{\theta} is a set of mean and variance of 𝐐𝐐\mathbf{Q}. From the independence assumptions on 𝐐𝐐\mathbf{Q}, the posterior update is reduced to an update for the belief on Qs,asubscript𝑄𝑠𝑎Q_{s,a}:p^Qs,a​(q|θ,r,s′)∝pVs′​(q−rγ|s′,θ)​pQs,a​(q|θ)proportional-tosubscript^𝑝subscript𝑄𝑠𝑎conditional𝑞𝜃𝑟superscript𝑠′subscript𝑝subscript𝑉superscript𝑠′conditional𝑞𝑟𝛾superscript𝑠′𝜃subscript𝑝subscript𝑄𝑠𝑎conditional𝑞𝜃\hat{p}_{Q_{s,a}}(q|\mathbf{\theta},r,s^{\prime})\propto p_{V_{s^{\prime}}}\left(\left.\frac{q-r}{\gamma}\right|s^{\prime},\mathbf{\theta}\right)p_{Q_{s,a}}(q|\mathbf{\theta})Applying Eq.2, the posterior distribution is derived as follows (derivation details in Appendix B):p^Qs,a​(q|θ,r,s′)=1Z​∑b∈𝒜cτ,bσ¯τ,b​ϕ​(q−μ¯τ,bσ¯τ,b)​∏b′∈𝒜b′≠bΦ​(q−(r+γ​μs′,b′)γ​σs′,b′)subscript^𝑝subscript𝑄𝑠𝑎conditional𝑞𝜃𝑟superscript𝑠′1𝑍subscript𝑏𝒜subscript𝑐𝜏𝑏subscript¯𝜎𝜏𝑏italic-ϕ𝑞subscript¯𝜇𝜏𝑏subscript¯𝜎𝜏𝑏subscriptproductsuperscript𝑏′𝒜superscript𝑏′𝑏Φ𝑞𝑟𝛾subscript𝜇superscript𝑠′superscript𝑏′𝛾subscript𝜎superscript𝑠′superscript𝑏′\hat{p}_{Q_{s,a}}(q|\mathbf{\theta},r,s^{\prime})=\frac{1}{Z}\sum_{b\in\mathcal{A}}\frac{c_{\mathbf{\tau},b}}{\bar{\sigma}_{\mathbf{\tau},b}}\phi\left(\frac{q-\bar{\mu}_{\mathbf{\tau},b}}{\bar{\sigma}_{\mathbf{\tau},b}}\right)\prod_{\begin{subarray}{c}b^{\prime}\in\mathcal{A}\\b^{\prime}\neq b\end{subarray}}\Phi\left(\frac{q-(r+\gamma\mu_{s^{\prime},b^{\prime}})}{\gamma\sigma_{s^{\prime},b^{\prime}}}\right)(3)where Z𝑍Z is a normalization constant andcτ,b=1σs,a2+γ2​σs′,b2​ϕ​((r+γ​μs′,b)−μs,aσs,a2+γ2​σs′,b2)subscript𝑐𝜏𝑏1superscriptsubscript𝜎𝑠𝑎2superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏2italic-ϕ𝑟𝛾subscript𝜇superscript𝑠′𝑏subscript𝜇𝑠𝑎superscriptsubscript𝜎𝑠𝑎2superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏2c_{\mathbf{\tau},b}=\frac{1}{\sqrt{\sigma_{s,a}^{2}+\gamma^{2}\sigma_{s^{\prime},b}^{2}}}\phi\left(\frac{(r+\gamma\mu_{s^{\prime},b})-\mu_{s,a}}{\sqrt{\sigma_{s,a}^{2}+\gamma^{2}\sigma_{s^{\prime},b}^{2}}}\right)(4)μ¯τ,b=σ¯τ,b2​(μs,aσs,a2+r+γ​μs′,bγ2​σs′,b2)1σ¯τ,b2=1σs,a2+1γ2​σs′,b2formulae-sequencesubscript¯𝜇𝜏𝑏subscriptsuperscript¯𝜎2𝜏𝑏subscript𝜇𝑠𝑎superscriptsubscript𝜎𝑠𝑎2𝑟𝛾subscript𝜇superscript𝑠′𝑏superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏21subscriptsuperscript¯𝜎2𝜏𝑏1superscriptsubscript𝜎𝑠𝑎21superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏2\bar{\mu}_{\mathbf{\tau},b}=\bar{\sigma}^{2}_{\mathbf{\tau},b}\left(\frac{\mu_{s,a}}{\sigma_{s,a}^{2}}+\frac{r+\gamma\mu_{s^{\prime},b}}{\gamma^{2}\sigma_{s^{\prime},b}^{2}}\right)\qquad\qquad\frac{1}{\bar{\sigma}^{2}_{\mathbf{\tau},b}}=\frac{1}{\sigma_{s,a}^{2}}+\frac{1}{\gamma^{2}\sigma_{s^{\prime},b}^{2}}(5) + +Note that all next actions are considered in Eq.3 unlike the conventional Q-learning update which only considers the subsequent action resulting in the maximum Q-value at the next step (maxb⁡Q​(s′,b)subscript𝑏𝑄superscript𝑠′𝑏\max_{b}Q(s^{\prime},b)). This can lead to a more stable update rule as updating with only the maximum Q-value has inherent instability [16, 32]. The Bayesian update considers the scenario where the true maximum Q-value may not be the one with the highest estimated mean, and weights each subsequence Q-value accordingly.Each term for action b𝑏b inside the summation in Eq.3 has three important features. First of all, μ¯τ,bsubscript¯𝜇𝜏𝑏\bar{\mu}_{\mathbf{\tau},b} is an inverse-variance weighted (IVW) average of the prior mean and the TD target mean. Therefore, the Gaussian PDF part becomes closer to the TD target distribution if it has a lower uncertainty than the prior, and vice versa as compared in the first row (a) and (b) of Fig.1.Next, the TD error, δτ,b=(r+γ​μs′,b)−μs,asubscript𝛿𝜏𝑏𝑟𝛾subscript𝜇superscript𝑠′𝑏subscript𝜇𝑠𝑎\delta_{\tau,b}=(r+\gamma\mu_{s^{\prime},b})-\mu_{s,a}, is naturally incorporated in the posterior distribution with the form of a Gaussian PDF in the weight cτ,bsubscript𝑐𝜏𝑏c_{\tau,b}. Thus, a subsequent action which results in a smaller TD error contributes more to the update. The sensitivity of a weight value is determined by the prior and target uncertainties. An example case is described in the second row of Fig.1 where δτ,1=δτ,2>δτ,3subscript𝛿𝜏1subscript𝛿𝜏2subscript𝛿𝜏3\delta_{\tau,1}=\delta_{\tau,2}>\delta_{\tau,3} and σs′,1>σs′,2=σs′,3subscript𝜎superscript𝑠′1subscript𝜎superscript𝑠′2subscript𝜎superscript𝑠′3\sigma_{s^{\prime},1}>\sigma_{s^{\prime},2}=\sigma_{s^{\prime},3}.Finally, the product of Gaussian CDFs provides a soft-max operation. The red curve with dots in the third row of Fig.1 represents ∏b′≠bΦ(q|r+γμτ,b′,γστ,b′\prod_{b^{\prime}\neq b}\Phi(q|r+\gamma\mu_{\tau,b^{\prime}},\gamma\sigma_{\tau,b^{\prime}}) for each b𝑏b. For a certain q𝑞q value (x-axis), the term returns a larger value for a larger μs′,bsubscript𝜇superscript𝑠′𝑏\mu_{s^{\prime},b} as seen in the black circles. This result has a similarity with the soft Bellman equation [34], but the degree of softness in this case is determined by the uncertainty measures rather than a hyperparameter. + +The posterior distribution in Eq.3, however, is no longer Gaussian. In order to continue the online Bayesian update, we approximate the posterior with a Gaussian distribution using ADF. When the parametric family of interest is spherical Gaussian, it is shown that the ADF parameters are obtained by matching moments. Thus, the mean and variance of the approximate posterior are given by those of the true posterior, 𝔼p^Qs,a​[q]subscript𝔼subscript^𝑝subscript𝑄𝑠𝑎delimited-[]𝑞\mathbb{E}_{\hat{p}_{Q_{s,a}}}[q] and Varp^Qs,a​[q]subscriptVarsubscript^𝑝subscript𝑄𝑠𝑎delimited-[]𝑞\mathrm{Var}_{\hat{p}_{Q_{s,a}}}[q], respectively. It is fairly easy to derive the mean and variance when |𝒜|=2𝒜2|\mathcal{A}|=2. The derivation is presented in Appendix C. However, to our knowledge, there is no analytically tractable solution for |𝒜|>2𝒜2|\mathcal{A}|>2. + +When σw>0subscript𝜎𝑤0\sigma_{w}>0, the expected likelihood is obtained by solving ∫ℝp​(r+γ​Vs′+w|q,θ)​pW​(w)​𝑑wsubscriptℝ𝑝𝑟𝛾subscript𝑉superscript𝑠′conditional𝑤𝑞𝜃subscript𝑝𝑊𝑤differential-d𝑤\int_{\mathbb{R}}p(r+\gamma V_{s^{\prime}}+w|q,\theta)p_{W}(w)dw which is an integral of a similar form with the posterior in Eq.3. Therefore, a closed-form expression is also not available in general except when |𝒜|=2𝒜2|\mathcal{A}|=2 (see Appendix D). + +In the next sections, we prove the convergence of the means to the optimal Q-values for the case |𝒜|=2𝒜2|\mathcal{A}|=2 with the exact solutions for the ADF parameters. Then, we show how to derive an analytic approximation for the ADF parameters which becomes exact in the small variance limit. + +The convergence theorem of the Q-learning algorithm has previously been proven [33]. We, therefore, show that the online Bayesian update using ADF with the posterior in Eq.3 converges to Q-learning when |𝒜|=2𝒜2|\mathcal{A}|=2. We apply an approximation from Lemma 1 in order to prove Theorem 1. Proofs for Lemma 1 and Theorem 1 are presented in Appendix E. + +Interestingly, ατsubscript𝛼𝜏\alpha_{\tau} approaches 1 when σs,a/σs′,b+→∞→subscript𝜎𝑠𝑎subscript𝜎superscript𝑠′superscript𝑏\sigma_{s,a}/\sigma_{s^{\prime},b^{+}}\rightarrow\infty and 0 when σs,a/σs′,b+→0→subscript𝜎𝑠𝑎subscript𝜎superscript𝑠′superscript𝑏0\sigma_{s,a}/\sigma_{s^{\prime},b^{+}}\rightarrow 0 for σw=0subscript𝜎𝑤0\sigma_{w}=0. Such behavior remains when σw>0subscript𝜎𝑤0\sigma_{w}>0 but ατsubscript𝛼𝜏\alpha_{\tau} eventually approaches 0 as the number of visits to (s,a)𝑠𝑎(s,a) goes to infinity.This not only satisfies the convergence condition of Q-learning but also provides a natural learning rate – the smaller the variance of the TD target (the higher the confidence), the more Qs,asubscript𝑄𝑠𝑎Q_{s,a} is updated from the target information rather than the current belief. We show empirical evidence that the contraction condition on variance in Theorem 1 holds in Appendix C. + +When |𝒜|>2𝒜2|\mathcal{A}|>2, the update can be solved by numerical approximation of the true posterior mean and variance using a number of samples. However, its computation becomes unwieldy due to the large number of samples needed for accurate estimates. This becomes especially problematic with small variances as the number of visits to corresponding state-action pairs grows. In this section, we show how to accurately estimate the ADF parameters using an analytic approximation. This estimate becomes exact in the small variance limit. + +Applying Lemma 1 to the Gaussian CDF terms in Eq.3, the posterior is approximated to the following:p~Qs,a​(q)=1Z​∑b∈𝒜cτ,b2​π​σ¯τ,b​exp⁡{−(q−μ¯τ,b)22​σ¯τ,b2−∑b′≠b[r+γ​μs′,b′−q]+22​γ2​σs′,b′2}subscript~𝑝subscript𝑄𝑠𝑎𝑞1𝑍subscript𝑏𝒜subscript𝑐𝜏𝑏2𝜋subscript¯𝜎𝜏𝑏superscript𝑞subscript¯𝜇𝜏𝑏22superscriptsubscript¯𝜎𝜏𝑏2subscriptsuperscript𝑏′𝑏superscriptsubscriptdelimited-[]𝑟𝛾subscript𝜇superscript𝑠′superscript𝑏′𝑞22superscript𝛾2subscriptsuperscript𝜎2superscript𝑠′superscript𝑏′\tilde{p}_{Q_{s,a}}(q)=\frac{1}{Z}\sum_{b\in\mathcal{A}}\frac{c_{\tau,b}}{\sqrt{2\pi}\bar{\sigma}_{\tau,b}}\exp\left\{-\frac{\left(q-\bar{\mu}_{\tau,b}\right)^{2}}{2\bar{\sigma}_{\tau,b}^{2}}-\sum_{b^{\prime}\neq b}\frac{\left[r+\gamma\mu_{s^{\prime},b^{\prime}}-q\right]_{+}^{2}}{2\gamma^{2}\sigma^{2}_{s^{\prime},b^{\prime}}}\right\}(7)Similar to Laplace’s method, we approximate each term as a Gaussian distribution by matching the maximum values as well as the curvature at the peak of the distribution. In other words, the maximum of the distribution is modeled locally near its peak by the quadratic concave function:−(q−μ¯τ,b)22​σ¯τ,b2−∑b′≠b[r+γ​μs′,b−q]+22​γ2​σs′,b2≈−(q−μτ,b∗)22​σb∗2superscript𝑞subscript¯𝜇𝜏𝑏22superscriptsubscript¯𝜎𝜏𝑏2subscriptsuperscript𝑏′𝑏superscriptsubscriptdelimited-[]𝑟𝛾subscript𝜇superscript𝑠′𝑏𝑞22superscript𝛾2subscriptsuperscript𝜎2superscript𝑠′𝑏superscript𝑞superscriptsubscript𝜇𝜏𝑏22superscriptsubscriptsuperscript𝜎𝑏2-\frac{\left(q-\bar{\mu}_{\tau,b}\right)^{2}}{2\bar{\sigma}_{\tau,b}^{2}}-\sum_{b^{\prime}\neq b}\frac{\left[r+\gamma\mu_{s^{\prime},b}-q\right]_{+}^{2}}{2\gamma^{2}\sigma^{2}_{s^{\prime},b}}\approx-\frac{(q-\mu_{\tau,b}^{*})^{2}}{2{\sigma^{*}_{b}}^{2}}(8)We find μτ,b∗subscriptsuperscript𝜇𝜏𝑏\mu^{*}_{\tau,b} and στ,b∗subscriptsuperscript𝜎𝜏𝑏\sigma^{*}_{\tau,b} by matching the first and the second derivatives, respectively (the coefficient of the quadratic term gives the local curvature):μτ,b∗−μ¯τ,bσ¯τ,b2=∑b′≠b[r+γ​μs′,b′−μτ,b∗]+γ2​σs′,b′21στ,b∗2=1σ¯τ,b2+∑b′≠bH​(r+γ​μs′,b′−μτ,b∗)γ2​σs′,b′2formulae-sequencesubscriptsuperscript𝜇𝜏𝑏subscript¯𝜇𝜏𝑏subscriptsuperscript¯𝜎2𝜏𝑏subscriptsuperscript𝑏′𝑏subscriptdelimited-[]𝑟𝛾subscript𝜇superscript𝑠′superscript𝑏′superscriptsubscript𝜇𝜏𝑏superscript𝛾2superscriptsubscript𝜎superscript𝑠′superscript𝑏′21superscriptsuperscriptsubscript𝜎𝜏𝑏21subscriptsuperscript¯𝜎2𝜏𝑏subscriptsuperscript𝑏′𝑏𝐻𝑟𝛾subscript𝜇superscript𝑠′superscript𝑏′subscriptsuperscript𝜇𝜏𝑏superscript𝛾2subscriptsuperscript𝜎2superscript𝑠′superscript𝑏′\frac{\mu^{*}_{\tau,b}-\bar{\mu}_{\tau,b}}{\bar{\sigma}^{2}_{\tau,b}}=\sum_{b^{\prime}\neq b}\frac{\left[r+\gamma\mu_{s^{\prime},b^{\prime}}-\mu_{\tau,b}^{*}\right]_{+}}{\gamma^{2}\sigma_{s^{\prime},b^{\prime}}^{2}}\qquad\frac{1}{{\sigma_{\tau,b}^{*}}^{2}}=\frac{1}{\bar{\sigma}^{2}_{\tau,b}}+\sum_{b^{\prime}\neq b}\frac{H\left(r+\gamma\mu_{s^{\prime},b^{\prime}}-\mu^{*}_{\tau,b}\right)}{\gamma^{2}\sigma^{2}_{s^{\prime},b^{\prime}}}(9)where H​(⋅)𝐻⋅H(\cdot) is a Heaviside step function. The self-consistent piece-wise linear equation for μτ,b∗subscriptsuperscript𝜇𝜏𝑏\mu^{*}_{\tau,b} can be rewritten as follows:μτ,b∗=(1σ¯τ,b2+∑b′≠bH​(r+γ​μs′,b′−μτ,b∗)γ2​σs′,b′2)−1​(μ¯τ,bσ¯τ,b2+∑b′≠b(r+γ​μs′,b′)γ2​σs′,b′2​H​(r+γ​μs′,b′−μτ,b∗))superscriptsubscript𝜇𝜏𝑏superscript1superscriptsubscript¯𝜎𝜏𝑏2subscriptsuperscript𝑏′𝑏𝐻𝑟𝛾subscript𝜇superscript𝑠′superscript𝑏′subscriptsuperscript𝜇𝜏𝑏superscript𝛾2subscriptsuperscript𝜎2superscript𝑠′superscript𝑏′1subscript¯𝜇𝜏𝑏superscriptsubscript¯𝜎𝜏𝑏2subscriptsuperscript𝑏′𝑏𝑟𝛾subscript𝜇superscript𝑠′superscript𝑏′superscript𝛾2subscriptsuperscript𝜎2superscript𝑠′superscript𝑏′𝐻𝑟𝛾subscript𝜇superscript𝑠′superscript𝑏′subscriptsuperscript𝜇𝜏𝑏\mu_{\tau,b}^{*}=\left(\frac{1}{\bar{\sigma}_{\tau,b}^{2}}+\sum_{b^{\prime}\neq b}\frac{H(r+\gamma\mu_{s^{\prime},b^{\prime}}-\mu^{*}_{\tau,b})}{\gamma^{2}\sigma^{2}_{s^{\prime},b^{\prime}}}\right)^{-1}\left(\frac{\bar{\mu}_{\tau,b}}{\bar{\sigma}_{\tau,b}^{2}}+\sum_{b^{\prime}\neq b}\frac{(r+\gamma\mu_{s^{\prime},b^{\prime}})}{\gamma^{2}\sigma^{2}_{s^{\prime},b^{\prime}}}H(r+\gamma\mu_{s^{\prime},b^{\prime}}-\mu^{*}_{\tau,b})\right)This is an IVW average mean of the prior, the TD target distribution of b𝑏b, and other TD target distributions whose means are larger than μτ,b∗subscriptsuperscript𝜇𝜏𝑏\mu^{*}_{\tau,b}. The height of the peak is computed for q=μτ,b∗𝑞superscriptsubscript𝜇𝜏𝑏q=\mu_{\tau,b}^{*},kτ,b∗=cτ,b​στ,b∗σ¯τ,b​exp⁡{−(μτ,b∗−μ¯τ,b)22​σ¯τ,b2−∑b′≠b[r+γ​μs′,b′−μτ,b∗]+22​γ2​σs′,b′2}subscriptsuperscript𝑘𝜏𝑏subscript𝑐𝜏𝑏subscriptsuperscript𝜎𝜏𝑏subscript¯𝜎𝜏𝑏superscriptsuperscriptsubscript𝜇𝜏𝑏subscript¯𝜇𝜏𝑏22superscriptsubscript¯𝜎𝜏𝑏2subscriptsuperscript𝑏′𝑏superscriptsubscriptdelimited-[]𝑟𝛾subscript𝜇superscript𝑠′superscript𝑏′superscriptsubscript𝜇𝜏𝑏22superscript𝛾2subscriptsuperscript𝜎2superscript𝑠′superscript𝑏′k^{*}_{\tau,b}=\frac{c_{\tau,b}\sigma^{*}_{\tau,b}}{\bar{\sigma}_{\tau,b}}\exp\left\{-\frac{\left(\mu_{\tau,b}^{*}-\bar{\mu}_{\tau,b}\right)^{2}}{2\bar{\sigma}_{\tau,b}^{2}}-\sum_{b^{\prime}\neq b}\frac{\left[r+\gamma\mu_{s^{\prime},b^{\prime}}-\mu_{\tau,b}^{*}\right]_{+}^{2}}{2\gamma^{2}\sigma^{2}_{s^{\prime},b^{\prime}}}\right\}(10)The final approximated distribution is a Gaussian mixture model with μτ,b∗,στ,b∗,wτ,b∗subscriptsuperscript𝜇𝜏𝑏subscriptsuperscript𝜎𝜏𝑏subscriptsuperscript𝑤𝜏𝑏\mu^{*}_{\tau,b},\sigma^{*}_{\tau,b},w^{*}_{\tau,b} as mean, variance, and weight, respectively, for all b∈𝒜𝑏𝒜b\in\mathcal{A} where wτ,b∗=kτ,b∗/∑b′kτ,b′∗subscriptsuperscript𝑤𝜏𝑏subscriptsuperscript𝑘𝜏𝑏subscriptsuperscript𝑏′subscriptsuperscript𝑘𝜏superscript𝑏′w^{*}_{\tau,b}=k^{*}_{\tau,b}/\sum_{b^{\prime}}k^{*}_{\tau,b^{\prime}}.Therefore, we update the belief distribution over Qs,asubscript𝑄𝑠𝑎Q_{s,a} with the mean and variance of the Gaussian mixture model:𝔼p~​[q]=∑b∈𝒜wτ,b∗​μτ,b∗Varp~​[q]=∑b∈𝒜wτ,b∗​στ,b∗2+∑b∈𝒜wτ,b∗​μτ,b∗2−(𝔼p~​[q])2formulae-sequencesubscript𝔼~𝑝delimited-[]𝑞subscript𝑏𝒜superscriptsubscript𝑤𝜏𝑏subscriptsuperscript𝜇𝜏𝑏subscriptVar~𝑝delimited-[]𝑞subscript𝑏𝒜superscriptsubscript𝑤𝜏𝑏superscriptsuperscriptsubscript𝜎𝜏𝑏2subscript𝑏𝒜superscriptsubscript𝑤𝜏𝑏superscriptsubscriptsuperscript𝜇𝜏𝑏2superscriptsubscript𝔼~𝑝delimited-[]𝑞2\mathbb{E}_{\tilde{p}}[q]=\sum_{b\in\mathcal{A}}w_{\tau,b}^{*}\mu^{*}_{\tau,b}\quad\qquad\mathrm{Var}_{\tilde{p}}[q]=\sum_{b\in\mathcal{A}}w_{\tau,b}^{*}{\sigma_{\tau,b}^{*}}^{2}+\sum_{b\in\mathcal{A}}w_{\tau,b}^{*}{\mu^{*}_{\tau,b}}^{2}-\left(\mathbb{E}_{\tilde{p}}[q]\right)^{2}(11)The final mean is the weighted sum of each individual mean with a weight from kτ,b∗subscriptsuperscript𝑘𝜏𝑏k^{*}_{\tau,b} and the final variance is the weighted sum of each individual variance added to a non-negative term accounting for the dispersion of the means. As shown in Eq.10, the weights are determined by TD errors, variances, relative distances to larger TD targets. It has the TD error penalizing term, cτ,bsubscript𝑐𝜏𝑏c_{\tau,b}, and also decreases as the number of TD targets larger than μτ,b∗subscriptsuperscript𝜇𝜏𝑏\mu^{*}_{\tau,b} increases. Therefore, the weight provides a softened maximum property over b𝑏b. + +The final algorithm is summarized in Table.1. Its space complexity is O​(|𝒮|​|𝒜|)𝑂𝒮𝒜O(|\mathcal{S}||\mathcal{A}|). The computational complexity of each update is O​(|𝒜|2)𝑂superscript𝒜2O(|\mathcal{A}|^{2}) which is higher than Q-learning but only by a factor of |𝒜|𝒜|\mathcal{A}| and constant in the number of states. + +In an asymptotic limit of σw/σs′,b→0→subscript𝜎𝑤subscript𝜎superscript𝑠′𝑏0\sigma_{w}/\sigma_{s^{\prime},b}\rightarrow 0, ∀b∈𝒜for-all𝑏𝒜\forall b\in\mathcal{A} and |𝒜|=2𝒜2|\mathcal{A}|=2, the expected likelihood distribution for σw>0subscript𝜎𝑤0\sigma_{w}>0 is similar to p​(r+γ​Vs′|q,θ)𝑝𝑟conditional𝛾subscript𝑉superscript𝑠′𝑞𝜃p(r+\gamma V_{s^{\prime}}|q,\theta) but the variance of its Gaussian PDF term is γ2​σs′,b2+σw2superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏2superscriptsubscript𝜎𝑤2\gamma^{2}\sigma_{s^{\prime},b}^{2}+\sigma_{w}^{2} instead of γ2​σs′,b2superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏2\gamma^{2}\sigma_{s^{\prime},b}^{2} (see Appendix D for details):∑b∈𝒜γγ2​σs′,b2+σw2​ϕ​(q−(r+γ​μs′,b)γ2​σs′,b2+σw2)​∏b′≠b,b′∈𝒜Φ​(q−(r+γ​μs′,b′)γ​σs′,b′)subscript𝑏𝒜𝛾superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏2subscriptsuperscript𝜎2𝑤italic-ϕ𝑞𝑟𝛾subscript𝜇superscript𝑠′𝑏superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏2subscriptsuperscript𝜎2𝑤subscriptproductformulae-sequencesuperscript𝑏′𝑏superscript𝑏′𝒜Φ𝑞𝑟𝛾subscript𝜇superscript𝑠′superscript𝑏′𝛾subscript𝜎superscript𝑠′superscript𝑏′\displaystyle\sum_{b\in\mathcal{A}}\frac{\gamma}{\sqrt{\gamma^{2}\sigma_{s^{\prime},b}^{2}+\sigma^{2}_{w}}}\phi\left(\frac{q-(r+\gamma\mu_{s^{\prime},b})}{\sqrt{\gamma^{2}\sigma_{s^{\prime},b}^{2}+\sigma^{2}_{w}}}\right)\prod_{b^{\prime}\neq b,b^{\prime}\in\mathcal{A}}\Phi\left(\frac{q-(r+\gamma\mu_{s^{\prime},b^{\prime}})}{\gamma\sigma_{s^{\prime},b^{\prime}}}\right)(12)Extending this result to the general case (|𝒜|=n𝒜𝑛|\mathcal{A}|=n for n∈ℕ𝑛ℕn\in\mathbb{N}), the posterior distribution, p^Qs,a​(q)subscript^𝑝subscript𝑄𝑠𝑎𝑞\hat{p}_{Q_{s,a}}(q), for σw>0subscript𝜎𝑤0\sigma_{w}>0 is same with Eq.3 but γ2​σs′,b2superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏2\gamma^{2}\sigma_{s^{\prime},b}^{2} is replaced by γ2​σs′,b2+σw2superscript𝛾2superscriptsubscript𝜎superscript𝑠′𝑏2superscriptsubscript𝜎𝑤2\gamma^{2}\sigma_{s^{\prime},b}^{2}+\sigma_{w}^{2} in cτ,bsubscript𝑐𝜏𝑏c_{\tau,b}, μ¯τ,bsubscript¯𝜇𝜏𝑏\bar{\mu}_{\tau,b}, and σ¯τ,bsubscript¯𝜎𝜏𝑏\bar{\sigma}_{\tau,b} (Eq.4-5). Therefore, μτ,b∗superscriptsubscript𝜇𝜏𝑏\mu_{\tau,b}^{*}, στ,b∗superscriptsubscript𝜎𝜏𝑏\sigma_{\tau,b}^{*}, and kτ,b∗superscriptsubscript𝑘𝜏𝑏k_{\tau,b}^{*} in the ADFQ algorithm (Table.1) are also changed accordingly. + +Theorem 1 extends to the ADFQ algorithm (Proof in Appendix E). The contraction behavior of the variances in the case of Theorem 1 is also empirically observed in ADFQ. + +As we have observed the behavior of ατsubscript𝛼𝜏\alpha_{\tau} in Theorem 1, the learning rate ατsubscript𝛼𝜏\alpha_{\tau} again provides a natural learning rate with the ADFQ update. We can therefore think of Q-learning as a special case of ADFQ. + +To demonstrate the behavior of the ADFQ update, we look at the simple MDP (γ=0.9𝛾0.9\gamma=0.9) in Fig.2 at a specific iteration. An episode starts at s0subscript𝑠0s_{0} and terminates at either s2subscript𝑠2s_{2} or s3subscript𝑠3s_{3}. At s1subscript𝑠1s_{1}, each action returns a stochastic reward with p=0.2𝑝0.2p=0.2. The optimal deterministic policy at s1subscript𝑠1s_{1} is a1subscript𝑎1a_{1}. Suppose an RL learner has already visited (s1,a1)subscript𝑠1subscript𝑎1(s_{1},a_{1}) 3 times and obtained a reward of r=5𝑟5r=5 every time. Now it is on the t𝑡t-th iteration with (s1,a1)subscript𝑠1subscript𝑎1(s_{1},a_{1})The plots in Fig.2 show the ADFQ update for Qs0,a0subscript𝑄subscript𝑠0subscript𝑎0Q_{s_{0},a_{0}} at t+1𝑡1t+1 when rt=+5subscript𝑟𝑡5r_{t}=+5 (left) and rt=−5subscript𝑟𝑡5r_{t}=-5 (right).When it receives a less expected reward, −55-5, at t𝑡t, σs1,a1;tsubscript𝜎subscript𝑠1subscript𝑎1𝑡\sigma_{s_{1},a_{1};t} is updated to a larger value than the one in the rt=+5subscript𝑟𝑡5r_{t}=+5 case. Then, the episode is terminated and the next episode starts at st+1=s0subscript𝑠𝑡1subscript𝑠0s_{t+1}=s_{0}, at+1=a0subscript𝑎𝑡1subscript𝑎0a_{t+1}=a_{0}. ADFQ considers both Qs1,a0subscript𝑄subscript𝑠1subscript𝑎0Q_{s_{1},a_{0}} and Qs1,a1subscript𝑄subscript𝑠1subscript𝑎1Q_{s_{1},a_{1}} for updating Qs0,a0subscript𝑄subscript𝑠0subscript𝑎0Q_{s_{0},a_{0}}. Due to the relatively large TD error and variance of Qs1,a1subscript𝑄subscript𝑠1subscript𝑎1Q_{s_{1},a_{1}}, a lower value is assigned to wτ,b=1∗subscriptsuperscript𝑤𝜏𝑏1w^{*}_{\tau,b=1}. In this same scenario, Q-learning would update Q​(s0,a0)𝑄subscript𝑠0subscript𝑎0Q(s_{0},a_{0}) only from Q​(s1,a0)𝑄subscript𝑠1subscript𝑎0Q(s_{1},a_{0}) and regulate the update amount with the learning rate which is usually fixed or determined by the number of visits. + +In order to show the benefits of the update rule, we examined Q-learning, ADFQ, and a numerical approximation of the mean and variance of Eq.3 (denoted as ADFQ-Numeric) for the convergence to the optimal Q-values in the presented MDP and a similar MDP but with 10 terminating states and 10 actions. Random exploration is used in order to evaluate only the update part of each algorithm. During learning, we computed the root mean square error (RMSE) between the estimated Q-values (or means) and Q∗superscript𝑄Q^{*}, and plotted the averaged results over 5 trials in Fig.3. As shown, ADFQ converged to the optimal Q-values quicker than Q-learning in both cases and showed more stable performance. ADFQ-Numeric suffers from correctly estimating the parameters when its variances become small as it is previously pointed out, and resulted a poor convergence result in the large MDP. + +In this section, we extend our algorithm to complex environments with neural networks similar to Deep Q-Networks (DQN) proposed in [22]. In the Deep ADFQ model with network parameters ξ𝜉\xi, the output of the network is mean μ​(s,a;ξ)𝜇𝑠𝑎𝜉\mu(s,a;\xi) and variance σ2​(s,a;ξ)superscript𝜎2𝑠𝑎𝜉\sigma^{2}(s,a;\xi) of each action for a given state s𝑠s as shown in Fig.4. In practice, we use −log⁡(σs,a)subscript𝜎𝑠𝑎-\log(\sigma_{s,a}) instead of σs,a2subscriptsuperscript𝜎2𝑠𝑎\sigma^{2}_{s,a} for the output to ensure positive values for the variance. As in DQN, we have a train network (ξ𝜉\xi) and a target network (ξ′superscript𝜉′\xi^{\prime}). Mean and variance for s𝑠s and s′superscript𝑠′s^{\prime} from the target network are used as inputs into the ADFQ algorithm to compute the desired mean, μA​D​F​Qsuperscript𝜇𝐴𝐷𝐹𝑄\mu^{ADFQ}, and standard deviation, σA​D​F​Qsuperscript𝜎𝐴𝐷𝐹𝑄\sigma^{ADFQ} for the train network. We used prioritized experience replay [29] and a combined Huber loss functions of mean and variance. + +In order to demonstrate the effectiveness of our algorithm, we tested on six Atari games, Enduro (|𝒜|=9𝒜9|\mathcal{A}|=9), Boxing (|𝒜|=18𝒜18|\mathcal{A}|=18), Pong (|𝒜|=6𝒜6|\mathcal{A}|=6), Asterix (|𝒜|=9𝒜9|\mathcal{A}|=9), Kung-Fu Master (|𝒜|=14𝒜14|\mathcal{A}|=14), and Breakout (|𝒜|=4𝒜4|\mathcal{A}|=4), from the OpenAI gym simulator [4]. For baselines, we used DQN and Double DQN with prioritized experience replay implemented in OpenAI baselines [8] with their default hyperparameters for all games. We used ϵitalic-ϵ\epsilon-greedy action policy with ϵitalic-ϵ\epsilon annealed from 1.0 to 0.01 for the baselines as well as ADFQ. In ADFQ, the greedy selection is performed on the mean values instead of Q-values. Additionally, we examined Thompsing Sampling (TS) [31] for ADFQ which selects at=argmaxaqst,asubscript𝑎𝑡subscriptargmax𝑎subscript𝑞subscript𝑠𝑡𝑎a_{t}=\operatornamewithlimits{argmax}_{a}q_{s_{t},a} where qst,a∼pQst,a(⋅|θt)q_{s_{t},a}\sim p_{Q_{s_{t},a}}(\cdot|\theta_{t}). Further details on the network architecture are provided in Appendix F. + +The algorithms were evaluated for TH=10​Msubscript𝑇𝐻10𝑀T_{H}=10M training steps (5M for Pong). Each learning was greedily evaluated at every epoch (=TH/100absentsubscript𝑇𝐻100=T_{H}/100) for 3 times, and their averaged results are presented in Fig.5. The entire experiment was repeated for 3 random seeds. Rewards were normalized to {−1,0,1}101\{-1,0,1\} and different from raw scores of the games. Both ADFQ with TS and with ϵitalic-ϵ\epsilon-greedy notably surpassed DQN and Double DQN in Enduro, Boxing, Asterix, and Kung-Fu Master and showed similar results in Pong. The performance of ADFQ in Breakout is explained as Breakout is the only tested domain where there is no dynamic object interrupting the learning agent. As the demonstration in Sec.5 and the additional experiments in the appendix show, improvements of ADFQ from Q-learning is more significant when an experimental domain has high stochasticity and its action space is large due to the non-greedy update with uncertainty measures. Additionally, ADFQ showed more stable performance in all tested domains overcoming DQN’s instability. ADFQ with TS achieved slightly higher performance than the ϵitalic-ϵ\epsilon-greedy method utilizing the uncertainty in exploration. + +We proposed an approach to Bayesian off-policy TD method called ADFQ. ADFQ demonstrated that it could improve some of the issues from the greedy update of Q-learning by showing the quicker convergence to Q∗superscript𝑄Q^{*} than Q-learning and surpassing DQN and Double DQN in various Atari games. The presented ADFQ algorithm demonstrates several intriguing results. + +Non-greedy update regularized by uncertainty measures. Unlike the conventional Q-learning algorithm, ADFQ incorporates the information of all available actions for the subsequent state in the Q-value update. Each subsequent state-action pair contributes to the update based on its TD target mean and variance as well as its TD error. Particularly, we make use of our uncertainty measures not only in exploration but also in the value update as natural regularization. The advantages of the non-greedy update are noticeable in highly stochastic domains or domains with a large action space in the experiment. + +Convergence to Q-learning. We prove that ADFQ converges to Q-learning as the variances decrease and can be seen as a more general form of Q-learning. + +Computational Complexity and Scalability. One of the major drawbacks of Baysian RL approaches is their high computational complexity [14]. ADFQ is computationally efficient and is extended to Deep ADFQ with a neural network. + +We would like to highlight the fact that ADFQ is a Bayesian counterpart of Q-learning and is orthogonal to most other advancements made in Deep RL. Deep ADFQ merely changes the loss function and we compare with basic architectures here to provide insight as to how it may improve the performance. ADFQ can be used in conjunction with other extensions and techniques applied to Q-learning and DQN. \ No newline at end of file diff --git a/1712.03463v2.txt b/1712.03463v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..9af57bd6e547ebc1d513ea4ba5d1da042690dd09 --- /dev/null +++ b/1712.03463v2.txt @@ -0,0 +1,624 @@ +\section{Motivation} +One of the longstanding challenges of AI, first introduced as SHRDLU in early 70s \cite{shrdlu}, is to build an agent that can follow natural language instructions in a physical environment. +The ultimate goal is to create systems that can interact in the \textit{real} world using \emph{rich} natural language. +However, due to the complex interdisciplinary nature of the challenge \cite{harnard}, which spans across several fields in AI, including robotics, language, and vision, most existing studies make varying degrees of simplifying assumptions. + +On one end of the spectrum is rich robotics paired with +simple constrained language \cite{Roy:2005fj,tellex:2011}, as +acquiring a large corpus of natural language grounded with a real robot is prohibitively expensive \cite{Misra-RSS-14,thomason:corl17}. +On the other end of the spectrum are approaches based on simulation environments, +which support broader deployment at the cost of unrealistic simplifying assumptions about the world +\cite{Bisk:2016:NAACL,wang-liang-manning:2016:P16-1}. +In this paper, we seek to reduce the gap between two complementary research efforts by introducing a new level of complexity to both the environment and the language associated with the interactions. + +\paragraph{Lifting Grid Assumptions} +We find that language situated in a richer world leads to richer language. One such example is presented in Figure \ref{fig:example}. +To correctly place the UPS block, the system must understand the complex physical, spatial, and pragmatic meaning of language including: +(1) the 3D concept of a \emph{tower}, +(2) that \textit{new} or \textit{fourth} are referencing an assumed future, +and (3) that \textit{mirror} implies an axis and reflection. +However, concepts such as above are often outside the scope of most existing language grounding systems. + + + + +\begin{figure} +\centering +\begin{tabular}{c@{\hspace{2pt}}c@{\hspace{2pt}}c} +\multicolumn{3}{c}{\it ``On the (new) fourth tower, mirror Nvidia with UPS.''}\\[3pt] +\raisebox{-.5\height}{\includegraphics[width=0.4\linewidth]{images/Ex1}} & $\Rightarrow$ & \raisebox{-.5\height}{\includegraphics[width=0.4\linewidth]{images/Ex2}}\\ +\end{tabular} +\caption{Example language instruction in our new dataset. The action requires fine-grained positioning and utilizes a complex concept: {\it mirror}.} +\label{fig:example} +\end{figure} + +In this work, we introduce a new dataset that allows for learning significantly richer and more complex spatial language than previously explored. +Building on the simulator provided by \citet{Bisk:2016:NAACL}, +we create roughly 13,000 new crowdsourced instructions (9 per action), nearly doubling the size of the original dataset in the 2D blocks world introduced in their previous work. +We address the challenge of realism in the simulated data by introducing three crucial but previously absent complexities: +\begin{enumerate} +\item 3D block structures (lifting 2D assumptions) +\item Fine-grained real valued locations (lifting grid assumptions) +\item Rotational, angled movements (lifting grid assumptions) +\end{enumerate} + + +\begin{figure*}[h] +\centering +\begin{tabular}{@{}c@{\hspace{2pt}}c@{\hspace{30pt}}c@{\hspace{2pt}}c@{}} +\multicolumn{2}{c}{\textbf{\citet{Bisk:2016:NAACL}}} & \multicolumn{2}{c}{\textbf{This work}}\\ +\includegraphics[width=0.2\linewidth]{images/old_1} & +\includegraphics[width=0.2\linewidth]{images/old_2} & +\includegraphics[width=0.2\linewidth]{images/new_1} & +\includegraphics[width=0.2\linewidth]{images/new_2} \\ +\multicolumn{2}{@{}l}{\textbf{Freq Relations: } left, up, right, directly, above, until} & +\multicolumn{2}{@{}l}{\textbf{New Relations: } degrees, rotate, clockwise, covering,}\\ +\multicolumn{2}{@{}l}{corner, top, down, below, bottom, slide, space, between} & +\multicolumn{2}{@{}l}{45, layer, mirror, arch, towers, equally, twist, balance, ...} +\end{tabular} +\caption{Example goal states in our work as compared to the previous Blocks dataset. Our work extends theirs to include rotations, 3D construction, and human created designs. This has a dramatic effect on the language used. Rich worlds facilitate rich language, above are the most common relations in their data and the most common new relations in ours.} +\label{fig:comparison} +\end{figure*} + +\paragraph{Learning Interpretable Operators} +In addition, we introduce an interpretable neural model for learning spatial operations in the rich 3D blocks world. +In particular, in our model instead of using a single layer conditioned on the language for interpreting the operations, we have the model choose which parameters to apply via a softmax over the possible parameter vectors to use. +Specifically, by having the model decide for each example which parameters to use, the model picks among 32 different networks, deciding which is appropriate for a given sentence. Learning these networks and when to apply them enables the model to cluster spatial functions. Secondly, +by encouraging low entropy in the selector, the model converges to nearly one-hot representations during training. A side effect of this decision is that the final model exposes an API which +can be used interactively for focusing the model's attention and choosing its actions. +We will exploit this property when generating plots in Figure \ref{fig:operations_grid} showing the meaning of each learned function. +Our model is still fully end-to-end trainable despite choosing its own parameters and composeable structure, leading +to a modular network structure similar to \cite{andreas-EtAl:2016:N16-1}. + + +The rest of the paper is organized as follows. We first discuss related work, introduce our new dataset, followed by our new model. We then present empirical evaluations, analysis on the internal representations, and error analysis. We conclude with the discussion for future work. +\section{Related Work} +\label{sec:related} +Advances in robotics, language, and vision are all applicable to this domain. +The intersection of robotics and language have seen impressive results in +grounding visual attributes \cite{Kollar:2013wr,Matuszek:2014ts}, spatial reasoning \cite{Steels:1997we,Roy:2002jc,Guadarrama:2013tr}, and action taking \cite{MacMahon:2006:WTC:1597348.1597423,yu-siskind:2013:ACL2013}. For example, recent work \cite{thomason:ijcai15,thomason:ijcai16,thomason:corl17} has shown how these instructions can be combined with exploration on physical robotics to follow instructions and learn representations online. + +Within computer vision Visual Question Answering \cite{VQA} has been widely popular. Unfortunately, it is unclear what models are learning and how much they are understanding versus memorizing bias in the training data \cite{anchor:nipsws16}. Datasets and models have also recently been introduced for visual reasoning \cite{johnson2017inferring,NIPS2017_7082} and referring expressions \cite{kazemzadeh2014referitgame,mao2016generation}. + +Finally, within the language community, interest in action understanding follows naturally from research in semantic parsing \cite{andreas-klein:2015:EMNLP,Artzi:2013th}. Here, the community has traditionally been focused on more complex and naturally occurring text, though this has not always been possible for the navigation domain. + + +Simultaneously, work within NLP \cite{Bisk:2016:AAAI,wang-liang-manning:2016:P16-1} and Robotics \cite{li2016spatial} returned to the question of action taking and scene understanding in SHRDLU style worlds. The goal with this modern incarnation was to truly solicit natural language from humans without limiting their vocabulary or referents. This was an important step in moving towards unconstrained language understanding. + +The largest corpus was provided by \citet{Bisk:2016:NAACL}. In this work, the authors presented pairs of scenes +with simulated blocks to users of Amazon's +Mechanical Turk. Turkers would then describe actions or instructions that +their imagined collaborator needs to perform to transform the input scene into the target (e.g. Moving a block to the side of another). An important aspect of +this dataset is that participants +assume they are speaking to another human. This means they do not +limit their vocabulary, space of references, simplify their grammar, +or even write carefully. The annotators assume that whomever will be reading +what they submit is capable of error correction, spatial reasoning, +and complex language understanding. This provides an important, and +realistic, basis for training artificial language understanding +agents. Follow-up work has investigated advances to language +representations \cite{pivsl-marevcek:2017:RoboNLP}, spatial +reasoning \cite{tan17}, and reinforcement learning approaches for +mapping language to latent action sequences \cite{misra2017}. +\section{Creating Realistic Data} +\label{sec:data} +To facilitate closing the gap between simulation and reality, blocks should not have perfect locations, orderings, or alignments. They should have jitter, nuanced alignments, rotations and the haphazard construction of real objects. Figure \ref{fig:comparison} shows example how our new configurations aim to capture that realism (right) as compared to previous work (left). Previous work created target configurations by downsampling MNIST \cite{lecun-98} digits. This enabled them to create interpretable but unrealistic 2D final representations and the order in which blocks were combined was determined by a heuristic to simulate drawing/writing. + +In our data, we solicited creations from people around our lab and their children, not affiliated with the project. They built whatever they wanted (open concept domain), in three dimensions, and were allowed to rotate the blocks. For example, the animal on the left is an elephant whose trunk, tail, and legs curve. Additionally, because humans built the configurations, we were able to capture the order in which blocks were placed for a more natural trajectory. Realism brings with it important new challenges discussed below. + +\paragraph{Real Valued Coordinate Spaces} +The discretized world seen in several recent +datasets \cite{Bisk:2016:NAACL,wang-liang-manning:2016:P16-1} simplifies +spatial reasoning. Simple constructions like \texttt{left} and \texttt{right} +can be reduced to exact offsets that do not require context specific interpretations +(e.g. \texttt{right} $= +[1,0,0]$). In reality, these concepts +depend on the scene around them. For example, in the rightmost image +of Figure \ref{fig:comparison}, it is correct to say that the +McDonald's block is \textit{right} of Adidas, but also that SRI +is \textit{right} of Heineken, despite both having different +offsets. The modifier \textit{mirroring} disambiguates the meaning for us. + +\paragraph{Semantically Irrelevant Noise} +It is important to note that with realism comes noise. Occasionally, an annotator may bump a +block or shift the scene a little. Despite repeated efforts to +clean and curate the data, most +people did not consider this noise noteworthy because it was +semantically irrelevant to the task. For example, if while performing +an action, a nearby block jostles, it does not change the holistic +understanding of the scene. For this reason, we only evaluate the +placement of the block that ``moved the furthest.'' This is a baby +step towards building models invariant to changes +in the scene orthogonal to the goal. + +\paragraph{Physics} +One concession we were forced to make was +relaxing physics. Unlike prior +work \cite{wang-EtAl:2017:Long3}, we insisted that the final +configurations roughly adhere to physics (e.g. minimizing overhangs, +no floating blocks, limited intersection), but we found volunteers too +often gave up if we forced them to build entirely with physics turned +on. This also means that intermediary steps that in the real world +require a counter-weight can be constructed one step at a time. + +\begin{table} +\centering +\begin{tabular}{@{}lllllc@{}} + & Configs & Types & Tokens & Utters & Ave. Len\\ +\toprule +B16 & 100 & 1,281 & 258,013 & 16,767 & 15.4\\ This & 100 & 1,820 & +233,544 & 12,975 & 18.0\\ +\midrule +Total & 200 & 2,299 & 491,557 & 29,742 & 16.5\\ +\bottomrule +\end{tabular} +\caption{Corpus statistics for our dataset as compared to previous work (Bisk 16), and the total statistics when combined.} +\label{tab:corpus_stats} +\end{table} + +\paragraph{Language} +Our new corpus contains nearly all of the concepts of previous work, but introduces many more. Figure \ref{fig:comparison} shows the most common +relations in prior work, and the most common new concepts. We see that these +predominantly focus on rotation (\textit{degrees, clockwise, ...}) and 3D construction (\textit{arch, balance, ...}), but higher level concepts like mirroring or balancing pose fundamentally new challenges. +\subsection{Corpus Statistics} +Our new dataset comprises 100 configurations split 70-20-10 +between training, testing, and development. Each configuration has +between five and twenty steps (and blocks). We present type and token +statistics in Table \ref{tab:corpus_stats}, where we use +NLTK's \cite{NLTK} treebank tokenizer. This yields higher +token counts in previous works due to +different assumptions about punctuation. + +Not all of our annotators +made use of the full 20 blocks. As such, we have fewer +utterances than the original dataset for the same number of goal +configurations. Yet, we find that the instructions for +completing our tasks are more nuanced and therefore result in slightly +longer sentences on average. Finally, we note that while the +datasets are similar, there are significant enough differences that one +should not simply assume that training on the combined dataset will +necessarily yield a ``better" model on either one individually. There +are important linguistic and spatial reasoning differences between the +two that make our proposed data much more difficult. We present +all modeling results on both subsets of the data and the full combined +dataset. + +\begin{figure*} +\centering +\includegraphics[width=0.65\linewidth]{images/Model} +\caption{Our target prediction model uses the sentence to produce distributions over operations and blocks (arguments). The argument values illuminate regions of the world before the selected operation is applied. This final representation is used to predict offsets in $(x, y, z, \theta)$ space. In practice, two bi-LSTMs were used and the final vector contains rotation information.} +\label{fig:model} +\end{figure*} +\subsection{Evaluation and Angles} +We follow the evaluation setup by prior work and evaluate +by reporting the average distance ($L_2$ in block lengths) between where +a block should be placed and the model's prediction. This metric +naturally extends to 3D. +\begin{equation} + L_{x,y,z}(p, g) = || p - g ||_2 +\end{equation} + +We also devise a metric for evaluating rotations. In our released data,\footnote{\url{https://groundedlanguage.github.io/}} we +captured block orientations as quaternions. This allows for a +complete and accurate re-rendering of the exact block orientations +produced by our annotators. However, the most semantically +meaningful angle is the Eulerian rotation around the Y-axis. We will +therefore evaluate error as the minimal angle between the ground truth and prediction in radians as: +\begin{equation} + L_\theta(p, g) = atan2(sin(p - g), cos(p - g)) +\end{equation} +\subsection{Example Phenomena} +In the following example, nine instructions (three per annotator) are provided +for the proper placement of McDonald's. We see a diverse set of concepts that +include counting, abstract notions like mirror or parallel, +geometric concepts like a square or row, and even constraints +specified by three different blocks. + + +\begin{tabular}{cc} +\textbf{$t_1$} & \textbf{$t_2$} \\ +\includegraphics[width=0.35\linewidth]{images/spaceship_1} & +\includegraphics[width=0.35\linewidth]{images/spaceship_2} \\ +\end{tabular}\\ + +\begin{footnotesize} +\begin{tabular}{l@{\hspace{6pt}}l@{}p{8cm}@{}} +\multicolumn{3}{l}{McDonalds...}\\ +1 & ... & \textbf{mirrors} Twitter across the Y-axis.\\ +2 & ... & to just over one space right of Twitter.\\ +3 & ... & to the right of twitter with \textbf{1/2 block} in between\\ +4 & ... & the right side of twitter with a \textbf{small space} in between\\ +5 & ... & as the bottom right \textbf{square}, \textbf{parallel} with Twitter,\\ + & & but a little further than touching.\\ +6 & ... & so it's just to the right (not \textbf{touching}) the Twitter block.\\ +7 & ... & \textbf{1/3-block's-length} to the right of the Twtter block.\\ +8 & ... & will move down and right until it is in the same \textbf{row} \\ + & & as twitter with a small space between them\\ +9 & ... & move it downwards enough to line up with the Twitter \\ + & & logo, then move it left to be closer to the Twitter logo, \\ + & & but not touching. The McDonald's logo should appear \\ + & & to be \textbf{inbetween the boundaries} of BurgerKing's \\ + & & left edge and SRI's right edge. \\ +\end{tabular} +\end{footnotesize} + +Later in the same task, the agent will be asked to rotate a block and place +it between the two stacks. We present here just a few excerpts wherein the +same action is described in five different ways. + +\begin{tabular}{cc} +\centering +\textbf{$t_7$} & \textbf{$t_8$} \\ +\includegraphics[width=0.35\linewidth]{images/spaceship_7} & +\includegraphics[width=0.35\linewidth]{images/spaceship_8} \\ +\end{tabular} + + +\begin{footnotesize} +\centering +\begin{tabular}{l@{\hspace{6pt}}p{8cm}@{}} +1 & \textbf{Rotate} SRI to the \textbf{right} ... \\ +2 & rotate it \textbf{45 degrees clockwise} ...\\ +3 & \textbf{only half of one rotation} so its corners point \\ + & where its edges did ... \\ +4 & \textbf{the logo faces the top right corner} of the screen...\\ +5 & Spin SRI \textbf{slightly} to the right and then set it \\ + & \textbf{in the middle of the 4 stacks}\\ +\end{tabular} +\end{footnotesize} + +To complete these instructions requires understanding angles, a new +set of verbs (\textit{rotate, spin, ...}), and references to the block's +previous orientation. The final example, indicates that a spin is +necessary, but assumes the goal of having it balance between the two +stacks is sufficient information to choose the right angle. + +The world knowledge and concepts necessary to complete this task are +well beyond the ability of any systems we are currently aware of or +expect to be built in the near future. Our goal is to provide data +and an environment which more accurately reflects the complexity of +grounding language to actions. Where previous work broadened +the community's understanding of the types of natural language people +use by recreating a blocks world with real human annotators, we felt +they did not go far enough in really covering the space of actions and +therefore language naturally present in even this constrained world. +\section{Model} +\label{sec:model} + +In addition to our dataset, we propose an end-to-end trainable model that is both competitive in +performance and has an easily interpretable internal +representation. The model takes in a natural language instruction for +block manipulation and a 3D representation of the world as +input, and outputs where the chosen block should be moved. The model can be broken down into three primary components: +\begin{enumerate} +\item Language Encoding for Block and Operation prediction +\item Applying a spatial operation +\item Predicting a coordinate in space. +\end{enumerate} + +Our overall model architecture is shown in Figure \ref{fig:model}. +By keeping the model modular we can both control the bottlenecks that +learning must use for representation and provide ourselves post hoc access +to interpretable scene and action representations (explored further in interpretability section). Without these, the model allows sentences +and operations to be represented by arbitrary N-dimensional vectors. +\subsection{Language Encoder} +As is common, we use bidirectional LSTMs~\cite{hochreiter1997long,schuster1997bidirectional} to encode the input sentence. +We use two LSTMs: one for predicting blocks to attend to, one for +choosing the operations to apply. Both LSTMs share a vocabulary embedding matrix, but +have no other means of communication. We experimented with using a single +LSTM as well as conditioning one on the other, but found it degraded performance. + +Once we have produced a representation for arguments $h_a$ and operations $h_o$, +we multiply each by their own feed-forward layers, then softmax to +produce a distribution over 20 blocks and 32 operations for $d_a$ and $d_{op}$, respectively. + +\begin{equation} +\begin{aligned} + d_a &= \mathrm{softmax(}W_a h_a + b_a)\\ + d_{op} &= \mathrm{softmax(}W_o h_o + b_o) +\end{aligned} +\end{equation} + +\paragraph{Argument Softmax} +The first output of our model is an attention over the block IDs. +The input world is represented by a +3D tensor of IDs.\footnote{In principle, we could work over an RGB rendering of the +world, but doing so would add layers of vision complexity that +do not help address the dominant language understanding problems.} +We can convert this to a one-hot representation and +multiply it by the distribution to get an attention per ``pixel'' (hereby +referred to as argument attention map) equal to the model's +confidence. In practice we found that the model was better able to +learn when the attention map was multiplied by 10. This may be due to parameter +initialization. Additionally, we do not allow the model to attend to +background so it is masked out (result in Figure \ref{fig:model}) We use the +operator * to represent the inner product. + +\begin{equation} + \begin{aligned} + A_{i,j,k}& = 10 ( \mathrm{\texttt{one\_hot}}(\mathrm{World}_{i,j,k}) * d_a)\\ + A_{i,j,k}& = A_{i,j,k}*\mathrm{\texttt{bg\_mask}}_{i,j,k} + \end{aligned} +\end{equation} + +\paragraph{Operation Softmax} +The second distribution we predict is over functions for spatial relations. Here +the model needs to choose how far and in what directions to go from +the blocks it has chosen to focus on. Unfortunately, there is no a +priori set of such functions as we have specifically chosen not to try and +pretrain/bias the model in this capacity, so the model must perform a type of +clustering where it simultaneously chooses a weighted sum of functions +and trains their values. + +As noted previously, for the sake of interpretability, we force the +encoding for operations ($d_{op}$) to be a latent softmax distribution +over 32 logits. The final operation vector that is passed along to the +convolutional model is computed as: +\begin{equation} + v_{op} = M_{op}d_{op} +\end{equation} + +Here, $M_{op}$ is a set of 32 basis vectors. The output vector +$v_{op}$ is a weighted average across all 32 basis vectors, using +$d_{op}$ to weight each individual basis. The goal of this formulation +is such that each of the 32 basis vectors will be independently +interpretable by replacing $d_{op}$ with a 1-hot vector, allowing us +to see what type of spatial operation each vector represents. +The choice of 32 basis vectors was an empirical +one. We only experimented with powers of two, but it is quite likely +a more optimal value exists. +\subsection{Predicting a location} +The second half of our pipeline features a convolutional model that +combines the encoded operation and argument blocks with the world +representation to determine the final location of the block-to-move. + +Given the aforementioned argument attention map (tensor $A$ of size +$B \times D \times H \times W \times 1$, our model starts by applying +the operation vector $v_{op}$ at every location of the map, weighted +by each location's attention score. This creates a world +representation of size $B\times D \times H \times W \times +|v_{op}|$. We then pass this world through two convolutional layers +using \texttt{tanh} or \texttt{relu} nonlinearities. + +In order to predict the final location for the block-to-move, we apply +a final $1\times 1\times 1$ convolutional layer to predict offsets and their respective +confidences for each location relative to a coordinate grid (8 values total). The +coordinate grid is a constant 3D tensor generated by uniformly +sampling points across each coordinate axis to achieve the desired +resolution. Given the coordinate grid, the goal of the learned +convolutional model is to, at every sampled point, predict offsets for +$x$, $y$, $z$, $\theta$, as well as a confidence for each predicted +offset. This formulation was similarly used for keypoint localization in~\cite{singh2016learning}. Let $g_x(i,j,k)$ be the $x$ coordinates for all sampled grid +points at grid location $(i,j,k)$ and let $d_x(i,j,k)$ and +$c_x(i,j,k)$ be the respective offsets and confidences, +then the final predicted $\hat{x}$ coordinate for the block-to-move +is computed as: +\begin{equation} +\hat{x}=\sum_{i,j,k}c_x(i,j,k) * (g_x(i,j,k) + d_x(i,j,k)) +\end{equation} + +Here, confidences $c_x(i,j,k)$ are softmax normalized across all grid +points. Predictions for $\hat{y}$, $\hat{z}$ are computed similarly. We compute $\hat{\theta}$ without a coordinate grid such that: $\hat{\theta}=\sum_{i,j,k}c_{\theta}(i,j,k)d_{\theta}(i,j,k)$. +\subsection{Implementation Details} +Our model is trained end-to-end using Adam~\cite{kingma2014adam} with +a batch size of 32. +The convolutional aspect of the model has +3 layers and operates on a world representation of +dimensions 32 $\times$ 4 $\times$ 64 $\times$ 64 $\times$ 32 (batch, depth, height, +width, channels). The first +convolutional layer uses a filter of size 4 $\times$ 5 $\times$ 5 and +the second of size 4 $\times$ 3 $\times$ 3, each followed by +a \texttt{tanh} nonlinearity for the 3D model\footnote{We did not perform a grid search for parameters, but we did find the 2D model performed better when a \texttt{relu} was used and Batch-Normalization \cite{ioffe15}. Finally, the depth values and kernel were set to 1 when training exclusively in 2D.}. +Both layers +output a tensor with the same dimensions as the input world. The final +predicton layer is a 1 $\times$ 1 $\times$ 1 filter that projects the +32 dimensional vector at each location down to 8 values as detailed in +the previous section. We further include an entropy term to encourage peakier distributions in the argument and operation softmaxes. + + +\begin{figure} +\centering +\includegraphics[width=0.6\linewidth]{interpolate.pdf} +\caption{Interpolations of operations 23 (north) and 26 (east) being applied at nine locations around the world.} +\label{fig:op_interp} +\end{figure} + + +\begin{figure*} +\centering{\scriptsize \texttt{~0}} \includegraphics[width=0.22\textwidth]{Ops/Op0.png}{\scriptsize \texttt{~1}} \includegraphics[width=0.22\textwidth]{Ops/Op1.png}{\scriptsize \texttt{~2}} \includegraphics[width=0.22\textwidth]{Ops/Op2.png}{\scriptsize \texttt{~3}} \includegraphics[width=0.22\textwidth]{Ops/Op3.png} + +{\scriptsize \texttt{~4}} \includegraphics[width=0.22\textwidth]{Ops/Op4.png}{\scriptsize \texttt{~5}} \includegraphics[width=0.22\textwidth]{Ops/Op5.png}{\scriptsize \texttt{~6}} \includegraphics[width=0.22\textwidth]{Ops/Op6.png}{\scriptsize \texttt{~7}} \includegraphics[width=0.22\textwidth]{Ops/Op7.png} + +{\scriptsize \texttt{~8}} \includegraphics[width=0.22\textwidth]{Ops/Op8.png}{\scriptsize \texttt{~9}} \includegraphics[width=0.22\textwidth]{Ops/Op9.png}{\scriptsize \texttt{10}} \includegraphics[width=0.22\textwidth]{Ops/Op10.png}{\scriptsize \texttt{11}} \includegraphics[width=0.22\textwidth]{Ops/Op11.png} + +{\scriptsize \texttt{12}} \includegraphics[width=0.22\textwidth]{Ops/Op12.png}{\scriptsize \texttt{13}} \includegraphics[width=0.22\textwidth]{Ops/Op13.png}{\scriptsize \texttt{14}} \includegraphics[width=0.22\textwidth]{Ops/Op14.png}{\scriptsize \texttt{15}} \includegraphics[width=0.22\textwidth]{Ops/Op15.png} + +{\scriptsize \texttt{16}} \includegraphics[width=0.22\textwidth]{Ops/Op16.png}{\scriptsize \texttt{17}} \includegraphics[width=0.22\textwidth]{Ops/Op17.png}{\scriptsize \texttt{18}} \includegraphics[width=0.22\textwidth]{Ops/Op18.png}{\scriptsize \texttt{19}} \includegraphics[width=0.22\textwidth]{Ops/Op19.png} + +{\scriptsize \texttt{20}} \includegraphics[width=0.22\textwidth]{Ops/Op20.png}{\scriptsize \texttt{21}} \includegraphics[width=0.22\textwidth]{Ops/Op21.png}{\scriptsize \texttt{22}} \includegraphics[width=0.22\textwidth]{Ops/Op22.png}{\scriptsize \texttt{23}} \includegraphics[width=0.22\textwidth]{Ops/Op23.png} + +{\scriptsize \texttt{24}} \includegraphics[width=0.22\textwidth]{Ops/Op24.png}{\scriptsize \texttt{25}} \includegraphics[width=0.22\textwidth]{Ops/Op25.png}{\scriptsize \texttt{26}} \includegraphics[width=0.22\textwidth]{Ops/Op26.png}{\scriptsize \texttt{27}} \includegraphics[width=0.22\textwidth]{Ops/Op27.png} + +{\scriptsize \texttt{28}} \includegraphics[width=0.22\textwidth]{Ops/Op28.png}{\scriptsize \texttt{29}} \includegraphics[width=0.22\textwidth]{Ops/Op29.png}{\scriptsize \texttt{30}} \includegraphics[width=0.22\textwidth]{Ops/Op30.png}{\scriptsize \texttt{31}} \includegraphics[width=0.22\textwidth]{Ops/Op31.png} + +\caption{A 2D projected visualization of the operations our model discovered. Common operations are described in Table \ref{tab:attention}. Short arrows are mostly in 3D, and nearly all operations exhibit different behaviors depending on location in the world.} +\label{fig:operations_grid} +\end{figure*} +\section{Interpretability and Visualizing the Model} +One of the features of our model is its interpretability, which we +ensured by placing information bottlenecks within the architecture. By +designing the language-to-operation encoding process as predicting a +probability distribution over a set of learned basis vectors, we can interpret +each vector as a separate operation and visualize the behaviors of each operation +vector individually. + +\paragraph{Visualizing Operations} +We generated Figure \ref{fig:operations_grid} by placing a single block +in the world and moving it around a 9 by 9 grid and passing +a 1-hot operation choice vector to our model. We then plot a vector from +the block's center to the predicted target location. We see many simple and expected +relationships (left, right, ...), but importantly we see the operations are +location specific functions, not simply offsets. Operations on the edges of +the world are more fine-grained and many move directly to a region +of the world (e.g. 9 = ``center''), not simply an offset. It is also possible that +some of the more dramatic edge vectors may serve as a failsafe mechanism for misinterpreted +instructions. In particular, nearly all of the operations when applied in the bottom right +corner redirect to the center of the board rather than off of it. + +Additionally, while shown here in 2D, all of our predictions are actually in 3D and contain rotation predictions. +In Figure \ref{fig:operations_grid} the operations denoting directly on top are the figures with the shortest arrows (e.g. Operation 14). + +\label{sec:interpretability} +\begin{table} +\centering +\begin{footnotesize} +\begin{tabular}{r|lll@{}} +OP&\multicolumn{3}{l}{Descriptions learned from our data}\\ +\hline +0& directly northwest & left and above & upper left \\ +\rowcolor{lgray}1& directly below & directly under & \multicolumn{1}{l}{south} \\ +\multirow{2}{*}{2} & \multicolumn{3}{l}{bottom left corner should be almost touching upper right}\\ +& northeast & &\\ +\rowcolor{lgray}3& south of & \multicolumn{2}{l}{below}\\ +4& next to\\ +\rowcolor{lgray}& bottom side should touch & directly above & \multicolumn{1}{l}{north of} \\ +\multirow{2}{*}{7}& below and to the right of & top left corner & \\ +& \multicolumn{3}{l}{is almost touching the lower right corner of}\\ +\rowcolor{lgray}8& left of & \multicolumn{2}{l}{directly west of}\\ +\multirow{3}{*}{11}& \multicolumn{3}{l}{shifted between block hp and block nvidia}\\ +& \multicolumn{3}{l}{its center with the line between the nvidia and mercedes }\\ +\rowcolor{lgray}14& goes on top of & \multicolumn{2}{l}{stacked on top} \\ +18& \multicolumn{3}{l}{place it on top of}\\ +\rowcolor{lgray}19& \multicolumn{3}{l}{directly under it}\\ +21& to the right of& \multicolumn{2}{l}{directly on the right of}\\ +\rowcolor{lgray}23& 5 block lengths above & \multicolumn{2}{l}{three rows above} \\ +24& southwest of& \multicolumn{2}{l}{diagonally below}\\ +\rowcolor{lgray}25& east of& \multicolumn{2}{l}{to the right of}\\ +& \multicolumn{3}{l}{on the east side of the nvidia cube}\\ +\multirow{-2}{*}{26}& \multicolumn{3}{l}{so that there is no space in between them}\\ +\rowcolor{lgray}& \multicolumn{3}{l}{three spaces to the left of} \\ +\rowcolor{lgray}\multirow{-2}{*}{28}& \multicolumn{3}{l}{to the left with two intervening empty block spaces}\\ +& \multicolumn{3}{l}{bottom face touches bmw's top face}\\ +\multirow{-2}{*}{29}& cover shell with heineken & \multicolumn{2}{l}{top of it}\\ +\end{tabular} +\end{footnotesize} +\caption{Utterances with low entropy for Op predictions were mapped to their corresponding argmax dimension. We extracted relevant phrase here for common dimensions.} +\label{tab:attention} +\end{table} + + +\paragraph{Interpolating Operations} +The 1-hot operations can be treated like API calls +where several can be called at the same time and interpolated. +Figure~\ref{fig:op_interp} shows the predicted offsets when interpolating +operations 23 (north) and 26 (east). There are two important takeaways +from this. First, we see that when combined, we can sweep out angles in the +first quadrant to reference them all. Second, we see that magnitudes and +angles change as we move closer to the edges of the world. This result +is intuitive and desired. Specifically, a location like ``to the right" has +a variable interpretation depending on how much space exists in the world, +and the model is trying to make sure not to push a block off the table. +In practice, our analysis found very few clear cases of the model using this power. +More commonly, mass would be split between two very similar operations or the +sentence was a compound construction (\textit{left of X and above Y}). We did find +that operation 11 correlated with the description between but it is difficult to +divine why from the grid. An important +extension for future work will be to construct a model which can apply multiple +operations to several distinct arguments. + + + +\paragraph{Linguistic Paraphrase} +Using the validation data, we clustered sentences by their predicted operation +vectors. To pick out phrases we only look at sentences with very low entropy +distributions (highly confident) and we present our findings in Table \ref{tab:attention}. +We see that specifications range from short one word indicators (e.g. \textit{below}) to +nearly complete sentences (\textit{on the east side of the nvidia cube so that there is no space in between them}). This also touches on the fact that several operations have the same direction but different magnitudes. Specifically, operation 23 means far above, not directly, and we see this in the visualized grid as well. + + + +\begin{table} +\centering +\begin{tabular}{ll@{\hspace{6pt}}l@{\hspace{6pt}}ll@{\hspace{6pt}}l} +\toprule + & Source & \multicolumn{4}{c}{Target} \\ + & & \multicolumn{2}{@{}c}{Gold Source} & \multicolumn{2}{c@{}}{End-to-End} \\ + & Acc. & Mean & Med & Mean & Med \\ +\midrule +Bisk 16 & 98 & -- & -- & 0.98 & 0.0 \\ +Pi\v{s}l 17 & 98.5 & -- & -- & 0.72 & -- \\ +Ours & 97.5 & 0.7 & 0.14 & 0.80 & 0.14 \\ +\midrule +v2 & 91.3 & 1.2 & 0.85 & 1.15 & 0.88 \\ +\midrule +v1 + v2 & 95.9 & 1.0 & 0.50 & 1.10 & 0.51 \\ +v1 + v2 $\rightarrow$ v1 & 98.1 & 0.8 & 0.15 & 0.84 & 0.15 \\ +v1 + v2 $\rightarrow$ v2 & 93.1 & 1.2 & 0.88 & 1.35 & 0.91 \\ +\bottomrule +\end{tabular} +\caption{A comparison of our interpretable model with previous results (top) in addition to our performance on our new corpus (v2). Finally, we show how training jointly on both corpora has only a very moderate effect on performance, indicating the complementarity of the data. Target values are error measurements in block-lengths (lower is better).} +\label{tab:results} +\end{table} +\section{Results} +\label{sec:results} +In Table \ref{tab:results}, we compare our model against existing work, and evaluate on both the original Blocks data (v1) and our new corpus (v2). While our primary goal was the creation of an interpretable model and the introduction of new spatial and linguistic phenomena, it is important to see that our model also performs well. We note three important results: + +First, we see that our model outperforms the original model of Bisk 16, and is only slightly weaker than Pi\v{s}l 17. Our technique does outperform theirs when given the correct source block, so it is possible that we can match their performance with tuning. + +Second, our results indicate that the new data (v2) is harder than v1, both in terms of isolating the correct block to move (91 vs 98\% accuracy) and average error (1.15 vs 0.80) on the End-to-End setting. Further, a model trained on the union of our corpora improved in source prediction on both the v1 and v2 test sets, but target location performance was either unaffected or slightly deteriorated. This indicates to us that the new dataset is in fact complementary and adds new constructions. + +Finally, our model has an average error of 0.058 radians (three degrees). In validation, 46\% of predictions require a rotation. 1,374 of 1491 predictions are within 2 degrees of the correct orientation. The remainder have dramatically larger errors (36 at 30$^{\circ}$, 81 at 45$^{\circ}$). This means that the model is learning to interpret the scene and utterance correctly in the vast majority of cases. +\section{Error Analysis} +\label{sec:analysis} +Several of our model's worst performing examples are included in Table \ref{tab:analysis}. The model's error is presented alongside the goal configuration and misunderstood instruction. +\begin{table} +\begin{footnotesize} +\begin{tabular}{@{}m{1cm}@{\hspace{3pt}}lb{5.2cm}@{}} +\toprule +Error & Goal & Instruction \\ +\midrule +4.8 &\includegraphics[width=0.2\linewidth]{images/ZigZag} & use sri as +the base of a fourth tower to the left and equidistant with the other +tower\\ 5.2 +& \includegraphics[width=0.2\linewidth]{images/spaceship_8} & spin sri +slightly to the right and then set it in the middle of the 4 stacks\\ +6.4 & \includegraphics[width=0.2\linewidth]{images/deep} & in the +emerging 3x3 grid place texaco in the middle left\\ +\bottomrule +\end{tabular} +\end{footnotesize} +\caption{Several of our worst performing results. Errors are in block lengths, the images are the goal configuration, and the instructions have been lowercased and tokenized.} +\label{tab:analysis} +\end{table} + +The first example specifies the goal location using an abstract concept (tower) and the offset (equidistant) implies recognition of a larger pattern. The second example specifies the goal location in terms of ``the 4 stacks'', again without naming any of them and in 3D. Finally, the third demonstrates a particularly nice phenomenon in human language where a plan is specified, the speaker provides categorizing information to enable its recognition, and then can use this newly defined concept as a referent. No models to our knowledge have the ability to dynamically form new concepts in this manner. + + +\begin{table} +\centering +\begin{tabular}{@{\hspace{20pt}}cc} +\includegraphics[width=0.35\linewidth]{images/ZigZag4} & \includegraphics[width=0.35\linewidth]{images/ZigZag5}\\ +\multicolumn{2}{@{}p{8.1cm}@{}}{\footnotesize place the block that is to the right of the stella block as the highest block on the board. it should be in line with the bottom block .} +\end{tabular} +\caption{Example utterance which requires both understanding that highest is a 3D concept, and inferring that the 2D concept of a line has been rotated to be in the z-dimension.} +\label{tab:3D} +\end{table} + +\paragraph{Rotations} +Despite a strong performance by the model on rotations, there are a number of cases that were completely overlooked. Upon inspection, these appear to be predominantly cases where the rotation is not explicitly mentioned, but instead assumed or implied: +\begin{itemize} +\item place toyota on top of sri in the \textbf{same direction} . +\item take toyota and place it on top of sri . +\item ... making part of the inside of the \textbf{curve of the circle} . +\end{itemize} +The first two should be the focus of immediate future work as they only require trusting that a new block should trust the orientation of an existing one below it unless there is a compelling reason (e.g. balance) to rotate it. The third case, returns to our larger discussion on understanding geometric shapes and is probably out of scope for most approaches. +\section{Conclusions} +This work presents a new model which moves beyond simple spatial offset predictions (+x, +y, +z) to learn functions which can be applied to the scene. We achieve this without losing interpretability. In addition, we introduce a new corpus of 10,000 actions and 250,000 tokens which contains a plethora of new concepts (subtle movements, balance, rotation) to advance research in action understanding. +\section*{Acknowledgments} +We thank the anonymous reviewers for their many insightful comments. +This work was supported in part by the +NSF grant (IIS-1703166), DARPA CwC program +through ARO (W911NF-15-1-0543), and gifts by +Google and Facebook. + +\bibliographystyle{aaai} +\bibliography{references_acro} diff --git a/1712.03556v2.txt b/1712.03556v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..dd14ecf73444cfaa40598b9d7f59527f37238ddf --- /dev/null +++ b/1712.03556v2.txt @@ -0,0 +1,73 @@ +Machine reading comprehension (MRC) is a challenging task: the goal is to have machines read a text passage and then answer any question about the passage.This task is an useful benchmark to demonstrate natural language understanding, and also has important applications in e.g. conversational agents and customer service support.It has been hypothesized that difficult MRC problems require some form of multi-step synthesis and reasoning.For instance, the following example from the MRC dataset SQuAD Rajpurkar et al. (2016) illustrates the need for synthesis of information across sentences and multiple steps of reasoning:Q𝑄Q: What collection does the V&A Theator & Performance galleries hold?P𝑃P: The V&A Theator & Performance galleries opened in March 2009. … They hold the UK’s biggest national collection of material about live performance.To infer the answer (the underlined portion of the passage P𝑃P), the model needs to first perform coreference resolution so that it knows “They” refers “V&A Theator”, then extract the subspan in the direct object corresponding to the answer. + +This kind of iterative process can be viewed as a form of multi-step reasoning.Several recent MRC models have embraced this kind of multi-step strategy, wherepredictions are generated after making multiple passes through the same text and integrating intermediate information in the process.The first models employed a predetermined fixed number of steps Hill et al. (2016); Dhingra et al. (2016); Sordoni et al. (2016); Kumar et al. (2015).Later, Shen et al. (2016) proposed using reinforcement learning to dynamically determine the number of steps based on the complexity of the question.Further, Shen et al. (2017) empirically showed that dynamic multi-step reasoning outperforms fixed multi-step reasoning,which in turn outperforms single-step reasoning on two distinct MRC datasets (SQuAD and MS MARCO). + +In this work, we derive an alternative multi-step reasoning neural network for MRC.During training, we fix the number of reasoning steps, but perform stochastic dropout on the answer module (final layer predictions).During decoding, we generate answers based on the average of predictions in all steps, rather than the final step.We call this a stochastic answer network (SAN) because the stochastic dropout is applied to the answer module;albeit simple, this technique significantly improves the robustness and overall accuracy of the model.Intuitively this works because while the model successively refines its prediction over multiple steps, each step is still trained to generate the same answer;we are performing a kind of stochastic ensemble over the model’s successive prediction refinements.Stochastic prediction dropout is illustrated in Figure 1. + +The machine reading comprehension (MRC) task as defined here involves a question Q={q0,q1,…,qm−1}𝑄subscript𝑞0subscript𝑞1…subscript𝑞𝑚1Q=\{q_{0},q_{1},...,q_{m-1}\} and a passage P={p0,p1,…,pn−1}𝑃subscript𝑝0subscript𝑝1…subscript𝑝𝑛1P=\{p_{0},p_{1},...,p_{n-1}\}and aims to find an answer span A={as​t​a​r​t,ae​n​d}𝐴subscript𝑎𝑠𝑡𝑎𝑟𝑡subscript𝑎𝑒𝑛𝑑A=\{a_{start},a_{end}\} in P𝑃P.We assume that the answer exists in the passage P𝑃P as a contiguous text string.Here, m𝑚m and n𝑛n denote the number of tokens in Q𝑄Q and P𝑃P, respectively.The learning algorithm for reading comprehension is to learn a function f​(Q,P)→A→𝑓𝑄𝑃𝐴f(Q,P)\rightarrow A.The training data is a set of the query, passage and answer tuples . + +We now describe our model from the ground up. The main contribution of this work is the answer module, but in order to understand what goes into this module, we will start by describing how Q𝑄Q and P𝑃P are processed by the lower layers. Note the lower layers also have some novel variations that are not used in previous work.As shown in Figure 2, our model contains four different layers to capture different concept of representations.The detailed description of our model is provided as follows. + +Lexicon Encoding Layer.The purpose of the first layer is to extract information from Q𝑄Q and P𝑃P at the word level and normalize for lexical variants.A typical technique to obtain lexicon embedding is concatenation of its word embedding with other linguistic embedding such as those derived from Part-Of-Speech (POS) tags.For word embeddings, we use the pre-trained 300-dimensional GloVe vectors Pennington et al. (2014) for the both Q𝑄Q and P𝑃P.Following Chen et al. (2017), we use three additional types of linguistic features for each token pisubscript𝑝𝑖p_{i} in the passage P𝑃P:•999-dimensional POS tagging embedding for total 56 different types of the POS tags.•888-dimensional named-entity recognizer (NER) embedding for total 18 different types of the NER tags. We utilized small embedding sizes for POS and NER to reduce model size. They mainly serve the role of coarse-grained word clusters.•A 333-dimensional binary exact match feature defined as fe​x​a​c​t​_​m​a​t​c​h​(pi)=𝕀​(pi∈Q)subscript𝑓𝑒𝑥𝑎𝑐𝑡_𝑚𝑎𝑡𝑐ℎsubscript𝑝𝑖𝕀subscript𝑝𝑖𝑄f_{exact\_match}(p_{i})=\mathbb{I}(p_{i}\in Q). This checks whether a passage token pisubscript𝑝𝑖p_{i} matches the original, lowercase or lemma form of any question token.•Question enhanced passages word embeddings: fa​l​i​g​n​(pi)=∑jγi,j​g​(G​l​o​V​e​(qj))subscript𝑓𝑎𝑙𝑖𝑔𝑛subscript𝑝𝑖subscript𝑗subscript𝛾𝑖𝑗𝑔𝐺𝑙𝑜𝑉𝑒subscript𝑞𝑗f_{align}(p_{i})=\sum_{j}\gamma_{i,j}g(GloVe(q_{j})), where g​(⋅)𝑔⋅g(\cdot) is a 280-dimensional single layer neural network R​e​L​U​(W0​x)𝑅𝑒𝐿𝑈subscript𝑊0𝑥ReLU(W_{0}x) and γi,j=e​x​p​(g​(G​l​o​V​e​(pj))⋅g​(G​l​o​V​e​(qi)))∑j′e​x​p​(g​(G​l​o​V​e​(pi))⋅g​(G​l​o​V​e​(qj′)))subscript𝛾𝑖𝑗𝑒𝑥𝑝⋅𝑔𝐺𝑙𝑜𝑉𝑒subscript𝑝𝑗𝑔𝐺𝑙𝑜𝑉𝑒subscript𝑞𝑖subscriptsuperscript𝑗′𝑒𝑥𝑝⋅𝑔𝐺𝑙𝑜𝑉𝑒subscript𝑝𝑖𝑔𝐺𝑙𝑜𝑉𝑒subscript𝑞superscript𝑗′\gamma_{i,j}=\frac{exp(g(GloVe(p_{j}))\cdot g(GloVe(q_{i})))}{\sum_{j^{\prime}}exp(g(GloVe(p_{i}))\cdot g(GloVe(q_{j^{\prime}})))} measures the similarity in word embedding space between a token pisubscript𝑝𝑖p_{i} in the passage and a token qjsubscript𝑞𝑗q_{j} in the question. Compared to the exact matching features, these embeddings encode soft alignments between similar but not-identical words.In summary, each token pisubscript𝑝𝑖p_{i} in the passage is represented as a 600-dimensional vector and each token qjsubscript𝑞𝑗q_{j} is represented as a 300-dimensional vector. + +Due to different dimensions for the passages and questions, in the next layer two different bidirectional LSTM (BiLSTM) Hochreiter and Schmidhuber (1997) may be required to encode the contextual information.This, however, introduces a large number of parameters.To prevent this, we employ an idea inspired by Vaswani et al. (2017): use two separate two-layer position-wise Feed-Forward Networks (FFN), F​F​N​(x)=W2​R​e​L​U​(W1​x+b1)+b2𝐹𝐹𝑁𝑥subscript𝑊2𝑅𝑒𝐿𝑈subscript𝑊1𝑥subscript𝑏1subscript𝑏2FFN(x)=W_{2}ReLU(W_{1}x+b_{1})+b_{2}, to map both the passage and question lexical encodings into the same number of dimensions. Note that this FFN has fewer parameters compared to a BiLSTM.Thus, we obtain the final lexicon embeddings for the tokens in Q𝑄Q as a matrix Eq∈ℝd×msuperscript𝐸𝑞superscriptℝ𝑑𝑚E^{q}\in\mathbb{R}^{d\times m} and tokens in P𝑃P as Ep∈ℝd×nsuperscript𝐸𝑝superscriptℝ𝑑𝑛E^{p}\in\mathbb{R}^{d\times n}. + +Contextual Encoding Layer. Both passage and question use a shared two-layers BiLSTM as the contextual encoding layer, which projects the lexicon embeddings to contextual embeddings. We concatenate a pre-trained 600-dimensional CoVe vectors111https://github.com/salesforce/cove McCann et al. (2017) trained on German-English machine translation dataset, with the aforementioned lexicon embeddings as the final input of the contextual encoding layer, and also with the output of the first contextual encoding layer as the input of its second encoding layer. To reduce the parameter size, we use a maxout layer Goodfellow et al. (2013) at each BiLSTM layer to shrink its dimension. By a concatenation of the outputs of two BiLSTM layers, we obtain Hq∈ℝ2​d×msuperscript𝐻𝑞superscriptℝ2𝑑𝑚H^{q}\in\mathbb{R}^{2d\times m} as representation of Q𝑄Q and Hp∈ℝ2​d×nsuperscript𝐻𝑝superscriptℝ2𝑑𝑛H^{p}\in\mathbb{R}^{2d\times n} as representation of P𝑃P, where d𝑑d is the hidden size of the BiLSTM. + +Memory Generation Layer. In the memory generation layer, We construct the working memory, a summary of information from both Q𝑄Q and P𝑃P.First, a dot-product attention is adopted like in Vaswani et al. (2017) to measure the similarity between the tokens in Q𝑄Q and P𝑃P.Instead of using a scalar to normalize the scores as in Vaswani et al. (2017), we use one layer network to transform the contextual information of both Q𝑄Q and P𝑃P:C=d​r​o​p​o​u​t​(fa​t​t​e​n​t​i​o​n​(H^q,H^p))∈ℝm×n𝐶𝑑𝑟𝑜𝑝𝑜𝑢𝑡subscript𝑓𝑎𝑡𝑡𝑒𝑛𝑡𝑖𝑜𝑛superscript^𝐻𝑞superscript^𝐻𝑝superscriptℝ𝑚𝑛C=dropout(f_{attention}(\hat{H}^{q},\hat{H}^{p}))\in\mathbb{R}^{m\times n}\\(1)C𝐶C is an attention matrix.Note that Hq^^superscript𝐻𝑞\hat{H^{q}} and Hp^^superscript𝐻𝑝\hat{H^{p}} is transformed from Hqsuperscript𝐻𝑞H^{q} and Hpsuperscript𝐻𝑝H^{p} by one layer neural network R​e​L​U​(W3​x)𝑅𝑒𝐿𝑈subscript𝑊3𝑥ReLU(W_{3}x), respectively.Next, we gather all the information on passages by a simple concatenation of its contextual information Hpsuperscript𝐻𝑝H^{p} and its question-aware representation Hq⋅C⋅superscript𝐻𝑞𝐶H^{q}\cdot C:Up=c​o​n​c​a​t​(Hp,Hq​C)∈ℝ4​d×nsuperscript𝑈𝑝𝑐𝑜𝑛𝑐𝑎𝑡superscript𝐻𝑝superscript𝐻𝑞𝐶superscriptℝ4𝑑𝑛U^{p}=concat(H^{p},H^{q}C)\in\mathbb{R}^{4d\times n}(2) + +Typically, a passage may contain hundred of tokens, making it hard to learn the long dependencies within it. Inspired by Lin et al. (2017), we apply a self-attended layer to rearrange the information Upsuperscript𝑈𝑝U^{p} as:U^p=Up​d​r​o​pd​i​a​g​(fa​t​t​e​n​t​i​o​n​(Up,Up)).superscript^𝑈𝑝superscript𝑈𝑝𝑑𝑟𝑜subscript𝑝𝑑𝑖𝑎𝑔subscript𝑓𝑎𝑡𝑡𝑒𝑛𝑡𝑖𝑜𝑛superscript𝑈𝑝superscript𝑈𝑝\hat{U}^{p}=U^{p}drop_{diag}(f_{attention}(U^{p},U^{p})).(3)In other words, we first obtain an n×n𝑛𝑛n\times n attention matrix with Upsuperscript𝑈𝑝U^{p} onto itself, apply dropout, then multiply this matrix with Upsuperscript𝑈𝑝U^{p} to obtain an updated U^psuperscript^𝑈𝑝\hat{U}^{p}.Instead of using a penalization term as in Lin et al. (2017), we dropout the diagonal of the similarity matrix forcing each token in the passage to align to other tokens rather than itself. + +At last, the working memory is generated by using another BiLSTM based on all the information gathered:M=B​i​L​S​T​M​([Up;U^p])𝑀𝐵𝑖𝐿𝑆𝑇𝑀superscript𝑈𝑝superscript^𝑈𝑝M=BiLSTM([U^{p};\hat{U}^{p}])(4)where the semicolon mark ; indicates the vector/matrix concatenation operator. + +Answer module.There is a Chinese proverb that says: “wisdom of masses exceeds that of any individual.”Unlike other multi-step reasoning models, which only uses a single output either at the last step or some dynamically determined final step, our answer module employs all the outputs of multiple step reasoning. Intuitively, by applying dropout, it avoids a “step bias problem” (where models places too much emphasis one particular step’s predictions) and forces the model to produce good predictions at every individual step. Further, during decoding, we reuse wisdom of masses instead of individual to achieve a better result.We call this method “stochastic prediction dropout” because dropout is being applied to the final predictive distributions. + +Formally, our answer module will compute over T𝑇T memory steps and output the answer span.This module is a memory network and has some similarities to other multi-step reasoning networks: namely, it maintains a state vector, one state per step.At the beginning, the initial state s0subscript𝑠0s_{0} is the summary of the Q𝑄Q: s0=∑jαj​Hjqsubscript𝑠0subscript𝑗subscript𝛼𝑗subscriptsuperscript𝐻𝑞𝑗s_{0}=\sum_{j}\alpha_{j}H^{q}_{j}, where αj=e​x​p​(w4⋅Hjq)∑j′e​x​p​(w4⋅Hj′q)subscript𝛼𝑗𝑒𝑥𝑝⋅subscript𝑤4subscriptsuperscript𝐻𝑞𝑗subscriptsuperscript𝑗′𝑒𝑥𝑝⋅subscript𝑤4subscriptsuperscript𝐻𝑞superscript𝑗′\alpha_{j}=\frac{exp(w_{4}\cdot H^{q}_{j})}{\sum_{j^{\prime}}exp(w_{4}\cdot H^{q}_{j^{\prime}})}. At time step t𝑡t in the range of {1,2,…,T−1}12…𝑇1\{1,2,...,T-1\}, the state is defined by st=G​R​U​(st−1,xt)subscript𝑠𝑡𝐺𝑅𝑈subscript𝑠𝑡1subscript𝑥𝑡s_{t}=GRU(s_{t-1},x_{t}).Here, xtsubscript𝑥𝑡x_{t} is computed from the previous state st−1subscript𝑠𝑡1s_{t-1} and memory M𝑀M: xt=∑jβj​Mjsubscript𝑥𝑡subscript𝑗subscript𝛽𝑗subscript𝑀𝑗x_{t}=\sum_{j}\beta_{j}M_{j} and βj=s​o​f​t​m​a​x​(st−1​W5​M)subscript𝛽𝑗𝑠𝑜𝑓𝑡𝑚𝑎𝑥subscript𝑠𝑡1subscript𝑊5𝑀\beta_{j}=softmax(s_{t-1}W_{5}M).Finally, a bilinear function is used to find the begin and end point of answer spans at each reasoning step t∈{0,1,…,T−1}𝑡01…𝑇1t\in\{0,1,\ldots,T-1\}.Ptb​e​g​i​n=s​o​f​t​m​a​x​(st​W6​M)superscriptsubscript𝑃𝑡𝑏𝑒𝑔𝑖𝑛𝑠𝑜𝑓𝑡𝑚𝑎𝑥subscript𝑠𝑡subscript𝑊6𝑀P_{t}^{begin}=softmax(s_{t}W_{6}M)(5)Pte​n​d=s​o​f​t​m​a​x​([st;∑jPt,jb​e​g​i​n​Mj]​W7​M).superscriptsubscript𝑃𝑡𝑒𝑛𝑑𝑠𝑜𝑓𝑡𝑚𝑎𝑥subscript𝑠𝑡subscript𝑗superscriptsubscript𝑃𝑡𝑗𝑏𝑒𝑔𝑖𝑛subscript𝑀𝑗subscript𝑊7𝑀P_{t}^{end}=softmax([s_{t};\sum_{j}P_{t,j}^{begin}M_{j}]W_{7}M).(6) + +From a pair of begin and end points, the answer string can be extracted from the passage.However, rather than output the results (start/end points) from the final step (which is fixed at T−1𝑇1T-1 as in Memory Networks or dynamically determined as in ReasoNet),we utilize all of the T𝑇T outputs by averaging the scores:Pb​e​g​i​n=a​v​g​([P0b​e​g​i​n,P1b​e​g​i​n,…,PT−1b​e​g​i​n])superscript𝑃𝑏𝑒𝑔𝑖𝑛𝑎𝑣𝑔superscriptsubscript𝑃0𝑏𝑒𝑔𝑖𝑛superscriptsubscript𝑃1𝑏𝑒𝑔𝑖𝑛…superscriptsubscript𝑃𝑇1𝑏𝑒𝑔𝑖𝑛P^{begin}=avg([P_{0}^{begin},P_{1}^{begin},...,P_{T-1}^{begin}])(7)Pe​n​d=a​v​g​([P0e​n​d,P1e​n​d,…,PT−1e​n​d])superscript𝑃𝑒𝑛𝑑𝑎𝑣𝑔superscriptsubscript𝑃0𝑒𝑛𝑑superscriptsubscript𝑃1𝑒𝑛𝑑…superscriptsubscript𝑃𝑇1𝑒𝑛𝑑P^{end}=avg([P_{0}^{end},P_{1}^{end},...,P_{T-1}^{end}])(8)Each Ptb​e​g​i​nsuperscriptsubscript𝑃𝑡𝑏𝑒𝑔𝑖𝑛P_{t}^{begin} or Pte​n​dsuperscriptsubscript𝑃𝑡𝑒𝑛𝑑P_{t}^{end} is a multinomial distribution over {1,…,n}1…𝑛\{1,\ldots,n\}, so the average distribution is straightforward to compute. + +During training, we apply stochastic dropout to before the above averaging operation. For example, as illustrated in Figure 1, we randomly delete several steps’ predictions in Equations 7 and 8 so that Pb​e​g​i​nsuperscript𝑃𝑏𝑒𝑔𝑖𝑛P^{begin} might be a​v​g​([P1b​e​g​i​n,P3b​e​g​i​n])𝑎𝑣𝑔superscriptsubscript𝑃1𝑏𝑒𝑔𝑖𝑛superscriptsubscript𝑃3𝑏𝑒𝑔𝑖𝑛avg([P_{1}^{begin},P_{3}^{begin}]) and Pe​n​dsuperscript𝑃𝑒𝑛𝑑P^{end} might be a​v​g​([P0e​n​d,P3e​n​d,P4e​n​d])𝑎𝑣𝑔superscriptsubscript𝑃0𝑒𝑛𝑑superscriptsubscript𝑃3𝑒𝑛𝑑superscriptsubscript𝑃4𝑒𝑛𝑑avg([P_{0}^{end},P_{3}^{end},P_{4}^{end}]). The use of averaged predictions and dropout during training improves robustness. + +Our stochastic prediction dropout is similar in motivation to the dropout introduced by Srivastava et al. (2014). The difference is that theirs is dropout at the intermediate node-level, whereas ours is dropout at the final layer-level.Dropout at the node-level prevents correlation between features.Dropout at the final layer level, where randomness is introduced to the averaging of predictions, prevents our model from relying exclusively on a particular step to generate correct output.We used a dropout rate of 0.4 in experiments. + +Dataset: We evaluate on the Stanford Question Answering Dataset (SQuAD) Rajpurkar et al. (2016). This contains about 23K passages and 100K questions. The passages come from approximately 500 Wikipedia articles and the questions and answers are obtained by crowdsourcing. The crowdsourced workers are asked to read a passage (a paragraph), come up with questions, then mark the answer span. All results are on the official development set, unless otherwise noted. + +Two evaluation metrics are used: Exact Match (EM), which measures the percentage of span predictions that matched any one of the ground truth answer exactly, and Macro-averaged F1 score, which measures the average overlap between the prediction and the ground truth answer. + +Implementation details: The spaCy tool222https://spacy.io is used to tokenize the both passages and questions, and generate lemma, part-of-speech and named entity tags. We use 2-layer BiLSTM with d=128𝑑128d=128 hidden units for both passage and question encoding. The mini-batch size is set to 32 and Adamax Kingma and Ba (2014) is used as our optimizer. The learning rate is set to 0.002 at first and decreased by half after every 10 epochs. We set the dropout rate for all the hidden units of LSTM, and the answer module output layer to 0.4. To prevent degenerate output, we ensure that at least one step in the answer module is active during training. + +The main experimental question we would like to answer is whether the stochastic dropout and averaging in the answer module is an effective technique for multi-step reasoning.To do so, we fixed all lower layers and compared different architectures for the answer module:1.Standard 1-step: generate prediction from s0subscript𝑠0s_{0}, the first initial state.2.5-step memory network: this is a memory network fixed at 5 steps. We try two variants: the standard variant outputs result from the final step sT−1subscript𝑠𝑇1s_{T-1}. The averaged variant outputs results by averaging across all 5 steps, and is like SAN without the stochastic dropout.3.ReasoNet333The ReasoNet here is not an exact re-implementation of Shen et al. (2017). The answer module is the same as Shen et al. (2017) but the lower layers are set to be the same as SAN, 5-step memory network, and standard 1-step as described in Figure 2. We only vary the answer module in our experiments for a fair comparison.: this answer module dynamically decides the number of steps and outputs results conditioned on the final step.4.SAN: proposed answer module that uses stochastic dropout and prediction averaging. + +The main results in terms of EM and F1 are shown in Table 1.We observe that SAN achieves 76.235 EM and 84.056 F1, outperforming all other models.Standard 1-step model only achieves 75.139 EM and dynamic steps (via ReasoNet) achieves only 75.355 EM. SAN also outperforms a 5-step memory net with averaging, which implies averaging predictions is not the only thing that led to SAN’s superior results;indeed, stochastic prediction dropout is an effective technique. + +The K-best oracle results is shown in Figure 3.The K-best spans are computed by ordering the spans according the their probabilities Pb​e​g​i​n×Pe​n​dsuperscript𝑃𝑏𝑒𝑔𝑖𝑛superscript𝑃𝑒𝑛𝑑P^{begin}\times P^{end}.We limit K in the range 1 to 4 and then pick the span with the best EM or F1 as oracle.SAN also outperforms the other models in terms of K-best oracle scores. Impressively, these models achieve human performance at K=2𝐾2K=2 for EM and K=3𝐾3K=3 for F1. + +Finally, we compare our results with other top models in Table 2. Note that all the results in Table 2 are taken from the published papers.We see that SAN is very competitive in both single and ensemble settings (ranked in second) despite its simplicity. Note that the best-performing model Peters et al. (2018) used a large-scale language model as an extra contextual embedding, which gave a significant improvement (+4.3% dev F1). We expect significant improvements if we add this to SAN in future work. + +We are interested in whether the proposed model is sensitive to different random initial conditions.Table 3 shows the development set scores of SAN trained from initialization with different random seeds.We observe that the SAN results are consistently strong regardless of the 10 different initializations.For example, the mean EM score is 76.131 and the lowest EM score is 75.922, both of which still outperform the 75.355 EM of the Dynamic step ReasoNet in Table 1.444Note the Dev EM/F1 scores of ReasoNet in Table 1 do not match those of ReasoNet++ in Table 2. While the answer module is the same architecture, the lower encoding layers are different. + +We are also interested in how sensitive are the results to the number of reasoning steps, which is a fixed hyper-parameter.Since we are using dropout, a natural question is whether we can extend the number of steps to an extremely large number.Table 4 shows the development set scores for T=1𝑇1T=1 to T=10𝑇10T=10.We observe that there is a gradual improvement as we increase T=1𝑇1T=1 to T=5𝑇5T=5, but after 5 steps the improvements have saturated.In fact, the EM/F1 scores drop slightly, but considering that the random initialization results in Table 3 show a standard deviation of 0.142 and a spread of 0.426 (for EM), we believe that the T=10𝑇10T=10 result does not statistically differ from the T=5𝑇5T=5 result.In summary, we think it is useful to perform some approximate hyper-parameter tuning for the number of steps, but it is not necessary to find the exact optimal value. + +Finally, we test SAN on two Adversarial SQuAD datasets, AddSent and AddOneSent Jia and Liang (2017), where the passages contain auto-generated adversarial distracting sentences to fool computer systems that are developed to answer questions about the passages.For example, AddSent is constructed by adding sentences that look similar to the question, but do not actually contradict the correct answer. AddOneSent is constructed by appending a random human-approved sentence to the passage. + +We evaluate the single SAN model (i.e., the one presented in Table 2) on both AddSent and AddOneSent. The results in Table 5 show that SAN achieves the new state-of-the-art performance and SAN’s superior result is mainly attributed to the multi-step answer module, which leads to significant improvement in F1 score over the Standard 1-step answer module, i.e., +1.2 on AddSent and +0.7 on AddOneSent. + +For practical deployment scenarios, prediction speed at test time is an important criterion.Therefore, one question is whether SAN can train with, e.g. T=5𝑇5T=5 steps but test with T=1𝑇1T=1 steps.Table 6 shows the results of a SAN trained on T=5𝑇5T=5 steps, but tested with different number of steps.As expected, the results are best when T𝑇T matches during training and test; however, it is important to note that small numbers of steps T=1𝑇1T=1 and T=2𝑇2T=2 nevertheless achieve strong results.For example, prediction at T=1𝑇1T=1 achieves 75.58, which outperforms a standard 1-step model (75.14 EM) as in Table 1 that has approximate equivalent prediction time. + +The average training time per epoch is comparable: our implementation running on a GTX Titan Xis 22 minutes for 5-step memory net, 30 minutes for ReasoNet, and 24 minutes for SAN.The learning curve is shown in Figure 4.We observe that all systems improve at approximately the same rate up to 10 or 15 epochs.However, SAN continues to improve afterwards as other models start to saturate.This observation is consistent with previous works using dropout Srivastava et al. (2014).We believe that while training time per epoch is similar between SAN and other models, it is recommended to train SAN for more epochs in order to achieve gains in EM/F1. + +To see whether SAN performs well on a particular type of question, we divided the development set by questions type based on their respective Wh-word, such as “who” and “where”.The score breakdown by F1 is shown in Figure 5.We observe that SAN seems to outperform other models uniformly across all types.The only exception is the Why questions, but there is too little data to derive strong conclusions. + +MS MARCO Nguyen et al. (2016) is a large scale real-word RC dataset which contains 100,100 (100K) queries collected from anonymized user logs from the Bing search engine. The characteristic of MS MARCO is that all the questions are real user queries and passages are extracted from real web documents. For each query, approximate 10 passages are extracted from public web documents. The answers are generated by humans. The data is partitioned into a 82,430 training, a 10,047 development and 9,650 test tuples. The evaluation metrics are BLEUPapineni et al. (2002) and ROUGE-L Lin (2004) due to its free-form text answer style. To apply the same RC model, we search for a span in MS MARCO’s passages that maximizes the ROUGE-L score with the raw free-form answer. It has an upper bound of 93.45 BLEU and 93.82 ROUGE-L on the development set. + +The MS MARCO dataset contains multiple passages per query. Our model as shown in Figure 2 is developed to generate answer from a single passage. Thus, we need to extend it to handle multiple passages. Following Shen et al. (2017), we take two steps to generate an answer to a query Q𝑄Q from J𝐽J passages, P1,…,PJsuperscript𝑃1…superscript𝑃𝐽P^{1},...,P^{J}. First, we run SAN on every (Pj,Qsuperscript𝑃𝑗𝑄P^{j},Q) pair, generating J𝐽J candidate answer spans, one from each passage. Then, we multiply the SAN score of each candidate answer span with its relevance score r​(Pj,Q)𝑟superscript𝑃𝑗𝑄r(P^{j},Q) assigned by a passage ranker, and output the span with the maximum score as the answer. In our experiments, we use the passage ranker described in Liu et al. (2018)555It is the same model structure as Liu et al. (2018) by using softmax over all candidate passages. A simple baseline, TF-IDF, obtains 20.1 p@1 on MS MARCO development.. The ranker is trained on the same MS MARCO training data, and achieves 37.1 p@1 on the development set. + +The results in Table 7 show that SAN outperforms V-Net Wang et al. (2018) and becomes the new state of the art666The official evaluation on MS MARCO on test is closed, thus here we only report the results on the development set.. + +The recent big progress on MRC is largely due to the availability of the large-scale datasets Rajpurkar et al. (2016); Nguyen et al. (2016); Richardson et al. (2013); Hill et al. (2016), since it is possible to train large end-to-end neural network models.In spite of the variety of model structures and attenion types Bahdanau et al. (2015); Chen et al. (2016); Xiong et al. (2016); Seo et al. (2016); Shen et al. (2017); Wang et al. (2017), a typical neural network MRC model first maps the symbolic representation of the documents and questions into a neural space, then search answers on top of it. We categorize these models into two groups based on the difference of the answer module: single-step and multi-step reasoning.The key difference between the two is what strategies are applied to search the final answers in the neural space. + +A single-step model matches the question and document only once and produce the final answers. It is simple yet efficient and can be trained using the classical back-propagation algorithm, thus it is adopted by most systems Chen et al. (2016); Seo et al. (2016); Wang et al. (2017); Liu et al. (2017b); Chen et al. (2017); Weissenborn et al. (2017); Hu et al. (2017). However, since humans often solve question answering tasks by re-reading and re-digesting the document multiple times before reaching the final answers (this may be based on the complexity of the questions/documents), it is natural to devise an iterative way to find answers as multi-step reasoning. + +Pioneered by Hill et al. (2016); Dhingra et al. (2016); Sordoni et al. (2016); Kumar et al. (2015), who used a predetermined fixed number of reasoning steps, Shen et al Shen et al. (2016, 2017) showed that multi-step reasoning outperforms single-step ones and dynamic multi-step reasoning further outperforms the fixed multi-step ones on two distinct MRC datasets (SQuAD and MS MARCO). But these models have to be trained using reinforcement learning methods, e.g., policy gradient, which are tricky to implement due to the instability issue.Our model is different in that we fix the number of reasoning steps, but perform stochastic dropout to prevent step bias. Further, our model can also be trained by using the back-propagation algorithm, which is simple and yet efficient. + +We introduce Stochastic Answer Networks (SAN), a simple yet robust model for machine reading comprehension. The use of stochastic dropout in training and averaging in test at the answer module leads to robust improvements on SQuAD, outperforming both fixed step memory networks and dynamic step ReasoNet. We further empirically analyze the properties of SAN in detail.The model achieves results competitive with the state-of-the-art on the SQuAD leaderboard, as well as on the Adversarial SQuAD and MS MARCO datasets.Due to the strong connection between the proposed model with memory networks and ReasoNet, we would like to delve into the theoretical link between these models and its training algorithms. Further, we also would like to explore SAN on other tasks, such as text classification and natural language inference for its generalization in the future. \ No newline at end of file diff --git a/1712.03609v4.txt b/1712.03609v4.txt new file mode 100644 index 0000000000000000000000000000000000000000..05d05658142357c26bf346d3200774a74e9bb90c --- /dev/null +++ b/1712.03609v4.txt @@ -0,0 +1,59 @@ +Reading comprehension (RC) is a high-level task in natural language understanding that requires reading a document and answering questions about its content. RC has attracted substantial attention over the last few years with the advent of large annotated datasets Hermann et al. (2015); Rajpurkar et al. (2016); Trischler et al. (2016); Nguyen et al. (2016); Joshi et al. (2017), computing resources, and neural network models and optimization procedures (Weston et al., 2015; Sukhbaatar et al., 2015; Kumar et al., 2015). + +Reading comprehension models must invariably represent word tokens contextually, as a function of their encompassing sequence (document or question).The vast majority of RC systems encode contextualized representations of words in both the document and question as hidden states of bidirectional RNNs Hochreiter and Schmidhuber (1997); Schuster and Paliwal (1997); Cho et al. (2014), and focus model design and capacity around question-document interaction,carrying out calculations where information from both is available (Seo et al., 2016; Xiong et al., 2017b; Huang et al., 2017; Wang et al., 2017). + +Analysis of current RC models has shown that models tend to react to simple word-matching between the question and document (Jia and Liang, 2017), as well as benefit from explicitly providing matching information in model inputs (Hu et al., 2017; Chen et al., 2017; Weissenborn et al., 2017). In this work, we hypothesize that the still-relatively-small size of RC datasets drives this behavior, which leads to models that make limited use of context when representing word tokens. + +To illustrate this idea, we take a model that carries out only basic question-document interaction and prepend to it a module that produces token embeddings by explicitly gating between contextual and non-contextual representations (for both the document and question). This simple addition already places the model’s performance on par with recent work, and allows us to demonstrate the importance of context. + +Motivated by these findings, we turn to a semi-supervised setting in which we leverage a language model, pre-trained on large amounts of data, as a sequence encoder which forcibly facilitates context utilization. We find that model performance substantially improves, reaching accuracy comparable to state-of-the-art on the competitive SQuAD dataset, showing that contextual word representations captured by the language model are beneficial for reading comprehension.111Our complete code base is available at http://github.com/shimisalant/CWR. + +We consider the task of extractive reading comprehension: given a paragraph of text𝐩=(p1,…,pn)𝐩subscript𝑝1…subscript𝑝𝑛\mathbf{p}=(p_{1},\dots,p_{n})and a question𝐪=(q1,…,qm)𝐪subscript𝑞1…subscript𝑞𝑚\mathbf{q}=(q_{1},\dots,q_{m}), an answer span (pl,…,pr)subscript𝑝𝑙…subscript𝑝𝑟(p_{l},\dots,p_{r}) is to be extracted, i.e., a pair of indices 1≤l≤r≤n1𝑙𝑟𝑛1\leq l\leq r\leq n into 𝐩𝐩\mathbf{p} are to be predicted. + +When encoding a word token in its encompassing sequence (question or passage), we are interested in allowing extra computation over the sequence and evaluating the extent to which context is utilized in the resultant representation.To that end, we employ a re-embedding component in which a contextual and a non-contextual representation are explicitly combined per token. Specifically, for a sequence of word-embeddings w1,…,wksubscript𝑤1…subscript𝑤𝑘w_{1},\dots,w_{k} with wt∈ℝdwsubscript𝑤𝑡superscriptℝsubscript𝑑𝑤w_{t}\in\mathbb{R}^{d_{w}}, the re-embedding of the t𝑡t-th token wt′superscriptsubscript𝑤𝑡′w_{t}^{\prime} is the result of a Highway layer Srivastava et al. (2015) and is defined as:wt′superscriptsubscript𝑤𝑡′\displaystyle w_{t}^{\prime}=gt⊙wt+(1−gt)⊙ztabsentdirect-productsubscript𝑔𝑡subscript𝑤𝑡direct-product1subscript𝑔𝑡subscript𝑧𝑡\displaystyle=g_{t}\odot w_{t}+(1-g_{t})\odot z_{t}gtsubscript𝑔𝑡\displaystyle g_{t}=σ​(Wg​xt+Ug​ut)absent𝜎subscript𝑊𝑔subscript𝑥𝑡subscript𝑈𝑔subscript𝑢𝑡\displaystyle=\sigma(W_{g}x_{t}+U_{g}u_{t})ztsubscript𝑧𝑡\displaystyle z_{t}=t​a​n​h​(Wz​xt+Uz​ut)absent𝑡𝑎𝑛ℎsubscript𝑊𝑧subscript𝑥𝑡subscript𝑈𝑧subscript𝑢𝑡\displaystyle=tanh(W_{z}x_{t}+U_{z}u_{t})where xtsubscript𝑥𝑡x_{t} is a function strictly of the word-type of the t𝑡t-th token, utsubscript𝑢𝑡u_{t} is a function of the enclosing sequence, Wg,Wz,Ug,U​zsubscript𝑊𝑔subscript𝑊𝑧subscript𝑈𝑔𝑈𝑧W_{g},W_{z},U_{g},Uz are parameter matrices, and ⊙direct-product\odot the element-wise product operator. We set xt=[wt;ct]subscript𝑥𝑡subscript𝑤𝑡subscript𝑐𝑡x_{t}=[w_{t};c_{t}], a concatenation of wtsubscript𝑤𝑡w_{t} with ct∈ℝdcsubscript𝑐𝑡superscriptℝsubscript𝑑𝑐c_{t}\in\mathbb{R}^{d_{c}} where the latter is a character-based representation of the token’s word-type produced via a CNN over character embeddings Kim (2014). We note that word-embeddings wtsubscript𝑤𝑡w_{t} are pre-trained (Pennington et al., 2014) and are kept fixed during training, as is commonly done in order to reduce model capacity and mitigate overfitting. We next describe different formulations for the contextual term utsubscript𝑢𝑡u_{t}. + +Here we set {u1,…,uk}=BiLSTM​(x1,…,xk)subscript𝑢1…subscript𝑢𝑘BiLSTMsubscript𝑥1…subscript𝑥𝑘\{u_{1},\dots,u_{k}\}=\textsc{B{i}LSTM}{}(x_{1},\dots,x_{k}) as the hidden states of the top layer in a stacked BiLSTM of multiple layers, each uni-directional LSTM in each layer having dhsubscript𝑑ℎd_{h} cells and uk∈ℝ2​dhsubscript𝑢𝑘superscriptℝ2subscript𝑑ℎu_{k}\in\mathbb{R}^{2d_{h}}. + +The simple module specified above allows better exploitation of the context that a token appears in, if such exploitation is needed and is not learned by the rest of the network, which operates over w1′,…,wk′superscriptsubscript𝑤1′…superscriptsubscript𝑤𝑘′w_{1}^{\prime},\dots,w_{k}^{\prime}.Our findings in Section 4 indicate that context is crucial but that in our setting it may be utilized to a limited extent. + +We hypothesize that the main determining factor in this behavior is the relatively small size of the data and its distribution, which does not require using long-range context in most examples. Therefore, we leverage a strong language model that was pre-trained on large corpora as a fixed encoder which supplies additional contextualized token representations. We denote these representations as {o1,…,ok}subscript𝑜1…subscript𝑜𝑘\{o_{1},\dots,o_{k}\} and set ut=[ut′;ot]subscript𝑢𝑡superscriptsubscript𝑢𝑡′subscript𝑜𝑡u_{t}=[u_{t}^{\prime};o_{t}] for {u1′,…,uk′}=BiLSTM​(x1,…,xk)superscriptsubscript𝑢1′…superscriptsubscript𝑢𝑘′BiLSTMsubscript𝑥1…subscript𝑥𝑘\{u_{1}^{\prime},\dots,u_{k}^{\prime}\}=\textsc{B{i}LSTM}(x_{1},\dots,x_{k}). + +The LM we use is from Józefowicz et al. (2016),222Named BIG LSTM+CNN INPUTS in that work and available at http://github.com/tensorflow/models/tree/master/research/lm_1b. trained on the One Billion Words Benchmark dataset Chelba et al. (2013). It consists of an initial layer which produces character-based word representations, followed by two stacked LSTM layers and a softmax prediction layer. The hidden state outputs of each LSTM layer are projected down to a lower dimension via a bottleneck layer Sak et al. (2014). We set {o1,…,ok}subscript𝑜1…subscript𝑜𝑘\{o_{1},\dots,o_{k}\} to either the projections of the first layer, referred to as TR + LM(L1), or those of the second one, referred to as TR + LM(L2). + +With both re-embedding schemes, we use the resulting representations w1′,…,wk′superscriptsubscript𝑤1′…superscriptsubscript𝑤𝑘′w_{1}^{\prime},\dots,w_{k}^{\prime} as a drop-in replacement for the word-embedding inputs fed to a standard model, described next. + +We build upon Lee et al. (2016), who proposed the RaSoR model. For word-embedding inputs q1,…,qmsubscript𝑞1…subscript𝑞𝑚q_{1},\dots,q_{m} and p1,…,pnsubscript𝑝1…subscript𝑝𝑛p_{1},\dots,p_{n} of dimension dwsubscript𝑑𝑤{d_{w}}, RaSoR consists of the following components: + +The question is encoded via a BiLSTM {v1,…,vm}=BiLSTM​(q1,…,qm)subscript𝑣1…subscript𝑣𝑚BiLSTMsubscript𝑞1…subscript𝑞𝑚\{v_{1},\dots,v_{m}\}=\textsc{B{i}LSTM}(q_{1},\dots,q_{m}) and the resulting hidden states are summarized via attention (Bahdanau et al., 2015; Parikh et al., 2016): qi​n​d​e​p=∑j=1mαj​vj∈ℝ2​dhsuperscript𝑞𝑖𝑛𝑑𝑒𝑝superscriptsubscript𝑗1𝑚subscript𝛼𝑗subscript𝑣𝑗superscriptℝ2subscript𝑑ℎq^{indep}=\sum_{j=1}^{m}\alpha_{j}v_{j}\in\mathbb{R}^{2d_{h}}.The attention coefficients α𝛼\mathbf{\alpha} are normalized logits {α1,…,αm}=softmax(s1,…,sm)\alpha_{1},\dots,\alpha_{m}\}=\textsc{{softmax}}(s_{1},\dots,s_{m}) where sj=wqT⋅FF​(vj)subscript𝑠𝑗⋅superscriptsubscript𝑤𝑞𝑇FFsubscript𝑣𝑗s_{j}=w_{q}^{T}\cdot\textsc{FF}(v_{j}) for a parameter vector wq∈ℝdfsubscript𝑤𝑞superscriptℝsubscript𝑑𝑓w_{q}\in\mathbb{R}^{d_{f}} and FF​(⋅)FF⋅\textsc{FF}(\cdot) a single layer feed-forward network. + +For each passage position i𝑖i, the question is encoded via attention operated over its word-embeddings qia​l​i​g​n=∑j=1mβi​j​qj∈ℝdwsuperscriptsubscript𝑞𝑖𝑎𝑙𝑖𝑔𝑛superscriptsubscript𝑗1𝑚subscript𝛽𝑖𝑗subscript𝑞𝑗superscriptℝsubscript𝑑𝑤q_{i}^{align}=\sum_{j=1}^{m}\beta_{ij}q_{j}\in\mathbb{R}^{d_{w}}.The coefficients βisubscript𝛽𝑖\beta_{i} are produced by normalizing the logits {si​1,…,si​m}subscript𝑠𝑖1…subscript𝑠𝑖𝑚\{s_{i1},\dots,s_{im}\}, where si​j=FF​(qj)T⋅FF​(pi)subscript𝑠𝑖𝑗⋅FFsuperscriptsubscript𝑞𝑗𝑇FFsubscript𝑝𝑖s_{ij}=\textsc{FF}(q_{j})^{T}\cdot\textsc{FF}(p_{i}). + +Each passage word-embedding pisubscript𝑝𝑖p_{i} is concatenated with its corresponding qia​l​i​g​nsuperscriptsubscript𝑞𝑖𝑎𝑙𝑖𝑔𝑛q_{i}^{align} and with the independent qi​n​d​e​psuperscript𝑞𝑖𝑛𝑑𝑒𝑝q^{indep} to produce pi∗=[pi;qia​l​i​g​n;qi​n​d​e​p]superscriptsubscript𝑝𝑖subscript𝑝𝑖superscriptsubscript𝑞𝑖𝑎𝑙𝑖𝑔𝑛superscript𝑞𝑖𝑛𝑑𝑒𝑝p_{i}^{*}=[p_{i};q_{i}^{align};q^{indep}], and a BiLSTM is operated over the resulting vectors: {h1,…,hn}=BiLSTM​(p1∗,…,pn∗)subscriptℎ1…subscriptℎ𝑛BiLSTMsuperscriptsubscript𝑝1…superscriptsubscript𝑝𝑛\{h_{1},\dots,h_{n}\}=\textsc{B{i}LSTM}(p_{1}^{*},\dots,p_{n}^{*}). + +A candidate answer span a=(l,r)𝑎𝑙𝑟a=(l,r) with l≤r𝑙𝑟l\leq r is represented as the concatenation of the corresponding augmented passage representations: ha∗=[hl;hr]superscriptsubscriptℎ𝑎subscriptℎ𝑙subscriptℎ𝑟h_{a}^{*}=[h_{l};h_{r}]. In order to avoid quadratic runtime, only spans up to length 30 are considered. + +Finally, each span representation ha∗superscriptsubscriptℎ𝑎h_{a}^{*} is transformed to a logit sa=wcT⋅FF​(ha∗)subscript𝑠𝑎⋅superscriptsubscript𝑤𝑐𝑇FFsuperscriptsubscriptℎ𝑎s_{a}=w_{c}^{T}\cdot\textsc{FF}(h_{a}^{*}) for a parameter vector wc∈ℝdfsubscript𝑤𝑐superscriptℝsubscript𝑑𝑓w_{c}\in\mathbb{R}^{d_{f}}, and these logits are normalized to produce a distribution over spans. Learning is performed by maximizing the log-likelihood of the correct answer span. + +We evaluate our contextualization scheme on the SQuAD dataset Rajpurkar et al. (2016) which consists of 100,000+ paragraph-question-answer examples, crowdsourced from Wikipedia articles. + +We are interested in evaluating the effect of our RNN-based re-embedding scheme on the performance of the downstream base model. However, the addition of the re-embedding module incurs additional depth and capacity for the resultant model. We therefore compare this model, termed RaSoR + TR, to a setting in which re-embedding is non-contextual, referred to as RaSoR + TR(MLP). Here we set ut=MLP​(xt)subscript𝑢𝑡MLPsubscript𝑥𝑡u_{t}=\textsc{MLP}(x_{t}), a multi-layered perceptron on xtsubscript𝑥𝑡x_{t}, allowing for the additional computation to be carried out on word-level representations without any context and matching the model size and hyper-parameter search budget of RaSoR + TR.In Table 1 we compare these two variants over the development set and observe superior performance by the contextual one, illustrating the benefit of contextualization and specifically per-sequence contextualization which is done separately for the question and for the passage. + +Our formulation lends itself to an inspection of the different dynamic weightings computed by the model for interpolating between contextual and non-contextual terms. In Figure 1 we plot the average gate value gtsubscript𝑔𝑡g_{t} for each word-type, where the average is taken across entries of the gate vector and across all occurrences of the word in both passages and questions. This inspection reveals the following:On average, the less frequent a word-type is, the smaller are its gate activations, i.e., the re-embedded representation of a rare word places less weight on its fixed word-embedding and more on its contextual representation, compared to a common word. This highlights a problem with maintaining fixed word representations: albeit pre-trained on extremely large corpora, the embeddings of rare words need to be complemented with information emanating from their context. Our specific parameterization allows observing this directly, but it may very well be an implicit burden placed on any contextualizing encoder such as a vanilla BiLSTM. + +Supplementing the calculation of token re-embeddings with the hidden states of a strong language model proves to be highly effective. In Table 1 we list development set results for using either the LM hidden states of the first stacked LSTM layer or those of the second one. We additionally evaluate the incorporation of that model’s word-type representations (referred to as RaSoR + TR + LM(emb)), which are based on character-level embeddings and are naturally unaffected by context around a word-token. + +Overall, we observe a significant improvement with all three configurations, effectively showing the benefit of training a QA model in a semi-supervised fashion Dai and Le (2015) with a large language model.Besides a crosscutting boost in results, we note that the performance due to utilizing the LM hidden states of the first LSTM layer significantly surpasses the other two variants. This may be due to context being most strongly represented in those hidden states as the representations of LM(emb) are non-contextual by definition and those of LM(L2) were optimized (during LM training) to be similar to parameter vectors that correspond to word-types and not to word-tokens. + +In Table 3 we list the top-scoring single-model published results on SQuAD’s test set, where we observe RaSoR + TR + LM(L1) ranks second in EM, despite having only minimal question-passage interaction which is a core component of other works.An additional evaluation we carry out is following Jia and Liang (2017), which demonstrated the proneness of current QA models to be fooled by distracting sentences added to the paragraph.In Table 3 we list the single-model results reported thus far and observe that the utilization of LM-based representations carried out by RaSoR + TR + LM(L1) results in improved robustness to adversarial examples. + +We use pre-trained GloVe embeddings Pennington et al. (2014) of dimension dw=300subscript𝑑𝑤300d_{w}=300 and produce character-based word representations via dc=100subscript𝑑𝑐100d_{c}=100 convolutional filters over character embeddings as in Seo et al. (2016).For all BiLSTMs, hyper-parameter search included the following values, with model selection being done according to validation set results (underlined): number of stacked BiLSTM layers (1,2¯,3)1¯23(1,\underline{2},3), number of cells dhsubscript𝑑ℎd_{h} (50,100,200¯)50100¯200(50,100,\underline{200}), dropout rate over input (0.4,0.5,0.6¯)0.40.5¯0.6(0.4,0.5,\underline{0.6}), dropout rate over hidden state (0.05,0.1¯,0.15)0.05¯0.10.15(0.05,\underline{0.1},0.15).To further regularize models, we employed word dropout (Iyyer et al., 2015; Dai and Le, 2015) at rate (0.05,0.1,0.15¯)0.050.1¯0.15(0.05,0.1,\underline{0.15}) and couple LSTM input and forget gate as in Greff et al. (2016).All feed-forward networks and the MLP employed the ReLU non-linearity Nair and Hinton (2010) with dropout rate (0.2¯,0.3)¯0.20.3(\underline{0.2},0.3), where the single hidden layer of the FFs was of dimension df=(50,100¯)subscript𝑑𝑓50¯100d_{f}=(50,\underline{100}) and the best performing MLP consisted of 3 hidden layers of dimensions 865865865, 865865865 and 400400400.For optimization, we used Adam Kingma and Ba (2015) with batch size 808080. + +Our use of a Highway layer with RNNs is related to Highway LSTM Zhang et al. (2016) and Residual LSTM Kim et al. (2017). The goal in those works is to effectively train many stacked LSTM layers and so highway and residual connections are introducedinto the definition of the LSTM function.Our formulation is external to that definition, with the specific goal of gating between LSTM hidden states and fixed word-embeddings. + +Multiple works have shown the efficacy of semi-supervision for NLP tasks Søgaard (2013). Pre-training a LM in order to initialize the weights of an encoder has been reported to improve generalization and training stability for sequence classification (Dai and Le, 2015) as well as translation and summarization (Ramachandran et al., 2017). + +Similar to our work, Peters et al. (2017) utilize the same pre-trained LM from Józefowicz et al. (2016) for sequence tagging tasks, keeping encoder weights fixed during training. Their formulation includes a backward LM and uses the hidden states from the top-most stacked LSTM layer of the LMs, whereas we also consider reading the hidden states of the bottom one, which substantially improves performance.In parallel to our work, Peters et al. (2018) have successfully leveraged pre-trained LMs for several tasks, including RC, by utilizing representations from all layers of the pre-trained LM. + +In a transfer-learning setting, McCann et al. (2017) pre-train an attentional encoder-decoder model for machine translation and show improvements across a range of tasks when incorporating the hidden states of the encoder as additional fixed inputs for downstream task training. + +In this work we examine the importance of context for the task of reading comprehension. We present a neural module that gates contextual and non-contextual representations and observe gains due to context utilization. Consequently, we inject contextual information into our model by integrating a pre-trained language model through our suggested module and find that it substantially improves results, reaching state-of-the-art performance on the SQuAD dataset. \ No newline at end of file diff --git a/1712.04172v2.txt b/1712.04172v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..c3691f1c3795dd636d1e3d9a463cad54eab9628e --- /dev/null +++ b/1712.04172v2.txt @@ -0,0 +1,75 @@ +As AI systems become part of our lives and sometimes make decisions related to life-or-death consequences such as clinical decision making (?), awareness should be raised to prevent machines from making not only incorrect but also unethical decisions. Reinforcement learning (?) is designed to tackle intricate real-world problems in rather short time (?; ?) with a performance bound (?); however, it relies heavily on the quality of the reward functions provided as the inputs. The problems of unintended and harmful behavior that may emerge from poor design of AI systems are mentioned in (?). + +Nevertheless, identifying all plausible ethical concerns for an agent is challenging, not to mention implementing them into the system. Here we consider a scenario in machine ethics that objective functions are specifically designed to reward a given goal without considering much ethical violation, so that penalties are not delivered when the agents attempt to make unethical decisions. Consequently, even though the goal or desired performance is achieved, some unethical behavior may appear such as robbing a pharmacy to get the drug or passing by an injured person without offering any help when minimizing the traveling time. + +To address these concerns, we need to design an RL agent that can not only optimize the cumulative rewards but also minimize the ethical violation. A straightforward solution is to design the rewards for ethical moves. However, such strategy suffers at least two drawbacks. First, it is costly, if by all means possible, to enumerate all plausible ethical/non-ethical scenarios or rules, not to mention designing meaningful rewards to them. Second, the judgment of ethics is likely to be dynamic, depending on the present environment or situation. Thus the hand-crafted ethical patterns might not be valid given updated situations, making the design of general ethical RL rewards challenging. + +The research question we would like to address here is: Is it possible to alleviate the burden of RL designers from having to consider many ethical issues in the design?For instance, to build a supermarket shopping agent, can an RL designer simply focus on implementing the shopping capability of an agent (i.e. seeking and fetching items, checking out in the counter, etc) instead of worrying about trivial ethical decisions it may face (e.g., helping elder persons, assisting lost kids, reporting wet floor, etc) and let our framework take care of the learning of such behavior?One idea to achieve such goal is to collect enough ethical behavior data of human acting toward the given goal, and then apply the inverse reinforcement learning (IRL) (?; ?; ?; ?) technique to learn an ethical agent that follows a similar pattern. IRL and apprenticeship learning (?) have been considered as promising solutions due to their ability to extract rules and policies of human behaviors. IRL is also admired for the ability to generalize to unseen states, which greatly saves the effort of manually enumerating reward. + +However, there are several concerns for adopting IRL. First, collecting a large amount of human data toward maximizing the reward is costly, and can bias the ethical learning since it is likely only data from a small number of personnel is collected. Second, the human data might not be optimal (e.g., human not aware of a better solution); thus, learning based on such imperfect data might lead to sub-optimal outcomes. Third, IRL is insufficient for agents to infer temporally complex norms (?). + +On the other hand, we have observed that although human behavior data optimizing certain RL goals is costly to obtain, general human data without targeting at the desired goals is much easier to gather. For instance, in the previous shopping bot example, it might not be as easy to gather many people’s behavior in the supermarket compared to gathering general shopping or wandering data of people in any commercial district. That says, we assume the accessibility to the larger amount of general human data not necessary aiming at the target goal of interest. The technical challenge then becomes how an RL agent can learn to behave ethically given such imperfect data, while still achieving high cumulative rewards for the target goal of interests.We believe it is achievable given the assumption that under normal circumstances the majority of humans do behave ethically. + +Toward this direction, we propose a framework that works as below: Besides the regular reward function to guide an RL agent to achieve the specific objective of interests (e.g., shopping), we are further given a set of human action data optimizing diverse objectives (e.g., jogging, walking) or even without an apparent goal (e.g., wandering). The goal is to design an RL agent that can not only optimize the target objective but also minimize the chance of unethical behavior. If it succeeds, the proposed framework can relieve the burden for an RL developer to consider various ethical issues, and focus mainly on designing an adequate reward function to achieve the target objective. What is needed then becomes a corpus of normal human behavior toward arbitrary goals. + +This paper proposes Ethics Shaping, which leverages human data and reward shaping to design a more ethical reinforcement learner. We argue that as larger amount of human data are being collected, the decisions that involve ethical issues become clearer and aligned.Therefore, this paper only focuses on the ethical decision makings that are independent of the RL goals to emphasize on universal guidelines of ethics that every human beings normally follow, such as helping injured people or avoid hitting animals while driving. In our ethics shaping, the human data is not required to be aligned with the objective functions of the agents as long as it is from ethical human behavior. Consequently, ethics shaping is low-cost and applicable to real-world scenarios as we do not demand high-quality or goal-specific human data. + +We demonstrate the effectiveness of ethics shaping by conducting experiments in three scenarios, Grab a Milk, Driving and Avoiding, and Driving and Rescuing. These schemes are designed to show how the learner’s behavior could be altered by ethics shaping while facing matters happening in our daily lives. We further claim that ethics shaping ought to overcome or alleviate ethical problems such as side effects caused by optimizing the original objective functions (?) and dangerous exploration (?), which will be confirmed by the experiment results. The main contributions can be summarized as follows:•Strategically we propose a high-level framework to train an ethical RL agent based on a regular reward function together with certain human data optimizing diverse objectives. It is of much lower cost compared to IRL since we do not need human data geared towards optimizing the target reward function.•Technically we propose the ethics shaping model to adjust the reward function through the interaction between the RL and human policy.•We coin three scenarios Grab a Milk, Driving and Avoiding, and Driving and Rescuing to show how ethics shaping balances ethical behavior and performance pursuit. + +Recently, reinforcement learning has attracted attention for beating the world champion of Go for the first time (?; ?), since searching for effective tactical decisions from such enormous states was thought to be impossible. Reinforcement learning defines a class of algorithms solving problems modeled as a Markov Decision Process (MDP). + +A Markov Decision Problem is usually denoted by the tuple (𝒮,𝒜,𝒯,ℛ,γ)𝒮𝒜𝒯ℛ𝛾(\mathcal{S},\mathcal{A},\mathcal{T},\mathcal{R},\gamma), where•𝒮𝒮\mathcal{S} is a set of possible states•𝒜𝒜\mathcal{A} is a set of actions•𝒯𝒯\mathcal{T} is a transition function defined by 𝒯​(s,a,s′)=Pr⁡(s′|s,a)𝒯𝑠𝑎superscript𝑠′Prconditionalsuperscript𝑠′𝑠𝑎\mathcal{T}(s,a,s^{\prime})=\Pr(s^{\prime}|s,a), where s,s′∈𝒮𝑠superscript𝑠′𝒮s,s^{\prime}\in\mathcal{S} and a∈𝒜𝑎𝒜a\in\mathcal{A}•ℛ:𝒮×𝒜×𝒮↦ℝ:ℛmaps-to𝒮𝒜𝒮ℝ\mathcal{R}:\mathcal{S}\times\mathcal{A}\times\mathcal{S}\mapsto\mathbb{R} is a reward function. It can always be reduced to 𝒮×𝒜↦ℝmaps-to𝒮𝒜ℝ\mathcal{S}\times\mathcal{A}\mapsto\mathbb{R} by marginalizing over next state•γ𝛾\gamma is a discount factor that specifies how much long term reward is kept. + +To solve a MDP problem, the discounted long term reward received should be maximized. Usually the infinite-horizon objective is considered:max​∑t=0∞γt​ℛ​(st,at)superscriptsubscript𝑡0superscript𝛾𝑡ℛsubscript𝑠𝑡subscript𝑎𝑡\displaystyle\max\sum_{t=0}^{\infty}\gamma^{t}\mathcal{R}(s_{t},a_{t})(1) + +Solutions come in the form of policies π:𝒮↦𝒜:𝜋maps-to𝒮𝒜\pi:\mathcal{S}\mapsto\mathcal{A}, which specify what action the agent will take in any given state deterministically or stochastically. One way to solve this problem is through SARSA (?), where Q-value 𝒬​(s,a)𝒬𝑠𝑎\mathcal{Q}(s,a) is calculated as an estimate of the expected future discounted reward for taking action a∈𝒜𝑎𝒜a\in\mathcal{A} in state s∈𝒮𝑠𝒮s\in\mathcal{S}. The Q-value of the state-action pair is updated according to the received value:𝒬​(st,at)←←𝒬subscript𝑠𝑡subscript𝑎𝑡absent\displaystyle\mathcal{Q}(s_{t},a_{t})\leftarrow𝒬​(st,at)+limit-from𝒬subscript𝑠𝑡subscript𝑎𝑡\displaystyle\mathcal{Q}(s_{t},a_{t})+α​[rt+γ​𝒬​(st+1,at+1)−Q​(st,at)],𝛼delimited-[]subscript𝑟𝑡𝛾𝒬subscript𝑠𝑡1subscript𝑎𝑡1𝑄subscript𝑠𝑡subscript𝑎𝑡\displaystyle\alpha[r_{t}+\gamma\mathcal{Q}(s_{t+1},a_{t+1})-Q(s_{t},a_{t})],(2)where α𝛼\alpha is the learning rate. In this paper, ϵitalic-ϵ\epsilon-greedy is used for exploration. The agent’s policy is modeled by Boltzmann distributionPr𝒬⁡(a|s)=e𝒬​(s,a)/τ∑a′e𝒬​(s,a′)/τsubscriptPr𝒬conditional𝑎𝑠superscript𝑒𝒬𝑠𝑎𝜏subscriptsuperscript𝑎′superscript𝑒𝒬𝑠superscript𝑎′𝜏\displaystyle\Pr_{\mathcal{Q}}(a|s)=\frac{e^{\mathcal{Q}(s,a)/\tau}}{\sum_{a^{\prime}}e^{\mathcal{Q}(s,a^{\prime})/\tau}}(3)when aggregated with human data. + +Without prior knowledge, most value-based reinforcement learning algorithms are slow because they need to explore state-action pairs uniformly at random in the early stage. Only going through enough explorations and then updated by associated rewards have been observed can the agent start to exploit the experience by biasing its action selection towards what it estimates to be good. + +Reward shaping, motivated from behavioral psychology (?), is an efficient way of including prior knowledge in the learning problems so as to speed up the process. Extra intermediate rewards are provided to enrich a sparse base reward signal, providing the agent with useful gradient information. Reward shaping can be easily incorporated with a variety of resources such as demonstration (?) and verbal feedback (?). The shaping reward ℋℋ\mathcal{H} is usually integrated with the original reward in the form of addition:ℛs​(st,at,st+1)=ℛ​(st,at,st+1)+ℋ​(st,at,st+1).subscriptℛ𝑠subscript𝑠𝑡subscript𝑎𝑡subscript𝑠𝑡1ℛsubscript𝑠𝑡subscript𝑎𝑡subscript𝑠𝑡1ℋsubscript𝑠𝑡subscript𝑎𝑡subscript𝑠𝑡1\displaystyle\mathcal{R}_{s}(s_{t},a_{t},s_{t+1})=\mathcal{R}(s_{t},a_{t},s_{t+1})+\mathcal{H}(s_{t},a_{t},s_{t+1}).(4) + +We propose a method that gives additional penalties and rewards according to the Kullback-Leibler divergence between the policy of the learning agent and the human policy aggregated from human data. The human data 𝒟𝒟\mathcal{D} is a set of state-action pairs recorded from human behaviors. Each pair in 𝒟𝒟\mathcal{D} is treated as a positive human feedback since decisions made by human beings are usually, from their prospective, superior to other choices. + +We generate the human policy from human data 𝒟𝒟\mathcal{D} according to (?), which integrates human feedback to derive a stochastic policy by imposing binomial distribution. The human feedback suggesting if certain action is optimal is aggregated to be Δs,asubscriptΔ𝑠𝑎\Delta_{s,a}, which is defined as the difference between the number of “right” and “wrong” labels. Define that the probability an action a𝑎a in a particular state s𝑠s is optimal as PrH⁡(a|s)subscriptPr𝐻conditional𝑎𝑠\Pr_{H}(a|s). By assuming that PrH⁡(a|s)subscriptPr𝐻conditional𝑎𝑠\Pr_{H}(a|s) is independent of feedback to other actions and that there is only one optimal action in each state, which indicates independence conditions and the Bayes’ rule are applicable, they formally derive the integrated stochastic policy of human:PrH⁡(a|s)∝CΔs,a​(1−C)∑j≠aΔs,j.proportional-tosubscriptPr𝐻conditional𝑎𝑠superscript𝐶subscriptΔ𝑠𝑎superscript1𝐶subscript𝑗𝑎subscriptΔ𝑠𝑗\displaystyle\Pr_{H}(a|s)\propto C^{\Delta_{s,a}}(1-C)^{\sum_{j\neq a}\Delta_{s,j}}.(5)The parameter C𝐶C indicates the confidence level of human feedback. The detailed derivation of the above result is available in their appendix section. In our case, since there is only positive feedback given by each state-action pair in 𝒟𝒟\mathcal{D}, we normalize the set {Δs,a| ​∀a}conditional-setsubscriptΔ𝑠𝑎 for-all𝑎\{\Delta_{s,a}|\text{ }\forall a\} to zero mean with respect to states in order to approximate feedback scenario. + +Inspired by (?), which utilizes reward shaping with deterministic policy of human teacher to speed up the learning process, here we design our shaping reward by imposing the Kullback-Leibler divergence between two stochastic policies of human and the agent. With probability distribution of policies defined as equation 3 and 5, the shaping reward becomes:ℋ​(s,a)={−cn⋅DKL​(PrQ⁡(a|s)∥PrH⁡(a∣s)),if ​PrQ⁡(a=1|s)>PrH⁡(a=1|s)and ​PrH⁡(a=1|s)<τncp⋅DKL​(PrQ⁡(a|s)∥PrH⁡(a∣s)),if ​PrQ⁡(a=1|s)τp0,otherwiseℋ𝑠𝑎cases⋅subscript𝑐𝑛subscript𝐷KLconditionalsubscriptPr𝑄conditional𝑎𝑠subscriptPr𝐻𝑎𝑠otherwiseif subscriptPr𝑄𝑎conditional1𝑠subscriptPr𝐻𝑎conditional1𝑠otherwiseand subscriptPr𝐻𝑎conditional1𝑠subscript𝜏𝑛otherwise⋅subscript𝑐𝑝subscript𝐷KLconditionalsubscriptPr𝑄conditional𝑎𝑠subscriptPr𝐻𝑎𝑠otherwiseif subscriptPr𝑄𝑎conditional1𝑠subscriptPr𝐻𝑎conditional1𝑠otherwiseand subscriptPr𝐻𝑎conditional1𝑠subscript𝜏𝑝otherwise0otherwiseotherwise\displaystyle\mathcal{H}(s,a)=\begin{cases}-c_{n}\cdot D_{\text{KL}}(\Pr_{Q}(a|s)\|\Pr_{H}(a|s)),\\\qquad\text{if }\quad\!\Pr_{Q}(a=1|s)>\Pr_{H}(a=1|s)\\\qquad\text{and }\Pr_{H}(a=1|s)<\tau_{n}\\c_{p}\cdot D_{\text{KL}}(\Pr_{Q}(a|s)\|\Pr_{H}(a|s)),\\\qquad\text{if }\quad\!\Pr_{Q}(a=1|s)<\Pr_{H}(a=1|s)\\\qquad\text{and }\Pr_{H}(a=1|s)>\tau_{p}\\0,\quad\text{otherwise}\end{cases}(6)The K-L divergence term measures whether the current policy learned by the RL agent (denoted as P​rQ​(a|s)𝑃subscript𝑟𝑄conditional𝑎𝑠Pr_{Q}(a|s)) is diverse from the human policy (denoted as P​rH​(a|s)𝑃subscript𝑟𝐻conditional𝑎𝑠Pr_{H}(a|s)) induced from human data given the current state s𝑠s. If they are indeed similar, then this value shall be close to zero (i.e. no shaping is required).If this value is much larger than zero, meaning that there is a discrepancy between human and RL policy. We would then utilize equation 6 to identify if such action is related to ethical issues. The situations can be grouped into three categories:•Negative ethical decisions. It is associated with the top condition in equation 6 representing what machines should not do but do such as cutting in line or hurting people. Mathematically, if the probability for the agent to make certain move a=1𝑎1a=1 given the learned policy is higher than that under human policy P​rH​(a=1|s)𝑃subscript𝑟𝐻𝑎conditional1𝑠Pr_{H}(a=1|s), and the chance for human to conduct this action is very low PrH⁡(a=1|s)τpsubscriptPr𝐻𝑎conditional1𝑠subscript𝜏𝑝\Pr_{H}(a=1|s)>\tau_{p} indicates that this action is indeed a very attractive move to the human since we set the threshold τpsubscript𝜏𝑝\tau_{p} to a high probability. Given the above conditions hold, we shall update the RL policy toward performing action a𝑎a given s𝑠s through a positive ℋ​(s,a)ℋ𝑠𝑎\mathcal{H}(s,a). Note that cnsubscript𝑐𝑛c_{n} and cpsubscript𝑐𝑝c_{p} allow the RL designer to weight the importance of positive and negative ethical conditions respectively.•Others. No shaping is required as we do not recognize either ethical issues or policy discrepancy. + +Thanks to its simplicity in reward shaping, our model can be seamlessly integrated into a variety of types of reinforcement learning methods. However, we would like to mention that our framework requires the human data to be collected given diverse objectives, and therefore the non-ethical biases can be minimized. + +We argue that ethics shaping is able to deal with shortcomings of IRL suggested by (?): (1) IRL may inherit unethical biases and characteristics of the data of which it is trained and (2) IRL is insufficient for agents to infer temporally complex norms. For the first defect, unlike IRL which requires policies to have descent performance and behave ethically at the same time, in our model, human data is not required to be optimal or even aligned with the target objective for reinforcement learning. The reason is that the integrated human policy from human data is capable of recognizing which ethical decision making has happened under our claim that universal ethical code should be obeyed by most of the people. For the second drawback, temporally complex norms can be learned in our model because in equation 5, we may deploy queue data structure for each state to maintain the total number of Δs,jsubscriptΔ𝑠𝑗\Delta_{s,j} and the human policy derived from equation 5 will be updated according to incoming state-action pairs. Therefore, when such norms vanish, penalties or rewards will not be given to bias action choices as well. + +In this section, we will demonstrate that the ethics shaping algorithm can make the SARSA algorithm perform more ethically. The same concept can be adopted to other RL models in a similar manner. Instead of considering the two previous scenarios, Cake or Death (?) and Burning Room (?), in which the number of states is fairly small, we propose three tasks Grab a Milk, Driving and Avoiding, and Driving and Rescuing which are closely related to our everyday lives. The main advantage is that the number of states is larger and therefore can be more closely related to the real-world scenarios. + +In the experiments, all human policies are synthesized by random walk with ethical rules and the confidence level of human feedback C𝐶C is set to 0.95 since we would like to focus on how much ethics shaping can influence reinforcement learners. For algorithms with and without ethics shaping, the best performances are reported in terms of learning rate α𝛼\alpha, discount factor γ𝛾\gamma, and the scale parameters cn,cpsubscript𝑐𝑛subscript𝑐𝑝c_{n},c_{p} in shaping reward ℋℋ\mathcal{H}. + +Route planning is a classic task for reinforcement learning and robotic techniques (?). The Grab a Milk scenario is a basic route planning problem with ethical issues that we should carefully deal with. In a room with walls, objects and milk, the robot should manage to reach the milk as soon as possible. The robot will receive a huge penalty when facing a wall because it is time-consuming to cross it. In contrast, the robot may receive no penalty to small objects as long as the decision results in a faster route. However, what if the small object is a baby? Ethical human would normally opt to avoid crossing babies. To show the scenario that includes both positive and negative ethical decisions, we further extend the scheme with crying babies. Unlike the case of other babies, it would be better if crying babies could get helped instead of being neglected, which, in a sense, represents ethical decisions that need robots voluntarily to make. + +We simplify the problem to a 10 by 10 grid room with a robot starts at (0,0)00(0,0) and a milk is positioned at (9,9)99(9,9). There are 16 babies in the room and five of them are crying for attention. The goals of this task can be stated as follows.•Primary goal: minimize steps to the milk•Sub-goals: (1) soothe as many crying babies as possible, (2) avoid crossing non-crying babies.The MDP has four actions which allow the robot to move to neighboring grids. If the robot moves to grids with babies, crying babies will be comforted but other babies will get hurt. A state is represented by the coordinate where the robot is currently at. The defective reward function is:ℛ​(s,a)={20,if the robot get the milk−1,otherwiseℛ𝑠𝑎cases20if the robot get the milk1otherwise\displaystyle\mathcal{R}(s,a)=\begin{cases}20,&\text{if the robot get the milk}\\-1,&\text{otherwise}\end{cases}(7)where the reward from soothing crying babies and the penalty from hurting babies are not provided and need to be learned through ethics shaping from human data. Human trajectories are generated from random walk while obeying rules that quiet babies should not be crossed and human beings will choose to comfort crying babies when they are adjacent to those babies both with 0.95 probability. + +There are 48,620 optimal solutions (18 steps to the milk) for the defective reward function and ideally there exist some routes that both avoid non-crying babies and comfort crying babies as many as possible. Figure 2 and 3 display how the agent improves at the two sub-goals through ethics shaping. Note that the agent actually helps more babies than human beings because the reward propagation mechanism in reinforcement learning makes the learner come up with more thorough plans. Unlike apprenticeship learning which directly imitates human behaviors, ethics shaping enables reinforcement learner not to be biased by inadequate decisions of human beings. Additionally, Figure 1 suggests that the extra tasks do not significantly affect the convergence. + +Since autonomous cars have attracted attention for ideally being able to dramatically reduce the number of traffic accidents, some ethical issues (?; ?) have been claimed for security. We would like to deploy this toy example to demonstrate that ethics shaping is capable of dealing with driving issues when the reward function is incomplete. + +Our car driving simulation is similar to the second experiment in (?) except that cars could be driving in all of the lanes and sometimes there are seriously wounded cats lying in certain lanes which we should avoid so as not to make them worse. We are driving faster than all of the other cars and the cats relatively approach us the fastest since they are unable to move. Even though dying cats may not directly relate to machine ethics which usually indicates human-machine interactions, we use dying cats to represent other objects such as humans injured in car accidents or elderly people with dementia. To be a good driver, it is also encouraged to drive straight when switching lanes is not needed. The problem definition without considering ethics is as follows:Objective (Driving and Avoiding)min𝐀={a1,a2,⋯,an|ai∈𝒜}⁡L​(𝐀),subscript𝐀conditional-setsubscript𝑎1subscript𝑎2⋯subscript𝑎𝑛subscript𝑎𝑖𝒜𝐿𝐀\displaystyle\min_{{\bf A}=\{a_{1},a_{2},\cdots,a_{n}|a_{i}\in\mathcal{A}\}}L({\bf A}),whereL​(𝐀)=∑ai∈𝒜𝐿𝐀subscriptsubscript𝑎𝑖𝒜\displaystyle L({\bf A})=\sum_{a_{i}\in\mathcal{A}}p1⋅𝟙​[[a∈Collision]]−limit-from⋅subscript𝑝11delimited-[]delimited-[]𝑎Collision\displaystyle p_{1}\cdot\mathbbm{1}[\![a\in\textit{Collision}]\!]-p2⋅𝟙​[[a=straight]],⋅subscript𝑝21delimited-[]delimited-[]𝑎straight\displaystyle p_{2}\cdot\mathbbm{1}\mathbbm{[}\![a=\textit{straight}]\!],𝒜𝒜\mathcal{A} is all possible actions, Collision is the set of actions that might collide with one of the cars, and straight is the action to drive straight. p1subscript𝑝1p_{1} and p2subscript𝑝2p_{2} are set to 202020 and 0.50.50.5 respectively in our experiment. + +By this experiment, we would like to test whether the ethics shaping technique is capable of making reinforcement learners dodge dying cats as well as be good drivers. The goals of this task can be stated as follows.•Primary goal: avoid collisions•Sub-goals: (1) drive straight, (2) dodge dying cats.Manually generated human trajectories aim at avoiding running over dying cats and averting car collisions. Some randomness is added to give variety. The MDP has three actions, which allow the agent to steer smoothly to one of the neighboring lanes and go straight. There are five features indicating what lane the car is currently at and the other twelve features indicating the discretized distance of the closest car and the closest cat in the left, current and the right lane respectively. The incomplete reward function is defined as the negative loss function as described above. + +This scenario is more difficult than Grab a Milk since sometimes it is required to make decisions between collision with cars and hitting wounded cats. Collisions are occasionally unavoidable due to the limited horizon of the agent. In this experiment, the human trajectories are generated with a rule that avoiding hurting cats first and then avoiding collisions by switching to the other lanes. The performance is evaluated by cumulative reward through one episode. It is shown that ethics shaping is able to acquire descent performance and still preserve ethical behavior. As Figure 4 and 5 suggest, in the reinforcement learning process, there is no significant difference between two algorithms with respect to cumulative rewards and number of collisions. Additionally, the significant reduction in the number of cats getting hit is shown in Figure 6, which provides an insight that ethics shaping is able to resolve the conflicts between performances and ethical decisions. + +Driving and Rescuing is similar to Driving and Avoiding in terms of environments. However, in this scenario, instead of avoiding running over dying cats, the sub-task for the agent is to rescue the dementia elderly trapped in the traffic by taking them into the car. We simplify the problem by considering that to rescue the elderly it is required to drive through their positions and the process takes no time. Consequently, it is the opposite problem of Driving and Avoiding in which the agent should avoid crossing cats. + +The problem is more challenging than Driving and Avoiding since there are more choices to stay away from a cat; however, to rescue the elderly, the action toward them is the only option. As Figure 7 and 8 suggest, to rescue more elders, it is inevitable for human beings to experience more collisions than in Driving and Avoiding. Even though SARSA algorithm with ethics shaping seems to perform slightly worse, it is reasonable since sacrifice (i.e. switching lanes) is needed to rescue elders. A piece of supporting evidence is that Figure 8 reveals there is no much difference between two approaches in terms of the number of collisions. With regard to the number of elders getting rescued, a significant change is shown in Figure 9, which verifies the ability of ethics shaping to make the learner behave ethically while pursuing better performance.Another conclusion can be made in the three experiments that the problem of dangerous exploration (?) is alleviated since in the learning process, penalties are given while the agents making unethical decisions. Consequently, the total number of unethical decision making is greatly reduced compared with original reinforcement learners. + +Machine ethics (?), a project that aims to make an AI system’s decision-making procedure obey some norms and ethics, has drawn attention since the AI systems have become part of the lives of modern people. Some proactive issues (?; ?; ?) have been proposed to discuss possible situations that might harm the interactions between human and machines. Several issues are resulted from ill-designed objective functions (?), which our work aims to solve. To the best of our knowledge, the idea that employs ordinary human data to learn ethical behaviors has not been proposed. We provide a brief survey of existing approaches that relate to ethical decision making and learning. + +(?) proposes a mechanism to determine when and how it is best to reject directives from human interlocutors. Under their architecture, ‘fecility conditions’ are reasoned to ensure matters such as the agent know how to accomplish the task and accomplishing the task does not violate normative principles. Those conditions are formulated as a logical expression along with inference rules. + +Horty logic (?) is a deontic logic (?) that allows reasoning about multiple agents and their actions. (?; ?) propose similar approaches that utilize Horty logic to compose ethical semantics. However, this formalism suffers from similar limitations as Briggs and Scheutz’s approach: ethical uncertainty is not allowed for decision making, active learning of the ethical rules is not permitted, and all rules should be rendered in advance. With the aid of ethics shaping, there is no need to enumerate all possible ethical rules since the integrated policy from human data is able to suggest ethical moves with our claim that most of the people would obey ethical code. + +Richer kinds of materials have been explored to achieve value alignment (?), which is a property of an agent indicating that it can only pursue goals beneficial to humans (?; ?). (?) claims that stories are necessarily reflections of the culture and society; consequently, stories are a wealth of data where cultural values tacitly hold. They first generate a plot graph from crowdsourced stories using the technique described by (?). However, stories may not be detailed enough to describe sophisticated behavior such as driving cars. + +It is a challenging problem for agents to derive their objective functions while making decisions. (?) uses Bayesian learning to update beliefs about the utility functions that best match ethical behaviors. Adopting the concept of utility functions as well, (?) considers the problem of ethical learning as learning an ethical utility function that is a part of hidden state of Partially Observable Markov Decision Process (POMDP). The difference with Armstrong’s work is that the agent is not maximizing a changing meta-utility function. Instead, the uncertainty of the ethical utility function is coupled with the uncertainty in the rest of the world. (?) claims that IRL by itself is insufficient for agents to infer norms that are temporally complex, unless each state contains sufficient information to characterize the history of the agent with respect to norms. To combine the strength of RL and logical representations, they propose a hybrid approach that agent would prioritize adherence. The agents would maximize the reward function over only those state-action pairs that maximally satisfy the norms. + +Ethics shaping is proposed to make reinforcement learners not only achieve the expected performance and the goals but also comply with ethical rules. It utilizes reward shaping and stochastic policy from human data to balance ethical behavior and performance pursuit by providing additional reward. The reward is given if the move is related to ethics identified by integrated human policy. It can be incorporated with a variety of reinforcement learning algorithms since most of the reinforcement learning frameworks rely on reward functions. + +We coin three scenarios Grab a Milk, Driving and Avoiding, and Driving and Rescuing to simulate real-life matters that everybody would possibly experience. In the three experiments, we show the capability of ethics shaping that it could outperform human policies with respect to positive ethical decisions (e.g., saving people) since reinforcement learners provide thorough plans even only local information is given. Additionally, although under more constraints than original problems, ethics shaping still achieves competitive performances with RL algorithms without ethics shaping. \ No newline at end of file diff --git a/1712.04415v1.txt b/1712.04415v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..ee843d8641ef74867f83c163521a09f96956fcd0 --- /dev/null +++ b/1712.04415v1.txt @@ -0,0 +1,276 @@ +\section{Introduction} +Deception is common in our daily lives. Some lies are harmless, while others may have severe consequences and can become an existential threat to society. For example, lying in a court may affect justice and let a guilty defendant go free. +Therefore, accurate detection of a deception in a high stakes situation is crucial for personal and public safety. + +The ability of humans to detect deception is very limited. In ~\cite{bond2006accuracy}, it was reported that the average accuracy of detecting lies without special aids is $54\%$, which is only slightly better than chance. To detect deception more accurately, physiological methods have been developed. However, physiological methods such as the Polygraph, or more recent functional Magnetic Resonance Imaging (fMRI) based methods are not always correlated with deception ~\cite{farah2014functional}. Additionally, the cost of the equipment and the overt nature of the method make the utility of these devices limited for real-life deception detection. + +Another line of work attempts to find behavioral cues for deception detection~\cite{depaulo2003cues}. These cues are faint behavioral residues, which are difficult for untrained people to detect. For example, according to ~\cite{ekman1969pan,ekman2009telling}, facial micro-expressions reflect emotions that subjects might want to hide. However, because of the variablity across different subjects, these micro-expressions are extremely difficult to detect using computer vision, especially in unconstrained settings. + + \begin{figure}[t!] + \centering + \includegraphics[width=1\linewidth]{change2.png} +\caption{Micro-expression: Eyebrows Raising. The left image and rightmost image in the image sequence are the same. However, it is much easier to detect the micro-expression in the image sequence when compared to the static image, as shown by the two green dotted lines.} + \label{fig:change} +\end{figure} + +It is usually much easier for humans to detect a subtle facial expression from videos than from static images \cite{grill1998cue}. For example, Fig.~\ref{fig:change} shows a comparison of static and dynamic representations of a simple micro micro-expression: Eyebrows Raise. Given only the left static image, people have a difficult time detecting that the eyebrows are raising. In contrast, we can clearly see from the right image sequence that the eyebrows are raising, even though the last image of the image flow is exactly the left static image. + + +Motivated by these observations, we propose to use motion dynamics for recognizing facial micro-expressions. +This coincides with the psychological insights from ~\cite{duran2013exploring}, in which the authors suggest focusing on dynamic motion signatures which are indicative of deception. +To accomplish this, we design a two-level feature representation for capturing dynamic motion signatures. +For the low-level feature representation, we use dense trajectories which represent motion and motion changes. +For the high-level representation, we train facial micro-expression detectors using low level features, and use their confidence score as high-level features. Experiments on 104 court room trial videos demonstrate the effectiveness and the complementary nature of our low-level and high-level features. + +Deception is a complex human behavior where subjects try to inhibit their deceptive evidence, from facial expressions to gestures, from the way they talk to what they say. Thus, a reliable deception detection method should integrate information from more than one modality. Taking motivation from prior work ~\cite{perez2015deception,jaiswal2016truth}, we also include features from other modalities, specifically audio and text. These additional modalities improve AUC (Area under the precision-recall curve) of our automated system by ~$5\%$ to $0.877$. When using ground truth facial micro-expression annotations, the system obtains $0.922$ AUC which is $9\%$ better than the previous state-of-the-art. We also conduct user studies to analyze how well do average humans perform on this task, what modalities they use and how they perform if only one modality is accessible. +\section{Related Work} +Physiological measures have been considered to be useful in deception detection for a long time. Polygraph measures physiological indices such as blood pressure, heart rate, skin conductivity of the person under interrogation, but their reliability is questionable. Thermal imaging can record the thermal patterns~\cite{pavlidis2002human} and measure the blood flow of the body~\cite{buddharaju2005automatic}, but the technique requires expensive thermal cameras. Brain-based detectors, such as functional MRI, have recently been proposed to detect deception by scanning the brain and finding areas that are correlated with deception. Although it achieves high accuracy~\cite{kozel2005detecting,langleben2013using,farah2014functional}, important questions related to the working mechanism, reliability and the experimental setting are still open research problems ~\cite{langleben2013using,farah2014functional}. Furthermore, the above mentioned physiological measure based methods are overt and could be disrupted by the subject's counter preparation and behavior~\cite{ganis2011lying}. + +Among the covert systems, computer vision based methods play an important role. Early works ~\cite{lu2005blob,tsechpenakis2005hmm} used blob analysis to track head and hand movements, which were used to classify human behavior in videos in three different behavioral states. +However, these methods used person specific sample images for training blob detectors, and since the database was small, the methods were prone to overfitting and did not generalize to new subjects. Based on Ekman's psychology research\cite{ekman1969pan,ekman2009telling} that some facial behaviors are involuntary and might serve as an evidence for deceit detection, several automatic vision-based systems were developed. Zhang et al. \cite{zhang2007real} tried to detect the differences between simulated facial expressions and involuntary facial expressions by identifying Deceit Indicators, which were defined by a group of specific Facial Action Units \cite{ekman1977facial}. However, this method requires people to manually label facial landmarks and input major components of FAU, thus is not fully automated. +Besides, this method was only tested with static images, so essential motion patterns in facial expressions were not captured. \cite{michael2010motion} proposed a new feature called motion profiles to extend the head and hand blob analysis with facial micro-expressions. Although fully automatic, this method relies heavily on the performance of facial landmarks localization, and the experimental setting is very constrained. For unconstrained videos, the facial landmark localization method may be unreliable. + +These early works were mainly in low-stake situations. Recently, researchers focused more on high stake deception detection, so that experiments are closer to real life settings. +In ~\cite{perez2015deception}, a new dataset containing real-life trial videos was introduced. +In this work, a multi-modal approach is presented for the high-stake deception detection problem, but the method requires manual labelling of human micro-expressions. Furthermore, in the dataset, the number of videos for different trials varies a lot, biasing the results towards longer trials. +In \cite{su2016does}, the authors also collected a video database of high-stakes situations, and manually designed a variety of features for different facial parts. Again, the manually designed features require the facial landmarks to be accurately detected. Also, the method segmented each video into multiple temporal volumes and assumes all the temporal volume labels to be the same when learning the classifier. +This could be incorrect for deception cases, because the deception evidence could be buried anywhere in the video. + +Deceptive behavior is very subtle and varies across different people. Thus, detecting these subtle micro motion patterns, e.g. micro facial expression, itself is a challenging problem. In addition, Duran et al. ~\cite{duran2013exploring} suggested that research should focus more on the movement dynamics and behavior structure. Motivated by this, we directly describe behavioral dynamics without detecting facial landmarks, then use behavior dynamics to learn micro-expressions and deceptive behavior. We also include simple verbal and audio features, as other multi-modal approaches~\cite{perez2015deception,jaiswal2016truth}, into the overall covert automated system. +\section{Method} +Our automated deception detection framework consists of 3 steps: multi-modal feature extraction, feature encoding and classification. The framework is shown in Figure.~\ref{fig:framework}. + + \begin{figure*}[ht!] + \centering + \includegraphics[width=0.9\linewidth]{Framework2.png} +\caption{Our automated deception detection framework.} + \label{fig:framework} +\end{figure*} +\subsection{Multi-Modal Feature Extraction} + +\subsubsection{Motion Features} +Our input source are videos, where a person is making truthful or deceptive statements. The video acquisition conditions are unconstrained, so the subject's face may not always be viewed frontally or centered. Here, we employ IDT (Improved Dense Trajectory)~\cite{wang2016robust} features due to their excellent performance in action recognition, especially in unconstrained settings. + +IDT compute local feature correspondences in consecutive frames and estimate the camera motion using RANSAC. After cancelling the effect of camera motion, the method samples feature points densely at multiple spatial scales, then tracks them through a limited number of frames to prevent drifting. Within the space-time volume around the trajectory, the method computes HOG (histogram of oriented gradients), HOF (histogram of optical flow) \cite{laptev2008learning}, MBH (motion bountary histogram) \cite{dalal2006human} and trajectory descriptors. +We found that the MBH descriptor works better than other descriptors (like HOG/HOF) for our task, because MBH computes optical flow derivatives and captures derivatives of motion rather than first order motion information. Since we want to detect micro-expressions, the descriptor should represent changes in motion rather than constant motion, which is captured in MBH. +\subsubsection{Audio Features} +We use MFCC (Mel-frequency Cepstral Coefficients) ~\cite{davis1980comparison} features as our audio features. MFCC has been widely used for ASR (Automatic Speech Recognition) tasks for over 30 years. We use the following MFCC extraction procedure: first estimate the periodogram of the power spectrum for each short frame, then warp to a Mel frequency scale, and finally compute the DCT of the log-Mel-spectrum. Then for each video, we have a series of MFCC features corresponding to short intervals. +After MFCC features are extracted, we use GMM (Gaussian Mixture Model) to build an audio feature dictionary for all training videos. We treat all the audio features equally and use our feature encoding method to encode the whole sequence, similar to ~\cite{campbell2006support}. This is because we are not interested in speech content (spoken words), but in hidden cues of deception in the audio domain. +\subsubsection{Transcript Features} +For every video, we use Glove(Global Vectors for Word Representation)~\cite{pennington2014glove} for encoding the entire set of words in the video transcripts to one fixed-length vector. Glove is an unsupervised learning algorithm for representing words using vectors. It is trained using word co-occurrence statistics. As a result, the word vector representations capture meaningful semantic structure. Compared to other text-based deception detection methods~\cite{porter2010truth}, Glove is more widely applicable in unconstrained environments. + +We use the pre-trained Wikipedia 2014+ Gigaword5 corpus which contains 6 billion tokens in total. Each word is embedded in a 300 dimensional vector space. Again, we use GMM to learn a vocabulary for the word vectors and employ a Fisher Vector encoding, described below, to aggregate all the word vectors into a fixed-length representation for the entire transcript. + +\begin{figure*}[ht!] + \minipage{0.19\textwidth} + \includegraphics[width=\linewidth,height=0.6\linewidth]{frown.png} + \label{fig:frown} +\endminipage\hfill +\minipage{0.19\textwidth} + \includegraphics[width=\linewidth,height=0.6\linewidth]{raise.png} + \label{fig:raise} +\endminipage\hfill +\minipage{0.19\textwidth} + \includegraphics[width=\linewidth,height=0.6\linewidth]{lipup.png} + \label{fig:lipup} +\endminipage\hfill +\minipage{0.19\textwidth} + \includegraphics[width=\linewidth,height=0.6\linewidth]{lippro.png} + \label{fig:lippro} +\endminipage\hfill +\minipage{0.19\textwidth} + \includegraphics[width=\linewidth,height=0.6\linewidth]{turn.png} + \label{fig:turn} +\endminipage\hfill +\caption{Five most predictive micro-expressions, from left to right: Frowning, Eyebrows raising, Lip corners up, Lips protruded and Head Side Turn.} +\label{facialges} +\end{figure*} +\subsection{Feature Encoding} +Since the number of features is different for each video, we employ a Fisher Vector encoding to aggregate a variable number of features to a fixed-length vector. Fisher Vectors were first introduced in ~\cite{jaakkola1999exploiting} to combine the advantages of generative and discriminative models, and are widely used in other computer vision tasks, such as image classification~\cite{perronnin2007fisher}, action recognition~\cite{wang2016robust} and video retrieval~\cite{han2017vrfp}. + +Fisher Vector encoding first builds a $K$-component GMM model $(\mu_i, \sigma_i, w_i:i=1,2,..., K)$ from training data, where $ \mu_i, \sigma_i, w_i$ are the mean, diagonal covariance, and mixture weights for the $i^{th}$ component, respectively. Given a bag of features $\{ x_1, x_2, ..., x_T\}$, its Fisher Vector is computed as: + +\begin{equation} +\mathcal{G}_{{\mu}_i} = \frac{1}{T\sqrt{w_i}}\sum_{t=1}^{T} \gamma_t(i) \left(\frac{ x_t - \mu_i}{ \sigma_i} \right) +\end{equation} +\begin{equation} +\mathcal{G}_{{\sigma}_i} = \frac{1}{T\sqrt{2w_i}}\sum_{t=1}^{T} \gamma_t(i) \left( \frac{(x_t - \mu_i)^2}{ \sigma_i^2} - 1 \right) +\end{equation} +where, $\gamma_t(i)$ is the posterior probability. Then all the $\mathcal{G}_{{\mu}_i}$ and $\mathcal{G}_{{\sigma}_i}$ are stacked to form the $2DK$-dimension Fisher Vector, where $D$ is the dimensionality of local feature $x_t$. +\subsection{Facial Micro-Expression Prediction} +The multi-modal features discussed above are low-level features. +Here, we introduce the high-level features used to represent facial micro-expressions. According to \cite{ekman1969pan,ekman2009telling}, facial micro-expressions play an important role in predicting deceptive behavior. To investigate their effectiveness, \cite{perez2015deception} manually annotated facial expressions and use binary features derived from the ground truth annotations to predict deception. They showed the five most predictive micro-expressions are: Frowning, Eyebrows raising, Lip corners up, Lips protruded and Head Side Turn. Samples of these facial micro-expressions are shown in Figure.~\ref{facialges}. + + + +We use the low-level visual features to train micro-expression detectors, and then use the predicted scores of the micro-expression detectors as high-level features for predicting deception. We divide each video in the database into short fixed-duration video clips and annotate these clips with micro-expression labels. Formally, given a training video set $V = \{v_1, v_2,..., v_N\}$, by dividing each video into clips, we obtain a training set $C = \{v_i^j\}$. The annotation set is $L=\{l_i^j\}$, $i\in[1,N]$ denotes the video id, the superscript $j\in[1,n_i]$ denotes the clip id +, $n_i$ is the number of clips for video $i$ and the duration of $v_i^j$ is a constant (4 seconds in our implementation). The dimension of $l_i^j$ is the number of micro-expressions. Then we train a set of micro-expression classifiers using the clips $C$, and apply the classifiers on test video clips $\tilde{C}$ to generate the predicted score $\tilde{L} = \{\tilde{l}_i^j\}$. These score vectors are pooled by averaging them over all clips in a video to produce a video score vector. +\subsection{Deception Detection} +The Fisher vector encoding of the low level features and the video level score vector are then used to train four binary deception classifiers. Three of those classifiers are based on the visual, auditory and text channels for which GMM's were constructed, and the fourth uses the pooled score vectors for the micro-expression detectors. Denote the prediction score of the multi-modal Fisher Vector and the high-level micro-expression feature as $\{S_{m_i}\}, i\in[1,3]$ and $S_{high}$. The final deception score $S$ is obtained by late fusion, given by: +\begin{equation} +S = \sum_{i} {\alpha_iS_{m_i}} + \alpha_{high}S_{high} +\end{equation} +where $\alpha_i, \alpha_{high} > 0$ and $\sum_{i=1}^4\alpha_i + \alpha_{high} = 1$. The values of $\alpha_i$ and $\alpha_{high}$ are obtained by cross validation. +\section{Experiments and Results} + +\subsection{Dataset} +We evaluate our automated deception detection approach on a real-life deception detection database~\cite{perez2015deception}. This database consists of 121 court room trial video clips. +Videos in this trial database are unconstrained videos from the web. Thus, we need to handle differences in the viewing angle of the person, variation in video quality and background noise, as shown in Figure.~\ref{fig:dataset}. + + \begin{figure}[t!] + \centering + \includegraphics[width=1\linewidth]{Dataset2.png} +\caption{Video Samples in the Real-life Trial Deception Database depicting the variation in human face size, pose and illumination.} + \label{fig:dataset} +\end{figure} + +We use a subset of 104 videos from the trial database of 121 videos, including 50 truthful videos and 54 deceptive videos. The pruned videos have either significant scene change or human editing. In the experiments shown below, we do not report the results, as described in ~\cite{perez2015deception}. Instead, we re-implement the method (referred to Ground Truth micro-expressions) on our training and test splits to avoid over fitting to identities rather than deception clues. + +The dataset contains only 58 identities, which is less than the number of videos and often the same identity is either uniformly deceptive or truthful. This means a deception detection method may simply degenerate to person re-idetification, if videos of the same person were included in both the training and test splits. To avoid this problem, we perform 10-fold cross validation using identities instead of video samples for all the following experiments, i.e. no identity in the test set belongs to the training set. + + +\begin{table}[t!] +\centering +\begin{tabular}{|c|c|} + \hline + Micro-Expression & IDT+FV\\ + \hline\hline + Eyebrows Frown& 0.6437 \\ + Eyebrows Raise & 0.6633\\ + Lips Up & 0.4791\\ + Lips Protruded & 0.7512\\ + Head Side Turn & 0.7180\\ + \hline + Mean & 0.6511\\ + \hline +\end{tabular} +\caption{Micro-Expression Detector Performance} +\label{tab:ges} +\end{table} + +\begin{table*}[h] +\centering +\begin{tabular}{|c|c|c|c|c|c|c|c|c|} +\hline +Features & L-SVM & K-SVM & NB & DT & RF & LR & Adaboost\\ +\hline\hline +IDT & 0.7731 & 0.6374 & 0.5984 & 0.5895 & 0.5567 & 0.6425 & 0.6591\\ +\hline +MicroExpression & 0.7502 & 0.7540 & 0.7629 & 0.7269 & 0.8064 & 0.7398 & 0.7507\\ +\hline +Transcript & 0.6457 & 0.4667 & 0.6625 & 0.5251 & 0.6172 & 0.5643 & 0.6416\\ +\hline +MFCC & 0.7694 & 0.8171 & 0.6726 & 0.4369 & 0.7393 & 0.6683 & 0.6900\\ +\hline\hline +IDT+MicroExpression & 0.8347 & 0.7540 & 0.7629 & 0.7687 & 0.8184 & 0.7419 & 0.7507\\ +\hline +IDT+MicroExpression+Transcripts & 0.8347 & 0.7540 & 0.7776 & 0.7777 & 0.8184 & 0.7419 & 0.7507\\ +\hline +IDT+MicroExpression+MFCC & 0.8596 & 0.8233 & 0.7629 & 0.7687 & 0.8477 & 0.7894 & 0.7899 \\ +\hline +All Modalities & \textbf{0.8773} & 0.8233 & 0.7776 & 0.7777 & 0.8477 & 0.7894 & 0.7899\\ +\hline +\end{tabular} +\caption{Deception Detection results using different feature and classifier combinations. First 4 rows are results of independent features. Last 4 rows are late fusion results of multi-modal features.} +\label{tab:res} +\end{table*} + + +\begin{table*}[h] +\centering +\begin{tabular}{|c|c|c|c|c|c|c|c|c|} +\hline +Features & L-SVM & K-SVM & NB & DT & RF & LR & Adaboost\\ +\hline\hline +GTMicroExpression & 0.7964 & 0.8102 & 0.8325 & 0.7731 & 0.8151 & 0.8275 & 0.8270\\ +\hline +GTMicroExpression+IDT & 0.8456 & 0.8137 & 0.8468 & 0.7834 & 0.8205 & 0.8988 & 0.8270\\ +\hline +GTMicroExpression+IDT+Transcript & 0.8594 & 0.8137 & 0.8923 & 0.8074 & 0.8205 & 0.8988 & 0.8270\\ +\hline +GTMicroExpression+IDT+MFCC & 0.8969 & 0.9002 & 0.8668 & 0.7834 & 0.8319 & 0.9221 & 0.8320\\ +\hline +GTMicroExpression+All Modalities& 0.9065 & 0.9002 & 0.8905 & 0.8074 & 0.8731 & \textbf{0.9221} & 0.8321\\ +\hline +\end{tabular} +\caption{Deception Detection results with Ground Truth micro-expression features and other feature modalities.} +\label{tab:resGT} +\end{table*} +\subsection{Micro-Expression Prediction} +We first analyze the performance our micro-expression prediction module. We sample frames for each video clip using a frame rate of 15 fps. The motion features are Improved Dense Trajectories which are represented with a Fisher Vector encoding. The micro-expression detectors are trained using a linear kernel SVM using LibSVM~\cite{chang2011libsvm}. The results are shown in Table.~\ref{tab:ges}, and we report AUC (Area under the precision-recall curve). We will show in the following experiments that even though an AUC of 0.6511 is not high for detecting micro-expressions, the high-level features representing the probability of micro-expressions still provide good performance on the final deception detection task. We believe deep learning based approaches could perform better at predicting micro-expressions; however, with the limited amount of training data available in this dataset, it is problematic to train such techniques. We did experiment with off-the-shelf CNN features for classifying micro-expressions, but their performance was significantly worse than IDT. +\subsection{Deception Detection} +We now evaluate our automated deception detection system. We first test four individual features: IDT (Improved Debse Trajectory), high-level micro-expression scores, verbal features and MFCC audio features. Then we test different combinations of multi-modal features. To test the reliability and robustness of the features, we use several widely used binary classifiers in our experiments, which are Linear SVM, Kernel SVM, Naive Bayes, Decision Trees, Random Forests, Logistic Regression and Adaboost. We use a polynomial kernel for Kernel SVM because it performs best. For Naive Bayes classifier, we use normal distributions and remove the feature dimensions which have zero variance before fitting. For logistic regression, we use Binomial distribution. In Random Forest, the number of trees is 50. +In Adaboost, we use decision trees as the weak learners. All experiments are conducted using 10-fold cross validation across different feature sets and classifiers. + +The results, measured by AUC, are shown in Table.~\ref{tab:res}. The first 4 rows are results from one modality, while the last 4 rows are after late fusion of multi-modal features. Each column corresponds to one type of classifier. We can see the highest AUC (0.8773) is after late fusion, which uses all modality features and a linear SVM classifier. This performance is much better than using Ground Truth micro-expression features (0.8325). +\subsubsection{Performance of Different Classifiers} +SVM and Random Forest perform better compared to other classifiers like Naive Bayes and Logistic Regression because they are discriminative. One interesting finding is that different classifiers are good at utilizing different feature modalities. For example, we observe that linear SVM works best on IDT features, Random Forest works best on high-level micro-expression features and Kernel SVM performs best on MFCC features. However, when we aggregate multi-modal features using late fusion, the performance of different classifiers converges. +\subsubsection{Performance of Different Modalities} +We observe that IDT features obtain an AUC of 0.7731. Although the proposed high-level micro-expression features could not accurately predict micro-expressions, they help in improving deception detection. MFCC features obtain the highest AUC using a single modality, showing the importance of audio features in the deception detection task. +The transcript feature obtains the lowest performance, mainly because the pre-trained word vector representation does not capture the underlying complicated verbal deception cues. Nevertheless, the entire system still benefits from the transcript features after late fusion. +\subsubsection{Analysis of Late Fusion} +Although the performance of different modalities are different for each classifier, the overall performance improves when we combine different modalities. Combining the scores of the classifier trained on IDT features with the classifier trained on micro-expression predictions helps us obtain an AUC of 0.8347, which is the performance of visual modality. Thus, even though the micro-expression detectors are trained using IDT features, the low-level and high-level classifiers are complementary. Other modalities like text and audio improve performance by $4\%$ for the overall system. +\subsection{Deception Detection with Ground Truth Micro-Expressions} +Since the high-level feature is the prediction score of trained micro-expression detectors, one interesting question is how the performance will be affected if we use the Ground Truth micro-expression features, as in ~\cite{perez2015deception}. In the following experiment, we use the GT micro-expression feature as the baseline, and test how the performance changes with other feature modalities. Table.~\ref{tab:resGT} shows the results, measured by AUC. Note that we re-ran this study because we do not use the same identity in the training and test splits. + +From Table.~\ref{tab:res}, we observe that the performance of GTMicroExpression~\cite{perez2015deception} alone is better than high-level micro-expression features (which is the confidence score of the micro-expression classifier). With the addition of IDT features, our vision system improves by more than $5\%$ (0.8988 AUC). This proves the effectiveness of motion-based features. After late fusion with results of transcript and MFCC features, the performance of the overall system is 0.9221 AUC, which is better than the proposed fully automated system. This suggests that developing more accurate methods for detecting micro-expressions is a potential direction for improving deception detection in the future. + +\begin{figure}[h!] +\begin{subfigure}{.47\textwidth} + \centering + \includegraphics[width=0.95\linewidth]{unary_pred.png} + \caption{Predicted Micro-Expressions} + \label{fig:unary_pred} +\end{subfigure}% +\\ +\begin{subfigure}{.47\textwidth} + \centering + \includegraphics[width=0.95\linewidth]{unary_gt.png} + \caption{Ground Truth Micro-Expressions} + \label{fig:unary_gt} +\end{subfigure} +\caption{Analysis of predicted micro-expressions and Ground truth micro-expressions. Each group depicts the performance with only that micro-expression. The performance of using all micro-expressions is shown in the rightmost group.} +\label{fig:unary} +\end{figure} +\subsection{Analysis of Micro-Expressions} +We investigate the effectiveness of each individual micro-expression. + +For each micro-expression, we test the performance by using the high-level micro-expression score feature, with low level motion features and other modalities, shown in Figure.~\ref{fig:unary}. +The performance of using all micro-expressions is shown for comparison. We use linear SVM as the classifier in this study, as it was the best individual classifier. +From Figure.~\ref{fig:unary}, we observe that ``Eyebrows Raise'' is more effective than other micro-expressions in both predicted micro-expressions and ground truth micro-expressions. ``Head Side Turn'' is also helpful when using predicted micro-expressions, see Figure.~\ref{fig:unary_pred}. This is different from results obtained from ground truth micro-expressions. +On the other hand, ``Frown'' works better using ground truth feature than predicted feature, possibly because the ``Frown'' detector is not accurate enough, as also suggested in Table.~\ref{tab:ges}. +\subsection{User Study} +To test human performance on this task, we perform user studies using AMT (Amazon Mechanical Turk). First, we ask 10 different people to watch each video and decide if they consider the subject in the video truthful or not. Each annotator is assigned 5 videos of 5 different identities to ensure no identity specific bias is used for deceit prediction. We also record if image, audio or transcripts were helpful for their decision. Note that here the decision is made using all modalities. The percentage of votes per video is used as the score for deception. The AUC for human prediction is 0.8102. This shows that this dataset is relatively easier than previous studies where predictions of people on this task were almost chance. Nevertheless, even on this dataset, it is not obvious if the subject is deceptive or not. + +When making the decision, $67.4\%$ of the time users rely on visual cues, $61.3\%$ of the time on audio, and $70.7\%$ of the time on transcripts, as shown in Figure.~\ref{fig:AMT}. Note that for each video, people can select multiple modalities as helpful. From this data, we notice that people tend to make decisions based on spoken content, as this is a semantic-level feature. +Only half of the people think that audio helps them making decision, while in our system, audio features are very effective. Therefore, we conducted another user study where we only show one modality at a time to each individual user because when multiple sources of information are available simultaneously, it is not easy to tell which source was helpful for making the final decision. + + +To test human performance on each modality, we ask 5 people to watch each video without sound, 5 people to listen to the audio and 5 people to read the transcripts of the video. Therefore in each study, subjects have access to one modality only. Note that the same person is not shown any other modality from the same video again after being shown one modality. +The results shown in Figure.~\ref{fig:AMT2} are of our system using linear SVM as classifier along with human performance. We can see that with only visual modality, there is a huge performance gap between human performance and our system. This shows that although humans lack the ability of predicting deceptive behavior with visual cues alone, our computer vision based system is significantly better. +On the other hand, with only audio, human performance is as good as when all modalities are accessible. But when only transcripts of videos are provided, the performance drops significantly both for humans and our system. This suggests that audio information plays an essential role for humans for predicting deceptive behavior, while transcripts are not that beneficial. +With all modalities, our automated system is about $7\%$ better compared to an average person, while our system with Ground Truth micro-expressions is about $11\%$ better. + +For future work, we believe better models for representing audio would be a promising direction for improving performance of our system. In addition, designing hybrid human-computer systems might be very important for developing a robust and accurate deception detection system. + + + \begin{figure}[t!] + \centering + \includegraphics[width=0.9\linewidth]{AMT1.png} +\caption{The importance of modalities for humans in making decisions.} + \label{fig:AMT} +\end{figure} + + + \begin{figure}[t!] + \centering + \includegraphics[width=1\linewidth]{AMT2.png} +\caption{Human performance in deception detection using different modalities is compared with our automated system and our system with Ground Truth micro-expressions.} + \label{fig:AMT2} +\end{figure} +\section{Conclusion} +A system for covert automatic deception detection using multi-modal information in a video was presented. We demonstrated that deception can be predicted independent of the identity of the person. Our vision system, which uses both high-level and low level visual features, is significantly better at predicting deception compared to humans. When complementary information from audio and transcripts is provided, deception prediction can be further improved. These claims are true over a variety of classifiers verifying the robustness of our system. To understand how humans predict deception using individual modalities, results of a user study were also presented. As part of future work, we believe collecting more data for this task would be fruitful as more powerful deep learning techniques can be employed. Predicting deception in a multi-agent setting using information available in video would be a promising future direction as the system would need to understand the conversation between identities over time and then arrive at a logical conclusion. +\section{Acknowlegement} +This research was funded by ARO Grant W911NF1610342. We would like to thank Srijan Kumar for helpful discussions during this project. + +\bibliographystyle{aaai}\bibliography{reference.bib} diff --git a/1712.04616v1.txt b/1712.04616v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..17216926d1021ccd2f2517ee87a30df3f4810ac6 --- /dev/null +++ b/1712.04616v1.txt @@ -0,0 +1,316 @@ +\section{Introduction} +With increasing large-scale and high-dimensional image data emerging in search engines and social networks, image retrieval has attracted increasing attention in computer vision community. Approximate nearest neighbors (ANN) search is an important method for image retrieval. Parallel to the traditional indexing methods \cite{cite:TOMM06CBIR}, another advantageous solution is hashing methods \cite{cite:Arxiv14HashSurvey}, which transform high-dimensional image data into compact binary codes and generate similar binary codes for similar data items. In this paper, we will focus on data-dependent hash encoding schemes for efficient image retrieval, which have shown better performance than data-independent hashing methods, e.g. Locality-Sensitive Hashing (LSH) \cite{cite:VLDB99LSH}. + +There are two related search problems in hashing~\cite{cite:TPAMI14FES}, $K$-NN search and Point Location in Equal Balls (PLEB)~\cite{cite:STOC98ANN}. Given a database of hash codes, $K$-NN search aims to find $K$ codes in database that are closest in Hamming distance to a given query. With the Definition that a binary code is an $r$-$neighbor$ of a query code $q$ if it differs from $q$ in $r$ bits or less, PLEB for $r$ Equal Ball finds all $r$-$neighbors$ of a query in the database. This paper will focus on PLEB search which we call Hamming Space Retrieval. + +For binary codes of $b$ bits, the number of distinct hash buckets to examine is $N\left({b,r} \right) = \sum\nolimits_{k = 0}^r {\left({_k^b} \right)}$. $N\left({b,r} \right)$ grows rapidly with $r$ and when $r\le2$, it only requires $O(1)$ time for each query to find all $r$-$neighbors$. Therefore, the search efficiency and quality within Hamming Radius 2 is an important technical backbone of hashing. + +Previous image hashing methods~\cite{cite:NIPS09BRE,cite:CVPR11ITQ,cite:ICML11MLH,cite:CVPR12MIH,cite:CVPR12KSH,cite:TPAMI12SSH,cite:CVPR13HBS,cite:CVPR13BP,cite:ICML14CBE,cite:SIGIR14LFH,cite:CVPR14CH,cite:AAAI14CNNH,cite:CVPR15DNNH,cite:CVPR15SDH,cite:CVPR15DH,cite:AAAI16DHN,cite:AAAI16DQN,cite:IJCAI16DPSH,cite:CVPR2016DSH,cite:ICCV17HashNet} have achieved promising image retrieval performance. However, they all require that the source domain and the target domain are the same, under which they can directly apply the model trained on train images to database images. Many real-world applications actually violate this assumption where source and target domain are different. For example, one person want to build a search engine on real-world images, but unfortunately, he/she only has images rendered from 3D model with known similarity and real-world images without any supervised similarity. Thus, a method for the transfer setting is needed. + +The transfer retrieval setting can raise two problems. The first is that the similar points of a query within its Hamming Radius 2 Ball will deviate more from the query. As shown in Figure~\ref{fig:dhn_same}, the red points similar to black query in the orange Hamming Ball (Hamming Radius 2 Ball) of the source domain scatter more sparsely in a blue larger Hamming Ball of the target domain in Figure~\ref{fig:dhn_transfer}, indicating that the number of similar points within Hamming Radius 2 decreases because of the domain gap. This can be validated in Table~\ref{table:problem_table} by the decreasing of average number of similar points of DHN from $1450$ on $synthetic \rightarrow synthetic$ task to $58$ on $real \rightarrow synthetic$ task. Thus, we propose a new similarity function based on $t$-distribution and Hamming distance, denoted as $t$-Transfer in Figure~\ref{fig:problem} and Table~\ref{table:problem_table}. From Figure~\ref{fig:dhn_transfer}-\ref{fig:t_transfer} and Table~\ref{table:problem_table}, we can observe that our proposed similarity function can draw similar points closer and let them locate in the Hamming Radius 2 Ball of the query. + +\begin{table}[tbp] + \centering + \addtolength{\tabcolsep}{0pt} + \vspace{-10pt} + \caption{Average Number of Similar Points within Hamming Radius 2 of each query on $synthetic \rightarrow synthetic$ and $real \rightarrow synthetic$ tasks in VisDA2017 dataset.} + \label{table:problem_table} + \begin{tabular}{c|c|c|c} + \Xhline{1.0pt} + Task & DHN & DHN-Transfer & $t$-Transfer \\ + \hline + \#Similar Points & 1450 & 58 & 620 \\ + \Xhline{1.0pt} + \end{tabular} +\end{table} + +\begin{figure}[tbp] + \centering + \subfigure[DHN]{ + \includegraphics[width=0.13\textwidth]{problem1.pdf} + \label{fig:dhn_same} + } + \subfigure[DHN-Transfer]{ + \includegraphics[width=0.13\textwidth]{problem2.pdf} + \label{fig:dhn_transfer} + } + \subfigure[$t$-Transfer]{ + \includegraphics[width=0.13\textwidth]{problem3.pdf} + \label{fig:t_transfer} + } + \vspace{-10pt} + \caption{Visualization of similar points within Hamming Radius 2 of a query.} + \label{fig:problem} + \vspace{-10pt} +\end{figure} + +The second problem is that substantial gap across Hamming spaces exists between source domain and target domain since they follow different distributions. We need to close this distribution gap. This paper exploits adversarial learning~\cite{cite:ICML15RevGrad} to align the distributions of source domain and target domain, to adapt the hashing model trained on source domain to target domain. With this domain distribution alignment, we can apply the hashing model trained on source domain to the target domain. + +In all, this paper proposes a novel Transfer Adversarial Hashing (TAH) approach to the transfer setting for image retrieval. With similarity relationship learning and domain distribution alignment, we can align different domains in Hamming space and concentrate the hash codes to be within a small Hamming ball in an end-to-end deep architecture to enable efficient image retrieval within Hamming Radius 2. Extensive experiments show that TAH yields state of the art performance on public benchmarks NUS-WIDE and VisDA2017. +\section{Related Work} +Our work is related to learning to hash methods for image retrieval, which can be organized into two categories: unsupervised hashing and supervised hashing. We refer readers to \cite{cite:Arxiv14HashSurvey} for a comprehensive survey. + +Unsupervised hashing methods learn hash functions that encode data points to binary codes by training from unlabeled data. Typical learning criteria include reconstruction error minimization \cite{cite:AI07SemanticHashing,cite:CVPR11ITQ,cite:TPAMI11PQ} and graph learning\cite{cite:NIPS09SH,cite:ICML11AGH}. While unsupervised methods are more general and can be trained without semantic labels or relevance information, they are subject to the semantic gap dilemma \cite{cite:TPAMI00SemanticGap} that high-level semantic description of an object differs from low-level feature descriptors. Supervised methods can incorporate semantic labels or relevance information to mitigate the semantic gap and improve the hashing quality significantly. +Typical supervised methods include Binary Reconstruction Embedding (BRE) \cite{cite:NIPS09BRE}, Minimal Loss Hashing (MLH) \cite{cite:ICML11MLH} and Hamming Distance Metric Learning \cite{cite:NIPS12HDML}. +Supervised Hashing with Kernels (KSH) \cite{cite:CVPR12KSH} generates hash codes by minimizing the Hamming distances across similar pairs and maximizing the Hamming distances across dissimilar pairs. + +As various deep convolutional neural networks (CNN) \cite{cite:NIPS12CNN,cite:CVPR16DRL} yield breakthrough performance on many computer vision tasks, deep learning to hash has attracted attention recently. CNNH \cite{cite:AAAI14CNNH} adopts a two-stage strategy in which the first stage learns hash codes and the second stage learns a deep network to map input images to the hash codes. DNNH \cite{cite:CVPR15DNNH} improved the two-stage CNNH with a simultaneous feature learning and hash coding pipeline such that representations and hash codes can be optimized in a joint learning process. DHN \cite{cite:AAAI16DHN} further improves DNNH by a cross-entropy loss and a quantization loss which preserve the pairwise similarity and control the quantization error simultaneously. HashNet \cite{cite:ICCV17HashNet} attack the ill-posed gradient problem of sign by continuation, which directly optimized the sign function. HashNet obtains state-of-the-art performance on several benchmarks. + +However, prior hash methods perform not so good within Hamming Radius 2 since their loss penalize little on small Hamming distance. And they suffer from large distribution gap between domains under the transfer setting. DVSH~\cite{cite:KDD16DVSH} and PRDH~\cite{cite:AAAI17PRDH} integrate different types of pairwise constraints to encourage the similarities of the hash codes from an intra-modal view and an inter-modal view, with additional decorrelation constraints for enhancing the discriminative ability of each hash bit. +THN~\cite{cite:AAAI17THN} aligns the distribution of database domain with auxiliary domain by minimize the Maximum Mean Discrepancy (MMD) of hash codes in Hamming Space, which fits the transfer setting. + +However, adversarial learning has been applied to transfer learning~\cite{cite:ICML15RevGrad} and achieves the state of the art performance. Thus, the proposed Transfer Adversarial Hashing addresses distribution gap between source and target domain by adversarial learning. With similarity relationship learning designed for searching in Hamming Radius 2 and adversarial learning for domain distribution alignment, TAH can solve the transfer setting for image retrieval efficiently and effectively. + +\begin{figure*}[tbp] + \centering + \includegraphics[width=0.8\textwidth]{TAHfig.pdf} + \vspace{-10pt} + \caption{The architecture of transfer adversarial hashing (TAH), which consists of three modules: similarity relationship learning (green), domain distribution alignment (orange), and quantization error minimization (pink).} + \label{fig:TAH} + \vspace{-10pt} +\end{figure*} +\section{Transfer Adversarial Hashing} +In transfer retrieval setting, we are given a database ${\cal Y} = \{ {\bm y}_k\}_{k=1}^m$ from target domain $Y$ and a training set ${\cal X} = \{ {\bm x}_i\}_{i=1}^{n}$ from source domain $X$, where ${\bm x}_i,{\bm y}_k \in \mathcal{\bm{R}}^{d}$ are $d$-dimensional feature vectors. The key challenge of transfer hashing is that no supervised relationship is available between database points. Hence, we build a hashing model for the database of target domain $Y$ by learning from a training dataset ${\cal X} = \{ {\bm x}_i\}_{i=1}^{n}$ available in a different but related source domain $X$, which consists of similarity relationship $\mathcal{S} = \{ s_{ij}\}$, where $s_{ij} = 1$ implies points ${{\bm x}}_i$ and ${{\bm x}}_j$ are similar while $s_{ij} = 0$ indicates points ${{\bm x}}_i$ and ${{\bm x}}_j$ are dissimilar. In real image retrieval applications, the similarity relationship ${\cal S}=\{s_{ij}\}$ can be constructed from the semantic labels among the data points or the relevance feedback from click-through data in online image retrieval systems. + +The goal of Transfer Adversarial Hashing (TAH) is to learn a hash function $f :\mathbb{R}^{d} \to \{ -1,1\}^b$ encoding data points $x$ and $y$ from domains $X$ and $Y$ into compact $b$-bit hash codes ${\bm h^x} = f({\bm x})$ and ${\bm h^y} = f({\bm y})$, such that both ground truth similarity relationship ${\cal S}$ for domain $X$ and the unknown similarity relationship ${\cal S'}$ for domain $Y$ can be preserved. With the learned hash function, we can generate hash codes ${\cal H}^x=\{{\bm h}_i^x\}_{i=1}^n$ and ${\cal H}^y=\{{\bm h}_k^y\}_{k=1}^m$ for the training set and database respectively, which enables image retrieval in the Hamming space through ranking the Hamming distances between hash codes of the query and database points. +\subsection{The Overall Architecture} +The architecture for learning the transfer hash function is shown in Figure~\ref{fig:TAH}, which is a hybrid deep architecture of a deep hashing network and a domain adversarial network. In the deep hashing network $G_f$, we extend AlexNet \cite{cite:NIPS12CNN}, a deep convolutional neural network (CNN) comprised of five convolutional layers $conv1$--$conv5$ and three fully connected layers $fc6$--$fc8$. We replace the $fc8$ layer with a new $fch$ hash layer with $b$ hidden units, which transforms the network activation ${\bm z}_i^x$ in $b$-bit hash code by sign thresholding ${\bm h}^x_{i} = \operatorname{sgn} ({\bm z}_i^{x})$. Since it is hard to optimize sign function for its ill-posed gradient, we adopt the hyperbolic tangent (tanh) function to squash the activations to be within $[-1,1]$, which reduces the gap between the $fch$-layer representation ${\bm z}_i^{\ast}$ and the binary hash codes ${\bm h}_i^{\ast}$, where $\ast\in\{x,y\}$. And a pairwise $t$-distribution cross-entropy loss and a pairwise quantization loss are imposed on the hash codes. In domain adversarial network $G_d$, we use the Multilayer Perceptrons (MLP) architecture adopted by~\cite{cite:ICML15RevGrad}. It accepts as inputs the hash codes generated by the deep hashing network $G_f$ and consists of three fully connected layers, with the numbers of units being $(b,1024,1024,1)$. +The last layer of $G_d$ output the probability of the input data belonging to a specific domain. And a cross-entropy loss is added on the output of the adversarial network. This hybrid deep network can achieve hash function learning through similarity relationship preservation and domain distribution alignment simultaneously, which enables image retrieval from the database in the target domain. +\subsection{Hash Function Learning} +To perform deep learning to hash from image data, we jointly preserve similarity relationship information underlying pairwise images and generate binary hash codes by Maximum A Posterior (MAP) estimation. + +Given the set of pairwise similarity labels $\mathcal{S} = \{s_{ij}\}$, the logarithm Maximum a Posteriori (MAP) estimation of training hash codes ${\bm H}^x = [{\bm h}_1^x,\ldots,{\bm h}_{n}^x]$ can be defined as +\begin{equation}\label{eqn:MAP} + \small + \begin{aligned} + \log p\left({{\bm{H}^x}|\mathcal{S}} \right) &\propto \log p\left({\mathcal{S}|{\bm{H}^x}} \right) p\left({{{\bm{H}}^x}} \right) \\ + &= \sum\limits_{{s_{ij}} \in \mathcal{S}} {\log p\left({{s_{ij}}|{{\bm{h}}_i^x},{{\bm{h}}_j^x}} \right)p\left({{{\bm{h}}_i^x}} \right)p\left({{{\bm{h}}_j^x}} \right)} , + \end{aligned} + \normalsize +\end{equation} +where $p({\cal S}|{\bm H}^x)$ is likelihood function, and $p({{\bm H}}^x)$ is prior distribution. For each pair of points ${\bm x}_i$ and ${\bm x}_j$, $p(s_{ij}|{\bm h}_i^x,{\bm h}_j^x)$ is the conditional probability of their relationship $s_{ij}$ given their hash codes ${\bm h}_i^x$ and ${\bm h}_j^x$, which can be defined using the pairwise logistic function, + \begin{equation}\label{eqn:CDF} + \begin{aligned} + & p \left({{s_{ij}}|{{\bm h}_i^x},{{\bm h}_j^x}} \right) = + \begin{cases} + \sigma \left( \text{sim} \left({\bm h}_i^x, {\bm h}_j^x \right) \right), & {s_{ij}} = 1 \\ + 1 - \sigma \left( \text{sim} \left({\bm h}_i^x, {\bm h}_j^x \right) \right), & {s_{ij}} = 0 \\ + \end{cases} \\ + & = \sigma{\left( \text{sim} \left({\bm h}_i^x, {\bm h}_j^x \right) \right)^{{s_{ij}}}}{\left({1 - \sigma \left( \text{sim} \left({\bm h}_i^x, {\bm h}_j^x \right) \right)} \right)^{1 - {s_{ij}}}}, + \end{aligned} + \normalsize +\end{equation} +where $\text{sim} \left({\bm h}_i^x, {\bm h}_j^x \right)$ is the similarity function of code pairs ${\bm h}_i^x$ and ${\bm h}_j^x$ and $\sigma \left( x \right)$ is the probability function. Previous methods~\cite{cite:AAAI16DHN,cite:ICCV17HashNet} usually adopt inner product function $\left\langle{\bm h}_i^x, {\bm h}_j^x \right\rangle $ as similarity function and $\sigma \left( x \right) = {1}/({{1 + {e^{ - \alpha x}}}})$ as probability function. However, from Figure~\ref{fig:formula}, we can observe that the probability corresponds to these similarity function and probability function stays high when the Hamming distance between codes is larger than 2 and only starts to decrease when the Hamming distance becomes close to $b/2$ where $b$ is the number of hash bits. This means that previous methods cannot force the Hamming distance between codes of similar data points to be smaller than 2 since the probability cannot discriminate different Hamming distances smaller than $b/2$ sufficiently. + +\begin{figure}[!tbp] + \centering + \subfigure[Probability]{ + \includegraphics[width=0.22\textwidth]{compare.pdf} + \label{fig:formula_probability} + } + \subfigure[Loss Value]{ + \includegraphics[width=0.22\textwidth]{compare1.pdf} + \label{fig:formula_loss} + } + \caption{Probability (a) and Loss value (b) w.r.t Hamming Distance between codes for similar data points.} + \label{fig:formula} +\end{figure} + +To tackle the above mis-specification of the inner product, we proposes a new similarity function inspiring by the success of $t$-distribution with one degree of freedom for modeling long-tail dataset, +\begin{equation} + \text{sim} \left({\bm h}_i^x, {\bm h}_j^x \right) = \frac{b}{1+\left\lVert{{\bm h}_i^x-{\bm h}_j^x} \right\rVert^2 }, +\end{equation} +and the corresponding probability function is defined as $\sigma \left( x \right) = \tanh \left(\alpha x \right)$. Similar to previous methods, these functions also satisfy that the smaller the Hamming distance ${\text{dis}}{{\textrm{t}}_H}( {{{\bm{h}}_i^x},{{\bm{h}}_j^x}} )$ is, the larger the similarity function value $\text{sim} \left({\bm h}_i^x, {\bm h}_j^x \right)$ will be, and the larger $p( {1|{{\bm{h}}_i^x},{{\bm{h}}_j^x}} )$ will be, implying that pair ${\bm h}_i^x$ and ${\bm h}_j^x$ should be classified as ``similar''; otherwise, the larger $p( {0|{{\bm{h}}_i^x},{{\bm{h}}_j^x}} )$ will be, implying that pair ${\bm h}_i^x$ and ${\bm h}_j^x$ should be classified as ``dissimilar''. Furthermore, from Figure~\ref{fig:formula}, we can observe that our probability w.r.t Hamming distance between code pairs decreases significantly when the Hamming distance is larger that $2$, indicating that our loss function will penalize Hamming distance larger than $2$ for similar codes much more than previous methods. Thus, our similarity function and probability function perform better for search within Hamming Radius $2$. Hence, Equation~\eqref{eqn:CDF} is a reasonable extension of the logistic regression classifier which optimizes the performance of searching within Hamming Radius 2 of a query. + +Similar to previous work~\cite{cite:AAAI14CNNH,cite:CVPR15DNNH,cite:AAAI16DHN}, defining that ${\bm h}_i^x = \operatorname{sgn}({{\bm z}_i^x})$ where ${\bm z}_i^x$ is the activation of hash layer, we relax binary codes to continuous codes since discrete optimization of Equation~\eqref{eqn:MAP} with binary constraints is difficult and adopt a quantization loss function to control quantization error. Specifically, we adopt the prior for quantization of~\cite{cite:AAAI16DHN} as +\begin{equation} +p\left({{\bm z}_i^x} \right) = \frac{1}{{2\varepsilon }}\exp \left({ - \frac{\|{|{\bm z_i^x}| - {\bm 1}}\|_1}{\varepsilon }} \right)\ +\label{eqn:prior} +\end{equation} +where $\varepsilon$ is the parameter of the exponential distribution. + +By substituting Equations \eqref{eqn:CDF} and \eqref{eqn:prior} into the MAP estimation in Equation~\eqref{eqn:MAP}, we achieve the optimization problem for similarity hash function learning as follows, +\begin{equation}\label{eqn:HRL} +\mathop{\min }\limits_\Theta J = L + \lambda Q, \\ +\end{equation} +where $\lambda$ is the trade-off parameter between pairwise cross-entropy loss $L$ and pairwise quantization loss $Q$, and $\Theta$ is a set of network parameters. Specifically, loss $L$ is defined as +\begin{equation}\label{eqn:heteoL} +\begin{aligned}{L} & = \sum\limits_{s_{ij}\in{\cal S}} \log \left( \frac{2}{1+\exp \left(2\alpha \frac{b}{1+\left\lVert{{\bm z}_i^x-{\bm z}_j^x} \right\rVert_2 } \right)} \right) \\ + &+ {s_{ij}} \log \left( \frac{\exp \left(2\alpha \frac{b}{1+\left\lVert{{\bm z}_i^x-{\bm z}_j^x} \right\rVert_2 } \right) -1}{2} \right). +\end{aligned} +\end{equation} +Similarly the pairwise quantization loss $Q$ can be derived as +\begin{equation}\label{eqn:Q} + Q = \sum\limits_{{s_{ij}} \in \mathcal{S}} {\left({{{\left\| {\left|{{\bm{z}}_i^x} \right| - {\bm{1}}} \right\|}_1} + {{\left\| {\left|{{\bm{z}}_j^x} \right| - {\bm{1}}} \right\|}_1}} \right)} , +\end{equation} +where ${\bm 1} \in \mathbb{R}^K$ is the vector of ones. +By the MAP estimation in Equation \eqref{eqn:HRL}, we can simultaneously preserve the similarity relationship and control the quantization error of binarizing continuous activations to binary codes in source domain. +\subsection{Domain Distribution Alignment} +The goal of transfer hashing is to train the model on data of source domain and perform efficient retrieval from the database of target domain in response to the query of target domain. Since there is no relationship between the database points, we exploit the training data ${{\cal X}}$ to learn the relationship among the database points. However, there is large distribution gap between the source domain and the target domain. Therefore, we should further reduce the distribution gap between the source domain and the target domain in the Hamming space. + +Domain adversarial networks have been successfully applied to transfer learning~\cite{cite:ICML15RevGrad} by extracting transferable features that can reduce the distribution shift between the source domain and the target domain. Therefore, in this paper, we reduce the distribution shifts between the source domain and the target domain by adversarial learning. The adversarial learning procedure is a two-player game, where the first player is the domain discriminator $G_d$ trained to distinguish the source domain from the target domain, and the second player is the base hashing network $G_f$ fine-tuned simultaneously to confuse the domain discriminator. + +To extract domain-invariant hash codes $\bm{h}$, the parameters $\theta_f$ of deep hashing network $G_f$ are learned by maximizing the loss of domain discriminator $G_d$, while the parameters $\theta_d$ of domain discriminator $G_d$ are learned by minimizing the loss of the domain discriminator. The objective of domain adversarial network is the functional: +\begin{equation}\label{eqn:GRL} + D \left({{\theta _f},{\theta _d}} \right) = \frac{1}{{{n} + {m}}}\sum\limits_{{{\bm{u}}_i} \in {{\cal X} \cup {\cal Y}}} {{L_d}\left({{G_d}\left({{G_f}\left({{{\bm{u}}_i}} \right)} \right),{d_i}} \right)} , +\end{equation} +where $L_d$ is the cross-entropy loss and $d_i$ is the domain label of data point $\bm{u}_i$. $d_i = 1$ means $\bm{u}_i$ belongs to target domain and $d_i = 0$ means $\bm{u}_i$ belongs to source domain. +Thus, we define the overall loss by integrating Equations \eqref{eqn:HRL} and \eqref{eqn:GRL}, +\begin{equation}\label{eqn:model} + C = J - \mu D, +\end{equation} +where $\mu$ is a trade-off parameter between the MAP loss $J$ and adversarial learning loss $D$. The optimization of this loss is as follows. After training convergence, the parameters $\hat\theta_f$ and $\hat\theta_d$ will deliver a saddle point of the functional~\eqref{eqn:model}: +\begin{equation}\label{eqn:param1} +\begin{gathered} + (\hat\theta_f) = \arg \mathop{\min }\limits_{{\theta _f}} C \left({{\theta _f},{\theta _d}} \right), \\ + (\hat\theta_d) = \arg \mathop{\max }\limits_{{\theta_d}} C \left({{\theta _f},{\theta _d}} \right). +\end{gathered} +\end{equation} +This mini-max problem can be trained end-to-end by back-propagation over all network branches in Figure~\ref{fig:TAH}, where the gradient of the adversarial loss $D$ is reversed and added to the gradient of the hashing loss $J$. +By optimizing the objective function in Equation~\eqref{eqn:model}, we can learn transfer hash codes which preserve the similarity relationship and align the domain distributions as well as control the quantization error of sign thresholding. Finally, we generate $b$-bit hash codes by sign thresholding as ${\bm h}^\ast = {\mathop{\rm sgn}} (\bm{z}^\ast)$, where ${\mathop{\rm sgn}} (\bm{z})$ is the sign function on vectors that for each dimension $i$ of $\bm{z}^\ast$, $k=1,2,...,b$, ${\mathop{\rm sgn}} (z_k^\ast)=1$ if $z_k^\ast > 0$, otherwise ${\mathop{\rm sgn}} (z_k^\ast)=-1$. Since the quantization error in Equation \eqref{eqn:model} has been minimized, this final binarization step will incur small loss of retrieval quality for transfer hashing. +\section{Experiments} +\label{section:Experiments} +We extensively evaluate the efficacy of the proposed TAH model against state of the art hashing methods on two benchmark datasets. The codes and configurations will be made available online. +\subsection{Setup} +\textbf{NUS-WIDE}\footnote{\scriptsize{\url{http://lms.comp.nus.edu.sg/research/NUS-WIDE.htm}}} is a popular dataset for cross-modal retrieval, which contains 269,648 image-text pairs. The annotation for 81 semantic categories is provided for evaluation. We follow +the settings in \cite{cite:AAAI16DHN,cite:ICML11AGH,cite:CVPR15DNNH} and use the +subset of 195,834 images that are associated with the 21 +most frequent concepts, where each concept consists of at +least 5,000 images. Each image is resized into $256 \times 256$ pixels. We follow similar experimental protocols as DHN \cite{cite:AAAI16DHN} and randomly sample 100 images per category as queries, with the remaining images used as the database; furthermore, we randomly sample 500 images per category (each image attached to one category in sampling) from the database as training points. + +\textbf{VisDA2017}\footnote{\scriptsize{\url{https://github.com/VisionLearningGroup/taskcv-2017-public/tree/master/classification}}} is a cross-domain image dataset of images rendered from CAD models as synthetic image domain and real object images cropped from the COCO dataset as real image domain. We perform two types of transfer retrieval tasks on the VisDA2017 dataset: (1) using real image query to retrieve real images where the training set consists of synthetic images (denoted by $synthetic \rightarrow real$); (2) using synthetic image query to retrieve synthetic images where the training set consists of real images (denoted by $real \rightarrow synthetic$). The relationship ${\cal S}$ for training and the ground-truth for evaluation are defined as follows: if an image $i$ and a image $j$ share the same category, they are relevant, i.e. $s_{ij}=1$; otherwise, they are irrelevant, i.e. $s_{ij}=0$. Similarly, we randomly sample 100 images per category of target domain as queries, and use the remaining images of target domain as the database and we randomly sample 500 images per category from both source domain and target domain as training points, where source domain data points have ground truth similarity information while the target domain data points do not. + +We use retrieval metrics within Hamming radius 2 to test the efficacy of different methods. We evaluate the retrieval quality based on standard evaluation metrics: Mean Average Precision (MAP), Precision-Recall curves and Precision all within Hamming radius 2. We compare the retrieval quality of our \textbf{TAH} with ten classical or state-of-the-art hashing methods, including unsupervised methods \textbf{LSH} \cite{cite:VLDB99LSH}, \textbf{SH} \cite{cite:NIPS09SH}, \textbf{ITQ} \cite{cite:CVPR11ITQ}, supervised shallow methods \textbf{KSH} \cite{cite:CVPR12KSH}, \textbf{SDH} \cite{cite:CVPR15SDH}, supervised deep single domain methods \textbf{CNNH} \cite{cite:AAAI14CNNH}, \textbf{DNNH} \cite{cite:CVPR15DNNH}, \textbf{DHN} \cite{cite:AAAI16DHN}, \textbf{HashNet} \cite{cite:ICCV17HashNet} and supervised deep cross-domain method \textbf{THN} \cite{cite:AAAI17THN}. + +For fair comparison, all of the methods use identical training and test sets. For deep learning based methods, we directly use the image pixels as input. For the shallow learning based methods, we reduce the 4096-dimensional AlexNet features \cite{cite:ICML14DeCAF} of images. We adopt the AlexNet architecture \cite{cite:NIPS12CNN} for all deep hashing methods, and implement TAH based on the \textbf{Caffe} framework \cite{cite:MM14Caffe}. For the single domain task on NUS-WIDE, we test cross-domain method TAH and THN by removing the transfer part. For the cross-domain tasks on VisDA2017, we train single domain methods with data of source domain and directly apply the trained model to the query and database of another domain. We fine-tune convolutional layers $conv1$--$conv5$ and fully-connected layers $fc6$--$fc7$ copied from the AlexNet model pre-trained on ImageNet 2012 and train the hash layer $fch$ and adversarial layers, all through back-propagation. As the $fch$ layer and the adversarial layers are trained from scratch, we set its learning rate to be 10 times that of the lower layers. We use mini-batch stochastic gradient descent (SGD) with 0.9 momentum and the learning rate annealing strategy implemented in Caffe. The penalty of adversarial networks $mu$ is increased from 0 to 1 gradually as RevGrad~\cite{cite:ICML15RevGrad}. We cross-validate the learning rate from $10^{-5}$ to $10^{-3}$ with a multiplicative step-size ${10}^{\frac{1}{2}}$. We fix the mini-batch size of images as $64$ and the weight decay parameter as $0.0005$. + +\begin{table*}[tb] + \centering + \caption{MAP Results of Ranking within Hamming Radius 2 for Different Number of Bits on Three Image Retrieval Tasks} + \label{table:MAP} + \resizebox{\textwidth}{!}{ + \begin{tabular}{c|cccc|cccc|cccc} + \Xhline{1.0pt} + \multirow{3}{30pt}{\centering Method} & + \multicolumn{4}{c|}{\multirow{2}{50pt}{\centering NUS-WIDE}} & \multicolumn{8}{c}{VisDA2017}\\ + \cline{6-13} + & \multicolumn{4}{c|}{} & \multicolumn{4}{c|}{$synthetic \rightarrow real$} & \multicolumn{4}{c}{$real \rightarrow synthetic$} \\ + \cline{2-13} + & 16 bits & 32 bits & 48 bits & 64 bits & 16 bits & 32 bits & 48 bits & 64 bits & 16 bits & 32 bits & 48 bits & 64 bits \\ + \hline + TAH & \textbf{0.722} & \textbf{0.729} & \textbf{0.692} & \textbf{0.680} & \textbf{0.465} & \textbf{0.423} & \textbf{0.433} & \textbf{0.404} & \textbf{0.672} & \textbf{0.695} & \textbf{0.784} & \textbf{0.761} \\ + THN & 0.671 & 0.676 & 0.662 & \underline{0.603} & \underline{0.415} & 0.396 & 0.228 & 0.127 & \underline{0.647} & \underline{0.687} & \underline{0.664} & 0.532 \\ + HashNet & \underline{0.709} & \underline{0.693} & \underline{0.681} & 0.615 & 0.412 & \underline{0.403} & \underline{0.345} & 0.274 & 0.572 & 0.676 & 0.662 & \underline{0.642} \\ + DHN & 0.669 & 0.672 & 0.661 & 0.598 & 0.331 & 0.354 & 0.309 & \underline{0.281} & 0.545 & 0.612 & 0.608 & 0.604 \\ + DNNH & 0.568 & 0.622 & 0.611 & 0.585 & 0.241 & 0.276 & 0.252 & 0.243 & 0.509 & 0.564 & 0.551 & 0.503 \\ + CNNH & 0.542 & 0.601 & 0.587 & 0.535 & 0.221 & 0.254 & 0.238 & 0.230 & 0.487 & 0.568 & 0.530 & 0.445 \\ + SDH & 0.555 & 0.571 & 0.517 & 0.499 & 0.196 & 0.238 & 0.229 & 0.212 & 0.330 & 0.388 & 0.339 & 0.277 \\ + ITQ & 0.498 & 0.549 & 0.517 & 0.402 & 0.187 & 0.175 & 0.146 & 0.123 & 0.163 & 0.193 & 0.176 & 0.158 \\ + SH & 0.496 & 0.543 & 0.437 & 0.371 & 0.154 & 0.141 & 0.130 & 0.105 & 0.154 & 0.182 & 0.145 & 0.123 \\ + KSH & 0.531 & 0.554 & 0.421 & 0.335 & 0.176 & 0.183 & 0.124 & 0.085 & 0.143 & 0.178 & 0.146 & 0.092 \\ + LSH & 0.432 & 0.453 & 0.323 & 0.255 & 0.122 & 0.092 & 0.083 & 0.071 & 0.130 & 0.145 & 0.122 & 0.063 \\ + \Xhline{1.0pt} + \end{tabular} + } +\end{table*} + +\begin{figure*}[!phtb] + \centering + \subfigure[NUS-WIDE]{ + \includegraphics[width=0.28\textwidth]{pr_nus.pdf} + \label{fig:pr_nus} + } + \hfil + \subfigure[synthetic $\rightarrow$ real]{ + \includegraphics[width=0.28\textwidth]{pr_train.pdf} + \label{fig:pr_train} + } + \hfil + \subfigure[real $\rightarrow$ synthetic]{ + \includegraphics[width=0.36\textwidth]{pr_validation.pdf} + \label{fig:pr_validation} + } + \vspace{-10pt} + \caption{The Precision-recall curve @ 64 bits within Hamming radius 2 of TAH and comparison methods on three tasks.} + \label{fig:pr} +\end{figure*} + +\begin{figure*}[!phtb] + \centering + \subfigure[NUS-WIDE]{ + \includegraphics[width=0.28\textwidth]{ham_nus.pdf} + \label{fig:ham_nus} + } + \hfil + \subfigure[synthetic $\rightarrow$ real]{ + \includegraphics[width=0.28\textwidth]{ham_train.pdf} + \label{fig:ham_train} + } + \hfil + \subfigure[real $\rightarrow$ synthetic]{ + \includegraphics[width=0.36\textwidth]{ham_validation.pdf} + \label{fig:ham_validation} + } + \vspace{-10pt} + \caption{The Precision curves @64 bits within Hamming radius 2 of TAH and comparison methods on three tasks.} + \label{fig:ham} +\end{figure*} +\subsection{Results} +\textbf{NUS-WIDE:} The Mean Average Precision (MAP) within Hamming Radius 2 results are shown in Table \ref{table:MAP}. We can observe that on the classical task that database and query images are from the same domain, TAH generally outperforms state of the art methods defined on classical retrieval setting. Specifically, compared to the best method on this task, HashNet, and state of the art cross-domain method THN, we achieve absolute boosts of 0.031 and 0.053 in average MAP for different bits on NUS-WIDE, which is very promising. + +The precision-recall curves within Hamming Radius 2 based on 64-bits hash codes for the NUS-WIDE dataset are illustrated in Figure~\ref{fig:pr_nus}. We can observe that TAH achieves the highest precision at all recall levels. The precision nearly does not decrease with the increasing of recall, proving that TAH has stable performance for Hamming Radius 2 search. + +The Precision within Hamming radius 2 curves are shown in Figure~\ref{fig:ham_nus}. We can observe that TAH achieves the highest P@H=2 results on this task. When using longer codes, the Hamming space will become sparse and few data points fall within the Hamming ball with radius 2 \cite{cite:CVPR12MIH}. This is why most hashing methods perform worse on accuracy with very long codes. However, TAH achieves a relatively mild decrease on accuracy with the code length increasing. This validates that TAH can concentrate hash codes of similar data points to be within the Hamming ball of radius $2$. + +These results validate that TAH is robust under diverse retrieval scenarios. The superior results in MAP, precision-recall curves and Precision within Hamming radius 2 curves suggest that TAH achieves the state of the art performance for search within Hamming Radius 2 on conventional image retrieval problems where the training set and the database are from the same domain. + +\textbf{VisDA2017:} The MAP results of all methods are compared in Table~\ref{table:MAP}. We can observe that for novel transfer retrieval tasks between two domains of VisDA2017, TAH outperforms the comparison methods on the two transfer tasks by very large margins. In particular, compared to the best deep hashing method HashNet, TAH achieves absolute increases of \textbf{0.073} and \textbf{0.090} on the transfer retrieval tasks $synthetic \rightarrow real$ and $real \rightarrow synthetic$ respectively, validating the importance of mitigating domain gap in the transfer setting. Futhermore, compared to state of the art cross-domain deep hashing method THN, we achieve absolute increases of \textbf{0.140} and \textbf{0.096} in average MAP on the transfer retrieval tasks $synthetic \rightarrow real$ and $real \rightarrow synthetic$ respectively. This indicates that the our adversarial learning module is superior to MMD used in THN in aligning distributions. Similarly, the precision-recall curves within Hamming Radius 2 based on 64-bits hash codes for the two transfer retrieval tasks in Figure~\ref{fig:pr_train}-\ref{fig:pr_validation} show that TAH achieves the highest precision at all recall levels. From the Precision within Hamming radius 2 curves shown in Figure~\ref{fig:ham_train}-\ref{fig:ham_validation}, we can observe that TAH outperforms other methods at different bits and has only a moderate decrease of precision when increasing the code length. + +In particular, between two transfer retrieval tasks, TAH outperforms other methods with larger margin on $synthetic \rightarrow real$ task. Because the synthetic images contain less information and noise such as background and color than real images. Thus, directly applying the model trained on synthetic images to the real image task suffers from large domain gap or even fail. Transferring knowledge is very important in this task, which explains the large improvement from single domain methods to TAH. TAH also outperforms THN, indicating that adversarial network can match the distribution of two domains better than MMD, and the proposed similarity function based on $t$-distribution can better concentrate data points to be within Hamming radius $2$. + +An counter-intuitive result is that the precision keeps unchanged while the recall increases, as shown in Figure \ref{fig:pr}. One plausible reason is that, we present a $t$-distribution motivated hashing loss to enable Hamming space retrieval. Our new loss can concentrate as many data points as possible to be within Hamming ball with radius 2. This concentration property naturally leads to stable precision at different recall levels, i.e. the precision decreases much more slowly by increasing the recall. + +\begin{figure}[!tbp] + \centering + \includegraphics[width=1.0\columnwidth]{sample10.pdf} + \caption{Examples of top 10 retrieved images and P@10.} + \label{fig:top10} + \vspace{-10pt} +\end{figure} + +Furthermore, as an intuitive illustration, we visualize the top 10 relevant images for a query image for TAH, DHN and HashNet on $synthetic \rightarrow real$ and $real \rightarrow synthetic$ tasks in Figure~\ref{fig:top10}. It shows that TAH can yield much more relevant and user-desired retrieval results. + +The superior results of MAP, precision-recall curves and precision within Hamming Radius 2 suggest that TAH is a powerful approach to for learning transferable hash codes for image retrieval. TAH integrates similarity relationship learning and domain adversarial learning into an end-to-end hybrid deep architecture to build the relationship between database points. The results on the NUS-WIDE dataset already show that the similarity relationship learning module is effective to preserve similarity between hash codes and concentrate hash codes of similar points. The experiment on the VisDA2017 dataset further validates that the domain adversarial learning between the source and target domain contributes significantly to the retrieval performance of TAH on transfer retrieval tasks. Since the training and the database sets are collected from different domains and follow different data distributions, there is a substantial domain gap posing a major difficulty to bridge them. The domain adversarial learning module of TAH effectively close the domain gap by matching data distributions with adversarial network. This makes the proposed TAH a good fit for the transfer retrieval. + +\vspace{-10pt} +\begin{table}[htp] + \centering + \caption{MAP within Hamming Radius 2 of TAH variants} + \label{table:EmpirMAP} + \resizebox{\columnwidth}{!}{ + \begin{tabular}{c|cccc|cccc} + \Xhline{1.0pt} + \multirow{2}{30pt}{\centering Method} & \multicolumn{4}{c|}{\centering $synthetic \rightarrow real$} &\multicolumn{4}{c}{\centering $real \rightarrow synthetic$} \\ + \cline{2-9} + & 16 bits & 32 bits & 48 bits & 64 bits & 16 bits & 32 bits & 48 bits & 64 bits\\ + \hline + TAH-t & \underline{0.443} & \underline{0.405} & \underline{0.390} & 0.\underline{364} & \underline{0.660} & 0.671 & 0.717 & 0.624 \\ + TAH-A & 0.305 & 0.395 & 0.382 & 0.331 & 0.605 & \underline{0.683} & 0.\underline{725} & \underline{0.724} \\ + TAH & \textbf{0.465} & \textbf{0.423} & \textbf{0.433} & \textbf{0.404} &\textbf{0.672} & \textbf{0.695}& \textbf{0.784} & \textbf{0.761} \\ + \Xhline{1.0pt} + \end{tabular} + } + \vspace{-10pt} +\end{table} +\subsection{Discussion} +We investigate the variants of TAH on VisDA2017 dataset: (1) \textbf{TAH-t} is the variant which uses the pairwise cross-entropy loss introduced in DHN~\cite{cite:AAAI16DHN} instead of our pairwise $t$-distribution cross-entropy loss; (2) \textbf{TAH-A} is the variant removing adversarial learning module and trained without using the unsupervised training data. We report the MAP within Hamming Radius 2 results of all TAH variants on VisDA2017 in Table~\ref{table:EmpirMAP}, which reveal the following observations. (1) TAH outperforms TAH-t by very large margins of 0.031 / 0.060 in average MAP, which confirms that the pairwise $t$ cross-entropy loss learns codes within Hamming Radius 2 better than pairwise cross-entropy loss. (2) TAH outperforms TAH-A by 0.078 / 0.044 in average MAP for transfer retrieval tasks $synthetic \rightarrow real$ and $real \rightarrow synthetic$. This convinces that TAH can further exploit the unsupervised train data of target domain to bridge the Hamming spaces of training dataset (real/synthetic) and database (synthetic/real) and transfer knowledge from training set to database effectively. +\section{Conclusion} +In this paper, we have formally defined a new transfer hashing problem for image retrieval, and proposed a novel transfer adversarial hashing approach based on a hybrid deep architecture. The key to this transfer retrieval problem is to align different domains in Hamming space and concentrate the hash codes to be within a small Hamming ball, which relies on relationship learning and distribution alignment. Empirical results on public image datasets show the proposed approach yields state of the art image retrieval performance. +\section*{Acknowledgments} +This work was supported by the National Key Research and Development Program of China (2016YFB1000701), National Natural Science Foundation of China (61772299, 61325008, 61502265, 61672313) and TNList Fund. + + +\begin{small} + \bibliographystyle{aaai} + \bibliography{tsne} +\end{small} diff --git a/1712.04851v2.txt b/1712.04851v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..369e5dd24b5534f038381908764e42b9f357757f --- /dev/null +++ b/1712.04851v2.txt @@ -0,0 +1,83 @@ +The resurgence of convolutional neural networks (CNNs) has led to a wave of unprecedented advances for image classification using end-to-end hierarchical feature learning architectures [1, 2, 3, 4]. The task of video classification, however, has not enjoyed the same level of performance jump as in image classification.In the past, one limitation was the lack of large-scale labeled video datasets.However, the recent creation ofSports-1M [5],Kinetics [6],Something-something [7],ActivityNet [8],Charades [9], etc.has partially removed that impediment. + +Now we face more fundamental challenges.In particular, we have three main barriers to overcome: (1)how best to represent spatial information (i.e., recognizing the appearances of objects);(2) how best to represent temporal information(i.e., recognizing context, correlation and causation through time);and (3)how best to tradeoff model complexity with speed,both at training and testing time. + +In this paper, we study these three questions by considering various kinds of 3D CNNs.Our starting point is the state of the art approach, due toCarreira and Zisserman [10],known as “I3D”(since it “inflates” the 2D convolutional filters of the“Inception” network [2] to 3D). + +Despite giving good performance,this model is very computationally expensive. This prompts several questions, which we seek toaddress in this paper:•Do we even need 3D convolution? If so, what layers should we make 3D, and what layers can be 2D? Does this depend on the nature of the dataset and task?•Is it important that we convolve jointly over time and space, or would it suffice to convolve over these dimensions independently?•How can we use answers to the above questions to improve on prior methods in terms of accuracy, speed and memory footprint? + +To answer the first question,we apply “network surgery” to obtain severalvariants of the I3D architecture.In one family of variants, which we call Bottom-Heavy-I3D, we retain 3D temporal convolutions at the lowest layers of the network(the ones closest to the pixels), and use 2D convolutions for the higher layers.In the other family of variants, which we call Top-Heavy-I3D, we do the opposite, and retain 3D temporal convolutions at the top layers, and use 2D for the lower layers(see Figure 1).We then investigate how to trade between accuracy and speed by varyingthe number of layers that are “deflated” (converted to 2D) in this way.We find that the Top-Heavy-I3D models are faster,which is not surprising, since they only apply 3D to the abstract feature maps, which are smaller than the low level feature maps due to spatial pooling.However, we also find that Top-Heavy-I3D models are often more accurate, which is surprising since they ignore low-level motion cues. + +To answer the second question (about separating space and time), we consider replacing 3D convolutionswith spatial and temporal separable 3D convolutions,i.e., we replace filters of the form kt×k×ksubscript𝑘𝑡𝑘𝑘k_{t}\times k\times kby 1×k×k1𝑘𝑘1\times k\times k followed by kt×1×1subscript𝑘𝑡11k_{t}\times 1\times 1,where ktsubscript𝑘𝑡k_{t} is the width of the filter in time,and k𝑘k is the height/width of the filter in space.We call the resulting model S3D, which stands for “separable 3D CNN”.S3D obviously has many fewer parameters than models that use standard 3D convolution,and it is more computationally efficient.Surprisingly, we also show that it also has better accuracy than the original I3D model. + +Finally, to answer the third question (about putting things together for an efficient and accurate video classification system), we combine what we have learned in answeringthe above two questions with a spatio-temporal gating mechanismto design a new model architecturewhich we call S3D-G.We show that this model gives significant gains in accuracy over baseline methods on a variety of challenging video classification datasets, such as Kinetics,Something-something, UCF-101 and HMDB,and also outperforms many other methods on other video recognition tasks, such as action localization on JHMDB. + +2D CNNs have achieved state of the art results for image classification,so, not surprisingly,there have been many recent attempts to extend these successesto video classification.The Inception 3D (I3D) architecture [10] proposed by Carreira and Zisserman is one of the currentstate-of-the-art models. There are three key ingredients for its success: first, they “inflate” all the 2D convolution filters used by the Inception V1 architecture [2] into 3D convolutions, and carefully choose the temporal kernel size in the earlier layers. Second, they initialize the inflated model weights by duplicating weightsthat were pre-trained on ImageNet classificationover the temporal dimension. Finally, they train the network onthe large-scale Kinetics dataset [6]. + +Unfortunately, 3D CNNs are computationally expensive, so there has been recent interest in more efficient variants.In concurrent work, [11]has recently proposed a variety of models based on topof the ResNet architecture [4].In particular, they consider models that use 3D convolution in either the bottom or top layers, and 2D in the rest; they call these “mixed convolutional” models.This is similar to our top-heavy and bottom-heavy models.They conclude that bottom heavy networks are more accurate,which contradicts our finding.However, the differences they find between top heavy and bottom heavy are fairly small,and are conflated with changes in computational complexity.By studying the entire speed-accuracy tradeoff curve (of Inception variants),we show that there are clear benefits to using a top-heavy design for a given computational budget (see Section 4.2). + +Another way to save computation is to replace 3D convolutions with separable convolutions, in which we first convolve spatially in 2D, and then convolve temporally in 1D.We call the resulting model S3D.This factorization is similar in spirit to the depth-wise separable convolutionsused in [12, 13, 14], except that we apply the ideato the temporal dimension instead of the feature dimension.This idea has been used in a variety of recent papers,including [11] (who call it “R(2+1)D”),[15] (who call it “Pseudo-3D network”),[16] (who call it “factorized spatio-temporal convolutional networks”),etc.We use the same method, but combine it with both top-heavy and bottom-heavy designs, which is a combination that leads to a very efficient video classification system.We show that the gains from separable convolution are complementary to the gains from using a top-heavy design (see Section 4.4). + +An efficient way to improve accuracy is to use feature gating, which captures dependencies between feature channels with a simple but effective multiplicative transformation.This can be viewed as an efficient approximation to second-order poolingas shown in [17].Feature gating has been used for many tasks,such as machine translation [18],VQA [19],reinforcement learning [20], image classification [21, 22],and action recognition [23].We consider a variant of the above techniques inwhich we place the feature gating module after each of the temporal convolutions in an S3D network,and show that this results in substantial gains in accuracy (see Section 4.6). + +Another way to improve accuracy (at somewhat higher cost)is to use precomputed optical flow features.This idea was successfully used in [24],who proposed a two-stream architecture where one CNN stream handles raw RGB input, and the otherhandles precomputed optical flow.Since then, many video classification methods follow the same multi-stream 2D CNN design, and have made improvements in terms of new representations [25, 26], different backbone architecture [27, 28, 29, 17], fusion of the streams [30, 31, 32, 33] and exploiting richer temporal structures [34, 35, 36].We will study the benefits of using optical flow in Section 5.1. + +In this paper, we consider two large video action classification datasets.The first one is Kinetics [6],which is a large dataset collected from YouTube, containing 400 action classes and 240K training examples.Each example is temporally trimmed to be around 10 seconds.Since the full Kinetics dataset is quite large,we have created a smaller datasetthat we call Mini-Kinetics-200.111The original “Mini-Kinetics” dataset used in[6] contains videos that are no longer available.We created the new Mini-Kinetics-200 dataset in collaboration with the original authors. Mini-Kinetics-200 consists ofthe 200 categories with most training examples;for each category, we randomly sample 400 examples from the training set, and 25 examples from the validation set,resulting in80K training examples and 5K validation examples in total. The splits are publicly released to enable future comparisons.We also report some results on the original Kinetics dataset, which we will call Kinetics-Full for clarity. + +The second main dataset isSomething-something [7]. It consists of  110k videos of 174 different low-level actions, each lasting between 2 to 6 seconds.In contrast to Kinetics,this dataset requires making fine-grained low-level distinctions, such as between “Pushing something from left to right” and “Pushing something from right to left”.It is therefore an interesting question whether the same principles will hold and the same architectures will work well on both datasets. + +We also consider twosmaller action classification datasets to test the transferability of our model,which we discuss in Section 5.2,as well as twoaction detection datasets, which we discuss in Section 5.3. + +Our training procedure largely follows [10]. During training, we densely sample 64 frames from a video and resize input frames to 256×256256256256\times 256 and then take random crops of size 224×224224224224\times 224. During evaluation, we use all frames and take 224×224224224224\times 224 center crops from the resized frames. Our models are implemented with TensorFlow and optimized with a vanilla synchronous SGD algorithm with momentum of 0.9 and on 56 GPUs, batch size is set to 6 per GPU. For Mini-Kinetics-200, we train our model for 80k steps with an initial learning rate of 0.1. We decay the learning rate at step 60k to 0.01, and step 70k to 0.001. Since Something-something is a smaller dataset, we reduce the number of GPUs to 16 and train at learning rate of 0.1 for 10k steps. + +We report top-1 and top-5 accuracy. To measure the computational efficiency of our models, we report theoretical FLOPS based on a single input video sequence of 64 frames and spatial size 224×224224224224\times 224. We pad the total number of frames to 250 for Mini-Kinetics-200 and 64 for Something-something when evaluating. + +In this section, we report the results of various “network surgery” experiments, where we vary different aspects of the I3D model to study the effects on speed and accuracy. + +In this section, we seek to determine how much value 3D convolution brings,motivated by the surprising success of 2D CNN approachesto video classification (see e.g., [36]).We do this byreplacing every 3D filter in the I3D model with a 2D filter. This yields what we will refer to as the I2Dmodel.222To reduce the memory and time requirements,and to keepthe training protocol identical to I3D (in terms of the number of clips we use for training in each batch, etc),we retain two max-pooling layers with temporal stride 2 betweenInception modules.Hence, strictly speaking, I2D is not a pure 2D model. However, it is very similar to a single-frame 2D classification model. + +Theoretically, the I2D network should be invariant to the temporal reversal of the input frames, since it is not capable of incorporating global signals. To verify this, we train I2D and the original I3D model on the Kinetics-Full and Something-something datasets with normal frame order, and apply the trained models on validation data in which the frames are innormal order and reversed temporal order.The results of the experiment are shown in Table 1.We see that I2D has the same performance on both versions during testing, as is to be expected. However,we notice an interesting difference between the Kinetics dataset and the Something-something dataset.In the former case, the performance of I3D is indifferent to the “arrow of time” [37],whereas in the latter case, reversing the order hurts performance.We believe this is because Something-something dataset requires fine-grained distinctions between visually similar action categories. + +Although we have seen that 3D convolution can boost accuracy compared to 2D convolution, it is computationally very expensive.In this section, we investigate the consequences of only replacing some of the 3D convolutions with 2D.Specifically, starting with an I2D model, we gradually inflate 2D convolutions into 3D,from low-level to high-level layers in the network,to create what we call the Bottom-Heavy-I3D model.We also consider the opposite process, in which we inflate the top layers of the model to 3D, but keep the lower layers 2D;we call such models Top-Heavy-I3D models. + +We train and evaluate the Bottom-Heavy-I3D and Top-Heavy-I3D models on Mini-Kinetics-200 and Something-something,and show the results in Figures 4.We see that the solid blue lines (top heavy I3D) are much better than the dotted blue lines (bottom heavy I3D) under the same FLOPS, which indicates that top heavy models are faster and more accurate.The speed increase is expected, since in a top-heavy model,the feature maps are reduced in size using spatial pooling before being convolved in 3D. For fixed computation budget, Top-Heavy-I3D is often significantly more accurate than Bottom-Heavy-I3D. This suggests that 3D convolutions are more capable and useful to model temporal patterns amongst high level features that are rich in semantics. + +To verify the above intuition, we examined the weights of an I3D modelwhich was trained on Kinetics-Full.Figure 5 shows the distribution of these weights across 4 layers of our model, from low-level to high-level. In particular, each boxplot shows the distribution of Wl​(t,:,:,:)subscript𝑊𝑙𝑡:::W_{l}(t,:,:,:) for temporal offset t𝑡t and layer l𝑙l.We use t=0𝑡0t=0 to indicate no offset in time, i.e.,the center in the temporal kernel.At initialization, all the filters started with the same set of (2D convolution) weights (derived from an Inception model pre-trained on Imagenet) for each value of t∈{−1,0,1}.𝑡101t\in\{-1,0,1\}.After training, we see that the temporally offset filters (i.e., for t≠0𝑡0t\neq 0) have a weight distribution that is still closely centered on zero in the lower layers (see left panel), whereas the variance of the distribution increases in higher layers (see right panel).This suggests once again that the higher level temporal patterns are more useful for the Kinetics action classification task. + +In this section, we study the effect of replacing standard 3D convolution with afactored version which disentangles this operation into a temporal part and a spatial part.In more detail, our method is toreplace each 3D convolution with two consecutive convolution layers: one 2D convolution layer to learn spatial features, followed by a 1D convolution layer purely on the temporal axis.This can be implemented by running two 3D convolutions, where the first (spatial) convolution has filter shape [1,k,k]1𝑘𝑘[1,k,k] and thesecond (temporal) convolution has filter shape [k,1,1]𝑘11[k,1,1].By applying this factorization to I3D, we obtain amodel which we refer to as S3D. For a detailed illustration of the architecture, please refer to Figure 6.333There are 4 branches in an Inception block, but only two of them have 3x3 convolutions (the other two being pointwise 1x1 convolutions), as shown in Figure 3.As such, when I3D inflates the convolutions to 3D, only some of the features contain temporal information.However, by using separable temporal convolution, we can add temporal information to all 4 branches.This improves the performance from 78.4%percent78.478.4\% to 78.9%percent78.978.9\% on Mini-Kinetics-200.In the following sections, whenever we refer to an S3D model, we mean S3D with such configuration. + +Table 2compares the results of S3D and I3D on Kinetics-Full. Table 3 shows that S3D also outperforms I3D on the Something-something dataset.The results show that, despite a substantial compression in model size(12.06M parameters for I3D reduced to 8.77M for S3D),and a large speed-up (107.9107.9107.9 GFLOPS for I3D reduced to 66.3866.3866.38 GFLOPS forS3D), the separable model is even more accurate(top-1 accuracy improved from 71.1% to 72.2% for Kinetics-Full, and from 45.8% to 47.3% for Something-something).We believe the gain in accuracy is because thespatio-temporalfactorization reduces overfitting, in a way without sacrificing the expressiveness of the representation, as we find that simply reducing the parameters of the network does not help with the performance. + +Note that we can apply this separable transformation to any place where 3D convolution is used;thus this idea is orthogonal to the question of which layers should contain 3D convolution, which we discussedin Section 4.1.We denotethe separable version of theBottom-Heavy-I3D models by Bottom-Heavy-S3D,and the separable version of theTop-Heavy-I3D models by Top-Heavy-S3D,thusgiving us 4 families of models. + +We plot the speed vs accuracy of these modelsin Figure 4. We see that separable top-heavy models offer the best speed-accuracy trade-off.In particular, the model in which we keep the top 2 layers as separable 3D convolutions,and make the rest 2D convolutions,seems to be a kind of “sweet spot”.We call this model “Fast-S3D”,since it is is 2.5 times more efficient than I3D(43.47 vs 107.9 GFLOPS), and yet has comparableaccuracy (78.0% vs 78.4% on Mini-Kinetics-200). + +Here we explore the spatiotemporal representations learned by different levelsof the S3D modelon the Something-something dataset,using the tool of tSNE projection [38].The behavior of the I3D models is very similar.Instead of using samples from all 174 categories, we use a smaller vocabulary, namely the “10 action groups” defined in [7].444The labels are as follows.0: Dropping [something],1: Moving [something] from right to left,2: Moving [something] from left to right,3: Picking [something],4:Putting [something],5: Poking [something],6: Tearing [something],7: Pouring [something],8: Holding [something],9: Showing [something]. We sample  2,200 data points from the validation set.In Figure 7, the top row shows representations learned by a S3D model, at levels from Max3a to Max5c.The class separation becomed increasingly clearer at higher levels. + +The bottom row shows representations learned at a certain feature level (Max5a), but across different models including I2D, Bottom-Heavy-S3D and Top-Heavy-S3D (both have a 2D-3D transition point at Max4b layer),as well as a full S3D model. Comparing the bottom-heavy and top-heavy models, for subtle actions such as “3: Picking”, “4: Putting” and “5: Poking” something, representations learned with a top-heavy model are more discriminative than that in a bottom-heavy model, thus leading to better class separations with the tSNE projection (highlighted with the red box). A top-heavy model can learn features that are as good as those learned with a full 3D model, and significantly better than those from the 2D model, without much sacrifice in processing speed.This observation further supports our hypothesis that temporal information modeling is most effective at top levels in the feature hierarchy for action classification tasks. + +In this section we further improve the accuracy of our model by using feature gating.We start by considering the context feature gatingmechanism first used for video classification in [23].They consider an unstructured input feature vector x∈ℛn𝑥superscriptℛ𝑛x\in\mathcal{R}^{n} (usually learned at final embedding layers close to the logit output),and produce an output feature vector y∈ℛn𝑦superscriptℛ𝑛y\in\mathcal{R}^{n} as follows:y=σ​(W​x+b)⊙x𝑦direct-product𝜎𝑊𝑥𝑏𝑥y=\sigma(Wx+b)\odot xwhere ⊙direct-product\odot represents elementwise multiplication,W∈ℛn×n𝑊superscriptℛ𝑛𝑛W\in\mathcal{R}^{n\times n} is a weight matrix,and b∈ℛn𝑏superscriptℛ𝑛b\in\mathcal{R}^{n} is the bias term.This mechanism allows the model to upweight certaindimensions of x𝑥x if the context model σ​(W​x+b)𝜎𝑊𝑥𝑏\sigma(Wx+b) predicts that they are important,and to downweight irrelevant dimensions; this can be thought of as a “self-attention” mechanism. + +We now extend this to feature tensors, with spatio-temporal structure.Let X∈ℛT×W×H×D𝑋superscriptℛ𝑇𝑊𝐻𝐷X\in\mathcal{R}^{T\times W\times H\times D} be the input tensor,and let Y𝑌Y be an output tensor of the same shape.We replace the matrix product W​x𝑊𝑥Wx with W​pool​(X)𝑊pool𝑋W\mathrm{pool}(X),where the pooling operation averages the dimensions of X𝑋X across space and time.(We found that this worked better than just averaging across space or just across time.)We then compute Y=σ​(W​pool​(X)+b)⊙X𝑌direct-product𝜎𝑊pool𝑋𝑏𝑋Y=\sigma(W\mathrm{pool}(X)+b)\odot X,where ⊙direct-product\odot represents multiplication across the feature (channel) dimension,(i.e., we replicate the attention map σ​(W​pool​(X)+b)𝜎𝑊pool𝑋𝑏\sigma(W\mathrm{pool}(X)+b) across space and time). + +We can plug this gating module into any layer of the network.We experimented with several options, and got the best results by applying it directly aftereach of the [k,1,1]𝑘11[k,1,1] temporal convolutions in the S3D network.We call the final model (S3D with gating) S3D-G.We see from Table 2 that this results in a healthy gain in accuracycompared to S3D on the Kinetics-Full dataset (72.2% top-1 to 74.7%) at a very modest cost increase (66.38 GFLOPS to 71.38). Table 3 shows that S3D-G also outperforms S3D and I3D on Something-something.We also significantly outperform the current state of the art method,which is the Multi-scale TRN of [39],improving top-1 accuracy from 33.6% to 42.0%. + +In this section, we evaluate the generality and robustness of the proposed S3D-G architecture by conducting transfer learning experiments on different input modalities, video datasets, and tasks. + +We first verify if S3D-G also works with optical flow inputs.For these experiments, we follow the standard setup as described in [10] and extract optical flow features with the TV-L1 approach [40]. We truncate the flow magnitude at [−20,20]2020[-20,20] and store them as encoded JPEG files. Other experiment settings are the same as the RGB experiments. From Table 4, we can see that the improvement of S3D-G over I3D is consistentwith the gain we saw with RGB inputs,bringing the performance up from 63.91%percent63.9163.91\% to 68.00%percent68.0068.00\%.By ensemblingthe two streams of RGB and flow, we obtaina performance of 77.22%,which is a 3% boost over the I3D network when trained on the same data. We note that even though we focus on the speed-accuracy trade-offs in action classification network design, the performance is competitive compared with recent Kinetics Challenge winners and concurrent works; notably [41] and [42] use heavier backbone architectures (e.g. ResNet 101 has  8.5x more FLOPS than our S3D-G architecture) + +Next we conduct transfer learning experiments from Kinetics to other video classification datasets,namely HMDB-51 [44] and UCF-101 [45].HMDB-51 contains around 7,000 videos spanning over 51 categories, while UCF-101 has 13,320 videos spanning over 101 categories.Both datasets consist of short video clips that are temporally trimmed, and contain3 training and validation splits.We follow the standard setup as used in previous work and report average accuracy across all splits. + +For our transfer learning experiments, we use the same setup as training on Kinetics, but change the number of GPUs to 8 and lower the learning rate to 0.01 for 6K steps, and 0.001 for another 2K steps.For simplicity, we only use RGB (no optical flow). + +Table 5 shows the results of this experiment. On UCF-101, our proposed S3D-G architecture,which only uses Kinetics for pretraining,outperforms I3D,and matches R(2+1)D, both of which use largescale datasets (Kinetics and Sports-1M) for pretraining.On HMDB-51, we outperform all previous methods published to date. + +Finally, we demonstrate the effectiveness of S3D-G on action detection tasks, where the inputs are video frames, and the outputs are bounding boxes associated with action labels on the frames.Similar to the framework proposed in [49], we use the Faster-RCNN [50] object detection algorithm to jointly perform person localization and action recognition. We use the same approach as described in [51] to incorporate temporal context information via 3D networks. To be more specific, the model uses a 2D ResNet-50 [4] network that takes the annotated keyframe (frame with box annotations) as input, and extract features for region proposal generation on the keyframe. We then use a 3D network (such as I3D or S3D-G) that takes the frames surrounding the keyframe as input, and extract feature maps which are then pooled for bounding box classification. The 2D region proposal network (RPN) and 3D action classification network are jointly trained end-to-end. Note that we extend the ROIPooling operation to handle 3D feature maps by simply pooling at the same spatial locations over all time steps. + +We report performance on two widely adopted video action detection datasets: JHDMB [52] and UCF-101-24 [45]. JHMDB dataset is a subset of HMDB-51, it consists of 928 videos for 21 action categories, and each video clip contains 15 to 40 frames. UCF-101-24 is a subset of UCF-101 with 24 labels and 3207 videos; we use the cleaned bounding box annotations from [53]. We report performance using the standard frame-AP metric defined in [54], which is computed as the average precision of action detection over all individual frames, at the intersection-over-union (IoU) threshold of 0.5. As commonly used by previous work, we report average performance over three splits of JHMDB and the first split for UCF-101-24. + +Our implementation is based on the TensorFlow Object Detection API [55]. We train Faster-RCNN with asynchronous SGD on 11 GPUs for 600K iterations. We fix the input resolution to be 320×400320400320\times 400 pixels. For both training and validation, we fix the size of temporal context to 20 frames. All the other model parameters are set based on the recommended values from [55]. The ResNet-50 networks are initialized with ImageNet pre-trained models, and I3D and S3D-Gare pre-trained from Kinetics. We extract 3D feature maps from the “Mixed 4e” layer which has a spatial stride of 16. + +Table 6 shows the comparison between I3D, S3D-G, and other state-of-the-art methods. We can see that both 3D networks outperform previous architectures by large margins, while S3D-G is consistently better than I3D. + +We show that we can significantly improve on the previous state of the art 3D CNN video classification model, known as I3D,in terms of efficiency,by combining 3 key ideas:a top-heavy model design,temporally separable convolution,and spatio-temporal feature gating.Our modifications are simple and can be applied to other architectures.We hope this will boost performance on a variety of video understanding tasks. \ No newline at end of file diff --git a/1712.05087v1.txt b/1712.05087v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..7dfda87b0ebaeefc51999d2a7c83ce81c90f5480 --- /dev/null +++ b/1712.05087v1.txt @@ -0,0 +1,327 @@ +\section{Introduction} +Video streaming services, such as Netflix and YouTube, are popular methods of viewing entertainment content nowadays. Due to large video sizes and limited network bandwidth, video compression is required for streaming video content from a server to a client. While video compression can reduce the size of a video, it often comes with undesired compression artifacts, such as image blocking effects and blurry effects. + + Decades of efforts were made towards delivering the best possible video quality under bandwidth constraint. State-of-the-art video compression methods such as MPEG-4~\cite{Li_mpeg_2001}, H.264~\cite{Wiegand_h264_2003}, and HEVC~\cite{sullivan2012overview} combine various classical techniques including image transform coding, predictive coding, source coding, and motion estimation in a carefully-engineered framework. These methods are general and can be applied to various video domains for effectively compressing most of the information in a video. However, the residual information, which is the difference between the uncompressed and compressed videos, is difficult to compress because it contains highly non-linear patterns. Neither linear predictive coding nor linear transform coding can effectively compress the residual. + + In this paper, we hypothesize that one can effectively compress the residual information if one is willing to limit the use of the video compression method to a specific domain. In other words, we no longer wish to have a video compression method that works universally well on all videos. We only wish to have a method that works particularly well in one specific domain. Although this setting may appear inconvenient at a first glance as one needs to have a video compressor for each domain, it does fit well with several major video streaming applications, such as video game streaming and sports streaming. For example, for video game streaming services such as GeForce Now and Twitch, the gamer chooses a game title to play, and the video content is rendered on the server and delivered to client's mobile console. During the game playing period, all the video content in the stream is in the same video game domain and a domain-specific video compression method is entirely appropriate. The setting also fits other user cases such as streaming sports, which are often limited to a particular discipline, as well as things like compressing dash cam videos, as all the videos are about street scenes. + + To verify our hypothesis, we leverage deep learning models, which have been established as powerful non-linear function approximators, to encode the highly nonlinear residual information. In our video compression pipeline, we first apply H.264 to compress videos in a specific domain and train a novel binary autoencoder to encode the resulting residual information frame-by-frame into a binary representation. We then apply Huffman coding~\cite{Cover_information_theory} to compress the binary representations in a lossless manner. The compressed binary representations can be sent to the client in the meta data field in the H.264 streaming packet. This way, our method can be integrated into the existing video streaming standard. We illustrate our method in Figure~\ref{fig:overview}. We show that with our proposed binary residual representation, one can achieve a better video quality (at a chosen bandwidth) by sending the video stream using H.264 at a smaller bandwidth and utilizing the saved bandwidth to transmit the learned binary residual representation. + + We conduct extensive experiments to verify our hypothesis that we can improve state-of-the-art video compression methods by learning to encode the domain-specific residual information in a binary form. We also compare various ways of training the proposed binary autoencoder for encoding the residual information. On the KITTI~\cite{Geiger_CVPR_2012} and three games video datasets, we show that our method consistently outperforms H.264 both quantitatively and qualitatively. For example, our PSNR score is 1.7dB better than H.264 on average under the bandwidth at 5Mbps. +\section{Related Work} +We review the related works by their categories. +\subsection{Image/Video Compression} +Transform coding using the discrete/integer cosine transform (DCT/ICT) has been widely used in image and video coding standards, such as JPEG \cite{Wallace_jpeg_1991}, MPEG-4 \cite{Li_mpeg_2001}, H.264 \cite{Wiegand_h264_2003}, and HEVC~\cite{sullivan2012overview}. The encoder divides an image/video frame into non-overlapping blocks, applies DCT/ICT to each individual block, and quantizes the coefficients. Because of the energy concentration ability of DCT/ICT, the compressed images are of good quality at moderate to high bit rates. However, real-time video stream requires very low bit-rate compression. As a result, the compressed images often suffer from blocking artifacts due to the block-wise processing. Another problem with existing coding standards is that they have been designed to be universal coders and cannot be tailored to specific domains. + + Machine learning-based techniques have been developed to aid these compression standards. A colorization model~\cite{Cheng_ICML_2007} is utilized to learn the representative color pixels to store for better reconstruction. Another work adopts a dictionary-based approach~\cite{Skretting_icassp_2011} to learn sparse representations for image compression. Our method is also based on learning, in which we leverage state-of-the-art deep learning models to compress the residual information. Recently, a reinforcement learning scheme is adopted to adaptively select the bit rate for video streaming for minimizing the latency~\cite{Mao_sigcomm_2017}. +\subsection{Deep Learning-based Image Compression} +Instead of engineering every step in the coding system, numerous learning-based approaches as discussed in Jiang et al.~\cite{Jiang_survey_1999} have been developed to compress the data in the holistic manner. Recently, autoencoders \cite{Hinton_science_2006} have been widely used in extracting abstract representations of images through learning to reconstruct the input signals~\cite{Vincent_ICML_2008,Pathak_CVPR_2016,Tsai_CVPR_2017}. While these methods use a bottleneck layer to learn a compact representation, each dimension of the compact representation is continuous, which needs to be further quantized for compression. + + Various approaches are utilized in the bottleneck layer to compress the data. Quantization methods~\cite{Balle_ICLR_2017,Theis_ICLR_2017} estimate the entropy rate of the quantized data while optimizing used number of bits. In addition, an adversarial training scheme~\cite{Rippel_ICML_2017} is developed to produce sharper and visually pleasing results. On the other hand, variants of the autoencoder architecture with recurrent networks show the ability to directly learn binary representations in the bottleneck layer~\cite{Toderici_ICLR_2016,Toderici_CVPR_2017}. + + While theses methods only focus on still image compression, our algorithm is designed to improve video quality in streaming applications, especially in the domain-specific scenarios such as game or street view videos. To this end, we integrate existing video compression standards that can effectively exploit temporal information and learning-based methods that can efficiently transmit binary residual representations. As a result of the integration, our system can be adaptively applied to existing video compression platforms and improve their performance. + \begin{figure*}[t] + \centering + \includegraphics[width=0.85\linewidth]{fig/overview.png} + \caption{ + Overview of our proposed video streaming pipeline. It consists of two modules: a conventional H.264 module and our proposed residual autoencoder. The input to our residual module is the difference between the original and compressed videos. The difference is encoded and binarized to generate binary representations. We utilize Huffman coding to further compress the binary representations into a bit stream in a lossless manner. On the client side, we reconstruct the output video by adding back the decoded difference to the compressed video.} + \label{fig:overview} + \end{figure*} +\subsection{Post-processing to Remove Compression Artifacts} +Post-processing at the decoder end aims at reducing the coding artifacts without introducing additional bit rates at the encoder end. Earlier approaches~\cite{Reeve_icassp_1983,Chen_itcsvt_2001} manually use smoothing filters to reduce blocking effects caused by DCT in the expense of more blurry image outputs. Recently, learning-based methods~\cite{Chang_tip_2014,Chen_ICCV_2015,Liu_CVPR_2015,Mao_NIPS_2016} are developed to model different compression artifacts. For example, the ARCNN method~\cite{Dong_ICCV_2015} uses end-to-end training for removing various JPEG artifacts. Furthermore, the D3 scheme~\cite{Wang_CVPR_2016} employs the JPEG priors to improve the reconstruction results. Deeper models such as DDCN~\cite{Guo_ECCV_2016} are also developed to eliminate artifacts, and a recent work~\cite{Guo_CVPR_2017} combines the perceptual loss to generate visually pleasing outputs. We note that these post-processing methods require extensive computation on the client side, which is not well-suited for embedded devices. In contrast, our method encodes the residual information in a binary form on the server side and send it to the client. Utilizing the encoded residual information, the client can better recover the original video using much less computational power. +\section{Domain-specific Video Compression with Residual Autoencoder} +Here, we first introduce our video compression pipeline for streaming domain-specific videos. We then present the details of our autoencoder for encoding the residual information into binary forms and the training methods. +\subsection{Video Streaming Pipeline} +The proposed pipeline consists of two modules: a video compression module and a deep learning-based autoencoder, as shown in Figure~\ref{fig:overview}. The video compression module adopts the H.264 standard, which has demonstrated good performance in compressing temporally smooth visual signals, while our residual autoencoder assists to recover the lost information during compression on the client side by leveraging the property that the videos to be compressed are from the same domain. Using such a hybrid approach, not only can we improve the output quality by spending a small amount of effort, but also the system can adapt to existing compression platforms and train for specific domains by exploiting large-scale data. Note that, although we use H.264 in our pipeline, other video compression standards such as MPEG4 and HEVC can be used as well. + + + Given an input video $\mathbf{X}$, we obtain the compressed video $\mathbf{Y}$ by applying H.264. The difference between the two videos is called the residual information $\mathbf{R} = \mathbf{X} - \mathbf{Y}$. The larger the residual information, the poorer the compressed video quality. We also note that $\mathbf{R}$ is not included in $\mathbf{Y}$ because it consists of highly non-linear patterns, which can not be compressed effectively with conventional approaches. + + + We argue that by limiting the video domain, we could leverage a novel autoencoder to effectively compress the residual information. The autoencoder consists of a pair of functions $(\mathcal{E},\mathcal{D})$, where the encoder $\mathcal{E}$ maps $\mathbf{R}$ to a binary map and the decoder $\mathcal{D}$ recovers $\mathbf{R}$ from the binary map on the client side. The recovered residual information is referred to as $\hat{\mathbf{R}}$ and the final output video $\mathbf{Y}+\hat{\mathbf{R}}$ has a better visual quality than $\mathbf{Y}$. We note that the binary map is further mapped to a bit stream by using the Huffman coding algorithm~\cite{Cover_information_theory}, which is asymptotically optimal, to reduce its bandwidth usage. + + + Sending the bit stream of the residual information requires additional bandwidth. However, we can train an autoencoder that only requires a much smaller bandwidth to compress the residual information than H.264. Therefore, we can run the H.264 standard in a higher compression rate, which uses a smaller bandwidth but results in a larger residual signal. We then apply our autoencoder to compress the residual signal into a small bit stream. Considering a scenario where the bandwidth for a video stream is 5Mbps, we can apply the proposed pipeline to compress the video in 4Mbps using H.264 and utilize the remaining 1Mbps for sending the residual signal. Because our autoencoder is more efficient than H.264 in compressing the residual signal, our system achieve better performance than a baseline system that allocates all the 5Mbps for H.264. + + \begin{figure*}[t] + \centering + \includegraphics[width=0.85\linewidth]{fig/architecture.png} + \caption{ + Architecture of the proposed binary residual autoencoder. It process the video frame by frame. The autoencoder consists of an encoder, a binarizer and a decoder. The encoder/decoder, each has $L$ convolutional layers and each layer contains $C$/$4C$ channels. For simplicity, Huffman coding modules are not illustrated here. + } + \label{fig:autoencoder} + \end{figure*} + + One may wonder why not completely replacing the H.264 standard with the proposed residual autoencoder. We argue that our residual autoencoder is only more efficient than H.264 in compressing the residual signal. The carefully-engineered H.264 is more efficient in compressing the core video. By marrying the strength of H.264 and the proposed autoencoder, our hybrid system achieves better performance. Moreover, our pipeline can be easily integrated into the existing H.264 standard since the residual information can be attached in the meta field of a H.264 streaming packet. Hence we can enjoy the popularity of the H.264 standard and various hardware accelerators implemented for H.264. + + + We note that in the proposed domain-specific video streaming pipeline, one needs to send the parameters of $\mathcal{D}$ and the Huffman decoder table to the client for the streaming service, which requires an additional bandwidth. However, the parameters can be sent before the streaming starts. Once the parameters are sent, the user can enjoy the low latency and high video quality features of the proposed video streaming pipeline. +\subsection{Binary Residual Autoencoder} +We design an autoencoder that consists of three components: encoder $\mathcal{E}$, binarizer $\mathcal{B}$ (introduced in the next section) and decoder $\mathcal{D}$. For the encoder, the goal is to learn to extract compact feature representations for the following binarizer. We use $L$ convolutional layers in our encoder, in which each layer has the same channel number $C$ and a stride of two that down-samples feature maps. The binarizer converts the output from the last convolutional layer into a binary map. For the decoder, we aim to up-sample the binary map back to the original input. Our decoder has $L$ convolutional layers. At the end of each convolutional layer, a sub-pixel layer~\cite{Shi_CVPR_2016} is used for up-sampling. Since we aim for upsampling the resolution of the feature map by two on each spatial dimension, the channel number of each convolutional layer in the decoder is set to $4\times C$ due to the use of the sub-pixel layer. To facilitate the learning process, batch normalization~\cite{Ioffe_ICML_2015} and ReLU layers are used. The architecture of the autoencoder are given in Figure~\ref{fig:autoencoder}. + + + We encode and decode the residual signal $\mathbf{R}$ frame by frame. Let $\{r_i\}$ be a set of residual frames computed by applying H.264 at a target bit rate. We train our autoencoder by solving the following optimization problem: + \begin{equation} + \min_{\mathcal{D},\mathcal{E}} \sum_{i}||r_i -\mathcal{D}(\mathcal{B}(\mathcal{E}(r_i)))||_2^2. + \label{eq:l2} + \end{equation} + We care a lot about the bandwidth required for transmitting binary representations, which is determined by two factors: 1 the number of layers $L$ in the encoder, and 2) the number of channels $C$. Let $W$ and $H$ be the width and height of the input image, the binary map size is given by $\frac{C\times W\times H}{2^{2L}}$. A large number of $L$ and a smaller number of $C$ would result in a smaller size of the encoder output and hence a smaller binary map. However, a smaller encoder output makes training of the autoencoder difficult. In our experiments we will discuss the results with different numbers of $L$ and $C$. +\subsection{Training of the Binary Residual Autoencoder} +Binarizing feature maps in neural networks have been studied in several earlier works \cite{Rastegari_ECCV_2016,Courbariaux_corr_2016,Tang_AAAI_2017} for the purpose of reducing memory footprint in mobile devices. It is also used for image compression \cite{Toderici_ICLR_2016,Toderici_CVPR_2017}, while our work is different in that we binarize feature maps for video streaming. We will discuss several binarization methods here and compare their advantages and drawbacks when used in our pipeline in the experiment section. + + {\flushleft{\bf Formulation.}}~Let the output feature map of $\mathcal{E}$ be $e_i = \mathcal{E}(r_i)$. Our binarizer $\mathcal{B}$ aims to produce the binary output $\{-1, 1\}$\footnote{We have found that our network requires negative responses to achieve reasonable results. Instead of producing the binary output $\{0, 1\}$, we aim to generate the discrete output $\{-1, 1\}$.}. To generate such binary outputs, the process $\mathcal{B}$ consists of two parts: 1) map each element of the encoder output $e_i$ to the interval $[-1, 1]$, and 2) discretize it to $\{-1, 1\}$ given by: + \begin{equation} + \mathcal{B}(e_i) = b(\sigma(e_i)), + \label{eq: binary} + \end{equation} + where $\sigma$ and $b$ are the activation and discretization functions, respectively. In the following, we discuss different functions for activation (i.e., \textit{tanh}, \textit{hardtanh}, \textit{sigmoid}) and various methodologies for binarization (i.e., stochastic regularization \cite{Raiko_ICLR_2015} , Gumbel noise \cite{Jang_ICLR_2017,Maddison_ICLR_2017}). + + {\flushleft{\bf Tanh/Hardtanh Activation.}} \textit{tanh} is a common activation to project feature values to $[-1, 1]$, so as the approximation version \textit{hardtanh} function. Here, we define the binarized output as: + \begin{align} + b(z) = + \begin{cases} + 1, & \text{if $z\geq 0$} \\ + -1, & \text{if $z< 0,$} + \end{cases} + \label{eq: thres} + \end{align} + where $z = \sigma(e_i)$ and $\sigma$ can be the \textit{tanh} or \textit{hardtanh} function. However, since binarization is not a differentiable function, we can not train the proposed autoencoder using back-propagation. To avoid the issue, inspired by the recent binarization work~\cite{Courbariaux_corr_2016}, we adopt a piecewise function $b_{bp}$ during back-propagation: + \begin{align} + b_{bp}(z) = + \begin{cases} + 1, & \text{if $z> 1$} \\ + z, & \text{if $-1 \leq z \leq 1$} \\ + -1, & \text{if $z< -1.$} + \end{cases} + \label{eq: bp} + \end{align} + By using the straight-through estimator \cite{Courbariaux_corr_2016}, we can compute the gradient of $b_{bp}(z)$ and pass gradients through $b$ unchanged as: + \begin{align} + b_{bp}'(z) = + \begin{cases} + 1, & \text{if $-1 \leq z \leq 1$} \\ + 0, & \text{otherwise.} + \end{cases} + \label{eq: gradient} + \end{align} + + {\flushleft{\bf Sigmoid Activation.}} + The \textit{sigmoid} function outputs a value in $[0, 1]$. We convert the output to $[-1, 1]$ by applying $z = 2(\sigma(e_i)-0.5)$. We can then use the approach discussed in the previous paragraph for binarization and training. + + {\flushleft{\bf Stochastic Regularization.}} Following Toderici et al.~\cite{Toderici_ICLR_2016}, we incorporate a stochastic process into \eqref{eq: thres} using the \textit{tanh} activation: + \begin{equation} + b(z) = z + \epsilon, \notag + \end{equation} + where $\epsilon$ is a randomized quantization noise, resulting in: + \begin{align} + b(z) = + \begin{cases} + 1, & \text{with probability $\frac{1+z}{2}$} \\ + - 1, & \text{with probability $\frac{1-z}{2}.$} + \end{cases} + \label{eq: stochastic} + \end{align} + For back-propagation, similarly we can pass unchanged gradients through $b$ \cite{Toderici_ICLR_2016}. + + {\flushleft{\bf Gumbel Noise.}} The Gumbel-Softmax distributions have been utilized for learning categorical/discrete outputs \cite{Jang_ICLR_2017}. We adopt a similar approach by adding Gumbel noise in the \textit{sigmoid} function, which we refer as Gumbel-Sigmoid. Since \textit{sigmoid} can be viewed as a special 2-class case ($e_i$ and 0 in our case) of \textit{softmax}, we derive the Gumbel-Sigmoid as: + \begin{equation} + \sigma(e_i) = \frac{\exp((e_i + g_k)/\tau)}{\exp((e_i + g_k)/\tau) + \exp(g_l/\tau)}, + \label{eq: gumbel} + \end{equation} + where $g$ is the sample from the Gumbel noise and $\tau$ is the temperature that controls how closely the Gumbel-Sigmoid distribution approximates the binary distribution. From \eqref{eq: gumbel}, we can further simplify it as: + \begin{align} + \sigma(e_i) & = \frac{1}{1 + \exp(-(e_i + g_k - g_l)/\tau)} \notag \\ + & = sigm((e_i + g_k - g_l)/\tau), + \label{eq: gumbel_sigmoid} + \end{align} + where $sigm$ is the \textit{sigmoid} function. Since $\sigma(e_i)$ is still in the range of $[0, 1]$, we adopt the same approach as introduced before to shift the value via $z = 2(\sigma(e_i)-0.5)$. Following \cite{Jang_ICLR_2017}, we start with a high temperature and gradually anneal it to a small but non-zero temperature. + + \begin{table}[t] + \caption{Compression ratio versus number of bits in a group computed from our KITTI dataset experiments. + } + \small + \centering + \begin{tabular}{ccccc} + \toprule + \# of bits in a group & 8 & 16 & 32 & 64 \\ + \hline + Compression ratio & 1.05 & 1.47 & 3.03 & 6.67 \\ + \bottomrule + \end{tabular} + \label{tab:entropy} + \end{table} + + {\flushleft{\bf Lossless Compression.}} Once we generate the binary feature map, we further use Huffman coding \cite{Cover_information_theory} to reduce the size of the binary representation. These coding schemes are asymptotically optimal, which means that the more the number of bits we group together as a symbol, the better the compression ratio. Such a behavior is illustrated in Table \ref{tab:entropy} using the KITTI dataset. We note that other source coding methods such as arithmetic coding \cite{Marpe_itcsvt_2003} can be used as well. +\section{Experimental Results} +We evaluate our pipeline using the KITTI~\cite{Geiger_CVPR_2012} dataset, which consists of various driving sequences of street scenes, and three popular video games: Assassins Creed, Skyrim and Borderlands. The details of the datasets are shown in Table \ref{tab:dataset}. We use the tracking benchmark on the KITTI dataset that contains 50 street-view videos. We randomly select 42 videos for training and 8 videos for testing. The images in the videos are resized to $360 \times 1200$. The game video resolutions are $720 \times 1280$. + + We report PSNR and SSIM scores at different bit rates for quantitative comparisons. These two metrics are popular performance metrics for benchmarking video compression algorithms~\cite{Wang_TIP_2004}. We first conduct an ablation study using the KITTI dataset where we discuss the impact of layer and channel numbers in our design. We then compare various methods for training the autoencoder. Finally, we report the performance with comparisons to H.264 and a deep learning baseline. + \begin{table}[t] + \caption{Number of videos and frames on the datasets. + } + \small + \centering + \begin{tabular}{ccccc} + \toprule + & KITTI & Assassins Creed & Skyrim & Borderlands \\ + \hline + + Videos & 50 & 50 & 9 & 19 \\ + \hline + + Frames & 19,057 & 34,448 & 9,337 & 8,752\\ + \bottomrule + \end{tabular} + \label{tab:dataset} + \end{table} + {\flushleft{\bf Implementation Details.}} Throughout the paper, we use Adam~\cite{Kingma_ICLR_2015} to train our binary residual autoencoder. The learning rate is set to $10^{-3}$ and then decreased by half for every 5 epochs. The momentums are set to $0.9$ and $0.999$. The batch size is $10$, and we train the model for $50$ epochs. The implementation is based on PyTorch. + + {\flushleft{\bf Runtime Analysis.}} On the server side, our encoder and the binarizer takes about 0.001 seconds to compress the residual image with a resolution of $360 \times 1200$ using a Titan X GPU. The decoder on the client side takes 0.001 seconds to reconstruct the residual image. % +\subsection{Ablation Study} +{\flushleft{\bf Depth and Breadth of the Model.}} We analyze the impact of layer numbers $L$ and channel numbers $C$ on the video compression performance of our pipeline. For this study, the bandwidth of H.264 is set to 5Mbps for generating training and testing videos. We then train the residual autoencoder with different $L$ and $C$ utilizing the \textit{hardtanh} activation for binarization. These two parameters determine the size of the binary map, which has impacts on the compression rate as well as the training difficulty. Intuitively, the smaller the binary map, the easier the compression task but the harder the training task. The results are shown in Table~\ref{tab:bitrate}. Based on the bit rate, we divide the settings into three groups. The ones in the same group have a very similar bit rate after applying the Huffman coding. We then use the best setting in each bit rate group for the rest of the experiments. + + \begin{table}[t] + \caption{Impact of $L$ and $C$ on PSNR/SSIM.} + \centering + \begin{tabular}{ccccc} + \toprule + Group & Mbps & ($C$, $L$) & PSNR & SSIM \\ + \hline + \multirow{2}{*}{1} & \multirow{2}{*}{$\sim$0.24} &$(8, 3)$ & 29.28 & 0.8571 \\ + + & & $(32, 4)$ & \textbf{29.39} & \textbf{0.8577} \\ + \hline + + \multirow{2}{*}{2} & \multirow{2}{*}{$\sim$0.48} & $(16, 3)$ & \textbf{29.83} & \textbf{0.8681} \\ + + & & $(64, 4)$ & 29.81 & 0.8652 \\ + \hline + + \multirow{2}{*}{3} & \multirow{2}{*}{$\sim$0.96} & $(8, 2)$ & 30.35 & 0.8855 \\ + + & & $(32, 3)$ & \textbf{30.67} & \textbf{0.8901} \\ + \bottomrule + \end{tabular} + \label{tab:bitrate} + \end{table} + \begin{figure*}[t] + \centering + \begin{tabular}{ + @{\hspace{0mm}}c@{\hspace{0mm}} @{\hspace{0mm}}c@{\hspace{0mm}} @{\hspace{0mm}}c@{\hspace{0mm}} @{\hspace{0mm}}c@{\hspace{0mm}} + } + \includegraphics[width=0.25\linewidth]{fig/kitti_psnr.png} & + \includegraphics[width=0.25\linewidth]{fig/ac_psnr.png} & + \includegraphics[width=0.25\linewidth]{fig/sky_psnr.png} & + \includegraphics[width=0.25\linewidth]{fig/bl_psnr.png} \\ + + (a) KITTI & (b) Assassins Creed & (c) Skyrim & (d) Borderlands \\ + + \end{tabular} + \caption{PSNR comparisons on four datasets at different bandwidths. + We compare our pipeline with H.264 and an artifact-removal method based on~\cite{Kim_CVPR_2016,Zhang_TIP_2017}. + } + \label{fig:psnr} + \end{figure*} + \begin{figure*}[t] + \centering + \begin{tabular}{ + @{\hspace{0mm}}c@{\hspace{0mm}} @{\hspace{0mm}}c@{\hspace{0mm}} @{\hspace{0mm}}c@{\hspace{0mm}} @{\hspace{0mm}}c@{\hspace{0mm}} + } + + \includegraphics[width=0.25\linewidth]{fig/kitti_ssim.png} & + \includegraphics[width=0.25\linewidth]{fig/ac_ssim.png} & + \includegraphics[width=0.25\linewidth]{fig/sky_ssim.png} & + \includegraphics[width=0.25\linewidth]{fig/bl_ssim.png} \\ + + (a) KITTI & (b) Assassins Creed & (c) Skyrim & (d) Borderlands \\ + + \end{tabular} + \caption{SSIM comparisons on four datasets at different bandwidths. We compare our pipeline with H.264 and an artifact-removal method based on~\cite{Kim_CVPR_2016,Zhang_TIP_2017}. + } + \label{fig:ssim} + \end{figure*} + \begin{figure*}[!th] + \centering + \includegraphics[width=1\linewidth]{fig/kitti_v2.png} \\ + + \includegraphics[width=1\linewidth]{fig/skyrim_v2.png} \\ + + \includegraphics[width=1\linewidth]{fig/ac4_v2.png} \\ + + \caption{Example results on the KITTI and video game datasets. We compare our pipeline with H.264 and an artifact-removal method. The corresponding bit rate and PSNR are shown next to the images. Best viewed with enlarged images. + } + \label{fig:result} + \end{figure*} + + {\flushleft{\bf Binarization.}} We compare various methods discussed earlier for training the binary residual autoencoder. We fix $L=3$ and $C=32$ and train our model with different H.264 compression rates. The results are reported in Table \ref{tab:binary_psnr} and \ref{tab:binary_ssim}. We find that the models trained using \textit{hardtanh} and \textit{tanh} activations consistently outperform the others. The model trained with the stochastic regularization does not perform well possibly due to the training difficulty. It is known that the stochastic noise increases the gradient variance. In addition, we empirically find that the model using Gumbel-Sigmoid performs much worse for the residual signal compression task. (We note that \cite{Jang_ICLR_2017} uses the Gumbel noise for reconstructing discrete/categorical signals but not continuous signals of images in our task.). Hence, we use \textit{hardtanh} activations in the rest of the experiments for its superior performance. + + + \begin{table}[t] + \caption{Comparisons of different binarization methods on the KITTI dataset using PSNR. + } + \centering + \begin{tabular}{cccc} + \toprule + H.264 $@$ Mbps & 1M & 2M & 5M \\ + \hline + + Hardtanh & \textbf{28.95} & \textbf{29.97} & \textbf{30.67} \\ + \hline + + Tanh & \textbf{28.95} & \textbf{29.97} & \textbf{30.67} \\ + \hline + + Sigmoid & 28.89 & 29.88 & 30.61 \\ + \hline + + Stochastic & 28.26 & 29.21 & 29.78 \\ + \hline + + Gumbel-Sigmoid & 26.66 & 27.82 & 28.66 \\ + \bottomrule + \end{tabular} + \label{tab:binary_psnr} + \end{table} +\subsection{Video Compression Performance} +We compare our video compression pipeline to the H.264 standard and an artifact removal network, which is a popular approach to reduce distortions. Following recent deep learning works in image enhancement and denoising \cite{Kim_CVPR_2016,Zhang_TIP_2017}, we utilize a neural network with 8 convolutional layers (no strides) to remove the artifacts. The network takes the compressed H.264 images as inputs in a frame-by-frame fashion and outputs enhanced images. We then train an artifact removal network for each video domain for fair comparisons. + + We note that the proposed pipeline requires bandwidth for both H.264 and the binary map. We account both in the bit rate calculation for fair comparisons with the baseline methods. In other words, the bit rate of the proposed pipeline is the sum of the bit rate from the H.264 stream and the Huffman code of the binary map. Again, we do not take transmitting the network parameters into account since it can be sent before the streaming starts. In the streaming services, the main goal is to have high quality videos with low latency. + + We report PSNR and SSIM scores on the KITTI benchmark and 3 video games in Figures \ref{fig:psnr} and \ref{fig:ssim}. We find our pipeline consistently outperforms the baseline methods at all bit rates. Our pipeline achieves a PSNR of $33.26$dB at 5Mbps averaged on four datasets, which is $1.71$dB better than H.264 and $0.84$dB better than the artifact-removal network. Similarly, our pipeline performs better in SSIM, e.g., $5.3\%$ and $4.1\%$ improvements over H.264 and the artifact-removal network at 2Mbps, respectively. In Figure \ref{fig:result}, we present some qualitative results, showing our method preserves more details and textured contents (e.g., tree, rock and water) in reconstructed images using a smaller bandwidth\footnote{The website link http://research.nvidia.com/publication/2018-02\_Learning\-Binary\-Residual contains more visualization results.}. + + + To validate the importance of modeling the residual, we also carry out experiments by directly compressing the raw video using the same autoencoder architecture. However, it results in a worse performance compared to H.264 (0.52dB drop in PSNR) since this method does not leverage any motion information for video compression. Overall, our results show that by propagating the extracted binary residual representations from the server to the client, the quality of reconstructed videos can be largely improved. It outperforms the artifact removal network, which aims for solving a challenging inverse problem and does not leverage any prior knowledge about the compression process. In addition, the runtime of our binary residual autoencoder (decoding on the client side) is two times faster than the artifact removal network. + + \begin{table}[t] + \caption{Comparisons of different binarization methods on the KITTI dataset using SSIM. + } + \centering + \begin{tabular}{cccc} + \toprule + H.264 $@$ Mbps & 1M & 2M & 5M \\ + \hline + + Hardtanh & 0.8575 & \textbf{0.8773} & \textbf{0.8901} \\ + \hline + + Tanh & \textbf{0.8577} & 0.8770 & 0.8882 \\ + \hline + + Sigmoid & 0.8538 & 0.8722 & 0.8861 \\ + \hline + + Stochastic & 0.8297 & 0.8470 & 0.8617 \\ + \hline + + Gumbel-Sigmoid & 0.7683 & 0.8128 & 0.8464 \\ + \bottomrule + \end{tabular} + \label{tab:binary_ssim} + \end{table} +\section{Conclusions} +In this paper, we propose a video streaming system that integrates H.264 and a binary residual autoencoder to encode non-linear compression errors for domain-specific video streaming. We analyze various network design choices and methods for obtaining binary representations of the residual information. The binary representations are further compressed and transmitted from the server to the client. On the KITTI benchmark dataset and three popular video game datasets, the proposed algorithm generates better reconstructed videos than H.264 and artifact-removal methods while using a smaller bandwidth. + + {\bf \noindent Acknowledgment} The authors would like to thank Sam H. Azar and Zheng Yuan for their helpful discussions. + + \bibliography{mybib} + \bibliographystyle{aaai} diff --git a/1712.05231v2.txt b/1712.05231v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..458f0e0507273e12321dff1521af06769b95c475 --- /dev/null +++ b/1712.05231v2.txt @@ -0,0 +1,542 @@ +\section{Introduction} +\label{sec:introduction} + +Visual object tracking is one of the fundamental problems in computer vision with a variety of real-world applications, such as video surveillance and robotics. +Although having achieved substantial progress during past decade, it is still difficult to deal with the challenging unconstraint environmental variations, such as illumination changes, partial occlusions, motion blur, fast motion and scale variations. + + +\def\fight{0.112\textheight} +\def\fig{1line}{0.41} +\begin{figure}[!t] + \centering + \includegraphics[width=\fig1line\linewidth]{./figs/videos/48-176} + \includegraphics[width=\fig1line\linewidth]{./figs/videos/48-431} + \includegraphics[width=\fig1line\linewidth]{./figs/v1} + \includegraphics[width=\fig1line\linewidth]{./figs/v3} + + \includegraphics[width=0.8\linewidth]{./figs/labels.pdf} + \caption{The similarity geometric transformation representation achieves more accurate and robust tracking results. } % + \label{fig:top} +\end{figure} + + + + + + +\begin{table*}[!t] + \centering + \scriptsize + \caption{Comparison with different kinds of trackers.} + \label{tab:all} + +\begin{tabular}{@{}|l|l|c|c|c|c|c|c|l|@{}} +\toprule +Type & Trackers & Sample Num. & Scale & Rot. & Pretrain & Performance & GPU & FPS \\ \midrule +\multirow{3}{*}{\begin{tabular}[c]{@{}l@{}}Traditional\\Methods \end{tabular}} & Lucas-Kanade based~\cite{Baker2004Lucas} & Depends & $\surd$ & $\surd$ & $\times$ & Fair & $\times$ & Depends \\ + & Keypoint based~\cite{cmt} & Depends & $\surd$ & $\surd$ & $\times$ & Fair & $\times$& 1\texttildelow20 \\ + & Particle filter-based~\cite{ross2008incremental,Ji2012apga} & 300\texttildelow600 & $\surd$ & $\surd$ & $\times$ & Fair & $\times$& 1\texttildelow20 \\ + \hline +\multirow{2}{*}{\begin{tabular}[c]{@{}l@{}}Deep\\ Learning\end{tabular}} & MDNet~\cite{nam2015learning} & 250 & $\surd$ & $\times$ & $\surd$ & Excellent & $\surd$& \texttildelow1 \\ + & SiamFC~\cite{BertinettoVHVT16} & 5 & $\surd$ & $\times$ & $\surd$ & Excellent & $\surd$& 15\texttildelow25 \\ + \hline + \multirow{4}{*}{\begin{tabular}[c]{@{}l@{}}Correlation\\ Filter\end{tabular}} & original CF~\cite{henriques2015high,bolme2010visual} & 1 &$\times$ & $\times$ & $\times$ & Fair & $\times$ & 300+ \\ + & DSST~\cite{martin2017fdsst},SAMF~\cite{li2014scale} & 7\texttildelow33 & $\surd$ & $\times$ & $\times$ &Good & $\times$ &20\texttildelow80 \\ + & Ours & 2\texttildelow8 & $\surd$ & $\surd$ & $\times$ & Excellent & $\times$ & 20\texttildelow30 \\ + \hline +\end{tabular} +\end{table*} + + +Recently, correlation filter-based methods have attracted continuous research +attention~\cite{mueller2017ca,Ma-ICCV-2015,ma2015cvpr,zhang2017largedisplacement,li2017cfnn} due to its superior performance and robustness in contrast to traditional tracking approaches. +However, +with correlation filters, little attention has been paid on how to efficiently and precisely estimate scale and rotation changes, which are typically represented in a 4-Degree of Freedom (DoF) similarity transformation. +To deal with scale changes of the conventional correlation filter-based trackers,~\cite{martin2017fdsst} and~\cite{li2014scale} extended the 2-DoF representation of original correlation filter-based methods to 3-DoF space, which handles scale changes in object appearance by introducing a pyramid-like scale sampling ensemble. +Unfortunately, all these methods have to intensively resample the image in order to estimate the geometric transformation, which incurs huge amounts of computational costs. +In addition, their accuracy is limited to the pre-defined dense sampling of the scale pool. +This makes them unable to handle the large displacement that is out of the pre-defined range in the status space. +Thus, none of these methods is guaranteed to the optimum of the scale estimation. +On the other hand, rotation estimation for the correlation filter-based methods has not been fully exploited yet, since it is very easy to drift away from the inaccurate rotation predictions. +This greatly limits their scope of applications in various wide situations. +Table~\ref{tab:all} summarizes the +properties of several typical trackers. + + + + +To address the above limitations, in this paper, we propose a novel visual object tracker to estimate the similarity transformation of the target efficiently and robustly. +Unlike existing correlation filter-based trackers, we formulate the visual object tracking into a status space searching problem in a 4-DoF status space, which gives a more appropriate geometric transformation parameterization for the target. As shown in Fig.~\ref{fig:top}, the representation in similarity transformation describes the object more correctly and helps to track the visual object more accurately. +To yield real-time tracking performance in the 4-DoF space, we propose to tackle the optimization task of estimating the similarity transformation by applying an efficient Block Coordinates Descent (BCD) solver. +Specifically, we employ an efficient phase correlation scheme to deal with both scale and rotation changes simultaneously in log-polar coordinates and utilize a fast variant of correlation filter to predict the translational motion. +This scheme sets our approach free from intensive sampling, and greatly boosts the performance in the 4-DoF space. +More importantly, as BCD searches the entire similarity transformation space, the proposed tracker achieves very accurate prediction performance in large displacement motion while still retaining advantages of the efficiency and simplicity in conventional correlation filter. +Experimental results demonstrate that our approach is robust and accurate for both generic object and planar object tracking. + +The main contributions of our work are summarized as follows: 1) a novel framework of similarity transformation estimation which only samples once for correlation filter-based trackers; 2) a joint optimization to ensure the stability in translation and scale-rotation estimation; +3) a new approach for scale and rotation estimation with efficient +implementation which can improve a family of existing correlation filter-based +trackers~(our implementation is available at \url{https://github.com/ihpdep/LDES}).% +\section{Related Work} +Traditionally, there are three genres to handle scale and rotation changes. +The most widely used approach is to iteratively search in an affine status space with gradient descent-based method~\cite{Baker2004Lucas,wenjie2016rpca}. +However, they are easy to get stuck at local optima, which are not robust for large displacements. +Trackers based on particle filter~\cite{ross2008incremental,Ji2012apga,zhang2017mcpf,li2015reliable} search the status space stochastically by observing the samples, which are employed to estimate the global optima in the status space. +Their results are highly related to the motion model that controls the distribution of the 6-DoF transformation. +This makes the tracker perform inconsistently in different situations. +Another choice is to take advantage of keypoint matching to predict the geometric transformation~\cite{cmt,2010ferns}. +These keypoint-based trackers first detect feature points, and then find the matched points in the following frames. +Naturally, they can handle any kind of transformations with the matched feature points. +Due to the lack of global information on the whole target, these trackers cannot +effectively handle the general objects~\cite{kristan2015visual}. + + + + + + + +Our proposed method is highly related to correlation filter-based trackers~\cite{henriques2015high,bolme2010visual}. +~\cite{martin2017fdsst} and~\cite{li2014scale} extend the original correlation filter to adapt the scale changes in the sequences. +~\cite{bertinetto2015staple} combines color information with correlation filter method in order to build a robust and efficient tracker. +Later,~\cite{martin2015srdcf} and~\cite{galoogahi2017bacf} decouple the relationship between the size of filter and searching range. +These approaches enable the correlation filter-based methods to have larger searching range while maintaining a relative compact presentation of the learned filters. +~\cite{mueller2017ca} learns the filter with the additional negative samples to enhance the robustness. +Note that all these approaches emphasize on the efficacy issue, which employs either DSST or SAMF to deal with the scale changes. +However, % +these methods cannot deal with rotation changes. + + + + + +Fourier Mellin image registration and its variants~\cite{gopalan1994rotationInvariant,siavash2005logpolarRegistraion} are also highly related to our proposed approach. +These methods usually convert both the test image and template into log-polar coordinates, in which the relative scale and rotation changes turn into the translational displacement. +~\cite{gopalan1994rotationInvariant} propose a rotation-invariant correlation filter to detect the same object from a god view. +~\cite{siavash2005logpolarRegistraion} propose an image registration method to +recover large-scale similarity in spatial domain. +Recently,~\cite{yan2016logpolar} and~\cite{zhang2015cf-rotation} introduce the log-polar coordinates into correlation filter-based method to estimate the rotation and scale. +Compared with their approaches, we directly employ phase correlation operation in log-polar coordinates. Moreover, an efficient Block Coordinates Descent optimization scheme is proposed to % +deal with large motions with real-time performance. + + +\begin{figure*}[tbp] + \centering + \includegraphics[width=0.86\linewidth]{./figs/overall.pdf} + \caption{Overview of our proposed approach in estimation of similarity transformation.} + \label{fig:overview} + \end{figure*} +\section{Our Approach} +In this paper, we aim to investigate robust visual object tracking techniques to deal with challenging scenarios especially when there are large displacements. We propose a novel robust object tracking approach, named ''Large-Displacement tracking vis Estimation of Similarity~(LDES), where the key idea is to enable the tracker with capability in 2D similarity transformation estimation in order to handle large displacement. Figure~\ref{fig:overview} gives an overview of the proposed LDES approach. +In the following, we first formally formulate the problem as an optimization task, and then divide it into two sub-problems, translation estimation and scale-rotation prediction.% +We solve the two sub-problems iteratively to achieve a global optimal. +\subsection{Problem Formulation} +Given an image patch $\mathbf{x}_i$ sampled from the $i$-th frame ${I_i}$ in a video sequence, the key idea of our proposed approach is to estimate the +similarity transformation $Sim(2)$ in 2D image space of the tracked traget. To this end, we need to predict a 4-DoF transformation status vector $\mathbf{\tau}_i \in \mathcal{R}^4 $ based on the output of the previous frame. Generally, $\mathbf{\tau}_i$ is obtained by optimizing the following score function: + +\begin{equation} + \tau_i = \arg \max_{\tau \in Sim(2)} f(\mathcal{W}( {I}_i,\tau); \mathcal{\mathbf{h}}_{i-1}), + \label{eq:eq1} +\end{equation} +where $f(\cdot)$ is a score function with the model $\mathbf{h}_{i-1}$ learned from the previous frames $I_{1:i-1}$. $\mathcal{W}$ +is an image warping function that samples the image ${I}_i$ with respect to the similarity transformation status vector $\tau$. + +The 2D similarity transformation $Sim(2)$ deals with 4-DoF $\{t_x,t_y,\theta,s\}$ motion, where $\{t_x,t_y\}$ denotes the 2D translation. $\theta$ denotes the in-plane rotation angle, and $s$ represents the scale change with respect to the template. Obviously, $Sim(2)$ has a quite large searching space, which is especially challenging for real-time applications. A typical remedy is to make use of effective sampling techniques to greatly reduce the searching space~\cite{particlefilter}. + +Since the tracking model $\mathbf{h}_{i-1}$ is learned from the previous frame, which is kept constant during the prediction. The score function $f$ is only related to the status vector $\tau$. We abuse the notation for simplicity: +\begin{equation} + f_i(\tau) = f(\mathcal{W}( {I}_i,\tau);\mathbf{h}_{i-1}). +\end{equation} + +Typically, most of the conventional correlation filter-based methods only take into account of in-plane translation with 2-DoF, where the score function $f_i$ can be calculated completely and efficiently by taking advantage of Convolution Theorem. To search the 4-DoF similarity space, the total number of candidate status exponentially increases. + +Although Eq.~\ref{eq:eq1} is usually non-convex, the optimal translation is near to the one in the previous frame in object tracking +scenarios. Thus, we assume that the function is convex and smooth in the nearby region, and split the similarity transformation $Sim(2)$ into two blocks, $\mathbf{t}=\{t_x,t_y\}$ and $\rho = \{\theta,s\}$, respectively. We propose a score function $f_i(\tau)$, which is the linear combination of three separate parts: +\begin{equation} + f_i(\mathbf{\tau};\mathbf{h}_{i-1}) = \eta f_t(\mathbf{t};\mathbf{h_t}) + (1-\eta) f_{\rho}(\mathbf{\rho};\mathbf{h}_{\rho}) + g(\mathbf{t},\mathbf{\rho}), + \label{eq:score} +\end{equation} +where $\eta$ is an interpolation coefficient. $f_t$ is the translational score function, and $f_{\rho}$ denotes the scale and rotation score function. $g(\mathbf{t},\mathbf{\rho})=exp(|\tau - \tau_{i-1}|_2)^{-1}$ is the motion model which prefers the location nearby the last status. Please note that we omit the subscript $i-1$ of $\mathbf{h_t}$ and $\mathbf{h}_{\rho}$ for simplicity. + +Eq.~\ref{eq:score} is a canonical form which can be solved by the Block Coordinate Descent Methods~\cite{peter2014cd,yu2010cd}. We optimize the following two subproblems alternatively to achieve the global solution: +\begin{equation} + \arg \max_{\mathbf{t}} g(\mathbf{t},{\rho}^*) + \eta f_t(\mathbf{t}), + \label{eq:eq3} +\end{equation} +\begin{equation} + \arg \max_{{\rho}} g(\mathbf{t}^*,{\rho})+ (1-\eta)f_\rho(\rho) , + \label{eq:eq4} +\end{equation} +${\rho}^*$ and $\mathbf{t}^*$ denote the local optimal estimation result from previous iteration, which is fixed for the current subproblem. Since $g$ can be calculated easily, the key to solving Eq.~\ref{eq:eq1} in real-time is to find the efficient solvers for the above two subproblems, $f_\rho$ and $f_t$.% +\subsection{Translation Estimation by Correlation Filter} +Translation vector $\mathbf{t}$ can be effectively estimated by Discriminative Correlation Filters (DCF)~\cite{henriques2015high,mueller2017ca}. A large part of its success is mainly due to the Fourier trick and translation-equivariance within a certain range, which calculates the $f_t$ in the spatial space exactly. According to the property of DCF, the following equation can be obtained: +\begin{equation} + f_t(\mathcal{W}({I},\mathbf{t});\mathbf{h_t}) = \mathcal{W}( f_t({I};\mathbf{h_t}),\mathbf{t}). + \label{eq:eq6} +\end{equation} +Since the calculation of $\arg \max_{\mathbf{t}} \mathcal{W}( f_t({I};\mathbf{h_t}),\mathbf{t})$ is unrelated to $\mathcal{W}$, we can directly obtain the transformation vector $\mathbf{t}$ from the response map. +Thus, the overall process is highly efficient. The score function $f_t$ can be obtained by +\begin{equation} + f_t(\mathbf{z}) = \mathcal{F}^{-1}\sum_{k}\hat{\mathbf{h_t}}^{(k)}\odot\hat\Phi^{(k)}(\mathbf{z}), + \label{eq:eq7} +\end{equation} +where $\mathbf{z}$ indicates a large testing patch. +$\mathcal{F}^{-1}$ denotes the inverse Discrete Fourier Transformation operator, $\odot$ is the element-wise multiplication and $\hat{\cdot}$ indicates the Fourier space. +$\mathbf{h_t}^{(k)}$ and $\Phi^{(k)}$ represent the $k$-th channel of the linear model weights and the feature map, respectively. +The whole computational cost is $\mathcal{O}(KN\log N)$, where $K$ is the channel number and $N$ is the dimension of the patch $\mathbf{z}$. + +To this end, we need to learn a model $\mathbf{h_t}$ in the process. Note that any quick learning method can be used. Without loss of generality, we briefly review a simple correlation filter learning approach~\cite{bolme2010visual} as follows: +\begin{equation} + \begin{aligned}{{{\left\| \sum\limits_k {\Phi^{(k)}(\mathbf{x}) \star{\mathbf{{h}_t}^{(k)}} - {\mathbf{y}}} \right\|}_2^2} + \lambda_1{{\left\| \mathbf{h_t} \right\|}_2^2}}, % + \label{eq:eq8} + \end{aligned} +\end{equation} +where $\star$ indicates the correlation operator and $\lambda_1$ is the regularization filters. $\mathbf{y}$ is the desired output, which is typically a Gaussian-like map with maximum value of one. + According to Parseval's theorem, the formulation can be calculated without correlation operation. +By stalling each channel and vectorizing the matrix, Eq.~\ref{eq:eq8} can be reformulated as a normal ridge regression without correlation operation. Thus, the solution to +Eq.~\ref{eq:eq8} can expressed as follows: +\begin{equation} + \mathbf{\hat{h}_t} = (\mathbf{\hat{X}}^T\mathbf{\hat{X}} + \lambda_1\mathbf{I})^{-1}\mathbf{\hat{X}}^T\mathbf{\hat{y}}, +\end{equation} +where $\mathbf{\hat{X}} = [\mathbf{diag}({\hat\Phi^{(1)}(\mathbf{x})})^T,...,\mathbf{diag}({\hat\Phi^{(K)}(\mathbf{x})})^T]$ +and +$\mathbf{\hat{h}_t} = [\mathbf{\hat{h}_t}^{(1)T},...,\mathbf{\hat{h}_t}^{(K)T}]^T$. +In this form, we need to solve a $KD \times KD $ linear system, where $D$ is the dimension of testing patch $\mathbf{x}$. + + +\def\stopfig{0.146} +\begin{figure*}[tbp] + \centering + \includegraphics[width=\stopfig\linewidth]{./figs/img2} + \includegraphics[width=\stopfig\linewidth]{./figs/img1} + \includegraphics[width=\stopfig\linewidth]{./figs/log2} + \includegraphics[width=\stopfig\linewidth]{./figs/log1} + \includegraphics[width=\stopfig\linewidth]{./figs/r1} + \includegraphics[width=\stopfig\linewidth]{./figs/r2.png} + + \caption{ The 3rd and 4th charts are corresponding Log-polar coordinates of the 1st and 2nd images. 2nd image is a $30^{\circ}$ rotation and 1.2 times scale version of the first image. + The last two charts are the phase correlation response maps. In log-polar coordinates, the response is a peak while it is noisy in Cartesian coordinates.} + \label{fig:log} + \end{figure*} + + +To solve our sub-problem efficiently, we assume that every channel is independent. Thus, by applying Parseval's theorem, the whole system can be simplified as element-wise +operation. The final solution can be derived as below: + +\begin{equation} + \begin{aligned} + \mathbf{\hat{h}_t}^{(k)} + &= \hat\alpha \odot{\hat\Psi}^{(k)}\\ +&=(\mathbf{\hat{y}}\odot^{-1} (\sum_k\hat\Phi^{(k)}(\mathbf{{x}})^* \odot \hat\Phi^{(k)}(\mathbf{{x}}) + \lambda)) \odot \hat\Phi^{(k)}(\mathbf{{x}})^* , + \label{eq:eq10} + \end{aligned} +\end{equation} +where +$\alpha$ denotes the parameters in dual space and $\Psi $ indicates the model sample in feature space. +$\odot^{-1}$ is the element-wise division. +Thus, the solution can be very efficiently +obtained with a computational cost of $\mathcal{O}(KD)$. With Eq.~\ref{eq:eq10}, +the computational cost of Eq.~\ref{eq:eq8} is $\mathcal{O}(KD\log D)$ which is +dominated by the FFT operation. For more details, please refer +to the seminal work~\cite{henriques2015high,multichannel2013mccf,mueller2017ca}. +\subsection{Scale and Rotation in Log-polar Coordinates} +We introduce an efficient method to estimate scale and rotation changes simultaneously in the log-polar coordinates. +\subsubsection{Log-Polar Coordinates} +Suppose an image $I(x,y)$ in the spatial domain, the log-polar coordinates $I'(s,\theta)$ can be +viewed as a non-linear and non-uniform transformation of the original Cartesian +coordinates. Like polar coordinates, the log-polar coordinates needs a +pivot point as the pole and a reference direction as the polar axis in order to expend +the coordinates system. One of the dimension is the angle between the point and +the polar axis. The other is the logarithm of the distance between the point and the pole. + +Given the pivot point $(x_0,y_0)$ and the reference direction $\mathbf{r}$ +in Cartesian coordinates, the relationship between Cartesian coordinates and +Log-polar coordinates can be formally expressed as follows: +\begin{equation} + \begin{aligned} + &s = \log(\sqrt{(x-x_0)^2 + (y-y_0)^2})\\ + &\theta = \cos^{-1}(\frac{<\mathbf{r},(x-x_0,y-y_0)>}{||\mathbf{r}||\sqrt{(x-x_0)^2 + (y-y_0)^2}}). + \label{eq:eq11} + \end{aligned} +\end{equation} + + Usually, the polar axis is chosen as the $x$-axis in Cartesian coordinates, where + $\theta$ can be simplified as $\tan^{-1}(\frac{y-y_0}{x-x_0})$. Suppose two images are related + purely by rotation $\tilde{\theta}$ and scale $e^{\tilde{s}}$ which can be written as + $I_0(e^s\cos\theta,e^s\sin\theta) = + I_1(e^{s+\tilde{s}}\cos(\theta+\tilde{\theta}),e^{s+\tilde{s}}\sin(\theta+\tilde{\theta}))$ + in Cartesian coordinates. +The log-polar coordinates enjoy an appealing merit that the relationship in the above equation can be derived as the following formula in log-polar coordinates: +\begin{equation} + I_0'(s,\theta) = I_1'(s+\tilde{s},\theta+\tilde{\theta}), +\end{equation} + where the pure rotation and scale changes in Log-polar coordinates can be viewed as the translational moving along the axis. +As illustrated in Fig.~\ref{fig:log}, this property naturally can be employed to estimate the scale and rotation changes of the tracked target. +\subsubsection{Scale and Rotation Changes} +By taking advantage of the log-polar coordinates, Eq.~\ref{eq:eq4} can be calculated very +efficiently. Similarly, scale-rotation invariant can be hold as in Eq.~\ref{eq:eq6}. The scale-rotation can be calculated as below: +\begin{equation} + f_{\rho}(\mathcal{W}(I_i,\rho);\mathbf{h}_\rho) = \mathcal{W}( f_{\rho}(I_i;\mathbf{h}_\rho),\rho'), +\end{equation} +where $\rho'=\{\theta',s'\}$ is the coordinates of $\rho$ in log-polar space. +$s = e^{s'\log(W/2)/W}$ and $\theta = 2\pi\theta'/H$. $H$ and $W$ is the height and width of the image $I_i$, respectively. +Similar to estimating the translation vector $\mathbf{t}$ by $f_{t}$, the whole space of $f_{\rho}$ can be computed at once through the Fourier trick: +\begin{equation} + f_{\rho}(\mathbf{z}) = \mathcal{F}^{-1}\sum_{k}\mathbf{\hat{h}}_{\rho}^{(k)}\odot\hat\Phi^{(k)}(\mathcal{L}(\mathbf{z})), + \label{eq:eq14} +\end{equation} +where $\mathcal{L}(x)$ is the log-polar transformation function, and $\mathbf{h}_{\rho}$ is a linear +model weights for scale and rotation estimation. Therefore, the scale and rotation estimation can be obtained very efficiently without any transformation sampling $\mathcal{W}$. Note that the computational cost of Eq.~\ref{eq:eq14} is unrelated to the sample numbers of scale or rotation. This is extremely efficient compared to the previous enumerate methods~\cite{li2014scale,martin2017fdsst} + + +To obtain the $\mathbf{\hat{h}}_{\rho}$ efficiently, we employ the phase-correlation to conduct the estimation, +\begin{equation} + \mathbf{\hat{h}}_{\rho} = \hat{\Upsilon}^* \odot^{-1} |\hat{\Upsilon} \odot \hat\Phi(\mathcal{L}(\mathbf{x}))|, +\end{equation} +where $\Upsilon = \sum_{j}\beta_j\Phi(\mathcal{L}(\mathbf{x}_j))$ is the linear combination of +previous feature patch and $|\cdot|$ is the normal operation. +Intuitively, we compute the phase correlation between current frame and the average of previous frames to align the image. +\subsection{Implementation Details} +In this work, we alternatively optimize Eq.~\ref{eq:eq3} and +Eq.~\ref{eq:eq4} until $f(\mathbf{x})$ does not decrease or reaches the maximal number +of iterations. After the optimization, we update the correlation filter model as +\begin{equation} + \hat\Psi_i = (1-\lambda_{\phi})\hat\Psi_{i-1} +\lambda_{\phi}\hat\Phi(\mathbf{{x_i}}), +\end{equation} +where $\lambda_\phi$ is the update rate of the feature data model in Eq.~\ref{eq:eq10}. +The kernel weight in dual space is updated as below: +\begin{equation} +\begin{aligned} + \hat{\mathbf{\alpha}}_i =& (1-\lambda_\alpha)\hat{\mathbf{\alpha}}_{i-1} \\ + +&\lambda_\alpha (\hat{\mathbf{y}} \odot^{-1} (\sum_k\hat\Phi^{(k)}(\mathbf{{x}}_i)^*\odot \hat\Phi^{(k)}(\mathbf{{x}}_i) + \lambda_1)), + \end{aligned} +\end{equation} +where $\lambda_\alpha$ is the update of the kernel parameter in dual space of Eq.~\ref{eq:eq10}. Although there exist some theoretical sounding updating schemes~\cite{kiani2015cfwlb,martin2017eco,martin2015srdcf}, the reason we use linear combination is due to its efficiency and the comparable performance. + +Meanwhile, we also update the scale and rotation model as a linear combination, +\begin{equation} + \Upsilon_i = (1-\lambda_w)\Upsilon_{i-1} + \lambda_w\Phi(\mathcal{L}(\mathbf{x}_i)), +\end{equation} +where $\lambda_w$ can be explained as an exponentially weighted average of the model $\beta_j\Phi(\mathcal{L}(\mathbf{x}_j))$. +We update the model upon $\Phi$ instead of $x_i$ because +$\Phi(\sum_i \mathcal{L}(\mathbf{x}_i))$ is not defined. +The logarithm function in log-polar transformation intends to blur the image due to the nonuniform sampling. This will decrease the visual information in the original images. + +To alleviate the artificial effects casued by discretization, we interpolate the $f_{t}$ and $f_{\rho}$ with a centroid-based method to obtain sub-pixel level precision. +In addition, +we use different size of $\mathbf{z}$ in testing and $\mathbf{x}$ in training since a larger search range ($N>D$) help to improve the robustness for the solution to sub-problems. +To match the different dimension $N$ and $D$, we pad $\mathbf{h}$ with zero in spatial space. + + + +\def\tbfig{0.23} +\begin{figure*}[!t] + \centering + \subfloat[Overall results on OTB-2013]{ + +\includegraphics[width=\tbfig\linewidth]{./eps/tb50-overlap} +\includegraphics[width=\tbfig\linewidth]{./eps/tb50-error} +} + \subfloat[Overall results on OTB-100]{ + +\includegraphics[width=\tbfig\linewidth]{./eps/tb100-overlap} +\includegraphics[width=\tbfig\linewidth]{./eps/tb100-error} +} + + + + + +\caption{The overall and scale performance in precision and success plots on OTB-2013 and OTB-100 dataset.} +\label{fig:tb100} +\end{figure*} +\section{Experiments} +In this section, we conduct four different experiments to evaluate our proposed tracker LDES comprehensively. +\subsection{Experimental Settings} +All the methods were implemented in Matlab and the experiments were conducted on a PC with an Intel i7-4770 3.40GHz CPU and 16GB RAM. +We employ HoG feature for both translational and scale-rotation estimation, and the extra color histogram is used to estimate translational. +All patch is multiplied a Hann window as suggested in~\cite{bolme2010visual}. +$\eta$ is 0.15 and $\lambda$ is set to $1e^{-4}$. $\lambda_\phi$ and $\lambda_\alpha$ are both set to 0.01. $\lambda_\omega$ is 0.015. +The size of learning patch $D$ is 2.2 larger than the original target size. Moreover, the searching window size $N$ is about 1.5 larger than the learning patch size $D$. For scale-rotation estimation, the phase correlation sample size is about 1.8 larger than the original target size. All parameters are fixed in the following experiments. +\subsection{Experiments on Proposed Scale Estimator} +As one of the contributions in our work is a fast scale estimator, we first evaluate our proposed log-polar based scale estimator on OTB-2013 and OTB-100 dataset~\cite{wu2013online,wu2015object}. % +Three baseline trackers are involved in the scale estimation evaluation. They are SAMF~\cite{li2014scale}, +fDSST~\cite{martin2017fdsst} and ECO~\cite{martin2017eco}. For fair comparison, we implement three counterpart-trackers including fDSST-LP, SAMF-LP and ECO-LP, which replace the original scale algorithm with our proposed scale estimator.% + + +In Fig.~\ref{fig:compare}, these variant trackers with our scale component outperform their original implementation. This indicates that our proposed scale estimator has superior performance compared with current state-of-the-art scale estimator. Specifically, ECO-LP achieves 69.1\% and 67.3\% in OTB-2013 and OTB-2015 respectively, compared with its original CPU implementation's 67.8\% and 66.8\%. This proves the effectiveness of our proposed scale method since it can even improve the state-of-the-art tracker with a simple replacement of the scale component. + + +Since the proposed scale estimator only samples once in each frame, the most significant part is the efficiency of scale estimating. In Table~\ref{tab:speed}, the proposed approach has a 3.8X+ speedup on SAMF, and ECO, which obtains a significant improvement on efficiency. Even with fDSST which is designed in efficiency with many tricks, our method can still reduce its computational time. This strongly supports that our proposed scale estimator is superior to current state-of-the-art scale estimating approaches. % +In addition, our method is very easy to implement and plug-in to other trackers. + + + +\def\lastfhtt{0.13\textheight} +\begin{figure} [!t] + \normalsize + \centering + \includegraphics[height=\lastfhtt]{./charts/compare5} + \includegraphics[height=\lastfhtt]{./charts/compare6} + + \caption{Evaluation of tracking success rate improvements over the original implementations of different trackers enhanced by the proposed scale estimator. } + \label{fig:compare} + +\end{figure} +\subsection{Comparison with Correlation Filter Trackers} +With efficient and effective scale estimator, our proposed tracker performs very promising in different situations. +We select seven state-of-the-art Correlation Filter-based trackers% +as reference methods, including ECO-HC~\cite{martin2017eco}, SRDCF~\cite{martin2015srdcf}, +Staple~\cite{bertinetto2015staple}, SAMF, +fDSST, +BACF~\cite{galoogahi2017bacf}, and KCF~\cite{henriques2015high}. +We initialize the proposed tracker with axis-aligned bounding box and ignore the rotation parameter in the similarity transformation as tracking output since the benchmarks only provide axis-aligned labels. + + + + + +In Fig.~\ref{fig:tb100}, % +it can be clearly seen that our proposed method outperforms most of the state-of-the-art correlation filter-based trackers and obtains 67.7\% and 81.0\% in OTB-2013 success and precision plots, and 63.4\% and 76.0\% in OTB-100 plots respectively. +ECO-HC achieves better results in OTB-100. However, we can see that our method is more accurate above 0.6 overlap threshold in success plot and comparable in the precision plot. The reason is that introducing rotation improves the accuracy but also enlarges the search space and hurts the robustness when large deformation occurs. In general, our method is very promising in generic object tracking task. + +The proposed approach maintains 20 fps with similarity estimation and is easy to implement due to its simplicity. Moreover, our no-BCD version tracker achieves 82 fps in the benchmark while stall maintains comparable performance (67.5\% and 62.2\% accuracy in OTB-2013 and OTB-100, respectively). + + + + + + + + + + + + + +Please note that our proposed LDES is quite stable in searching the 4-DoF status space. Introducing rotation gives the tracker more status choice in tracking process while the benchmark only provides axis-aligned labels which make the performance less robust in OTB-100. However, our proposed tracker still ranks 1st and 2nd in OTB-2013 and OTB-100 respectively, and beats most of the other correlation filter-based trackers. + + + + + + + + + +\begin{table}[!] + \centering + \footnotesize +\caption{Evaluation of speedup results on different trackers achieved by applying the proposed Log-Polar~(LP) based scale estimator.} +\label{my-label} +\begin{tabular}{|l|c||l|c||c|} + \hline +Trackers & FPS & Trackers & FPS & Speedup \\ +\hline +fDSST & 101.31& fDSST-LP & 112.77 & 1.11X \\ +\hline +SAMF & 20.95 & SAMF-LP & 86.75 & 4.14X \\ +\hline +ECO & 2.58 & ECO-LP & 9.88 & 3.82X\\ +\hline +\end{tabular} +\label{tab:speed} +\end{table} + + + + +\def\pot{_h}{0.13\textheight} +\begin{figure*}[!t] + \centering + \subfloat[All 210 sequences]{ + \includegraphics[height=\pot_h]{./pfigs/All-seq-precision} + \includegraphics[height=\pot_h]{./pfigs/All-seq-homography} + \label{fig:pot:a} + } + \subfloat[30 videos with unconstrained changes]{ + \includegraphics[height=\pot_h]{./pfigs/UC-precision} + \includegraphics[height=\pot_h]{./pfigs/UC-homography} + \label{fig:pot:b} + } + + \subfloat[30 videos with pure rotation changes]{ + \includegraphics[height=\pot_h]{./pfigs/RT-precision} + \includegraphics[height=\pot_h]{./pfigs/RT-homography} + \label{fig:pot:c} + } + \subfloat[30 videos with pure scale changes]{ + \includegraphics[height=\pot_h]{./pfigs/SC-precision} + \includegraphics[height=\pot_h]{./pfigs/SC-homography} + \label{fig:pot:d} + } + + + +\caption{Precision and success plots on the POT dataset.} + +\label{fig:pot} +\end{figure*} +\subsection{Comparison with State-of-the-Art trackers on POT} +\begin{table*}[!t] + \centering + \footnotesize +\begin{tabular}{|c|c|c|c|c|c|c|c||c|} + \hline +Precision & Scale & Rotation & Persp. Dist. & Motion Blur & Occlusions & Out of View & Unconstrained & ALL\\ \hline +LDES & \textbf{0.7858} & \textbf{0.6986} & \textbf{0.2807} & \textbf{0.1699} & 0.6277 & \textbf{0.5663} & \textbf{0.4159} & \textbf{0.5064}\\ \hline +LDES-NoBCD & 0.6461 & 0.6898 & 0.2528 & 0.1595 & \textbf{0.6679} & 0.5507 & 0.3759 & 0.4775\\ \hline +\hline +Success & Scale & Rotation & Persp. Dist. & Motion Blur & Occlusions & Out of View & Unconstrained & ALL\\ \hline +LDES & \textbf{0.5298} & 0.6778 & \textbf{0.3339} & \textbf{0.44} & 0.5947 & \textbf{0.5629} & \textbf{0.4526} & \textbf{0.5131}\\ \hline +LDES-NoBCD & 0.4724 & \textbf{0.6849} & 0.3215 & 0.43 & \textbf{0.6392} & 0.5615 & 0.4353 & 0.5064\\ \hline +\end{tabular} + + \caption{Comparison in all 7 categories attributed videos on POT benchmark.} +\label{tab:pot} + \end{table*} + + + + + + +To better evaluate our proposed approach to rotation estimation, we conduct an additional experiment on POT benchmark~\cite{lian2017pot} which is designed to evaluate the planar transformation tracking methods. +The POT dataset contains 30 objects with 7 different categories which yield 210 videos in total. +Alignment error and homography discrepancy are employed as the evaluation metrics. +In addition, six state-of-the-art trackers and two rotation-enabled trackers are involved.% +They are ECO-HC, ECO~\cite{martin2017eco}, MDNet~\cite{nam2015learning}, BACF~\cite{galoogahi2017bacf}, ADNet~\cite{yun2017adnet}, SiameseFC~\cite{BertinettoVHVT16}, IVT~\cite{ross2008incremental} and L1APG~\cite{Ji2012apga}. +To illustrate the POT plots appropriately, we set the maximal value of the alignment error axis from 20 to 50 pixels in precision plot and utilize the AUC as the metrics for ranking in both precision and homography discrepancy plots as same as OTB~\cite{wu2015object}. + + + + + +Fig.~\ref{fig:pot} shows that % +our proposed tracker, with hand-craft features only, performs extremely well in all sequences attributed plots and even outperforms deep learning based methods with a large margin. +In Fig.~\ref{fig:pot:a}, our LDES achieves 50.64\% and 51.31\% compared with second rank tracker ECO's 35.99\% and 37.79\% in precision and success rate plots within all 210 sequences, which is a 13\%+ performance improvement. % +Since the POT sequences are quite different from OTB, it indicates our proposed method has better generalization capabilities compared with pure deep learning based approaches in wide scenarios. +It also shows that our proposed method is able to search the 4-DoF similarity status simultaneously, efficiently and precisely. + + +Moreover, our method ranks 1st in almost all other plots.% +It not only validates the effectiveness of our proposed rotation estimation but also shows the superiority of our method compared with traditional approaches. +In Fig.~\ref{fig:pot:d}, we argue that our proposed log-polar based scale estimation is at least comparable with mainstream methods in performance. +\subsection{BCD Framework Evaluation on POT} +To verify the proposed framework with Block Coordinate Descent (BCD), we implement an additional variant, named LDES-NoBCD, which turns off the BCD framework and only estimates the object status once in each frame. We conduct comparison experiments on POT benchmark with LDES and LDES-NoBCD. + +In Table~\ref{tab:pot}, LDES performs better than its No BCD version in most of the categories. Specifically, BCD contributes more performance in scale attributed videos and unconstrained videos. LDES achieves 0.7858 and 0.5298 in scale compared with LDES-NoBCD's 0.6461 and 0.4724, which is about 14\% improvement in precision plot and 5\% in success plot, respectively. This indicates that the proposed framework ensures the stable searching in the 4-DoF space. + +In rotation column, % +the ranks in precision and success rate metrics are inconsistent. The reason is that rotation attributed videos contain pure rotation changes. This gives rotation estimation a proper condition to achieve a promising result.% +The only category that LDES performs inferior is occlusion attributed videos. When the occlusion occurs, BCD framework tries to find the best status of the templated object while the original object is being occluded and cannot be seen properly. This leads the algorithm to an inferior status. In contrast, No-BCD version algorithm does not search an optimal point in the similarity status space.% +\section{Conclusion} +In this paper, we proposed a novel visual object tracker for robust estimation of similarity transformation with correlation filter. +We formulated the 4-DoF searching problem into two 2-DoF sub-problems and applied a Block Coordinates Descent solver to search in such a large 4-DoF space with real-time performance on a standard PC. +Specifically, we employed an efficient phase correlation scheme to deal with both scale and rotation changes simultaneously in log-polar coordinates and utilized a fast variant of correlation filter to predict the translational motion. +Experimental results demonstrated that the proposed tracker achieves very promising prediction performance compared with the state-of-the-art visual object tracking methods. +\section*{Acknowledgments} +This work is supported by the National Key Research and Development Program of China (No. 2016YFB1001501) and also by National Natural Science Foundation of China under Grants (61831015). This research is also supported by the National Research Foundation Singapore under its AI Singapore Programme [AISG-RP-2018-001], and the National Research Foundation, Prime Minister’s Office, Singapore under its International Research Centres in Singapore Funding Initiative. + +\bibliography{bare_jrnl_compsoc} +\bibliographystyle{aaai} diff --git a/1712.05403v1.txt b/1712.05403v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..f9001d3483ce3822efce351b56e4ee814a12d66b --- /dev/null +++ b/1712.05403v1.txt @@ -0,0 +1,265 @@ +\section{Introduction} +Sentiment analysis lives at the heart of many business and social applications which explains its wild popularity in NLP research. Aspect-based sentiment analysis (ABSA) goes deeper by trying to predict polarity with respect to a specific aspect term. For example, consider the following review, \textit{`I love the user interface but this app is practically useless!'}. Clearly, we observe that there are two aspects (user interface and functionality) with completely opposite polarities. As such, techniques that are able to incorporate aspect for making predictions are not only highly desirable but also significantly more realistic compared to coarse-grained sentiment analysis. Recently, end-to-end neural networks (or deep learning) \cite{DBLP:conf/emnlp/WangHZZ16,DBLP:conf/wsdm/LiGM17} such as the long short-term memory networks \cite{hochreiter1997long} and memory networks \cite{DBLP:conf/nips/SukhbaatarSWF15} have demonstrated promising performance on ABSA tasks without requiring any laborious feature engineering. + +The task of ABSA introduces a challenging problem of incorporating aspect information into neural architectures. As such, deep learning architectures that are able to elegantly incorporate aspect information together with sentence modeling are highly desirable. Recently, there have been a myriad of models proposed for this purpose. For example, ATAE-LSTM \cite{DBLP:conf/emnlp/WangHZZ16} is a recently incepted attention based model that learns to attend to different parts of the sentence given the aspect information. ATAE-LSTM tries to incorporate aspect information by adopting a simple concatenation of context words and aspect. This is done both at the attention layer and the sentence modeling layer (inputs to the LSTM). Consequently, the ATAE-LSTM model suffers from the following drawbacks: + +\begin{itemize} +\item Instead of allowing the attention layer to focus on learning the relative importance of context words, the attention layer is given the extra burden of modeling the relationship between aspect and context words. +\item The parameters of LSTM are now given an extra burden aside from modeling sequential information, i.e., it has to also learn relationships between aspect and words. The LSTM layer in ATAE-LSTM is being trained on a sequence that is dominated by the aspect embedding. As such, this would make the model significantly harder to train. +\item Naive concatenation doubles the input to the LSTM layer in ATAE-LSTM which incurs additional parameter costs to the LSTM layer. This has implications in terms of memory footprint, computational complexity and risk of overfitting. +\end{itemize} + +In summary, the important question here is whether the naive concatenation of aspect and words at \textit{both} the LSTM layer and attention layer is necessary or even desirable. In fact, our early empirical experiments showed that the ATAE-LSTM does not always outperform the baseline LSTM model. We believe that this is caused by the word-aspect concatenation making the model difficult to train. As such, this paper aims to tackle the weaknesses of ATAE-LSTM while maintaining the advantages of aspect-aware attentions. Our model cleverly separates the responsibilities of layers by incorporating a dedicated \textit{association layer} for first modeling the relationships between aspect and context words, and then allowing the attention layer to focus on learning the relative importance of the fused context words. As such, the primary goal of this work is to design more effective and efficient attention mechanisms that are aspect-aware. +\subsection{Our Contributions} +The prime contributions of this paper are as follows: +\begin{itemize} +\item We propose a simple and efficient attention mechanism for incorporating aspect information into the neural model for performing aspect-based sentiment analysis. +\item For the first time, we introduce a novel association layer. In this layer, we adopt \textit{circular convolution of vectors} for performing word-aspect fusion, i.e., learning relationships between aspect and words in a sentence. Our association layer is inspired by the rich history of holographic reduced representation \cite{DBLP:journals/tnn/Plate95} and can be considered as a compressed tensor product. This allows rich higher order relationships between words and aspect to be learned. +\item Overall, we propose \textit{Aspect Fusion LSTM} (AF-LSTM), a novel deep learning architecture, specifically for the task of aspect-based sentiment analysis. Our model achieves not only state-of-the-art performance on benchmark datasets but also significant improvement over many other neural architectures. +\end{itemize} +\section{Related Work} +Sentiment analysis is a long standing problem in the field of NLP. Simply speaking, this task can be often interpreted as a multi-class (or binary) classification problem in which many decades of research have been dedicated to building features and running them through Support Vector Machine (SVM) classifiers. These traditional features include from sentiment lexicons \cite{rao2009semi,kaji2007building} to ngram features or parse-tree features \cite{DBLP:conf/semeval/KiritchenkoZCM14,DBLP:journals/jair/KiritchenkoZM14}. + +Today, neural architectures are incredibly fashionable for many NLP tasks and clearly, the field of sentiment analysis is of no exception, i.e., the task of document-level sentiment analysis is dominated by neural network architectures \cite{DBLP:journals/corr/BradburyMXS16,tai2015improved,DBLP:conf/acl/QianHLZ17}. The problem our architecture is targeted at is fine-grained sentiment analysis (or aspect-based sentiment analysis) whereby there is an additional complexity in fusing aspects with sentence representations. In order to incorporate aspect information, several architectures have been proposed including the target-dependent LSTM \cite{DBLP:conf/coling/TangQFL16} which models each sentence towards the aspect target. The works most relevant to ours are ATAE-LSTM and AT-LSTM \cite{DBLP:conf/emnlp/WangHZZ16} which are attentional models inspired by \cite{rocktaschel2015reasoning}. AT-LSTM can be considered as a modification of the neural attention of \cite{rocktaschel2015reasoning} for entailment detection that swaps the premise's last hidden state for the aspect embedding. + +Our work is concerned with associative compositional operators which have a rich history in holography. Specifically, in holographic reduced representations and holographic recurrent networks \cite{DBLP:journals/tnn/Plate95,DBLP:conf/nips/Plate92}, circular correlation and convolution are used as encoding-decoding operations which are analogous to storage and retrieval in associative memory models. These associative memory compositional operators can also be interpreted as compressed tensor products that enable second order relationships between word and aspect embeddings to be learned. Moreover, these operators are also efficient with only a computational cost of $\mathcal{O}(n\log n)$ by exploiting computation in the frequency domain, i.e., Fast Fourier Transforms. These associative memory models, though proposed long ago, have seen recent revival in several recent works, e.g., relational learning on knowledge bases \cite{DBLP:conf/aaai/NickelRP16}, question answering \cite{DBLP:conf/sigir/TayPLH17} and even within the recurrent cell \cite{DBLP:conf/icml/DanihelkaWUKG16}. As such, our work leverages these recent advances and adopts them to ameliorate the weaknesses of ATAE-LSTM by adopting rich second-order associative fusion of aspect and context words. + +It is worthy to mention that a separate class of neural architectures, known as MemNN or End-to-end Memory Network \cite{DBLP:conf/nips/SukhbaatarSWF15}, has also been used for ABSA. Specifically, this frames ABSA as a question answering problem where the network reasons with the aspect as a query and context words as the external memory. \cite{DBLP:conf/emnlp/TangQL16} introduced and applied multi-hop MemNN to ABSA and additionally included a novel mechanism of location attention. On the other hand, \cite{DBLP:conf/wsdm/LiGM17} proposed multi-task MemNN that is also trained on not only polarity prediction but also target detection. A recent work, the Dyadic MemNN \cite{DBLP:conf/cikm/TayTH17} applies rich compositional operators, leveraging neural tensor layers and associative layers on top of memory networks to improve performance on the ABSA task. However, the overall architecture in this paper differs significantly, integrating associative operators into an attention-based LSTM framework instead. +\section{Our Model} +In this section, we describe our deep learning architecture layer-by-layer. The overall model architecture is illustrated in Figure \ref{fig:4B}. + + \begin{figure*}[ht] + \centering + \includegraphics[width=0.84\linewidth]{images/new_architecture3.pdf} + \caption{Illustration of our proposed AF-LSTM deep learning architecture (\textit{best viewed in color}). Illustration of circular convolution and circular correlation is depicted in the top right of the image for $d=3$. Compression (summation) patterns are denoted by the matching colors. } + \label{fig:4B} +\end{figure*} +\subsection{Word Embedding Layer} +The input to our model is a sentence (sequence of words) along with an aspect word or phrase which are passed in as integer values and indexed into the embedding matrix. The word embedding layer is simply a $W_E \in \mathbb{R}^{k \times v}$ where $k$ is the dimension of the word embeddings and $v$ is the vocabulary size. As such, each input sentence is converted into a sequence of $k$ dimensional vectors by the embedding layer. For aspect terms with more than one word, we simply apply a neural bag of words model (sum operator) to learn a single $k$ dimensional vector of the aspect. We refer this as $s$ in this paper. +\subsection{Long Short-Term Memory (LSTM) Layer} +The word representations are then fed into a long short-term memory (LSTM) network \cite{hochreiter1997long}. The operations of the LSTM cell can be described as follows: +\begin{equation} +h_{t} = LSTM(h_{t-1}, x_i) +\end{equation} +where $x_t$ and $h_{t-1}$ are the input vectors at time $t$. The LSTM model is parameterized by output, input and forget gates, controlling the information flow within the recursive operation. For the sake of brevity, we omit the technical details of LSTM which can be found in many related works. +The output of this layer is a sequence of hidden vectors $\textbf{H} \in \mathbb{R}^{L \times d}$ where $L$ is the maximum sequence length and $d$ is the dimensional size of LSTM. +\subsection{Word-Aspect Fusion Attention Layer} +In this section, we describe our novel word-aspect fusion attention layer. First, we provide an overview of the mechanics of this new neural building block. + +\begin{itemize} + +\item The inputs to this layer are the outputs of the LSTM layer $\textbf{H} \in \mathbb{R}^{d \times L}$ and the aspect embedding $s$. +\item For each output vector $h_i \in \textbf{H}$ from the LSTM layer, we learn a joint representation of word and aspect embedding. This embedding is referred to as $m_i \in \mathbb{R}^{d}$ (memory traces) which encodes the relationship between the context word $h_i$ and aspect. In order to learn a joint representation of $h$ and $s$, we employ associative memory operators to learn $m_i$. +\item Subsequently, the sequence of encoded joint representations $m_1, m_2 \dots m_L$ is then passed into the attention layer. +\item The attention layer learns to attend based on $\textbf{M} \in \mathbb{R}^{d \times L}$ instead of $\textbf{H} \in \mathbb{R}^{d \times L}$. + +\end{itemize} +In this section, we describe the key steps that are crucial to the operation of our proposed attention mechanism. +\subsubsection{Associative Memory Operators} +We first describe the key concepts of associative memory operators which we use to model the relationship between context words and aspect embedding. Let $h_t$ be the hidden state of the LSTM at time $t$ and $s$ be the aspect embedding. In our case, we define two associative compositional operators, namely \textit{circular correlation} (denoted $\star$) and \textit{circular convolution} (denoted $\ast$), as our associative memory operators. The first operator, circular correlation is defined as follows: +\begin{equation} +[h \star s]_k = \sum_{i=0}^{d-1} h_i\:s_{(k+i) \: \bmod\:d} +\end{equation} +where $\star : \mathbb{R}^{d} \times \mathbb{R}^{d} \rightarrow \mathbb{R}^{d}$ denotes the circular correlation operator. For notational convenience, the subscript $t$ for $h$ is omitted. We also use zero-indexed vectors. Circular correlation can be computed as follows: +\begin{equation} +h \star a = \mathcal{F}^{-1} (\overline{\mathcal{F}(h)} \odot \mathcal{F}(a)) +\end{equation} +where $\mathcal{F(.)}$ and $\mathcal{F}^{-1}(.)$ are the Fast Fourier Transform (FFT) and inverse Fast Fourier Transform. $\overline{\mathcal{F}(h)}$ denotes the complex conjugate of $\mathcal{F}(h)$. $\odot$ is the element-wise (or Hadamard) product. Next, we define circular convolution as follows: +\begin{equation} +[h \ast s]_k = \sum_{i=0}^{d-1} h_i\:s_{(k-i) \bmod\:d} +\end{equation} +where $\ast : \mathbb{R}^{d} \times \mathbb{R}^{d} \rightarrow \mathbb{R}^{d}$ denotes the circular convolution operator. Similar to circular correlation, circular convolution can be computed efficiently via $\mathcal{F}^{-1} (\mathcal{F}(h) \odot \mathcal{F}(a))$. Note the absence of the conjugate operator. In our model, \textbf{either} circular correlation or convolution may be employed. In our experimental evaluation, we evaluate both variants of our model. However, note that the key difference between these two operators are the commutative property, i.e., correlation is non-commutative while convolution is not. Overall, the outputs of the association layer are defined as follows: + +\begin{equation} +\textbf{M}=[[h_1 \circ s], [h_2 \circ s], [h_3 \circ s]...[h_{L} \circ s]] +\end{equation} + \noindent where $\circ$ is the associative memory operator adopted, $h_i \in \mathbb{R}^{d}$ are the outputs from the LSTM layer and $s$ is the aspect embedding. As such, the dimension of the output association layer is identical to the inputs of the association layer. Note that the association layer is essentially parameterless and does not increase the parameters of the network. +\subsubsection{Normalization Layer} +Before learning association of $h_i$ and $s$, we also include an optional normalization layer. Specifically, we normalize\footnote{This is mentioned as a requirement in \cite{DBLP:conf/nips/Plate92,DBLP:journals/tnn/Plate95} but we found this condition is relatively unimportant for our model. An intuitive explanation might be due to the fact that we have already clipped the norm of the gradients to $\leq 1$.} $\abs{h_i}$ and $\abs{s}$ to $\leq 1$. Alternatively, we could also consider a batch normalization layer \cite{DBLP:conf/icml/IoffeS15} which we found to improve the performance on certain datasets. Overall, we consider the presence of this normalization layer as a hyperparameter to be tuned. +\subsubsection{Learning Attentive Representations} +Next, the composition of each hidden state $h_t$ and the aspect vector $s$ via associative operators are used for learning attentions. +\begin{align*}% +\textbf{Y} &= tanh(\textbf{W}_{y}\: \textbf{M}) &\\ +a &= softmax(w^{T}\:\textbf{Y}) &\\ +r &= \textbf{H}\:a^{T} & +\end{align*} +\noindent where $\textbf{W}_y \in \mathbb{R}^{d \times d}$ and $w \in \mathbb{R}^{d}$ are the parameters of the attention layer. $\textbf{H} \in \mathbb{R}^{L \times d}$ is a matrix of the LSTM output, $L$ is the sequence length and $d$ is the dimensionality of the LSTM. $a \in \mathbb{R}^{L}$ is the attention vector. The attention vector contains a probabilistic weighting of all the hidden representations from the LSTM layer and produces a final weighted representation $r \in \mathbb{R}^{d}$. Following \cite{DBLP:conf/emnlp/WangHZZ16}, we may also add a projection\footnote{In practice, we found that this layer does not seem to influence the performance much. However, it does not degrade the performance at the very least.} layer that combines the attentive representation with the last hidden state. The final representation is described as follows: +\begin{equation} +r = tanh(W_p \: r + W_x \: h_L) +\end{equation} +where $W_p \in \mathbb{R}^{d \times d}$ and $W_x \in \mathbb{R}^{d \times d}$ are the parameters of this layer. +\subsection{Final Softmax Layer} +The weighted representation $r$ of the sentence is then passed into the final layer which converts the weighted representation $r$ into a probability distribution. This layer also consists of a linear transformation layer and then a softmax function. The final layer can be defined as follows: +\begin{align*} +x &= W_f \ldotp r + b_f &\\ +p(y=k|x) &= \frac{e^{x^T\theta_k}}{\sum^{K}_{k=1}e^{x^T\theta_k}} & +\end{align*} +where $\theta_k$ is the weight vector of the $k$th class. $W_f$ and $b_f$ are the parameters of the final layer. +\subsection{Optimization and Training} +For optimization, we adopt the cross entropy loss function. +\begin{equation} +L = -\sum^{N}_{i=1} \: [ y_i \log o_i + (1-y_i)\log(1-o_i)] +R +\end{equation} +where $o$ is the output of the softmax layer and $R= \lambda\norm{\psi}^{2}_2$. $\psi$ contains all the parameters of the network and $ \lambda\norm{\psi}^{2}_2$ is the L2 regularization. +\section{Discussion and Analysis} +\label{sec:discussion} +In this section, we provide some intuitions and key advantages behind the usage of associative memory operators in our word-aspect fusion attention mechanism. +\subsection{Connections to Holographic Memory Models} +Our model is highly related to associative memory models and holographic reduced representations \cite{DBLP:journals/tnn/Plate95} that adopt a series of convolutions and correlations to store and retrieve item pairs. In these models, an encoding operation (e.g., circular convolution) is used to store the association of two vectors: +\begin{equation} +m = h \ast s +\end{equation} +and subsequently a decoding operation is used to retrieve $s$ via: +\begin{equation} +s' \approx h \star m = s \ast (h \star h) +\end{equation} +where $h \star h \approx \delta$ is the identity element of convolution. Given the noisy vector, $s'$, we are able to perform clean up which returns the most similar item in the stored memory $m$: +\begin{align*} +s = \argmax_{s_i} \: s_i^{\intercal} (h \ast m) +\end{align*} +In our proposed word-aspect fusion attention mechanism, recall that we are learning attentions by using the memory trace $m$ which is formed from composing the aspect embedding with the context, i.e., LSTM outputs $h_i$. In this case, either the circular convolution or circular correlation may be used as the encoding operation. Consider the case where circular convolution is used as the encoding operation, the gradients of the aspects at the attention layer are as follows: +\begin{align*} +\frac{\partial E}{\partial s_i} = \sum_{k} \frac{\partial E}{\partial a_{j}} \: h_{(k-j\bmod d)} +\label{eqn:grad} +\end{align*} +where $a$ is the attention vector and $\sum_{k} \frac{\partial E}{\partial a_{j}} \: h_{(k-j\bmod d)}$ is essentially the circular correlation operation \cite{DBLP:conf/nips/Plate92,DBLP:journals/tnn/Plate95}. As such, when circular convolution is used as the associative memory operator, its inverse (circular correlation) represents the decoding operation. This works vice versa as well, i.e., if circular correlation is the encoding operation, then circular convolution will become the decoding operation. For an explanation to why circular convolution decodes circular correlation, we refer interested readers to \cite{DBLP:journals/tnn/Plate95} for an extensive technical overview. + +Finally, considering the context of an end-to-end neural architecture, the forward operation is the encoding operation and the parameters of the attention layer are updated via the decoding operation which simulates storage and retrieval in holographic convolution-correlation memories, i.e., the process of encoding and decoding is reflected in the forward propagation and back propagation of the network. Intuitively, during the forward propagation (test time), this can be interpreted as trying to retrieve the context word $h_i$ that is closest to the aspect embedding $s$ which forms the crux of our word-aspect fusion attention layer. +\subsubsection{Capturing Second Order Interactions} +Additionally, we observe several advantages of our model over \cite{DBLP:conf/emnlp/WangHZZ16}. First, our model enables richer representational learning between context words and aspect. Associative memory operators are also known to be compressed tensor products which learn rich relationships between two vectors \cite{DBLP:conf/aaai/NickelRP16}. Figure \ref{fig:4B} (\textit{top right}) shows the visual interpretation of circular convolution and correlation with case $d=3$. Compression over a tensor product is shown by matching colours. For example, the summation of all purple blocks in circular convolution forms the first element of the composed vector $m$. +\subsubsection{On efficiency} +Unlike a simple concatenation employed in \cite{DBLP:conf/emnlp/WangHZZ16}, our model does not increase the parameters of the network and our association layer is actually parameterless. Each operation in the association layer can be computed efficiently with $\mathcal{O}(n\log n)$ which eliminates concerns about scalability. This also does not increase the burden of the LSTM layer or attention layer to learn the relationships between aspects and words. +\subsubsection{Separation of Goals} +Overall, our model allows a clear separation of goals, i.e., the associations between aspect and words are first learned independently and not coupled with other layers (e.g., LSTM and attention layers) which have their own primary objective such as learning semantic compositionality. + +\begin{table}[htbp] + \centering +\small + \begin{tabular}{c|c|cccc} + \toprule + \midrule + + Task & \textbf{Dataset} & \textbf{\# All} & \textbf{\# Pos} & \textbf{\# Neg} & \textbf{\# Neu} \\ + \midrule + T& Laptops Train & 1813 & 767 & 673 & 373 \\ + T & Laptops Dev & 499 & 220 & 192 & 87 \\ + T& Laptops Test & 638 & 341 & 128 & 169 \\ + \midrule + T& Restaurants Train & 3102 & 685 & 1886 & 531 \\ + T& Restaurants Dev & 500 & 278 & 120 & 102 \\ + T& Restaurants Test & 1120 & 728 & 196 & 196 \\ + \midrule + C& Restaurants Train & 3018 & 1855 & 733 & 430 \\ + C& Restaurants Dev & 500 & 324 & 106 & 70 \\ + C& Restaurants Test & 973 & 657 & 222 & 94 \\ + \midrule + C& SE 14+15 Train & 3587 & 1069 & 2310 & 208 \\ + C& SE 14+15 Dev & 1011 & 455 & 496 & 60 \\ + C& SE 14+15 Test & 427 & 274 & 134 & 19 \\ + \midrule + \toprule + \end{tabular}% + \caption{Dataset statistics of all datasets. T denotes the term classification task and C denotes the category classification task. } + \label{tab:dataset}% +\end{table}% +\section{Experimental Evaluation} +\label{sec:exp} +In this section, we introduce our empirical evaluation and comparisons. We introduce the datasets used, experimental protocol and finally the experimental results. We conduct on two tasks, namely aspect term classification and aspect category classification. The main difference is that \textit{term} can be more than one word that is found within the sentence itself. On the other hand, \textit{category} refers to generic labels such as `service' or `food' which may or may not be found in the sentence. Since we treat aspect embeddings to be the sum of all words (a single vector), the experiments can be conducted in the same fashion irregardless of the nature of term or category. + +\begin{table*}[htbp] + \centering + + \begin{tabular}{c|c|cccc|cccc|c} + \toprule + \midrule + & & \multicolumn{4}{c|}{Term Classification} & \multicolumn{4}{c|}{Category Classification} & \\ + \midrule + & & \multicolumn{2}{c}{Laptops} & \multicolumn{2}{c|}{Restaurants} & \multicolumn{2}{c}{Restaurants} & \multicolumn{2}{c|}{SemEval 14+15} & \\ + \midrule + \textbf{Model} & Aspect & 3-way & Binary & 3-way & Binary & 3-way & Binary & 3-way & Binary & Avg\\ + \midrule + Majority & No & 53.45 & 72.71 & 65.00 & 78.79 & 67.52 & 74.40 & 64.16 & 75.12 & 68.89\\ + NBOW & No & 58.62 & 73.34 & 67.49 & 82.47 & 70.81 & 78.61 & 70.92 & 77.18 & 72.43\\ + LSTM & No & 61.75 & 78.25 & 67.94 & 82.03 & 73.38 & 79.97 & 75.96 & 79.92 & 74.90 \\ + TD-LSTM & Yes & 62.38 & 79.31 & 69.73 & 84.41 & 79.97 & 75.96 & 79.92 & 74.90 & 75.63\\ + AT-LSTM & Yes & 65.83 & 78.25 & 74.37 & 84.74 & 77.90 & 84.87 & 76.16 & 81.28 & 77.93\\ + ATAE-LSTM & Yes & 60.34 & 74.20 & 70.71 & 84.52 & 77.80 & 83.85 & 74.08 & 78.96 & 75.56\\ + \midrule + AF-LSTM (MUL) & Yes & 66.14 & 83.37 & 75.35 & 86.47 & 79.96 & 81.71 & 77.44 & 80.44 & 78.86\\ + AF-LSTM (CORR) & Yes & 64.89 & 79.96 & 74.76 & 86.91 & 80.47 & 86.58 & 74.68 & \textbf{81.60} & 78.73\\ + AF-LSTM (CONV) & Yes & \textbf{68.81} & \textbf{83.58} & \textbf{75.44} & \textbf{87.78} & \textbf{81.29} & \textbf{87.26} & \textbf{78.44} & 81.49 & \textbf{80.51}\\ + \midrule + \toprule + \end{tabular}% + + \caption{Comparisons of all deep learning architectures on all datasets. Avg column reports macro-averaged results across all datasets. Best performance is in bold face. Our proposed AF-LSTM (CONV) achieves state-of-the-art performance across all four datasets and settings.} + \label{tab:main_results}% +\end{table*}% +\subsection{Datasets} +For our experimental evaluation, we adopt several subsets from the popular SemEval 2014 \cite{DBLP:conf/semeval/PontikiGPPAM14} task 4 and SemEval 2015 task 12 which are widely adopted benchmarks in many works \cite{DBLP:conf/emnlp/TangQL16,DBLP:conf/emnlp/WangHZZ16}. We evaluate on two datasets per task which are reported in Table \ref{tab:dataset}. For term classification (T), we use the Laptops and Restaurants datasets from SemEval 2014. For category classification (C), we use the Restaurants dataset from SemEval 2014 and a combined dataset from both SemEval2014 and SemEval2015. The split is obtained from \cite{DBLP:conf/wsdm/LiGM17} and is denoted as \textit{SemEval 14+15} in our experiments. +\subsubsection{Evaluation Protocol} +Apart from aspect term classification and aspect category classification, we conduct our experiments on two settings, namely three-way classification and binary classification (positive and negative). The metric reported is simply the accuracy score following \cite{DBLP:conf/emnlp/WangHZZ16}. Since there is no official development set for the SemEval 2014 task 4, we construct a development\footnote{Our splits can be found at \url{https://github.com/vanzytay/ABSA_DevSplits}.} set from the training set. Specifically, we take $500$ training instances as our development set for tuning model hyperparameters. Unfortunately, many published works \cite{DBLP:conf/emnlp/WangHZZ16,DBLP:conf/emnlp/TangQL16} do not mention the usage of a development set in their evaluation procedure. The usage of a fixed development set in our experiments (for all models) is motivated by the fluctuating performance on the test set per iteration. It is also best practice in evaluating models which is unfortunate that most prior works do not adopt. As such, we encourage future research to use the datasets with development splits. Additionally, we also reimplement all models on the same environment in the spirit of fair comparison. +\subsection{Compared Models} +In this section, we discuss the compared models. +\subsubsection{Our Models} +There are two variations to AF-LSTM, namely AF-LSTM (CCOR) and AF-LSTM (CONV), depending on the choice of encoding operation. CCOR and CONV denotes the circular correlation and convolution operations respectively. Additionally, we include a new baseline AF-LSTM (MUL) which swaps the encoding and decoding operator with the Hadamard product (elementwise multiplication). This is mainly to observe the effect of our holographic-inspired attentions. +\subsubsection{Baselines} +Additionally, we include other neural baseline models which are used for comparison. The baselines are listed as follows: +\begin{itemize} +\item \textbf{Neural Bag-of-Words} (NBOW) is simply the sum of all word embeddings in the context. +\item \textbf{LSTM} (Long Short-Term Memory) is a widely adopted neural baseline for many NLP tasks. In this model, aspect information is not used. +\item \textbf{TD-LSTM} (Target-Dependent LSTM) considers the aspect by adopting two LSTMs towards the aspect target and passing both outputs through a linear transformation layer. Note that TD-LSTM reverts to the baseline LSTM for \textit{category} classification tasks. +\item \textbf{AT-LSTM} (Attention LSTM) \cite{DBLP:conf/emnlp/WangHZZ16} adopts the attention mechanism in LSTM to produce a weighted representation of a sentence. The aspect embedding is added via linear projection and then concatenation at the attention layer. +\item \textbf{ATAE-LSTM} (Attention LSTM with Aspect Embedding) \cite{DBLP:conf/emnlp/WangHZZ16} can be considered as an extension of AT-LSTM. In this model, the aspect embedding is concatenated with the input before passing into the LSTM layer. + + +\end{itemize} +It is good to note that, many of these models, such as the vanilla LSTM and AT-LSTM, serve as good baselines for ablation studies. Additionally, we include a simple Majority baseline that predicts the majority class. For example, if positive instances are the majority class in the training set, the Majority baseline will classify all test instances as positive. + + +\begin{table*}[ht] + \centering +\small + \begin{tabular}{l|c|p{7.5cm}|c} + \toprule + \midrule + \textbf{Model} & \textbf{Aspect} & \textbf{Text} & \multicolumn{1}{l}{\textbf{Correct}} \\ + \midrule + AT-LSTM (w/o aspect) & Appetizer & The appetizers are \hltwo{okay} but the service is \hlsix{slow}. & \xmark \\ + AT-LSTM (\citeauthor{DBLP:conf/emnlp/WangHZZ16}) & Appetizer & The appetizers are \hltwo{okay} but the service is \hleight{slow}. & \xmark \\ + ATAE-LSTM (\citeauthor{DBLP:conf/emnlp/WangHZZ16}) & Appetizer & The appetizers are \hlfour{okay} but the service is \hlsix{slow}. & \xmark \\ + AF-LSTM (CONV) & Appetizer & The \hlsix{appetizers} \hltwo{are} \hlone{okay} but the service is slow. & \cmark \\ + \midrule + AT-LSTM (w/o aspect) & Service & The \hltwo{appetizers} are \hlfour{okay} \hlone{but} the service is slow. & \xmark \\ + AT-LSTM (\citeauthor{DBLP:conf/emnlp/WangHZZ16}) & Service & The appetizers are okay but the service is \hlsix{slow}. & \cmark \\ + ATAE-LSTM (\citeauthor{DBLP:conf/emnlp/WangHZZ16}) & Service & The appetizers are okay but the service is \hleight{slow}. & \cmark \\ + AF-LSTM (CONV)& Service & The appetizers are okay but the service is \hlsix{slow}. & \cmark \\ + \midrule + \toprule + \end{tabular}% + \caption{Example case study: inspecting attentions on a particularly difficult contrasting polarity test example on the Restaurants dataset. The intensity of the (red) color denotes the strength of the attention weights.} + \label{tab:example1}% +\end{table*}% +\subsection{Implementation Details} +We implemented all models in TensorFlow. All models are optimized using the Adam optimizer \cite{DBLP:journals/corr/KingmaB14} with a learning rate of $10^{-3}$. The regularization factor $\lambda$ is set to $4 \times 10^{-6}$ and the batch size tuned amongst $\{25,50\}$. We apply a dropout of $p=0.5$ after the LSTM (or representation) layer. All models are initialized with $300$ dimension Glove Embeddings (840B tokens) \cite{DBLP:conf/emnlp/PenningtonSM14}. All models are trained for $50$ epochs and the result reported is the test score of the model that performed the best on the development set. We also employ early stopping, i.e., we stop training when performance on the development set does not improve after $10$ epochs. As for preprocessing, we lowercased, filtered non-alphanumeric characters and applied NLTK's word tokenizer. All models are evaluated on a single NVIDIA GTX1060 GPU on a Linux machine. +\subsection{Experimental Results} +Table \ref{tab:main_results} shows our experimental results on ABSA. Firstly, we observe that our proposed AF-LSTM (CONV) outperforms all other neural architectures. In fact, AF-LSTM (CONV) outperforms\footnote{We carefully reimplemented ATAE-LSTM and AT-LSTM but we could not reproduce the good results of \cite{DBLP:conf/emnlp/WangHZZ16}. Results also differ because of the introduction of a development set.} ATAE-LSTM by $3\%-8\%$ on 3-way classification and about $2\%-3\%$ on binary classification. The performance of all AF-LSTM models is generally much higher than ATAE-LSTM. Additionally, we observe that ATAE-LSTM is outperformed by AT-LSTM across all settings. This shows that concatenation of aspect and word before the LSTM layer may significantly degrade performance. Moreover, we found that the performance of ATAE-LSTM may not outperform a baseline LSTM on certain datasets (Laptops). The overall performance of ATAE-LSTM is approximately the same as the baseline LSTM. + + Based on the empirical results of AT-LSTM, the concatenation of aspect and word at the attention layer is sound and shows reasonable improvements over the baseline LSTM. However, a simple Hadamard product (MUL) of word and aspect embedding already outperforms the AT-LSTM. AF-LSTM (MUL) outperforms AT-LSTM marginally ($\approx 1\%$) but significantly outperforms ATAE-LSTM ($\approx 3\%$). Finally, AF-LSTM (CONV) shows improvement over the Hadamard product, i.e., the AF-LSTM (MUL) baseline. On the other hand, the performance of AF-LSTM (CCOR) is similar to that of AF-LSTM (MUL). As such, we also observe that circular convolution is a significantly more effective associative operator as compared to circular correlation. We believe that this might be due to the circular correlation being an asymmetric operator. Words can appear in either aspect or context. Therefore, an explicit modeling of asymmetry may degrade the performance. Overall, the best performance is achieved by word-aspect fusion exploiting circular convolution (CONV). +\subsection{Memory / Parameter Size Analysis} +Finally, the parameter size of AF-LSTM is $\approx 810K$ while AT-LSTM and ATAE-LSTM are $\approx 1.1M$ and $\approx 1.4M$ respectively. Note that all variants of AF-LSTM has the same parameter size. The baseline LSTM has $\approx 720K$ parameters. As such, our proposed AF-LSTM has a smaller parameter size while outperforming AT-LSTM and ATAE-LSTM. +\section{Qualitative Analysis} +We selected a double-polarity example from the Restaurants dataset and visualize the reaction of attention weights with respect to the aspect embedding. We extract the attention vector for AF-LSTM, AT-LSTM and ATAE-LSTM. Additionally, we include a variation of AT-LSTM (w/o aspect) by removing the aspect embedding in order to clearly observe the effect of aspect-aware attentions. The hyperparameter settings remain identical. + +Table \ref{tab:example1} shows the visualized attention weights of the following contexts with respect to a particular aspect. In the first example where the aspect is the Appetizer, we see that the attention of AT-LSTM (w/o aspect), AT-LSTM and ATAE-LSTM are focusing at the wrong words, i.e., the focused words `okay` and `slow' are almost equal. On the other hand, AF-LSTM is able to focus on the correct words - `appetizers are okay' and completely ignore `slow'. We believe that this is due to associations learned between the words `appetizers' and `slow' (appetizers cannot be slow). + +In the second example, the aspect is swapped to Service. This time we see all models that have the aspect information focusing on the right words. AT-LSTM (w/o aspect) is randomly guessing whether to focus on `okay' or `slow' since it does not have any aspect information. Overall, we note that AT-LSTM and ATAE-LSTM of \cite{DBLP:conf/emnlp/WangHZZ16} are able to focus on the right words for the aspect of Service. However, both AT-LSTM and ATAE-LSTM are unable to focus on the right words for \textbf{both} aspects (Service and Appetizer) which is a weakness of the approach, i.e., the concatenation operator makes it difficult to model relationships between aspect and context words. Our approach, however, effectively and correctly switches the focus words when given a different aspect. +\section{Conclusion} +We proposed a novel method for incorporating aspect information for learning attentions. We introduce a novel word-aspect fusion attention layer to first learn associative relationships between aspect and context words for learning attentive representations. We show that learning attentions from associative memory traces of word and aspects are effective. Overall, circular convolution remains highly effective for aspect-word fusion. On the other hand, simple elementwise multiplications remains a strong baseline, outperforming simple concatenation models such as AT-LSTM and ATAE-LSTM. Our model shows an significant improvement in performance compared to multiple strong neural baselines. +\section{Acknowledgements} +The authors would like to thank anonymous reviewers for their feedback and comments. + + + +\bibliography{references} +\bibliographystyle{aaai} diff --git a/1712.05444v1.txt b/1712.05444v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..62579df51aa057efd5b7ee610306765d03489dd0 --- /dev/null +++ b/1712.05444v1.txt @@ -0,0 +1,179 @@ +\section{Introduction} +\label{sec:intro} +With mobile devices ingrained in the very fabric of people's life, capture, transmission and storage of digital images are ubiquitous nowadays. People are paying closer attention to the perceptual quality of digital images. This quantitative evaluation can either be subjective or objective. However, with such a great load of images, assessing the perceptual quality merely by the human is next to impossible. Objective image quality assessment (IQA), which measures visual quality by mimicking human perception, has become an alternative solution. + +In cases where the distortion-free image is available, IQA can be carried out by comparing the distorted image with the reference image. Current full-reference image quality assessment (FR-IQA) metrics such as FSIM~\cite{zhang2011fsim} and VSI~\cite{zhang2014vsi} have achieved satisfying results that are concordant with the human visual system (HVS). However, reference images seldom exist in most situations, and thus no-reference image quality assessment (NR-IQA) which evaluates perceptual quality with no access to reference images is highly demanded. Traditional learning-based IQA methods follow a routine pipeline, namely extract features first then train a model to estimate ground-truth perceptual score. +However, none of them take into consideration the detailed process in which humans perceive and assess distorted images, which results in inconsistency with subjective evaluation. + +Recent research in brain and neuroscience has brought insights into how HVS works when quantifying the quality of an image. \cite{friston2010free} propose a unified brain theory based on free-energy principle~\cite{friston2006free}, which reveals that human brain resists a natural tendency to disorder and HVS is inclined to restore and reconstruct degraded contents when assessing a distorted image. It shows that human brain will instinctively add textures and details based on the perceived image in order to simply unveil the mask of distortion and figure out the pristine content. % +After the restoration, human brain compares the distorted image to the brain-restored image in order to assess perceptual quality. Meanwhile, we also observe the correlation between distortion level and summation of brain-restored details: when people are shown images with higher level distortion, they are able to restore more details, although not all the complementary details are ground truth. + +Inspired by how HVS works, we hereby define Gain of Restoration (GoR) and assess perceptual quality using it. Given a distorted image, GoR is the perceptual distance between the distorted image and its restored version. In this paper, we propose restorative adversarial nets (RAN), an NR-IQA model which composes of a restorator, a discriminator and an evaluator. The proposed model is shown in Fig.~\ref{Model}. Different from the original generative adversarial nets (GAN)~\cite{goodfellow2014generative}, the restorator takes a distorted image patch as input instead of Gaussian noise and it is trained to restore the input. The discriminator aims to discern whether the input belongs to a restored version or is originally distortion-free. The evaluator takes restored and distorted patches as input and outputs perceptually quantified score by fitting and utilizing the monotonicity of GoR. The proposed model adopts perceptual loss~\cite{johnson2016perceptual,ledig2016photo} to achieve perceptually friendly results in restoration and Wasserstein distance~\cite{arjovsky2017wasserstein} to stabilize adversarial training. + +The remainder of this paper is organized as follows. In section \uppercase\expandafter{\romannumeral2}, we introduce related work in the field of NR-IQA and GAN. We detail the structure of RAN in section \uppercase\expandafter{\romannumeral3}. Experimental results and related discussions are presented in section \uppercase\expandafter{\romannumeral4}. In section \uppercase\expandafter{\romannumeral5}, we conclude the paper. + +\begin{figure*}[htb] +\includegraphics[width=\textwidth]{images/rest.pdf} +\includegraphics[width=\textwidth]{images/dis.pdf} +\caption{Overview of the detailed architecture of RAN. From up to down are the structures of restorator, discriminator and evaluator. ``Conv $m$-$n$'' denotes a convolution layer with $m$ feature maps and 3$\times$3 filters with stride $n$. ``L-ReLU'' denotes the Leaky ReLU.} +\label{Model} +\end{figure*} +\section{Related Work} + +\subsection{No-Reference Image Quality Assessment} +Given a no-reference setting, \cite{moorthy2011blind} propose DIVINE framework, which deploys summary statistics and performs a regression after identification of distortion type. BRISQUE~\cite{saad2012blind} and BLIINDS-II~\cite{mittal2012no} utilize natural scene statistics (NSS) to model perceptual quality. CORNIA~\cite{ye2012unsupervised}, on the other hand, constructs and presents a small yet accurate codebook to look up.~\cite{bosse2016deep,kang2015simultaneous,kang2014convolutional} adopt deep neural network to extract features from the raw input and perform regression to estimate perceptual scores. The above NR-IQA methods can be summarized as feature extraction and regression only based on distorted images. However, according to the free-energy theory~\cite{friston2006free,friston2010free}, HVS tends to restore the distorted image first before quality assessment. Despite building NR-IQA model based on the free-energy theory, \cite{zhai2012psychovisual} and~\cite{gu2015using} restore the distorted image with a linear autoregressive model, which is not capable of producing a satisfactory result when the input suffers high-level distortion and therefore may not be consistent with HVS. +\subsection{Generative Adversarial Nets} +Proposed by~\cite{goodfellow2014generative}, generative adversarial nets (GAN) have achieved impressive success in style transfer~\cite{zhu2017unpaired}, image super resolution~\cite{ledig2016photo}, and representation learning~\cite{radford2015unsupervised}. The key idea of GAN is to train a generator and a discriminator simultaneously, in which the generator takes noise as input and tries to fool the discriminator by generating indistinguishable samples. However, it suffers vanishing gradient and mode collapse problems when the discriminator is well-trained~\cite{salimans2016improved}. To address the problems, \cite{arjovsky2017wasserstein} propose Wasserstein GAN (WGAN), which greatly reduces instability of training. In this paper, stability is critical since the inputs are images with various kinds and levels of distortion, so we adopt WGAN framework to stabilize adversarial training. +\section{Proposed Model and Learning} +In NR-IQA, given a distorted image ${I_d}$, the aim is to learn a mapping $f:{I_d}\to{s}$, in which ${s}\in{\mathbb{R^{+}}}$ denotes the quality estimate of ${I_d}$ and should be consistent with the result of human visual system (HVS). As shown in Fig.~\ref{Model}, the proposed model consists of three parts: a restorator $R_\theta$, a discriminator $D_\phi$ and an evaluator $E_\omega$. They are realized by neural networks parametrized by $\theta$, $\phi$, $\omega$ respectively. It works as follows. We first sample non-overlapping patches ${\psi=\{P_0,P_1,\ldots,P_n\}}$ from the given distorted image ${I_d}$. For each patch ${P_k}\in{\psi}$, $R_\theta$ takes it as input and tries to restore ${P_k}$ into corresponding distortion-free pristine patch ${P_{k}^{0}}$, $D_\phi$ distinguishes restored $R_\theta({P_k})$ from pristine ${P_{k}^{0}}$. $E_\omega$ takes both ${P_k}$ and $R_\theta({P_k})$ as inputs and outputs $s_k$ and $w_k$, denoting a quality estimate and weight estimate of the patch ${P_k}$. Eventually, the perceptual quality $Q({I_d})$ is estimated by weighted sum of score predictions of all patches. % +\begin{equation}Q(I_d)=\frac{\sum_{k=1}^n s_k w_k}{\sum_{k=1}^n w_k}\end{equation} + +\begin{figure*} +\centering +\subfigure{ +\includegraphics[width=0.24\textwidth]{images/psnr_gblur.pdf}} +\subfigure{ +\includegraphics[width=0.24\textwidth]{images/psnr_wn.pdf}} +\subfigure{ +\includegraphics[width=0.24\textwidth]{images/psnr_jpg.pdf}} +\subfigure{ +\includegraphics[width=0.24\textwidth]{images/psnr_jp2.pdf}} +\subfigure{ +\includegraphics[width=0.24\textwidth]{images/ssim_gblur.pdf}} +\subfigure{ +\includegraphics[width=0.24\textwidth]{images/ssim_wn.pdf}} +\subfigure{ +\includegraphics[width=0.24\textwidth]{images/ssim_jpg.pdf}} +\subfigure{ +\includegraphics[width=0.24\textwidth]{images/ssim_jp2.pdf}} +\caption{Monotonicity of GoR. We randomly select 40 pristine images in Waterloo Exploration~\cite{ma2017waterloo} and their distorted version with 4 types and 3 levels of distortions. The distorted images are restored and we measure the distance between the distorted and restored images. The vertical axis denotes perceptual distance, measured by PSNR or SSIM~\cite{wang2004image}, between distorted image and restored version. The four charts on the first row are PSNR-measured, the four below are SSIM-measured. From left to right, the distortion type is Gaussian Blur, White Noise, JPEG Compression and JP2K Compression. Green, red, blue represent distortion level of 1, 3, 5 respectively. Severer distortion results in larger distance.} +\label{Mono} +\end{figure*} +\subsection{Gain of Restoration} +We define Gain of Restoration (GoR) as the perceptual distance between restored image and distorted image in the proposed NR-IQA model. We observe that GoR is monotone with respect to distortion level given a determined restorator. % +As shown in Fig.~\ref{Mono}, we try several functions to measure the perceptual distance, such as PSNR and SSIM~\cite{wang2004image}, after the restorator is trained. PSNR and SSIM are two widely-used metrics to measure the difference between two given images. We randomly picked 40 pristine images and their corresponding distorted version from Waterloo Exploration~\cite{ma2017waterloo}, a large-scale IQA database. We select all 4 distortion types: Gaussian Blur, White Noise, JPEG Compression and JP2K Compression. Waterloo Exploration generates distortion of 5 levels for each type, however, to justify GoR monotonicity, we choose 3 distortion levels: level 1, 3 and 5. After 480 distorted images are restored, we calculate PSNR and SSIM between distorted images and their restored version. The four charts in the first row show PSNR results, representing Gaussian Blur, White Noise, JPEG Compression and JP2K Compression from left to right. The four charts in the second row are SSIM results. We observe that perceptual similarity, quantified by SSIM and PSNR, between the restored image and the distorted image is low when the image has severe distortion, which means restoration is a huge improvement and GoR is high, and vice versa. + +Although % +restoration is a poorly-defined problem because the restorator is trained to restore the inputs with various types and levels of distortion to a single distortion-free image, we aim to maximize GoR of every input, and assess perceptual quality based on GoR, instead of focusing on how close the restored image is to the pristine image. +\subsection{Restorative Adversarial Nets} +The restorator $R_\theta$ takes in distorted patch $P_k$ and restores the input ${P_k}$ towards the pristine patch ${P_{k}^{0}}$. Motivated by~\cite{Gross2016residual,ledig2016photo}, we adopt the layout of a deep ResNet~\cite{he2016deep} for restorator $R_\theta$. Residual structure is critical in our proposed model. First, according to~\cite{he2016deep}, residual connections make the identity function easier to train, which is crucial in NR-IQA setting, because it is desired to restore images with low level of distortion as well as ones with high level of distortion. Second, ResNet structure is similar to the way HVS restores: adding details and textures onto distorted input chronologically. Gradually adding residual information simulates HVS model and greatly reduces potential color shifting problems in stacked convolution-ReLU networks. Specifically, each residual block has identical layout which has two convolutions with 3$\times$3 filters and 64 feature maps. We also adopt batch normalization~\cite{ioffe2015batch} to avoid undesired initialization, branches are added element-wisely to accumulate residue. After 10 identical residual blocks, we achieve the restored image with 3 channels by a convolution.% + +As for the discriminator $D_\phi$, which aims to distinguish restored image patch $R_\theta({P_k})$ from ${P_{k}^{0}}$, we propose a VGG-based~\cite{simonyan2014very} discriminator due to its successful application in several computer vision tasks. The discriminator has a similar layout of 13-layer VGG. Instead of pooling, we follow the advice of~\cite{radford2015unsupervised} and use strided convolution layers to downsample. Furthermore, we also adopt batch normalization~\cite{ioffe2015batch} after each Leaky ReLU activation layer. After extracting 512 feature maps, we use two fully connected layers to approximate discriminator objectives. + + +The loss function for RAN consists of a perceptual loss (realized by a pretrained VGG network) and an adversarial loss (realized by approximating Wasserstein distance), which is shown in Eq.~\ref{equ:ranloss}. % + +\begin{equation} +\label{equ:ranloss} +\mathcal{L}_{RAN} = \min_\theta \max_\phi (\mathcal{L}^{PER}_{RAN} + \mathcal{L}^{ADV}_{RAN}) +\end{equation} + +\paragraph{Perceptual loss} +Previous computer vision research relies on pixel-wise loss, such as mean squared error (MSE) to measure the distance between two given images. However, according to~\cite{wang2009mean}, pixel-wise loss fails to capture perceptual representations, such as texture details, as humans do. Lower MSE does not necessarily reflect better perceptual similarity. In this regard, we adopt perceptual loss~\cite{johnson2016perceptual} as cost function for the restorator. Perceptual loss is defined on a VGG19 network which is pretrained on IMAGENET~\cite{deng2009imagenet}. Instead of measuring pixel-by-pixel difference, perceptual loss quantifies perceptual difference based on various levels of feature representations extracted by the convolution layers in the pretrained network. The inputs are mapped into the feature space by non-linear differentiable functions, which in our setting, are the convolution layers from the pretrained model. In detail, the pretrained VGG19 has five maxpool layers and we select the last convolution layers before the corresponding five maxpool activations. Perceptual loss function is defined as the Euclidean distance of the five convolution layers, the $i^{th}$ convolution $\Omega_i$ is of size $W_{i}\times{H_{i}}\times{C_{i}}$. +\begin{equation}\label{equ:rlossper} +\mathcal{L}^{PER}_{RAN}=\sum_{i}{\frac{1}{W_{i}H_{i}C_{i}}\parallel{\Omega_{i}{(P_k^{0})}-\Omega_{i}{(R_\theta(P_k))}}\parallel_{2}^{2}}\end{equation} + +\paragraph{Wasserstein GAN} While traditional GANs suffer vanishing gradient and mode corruption problems, \cite{arjovsky2017wasserstein} propose Wasserstein GAN (WGAN), which claims to solve the problems with theoretical analysis. + +Instead of minimizing the Jensen-Shannon divergence, which leads to vanishing gradient when the discriminator reaches optima, a loss function which fits the Earth-Mover distance is defined as the cost between generated distribution and real distribution. Unlike its traditional counterpart which does 0-1 classification, the discriminator in WGAN model solves a regression problem. According to~\cite{arjovsky2017wasserstein}, when the discriminator is K-Lipschitz, the Earth-Mover distance suffers less gradient saturation and mode corruption problems even when the support of the generated distribution and the real distribution does not have a non-negligible intersection. +In our model, WGAN is crucial because the inputs of the restorator are images with various types and levels of distortions, stability is desired. As shown in Fig.~\ref{Model}, we remove the sigmoid layer in the discriminator. Furthermore, to enforce K-Lipschitz on discriminator, we clip weights between [-0.05, 0.05] after each update. Lastly, we use RMSProp~\cite{tieleman2012lecture} optimization to further avoid instability. +\begin{equation}\label{equ:rlossadv} +\mathcal{L}^{ADV}_{RAN} = D_\phi(P_k^0) - D_\phi(R_\theta(P_k))\end{equation} +\subsection{Evaluator} +After RAN restoration, we further train an evaluator $E_\omega$ to quantify visual score based on GoR monotonicity. As shown in Fig.~\ref{Model}, still patch-wisely, evaluator takes the restored patch and the distorted patch as input. Similar to the discriminator's function, we adopt the same layout to first extract feature representations. Second, feature vectors extracted from distorted patch and restored patch are fused and concatenated into a 1024-dimensional vector. Since the distortion is not evenly distributed, an average of scores of all patches does not necessarily reflect the global perceptual quality of the full image. Thus, in the last stage, the fused feature vector is fed into 2 branches which calculate the perceptual score $s_k$ and weight $w_k$ respectively. The whole model collects the weighted sum of all patches, which is the final quality estimate of distorted image $I_d$. + +The loss function of evaluator is shown in Eq.~\ref{equ:eloss1} and Eq.~\ref{equ:eloss2}. The evaluator is trained for two steps, which will be detailed in the experiments. When the score and weight labels for every image patch are available, we minimize the mean average error between the prediction and label for score and weight. + +\begin{equation}\label{equ:eloss1} +\mathcal{L}_{Eva}=\sum_{k=1}^{n}{\left|s_{k}-s_{k}^{0}\right|} + \sum_{k=1}^{n}{\left|w_{k}-w_{k}^{0}\right|} +\end{equation} + +However, when we only have access to the score of the whole image, the mean average error between ground truth and weighted prediction is minimized by each update. + + +\begin{equation}\label{equ:eloss2} +\mathcal{L}_{Eva}=\left|\frac{\sum_{k=1}^{n}{s_{k}w_{k}}}{\sum_{k}{w_k}}-s\right|\end{equation} + +\noindent where $s_{k}$ and $w_{k}$ denote the score and weight prediction for image patch $P_k$. $s_{k}^{0}$ and $w_{k}^{0}$ denote the ground truth score and weight for patch $P_k$. $s$ represents the ground truth score for the whole image $I_d$. +\section{Experimental Results} +In this section, we conduct several experiments to test the performance of RAN on several datasets. We pretrain RAN on Waterloo Exploration~\cite{ma2017waterloo}, perform cross validation on TID2013~\cite{ponomarenko2015image} and LIVE~\cite{sheikh2005live}. Furthermore, we conduct ablation experiments to test and quantify the performance gain and the necessity of each component and technique. +\subsection{Protocol} +\paragraph{TID2013} TID2013 is an extended version of TID2008 \cite{ponomarenko2009tid2008}, which consists of 25 distortion-free reference images and 3000 distorted images created from references at five levels. There are 24 different distortion types, ranging from additive Gaussian noise to sparse sampling reconstruction. Its wide range makes it one of the most comprehensive IQA databases. Mean Opinion Scores (MOS) are provided for every image, which is in the range [0, 9] and higher MOS means higher perceptual quality. + +\paragraph{LIVE} LIVE comprises 29 reference images and 779 distorted samples with 5 distortion types: JPEG Compression, JP2K Compression, White Noise, Gaussian Blur and Fast Fading. Every image is annotated with Differential Mean Opinion Scores (DMOS), which is in the range [0, 100]. Lower DMOS means higher perceptual quality. DMOS value of zero indicates the image is distortion-free. + +\paragraph{Waterloo Exploration} Waterloo Exploration is a large-scale IQA database, which contains 4744 pristine natural images and 94880 distorted images generated by MATLAB scripts with four distortion types and five levels. Compared to TID2013 and LIVE, Waterloo Exploration has a great diversity of image content. The four types: JPEG Compression, JP2K Compression, Gaussian Blur and White Noise, are also considered the most common distortion types and are covered both in TID2013 and LIVE. Instead of annotating distorted data with subjective mean opinion score (MOS), which is impractical for such a large database, Waterloo Exploration claims to preset MATLAB parameters which cover a wide range of subjective quality scale. + +We adopt two measures to evaluate the performance of RAN: Spearman rank order correlation coefficient (SROCC) and Pearson linear correlation coefficient (PLCC). SROCC measures the prediction monotonicity while PLCC takes relative distance into consideration and thus a non-linear regression is performed. + +\begin{table*}[tbp] +\begin{center} +\begin{tabular}{c|l|cc|cc} +\hline +&\multirow{2}*{IQA methods}&\multicolumn{2}{c}{TID2013}&\multicolumn{2}{c}{LIVE}\\ +\cline{3-6} +& &SROCC &PLCC &SROCC &PLCC\\ +\hline +\multirow{5}*{FR-IQA}&PSNR &0.889 &0.847 &0.880 &0.805\\ +&SSIM~\cite{wang2004image} &0.856 &0.867 &0.918 &0.780\\ +&FSIM~\cite{zhang2011fsim} &$\bm{0.963}$ &0.932 &$\bm{0.952}$ &0.822\\ +&FSIM$_{C}$~\cite{zhang2011fsim} &$\bm{0.963}$ &0.935 &0.951 &0.816\\ +&VSI~\cite{zhang2014vsi} &0.947 &$\bm{0.939}$ &0.936 &$\bm{0.853}$\\ +\hline +\multirow{7}*{NR-IQA}&DIIVINE~\cite{moorthy2011blind} &0.855 &0.851 &0.885 &0.853\\ +&BLIINDS-II~\cite{mittal2012no} &0.877 &0.841 &0.931 &0.930\\ +&BRISQUE~\cite{saad2012blind} &0.922 &0.917 &0.940 &0.911\\ +&CNN~\cite{kang2014convolutional} &0.903 &0.917 &0.913 &0.888\\ +&CNN++~\cite{kang2015simultaneous} &0.843 &0.804 &0.928 &0.897\\ +&DNN~\cite{bosse2016deep} &0.933 &0.909 &0.960 &$\bm{0.972}$\\ +&RAN (proposed) &$\bm{0.948}$ &$\bm{0.937}$ &$\bm{0.972}$ &0.968\\ +\hline +\end{tabular} +\caption{Cross Validation on TID2013 and LIVE} +\end{center} +\label{Result} +\end{table*} +\subsection{Training Details} +All the training is performed on an NVIDIA Tesla K40 GPU. The training consists of two steps: (1) pretrain on the Waterloo Exploration, (2) finetune on the TID2013 and LIVE. We crop every image into 64$\times$64 non-overlapping patches. The implementation is on tensorflow~\cite{abadi2016tensorflow}. + +In the pretrain step, we first train the restorator based on the labels (pristine patches) to avoid unwanted minima using Adam optimizer~\cite{kingma2014adam} at a learning rate of $10^{-4}$ for $300,000$ iterations. Then we train the restorator and the discriminator together using RMSProp~\cite{tieleman2012lecture} at a learning rate of $10^{-4}$ for $300,000$ iterations and a lower learning rate of $10^{-5}$ for another $300,000$ iterations. In each iteration, we train the discriminator 5 times and the restorator once. Then we freeze the weights of restorator and discriminator, and pretrain the evaluator using Adam at a learning rate of $10^{-4}$ for $300,000$ iterations. Note that all the above training uses $4744$ pristine images and $94,880$ distorted images from Waterloo Exploration. Considering that perceptual scores are not available in Waterloo Exploration, we label a score and weight for every distorted image patch by performing FSIM~\cite{zhang2011fsim}, which is one of the state-of-the-art FR-IQA metrics, on each patch of Waterloo Exploration. These scores and weights serve as the ground truth label in the pretrain of the evaluator. Note that the generated FSIM labels are only used during the pretrain of the evaluator. + +In the finetune step, we also freeze the weights of the restorator and discriminator, only train the evaluator using the same optimizer and learning rate on different datasets, which will be elucidated in the next section. +\subsection{Cross Validation on TID2013 and LIVE} +After pretrained on Waterloo Exploration, the evaluator is finetuned on TID2013 and LIVE to perform cross validation respectively. Since Waterloo Exploration only contains 4 distortion types, we finetune and test RAN on them: Gaussian Blur, White Noise, JPEG and JP2K. + +On TID2013, we randomly pick 60\% as the training set, 20\% as the validation set and the left 20\% as the test set. We finetune the evaluator for $20,000$ iterations. The result is displayed in Table 1. The best results of both NR-IQA metrics and FR-IQA metrics are in bold. The proposed model achieves as good a result as FSIM, on which RAN relys during pretrain. RAN outperforms state-of-the-art NR-IQA metrics in SROCC and PLCC in TID2013. + +We also perform two-sided t-test on average SROCC and PLCC between the proposed model and all the other mentioned NR-IQA models. The null hypothesis is that the two models have equal SROCC at the 95\% confidence level. An alternative hypothesis is that our model has higher/less correlation results. We also make a similar hypothesis on PLCC. We randomly split the TID2013, train, test for 15 times and achieve the results for all the models. Our model is statistically significant than all the other NR-IQA models on both SROCC and PLCC. + +To further test the robustness and generalization of RAN, we test our model on LIVE, where we split the dataset into 6:2:2 for train, validation and test respectively. LIVE has fewer images compared to TID2013, we finetune the evaluator for $15,000$ iterations. As shown in Table 1, RAN outperforms the state-of-the-art metrics, which shows its robustness and generalization across datasets. +\subsection{Ablation Experiments} +To demonstrate that the adopted techniques are critical for the performance, we conduct several ablation experiments on TID2013, in which we remove perceptual loss, Wasserstein distance, discriminator, weighted strategy and test the performance of the remaining framework. When we remove perceptual loss (RAN$\backslash$PER), we use L2 loss instead during the training of restorator. When we remove Wasserstein (RAN$\backslash$WAS), we adopt the original logarithm-based adversarial loss function. When we remove the discriminator (RAN$\backslash$DIS), the only component left is the restorator, which is trained only based on the perceptual loss objective. Without weighted strategy (RAN$\backslash$WEI), we simply estimate the quality of an image as the average of patch scores. As shown in Table 2, removal of the discriminator causes significant performance decline because restorator is not propelled by discriminator. The weighted strategy is also critical for the evaluator since distortion is not evenly distributed on test images, a naive average strategy will not give reasonable result when the image has severe distortion in a small area. Not using perceptual loss affects performance because without an HVS-consistent restorator, GoR monotonicity will not be notable and it is hard for the evaluator to assess perceptual quality. RAN without Wasserstein distance performs slightly worse than the proposed model. + +\begin{table}[tbp] +\begin{center} +\begin{tabular}{l|cc} +\hline +\multirow{2}*{Ablation}&\multicolumn{2}{c}{TID2013}\\ +\cline{2-3} +&SROCC &PLCC\\ +\hline +RAN (proposed) &$\bm{0.948}$ &$\bm{0.937}$\\ +RAN$\backslash$PER &0.893 &0.879\\ +RAN$\backslash$WAS &0.936 &0.906\\ +RAN$\backslash$DIS &0.854 &0.856\\ +RAN$\backslash$WEI &0.857 &0.884\\ +\hline +\end{tabular} +\caption{Ablation Experiment on TID2013} +\end{center} +\label{Result} +\end{table} +\section{Conclusion} +This paper presents RAN, a GAN-based no-reference image quality assessment model. Consistent with the human visual system, RAN restores input distorted image, extracts features both from distorted image and restored image based on GoR and evaluates perceptual quality by comparing them. Experimental results on standard IQA database have shown its superiority over state-of-the-art IQA methods and its generalization capacity. +\section{Acknowledgement} +We would like to express our thanks for support from the following research grants: 973-2015CB351800, NSFC-61527804, NSFC-61625201, NSFC-61421062 and NSFC-61210005. + + +\bibliography{aaai} +\bibliographystyle{aaai} diff --git a/1712.05558v3.txt b/1712.05558v3.txt new file mode 100644 index 0000000000000000000000000000000000000000..08a0224d1671ce2b1e74e1243797c212d9789801 --- /dev/null +++ b/1712.05558v3.txt @@ -0,0 +1,93 @@ +Building agents that can interact with humans in natural language while perceiving and taking actions in their environments is one of the fundamental goals in artificial intelligence.To this end, it will be necessary to ground language into perception and action (Harnad, 1990; Barsalou, 1999),where, e.g., nouns are connected to percepts and verbs relate to actions taken in an environment.Some approaches judge machine understanding of language purely based on the ability to mimic particular human utterances, but this has limitations: there are many ways to express roughly the same meaning, and conveying the correct information is often more important than the particular choice of words.An alternative approach, which has recently gained increased prominence, is to train and evaluate language capabilities in an interactive setting, where the focus is on successfully communicating information that an agent must share in order to achieve its goals. + +In this paper, we propose the Collaborative Drawing (CoDraw) task, which combines grounded language understanding and learning effective goal-driven communication into a single, unified testbed. Thistask involves perception, communication, and actions in apartially observable environment.As shown in Figure 1, our game is grounded in a virtual world constructed from clip art objects (Zitnick et al., 2013; Zitnick and Parikh, 2013). Two players, Teller and Drawer, play the game. The Teller sees an abstract scene consisting of clip art objects in a semantically meaningful configuration, while the Drawer sees a drawing canvas that is initially empty. The goal of the game is to have both players communicate so that the Drawer can reconstruct the image of the Teller, without ever seeing it. + +Our task requires effective communication because the two players cannot see each other’s scenes. The Teller must describethe scene in sufficient detail for the Drawer to reconstruct it, which will necessitate grounded language. Moreover, the Drawer will need to carry out a series of actions from a rich action space to position, orient, and resize all of the clip art pieces required for the reconstruction.Note how clip art pieces form a representation that is perceived visually by humans but is easy to manipulate in a structured manner, in contrast to lower-level pixel-based image representations.The performance of a pair of agents is judged based on the quality of reconstructed scenes, where high-quality reconstructions result from successful communication. + +We collect a CoDraw dataset111The CoDraw dataset is available at https://github.com/facebookresearch/CoDraw of ∼similar-to\sim10K variable-length dialogs consisting of ∼similar-to\sim138K messages with the drawing history at each step of the dialog. We also define a similarity metric for clip art scenes, which allows us to automatically evaluate the effectiveness of agent communication at the end of a dialog and at intermediate states.We evaluate several Drawer and Teller models222Models are available at https://github.com/facebookresearch/codraw-models automatically as well as by pairing them with humans, and show that long-term planning and contextual reasoningare key challenges of the CoDraw task. + +As we developed models and protocols for CoDraw, we found it critical to train the Teller and the Drawer separately on disjoint subsets of the training data. Otherwise, the two machine agents may conspire to successfully achieve the goal while communicating using a shared “codebook” that bears little resemblance to natural language. We call this separate-training, joint-evaluation protocol crosstalk, which prevents learning of mutually agreed upon codebooks, while still checking for goal completion at test time. We highlight crosstalk as one of our contributions, and believe it can be generally applicable to other related tasks (Sukhbaatar et al., 2016; Foerster et al., 2016; de Vries et al., 2016; Das et al., 2017b; Lewis et al., 2017). + +Language grounded in environments.Learning language games in a grounded environment has been studied recently (Wang et al., 2016, 2017).While language in these works is tied to actions that modify the environment, the tasks do not involve multiple agents that need to cooperate.Other work on grounded instruction following relies on datasets of pre-generated action sequences annotated with human descriptions, rather than using a single end goal (Long et al., 2016). Generation models for these tasks are only evaluated based on their ability to describe an action sequence that is given to them (Fried et al., 2018a), whereas Teller models for CoDraw also need to select in a goal-driven manner the action sequence to describe to the Drawer.Language grounding has been studied for robot navigation, manipulation, and environment mapping (Tellex et al., 2011; Mei et al., 2015; Daniele et al., 2016).However, these works manually pair each command with robot actions and lack end-to-end training (Tellex et al., 2011), dialog (Mei et al., 2015; Daniele et al., 2016), or both (Walter et al., 2014).Compared to work on navigation (Vogel and Jurafsky, 2010; Anderson et al., 2018; Fried et al., 2018b) where an agent must follow instructions to move itself in a static environment, CoDraw involves a structured action space for manipulating clip art pieces to form a semantically meaningful configuration. + +End-to-end goal-driven dialog.Traditional goal-driven agents are often based on ‘slot filling’ (Lemon et al., 2006; Wang and Lemon, 2013; Yu et al., 2015), in which the structure of the dialog is pre-specified but the individual slots are replaced by relevant information. Recently, end-to-end neural models are also proposed for goal-driven dialog (Bordes et al., 2017; Li et al., 2017a, b; He et al., 2017), as well as goal-free dialog or ‘chit-chat’ (Shang et al., 2015; Sordoni et al., 2015; Vinyals and Le, 2015; Li et al., 2016; Dodge et al., 2016). Unlike CoDraw, in these approaches, symbols in the dialog are not grounded into visual objects. + +Emergent communication.Building on the seminal works by Lewis (1969, 1975), a number of recent works study cooperative games between agents where communication protocols emerge as a consequence of training the agents to accomplish shared goals (Sukhbaatar et al., 2016; Foerster et al., 2016).These methods have typically been applied to learn to communicate small amounts of information, rather than the complete, semantically meaningful scenes used in the CoDraw task.In addition, the learned communication protocols are usually not natural (Kottur et al., 2017) or interpretable, whereas the CoDraw task is designed to develop agents that use human language. + +Language and vision.The proposed CoDraw game is related to several well-known language and vision tasks that study grounded language understanding (Karpathy and Fei-Fei, 2015; Donahue et al., 2015; de Vries et al., 2016).For instance, in contrast to image captioning (Vinyals et al., 2017; Xu et al., 2015; Chen and Zitnick, 2015; Lu et al., 2017), visual questionanswering (Antol et al., 2015; Zhang et al., 2016; Goyal et al., 2016; Gao et al., 2015; Krishna et al., 2017; Malinowski and Fritz, 2014; Ren et al., 2015; Tapaswi et al., 2016; Yu et al., 2015; Zhu et al., 2016) and recent embodied extensions (Das et al., 2018), CoDraw involves multiple rounds of interactions between two agents.Both agents hold their own partially observable states and may need to build a model of their partner’s state to collaborate effectively.Compared to past work on generating abstract scenes from single captions Zitnick et al. (2013), scenes in CoDraw are reconstructed over multiple rounds, and the task requires Teller models to generate coherent and precise descriptions over the course of a full dialog.Compared to visual dialog (Das et al., 2017a, b; Strub et al., 2017; Mostafazadeh et al., 2017) tasks, agents need to additionally cooperate to change the environment with actions (e.g., move pieces around).Thus, the agents have to possess the ability to adapt and hold a dialog about partially-constructed scenes that will occur over the course of their interactions.In addition, we also want to highlight that CoDraw has a well-defined communication goal, which facilitates objective measurement of success and enables end-to-end goal-driven learning. + +In this section, we first detail our task, then present the CoDraw dataset, and finally propose a scene similarity metric which allows automatic evaluation of the reconstructed and original scene. + +Abstract scenes. To enable people to easily draw semantically rich scenes on a canvas, we leverage the Abstract Scenes dataset of Zitnick et al. (2013) and Zitnick and Parikh (2013). This dataset consists of 10,020 semantically consistent scenes created by human annotators.An example scene is shown in the left portion of Figure 1.Most scenes contain 6 objects (min 6, max 17, mean 6.67). These scenes depict children playing in a park, and are made from a library of 58 clip arts, including a boy (Mike) and a girl (Jenny) in one of 7 poses and 5 expressions, and various other objects including trees, toys, hats, animals, food, etc.An abstract scene is created by dragging and dropping multiple clip art objects to any (x,y)𝑥𝑦(x,y) position on the canvas. Spatial transformations can be applied to each clip art, including sizes (small, normal, large) and two orientations (facing left or right).The clip art serve simultaneously as a high-level visual representation and as a mechanism by which rich drawing actions can be carried out. + +Interface.We built a drag-and-drop interface based on the Visual Dialog chat interface (Das et al., 2017a) (see Figures 5 and 6 in Appendix A for screen shots of the interface). The interface allows real-time interaction between two people. During the conversation, the Teller describes the scene and answers any questions from the Drawer on the chat interface, while Drawer “draws” or reconstructs the scene based on the Teller’s descriptions and instructions. Each side is only allowed to send one message at a time, and must wait for a reply before continuing. The maximum length of a single message is capped at 140 characters: this prevents excessively verbose descriptions and gives the Drawer more chances to participate in the dialog by encouraging the Teller to pause more frequently. Both participants were asked to submit the task when they areboth confident that Drawer has accurately reconstructed thescene of Teller.To focus the natural language on the high-level semantics of the scene rather than instructions calling for the execution of low-level clip art manipulation actions, the Teller is not able to observe the Drawer’s canvas while communicating. + +We collect 9,993333Excluding 27 empty scenes from the original dataset. dialogs where pairs of people complete the CoDraw task, consisting of one dialog per scene in the Abstract Scenes dataset. The dialogs contain of a total of 138K utterances and include snapshots of the intermediate state of the Drawer’s canvas after each round of each conversation.See Section 5 for a description of how we split the data into training, validation, and test sets. + +Messages.Figure 2a shows the distribution of message lengths for both Drawers and Tellers.The message length distribution for the Drawer is skewed toward 1 with passive replies like “ok”, “done”, etc.There does exist a heavy tail, which shows that Drawers ask clarifying questions about the scene like “where is trunk of second tree, low or high”.On the other hand, Teller utterances have a median length of 16 tokens and a vocabulary size of 4,555.Due to the limited number of clip arts, the vocabulary is smaller than it would be for real images. However, humans still use compositional language to describe clip art configurations and attributes, and make references to previous discourse elements in their messages. + +Rounds. Figure 2b shows the distribution of the numbers of conversational rounds for dialog sessions. Most interactions are shorter than 20 rounds; the median number of rounds is 7. + +Durations. In Figure 2c we see that the median session duration is 6 minutes. We had placed a 20-minute maximum limit on each session. + +The goal-driven nature ofthe CoDraw tasknaturally lends itself to evaluation bycomparing the reconstructed scene to the original.For this purpose we define a scene similarity metric, which allows us to automatically evaluate communication effectiveness both at the end of a dialog and at intermediate states. We use the metric to compare how well different machine-machine, human-machine, and human-human pairs can complete thetask. + +We represent a scene C𝐶C as a set of clip art objects c∈C𝑐𝐶c\in C, each of which consists of an identifier i​d​(c)𝑖𝑑𝑐id(c) that denotes its type, and additional features such as size and x,y𝑥𝑦x,y position. We denote by i​d​s​(C)𝑖𝑑𝑠𝐶ids(C) the set of clip art types that occur in the scene. Given two scenes, the intersection-over-union measure computed over clip art types is:I​O​U​(C,C^)=nintnunion=∑i𝟏i∈i​d​s​(C)∧i∈i​d​s​(C^)|i​d​s​(C)∪i​d​s​(C^)|𝐼𝑂𝑈𝐶^𝐶subscript𝑛intsubscript𝑛unionsubscript𝑖subscript1𝑖𝑖𝑑𝑠𝐶𝑖𝑖𝑑𝑠^𝐶𝑖𝑑𝑠𝐶𝑖𝑑𝑠^𝐶IOU(C,\hat{C})=\frac{n_{\text{int}}}{n_{\text{union}}}=\frac{\sum_{i}\bm{1}_{i\in ids(C)\land i\in ids(\hat{C})}}{\left|ids(C)\cup ids(\hat{C})\right|}(1)where nintsubscript𝑛intn_{\text{int}} (nunionsubscript𝑛unionn_{\text{union}}) is the numbers of clip art types in the intersection (union). + +To also incorporate features such as size and position, we replace the indicator function in the numerator with a term g​(i,C,C^)𝑔𝑖𝐶^𝐶g(i,C,\hat{C}) that measures attribute similarity for shared clip art types. We also introduce a pairwise similarity term h​(i,j,C,C^)ℎ𝑖𝑗𝐶^𝐶h(i,j,C,\hat{C}). Overall, scene similarity is defined as:s​(C,C^)=∑ig​(i,C,C^)nunion⏟unary+∑i0subscript𝑅𝜋𝑠𝑎0R_{\pi}(s,a)>0 iff π​(s)=a𝜋𝑠𝑎{\pi}(s)=a, hence for all s𝑠s:pg​(Rπ)​(s)=arg⁡maxa⁡Rπ​(s,a)=π​(s),subscript𝑝𝑔subscript𝑅𝜋𝑠subscript𝑎subscript𝑅𝜋𝑠𝑎𝜋𝑠\displaystyle p_{g}(R_{\pi})(s)=\operatorname*{\arg\!\max}_{a}R_{\pi}(s,a)={\pi}(s),so pg​(Rπ)=πsubscript𝑝𝑔subscript𝑅𝜋𝜋p_{g}(R_{\pi})={\pi}. Then −pg​(−Rπ)=pg​(−(−Rπ))=pg​(Rπ)=πsubscript𝑝𝑔subscript𝑅𝜋subscript𝑝𝑔subscript𝑅𝜋subscript𝑝𝑔subscript𝑅𝜋𝜋-p_{g}(-R_{\pi})=p_{g}(-(-R_{\pi}))=p_{g}(R_{\pi})={\pi}, by subsubsection 5.1.1.∎ + +We will look the operations that build the degenerate planner-reward pairs from any compatible pair:1.For any planner p𝑝p, f1​(p)=(p,0)subscript𝑓1𝑝𝑝0f_{1}(p)=(p,0) as a planner-reward pair.2.For any reward function R𝑅R, f2​(R)=(pg,R)subscript𝑓2𝑅subscript𝑝𝑔𝑅f_{2}(R)=(p_{g},R).3.For any planner-reward pair (p,R)𝑝𝑅(p,R), f3​(p,R)=p​(R)subscript𝑓3𝑝𝑅𝑝𝑅f_{3}(p,R)=p(R).4.For any planner-reward pair (p,R)𝑝𝑅(p,R), f4​(p,R)=(−p,−R)subscript𝑓4𝑝𝑅𝑝𝑅f_{4}(p,R)=(-p,-R).5.For any policy π𝜋{\pi}, f5​(π)=pπsubscript𝑓5𝜋subscript𝑝𝜋f_{5}({\pi})=p_{\pi}.6.For any policy π𝜋{\pi}, f6​(π)=Rπsubscript𝑓6𝜋subscript𝑅𝜋f_{6}({\pi})=R_{\pi}.These will be called the basic operations, and there are strong arguments that reasonable computer languages should be able to express them with short programs. The operation f1subscript𝑓1f_{1}, for instance, is simply appending the flat trivial 00, f2subscript𝑓2f_{2} appends a planner defined by the simple666In most standard computer languages, arg⁡max\operatorname*{\arg\!\max} just requires a forfor\mathrm{for}-loop, a reference to R𝑅R, a comparison with a previously stored value, and possibly the storage of a new value and the current action. search operator arg⁡max\operatorname*{\arg\!\max}, f3subscript𝑓3f_{3} applies a planner to the object — a reward function — that the planner naturally acts on, f4subscript𝑓4f_{4} is a double negation, while f5subscript𝑓5f_{5} and f6subscript𝑓6f_{6} are simply described in subsubsection 5.1.1. + +From these basic operations, we can define three composite operations that map any compatible planner-reward pair to one of the degenerate pairs (the element F4=f4subscript𝐹4subscript𝑓4F_{4}=f_{4} is useful for later definitions). Thus defineF={F1=f1∘f5∘f3,F2=f2∘f6∘f3,F3=f4∘f2∘f6∘f3,F4=f4}.𝐹formulae-sequencesubscript𝐹1subscript𝑓1subscript𝑓5subscript𝑓3formulae-sequencesubscript𝐹2subscript𝑓2subscript𝑓6subscript𝑓3formulae-sequencesubscript𝐹3subscript𝑓4subscript𝑓2subscript𝑓6subscript𝑓3subscript𝐹4subscript𝑓4\displaystyle F=\{F_{1}=f_{1}\circ f_{5}\circ f_{3},\ \ F_{2}=f_{2}\circ f_{6}\circ f_{3},\ \ F_{3}=f_{4}\circ f_{2}\circ f_{6}\circ f_{3},\ \ F_{4}=f_{4}\}.For any π˙˙𝜋{\dot{{\pi}}}-compatible pair (p,R)𝑝𝑅(p,R) we have F1​(p,R)=(pπ˙,0)subscript𝐹1𝑝𝑅subscript𝑝˙𝜋0F_{1}(p,R)=(p_{\dot{{\pi}}},0), F2​(p,R)=(pg,Rπ˙)subscript𝐹2𝑝𝑅subscript𝑝𝑔subscript𝑅˙𝜋F_{2}(p,R)=(p_{g},R_{\dot{{\pi}}}), and F3​(p,R)=(−pg,−Rπ˙)subscript𝐹3𝑝𝑅subscript𝑝𝑔subscript𝑅˙𝜋F_{3}(p,R)=(-p_{g},-R_{\dot{{\pi}}}) (see the proof of subsubsection 5.1.3). + +Let KLsubscript𝐾𝐿K_{L} denote Kolmogorov complexity in the language L: the shortest algorithm in L𝐿L that generates a particular object. We define the F𝐹F-complexity of L𝐿L asmax(p,R),Fi∈F⁡KL​(Fi​(p,R))−KL​(p,R).subscript𝑝𝑅subscript𝐹𝑖𝐹subscript𝐾𝐿subscript𝐹𝑖𝑝𝑅subscript𝐾𝐿𝑝𝑅\displaystyle\max_{(p,R),F_{i}\in F}K_{L}(F_{i}(p,R))-K_{L}(p,R).Thus the F𝐹F-complexity of L𝐿L is how much the Fisubscript𝐹𝑖F_{i} potentially increase777F𝐹F-complexity is non-negative: F4∘F4subscript𝐹4subscript𝐹4F_{4}\circ F_{4} is the identity, so that KL(F4(p,R))−KL(p,R)=−(KL(F4(F4(p,R))−KL(F4(p,R))K_{L}(F_{4}(p,R))-K_{L}(p,R)=-(K_{L}(F_{4}(F_{4}(p,R))-K_{L}(F_{4}(p,R)), meaning that max(p,R),F4⁡KL​(F4​(p,R))−KF​(p,R)subscript𝑝𝑅subscript𝐹4subscript𝐾𝐿subscript𝐹4𝑝𝑅subscript𝐾𝐹𝑝𝑅\max_{(p,R),F_{4}}K_{L}(F_{4}(p,R))-K_{F}(p,R) must be non-negative; this is a reason to include F4subscript𝐹4F_{4} in the definition of F𝐹F.the complexity of pairs. + +For a constant c≥0𝑐0c\geq 0, this allows us to formalise what we mean by L𝐿L being a c𝑐c-reasonable language for F𝐹F: that the F𝐹F-complexity of L𝐿L is at most c𝑐c.A reasonable language is a c𝑐c-reasonable language for a c𝑐c that we feel is intuitively low enough. + +To formalise the concepts ‘of lowest complexity’, and ‘of comparable complexity’, choose a constant c≥0𝑐0c\geq 0, then (p,R)𝑝𝑅(p,R) and (p′,R′)superscript𝑝′superscript𝑅′(p^{\prime},R^{\prime}) are of ‘comparable complexity’ if‖KL​(p,R)−KL​(p′,R′)‖≤c.normsubscript𝐾𝐿𝑝𝑅subscript𝐾𝐿superscript𝑝′superscript𝑅′𝑐\displaystyle||K_{L}(p,R)-K_{L}(p^{\prime},R^{\prime})||\leq c.For a set S⊂𝒫×ℛ𝑆𝒫ℛS\subset{\mathcal{P}}\times{\mathcal{R}}, the pair (p,R)∈S𝑝𝑅𝑆(p,R)\in S is amongst the lowest complexity in S𝑆S if‖KL​(p,R)−min(p′,R′)∈S⁡KL​(p′,R′)‖≤c,normsubscript𝐾𝐿𝑝𝑅subscriptsuperscript𝑝′superscript𝑅′𝑆subscript𝐾𝐿superscript𝑝′superscript𝑅′𝑐\displaystyle||K_{L}(p,R)-\min_{(p^{\prime},R^{\prime})\in S}K_{L}(p^{\prime},R^{\prime})||\leq c,thus KLsubscript𝐾𝐿K_{L} is within distance c𝑐c of the minimum complexity element of S𝑆S.Now formalize Section 5: + +If π˙˙𝜋{\dot{{\pi}}} is the human policy, c𝑐c defines a reasonable measure of comparable complexity, and L𝐿L is a c𝑐c-reasonable language for F𝐹F, then the degenerate planner-reward pairs (pπ˙,0)subscript𝑝˙𝜋0(p_{\dot{{\pi}}},0), (pg,Rπ˙)subscript𝑝𝑔subscript𝑅˙𝜋(p_{g},R_{\dot{{\pi}}}), and (−pg,−Rπ˙)subscript𝑝𝑔subscript𝑅˙𝜋(-p_{g},-R_{\dot{{\pi}}}) are amongst the pairs of lowest complexity among the pairs compatible with π˙˙𝜋{\dot{{\pi}}}. + +By subsubsection 5.1.1, (pπ˙,0)subscript𝑝˙𝜋0(p_{\dot{{\pi}}},0), (pg,Rπ˙)subscript𝑝𝑔subscript𝑅˙𝜋(p_{g},R_{\dot{{\pi}}}), and (−pg,−Rπ˙)subscript𝑝𝑔subscript𝑅˙𝜋(-p_{g},-R_{\dot{{\pi}}}) are compatible with π˙˙𝜋{\dot{{\pi}}}. By the definitions of the fisubscript𝑓𝑖f_{i} and Fisubscript𝐹𝑖F_{i}, for(p,R)𝑝𝑅(p,R) compatible with π˙˙𝜋{\dot{{\pi}}}, f3​((p,R))=p​(R)=π˙subscript𝑓3𝑝𝑅𝑝𝑅˙𝜋f_{3}((p,R))=p(R)={\dot{{\pi}}} and henceF1​(p,R)subscript𝐹1𝑝𝑅\displaystyle F_{1}(p,R)=f1∘f5​(π˙)=f1​(pπ˙)=(pπ˙,0),absentsubscript𝑓1subscript𝑓5˙𝜋subscript𝑓1subscript𝑝˙𝜋subscript𝑝˙𝜋0\displaystyle=f_{1}\circ f_{5}({\dot{{\pi}}})=f_{1}(p_{\dot{{\pi}}})=(p_{\dot{{\pi}}},0),F2​(p,R)subscript𝐹2𝑝𝑅\displaystyle F_{2}(p,R)=f2∘f6​(π˙)=f2​(Rπ˙)=(pg,Rπ˙),absentsubscript𝑓2subscript𝑓6˙𝜋subscript𝑓2subscript𝑅˙𝜋subscript𝑝𝑔subscript𝑅˙𝜋\displaystyle=f_{2}\circ f_{6}({\dot{{\pi}}})=f_{2}(R_{\dot{{\pi}}})=(p_{g},R_{\dot{{\pi}}}),F3​(p,R)subscript𝐹3𝑝𝑅\displaystyle F_{3}(p,R)=f4∘F2​(p,R)=(−pg,−Rπ˙).absentsubscript𝑓4subscript𝐹2𝑝𝑅subscript𝑝𝑔subscript𝑅˙𝜋\displaystyle=f_{4}\circ F_{2}(p,R)=(-p_{g},-R_{\dot{{\pi}}}).Now pick (p,R)𝑝𝑅(p,R) to be the simplest pair compatible with π˙˙𝜋{\dot{{\pi}}}.Since L𝐿L is c𝑐c-reasonable for F𝐹F, KL​(pπ˙,0)≤c+KL​(p,R)subscript𝐾𝐿subscript𝑝˙𝜋0𝑐subscript𝐾𝐿𝑝𝑅K_{L}(p_{\dot{{\pi}}},0)\leq c+K_{L}(p,R).Hence (pπ˙,0)subscript𝑝˙𝜋0(p_{\dot{{\pi}}},0) is of lowest complexity among the pairs compatible with π˙˙𝜋{\dot{{\pi}}}; the same argument applies for the other two degenerate pairs.∎ + +If (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) is compatible with π˙˙𝜋{\dot{{\pi}}}, then so is (−p˙,−R˙)=f4​(p˙,R˙)=F4​(p˙,R˙)˙𝑝˙𝑅subscript𝑓4˙𝑝˙𝑅subscript𝐹4˙𝑝˙𝑅(-{\dot{p}},-{\dot{R}})=f_{4}({\dot{p}},{\dot{R}})=F_{4}({\dot{p}},{\dot{R}}).This immediately implies the formalisation of Section 5: + +If π˙˙𝜋{\dot{{\pi}}} is a human policy, c𝑐c defines a reasonable measure of comparable complexity, L𝐿L is a c𝑐c-reasonable language for F𝐹F, and (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) is compatible with π˙˙𝜋{\dot{{\pi}}}, then (−p˙,−R˙)˙𝑝˙𝑅(-{\dot{p}},-{\dot{R}}) is of comparable complexity to (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}). + +So complexity fails to distinguish between a reasonable human reward function and its negative. + +Section 5 demonstrated that there are degenerate planner-reward pairs close to the minimum complexity among all pairs compatible with π˙˙𝜋{\dot{{\pi}}}.This section will argue that any reasonable pair (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) is unlikely to be close to this minimum, and is therefore of higher complexity than the degenerate pairs. Unlike simplicity, reasonable decomposition cannot easily be formalised. Indeed, a formalization would likely already solve the problem, yielding an algorithm to maximize it.Therefore, the arguments in this section are mostly qualitative. + +We use reasonable to mean ‘compatible with human judgements about rationality’.Since we do not have direct access to such a decomposition, the complexity argument will be about showing the complexity of these human judgements. This argument will proceed in three stages:1.Any reasonable (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) is of high complexity, higher than it may intuitively seem to us.2.Even given π˙˙𝜋{\dot{{\pi}}}, any reasonable (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) involves a high number of contingent choices. Hence any given (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) has high information (and thus high complexity), even given π˙˙𝜋{\dot{{\pi}}}.3.Past failures to find a simple (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) derived from π˙˙𝜋{\dot{{\pi}}} are evidence that this is tricky. + +Humans make noisy and biased decisions all the time. Though noise is important [Kahneman et al., 2016], many biases, such as anchoring bias, overconfidence, planning fallacies, and so on, affect humans in a highly systematic way; see Kahneman and Egan [2011] for many examples. + +Many people may feel that they have a good understanding of rationality, and therefore assume that assessing the (ir)rationality of any particular decision is not a complicated process.But an intuition for bias does not translate into a process for establishing a (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}). + +Consider the anchoring bias defined in Ariely et al. [2004], where irrelevant information — the last digits of social security numbers — changed how much people were willing to pay for goods.When defining a reasonable (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}), it does not suffice to be aware of the existence of anchoring bias888The fact that many cognitive biases have only been discovered recently argue against people having a good intuitive grasp of bias and rationality, as do people’s persistent bias blind spots [Scopelliti et al., 2015]., but one has to precisely quantify the extent of the bias — why does anchoring bias seem to be stronger for chocolate than for wine, for instance?And why these precise percentages and correlations, and not others?And can people’s judgment tell which people are more or less susceptible to anchoring bias?And can one quantify the bias for a single individual, rather than over a sample? + +Any given (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) can quantify the form and extent of these biases by computing objects like the regret function Reg⁡(p˙,R˙)​(s):=Reg⁡(p˙​(R˙),R˙)​(s)=VR˙∗​(s)−VR˙p˙​(R˙)​(s)assignReg˙𝑝˙𝑅𝑠Reg˙𝑝˙𝑅˙𝑅𝑠subscriptsuperscript𝑉˙𝑅𝑠subscriptsuperscript𝑉˙𝑝˙𝑅˙𝑅𝑠\operatorname{Reg}({\dot{p}},{\dot{R}})(s):=\operatorname{Reg}({\dot{p}}({\dot{R}}),{\dot{R}})(s)=V^{*}_{{\dot{R}}}(s)-V^{{\dot{p}}({\dot{R}})}_{{\dot{R}}}(s), which measures the divergence between the expected value of the actual and optimal human policies999To exactly quantify the anchoring bias above, we could use a regret function that contrasts π˙˙𝜋{\dot{{\pi}}} with the same policy, but where the decision is optimal for one turn only (rather than for all turns, as in standard regret)..Thus any given (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) — which contains the information to compute quantities like Reg⁡(p˙,R˙)​(s)Reg˙𝑝˙𝑅𝑠\operatorname{Reg}({\dot{p}},{\dot{R}})(s) or similar measures of bias101010In constrast, regret for the degenerate planner-reward pairs is trivial. Reg⁡(pπ˙,0)Regsubscript𝑝˙𝜋0\operatorname{Reg}(p_{\dot{{\pi}}},0) and Reg⁡(pg,Rπ˙)Regsubscript𝑝𝑔subscript𝑅˙𝜋\operatorname{Reg}(p_{g},R_{\dot{{\pi}}}) are identically zero — in the second case, since pg​(Rπ˙)subscript𝑝𝑔subscript𝑅˙𝜋p_{g}(R_{\dot{{\pi}}}) is actually optimal for Rπ˙subscript𝑅˙𝜋R_{\dot{{\pi}}}, getting the maximal possible reward — while (−pg,−Rπ˙)subscript𝑝𝑔subscript𝑅˙𝜋(-p_{g},-R_{\dot{{\pi}}}) has a regret that is identically −11-1 at each step., in every state — carries a high amount of numerical information about bias, and hence a high complexity. + +Since humans do not easily have access to this information, this implies that human judgement of irrationality is subject to Moravec’s paradox [Moravec, 1988].It is similar to, for example, social skills: though it seems intuitively simple to us, it is highly complex to define in algorithmic terms. + +Other authors have argued directly for the complexity of human values, from fields as diverse as computer science, philosophy, neuroscience, and economics[Minsky, 1984, Bostrom, 2014, Glimcher et al., 2009, Muehlhauser and Helm, 2012, Yudkowsky, 2011]. + +The previous section showed that reasonable (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) carry large amounts of information/complexity, but the key question is whether it requires information additional to that in π˙˙𝜋{\dot{{\pi}}}.This section will show thateven when π˙˙𝜋{\dot{{\pi}}} is known, there are many contingent choices that need to be made to define any specific reasonable (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}).Hence any given (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) contains a large amount of information beyond that in π˙˙𝜋{\dot{{\pi}}}, and hence is of higher complexity. + +Reasons to believe that human judgement about reasonable (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) contains many contingent choices:•There is a variability of human judgement between cultures. When Miller [1984] compared American and Indian assessments of the same behaviours, they found systematically different explanations for them111111“Results show that there were cross-cultural and developmental differences related to contrasting cultural conceptions of the person […] rather than from cognitive, experiential, and informational differences […].”Basic intuitions about rationality also vary between cultures [Nisbett et al., 2001, Brück, 1999].•There is a variability of human judgement within a single culture. When Slovic and Tversky [1974] analysed the “Allais Paradox”, they found that different people gave different answers as to what the rational behaviour was in their experiments.•There is evidence of variability of human judgement within the same person. Slovic and Tversky [1974] further attempted to argue for the rationality of one of the answers.This sometimes resulted in the participant sometimes changing their minds, and contradicting their previous assessment of rationality.•There is a variability of human judgement for the same person assessing their own values, caused by differences as trivial as question ordering [Schuman and Ludwig, 1983].So human meta-judgement, of own values and rationality, is also contingent and variable.•People have partial bias blind spots around their own biases [Scopelliti et al., 2015].Thus if a human is following policy π˙˙𝜋{\dot{{\pi}}}, a decomposition (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) would provide additional information about the cultural background of the decomposer, their personality within their culture, and even about the past history of the decomposer and how the issue is being presented to them.Those last pieces prevents us from ‘simply’ using the human’s own assessment of their own rationality, as that assessment is subject to change and re-interpretation depending on their possible histories. + +One final argument that there is no simple algorithm for going from π˙˙𝜋{\dot{{\pi}}} to (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}): many have tried and failed to find such an algorithm.Since the subject of human rationality has been a major one for several thousands of years, the ongoing failure is indicative — though not a proof — of the difficulties involved.There have been many suggested philosophical avenues for finding such a reward (such as reflective equilibrium [Rawls, 1971]), but all have been underdefined and disputed. + +The economic concept of revealed preferences [Samuelson, 1948] is the most explicit, using the assumption of rational behaviour to derive human preferences.This is an often acceptable approximation, but can be taken too far: failure to take achieve an achievable goal does not imply that failure was desired.Even within the confines of economics, it has been criticised by behavioural economics approaches, such as prospect theory [Kahneman and Tversky, 2013] — and there are counter-criticisms to these. + +Using machine learning to deduce the intentions and preferences of humans is in its infancy, but we can see non-trivial real-world examples, even in settings as simple as car-driving [Lazar et al., 2018]. + +Thus to date, neither humans nor machine learning have been able to find simple ways of going from π˙˙𝜋{\dot{{\pi}}} to (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}), nor any simple and explicit theory for how such a decomposition could be achieved.This suggests that (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) is a complicated object, even if π˙˙𝜋{\dot{{\pi}}} is known.In conclusion: + +If π˙˙𝜋{\dot{{\pi}}} is a human policy, and L𝐿L is a ‘reasonable’ computer language with (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) a ‘reasonable’ compatible planner-reward pair, then the complexity of (p˙,R˙)˙𝑝˙𝑅({\dot{p}},{\dot{R}}) is not close to minimal amongst the pairs compatible with π˙˙𝜋{\dot{{\pi}}}. + +We have shown that some degenerate planner-reward decompositions of a human policy have near-minimal description length and argued that decompositions we would endorse do not.Hence, under the Kolmogorov-complexity simplicity prior, a formalization of Occam’s Razor, the posterior would endorse degenerate solutions.Previous work has shown that noisy rationality is too strong an assumption as it does not account for bias; we tried the weaker assumption of simplicity, strong enough to avoid typical No Free Lunch results, but it is insufficient here. + +This is no reason for despair: there is a large space to explore between these two extremes. Our hope is that with some minimal assumptions about planner and reward we can infer the rest with enough data. Staying close to agnostic is desirable in some settings: for example, a misspecified model of the human reward function can lead to disastrous decisions with high confidence [Milli et al., 2017].Anonymous [2019] makes a promising first try — a high-dimensional parametric planner is initialized to noisy rationality and then adapts to fit the behavior of a systematically irrational agent. + +How can we reconcile our results with the fact that humans routinely make judgments about the preferences and irrationality of others? And, that these judgments are often correlated from human to human? After all, No Free Lunch applies to human as well as artificial agents.Our result shows that they must be using shared priors, beyond simplicity, that are not learned from observations. We call these normative assumptions because they encode beliefs about which reward functions are more likely and what constitutes approximately rational behavior.Uncovering minimal normative assumptions would be an ideal way to build on this paper; Appendix C shows one possible approach. \ No newline at end of file diff --git a/1712.05888v1.txt b/1712.05888v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..188c0b405880955f561174025b270b70b3460d11 --- /dev/null +++ b/1712.05888v1.txt @@ -0,0 +1,217 @@ +Public and private organizations capture and store diverse types of information about individuals that are either obligated to publish or could benefit from sharing with others [20].A key impediment in sharing is the concern of privacy.For instance, information about visited locations, online purchases, movie preferences [35], or web searches [5] has been shown to lead to inferences about sensitive properties like health, religious affiliation, or sexual orientation. + +In recent years, the field of privacy preserving data-sharing has flourished and differential privacy [15] (DP) has emerged as the predominant privacy standard.Informally, DP states that for a database that contains a single record per user, the participation of an individual will change the output of an analysis by a bounded factor proportional to a privacy parameter ϵitalic-ϵ\epsilon.Most work in differential privacy (with the exceptions of [4, 21]) has been developed under the assumption that every record in the database is equally sensitive. + +In this work, we depart from the above well trodden path, as we consider data sharing when only part of the data is sensitive, while the remainder (that may consist the majority) is non-sensitive.In real-world scenarios, the sensitive/non-sensitive dichotomy of data is not always apparent, but in certain cases it naturally occurs as a consequence of legislature, personal preferences, convenience, and privacy policies. + +In this paper, we use policies as the language for specifying sensitivity.Traditionally, query answering in the presence of policies has been the focus of access control literature [9, 33, 34].The Truman and non-Truman models [33] are the two primary models for query answering in access control.Based on the Truman model, queries are transparently re-written to ensure users only see what is contained in the authorized view.Thus, the result is correct only with respect to the restricted view.In non-Truman models queries that can not be answered correctly are rejected.However, neither approach guarantees privacy.Consider example 3, where the smoker’s lounge is the only sensitive location and Alice is attempting to locate Bob.If Bob is at the sensitive location, the Truman model will return nothing and the non-Truman model will honestly reject the query.Therefore, in both cases, Bob’s location is indirectly revealed, because the sensitivity of his record is correlated with the value of the record.This attack is an example of what we call an exclusion attack, which we formally define in section 3.2. + +An alternative solution is to directly apply differential privacy.Such an approach would hide all properties of a record (including its sensitivity) and protect against exclusion attacks.However, DP algorithms do not leverage on the fact that part of the data is non-sensitive to lower the error rates of the query answers.In prior work, heterogeneous DP [4] and personalized differential privacy (PDP) [21] have tried to take advantage of different privacy levels between records.Specifically, PDP [21] considers the case whereeach record r𝑟r is associated with its own privacy parameter ϵ​(r)italic-ϵ𝑟\epsilon(r).PDP, for instance, allows suppressing records with strong privacy requirements (ϵ​(r)2.2×105𝑛2.2superscript105n>2.2\times 10^{5}. + +For the remainder we use 𝐱𝐱\mathbf{x} to denote the histogram over all records in D𝐷D, and 𝐱n​ssubscript𝐱𝑛𝑠\mathbf{x}_{ns} over the non-sensitive records of D𝐷D alone. Note that under OSDP, a database D′∈NP​(D)superscript𝐷′subscript𝑁𝑃𝐷D^{\prime}\in N_{P}(D) is a neighbor of D𝐷D in one of two ways: (a) a sensitive record in D𝐷D is replaced with another sensitive record in D′superscript𝐷′D^{\prime}, or (b) a sensitive record in D𝐷D is replaced with a non-sensitive record in D′superscript𝐷′D^{\prime}. Thus, if 𝐱n​ssubscript𝐱𝑛𝑠\mathbf{x}_{ns} (𝐱′n​ssubscriptsuperscript𝐱′𝑛𝑠\mathbf{x^{\prime}}_{ns}) denotes the output of a histogram query over the non-sensitive records of D𝐷D (D′superscript𝐷′D^{\prime}, resp.), then the neighboring histograms differ in at most one count, and all counts in 𝐱′n​ssubscriptsuperscript𝐱′𝑛𝑠\mathbf{x^{\prime}}_{ns} are no smaller than the counts in 𝐱n​ssubscript𝐱𝑛𝑠\mathbf{x}_{ns}. Thus, we can release histogram counts on the non-sensitive records by adding one-sided Laplace noise to ensure OSDP. The one-sided Laplace distribution, L​a​p−​(λ)𝐿𝑎subscript𝑝𝜆Lap_{-}(\lambda), is the mirrored version of exponential distribution with scale equal to λ𝜆\lambda, where all the mass is on the negative values. + +The OsdpLaplace answers queries by adding one-sided noise to the query answer computed only using non-sensitive records. + +Let D,D′𝐷superscript𝐷′D,D^{\prime} P𝑃P-neighboring databases. Let 𝐱𝐱\mathbf{x} (𝐱′superscript𝐱′\mathbf{x}^{\prime}) denote the true non-sensitive histogram on D𝐷D (D′superscript𝐷′D^{\prime}).For simplicity, let ℳℳ\mathcal{M} be an alias for OsdpLaplace.Note that r​a​n​g​e​(ℳ​(D,P))𝑟𝑎𝑛𝑔𝑒ℳ𝐷𝑃range(\mathcal{M}(D,P)) ⊆r​a​n​g​e​(ℳ​(D′,P))absent𝑟𝑎𝑛𝑔𝑒ℳsuperscript𝐷′𝑃\subseteq range(\mathcal{M}(D^{\prime},P)) since ∀ifor-all𝑖\forall i, xi≤xi′subscript𝑥𝑖subscriptsuperscript𝑥′𝑖x_{i}\leq x^{\prime}_{i}.Let 𝐲∈r​a​n​g​e​(ℳ​(D′,P))𝐲𝑟𝑎𝑛𝑔𝑒ℳsuperscript𝐷′𝑃\mathbf{y}\in range(\mathcal{M}(D^{\prime},P)), then there are two cases: + +Case 1. ∃i:xi1𝛾1\gamma>1 and β𝛽\beta. This technique partitions the domain of the histogram into “High” and “Low” regions. The algorithm picks a bin b𝑏b at random and sets the bins in the range b±d⋅βplus-or-minus𝑏⋅𝑑𝛽b\pm d\cdot\beta as “High” bins. Every bin not in the High region is automatically in the Low region. Then, we proceed by sampling with replacement from bins of the histogram, bins of the “High” area are sampled with weight γ𝛾\gamma , while bins of the “Low” area are sampled with weight 111. Choosing a high γ𝛾\gamma and a smaller β𝛽\beta allows us to create an 𝐱n​ssubscript𝐱𝑛𝑠\mathbf{x}_{ns} that is highly dissimilar from 𝐱𝐱\mathbf{x}. We set γ=5𝛾5\gamma=5 and β=.4𝛽.4\beta=.4. + +For each policy, we use 777 different values of ρ𝐱subscript𝜌𝐱\rho_{\mathbf{x}}: {0.99,0.90,0.75,\{0.99,0.90,\allowbreak 0.75,0.50,0.25,0.10,0.01}0.50,0.25,0.10,0.01\}. Thus, for each of the 7 datasets we have 7×2=1472147\times 2=14 different non-sensitive histograms for a total of 989898 (𝐱,𝐱n​s)𝐱subscript𝐱𝑛𝑠(\mathbf{x},\mathbf{x}_{ns}) pairs to evaluate our algorithms on. + +Classification:First we consider a classification task on the TIPPERS dataset: based on a user’s daily trajectory we classify whether the user is a resident or a visitor. More specifically, we learn a logistic regression (LR) model to predict whether a daily trajectory corresponds to a resident. Due to IRB restrictions, we do not have access to the true identities of the owners of each device_mac in the data. For that reason, to create the training data we classify as residents owners of device_mac that (a) visit Bren Hall at least 10 days per month for the last 5 months and either (b) work beyond 7pm once a week, or (c) work more than 6 hours at once per week; every other user is classified as a visitor. In total, we detected 381381381 residents that correspond to ∼43​Ksimilar-toabsent43𝐾\sim 43K daily trajectories (out of ∼553​Ksimilar-toabsent553𝐾\sim 553K total daily trajectories).We use the following features derived from the daily trajectories: duration of stay at Bren Hall, distinct number of access points visited during a day, and the number of times each individual access point is visited in a trajectory. We also consider frequent patterns of the form (A​P1,A​P2,A​P3)𝐴subscript𝑃1𝐴subscript𝑃2𝐴subscript𝑃3(AP_{1},AP_{2},AP_{3}) from the trajectories. A trajectory satisfies a frequent pattern if it visits the three access points during the day at consecutive time intervals. We chose patterns that appear in at least 50 trajectories and construct a feature for each pattern using the number of times the pattern appears in a daily trajectory. + +We evaluate the performance of all LR classifiers using the receiver operating characteristic (ROC) curve, that is created by plotting the true positive rate versus the false positive rate for multiple thresholds over the probability of predicting a test record as belonging to a resident. The accuracy is usually reported using the average area under the ROC curve (AUC) over 10-fold cross validation, which is a value between [0,1]01[0,1]. We report 1.0−AUC1.0AUC1.0-\textnormal{{AUC}} as a measure of prediction error. + +High Dimensional Histograms:We also consider the task of privately releasing high dimensional histograms on the TIPPERSdataset.More specifically, we consider the number of distinct users for every n consecutive access points in a trajectory (i.e., the n-gram). This is a highly non-trivial task since (a) the domain size for an n-gram is 64nsuperscript64𝑛64^{n} and (b) the histogram over all bins has sensitivity 64nsuperscript64𝑛64^{n} since a user might appear in all n-grams.We use the mean relative error (MRE) to measure the quality of our private n-gram estimates.More specifically, for a histogram 𝐱𝐱\mathbf{x} of size d𝑑d and its private estimate 𝐱~~𝐱\mathbf{\tilde{x}}, we have:MRE​(𝐱,𝐱~)=1d​∑i=1d|xi−x~i|/max⁡(xi,δ)MRE𝐱~𝐱1𝑑superscriptsubscript𝑖1𝑑subscript𝑥𝑖subscript~𝑥𝑖subscript𝑥𝑖𝛿\displaystyle\textnormal{{MRE}}(\mathbf{x},\mathbf{\tilde{x}})=\frac{1}{d}\displaystyle\sum_{i=1}^{d}|x_{i}-\tilde{x}_{i}|/\max(x_{i},\delta)In our experiments, we set δ=1𝛿1\delta=1 and report the average MRE over 101010 independent executions. + +Low Dimensional Histograms:We also evaluate our algorithms on releasing 111 and 222-D histograms under OSDP. Our goal is twofold, we want to: evaluate the performance of OSDP algorithms in a realistic scenario and explore under which conditions OSDP algorithms offer advantages over their DP counterparts. Towards these goals we use histograms from both the benchmark datasets and TIPPERS. More specifically, we used TIPPERSto generate a 2-D histogram that contains the number of distinct users that connected to every access point and for every hour of a single day. For the DPBench-1D datasets, we consider the task of releasing 1-D histograms.In addition to MRE defined earlier, we also use per bin-relative error to measure the utility of the algorithms. Per-bin relative error is defined as a vector with the same size as the input histogram, and contains one relative error value per bin. More specifically:Rel​(𝐱,𝐱~)Rel𝐱~𝐱\displaystyle\textnormal{{Rel}}(\mathbf{x},\mathbf{\tilde{x}})=[|xi−x~i|/max⁡(xi,δ)]i∈[d]absentsubscriptdelimited-[]subscript𝑥𝑖subscript~𝑥𝑖subscript𝑥𝑖𝛿𝑖delimited-[]𝑑\displaystyle=\big{[}|x_{i}-\tilde{x}_{i}|/\max(x_{i},\delta)\big{]}_{i\in[d]}We report the median (Rel50subscriptRel50\textnormal{{Rel}}_{50}) and 95% (Rel95subscriptRel95\textnormal{{Rel}}_{95}) of the per-bin relative error to capture the average and worst-case empirical per-bin errors. For our experiments we ran each algorithm 101010 times on each input and estimate the value of the loss function by taking the average across the executions, we also use δ=1.0𝛿1.0\delta=1.0. + +Algorithms: We compare four algorithms.1) All NSis a baseline that does not satisfy OSDP that runs a non-private classifier on all the non-sensitive records. This captures the threshold algorithm that satisfies personalized DP [21]. Recall that personalized DP is susceptible to the exclusion attack.2) OsdpRRis our OSDP strategy of releasing true non-sensitive records using OsdpRR and then running a non-private classifier.3) ObjDPis an implementation of the objective perturbation technique for differentially private empirical risk minimization [12]. As prescribed by the authors, we normalized feature vectors to ensure the norm is bounded by 111 before running the method on our dataset.4) Randomis a baseline that randomly predicts a label based on just the label distribution (and ignoring all the features). + +Results: In Figure 1, we report the error (1−limit-from11-AUC) for the policies described in Section 6.1.1 for two levels of privacy budget, ϵ=1.0italic-ϵ1.0\epsilon=1.0 and ϵ=0.01italic-ϵ0.01\epsilon=0.01. In each figure, we plot All NS and OsdpRR using bars, as their accuracy differs based on the fraction of non-sensitive records in the dataset. We report the error of ObjDP and Random using a straight line. We see that OsdpRRachieves as low an error as the non-private baseline All NS, and the absolute errors are close to 10%. As expected, as the fraction of non-sensitive records decreases the error increases (as the number of records used by both All NS and OsdpRRto train the LR model decreases). ObjDP has high error close to that of the Random baseline. This shows that treating all records as sensitive results in a high error and OSDP algorithms alleviate this problem by leveraging on non-sensitive records. + +Algorithms:As noted earlier, under DP the sensitivity of an n-gram histogram is 64nsuperscript64𝑛64^{n}. for that reason, we use truncation [22] and choose at most k𝑘k n-grams from each daily trajectory. This step reduces the sensitivity of releasing the n-gram to 2⋅k⋅2𝑘2\cdot k. We report the MRE of the Laplace mechanism with truncation of k=1𝑘1k=1 (denoted by LM T1). We also report the MRE of Laplace mechanism with the optimal choice of k𝑘k for truncation (denoted by LM T*),this approach does not satisfy DP. Given the high domain size, it is intractable to materialize and perturb the complete histogram for LM when n𝑛n is large. In our experiments, we only materialize non-zero counts, so for the MRE computation we analytically computed the contribution of the zero counts to it. + +Results: In Figures 3, 3, we plot the MRE error of the 4-grams and 5-grams for all policies considered.We report All NS and OsdpRRerror using bars, and the errors of LM T1 and LM T* using straight lines – since the DP algorithms’ error is independent of the policy used. We observed that the optimal choice of truncation parameter k𝑘k for the 4- and 5-gram counting task was k=1𝑘1k=1. We see that All NS has error smaller than OsdpRR, but the difference is not too large when there are 10-50% sensitive records in the dataset.When ϵ=1italic-ϵ1\epsilon=1, LM algorithms has error comparable to OsdpRR, when 50%percent5050\% of the records are non-sensitive.For ϵ=0.01italic-ϵ0.01\epsilon=0.01, the LM algorithms have an order of magnitude poorer performance than the OsdpRR algorithm.Thus, we see again that leveraging on the presence of non-sensitive records results in significant utility gains.We did not consider more sophisticated DP techniques for releasing high-dimensional histograms. We believe their error will also be an order of magnitude larger than the OSDP algorithm, since they will also have to contend with the high sensitivity and would need to use truncation. + +Algorithms: For the task of releasing low dimensional histograms, we compare a total of 444 OSDP and 222 DP algorithms. The DP algorithms are: Laplace mechanism and DAWA, the state of the art DP algorithm for this task according to a recent benchmark study [18]. The OSDP algorithms are: OsdpRR, OsdpLaplace, OsdpLaplaceL1 and DAWAz. For DAWAz we used ρ=0.1𝜌0.1\rho=0.1 fraction of the privacy budget to run OsdpRR to estimate the set of zero counts in the histogram. + +Figure 4 reports the mean relative error for two different values of the privacy parameter: ϵ∈{1,0.01}italic-ϵ10.01\epsilon\in\{1,~{}0.01\} across all policies. We see that for ϵ=1italic-ϵ1\epsilon=1 the OSDP algorithms outperform the DP algorithm for policies with more than 25%percent2525\% non-sensitive records, but for smaller fractions the DP algorithm is clearly more competitive. The insight from this result is that for datasets with mainly sensitive records, using a DP algorithm is preferable. In Fig. 4(b) we report our findings for ϵ=0.01italic-ϵ0.01\epsilon=0.01 where again the OSDP algorithm OsdpLaplaceL1 is outperformed from the DP algorithm at the same 25%percent2525\% mark, but this time DAWAz is highly competitive for all policies. This is because the OSDP subroutine of DAWAz over-reports zero bin counts, which is better than adding high scale noise to the true bin counts. For brevity in the rest of our results we report only policies with more than 25%percent2525\% fraction of non-sensitive records and for ϵ=1italic-ϵ1\epsilon=1. + +In figures 5(a) and 5(b) we report the median and 95% per bin relative error. Overall we see that across error metrics, OSDP algorithms offer significant improvements over DAWA for all fractions of non-sensitive values. Even when only half the data records are non-sensitive we see that OSDP algorithms achieve better error rates in MRE and REL95subscriptREL95\textnormal{{REL}}_{95}, which means that the OSDP algorithms have an advantage in reporting counts of bins with otherwise high error.Note that DAWAz is not as competitive as we would expect and is outperformed from OspLaplaceL1. The main reason is that the policy in the TIPPERS dataset is value based. So some histogram bins contain only sensitive records, while others only consist of non-sensitive records. So OsdpLaplaceL1 is able to add normal Laplace noise to the sensitive buckets (ensuring DP) and one-sided noise to non-sensitive buckets (ensuring OSDP). The overall algorithm ensures OSDP by sequential composition. + +In this set of experiments, our goal is to analyze the performance of DP and OSDP algorithms for varying levels of the closeness of the non-sensitive histogram and the non-sensitive ratio. Closeness shows how similar 𝐱𝐱\mathbf{x} and 𝐱n​ssubscript𝐱𝑛𝑠\mathbf{x}_{ns} are, and the non-sensitive ratio ρ𝐱=‖𝐱n​s‖1/‖𝐱‖1subscript𝜌𝐱subscriptnormsubscript𝐱𝑛𝑠1subscriptnorm𝐱1\rho_{\mathbf{x}}=\|\mathbf{x}_{ns}\|_{1}/\|\mathbf{x}\|_{1} denotes the portion of tuples in 𝐱n​ssubscript𝐱𝑛𝑠\mathbf{x}_{ns}. Note that since we report aggregate results of similar inputs (e.g., group inputs by policy), the aggregated value of the loss function might skew the results due to different error scales between inputs. For this reason, we report the regret of each algorithm w.r.t. an error measure Err rather than the absolute value of the error. More specifically, for histogram 𝐱𝐱\mathbf{x}, budget ϵitalic-ϵ\epsilon, error measure Err, and algorithm A∈𝒜A𝒜\textnormal{{A}}\in\mathcal{A} the regret of A is:regretErr​(A,𝐱,ϵ)=Err​(A​(𝐱,ϵ),𝐱)O​P​T𝒜​(Err,𝐱,ϵ)subscriptregretErr𝐴𝐱italic-ϵErrA𝐱italic-ϵ𝐱𝑂𝑃subscript𝑇𝒜Err𝐱italic-ϵ\displaystyle\text{regret}_{\textnormal{{Err}}}(A,\mathbf{x},\epsilon)=\frac{\textnormal{{Err}}(\textnormal{{A}}(\mathbf{x},\epsilon),\mathbf{x})}{OPT_{\mathcal{A}}(\textnormal{{Err}},\mathbf{x,\epsilon})} + +Main Results: In figure 6 we present our results comparing performance across different values of the privacy parameter ϵitalic-ϵ\epsilon. Each figure shows results for both policies, across different values of the non sensitive ratio ρ𝐱subscript𝜌𝐱\rho_{\mathbf{x}}. Note that y-axis reports the average regret for MRE of each algorithm w.r.t. a set of 4 OSDP and 2 DP algorithms, which are averaged over the 777 histograms from DPBench-1D. We show results only for the most competitive algorithms. The dotted line corresponds to regret equal to 111 and since our results are aggregates, single algorithms will rarely have average regret equal to 111. Again we observe that low values of ϵitalic-ϵ\epsilon (i.e., bigger noise scale) favor the hybrid algorithm DAWAz. The main takeaway is that for ratios ρ𝐱≤0.25subscript𝜌𝐱0.25\rho_{\mathbf{x}}\leq 0.25 the DP algorithm outperforms the “pure” OSDP algorithm OsdpLaplaceL1. Also note that for both ϵitalic-ϵ\epsilon values the qualitative analysis of the results does not differ by much. For the above reasons, in our next results we (a) limit ρ𝐱≥0.25subscript𝜌𝐱0.25\rho_{\mathbf{x}}\geq 0.25 and (b) focus on a single ϵitalic-ϵ\epsilon value and present separate results for Close and Far policies. + +Next, in figures 7 and 8 we present our main results for the MRE and Rel95subscriptRel95\textnormal{{Rel}}_{95} error measures respectively. The privacy parameter ϵitalic-ϵ\epsilon is fixed to 111 and each figure shows the results for a different policy generator. The y-axis reports the average regret of each algorithm. For Close policies and across all non sensitive ratios and error metrics, OSDP algorithms always outperform DP algorithms, with the highest improvements in high error bins (i.e., Rel95subscriptRel95\textnormal{{Rel}}_{95}). Even for Far policies DAWAz outperforms the best performing DP algorithm DAWA for all non-sensitive ratios. This confirms our insight behind its design, as DAWAz combines the best of both worlds: it successfully leverages the non-sensitive records to identify zero cells using OSDP algorithms to enhance a state-of-the-art DP algorithm. + +In figure 9 we present results for the Close policy and fixed non-sensitive ratios across datasets. Note that these results are not aggregate and in the y-axis we report the regret for a single histogram with a fixed ρ𝐱subscript𝜌𝐱\rho_{\mathbf{x}} and a fixed policy. Each group in the x-axis corresponds to a different dataset and the datasets are sorted with descending sparsity (i.e., Adult is the sparsest dataset). Again, the dotted line corresponds to regret equal to 111. In some cases an algorithm other than the ones shown in the figure achieves a regret of 1 (e.g., OsdpRR has regret 111 in Adult), but we do not show them since they have very high regrets for other datasets (and to be consistent with our previous figures). Lastly note that Nettrace is a sorted histogram, which highly favors DAWA explaining its sudden drop in regret. + +In the case of the Close policy, OSDP algorithms offer significant performance improvements over using a traditional DP algorithm, across all datasets. We can see that for the sparser Adult histogram we achieve an improvement on regret of 25×25\times, this is because the OSDP algorithms can correctly identify the bins with 0 counts, and incur 0 error on them. As the sparsity of the datasets decreases we see the gap between DAWA (the best performing DP algorithm) and the OSDP algorithms to become smaller. Lastly we observe that as ρ𝐱subscript𝜌𝐱\rho_{\mathbf{x}} becomes smaller the advantages of DAWAz become more apparent - since DAWAz uses both the sensitive and the non-sensitive part of the histogram. + +Comparison with PDP:Finally, in Fig. 10, we compare OsdpLaplaceL1 with the PDP algorithm Suppress (described in Section 3.4) with thresholds τ={10​ϵ,50​ϵ,100​ϵ}𝜏10italic-ϵ50italic-ϵ100italic-ϵ\tau=\{10\epsilon,50\epsilon,\allowbreak 100\epsilon\} on the benchmark datasets. In figure 3.4 we show the two extreme cases for τ={10​ϵ,100​ϵ}𝜏10italic-ϵ100italic-ϵ\tau=\{10\epsilon,100\epsilon\} and refer to them Suppress10 and Suppress100 respectively. We observe that Suppress starts becoming competitive for values of τ≥100​ϵ𝜏100italic-ϵ\tau\geq 100\epsilon, but this utility comes at a cost of 100100100 times worse protection from exclusion attacks (see Theorems 3.1 and 3.4). + +One-sided differential privacy (OSDP) presents a new direction for privacy research in that it is the first formal privacy definition that exploits the sensitive/non-sensitive dichotomy of data to allow true data to be released with formal privacy guarantees.This paper focused on motivating and defining OSDP and highlighting its advantages both in the context of data sharing tasks where differential privacy (DP) either does not apply or offers very low utility, as well as, insituations where DP performs well, but OSDP appropriately combined with DP offers significant improvement. Below we highlight some of the key extensions that we believe offer interesting directions of future work. + +Policies that go beyond records.In this paper, we considered policy functions that define whether or not a specific record is non-sensitive. One could extend this to the case where a policy specifies a view over the database that is non-sensitive (like in the work on authorization views [33]), or a policy that determines that a view is sensitive (negative authorization [7]). While there has been work on whether or not a query leaks any information about a view [29, 31], there is no work that bounds the information to leak (like DP) about the sensitive records in such a setting. + +One-sided differential privacy and constraints.Theorem 3.1 showed that OSDP algorithms ensure freedom from exlusion attacks as long as an adversary believes the target record is independent of the rest of the database. As in the field of differentially private data analysis problems arise when the records in the database are correlated.For instance, in a location privacy setting, a specific non-sensitive location may be reachable only through a set of locations that are all sensitive. Revealing the fact that a user was in that location (even using our randomized response algorithm) will reveal the fact that the user was in a sensitive location in the previous time point with certainty, thus resulting in a privacy breach. Designing algorithms for OSDP in the presence of constraints in an important and interesting avenue for future work. + +Policy Specification and EnforcementOSDP definition and mechanisms assume the presence of an explicit policy function that partitions data into sensitive nad non-sensitive classes.As we discussed in the introduction, there are several application domains where explicit privacy policies and/or regulations exist that naturally lead to sucha classification. Furthermore, good practice followed by several data collectors (e.g., e-commerce sites, search engines, etc.) empowersusers to opt-in or opt-out. Such a practice as well lends itself directly to explicit policy function. Nonetheless, if we are to use OSDP in general applicationcontext, mechanisms to specify comprehensive policies that dictate data sensitivity or, better still, learn such policies, perhaps through appropriate machine learningtechniques offers rich fertile area for future research. Finally, our focus in this work has been on appropriate privacy definition and mechanisms to realize OSDP. We havenot focused on efficient approach to implement OSDP, especially in online setting wherein user’s may dynamically ask queries. + +In this work we presented a new privacy definition called one-sided privacy that allows for different levels of privacy guarantees (sensitive or non-sensitive) to be applied to different records in the dataset. The level of protection is determined by the value of a record, and hence, whether a record is sensitive or non-sensitive must also be hidden. This makes the privacy definition unique. We present the fundamental theory behind the privacy definition, compare it to existing definitions and present input and output perturbation algorithms. We present case studies where one-sided privacy can be used, along with effect of our algorithms on the utility of analyzing the data in these scenarios. We concluded with a discussion of extensions and open questions for future work. + +We propose a strict generalization of the definition of OSDP that supports neighboring datasets with different number of records and under which we can show that the parallel composition holds. + +Given a database D𝐷D and r∈D𝑟𝐷r\in D with P​(r)=0𝑃𝑟0P(r)=0, let D′=D−{r}∪{r′}superscript𝐷′𝐷𝑟superscript𝑟′D^{\prime}=D-\{r\}\cup\{r^{\prime}\} an OSDP neighbor of D𝐷D, i.e., D′∈NP​(D)superscript𝐷′subscript𝑁𝑃𝐷D^{\prime}\in N_{P}(D). Then database D′′=D∪rsuperscript𝐷′′𝐷𝑟D^{\prime\prime}=D\cup{r} is such that: (a) D′′∈NPe​(D)superscript𝐷′′subscriptsuperscript𝑁𝑒𝑃𝐷D^{\prime\prime}\in N^{e}_{P}(D) and (b) D′∈NPe​(D′′)superscript𝐷′subscriptsuperscript𝑁𝑒𝑃superscript𝐷′′D^{\prime}\in N^{e}_{P}(D^{\prime\prime}). Therefore, for mechanism ℳℳ\mathcal{M} that satisfies (P,ϵ)𝑃italic-ϵ(P,\epsilon)-eOSDP and it holds that ∀𝒪⊆r​a​n​g​e​(ℳ)for-all𝒪𝑟𝑎𝑛𝑔𝑒ℳ\forall\mathcal{O}\subseteq range(\mathcal{M}):P​r​[ℳ​(D)∈𝒪]𝑃𝑟delimited-[]ℳ𝐷𝒪\displaystyle Pr[\mathcal{M}(D)\in\mathcal{O}]≤eϵ​P​r​[ℳ​(D′′)∈𝒪]≤eϵ​P​r​[ℳ​(D′)∈𝒪]⟹absentsuperscript𝑒italic-ϵ𝑃𝑟delimited-[]ℳsuperscript𝐷′′𝒪superscript𝑒italic-ϵ𝑃𝑟delimited-[]ℳsuperscript𝐷′𝒪absent\displaystyle\leq e^{\epsilon}Pr[\mathcal{M}(D^{\prime\prime})\in\mathcal{O}]\leq e^{\epsilon}Pr[\mathcal{M}(D^{\prime})\in\mathcal{O}]\impliesP​r​[ℳ​(D)∈𝒪]𝑃𝑟delimited-[]ℳ𝐷𝒪\displaystyle Pr[\mathcal{M}(D)\in\mathcal{O}]≤e2​ϵ​P​r​[ℳ​(D′)∈𝒪]absentsuperscript𝑒2italic-ϵ𝑃𝑟delimited-[]ℳsuperscript𝐷′𝒪\displaystyle\leq e^{2\epsilon}Pr[\mathcal{M}(D^{\prime})\in\mathcal{O}]∎ + +Note that the inverse statement of Theorem 9.1 does not necessarily hold, i.e., (P,2​ϵ)𝑃2italic-ϵ(P,2\epsilon)-OSDP does not imply (P,ϵ)𝑃italic-ϵ(P,\epsilon)-eOSDP. + +Since under eOSDP, for D′∈NPe​(D)superscript𝐷′subscriptsuperscript𝑁𝑒𝑃𝐷D^{\prime}\in N^{e}_{P}(D), we have that D𝐷D has either one more or one less record than D′superscript𝐷′D^{\prime}. Thus, exactly one partition changes in D′superscript𝐷′D^{\prime}, i.e., ∃j∈[n]𝑗delimited-[]𝑛\exists j\in[n], s.t., Dj≠Dj′subscript𝐷𝑗subscriptsuperscript𝐷′𝑗D_{j}\neq D^{\prime}_{j} and ∀i∈[n]\{j}for-all𝑖\delimited-[]𝑛𝑗\forall i\in[n]\backslash\{j\}: Di=Di′subscript𝐷𝑖subscriptsuperscript𝐷′𝑖D_{i}=D^{\prime}_{i}. Lastly, since any (Pi,ϵi)subscript𝑃𝑖subscriptitalic-ϵ𝑖(P_{i},\epsilon_{i})-eOSDP mechanism also satisfies (Pm​r,ϵi)subscript𝑃𝑚𝑟subscriptitalic-ϵ𝑖(P_{mr},\epsilon_{i})-eOSDP and only one partition changed between D𝐷D and D′superscript𝐷′D^{\prime}, it follows that ℳ1​(Di)∘…∘ℳn​(Dn)subscriptℳ1subscript𝐷𝑖…subscriptℳ𝑛subscript𝐷𝑛\mathcal{M}_{1}(D_{i})\circ\ldots\circ\mathcal{M}_{n}(D_{n}) satisfies (Pm​r,max⁡(ϵi))subscript𝑃𝑚𝑟subscriptitalic-ϵ𝑖(P_{mr},\max(\epsilon_{i}))-eOSDP.∎ + +Proof of Theorem 3.4 + +Our goal is to bound the posterior odds ratio:Pr(r=x|ℳ(D)∈𝒪)θPr(r=y|ℳ(D)∈𝒪)θ≤Pr(r=x)θPr(r=y)θ​maxD1,D2⁡Prℳ⁡(ℳ​(D1)∈𝒪)Prℳ⁡(ℳ​(D2)∈𝒪)\frac{\Pr\mbox{${}_{\theta}$}(r=x|\mathcal{M}(D)\in\mathcal{O})}{\Pr\mbox{${}_{\theta}$}(r=y|\mathcal{M}(D)\in\mathcal{O})}\leq\frac{\Pr\mbox{${}_{\theta}$}(r=x)}{\Pr\mbox{${}_{\theta}$}(r=y)}\max_{D_{1},D_{2}}\frac{\Pr_{\mathcal{M}}(\mathcal{M}(D_{1})\in\mathcal{O})}{\Pr_{\mathcal{M}}(\mathcal{M}(D_{2})\in\mathcal{O})} + +Where D𝐷D is drawn from θ𝜃\theta and D1=D∪{x}subscript𝐷1𝐷𝑥D_{1}=D\cup\{x\} and D2=D∪{y}subscript𝐷2𝐷𝑦D_{2}=D\cup\{y\}, with x𝑥x a sensitive record and y𝑦y any record, i.e., P​(x)=0𝑃𝑥0P(x)=0 and P​(y)∈{0,1}𝑃𝑦01P(y)\in\{0,1\}. Note that Prℳ⁡(ℳ​(D1)∈𝒪)=Prℳ⁡(ℳ​(D)∈𝒪)subscriptPrℳℳsubscript𝐷1𝒪subscriptPrℳℳ𝐷𝒪\Pr_{\mathcal{M}}(\mathcal{M}(D_{1})\in\mathcal{O})=\Pr_{\mathcal{M}}(\mathcal{M}(D)\in\mathcal{O}) for Suppress, since x𝑥x does not participate in the computations of ℳℳ\mathcal{M}. If P​(y)=0𝑃𝑦0P(y)=0, the output of Suppress will remain unchanged, since the sensitive record is not considered in the computations at all, i.e., maxD1,D2⁡Prℳ⁡(ℳ​(D1)∈𝒪)Prℳ⁡(ℳ​(D2)∈𝒪)=1subscriptsubscript𝐷1subscript𝐷2subscriptPrℳℳsubscript𝐷1𝒪subscriptPrℳℳsubscript𝐷2𝒪1\max_{D_{1},D_{2}}\frac{\Pr_{\mathcal{M}}(\mathcal{M}(D_{1})\in\mathcal{O})}{\Pr_{\mathcal{M}}(\mathcal{M}(D_{2})\in\mathcal{O})}=1. If P​(y)=1𝑃𝑦1P(y)=1 the record y𝑦y is used from the mechanism and hence by definition of PDP maxD1,D2⁡Prℳ⁡(ℳ​(D1)∈𝒪)Prℳ⁡(ℳ​(D2)∈𝒪)≤ϵτsubscriptsubscript𝐷1subscript𝐷2subscriptPrℳℳsubscript𝐷1𝒪subscriptPrℳℳsubscript𝐷2𝒪superscriptitalic-ϵ𝜏\max_{D_{1},D_{2}}\frac{\Pr_{\mathcal{M}}(\mathcal{M}(D_{1})\in\mathcal{O})}{\Pr_{\mathcal{M}}(\mathcal{M}(D_{2})\in\mathcal{O})}\leq\epsilon^{\tau}, since Prℳ⁡(ℳ​(D1)∈𝒪)=Prℳ⁡(ℳ​(D)∈𝒪)subscriptPrℳℳsubscript𝐷1𝒪subscriptPrℳℳ𝐷𝒪\Pr_{\mathcal{M}}(\mathcal{M}(D_{1})\in\mathcal{O})=\Pr_{\mathcal{M}}(\mathcal{M}(D)\in\mathcal{O}) for Suppress. Thus,Pr(r=x|ℳ(D)∈𝒪)θPr(r=y|ℳ(D)∈𝒪)θ≤Pr(r=x)θPr(r=y)θ⋅eτ\frac{\Pr\mbox{${}_{\theta}$}(r=x|\mathcal{M}(D)\in\mathcal{O})}{\Pr\mbox{${}_{\theta}$}(r=y|\mathcal{M}(D)\in\mathcal{O})}\leq\frac{\Pr\mbox{${}_{\theta}$}(r=x)}{\Pr\mbox{${}_{\theta}$}(r=y)}\cdot e^{\tau} + +∎ \ No newline at end of file diff --git a/1712.06080v1.txt b/1712.06080v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..34c7acd89f9432db42946ce2fa6dc6bd0f60e68f --- /dev/null +++ b/1712.06080v1.txt @@ -0,0 +1,432 @@ +\section{Introduction} +In recent years, autonomous driving has received much attention in both academy and industry. +One of the most challenging task of autonomous driving is traffic scene understanding, which comprises computer vision tasks like lane detection and semantic segmentation. +Lane detection helps to guide vehicles and could be used in driving assistance system~\cite{urmson2008autonomous}, while semantic segmentation provides more detailed positions about surrounding objects like vehicles or pedestrians. +In real applications, however, these tasks could be very challenging considering the many harsh scenarios, including bad weather conditions, dim or dazzle light, etc. +Another challenge of traffic scene understanding is that in many cases, especially in lane detection, we need to tackle objects with strong structure prior but less appearance clues like lane markings and poles, which have long continuous shape and might be occluded. For instance, in the first example in Fig.~\ref{cnn_fail} (a), the car at the right side fully occludes the rightmost lane marking. + +\begin{figure}[!t] +\centering +\includegraphics[width=8.5cm]{cnn_fail.jpg} +\caption{\label{cnn_fail} Comparison between CNN and SCNN in (a) lane detection and (b) semantic segmentation. For each example, from left to right are: input image, output of CNN, output of SCNN. It can be seen that SCNN could better capture the long continuous shape prior of lane markings and poles and fix the disconnected parts in CNN. } +\end{figure} + +Although CNN based methods~\cite{krizhevsky2012imagenet,long2015fully} have pushed scene understanding to a new level thanks to the strong representation learning ability. +It is still not performing well for objects having long structure region and could be occluded, such as the lane markings and poles shown in the red bounding boxes in Fig.~\ref{cnn_fail}. +However, humans can easily infer their positions and fill in the occluded part from the context, i.e., the viewable part. + +\begin{figure*}[!htb] +\centering +\includegraphics[width=15.5cm]{examples.jpg} +\caption{\label{examples} (a) Dataset examples for different scenarios. (b) Proportion of each scenario.} +\end{figure*} + +To address this issue, we propose Spatial CNN (SCNN), a generalization of deep convolutional neural networks to a rich spatial level. +In a layer-by-layer CNN, a convolution layer receives input from the former layer, applies convolution operation and nonlinear activation, and sends result to the next layer. +This process is done sequentially. +Similarly, SCNN views rows or columns of feature maps as layers and applies convolution, nonlinear activation, and sum operations sequentially, which forms a deep neural network. +In this way information could be propagated between neurons in the same layer. +It is particularly useful for structured object such as lanes, poles, or truck with occlusions, since the spatial information can be reinforced via inter layer propagation. +As shown in Fig.~\ref{cnn_fail}, in cases where CNN is discontinuous or is messy, SCNN could well preserve the smoothness and continuity of lane markings and poles. +In our experiment, SCNN significantly outperforms other RNN or MRF/CRF based methods, and also gives better results than the much deeper ResNet-101~\cite{he2016deep}. + +\textbf{Related Work.} +For lane detection, most existing algorithms are based on hand-crafted low-level features~\cite{aly2008real,son2015real,jung2016efficient}, limiting there capability to deal with harsh conditions. +Only \citeauthor{huval2015empirical} (\citeyear{huval2015empirical}) gave a primacy attempt adopting deep learning in lane detection but without a large and general dataset. +While for semantic segmentation, CNN based methods have become mainstream and achieved great success~\cite{long2015fully,chen2016deeplab}. + +There have been some other attempts to utilize spatial information in neural networks. +\citeauthor{visin2015renet} (\citeyear{visin2015renet}) and \citeauthor{bell2016inside} (\citeyear{bell2016inside}) used recurrent neural networks to pass information along each row or column, thus in one RNN layer each pixel position could only receive information from the same row or column. +\citeauthor{liang2016semantic} (\citeyear{liang2016semantic2,liang2016semantic}) proposed variants of LSTM to exploit contextual information in semantic object parsing, but such models are computationally expensive. +Researchers also attempted to combine CNN with graphical models like MRF or CRF, in which message pass is realized by convolution with large kernels~\cite{liu2015semantic,tompson2014joint,chu2016crf}. +There are three advantages of SCNN over these aforementioned methods: in SCNN, (1) the sequential message pass scheme is much more computational efficiency than traditional dense MRF/CRF, (2) the messages are propagated as residual, making SCNN easy to train, and (3) SCNN is flexible and could be applied to any level of a deep neural network. + +\begin{figure*}[!t] +\centering +\includegraphics[width=13cm]{SCNNvsMRF.pdf} +\caption{\label{spatialCNN_model} (a) MRF/CRF based method. (b) Our implementation of Spatial CNN. MRF/CRF are theoretically applied to unary potentials whose channel number equals to the number of classes to be classified, while SCNN could be applied to the top hidden layers with richer information. } +\end{figure*} +\section{Spatial Convolutional Neural Network} + +\subsection{Lane Detection Dataset} +In this paper, we present a large scale challenging dataset for traffic lane detection. +Despite the importance and difficulty of traffic lane detection, existing datasets are either too small or too simple, and a large public annotated benchmark is needed to compare different methods~\cite{bar2014recent}. +KITTI~\cite{fritsch2013new} and CamVid~\cite{brostow2008segmentation} contains pixel level annotations for lane/lane markings, but have merely hundreds of images, too small for deep learning methods. +Caltech Lanes Dataset~\cite{aly2008real} and the recently released TuSimple Benchmark Dataset~\cite{tusimple} consists of 1224 and 6408 images with annotated lane markings respectively, while the traffic is in a constrained scenario, which has light traffic and clear lane markings. +Besides, none of these datasets annotates the lane markings that are occluded or are unseen because of abrasion, while such lane markings can be inferred by human and is of high value in real applications. + +To collect data, we mounted cameras on six different vehicles driven by different drivers and recorded videos during driving in Beijing on different days. +More than 55 hours of videos were collected and 133,235 frames were extracted, which is more than 20 times of TuSimple Dataset. +We have divided the dataset into 88880 for training set, 9675 for validation set, and 34680 for test set. +These images were undistorted using tools in \cite{scaramuzza2006flexible} and have a resolution of \(1640\times 590\). +Fig.~\ref{examples} (a) shows some examples, which comprises urban, rural, and highway scenes. +As one of the largest and most crowded cities in the world, Beijing provides many challenging traffic scenarios for lane detection. +We divided the test set into normal and 8 challenging categories, which correspond to the 9 examples in Fig.~\ref{examples} (a). +Fig.~\ref{examples} (b) shows the proportion of each scenario. +It can be seen that the 8 challenging scenarios account for most (72.3\%) of the dataset. + +For each frame, we manually annotate the traffic lanes with cubic splines. +As mentioned earlier, in many cases lane markings are occluded by vehicles or are unseen. +In real applications it is important that lane detection algorithms could estimate lane positions from the context even in these challenging scenarios that occur frequently. +Therefore, for these cases we still annotate the lanes according to the context, as shown in Fig.~\ref{examples} (a) (2)(4). +We also hope that our algorithm could distinguish barriers on the road, like the one in Fig.~\ref{examples} (a) (1). Thus the lanes on the other side of the barrier are not annotated. +In this paper we focus our attention on the detection of four lane markings, which are paid most attention to in real applications. +Other lane markings are not annotated. +\subsection{Spatial CNN} +Traditional methods to model spatial relationship are based on Markov Random Fields (MRF) or Conditional Random Fields (CRF)~\cite{krahenbuhl2011efficient}. +Recent works~\cite{zheng2015conditional,liu2015semantic,chen2016deeplab} to combine them with CNN all follow the pipeline of Fig.~\ref{spatialCNN_model} (a), where the mean field algorithm can be implemented with neural networks. +Specifically, the procedure is (1) Normalize: the output of CNN is viewed as unary potentials and is normalized by the Softmax operation, (2) Message Passing, which could be realized by channel wise convolution with large kernels (for dense CRF, the kernel size would cover the whole image and the kernel weights are dependent on the input image), (3) Compatibility Transform, which could be implemented with a \(1\times 1\) convolution layer, and (4) Adding unary potentials. This process is iterated for N times to give the final output. + +It can be seen that in the message passing process of traditional methods, each pixel receives information from all other pixels, which is very computational expensive and hard to be used in real time tasks as in autonomous driving. +For MRF, the large convolution kernel is hard to learn and usually requires careful initialization~\cite{tompson2014joint,liu2015semantic}. +Moreover, these methods are applied to the output of CNN, while the top hidden layer, which comprises richer information, might be a better place to model spatial relationship. + +To address these issues, and to more efficiently learn the spatial relationship and the smooth, continuous prior of lane markings, or other structured object in the driving scenario, we propose Spatial CNN. Note that the 'spatial' here is not the same with that in 'spatial convolution', but denotes propagating spatial information via specially designed CNN structure. + +As shown in the 'SCNN\_D' module of Fig.~\ref{spatialCNN_model} (b), considering a SCNN applied on a 3-D tensor of size \(C\times H\times W\), where \textit{C}, \textit{H}, and \textit{W} denote the number of channel, rows, and columns respectively. +The tensor would be splited into \textit{H} slices, and the first slice is then sent into a convolution layer with \textit{C} kernels of size \(C\times w\), where \textit{w} is the kernel width. +In a traditional CNN the output of a convolution layer is then fed into the next layer, while here the output is added to the next slice to provide a new slice. +The new slice is then sent to the next convolution layer and this process would continue until the last slice is updated. + +Specifically, assume we have a 3-D kernel tensor \textbf{K} with element \(K_{i,j,k}\) denoting the weight between an element in channel \textit{i} of the last slice +and an element in channel \textit{j} of the current slice, with an offset of \textit{k} columes between two elements. +Also denote the element of input 3-D tensor \textbf{X} as \(X_{i,j,k}\), where \textit{i}, \textit{j}, and \textit{k} indicate indexes of channel, row, and column respectively. Then the forward computation of SCNN is: +\begin{equation} + \begin{split} + X_{i,j,k}' = + \begin{cases} + X_{i,j,k}, \qquad\qquad\qquad\qquad\quad j = 1\\ + X_{i,j,k} + \mathlarger{f}\big(\sum\limits_{m} \sum\limits_{n} X_{\Scale[0.7]{m,j-1,k+n-1}}' \\ + \qquad\qquad\ \times K_{m,i,n}\big), \quad\ \Scale[0.9]{j = 2, 3, ..., H} + \end{cases} + \end{split} +\end{equation} +where \(f\) is a nonlinear activation function as ReLU. +The \(X\) with superscript \('\) denotes the element that has been updated. +Note that the convolution kernel weights are shared across all slices, thus SCNN is a kind of recurrent neural network. +Also note that SCNN has directions. +In Fig.~\ref{spatialCNN_model} (b), the four 'SCNN' module with suffix 'D', 'U', 'R', 'L' denotes SCNN that is downward, upward, rightward, and leftward respectively. +\subsection{Analysis} +There are three main advantages of Spatial CNN over traditional methods, which are concluded as follows. + +(1) \textit{Computational efficiency.} +As show in Fig.~\ref{messagePass}, in dense MRF/CRF each pixel receives messages from all other pixels directly, which could have much redundancy, while in SCNN message passing is realized in a sequential propagation scheme. +Specifically, assume a tensor with \textit{H} rows and \textit{W} columns, then in dense MRF/CRF, there is message pass between every two of the \(WH\) pixels. +For \(n_{iter}\) iterations, the number of message passing is \(n_{iter} W^2 H^2\). +In SCNN, each pixel only receive information from \textit{w} pixels, thus the number of message passing is \(n_{dir} W H w\), where \(n_{dir}\) and \textit{w} denotes the number of propagation directions in SCNN and the kernel width of SCNN respectively. +\(n_{iter}\) could range from 10 to 100, while in this paper \(n_{dir}\) is set to 4, corresponding to 4 directions, and \textit{w} is usually no larger than 10 (in the example in Fig.~\ref{messagePass} (b) \(w=3\)). +It can be seen that for images with hundreds of rows and columns, SCNN could save much computations, while each pixel still could receive messages from all other pixels with message propagation along 4 directions. + +\begin{figure}[!t] +\centering +\includegraphics[width=5.6cm]{messagePass.pdf} +\caption{\label{messagePass} Message passing directions in (a) dense MRF/CRF and (b) Spatial CNN (rightward). For (a), only message passing to the inner 4 pixels are shown for clearance. } +\end{figure} + +(2) \textit{Message as residual.} +In MRF/CRF, message passing is achieved via weighted sum of all pixels, which, according to the former paragraph, is computational expensive. +And recurrent neural network based methods might suffer from gradient descent~\cite{pascanu2013difficulty}, considering so many rows or columns. +However, deep residual learning~\cite{he2016deep} has shown its capability to easy the training of very deep neural networks. +Similarly, in our deep SCNN messages are propagated as residual, which is the output of ReLU in Eq.(1). +Such residual could also be viewed as a kind of modification to the original neuron. +As our experiments will show, such message pass scheme achieves better results than LSTM based methods. + +(3) \textit{Flexibility} +Thanks to the computational efficiency of SCNN, it could be easily incorporated into any part of a CNN, rather than just output. +Usually, the top hidden layer contains information that is both rich and of high semantics, thus is an ideal place to apply SCNN. +Typically, Fig.~\ref{spatialCNN_model} shows our implementation of SCNN on the LargeFOV~\cite{chen2016deeplab} model. +SCNNs on four spatial directions are added sequentially right after the top hidden layer ('fc7' layer) to introduce spatial message propagation. +\section{Experiment} +We evaluate SCNN on our lane detection dataset and Cityscapes~\cite{cordts2016cityscapes}. +In both tasks, we train the models using standard SGD with batch size 12, base learning rate 0.01, momentum 0.9, and weight decay 0.0001. +The learning rate policy is "poly" with power and iteration number set to 0.9 and 60K respectively. +Our models are modified based on the LargeFOV model in \cite{chen2016deeplab}. +The initial weights of the first 13 convolution layers are copied from VGG16~\cite{Simonyan15} trained on ImageNet~\cite{deng2009imagenet}. +All experiments are implemented on the Torch7~\cite{collobert2011torch7} framework. +\subsection{Lane Detection} + +\subsubsection{Lane detection model} +Unlike common object detection task that only requires bounding boxes, lane detection requires precise prediction of curves. +A natural idea is that the model should output probability maps (probmaps) of these curves, thus we generate pixel level targets to train the networks, like in semantic segmentation tasks. +Instead of viewing different lane markings as one class and do clustering afterwards, we want the neural network to distinguish different lane markings on itself, which could be more robust. +Thus these four lanes are viewed as different classes. +Moreover, the probmaps are then sent to a small network to give prediction on the existence of lane markings. + +During testing, we still need to go from probmaps to curves. As shown in Fig.\ref{baseline} (b), for each lane marking whose existence value is larger than 0.5, we search the corresponding probmap every 20 rows for the position with the highest response. These positions are then connected by cubic splines, which are the final predictions. + +\begin{figure}[!t] +\centering +\includegraphics[width=8cm]{baseline.pdf} +\caption{\label{baseline}(a) Training model, (b) Lane prediction process. 'Conv','HConv', and 'FC' denotes convolution layer, atrous convolution layer~\cite{chen2016deeplab}, and fully connected layer respectively. 'c', 'w', and 'h' denotes number of output channels, kernel width, and 'rate' for atrous convolution.} +\end{figure} + +As shown in Fig.\ref{baseline} (a), the detailed differences between our baseline model and LargeFOV are: (1) the output channel number of the 'fc7' layer is set to 128, (2) the 'rate' for the atrous convolution layer of 'fc6' is set to 4, (3) batch normalization~\cite{ioffe2015batch} is added before each ReLU layer, (4) a small network is added to predict the existence of lane markings. +During training, the line width of the targets is set to 16 pixels, and the input and target images are rescaled to \(800\times 288\). Considering the imbalanced label between background and lane markings, the loss of background is multiplied by 0.4. +\subsubsection{Evaluation} +In order to judge whether a lane marking is successfully detected, we view lane markings as lines with widths equal to 30 pixel and calculate the intersection-over-union (IoU) between the ground truth and the prediction. +Predictions whose IoUs are larger than certain threshold are viewed as true positives (TP), as shown in Fig.~\ref{evaluation}. +Here we consider 0.3 and 0.5 thresholds corresponding to loose and strict evaluations. +Then we employ \(\text{F-measure}=(1+\beta^2)\tfrac{\text{Precision Recall}}{\beta^2 \text{Precision} + \text{Recall}}\) as the final evaluation index, where \(\text{Precision}=\tfrac{TP}{TP + FP}\) and \(\text{Recall}=\tfrac{TP}{TP + FN}\). +Here \(\beta\) is set to 1, corresponding to harmonic mean (F1-measure). + +\begin{figure}[!t] +\centering +\includegraphics[width=8.5cm]{evaluation.jpg} +\caption{\label{evaluation} Evaluation based on IoU. Green lines denote ground truth, while blue and red lines denote TP and FP respectively. } +\end{figure} +\subsubsection{Ablation Study} +In section 2.2 we propose Spatial CNN to enable spatial message propagation. +To verify our method, we will make detailed ablation studies in this subsection. +Our implementation of SCNN follows that shown in Fig.~\ref{spatialCNN_model}. + +(1) \textit{Effectiveness of multidirectional SCNN.} +Firstly, we investigate the effects of directions in SCNN. +We try SCNN that has different direction implementations, the results are shown in Table.~\ref{directions}. +Here the kernel width \textit{w} of SCNN is set to 5. +It can be seen that the performance increases as more directions are added. +To prove that the improvement does not result from more parameters but from the message passing scheme brought about by SCNN, we add an extra convolution layer with \(5\times 5\) kernel width after the top hidden layer of the baseline model and compare with our method. +From the results we can see that extra convolution layer could merely bring about little improvement, which verifies the effectiveness of SCNN. + +\begin{table}[!h] +\small + \caption{Experimental results on SCNN with different directional settings. F1 denotes F1-measure, and the value in the bracket denotes the IoU threshold. The suffix 'D', 'U', 'R', 'L' denote downward, upward, rightward, and leftward respectively. } + \label{directions} + \centering + \resizebox{8cm}{0.8cm}{% + \begin{tabular}{M{1.05cm}>{\centering\arraybackslash}M{0.83cm}>{\centering\arraybackslash}M{0.87cm}>{\centering\arraybackslash}M{0.85cm} + >{\centering\arraybackslash}M{1cm}>{\centering\arraybackslash}M{1.05cm}} + \toprule + Models & {\fontsize{9}{7.2}\selectfont Baseline} & {\fontsize{8}{7.2}\selectfont ExtraConv} & {\fontsize{8}{7.2}\selectfont SCNN\_D} & {\fontsize{8}{7.2}\selectfont SCNN\_DU} & {\fontsize{8}{7.2}\selectfont SCNN\_DURL} \\ + \midrule + F1 (0.3) & 77.7 & 77.6 & 79.5 & 79.9 & \textbf{80.2} \\ + F1 (0.5) & 63.2 & 64.0 & 68.6 & 69.4 & \textbf{70.4} \\ + \bottomrule + \end{tabular} + } +\end{table} + +(2) \textit{Effects of kernel width \textit{w}.} +We further try SCNN with different kernel width based on the "SCNN\_DURL" model, as shown in Table.~\ref{width}. +Here the kernel width denotes the number of pixels that a pixel could receive messages from, and the \(w=1\) case is similar to the methods in~\cite{visin2015renet,bell2016inside}. +The results show that larger \textit{w} is beneficial, and \(w=9\) gives a satisfactory result, which surpasses the baseline by a significant margin 8.4\% and 3.2\% corresponding to different IoU threshold. + +\begin{table}[!h] +\small + \caption{Experimental results on SCNN with different kernel widths. } + \label{width} + \centering + \begin{tabular}{lcccccc} + \toprule + Kernel width \textit{w} & 1 & 3 & 5 & 7 & 9 & 11 \\ + \midrule + F1 (0.3) & 78.5 & 79.5 & 80.2 & 80.5 & \textbf{80.9} & 80.6 \\ + F1 (0.5) & 66.3 & 68.9 & 70.4 & 71.2 & 71.6 & \textbf{71.7} \\ + \bottomrule + \end{tabular} +\end{table} + +(3) \textit{Spatial CNN on different positions.} +As mentioned earlier, SCNN could be added to any place of a neural network. +Here we consider the SCNN\_DURL model applied on (1) output and (2) the top hidden layer, which correspond to Fig.~\ref{spatialCNN_model}. +The results in Table.~\ref{positions} indicate that the top hidden layer, which comprises richer information than the output, turns out to be a better position to apply SCNN. + +\begin{table}[!h] +\small + \caption{Experimental results on spatial CNN at different positions, with \(w=9\). } + \label{positions} + \centering + \begin{tabular}{lcc} + \toprule + Position & Output & Top hidden layer \\ + \midrule + F1 (0.3) & 79.9 & 80.9 \\ + F1 (0.5) & 68.8 & 71.6 \\ + \bottomrule + \end{tabular} +\end{table} + +(4) \textit{Effectiveness of sequential propagation.} +In our SCNN, information is propagated in a sequential way, i.e., a slice does not pass information to the next slice until it has received information from former slices. +To verify the effectiveness of this scheme, we compare it with parallel propagation, i.e., each slice passes information to the next slice simultaneously before being updated. +For this parallel case, the \('\) in the right part of Eq.(1) is removed. +As Table.~\ref{sequential} shows, the sequential message passing scheme outperforms the parallel scheme significantly. +This result indicates that in SCNN, a pixel does not merely affected by nearby pixels, but do receive information from further positions. + +\begin{table}[!h] +\small + \caption{Comparison between sequential and parallel message passing scheme, for SCNN\_DULR with \(w=9\). } + \label{sequential} + \centering + \begin{tabular}{lcc} + \toprule + Message passing scheme & Parallel & Sequential \\ + \midrule + F1 (0.3) & 78.4 & 80.9 \\ + F1 (0.5) & 65.2 & 71.6 \\ + \bottomrule + \end{tabular} +\end{table} + +\begin{table*}[!t] +\small + \caption{Comparison with other methods, with IoU threshold=0.5. For crossroad, only FP are shown. } + \label{others} + \centering + \resizebox{13.5cm}{2.1cm}{% + \begin{tabular}{lccccccc} + \toprule + Category & Baseline & ReNet & DenseCRF & MRFNet & ResNet-50 & ResNet-101 & Baseline+SCNN \\ + \midrule + Normal & 83.1 & 83.3 & 81.3 & 86.3 & 87.4 & 90.2 & \textbf{90.6}\\ + Crowded & 61.0 & 60.5 & 58.8 & 65.2 & 64.1 & 68.2 & \textbf{69.7}\\ + Night & 56.9 & 56.3 & 54.2 & 61.3 & 60.6 & 65.9 & \textbf{66.1}\\ + No line & 34.0 & 34.5 & 31.9 & 37.2 & 38.1 & 41.7 & \textbf{43.4}\\ + Shadow & 54.7 & 55.0 & 56.3 & 59.3 & 60.7 & 64.6 & \textbf{66.9}\\ + Arrow & 74.0 & 74.1 & 71.2 & 76.9 & 79.0 & 84.0 & \textbf{84.1}\\ + Dazzle light & 49.9 & 48.2 & 46.2 & 53.7 & 54.1 & \textbf{59.8} & 58.5\\ + Curve & 61.0 & 59.9 & 57.8 & 62.3 & 59.8 & \textbf{65.5} & 64.4\\ + Crossroad & 2060 & 2296 & 2253 & \textbf{1837} & 2505 & 2183 & 1990\\ + Total & 63.2 & 62.9 & 61.0 & 67.0 & 66.7 & 70.8 & \textbf{71.6}\\ + \bottomrule + \end{tabular}% + } +\end{table*} + +\begin{figure*}[!t] +\centering +\includegraphics[width=17.8cm]{compare.jpg} +\caption{\label{compare} Comparison between probmaps of baseline, ReNet, MRFNet, ResNet-101, and SCNN. } +\end{figure*} + +(5) \textit{Comparison with state-of-the-art methods. } +To further verify the effectiveness of SCNN in lane detection, we compare it with several methods: the rnn based ReNet~\cite{visin2015renet}, the MRF based MRFNet, the DenseCRF~\cite{krahenbuhl2011efficient}, and the very deep residual network~\cite{he2016deep}. +For ReNet based on LSTM, we replace the "SCNN" layers in Fig.~\ref{spatialCNN_model} with two ReNet layers: one layer to pass horizontal information and the other to pass vertical information. +For DenseCRF, we use dense CRF as post-processing and employ 10 mean field iterations as in \cite{chen2016deeplab}. +For MRFNet, we use the implementation in Fig.~\ref{spatialCNN_model} (a), with iteration times and message passing kernel size set to 10 and 20 respectively. +The main difference of the MRF here with CRF is that the weights of message passing kernels are learned during training rather than depending on the image. +For ResNet, our implementation is the same with \cite{chen2016deeplab} except that we do not use the ASPP module. +For SCNN, we add SCNN\_DULR module to the baseline, and the kernel width \textit{w} is 9. +The test results on different scenarios are shown in Table~\ref{others}, and visualizations are given in Fig.~\ref{compare}. + +From the results, we can see that the performance of ReNet is not even comparable with SCNN\_DULR with \(w=1\), indicating the effectiveness of our residual message passing scheme. +Interestingly, DenseCRF leads to worse result here, because lane markings usually have less appearance clues so that dense CRF cannot distinguish lane markings and background. +In contrast, with kernel weights learned from data, MRFNet could to some extent smooth the results and improve performance, as Fig.~\ref{compare} shows, but are still not very satisfactory. +Furthermore, our method even outperform the much deeper ResNet-50 and ResNet-101. +Despite the over a hundred layers and the very large receptive field of ResNet-101, it still gives messy or discontinuous outputs in challenging cases, while our method, with only 16 convolution layers plus 4 SCNN layers, could preserve the smoothness and continuity of lane lines better. +This demonstrates the much stronger capability of SCNN to capture structure prior of objects over traditional CNN. + +(6) \textit{Computational efficiency over other methods. } +In the \textbf{Analysis} section we give theoretical analysis on the computational efficiency of SCNN over dense CRF. +To verify this, we compare their runtime experimentally. +The results are shown in Table.~\ref{runtime}, where the runtime of the LSTM in ReNet is also given. +Here the runtime does not include runtime of the backbone network. +For SCNN, we test both the practical case and the case with the same setting as dense CRF. +In the practical case, SCNN is applied on top hidden layer, thus the input has more channels but less hight and width. +In the fair comparison case, the input size is modified to be the same with that in dense CRF, and both methods are tested on CPU. +The results show that even in fair comparison case, SCNN is over 4 times faster than dense CRF, despite the efficient implementation of dense CRF in \cite{krahenbuhl2011efficient}. +This is because SCNN significantly reduces redundancy in message passing, as in Fig.~\ref{messagePass}. +Also, SCNN is more efficient than LSTM, whose gate mechanism requires more computation. + +\begin{table}[!h] +\small + \caption{Runtime of dense CRF, LSTM, and SCNN. The two SCNNs correspond to the one used in practice and the one whose input size is modified for fair comparison with dense CRF respectively. The kernel width \textit{w} of SCNN is 9. } + \label{runtime} + \centering + \resizebox{8.4cm}{1.18cm}{% + \begin{tabular}{l>{\centering\arraybackslash}M{1.6cm}>{\centering\arraybackslash}M{1.7cm}>{\centering\arraybackslash}M{1.7cm}>{\centering\arraybackslash}M{1.6cm}} + \toprule + Method & dense CRF & LSTM & \begin{tabular}[t]{@{}l@{}} SCNN\_DULR\\ {\fontsize{8}{7.2}\selectfont (in practice)}\end{tabular} & \begin{tabular}[t]{@{}l@{}} SCNN\_DULR\\ {\fontsize{8}{7.2}\selectfont (fair comparison)}\end{tabular} \\ + \midrule + \begin{tabular}[t]{@{}l@{}}Input size\\ {\fontsize{7.5}{7.2}\selectfont \((C \times H \times W)\)}\end{tabular} & {\fontsize{8}{6.5}\selectfont \(5 \times 288 \times 800\)} & {\fontsize{8}{6.5}\selectfont \(128 \times 36 \times 100\)} & {\fontsize{8}{6.5}\selectfont \(128 \times 36 \times 100\)} & {\fontsize{8}{6.5}\selectfont \(5 \times 288 \times 800\)} \\ + Device & CPU\footnote{\fontsize{7}{7.2}\selectfont Intel Core i7-4790K CPU} & GPU\footnote{\fontsize{7}{7.2}\selectfont GeForce GTX TITAN Black} & GPU & CPU \\ + Runtime (ms) & 737 & 115 & 42 & 176 \\ + \bottomrule + \end{tabular} + } +\end{table} + +\begin{table*}[!t] +\small + \caption{Results on Cityscapes validation set. } + \label{Cityscapes} + \centering + \resizebox{17.8cm}{1.18cm}{% + \begin{tabular}{M{2.55cm}|>{\centering\arraybackslash}M{0.45cm}>{\centering\arraybackslash}M{0.6cm}>{\centering\arraybackslash}M{0.8cm} + >{\centering\arraybackslash}M{0.6cm}>{\centering\arraybackslash}M{0.4cm}>{\centering\arraybackslash}M{0.5cm}>{\centering\arraybackslash}M{0.6cm} + >{\centering\arraybackslash}M{0.6cm}>{\centering\arraybackslash}M{0.6cm}>{\centering\arraybackslash}M{0.75cm}>{\centering\arraybackslash}M{0.6cm} + >{\centering\arraybackslash}M{0.45cm}>{\centering\arraybackslash}M{0.65cm}>{\centering\arraybackslash}M{0.9cm}>{\centering\arraybackslash}M{0.7cm} + >{\centering\arraybackslash}M{0.4cm}>{\centering\arraybackslash}M{0.5cm}>{\centering\arraybackslash}M{0.55cm}>{\centering\arraybackslash}M{0.7cm} + |>{\centering\arraybackslash}M{0.55cm}} + \toprule + Method & road & terrain & building & wall & car & pole & \begin{tabular}[t]{@{}l@{}}traffic\\light\end{tabular} & \begin{tabular}[t]{@{}l@{}}traffic\\sign\end{tabular} & fence & sidewalk & sky & rider & person & vegetation & truck & bus & train & motor & bicycle & \textbf{mIoU} \\ + \midrule + LargeFOV & 97.0 & 59.2 & 89.9 & 42.2 & 92.3 & 52.9 & 62.3 & 71.1 & 52.2 & \textbf{78.8} & 92.2 & 52.1 & 75.9 & 91.0 & 48.8 & 70.2 & 37.6 & 54.6 & 72.3 & 68.0 \\ + LargeFOV+SCNN & 97.0 & \textbf{59.8} & \textbf{90.3} & \textbf{45.7} & \textbf{92.5} & \textbf{55.2} & 62.3 & \textbf{71.7} & \textbf{52.5} & 78.1 & \textbf{92.6} & \textbf{53.2} & \textbf{76.4} & \textbf{91.1} & \textbf{55.6} & \textbf{71.2} & \textbf{41.7} & \textbf{56.2} & 72.3 & \textbf{69.2} \\ + \midrule + ResNet-101 & 98.3 & 64.2 & 92.4 & 44.5 & \textbf{94.9} & 66.0 & \textbf{74.5} & \textbf{82.1} & 59.9 & 86.0 & 94.7 & 65.5 & \textbf{84.1} & 92.7 & 57.3 & 81.1 & 54.0 & 64.5 & 80.0 & 75.6 \\ + ResNet-101+SCNN & 98.3 & \textbf{65.4} & \textbf{92.6} & \textbf{46.7} & 94.8 & \textbf{66.1} & 74.3 & 81.5 & \textbf{61.2} & \textbf{86.1} & 94.7 & 65.5 & 84.0 & 92.7 & \textbf{57.7} & \textbf{82.0} & \textbf{59.9} & \textbf{67.0} & \textbf{80.1} & \textbf{76.4} \\ + \bottomrule + \end{tabular}% + } +\end{table*} + +\begin{figure*}[!t] +\centering +\includegraphics[width=14cm]{cityscapes.jpg} +\caption{\label{cityscapes} Visual improvements on Cityscapes validation set. For each example, from left to right are: input image, ground truth, result of LargeFOV, result of LargeFOV+SCNN.} +\end{figure*} +\subsection{Semantic Segmentation on Cityscapes} +To demonstrate the generality of our method, we also evaluate Spatial CNN on Cityscapes~\cite{cordts2016cityscapes}. +Cityscapes is a standard benchmark dataset for semantic segmentation on urban traffic scenes. +It contains 5000 fine annotated images, including 2975 for training, 500 for validation and 1525 for testing. +19 categories are defined including both stuff and objects. +We use two classic models, the LargeFOV and ResNet-101 in DeepLab~\cite{chen2016deeplab} as the baselines. +Batch normalization layers~\cite{ioffe2015batch} are added to LargeFOV to enable faster convergence. +For both models, the channel numbers of the top hidden layers are modified to 128 to make them compacter. + +We add SCNN to the baseline models in the same way as in lane detection. +The comparisons between baselines and those combined with the SCNN\_DURL models with kernel width \(w=9\) are shown in Table~\ref{Cityscapes}. +It can be seen that SCNN could also improve semantic segmentation results. +With SCNNs added, the IoUs for all classes are at least comparable to the baselines, while the "wall", "pole", "truck", "bus", "train", and "motor" categories achieve significant improve. +This is because for long shaped objects like train and pole, SCNN could capture its continuous structure and connect the disconnected part, as shown in Fig.~\ref{cityscapes}. +And for wall, truck, and bus which could occupy large image area, the diffusion effect of SCNN could correct the part that are misclassified according to the context. +This shows that SCNN is useful not only for long thin structure, but also for large objects which require global information to be classified correctly. +There is another interesting phenomenon that the head of the vehicle at the bottom of the images, whose label is ignored during training, is in a mess in LargeFOV while with SCNN added it is classified as road. +This is also due to the diffusion effects of SCNN, which passes the information of road to the vehicle head area. + +\begin{table}[!h] +\small + \caption{Comparison between our SCNN and other MRF/CRF based methods on Cityscapes test set. } + \label{CityscapesTest} + \centering + \resizebox{8cm}{0.75cm}{ + \begin{tabular}{M{1.1cm}>{\centering\arraybackslash}M{1.8cm}>{\centering\arraybackslash}M{1.8cm}>{\centering\arraybackslash}M{1.8cm}} + \toprule + Method & \begin{tabular}[t]{@{}c@{}}LargeFOV\\ {\fontsize{8}{7.2}\selectfont \cite{chen2016deeplab}}\end{tabular} & \begin{tabular}[t]{@{}c@{}}DPN\\ {\fontsize{9}{7.2}\selectfont \cite{liu2015semantic}}\end{tabular} & Ours \\ + \midrule + mIoU & 63.1 & 66.8 & 68.2 \\ + \bottomrule + \end{tabular} + } +\end{table} + +To compare our method with other MRF/CRF based methods, we evaluate LargeFOV+SCNN on Cityscapes test set, and compare with methods that also use VGG16~\cite{Simonyan15} as the backbone network. +The results are shown in Table~\ref{CityscapesTest}. +Here LargeFOV, DPN, and our method use dense CRF, dense MRF, and SCNN respectively, and share nearly the same base CNN part. +The results show that our method achieves significant better performance. +\section{Conclusion} +In this paper, we propose Spatial CNN, a CNN-like scheme to achieve effective information propagation in the spatial level. +SCNN could be easily incorporated into deep neural networks and trained end-to-end. +It is evaluated at two tasks in traffic scene understanding: lane detection and semantic segmentation. +The results show that SCNN could effectively preserve the continuity of long thin structure, while in semantic segmentation its diffusion effects is also proved to be beneficial for large objects. +Specifically, by introducing SCNN into the LargeFOV model, our 20-layer network outperforms ReNet, MRF, and the very deep ResNet-101 in lane detection. +Last but not least, we believe that the large challenging lane detection dataset we presented would push forward researches on autonomous driving. +\section{Acknowledgments} +This work is supported by SenseTime Group Limited. +We would like to thank Xiaohang Zhan, Jun Li, and Xudong Cao for helpful work in building the lane detection dataset. + +{ +\small +\bibliographystyle{aaai} +\bibliography{bib.bib} +} diff --git a/1712.06302v3.txt b/1712.06302v3.txt new file mode 100644 index 0000000000000000000000000000000000000000..a757554fae779de7eb1d1242c066c41f7660c977 --- /dev/null +++ b/1712.06302v3.txt @@ -0,0 +1,91 @@ +Methods based on deep neural networks (DNNs) have achieved impressive results for severalcomputer vision tasks, such asimage classification,object detectionand image generation.Combined with the general tendency in the Computer Vision community of developingmethods with a focus on high quantitative performance,this has motivated thewideadoption of DNN-based methods,despitethe initial skepticism due totheir black-box characteristics.In this work, we aim for more visually-descriptive predictions andpropose means to improve the quality of the visual feedback capabilities ofDNN-based methods.Our goal is to bridge the gap between methods aiming at model interpretation,i.e., understanding what a given trained model has actually learned, and methodsaiming at model explanation, i.e., justifying the decisions made by a model. + +Model interpretation of DNNs is commonly achieved in two ways: either bya) manually inspecting visualizations of every single filter (or a random subset thereof) from every layer of the network (Yosinski et al. (2015); Zeiler & Fergus (2014))or, more recently, by b) exhaustively comparing the internal activations produced by agiven model w.r.t. a dataset with pixel-wise annotations of possibly relevant concepts (Bau et al. (2017); Fong & Vedaldi (2018)).These two paths have provided useful insights into the internal representations learned by DNNs.However, they both have their own weaknesses.For the first case, the manual inspection of filter responses introduces a subjective bias,as was evidenced by Gonzalez-Garcia et al. (2017). In addition, the inspection of everyfilter from every layer becomes a cognitive-expensive practice for deeper models,which makes it a noisy process.For the second case, as stated by Bau et al. (2017), the interpretation capabilitiesover the network are limited by the concepts for which annotation is available. Moreover,the cost of adding annotations for new concepts is quite high due to its pixel-wise nature.A third weakness, shared by both cases, is inherited by the way in which theygenerate spatial filter-wise responses, i.e., either through deconvolution-basedheatmaps (Springenberg et al. (2015); Zeiler & Fergus (2014)) or by up-scaling theactivation maps at a given layer/filter to the image space (Bau et al. (2017); Zhou et al. (2016)).On the one hand,deconvolution methods are able to produce heatmaps withhigh level of detail from any filter in the network. However, as can be seen inFig. 1 (right), they suffer from artifacts introduced by strided operations in the back-propagation process.Up-scaled activation maps, on the other hand, can significantly lose detailswhen displaying the response of filters with large receptive field from deeper layers.Moreover, they have the weakness of only being computable for convolutional layers. + +In order to alleviate these issues, we start from the hypothesis proven by Bau et al. (2017); Yosinski et al. (2015), that only a small subset of the internal filtersof a network encode features that are important for the task that the network addresses.Based on that assumption, we propose a method which, given a trainedDNN model, automatically identifies a set of relevant internal filters whose encodedfeatures serve as indicators for the class of interest to be predicted (Fig. 1  left).These filters can originate from any type of internal layer of the network, i.e., convolutional,fully connected, etc. Selecting them is formulated as a μ𝜇\mu-lasso optimization problem inwhich a sparse set of filter-wise responses are linearly combined in order to predict theclass of interest. At test time,we move from interpretation to explanation.Given an image, a set of identified relevant filters,and a class prediction, we accompany the predicted class label with heatmap visualizationsof the top-responding relevant filters for the predicted class, see Fig. 1 (center).In addition, by improving the resampling operations within deconvnet-based methods,we are able to address the artifacts introduced in the back-propagation process, see Fig. 1 (right).The code and models used to generate our visual explanations can be found in the following link 111http://homes.esat.kuleuven.be/~joramas/projects/visualExplanationByInterpretation.Overall, the proposed method removes the requirement of additional expensivepixel-wise annotation, by relying on the same annotations used to train the initial model.Moreover, by using our own variant of a deconvolution-based method, our method is able toconsider the spatial response from any filter at any layer while still providing visuallypleasant feedback. This allows our method to reach some level of explanation by interpretation. + +Finally, recent approaches to evaluate explanation methodsmeasure the validity of an explanation either via user studies (Zeiler & Fergus (2014); Selvaraju et al. (2017))or by measuring its effect on a proxy task, e.g. object detection/segmentation (Zhou et al. (2015); Zhang et al. (2016)).While user studies inherently add subjectivity, benchmarking through a proxy task steers the optimizationof the explanation method towards such task.Here we propose an objective evaluation via an8Flower, a syntheticdataset where the discriminative feature between the classes of interestis controlled.This allows us to produce ground-truth masks for the regionsto be highlighted by the explanation. Furthermore, it allows us toquantitatively measure the performance of methods for model explanation. + +The main contributions of this work are four-fold.First, we propose an automatic method based on feature selectionto identify the network-encoded features that are important for theprediction of a given class. This alleviates the requirement of exhaustivemanual inspection or additional expensive pixel-wise annotations required byexisting methods.Second, the proposed method is able to provide visual feedback with higher-levelof detail over up-scaled raw activation maps and improved quality over recent deconvolution+guidedback-propagation methods. Third, the proposed method is general enough to be applied to any type of network,independently of the type of layers that compose it.Fourth, we release a dataset and protocol specificallydesigned for the evaluation of methods for model explanation.To the best of our knowledge this is the first dataset aimed at such task. + +This paper is organized as follows: in Sec. 2we position our work w.r.t. existing work. Sec. 3presents the pipeline and inner-workings of the proposed method.In Sec. 4, we conduct a series of experimentsevaluating different aspects of the proposed method.We draw conclusions in Sec. 5. + +Interpretation.Zeiler & Fergus (2014); Zhou et al. (2015) proposed to visualize propertiesof the function modelled by a network by systematically covering(part of) the input image and measuring the difference of activations.The assumption is that occlusion of important parts of theinput will lead to a significant drop in performance.This procedure is applied at test time to identify theregions of the image that are important for classification.However, the resolution of the explanation will depend on the regionsize.Another group of works focuses on linking internal activationswith semantic concepts. Escorcia et al. (2015) proposed a feature selectionmethod in which the neuron activations of a DNN trained with objectcategories are combined to predict object attributes.Similarly, Bau et al. (2017); Fong & Vedaldi (2018); Zhang et al. (2018)proposed to exhaustivelymatch the activations of every filter from the convolutional layersagainst a dataset with pixel-wise annotated concepts.While both methods provide important insights on the semantic conceptsencoded by the network, they are both limited by the conceptsfor which annotation is available.Similar to Escorcia et al. (2015), we discover relevant internalfilters through a feature selection method. Different from it,we link internal activations directly to the same annotationsused to train the initial model. This removes the expensiverequirement of additional annotations.A third line of works aims at discovering frequent visualpatterns (Doersch et al. (2015); Rematas et al. (2015))occurring in image collections.These patterns have a high semantic coverage which makesthem effective as means for summarization.We adopt the idea of using visualizations of (internal) mid-levelelements as means to reveal the relevant features encoded, internally,by a DNN. More precisely, we use the average visualizations used by theseworks in order to interpret, visually, what the network has actually learned. + +Explanation.For the sake of brevity, we ignore methods which generate explanations via bounding boxes (Karpathy & Fei-Fei (2017); Oramas M. & Tuytelaars (2016)) ortext (Hendricks et al. (2016)), and focus on methods capable of generatingvisualizations with pixel-level precision.Zeiler & Fergus (2014) proposed a deconvolutional network (Deconvnet) which uses activations from a given top layer and reverses the forward pass to reveal which visual patterns from the input image are responsible for the observed activations. Simonyan et al. (2014) used information from the lower layers and the input image to estimate which image regions are responsible for the activations seen at the top layers.Similarly, Bach et al. (2015) decomposed the classification decision intopixel-wise contributions while preserving the propagated quantitiesbetween adjacent layers.Later, Springenberg et al. (2015) extended these works byintroducing “guided back-propagation”, a technique that removes the effect of units with negative contributionsin forward and backward pass. This resulted in sharper heatmap visualizations.Zhou et al. (2016) propose Global Average Pooling, i.e.,a weighted sum over the spatial locations of the activations of the filters of the last convolutional layer, which results in a class activation map. Finally, a heatmap is generated by upsampling the class activation map to the size of the input image.Selvaraju et al. (2017) extended this by providing a more efficient way for computing the weights for the activation maps. Recently, Chattopadhyay et al. (2018) extended this with neuron specific weights with the goal of improving object localization on the generated visualizations.Here, we take DeconvNet with guided-backpropagation as starting point given itsmaturity and ability to produce visual feedback with pixel-level precision. However, we change the internal operations in the backward pass with the goal of reducingvisual artifacts introduced by strided operations while maintaining the network structure. + +Benchmarking.Zhou et al. (2016); Zhang et al. (2016) proposed a saliency-based evaluationwhere explanations are assessed based on how well they highlight complete instances of the classes ofinterest. Thus, treating model explanation as a weakly-supervised object detection/segmentation problem.This saliency-based protocol assumes that explanations are exclusive to intrinsic object features,e.g. color, shape, parts, etc. and completely ignores extrinsic features, e.g. scene, environment,related to the depicted context.Zeiler & Fergus (2014); Selvaraju et al. (2017) proposed a protocolbased on crowd-sourced user studies. These type of evaluations are not only characterizedby their high-cost, but also suffer from subjective bias (Gonzalez-Garcia et al. (2017)).Moreover, Das et al. (2016) suggest that deep models and humans do not necessarily attend tothe same input evidence even when they predict the same output.Here we propose a protocol where the regions to be highlighted by the explanationare predefined. The goal is to objectify the evaluation and relaxthe subjectivity introduced by human-based evaluations. Moreover, our protocolmakes no strong assumption regarding the type of features highlighted by thethe explanations. + +The proposed method consists of two parts. At training time, a set of relevantlayer/filter pairs are identified for every class of interest j𝑗j. This results in a relevance weight wjsubscript𝑤𝑗w_{j}, associated to class j𝑗j, for everyfilter-wise response x𝑥x computed internally by the network.At test time, an image I𝐼I is pushed through the network producing the classprediction j^=F​(I)^𝑗𝐹𝐼\hat{j}{=}F(I). Then, taking into account the internal responsesx𝑥x, and relevance weights wj^subscript𝑤^𝑗w_{\hat{j}} for the predicted class j^^𝑗\hat{j}, we generate visualizations indicating the image regions that contributed to this prediction. + +One of the strengths of deep models istheir ability to learn abstract concepts from simpler ones.That is, when an example is pushed into the model, a conclusionconcerning a specific task can be reached as a function of theresults (activations) of intermediate operations at differentlevels (layers) of the model.These intermediate results may hint at the “semantic” conceptsthat the model is taking into account when making a decision.From this observation,and the fact that activations are typically sparse,we make the assumption that someof the internal filters of a network encode features that areimportant for the task that the network addresses.To this end, we follow a procedure similar to Escorcia et al. (2015),aiming to predict each class j𝑗j by the linear combination wj∈ℝmsubscript𝑤𝑗superscriptℝ𝑚w_{j}{\in}\mathbb{R}^{m} of its internal activations x𝑥x, with m𝑚m the total number of neurons/activations. + +As an initial step, we extract the image-wise response xisubscript𝑥𝑖x_{i}.To this end, we compute the L2subscript𝐿2L_{2} norm of each channel (filter response) withineach layer and produce a 1-dimensional descriptor by concatenatingthe responses from the different channels. This layer-specific descriptor isL1subscript𝐿1L_{1}-normalized in order to compensate for the difference inlength among different layers. Finally,we concatenate all the layer-specific descriptorsto obtain xisubscript𝑥𝑖x_{i}.In this process, we do not consider the last layer whose output is directlyrelated to the classes of interest, e.g. the last two layers from VGG-F  Chatfield et al. (2014). + +Following this procedure, we construct the matrix X∈ℝm×N𝑋superscriptℝ𝑚𝑁X{\in}\mathbb{R}^{m\times N}by passing each of the N𝑁N training images throughthe network F𝐹F and storing the internal responses x𝑥x.As such, the it​hsuperscript𝑖𝑡ℎi^{th} image of the dataset isrepresented by a vector xi∈ℝmsubscript𝑥𝑖superscriptℝ𝑚x_{i}{\in}\mathbb{R}^{m} defined by thefilter-wise responses at different layers.Furthermore, the possible classes that the it​hsuperscript𝑖𝑡ℎi^{th} imagebelongs to are organized in a binary vector li∈{0,1}Csubscript𝑙𝑖superscript01𝐶l_{i}{\in}\{0,1\}^{C}where C𝐶C is the total number of classes.Putting the annotations from all the images together produces the binarylabel matrix L=[l1,l2,…,lN]𝐿subscript𝑙1subscript𝑙2…subscript𝑙𝑁L{=}[l_{1},l_{2},...,l_{N}], with L∈ℝC×N𝐿superscriptℝ𝐶𝑁L{\in}\mathbb{R}^{C\times N}.With these terms, we resort to solving the equation:W∗superscript𝑊\displaystyle W^{*}=a​r​g​m​i​nW​‖XT​W−LT‖F2absent𝑎𝑟𝑔𝑚𝑖subscript𝑛𝑊subscriptsuperscriptnormsuperscript𝑋𝑇𝑊superscript𝐿𝑇2𝐹\displaystyle=argmin_{W}~{}||X^{T}W-L^{T}||^{2}_{F}s​u​b​j​e​c​t​t​o:‖wj‖1≤μ,∀j=1,…,C:𝑠𝑢𝑏𝑗𝑒𝑐𝑡𝑡𝑜formulae-sequencesubscriptnormsubscript𝑤𝑗1𝜇subscriptfor-all𝑗1…𝐶\displaystyle~{}subject~{}to:~{}||w_{j}||_{1}\leq\mu~{},~{}\forall_{j}=1,...,C(1)with μ𝜇\mu a parameter that allows controlling the sparsity. This is the matrix form of the μ𝜇\mu-lasso problem.This problem can be efficiently solved using the SpectralGradient Projection method Mairal et al. (2014); van den Berg & Friedlander (2008).The μ𝜇\mu-lasso formulation is optimal for cases like the ones obtainedby ResNet where the number of internal activations is large compared tothe number of examples.After solving the μ𝜇\mu-lasso problem, we have amatrix W=[w1,w2,…,wC]𝑊subscript𝑤1subscript𝑤2…subscript𝑤𝐶W{=}[w_{1},w_{2},...,w_{C}], with W∈ℝm×C𝑊superscriptℝ𝑚𝐶W{\in}\mathbb{R}^{m\times C}.We impose sparsity on W𝑊W by enforcing the constraints onthe L1subscript𝐿1L_{1} norm of wjsubscript𝑤𝑗w_{j}, i.e., ‖wj‖1≤μ,∀j=1,…,Cformulae-sequencesubscriptnormsubscript𝑤𝑗1𝜇subscriptfor-all𝑗1…𝐶||w_{j}||_{1}{\leq}\mu~{},~{}\forall_{j}=1,...,C.As a result, each non-zero element in W𝑊W represents apair of network layer p𝑝p and filter index q𝑞q (within the layer)of relevance. + +During training time (Section 3.1),we identified a set of relevant features (indicated by W𝑊W)for the classes of interest. At test time, we generate the feedbackvisualizations by taking into account the response of thesefeatures on the content of the tested images.Towards this goal, we push an image I𝐼I through the network producing the classprediction j^=F​(I)^𝑗𝐹𝐼\hat{j}{=}F(I). During that pass, we compute the internalfilter-wise response vector xisubscript𝑥𝑖x_{i} following the procedure presented above.Then we compute the response rij^=(wj^∘xi)subscriptsuperscript𝑟^𝑗𝑖subscript𝑤^𝑗subscript𝑥𝑖r^{\hat{j}}_{i}{=}(w_{\hat{j}}\circ x_{i}), where ∘\circ represents the element-wise product between two vectors.Note that the wj^subscript𝑤^𝑗w_{\hat{j}} vector is highly sparse, therefore adding an insignificant cost at test time.The features, i.e., layer/filter pairs (p∗,q∗)superscript𝑝∗superscript𝑞∗(p^{\ast},q^{\ast}), with strongest contribution in theprediction j^^𝑗\hat{j} are selected as those with maximum response in rij^subscriptsuperscript𝑟^𝑗𝑖r^{\hat{j}}_{i}.Finally, we feed this information to the Deconvnet-based method withguided backpropagation from Grün et al. (2016) to visualize the importantfeatures as defined by the layer/filter pairs (p∗,q∗)superscript𝑝∗superscript𝑞∗(p^{\ast},q^{\ast}).Following the visualization method from Grün et al. (2016), given afilter p𝑝p from layer q𝑞q and an input image, we first push forwardthe input image through the network, storing the activations fromeach filter at each layer, until reaching the layer p𝑝p.Then, we backpropagate the activations from filter q𝑞q at layer p𝑝pwith inverse operations until reaching back to the input image space.As result we get as part of the output a set of heatmaps, associatedto the relevant features, defined by (p∗,q∗)superscript𝑝∗superscript𝑞∗(p^{\ast},q^{\ast}), indicatingthe influence of the pixels that contributed to the prediction.See Fig.1 (left) for an example of the visual feedbackprovided by our method.Please refer to Grün et al. (2016); Springenberg et al. (2015); Zeiler & Fergus (2014)for further details regarding Deconvnet-based and Guided backpropagation methods. + +Deep neural networks addressing computer vision taskscommonly push the input visual data through a sequence of operations.A common trend of this sequential processing is that the input data isinternally resampled until reaching the desired prediction space.As mentioned in Sec. 2, methods aiming atinterpretation/explanation start from an internal point in the networkand go backwards until reaching the input space - producing a heatmap.However, due to the resampling process, heatmaps generated by thebackwards process tend to display grid-like artifacts.More precisely, we find that this grid effect is caused by the internalresampling introduced by network operations with stride larger than one(S>1𝑆1S{>}1).To alleviate this effect, in the backwards pass, we set the strideS=1𝑆1S{=}1 and compensate for this change by modifying the input accordingly.As a result, the backwards process can be executed while maintainingthe network structure. + +More formally, given a network operation block defined by a convolutionmask with size [M×M]delimited-[]𝑀𝑀[M{\times}M], stride [S,S]𝑆𝑆[S,S], and padding [O,O,O,O]𝑂𝑂𝑂𝑂[O,O,O,O],the relationship between the size of its input [A×A]delimited-[]𝐴𝐴[A{\times}A] and its output[B×B]delimited-[]𝐵𝐵[B{\times}B] (see Fig. 3) is characterizedby the following equation:A+2⋅O=M+(B−1)⋅S𝐴⋅2𝑂𝑀⋅𝐵1𝑆A+2\cdot O=M+(B-1)\cdot S\vspace{-2mm}(2)from where,B=[(A+2⋅O−M)/S]+1𝐵delimited-[]𝐴⋅2𝑂𝑀𝑆1B=[~{}(A+2\cdot O-M)/S~{}]+1(3)Our method starts from the input ([Ad×Ad]delimited-[]subscript𝐴𝑑subscript𝐴𝑑[A_{d}{\times}A_{d}]), which encodes the contributions from the input image, carried by the higher layer in the Deconvnet backward pass.In order to enforce a “cleaner” resampling when S>1𝑆1S{>}1, during the backward pass, the size of the input ([Ad×Ad]delimited-[]subscript𝐴𝑑subscript𝐴𝑑[A_{d}{\times}A_{d}]) of the operation block should be the same as that of the feature map ([B×B]delimited-[]𝐵𝐵[B{\times}B]) produced by the forward passif the stride S𝑆S were equal to one, i.e., Ad′=B|S=1subscriptsuperscript𝐴′𝑑evaluated-at𝐵𝑆1A^{\prime}_{d}{=}B|_{S{=}1}.According to Eq. 3 with S=1𝑆1S{=}1, Adsubscript𝐴𝑑A_{d}should therefore be resampled to Ad′=B|S=1=A+2⋅O−M+1subscriptsuperscript𝐴′𝑑evaluated-at𝐵𝑆1𝐴⋅2𝑂𝑀1A^{\prime}_{d}{=}B|_{S{=}1}{=}A{+}2\cdot O{-}M{+}1.We do this resampling via the nearest-neighbor interpolation algorithm given itsproven fast computation time which makes it optimal for real-time processing.By introducing this step, the network will perform the backwards pass at every layerwith stride S=1𝑆1S{=}1 and the grid effect will disappear.See Fig. 3 for some examples of theimprovements introduced by our method. + +We conduct four sets of experiments.First, in Sec. 4.1, we verify theimportance of the identified relevant features in the task addressed by thenetwork.Then, in Sec. 4.2, weevaluate the improvements on visual quality provided by our method.In Sec. 4.3,we quantify the capability of our visual explanations to highlight the regionsthat are descriptive for the classes of interest.Finally, in Sec. 4.4, we assess the sensitivityof the proposed method w.r.t. the predicted classes. + +We evaluate the proposed method on an image recognition task.We conduct experiments on three standard image recognitiondatasets, i.e., MNIST LeCun & Cortes (2010), Fashion144k Simo-Serra et al. (2015)and imageNet (ILSVRC’12) Russakovsky et al. (2015).Additionally, we conduct experiments on a subset of cat images fromimageNet (imageNet-cats).MNIST covers 10 classes of hand-written digits. It iscomposed by 70k images in total (60k for training/validation, 10k for testing).The imageNet dataset is composed of 1k classes. Following the standard practice,we measure performance on its validation set. Each class contains 50 validationimages.For the Fashion144k  dataset Simo-Serra et al. (2015), we consider the subset of 12k imagesfrom Wang et al. (2018) used for the geolocation of 12 city classes.The imageNet-cats subset consists of 13 cat classes, containing bothdomestic and wild cats. It is composed of 17,550 images. Each class contains 1,3kimages for training and 50 images for testing.Please refer to the supplementary material for more implementation details. + +In this experiment, we verify the importance of the “relevant” featuresidentified by our method at training time (Sec. 3.1).To this end, given a set of identified features, we evaluate the influence theyhave in the network by measuring changes in classification performance causedby their removal. We remove features in the network by setting theircorresponding layer/filter to zero. The expected behavior is that a set offeatures with high relevance will produce a stronger drop in performancewhen ablated.Fig. 4, shows the changes in classificationperformance for the tested datasets. We report the performance of foursets of features: a) All, selected with our method by considering the wholeinternal network architecture, b) OnlyConv, selected by consideringonly the convolutional layers of the network, c) a  Randomselection of features (filters) selected from the layers indicated inthe sets a) and b), and for reference, d) the performance obtainedby the original network.Note that the OnlyConv method makes the assumptionthat relevant features are only present in the convolutional layers.This is a similar assumption as the one made by state-of-the-art methods Bau et al. (2017); Xie et al. (2017); Zhou et al. (2016).When performing feature selection (Sec.3.1), we set the sparsity parameter μ=10𝜇10\mu{=}10 for all the tested datasets.This produces subsets of 92∣∣\mid101, 46∣∣\mid28, 104∣∣\mid111, 248∣∣\mid180 relevant features for the All∣∣\midOnlyConv methods, on the respective datasetsfrom Fig. 4.Differences in the number of the selected features can be attributedto possibly redundant or missing predictive information between the initial poolsof filter responses x𝑥x used to select the All and OnlyConvfeatures. + +A quick inspection of Fig. 4 shows that indeed classificationperformance drops when we remove the identified features, All andOnlyConv. Moreover, it is noticeable that a random removal offeatures has a lower effect on classification accuracy.This demonstrates the relevance of the identified features for theclasses of interest.In addition, it is visible that the method that considers the completeinternal structure, i.e., All, suffers a stronger drop inperformance compared to the OnlyConv which only considers featuresproduced by the convolutional layers. This suggests that there is indeedimportant information encoded in the fully connected layers, and whileconvolutional layers are a good source for features, focusing on them onlydoes not reveal the full story.Regarding the effect of the sparsity value μ𝜇\mu in the μ𝜇\mu-lassoformulation (Sec. 3.1),we note that increasing μ𝜇\mu increases the number of selected features. This leads to more specializedfeatures that canbetter cope withrare instances of the classesof interest. We decided to start from a relatively low value, e.g. μ=10𝜇10\mu{=}10,in order to focus on a small set of relevant features that can generalize tothe classes of interest while, at the same time, keeping the computational cost low. + +Qualitative Analysis.In order to get a qualitative insight into the type of informationthat these features encode we compute an average visualizationby considering the top 100 image patches where such features have a high response.Towards this goal, given the set of identified relevant features, forevery class, we select images with higher responses. Then, wetake the input image at the location with maximum response for agiven filter and crop it by considering the receptive field of the correspondinglayer/filter of interest.Selected examples of average images, with rich semantic representation,are presented in Fig. 5 for the tested datasets. + +We can notice that for imageNet-Cats, the identified features coverdescriptive characteristics of the considered cat classes. For example,the dark head of a Siamese cat, the nose/mouth of acougar, or the fluffy-white body shape of Persian cat.Likewise, it effectively identifies the descriptive fur patterns fromthe jaguar, leopard and tiger classes and colors which are related to the background.We see a similar effect on a selection of other objects from the rest ofthe imageNet dataset.For instance, for scene-type classes, i.e., coast, castle and church, theidentified features focus on the outline of such scenes.Similarly, we notice different viewpoints for animal-type classes, e.g. golden-retriever, hen, robin, magpie.On the Fashion144k dataset (Fig. 5 (right))we can notice that some classes respond to features related togreen, blue, red, and beige colors.Some focus on legs, covered and uncovered, while others focuson the upped body part. It is interesting that from the upperbody parts, some focus on persons with dark long hair, short hair,and light hair. Similarly, there is a class with high response tohorizontal black-white gradients where individuals tend to dressin dark clothes.These visualizations answer the question explored inWang et al. (2018) and why the computer outperforms the surveyedparticipants. It shows that the model effectively exploitshuman-related features (legs clothing, hair length/color, clothing color)as well as background-related features, mainly covered bycolor/gradients and texture patterns.In the visual explanations provided by our methodwe can see that the model effectivelyuses this type of features to reach its decision. + +Finally, in Fig. 6 we show some examplesof the visual explanations produced by our method.We aggregate the predicted class label with our heatmap visualizationsindicating the pixel locations, associated to the relevant features,that contributed to the prediction.For the case of the ILSVRC’12 and Fashion144k examples, we notice that the relevantfeatures come from the object itself as well as from its context.For the case of the MNIST examples, in addition to the features firingon the object, there are features that support the existence of a gap(background), as to emphasize that the object is not filled there andavoid confusion with another class.For example, see for class 222 how it speaks against 00 and for 666 how it goes against 444. + +In this section, we assess the visual quality of thevisual explanations generated by our method.In Fig. 8, we compareour visualizations with upsampled activation maps frominternal layers (Bau et al. (2017); Zhou et al. (2016))and the output of DeconvNet with guided-backpropagation (Springenberg et al. (2015)).We show these visualizations for different layers/filtersthroughout the network. + +A quick inspection reveals that our method to attenuate the grid-likeartifacts introduced by Deconvnet methods (see Sec 3.3) indeed produces noticeable improvements for lower layers.See Fig. 3 for additional examples presenting thisdifference at lower layers.Likewise, for the case of higher layers (Fig. 8),the proposed method provides more precise visualizations when comparedto upsampled activation maps.In fact, the rough output produced by the activation maps at higherlayers has a saliency-like behavior that gives the impression that thenetwork is focusing on a larger region of the image. This could be apossible attribution to why in earlier works Zhou et al. (2015),manual inspection of network activations suggested that the networkwas focusing on “semantic” parts.Please see Gonzalez-Garcia et al. (2017) for an in-depth discussionof this observation.Finally, for the case of FC layers, using upsampled activation mapsis not applicable.Please refer to the supplementary material for additional examples.In addition, to quantitatively measure the quality of our heatmaps we performa box-occlusion study Zeiler & Fergus (2014). Given a specific heatmap, weocclude the original image with patches sampled from the distribution definedby the heatmap. We measure changes in performance as we gradually increase thenumber of patches up to covering the 30% most relevant part of the image.Here our method reaches a mean difference in prediction confidence of 2% w.r.t. toSpringenberg et al. (2015). This suggests that our method is able to maintainfocus on relevant class features while producing detailed heatmaps with better visualquality. + +We generate two synthetic datasets, an8Flower-single-6c and an8Flower-double-12c,with 6 and 12 classes respectively.In the former, a fixed single part of the object is allowed to change color.This color defines the classes of interest. In the latter, a combination ofcolor and the part on which it is located defines the discriminative feature.After defining these features, we generate masks that overlapwith the discriminative regions (Fig. 9 (left)).Then, we threshold the heatmaps at given values and measure the pixel-levelintersection over union (IoU) of a model explanation (produced by the methodto be evaluated) w.r.t. these masks.We test a similar model as for the MNIST dataset (Sec. 4.1)trained on each variant of the an8Flower dataset.In Table 1 we report 5-fold cross-validation performance of the proposedfeature selection method using three different means(Upsamp. Act. Maps, Deconv+GB Springenberg et al. (2015)and ours heatmap variant) and other state-of-the-art methodsto generate visual explanations. + +We can notice in Fig. 9 (right) that ourmethod effectively identifies the pre-defined discriminative regions regardlessof whether they are related to color and/or shape.Likewise, Fig. 9 (center) shows thatour explanations accurately highlight these featuresand that they have a better balance betweenlevel of detail and coverage than those produced by existing methods.The quantitative results (Table 1) show that our method has a highermean IoU of the discriminative features when compared to existing methods.However, it should be noted that, different from the compared methods,our method involves an additional process, i.e., feature selection via μ𝜇\mu-lasso,at training time. Moreover, for this process an additional parameter, i.e μ𝜇\mu,should be defined (Sec. 3.1).Please refer to the supplementary material for more details and visualizations. + +Methods for model explanation/interpretation aim at providing users with insightson what a model has learned and why it makes specific predictions. Putting this together with the observations made in our experiments, there are two points that should be noted.On the one hand, we believe that our objective evaluation should be complemented with simpleruser studies. This should ensure that the produced explanations are meaningful to the individuals they aim to serve.On the other hand, our proposed evaluation protocol enables objective quantitative comparison of different methods for visual explanation. As such it is free of the weaknesses of exhaustive user studies and of the complexities that can arise when replicating them. + +Beyond the capability of generating accurate visual explanations,recent works (Kindermans et al. (2017); Julius Adebayo (2018); Nie et al. (2018))have stressed the importance of verifying that the generated explanationsare indeed relevant to the model and the classes being explained.Towards this goal, we run a similar experiment to that conducted in Nie et al. (2018)where the visual explanation produced for a predicted classof a given model after observing a given image is compared against those when adifferent class is considered when generating the explanation.A good explanation should be sensible to the class, and thus generate different visualizations.In Fig. 10 we show qualitative results obtained by running thisexperiment on our models trained on the ILSVRC’12 (Russakovsky et al. (2015)) and  imageNet-cats datasets. + +As can be noted in Fig. 10, the explanation generated for the predicted class, i.e., ’cat’/’tabby’,focuses on different regions than those generated for randomly selected classes.This is more remarkable for the case of the imageNet-cats model, which can be considereda fine-grained classification task. In this setting, when changing towards a random class, i.e., ’jaguar, panther, Panthera onca, Felis onca’,the generated explanations only highlight the features that are common between the random classand the ’tabby’ class depicted in the image.In their work, Nie et al. (2018) and Julius Adebayo (2018) found that explanationsfrom DeconvNet and Guided-Backpropagation methods are not performing well in this respect, yielding visualizations that are not determined by the predictedclass, but by the filters of the first layer and the edge-like structures in theinput images. Although our method relies on DeconvNet and Guided-Backpropagation,our explanations go beyond regions with prominent gradients - see Fig. 1, 6 & 9. In fact, in classes where color is a discriminative feature,uniform regions are highlighted.This different result can be understood since, in our method, DeconvNet with Guided-Backpropagation is merely used as a means tohighlight the image regions that justify the identified relevant features, not thepredicted classes themselves.If a better, more robust or principledvisualization method is proposed in the future by the community, we could use that as well. + +We propose a method to enrich the prediction made byDNNs by indicating the visual features thatcontributed to such prediction.Our method identifies features encodedby the network that are relevant for the taskaddressed by the DNN.It allows interpretation of these featuresby the generation of average feature-wise visualizations.In addition, we proposed a method to attenuatethe artifacts introduced by strided operations invisualizations made by Deconvnet-based methods.This empowers our method with richer visual feedbackwith pixel-level precision without requiring additionalannotations for supervision.Finally, we have proposed a novel dataset designedfor the objective evaluation of methods for explanation of DNNs. + +This work was supported by the FWO SBO project Omnidrone,the VLAIO R&D-project SPOTT, the KU Leuven PDM Grant PDM/16/131,and a NVIDIA GPU grant. + +This section constitutes supplementary material.As such, this document is organized in six parts.In Section 6.1, we provide implementationdetails of the proposed method and experiments presented inthe original manuscript.In Section 6.2, we provide a furtherquantitative analysis on the importance of the identifiedrelevant features.In Section 6.3, we provide additionaldetails regarding the generation of an8Flower, adataset specially designed for evaluating methods for visualexplanation.In Section 6.4,we provide extended examples on the average images usedfor interpretation.Similarly, in Section 6.5,we provide additional examples of visual explanationsprovided by our method.Finally, we concluded this documentin Section 6.6 by performinga qualitative comparison in order to display the advantagesof the proposed method over existing work. + +We use in our experiments the pre-trained models provided as partof the MatconvNet framework Vedaldi & Lenc (2015) for both the MNISTand ImageNet datasets. For the Fashion144k dataset we use the VGG-F -basedmodel (Finetunned with image-based pooling) released by the authorsfrom Wang et al. (2018).For MNIST, we employ a network composed by 8 layers in total,five of them are convolutional , two are fully connected.The last one is a softmax layer.For the full imageNetset, we employ a VGG-F  Chatfield et al. (2014) modelwhich is composed of 21 layers, from these 15 are convolutional followedby five fully connected. The last one is a softmax layer.Finally, for the case of the imageNet-Cats subsetwe finetune the VGG-F model trained on the full imageNetset. + +In order to verify the relevance of the identifiedfeatures, i.e., how well the features encode informationfrom the classes of interest, we measure the level towhich they are able to "reconstruct" each of theclasses of interest.Towards this goal, we compute the mean area underthe ROC curve (mean-AUC) for all the classes of interestin a given dataset.In Figure 11, we reportperformance over different μ𝜇\mu values.It can be noted that already with a low amount of selectedfeatures, i.e.. a low value of μ𝜇\mu, we can already encode,properly, visual characteristics of the classes of interest.This shows that the identified features hold strong potentialas visual means for explanation. + +We release an8Flower, a dataset and evaluation protocol specifically designed for evaluating the performance of methods for model explanation.We generate this dataset by taking as starting point the eggplant model 222http://www.anim8or.com/learn/tutorials/eggplant/index.html publicly released with the Anim8or 333http://www.anim8or.com/ 3D modeling software. Then, we introduce into this model the discriminative features to define each of the classes of interest. For each class of interest, we rotate the object 360 degrees and render/save 40 frames at different viewpoints with a size of 300x300 pixels. + +Afterwards, in order to increase variation and the amount of data, we apply the following data augmentation procedure on each image frame. For each of the original 300x300 rendered frames, we crop each image five times at four corners and center respectively with the size of 250x250. Then, each cropped image is rotated five angles: 5, 10, 15, 20 and 25 degrees. In the end, the data augmentation produces a total of 1000 example images per class.Figure 12 shows rendered images of the classes of interest considered in three variants of this dataset, i.e., an8Flower-single-6c, an8Flower-double-12c and an8Flower-part-2c.Figure 13 and Figure  14 displays some examples of the augmented data used in training/testing and its corresponding mask. + +In this section, we provide extended examplesof the average images used by our method asmeans for visual interpretation(Section 4.1 of the original manuscript).Moreover, we provide a visual comparison with theircounterparts generated by existing methods.More precisely, up-scaled activations mapsfrom convolutional layers Bau et al. (2017); Zhou et al. (2015)and heatmaps generated from deconvnets withguided backpropagation Grün et al. (2016); Springenberg et al. (2015); Zeiler & Fergus (2014). + +In Figure 15, we showaverage images for the imageNet-Cats Russakovsky et al. (2015)subset, and the Fashion144k Simo-Serra et al. (2015)datasets, respectively.For each class on each dataset, we show theaverage image of each identified feature sorted,from top to bottom, based on their relevance forits corresponding class.In a similar fashion, in Figure 17,we show a visualization for the displayedsubset of classes (Figure 5 (center) inthe original manuscript) from the imageNet dataset.Given that for the imageNet dataset most of theidentified features come from fully connected (FC)layers, no up-scaled response map visualization ispossible for them.Therefore, we opted not to display averagevisualizations based on up-scaled activation maps.Finally, in Figure 17, we showaverage visualizations for additional classes fromimageNet. + +In Figure 15 we can noticethat already within few top relevantfeatures per class, semantic concepts start toappear.In addition, we see the same trends observedin the original paper. On the one hand, somefeatures encode class-specific properties,e.g. nose shape, fur pattern, for the case ofthe imageNet-Cats, or hair color/length, legdressing, or clothing color for the case ofFashion 144k.On the other hand, some features encodeproperties related to the background/contextin which the images are captured, e.g. wall/roadcolors, vegetation, etc.We can notice that for the case of up-sampledactivation maps, there are identified featureswhich originate in Fully Connected Layers (FC).For this type of layer, the up-scaling processis not applicable. + +When comparing the average visualizationsgenerated by the different methods, it isnoticeable that the proposed method producessharper visualizations than those generated fromup-scaled activation maps.Moreover, our visualizations are still sharperthan those produced by state-of-the-artdeconvnet-based methods withguided-backpropagation Springenberg et al. (2015).Therefore, enhancing the interpretation capabilitiesof the proposed method. + +In Figures 18, 19, 20, 14, 13we extend the visual explanation results presented in the original manuscript.(Figures 1, 6, 7 and 9 in the original manuscript) + +In the visual explanations generated by our methodwe accompany the predicted class label with ourheatmaps indicating the pixel locations, associatedto the features, that contributed to the prediction.In line with the original manuscript, on top of eachheatmap we indicate the number of the layer wherethe features come from. + +We conclude this document by providing extendedresults related to the visual quality comparison(Section 4.2 in the original manuscript)of the visualizations generated by our method.Towards this goal, in Figures 24-28 we compare our visualizationswith upsampled activation maps from internal layers Bau et al. (2017); Zhou et al. (2015) and theoutput of deconvnet combined with guided-backpropagation Springenberg et al. (2015).Following the same methodology as in Figure 2 of theoriginal manuscript, we focus on visualizations atlower and higher layers of the network, i.e.,layer-2/21 and layer-15/21, respectively. + +For reference, in Figure 29 we show similarcomparisons from explanations generated from models trainedon the proposed an8Flower dataset. + +In Figures 24-28 we can corroboratethat our method to attenuate the grid-like artifactsintroduced by deconvnet methods indeed produces noticeableimprovements, for lower layers.Likewise, for the case of higher layers, the proposedmethod provides a more precise visualization when comparedto upsampled activation maps. \ No newline at end of file diff --git a/1712.06317v3.txt b/1712.06317v3.txt new file mode 100644 index 0000000000000000000000000000000000000000..d3a8a920af44444fc68d74bc7c4783b65607aba9 --- /dev/null +++ b/1712.06317v3.txt @@ -0,0 +1,85 @@ +Object detection is a fundamental problem in computer vision. While there has been a long history of detecting objects in static images, there has been much less research in detecting objects in videos. However, cameras on robots, surveillance systems, vehicles, wearable devices, etc., receive videos instead of static images. Thus, for these systems to recognize the key objects and their interactions, it is critical that they be equipped with accurate video object detectors. + +The simplest way to detect objects in video is to run a static image-based detector independently on each frame. However, due to the different biases and challenges of video (e.g., motion blur, low-resolution, compression artifacts), an image detector usually does not generalize well. More importantly, videos provide rich temporal and motion information that should be utilized by the detector during both training and testing. For example, in Fig. 1, since the hamster’s profile view (frames 1-2) is much easier to detect than the challenging viewpoint/pose in later frames, the image detector only succeeds in detecting the leading frame of the sequence. On the other hand, by learning to aggregate useful information over time, a video object detector can robustly detect the object under extreme viewpoint/pose. + +Therefore, in recent years, there has been a growing interest in the community on designing video object detectors [18, 19, 29, 25, 14, 51, 50]. However, many existing methods exploit temporal information in an ad-hoc, post-processing manner – static object detections returned by an image detector like R-FCN [9] or Faster R-CNN [38] are linked across frames [19, 29, 25], or video segmentation is performed to refine the detection results [18]. Although these methods show improvement over a static image detector, exploiting temporal information as post-processing is sub-optimal since temporal and motion information are ignored during detector training. As such, they have difficulty overcoming consecutive failures of the static detector e.g., when the object-of-interest has large occlusion or unusual appearance for a long time. + +More recent works [14, 51, 50] learn to exploit temporal information during training by either learning to combine features across neighboring frames or by predicting the displacement of detection boxes across frames. However, these methods operate on fixed-length temporal windows and thus have difficulty modeling variable and long-term temporal information. While the Tubelet Proposal Network [24] does model long-term dependencies, it uses vectors to represent the memory of the recurrent unit, and hence loses spatial information. To compensate, it computes the memory vectors at the region-level for each tube (sequence of proposals), but this can be very slow and depends strongly on having accurate initial tubes. + +To address these limitations, we introduce the Spatial-Temporal Memory Network (STMN), which jointly learns to model and align an object’s long-term appearance and motion dynamics in an end-to-end fashion for video object detection. At its core is the Spatial-Temporal Memory Module (STMM), which is a convolutional recurrent computation unit that fully integrates pre-trained weights learned from static images (e.g., ImageNet [11]). This design choice is critical in addressing the practical challenge of learning from contemporary video datasets, which largely lack intra-category object diversity; i.e., since video frames are highly redundant, a video dataset of e.g., 1 million frames has much lower diversity than an image dataset with 1 million images. By designing our memory unit to be compatible with pre-trained weights from both its preceding and succeeding layers, we show that it outperforms the standard ConvGRU [4] recurrent module for video object detection. + +Furthermore, in order to account for the 2D spatial nature of visual data, the STMM preserves the spatial information of each frame in its memory. In particular, to achieve accurate pixel-level spatial alignment over time, the STMM uses a novel MatchTrans module to explicitly model the displacement introduced by motion across frames. Since the convolutional features for each frame are aligned and aggregated in the spatial memory, the feature for any particular object region is well-localized and contains information across multiple frames. Furthermore, each region feature can be extracted trivially via ROI pooling from the memory. + +In summary, our main contribution is a novel spatial-temporal memory network for video object detection. Our ablative studies show the benefits provided by the STMM and MatchTrans modules – integrating pre-trained static image weights and providing spatial alignment across time. These design choices lead to state-of-the-art results on the ImageNet video object detection dataset (VID) [1] across different base detectors and backbone networks. + +Recent work that adopt deep neural networks have significantly advanced the state-of-the-art in static image object detection [16, 39, 17, 38, 37, 31, 9, 40, 7]. Our work also builds on the success of deep networks to learn the features, classifier, and bounding box localizer in an end-to-end framework. However, in contrast to most existing work that focus on detecting objects in static images, this paper aims to detect objects in videos. + +Compared to static image-based object detection, there has been less research in detecting objects in videos. Early work processed videos captured from a static camera or made strong assumptions about the type of scene (e.g., highway traffic camera for detecting cars or an indoor room for detecting persons) [46, 8]. Later work used hand-designed features by aggregating simple motion cues (based on optical flow, temporal differences, or tracking), and focused mostly on pedestrian detection [45, 10, 23, 35]. + +With the introduction of ImageNet VID [1] in 2015, researchers have focused on more generic categories and realistic videos. However, many existing approaches combine per-frame detections from a static image detector via tracking in a two-stage pipeline [19, 43, 25]. Since the motion and temporal cues are used as a post-processing step only during testing, many heuristic choices are required, which can lead to sub-optimal results. In contrast, our approach directly learns to integrate the motion and temporal dependencies during training. Our end-to-end architecture also leads to a clean and fast runtime. + +Sharing our goal of leveraging temporal information during training, the recent works of Zhu et al. [51, 50] learn to combine features of different frames with a feed-forward network for improved detection accuracy. Our method differs in that it produces a spatial-temporal memory that can carry on information across long and variable number of frames, whereas the methods in [51, 50] can only aggregate information over a small and fixed number of frames. In Sec. 4.3.2, we demonstrate the benefits gained from this flexibility. Although the approach of Kang et al. [24] uses memory to aggregate temporal information, it uses a vector representation. Since spatial information is lost, it computes a separate memory vector for each region tube (sequence of proposals) which can make the approach very slow. In contrast, our approach only needs to compute a single frame-level spatial memory, whose computation is independent of the number of proposals. + +Finally, Detect and Track [14] aims to unify detection and tracking, where the correlation between consecutive two frames are used to predict the movement of the detection boxes. Unlike [14], our spatial-temporal memory aggregates information across t>2𝑡2t>2 frames. Furthermore, while our approach also computes the correlation between neighboring frames with the proposed MatchTrans module, we use it to warp the entire feature map for alignment (i.e., at the coarse pixel-level), rather than use it to predict the displacement of the boxes. Overall, these choices lead to state-of-the-art detection accuracy on ImageNet VID. + +Apart from video object detection, other recent work use convolutional and/or recurrent networks for video classification [26, 42, 4]. These methods tend to model entire video frames instead of pixels, which means the fine-grained details required for localizing objects are often lost. Object tracking (e.g., [30, 33]), which requires accurate localization, is also closely-related. The key difference is that in tracking, the bounding box of the first frame is given and the tracker does not necessarily need to know the semantic category of the object being tracked. + +In computer vision, RNNs have been used for image captioning [27, 44, 12], visual attention [2, 32, 47], action/object recognition [12, 4], human pose estimation [15, 6], and semantic segmentation [49]. Recently, Tripathi et al. [43] adopted RNNs for video object detection. However, in their pipeline, the CNN-based detector is first trained, then an RNN is trained to refine the detection outputs of the CNN. + +Despite the wide adoption of RNNs in various vision tasks, most approaches work with vector-form memory units (as in standard LSTM/GRU). To take spatial locality into account, Ballas et al. [4] proposed convolutional gated recurrent units (ConvGRU) and applied it to the task of action recognition. Built upon [4], Tokmakov et al. [41] used ConvGRUs for the task of video object segmentation. Our work differs in three ways: (1) we classify bounding boxes rather than frames or pixels; (2) we propose a new recurrent computation unit called STMM that makes better use of static image detector weights pre-trained on a large-scale image dataset like ImageNet; and (3) our spatial-temporal memory is aligned frame-to-frame through our MatchTrans module. We show that these properties lead to better results than ConvGRU for video object detection. + +We propose a novel RNN architecture called the Spatial-Temporal Memory Network (STMN) to model an object’s changing appearance and motion over time for video object detection. + +The overall architecture is shown in Fig. 2. Assuming a video sequence of length T𝑇T, each frame is first forwarded through a convnet to obtain convolutional feature maps F1,F2,…,FTsubscript𝐹1subscript𝐹2…subscript𝐹𝑇F_{1},F_{2},...,F_{T} as appearance features. To aggregate information along the temporal axis, the appearance feature of each frame is fed into the Spatial-Temporal Memory Module (STMM). The STMM at time step t𝑡t receives the appearance feature for the current frame Ftsubscript𝐹𝑡F_{t}, as well as a spatial-temporal memory Mt−1→subscriptsuperscript𝑀→𝑡1M^{\rightarrow}_{t-1}, which carries the information of all previous frames up through timestep t−1𝑡1t-1. The STMM then updates the spatial-temporal memory for the current time step Mt→subscriptsuperscript𝑀→𝑡M^{\rightarrow}_{t} conditioned on both Ftsubscript𝐹𝑡F_{t} and Mt−1→subscriptsuperscript𝑀→𝑡1M^{\rightarrow}_{t-1}. In order to capture information from both previous and later frames, we use two STMMs, one for each direction, to obtain both M→superscript𝑀→M^{\rightarrow} and M←superscript𝑀←M^{\leftarrow}. These are then concatenated to produce the temporally modulated memory M𝑀M for each frame. + +The concatenated memory M𝑀M, which also preserves spatial information, is then fed into subsequent convolution/fully-connected layers for both category classification and bounding box regression. This way, our approach combines information from both the current frame as well as temporally-neighboring frames when making its detections. This helps, for instance, in the case of detecting a frontal-view bicycle in the center frame of Fig. 2 (which is hard), if we have seen its side-view (which is easier) from nearby frames. In contrast, a static image detector would only see the frontal-view bicycle when making its detection. + +Finally, to train the detector, we use the same loss function used in R-FCN [9]. Specifically, for each frame in a training sequence, we enforce a cross-entropy loss between the predicted class label and the ground-truth label, and enforce a smooth L​1𝐿1L1 loss on the predicted bounding box regression coefficients. During testing, we slide the testing window and detect on all frames within each sliding window, to be consistent with our training procedure. + +We next explain how the STMM models the temporal correlation of an object across frames. At each time step, the STMM takes as input Ftsubscript𝐹𝑡F_{t} and Mt−1subscript𝑀𝑡1M_{t-1} and computes the following:ztsubscript𝑧𝑡\displaystyle z_{t}=𝙱𝙽∗​(𝚁𝚎𝙻𝚄​(Wz∗Ft+Uz∗Mt−1)),absentsuperscript𝙱𝙽𝚁𝚎𝙻𝚄subscript𝑊𝑧subscript𝐹𝑡subscript𝑈𝑧subscript𝑀𝑡1\displaystyle={\tt BN^{*}}({\tt ReLU}(W_{z}*F_{t}+U_{z}*M_{t-1})),(1)rtsubscript𝑟𝑡\displaystyle r_{t}=𝙱𝙽∗​(𝚁𝚎𝙻𝚄​(Wr∗Ft+Ur∗Mt−1)),absentsuperscript𝙱𝙽𝚁𝚎𝙻𝚄subscript𝑊𝑟subscript𝐹𝑡subscript𝑈𝑟subscript𝑀𝑡1\displaystyle={\tt BN^{*}}({\tt ReLU}(W_{r}*F_{t}+U_{r}*M_{t-1})),(2)M~tsubscript~𝑀𝑡\displaystyle\tilde{M}_{t}=𝚁𝚎𝙻𝚄​(W∗Ft+U∗(Mt−1⊙rt)),absent𝚁𝚎𝙻𝚄𝑊subscript𝐹𝑡𝑈direct-productsubscript𝑀𝑡1subscript𝑟𝑡\displaystyle={\tt ReLU}(W*F_{t}+U*(M_{t-1}\odot r_{t})),(3)Mtsubscript𝑀𝑡\displaystyle M_{t}=(1−zt)⊙Mt−1+zt⊙M~t,absentdirect-product1subscript𝑧𝑡subscript𝑀𝑡1direct-productsubscript𝑧𝑡subscript~𝑀𝑡\displaystyle=(1-z_{t})\odot M_{t-1}+z_{t}\odot\tilde{M}_{t},(4)where ⊙direct-product\odot is element-wise multiplication, ∗* is convolution, and U,W,𝑈𝑊U,W, Ur,Wr,Uz,Wzsubscript𝑈𝑟subscript𝑊𝑟subscript𝑈𝑧subscript𝑊𝑧U_{r},W_{r},U_{z},W_{z} are the 2D convolutional kernels, whose parameters are optimized end-to-end. Gate rtsubscript𝑟𝑡r_{t} masks elements of Mt−1subscript𝑀𝑡1M_{t-1} (i.e., it allows the previous state to be forgotten) to generate candidate memory M~tsubscript~𝑀𝑡\tilde{M}_{t}. And gate ztsubscript𝑧𝑡z_{t} determines how to weight and combine the memory from the previous step Mt−1subscript𝑀𝑡1M_{t-1} with the candidate memory M~tsubscript~𝑀𝑡\tilde{M}_{t}, to generate the new memory Mtsubscript𝑀𝑡M_{t}. + +To generate rtsubscript𝑟𝑡r_{t} and ztsubscript𝑧𝑡z_{t}, the STMM first computes an affine transformation of Mt−1subscript𝑀𝑡1M_{t-1} and Ftsubscript𝐹𝑡F_{t}, and then ReLU [28] is applied to the outputs. Since rtsubscript𝑟𝑡r_{t} and ztsubscript𝑧𝑡z_{t} are gates, their values need to be in the range of [0,1]01[0,1]. Therefore, we make two changes to the standard BatchNorm [22] (and denote it as 𝙱𝙽∗superscript𝙱𝙽{\tt BN^{*}}) such that it normalizes its input to [0,1]01[0,1], instead of zero mean and unit standard deviation. + +First, our variant of BatchNorm computes the mean μ​(X)𝜇𝑋\mu(X) and standard deviation σ​(X)𝜎𝑋\sigma(X) for an input batch X𝑋X, and then normalizes values in X𝑋X with the linear squashing function S​(X;μ,σ)𝑆𝑋𝜇𝜎S(X;\mu,\sigma) shown in Fig. 3. Second, we compute the mean and standard deviation for each batch independently instead of keeping running averages across training batches. In this way, we do not need to store different statistics for different time-steps, which allows us to generate test results for sequence lengths not seen during training (e.g., we can compute detections on longer sequences than those seen during training as demonstrated in Sec. 4.3). Note that a key difference between 𝙱𝙽∗superscript𝙱𝙽{\tt BN^{*}} and instance/layer normalization [21, 3] is that 𝙱𝙽∗superscript𝙱𝙽{\tt BN^{*}} guarantees that each and every value in its output is normalized within [0,1]01[0,1] (which is necessary for gating variables), whereas neither instance nor layer normalization ensures this property. Although simple, we find 𝙱𝙽∗superscript𝙱𝙽{\tt BN^{*}} works well for our purpose. + +A key practical challenge of learning video object detectors is the lack of intra-category object diversity in contemporary video datasets; i.e., since video frames are highly redundant, a video dataset of e.g., 1 million frames has much lower diversity than an image dataset with 1 million images. The cost of annotation is much higher in video, which makes it difficult to have the same level of diversity as an image dataset. Therefore, transferring useful information from large-scale image datasets like ImageNet [11]—into the memory processing unit itself—would benefit our video object detector by providing additional diversity. + +Specifically, we would like to initialize our STMN detector with the weights of the state-of-the-art static image-based RFCN detector [9] which has been pretrained on ImageNet DET images, and continue to fine-tune it on ImageNet VID videos. In practice, this would entail converting the last convolution layer before the Position-Sensitive ROI pooling in RFCN into our STMM memory unit (see Fig. 2). However, this conversion is non-trivial with standard recurrent units like LSTM/GRU that employ Sigmoid/Tanh nonlinearities, since they are different from the ReLU nonlinearity employed in the R-FCN convolutional layers. + +Thus, to transfer the weights of the pre-trained RFCN static image detector into our STMN video object detector, we make two changes to the ConvGRU [4]. First, in order to make full use of the pre-trained weights, we need to make sure the output of the recurrent computation unit is compatible with the pre-trained weights before and after it. As an illustrative example, since the output of the standard ConvGRU is in [−1,1]11[-1,1] (due to Tanh non-linearity), there would be a mismatch with the input range that is expected by the ensuing pre-trained convolutional layer (the expected values should all be positive due to ReLU). To solve this incompatibility, we change the non-linearities in standard ConvGRU from Sigmoid and Tanh to ReLU. Second, we initialize Wzsubscript𝑊𝑧W_{z}, Wrsubscript𝑊𝑟W_{r} and W𝑊W in Eqs. 1-3 with the weights of the convolution layer that is swapped out, rather than initializing them with random weights. Conceptually, this can be thought of as a way to initialize the memory with the pre-trained static convolutional feature maps. In Sec. 4.3, we show that these modifications allow us to make better use of pre-trained weights and achieve better detection performance. + +Next, we explain how to align the memory across frames. Since objects move in videos, their spatial features can be mis-aligned across frames. For example, the position of a bicycle in frame t−1𝑡1t-1 might not be aligned to the position of the bicycle in frame t𝑡t (as in Fig. 2). In our case, this means that the spatial-temporal memory Mt−1subscript𝑀𝑡1M_{t-1} may not be spatially aligned to the feature map for current frame Ftsubscript𝐹𝑡F_{t}. This can be problematic, for example in the case of Fig. 4; without proper alignment, the spatial-temporal memory can have a hard time forgetting an object after it has moved to a different spatial position. This is manifested by a trail of saliency, in the fourth row of Fig. 4, due to the effect of overlaying multiple unaligned feature maps. Such hallucinated features can lead to false positive detections and inaccurate localizations, as shown in the third row of Fig. 4. + +To alleviate this problem, we propose the MatchTrans module to align the spatial-temporal memory across frames. For a feature cell Ft​(x,y)∈1×1×Dsubscript𝐹𝑡𝑥𝑦11𝐷F_{t}(x,y)\in 1\times 1\times D at location (x,y)𝑥𝑦(x,y) in Ftsubscript𝐹𝑡F_{t}, MatchTrans computes the affinity between Ft​(x,y)subscript𝐹𝑡𝑥𝑦F_{t}(x,y) and feature cells in a small vicinity around location (x,y)𝑥𝑦(x,y) in Ft−1subscript𝐹𝑡1F_{t-1}, in order to transform the spatial-temporal memory Mt−1subscript𝑀𝑡1M_{t-1} to align with frame t𝑡t. More formally, the transformation coefficients ΓΓ\Gamma are computed as:Γx,y​(i,j)=Ft​(x,y)⋅Ft−1​(x+i,y+j)∑i,j∈{−k,…,k}Ft​(x,y)⋅Ft−1​(x+i,y+j),subscriptΓ𝑥𝑦𝑖𝑗⋅subscript𝐹𝑡𝑥𝑦subscript𝐹𝑡1𝑥𝑖𝑦𝑗subscript𝑖𝑗𝑘…𝑘⋅subscript𝐹𝑡𝑥𝑦subscript𝐹𝑡1𝑥𝑖𝑦𝑗\displaystyle\Gamma_{x,y}(i,j)=\frac{F_{t}(x,y)\cdot F_{t-1}(x+i,y+j)}{\sum_{i,j\in\{-k,\dots,k\}}F_{t}(x,y)\cdot F_{t-1}(x+i,y+j)},where both i𝑖i and j𝑗j are in the range of [−k,k]𝑘𝑘[-k,k], which controls the size of the matching vicinity. With ΓΓ\Gamma, we transform the unaligned memory Mt−1subscript𝑀𝑡1M_{t-1} to the aligned Mt−1′superscriptsubscript𝑀𝑡1′M_{t-1}^{\prime} as follows:Mt−1′​(x,y)=∑i,j∈{−k,…,k}Γx,y​(i,j)⋅Mt−1​(x+i,y+j).superscriptsubscript𝑀𝑡1′𝑥𝑦subscript𝑖𝑗𝑘…𝑘⋅subscriptΓ𝑥𝑦𝑖𝑗subscript𝑀𝑡1𝑥𝑖𝑦𝑗\displaystyle M_{t-1}^{\prime}(x,y)=\sum_{i,j\in\{-k,\dots,k\}}\Gamma_{x,y}(i,j)\cdot M_{t-1}(x+i,y+j).The intuition here is that given transformation ΓΓ\Gamma, we reconstruct the spatial memory Mt−1′​(x,y)superscriptsubscript𝑀𝑡1′𝑥𝑦M_{t-1}^{\prime}(x,y) as a weighted average of the spatial memory cells that are within the (2​k+1)×(2​k+1)2𝑘12𝑘1(2k+1)\times(2k+1) vicinity around (x,y)𝑥𝑦(x,y) on Mt−1subscript𝑀𝑡1M_{t-1}; see Fig. 5. At this point, we can thus simply replace all occurrences of Mt−1subscript𝑀𝑡1M_{t-1} with the spatially aligned memory Mt−1′superscriptsubscript𝑀𝑡1′M_{t-1}^{\prime} in Eqs. 1-4. With proper alignment, our generated memory is much cleaner (second row of Fig. 4) and leads to more accurate detections (first row of Fig. 4). Since the computational cost is quadratic in k𝑘k, we set k=2𝑘2k=2 for all our experiments as this choice provides a good trade-off between performance and computation. + +Our MatchTrans is related to the alignment module used in recent video object detection work by [51, 50]. However, [51, 50] use optical flow, which needs to be computed either externally e.g., using [5], or in-network through another large CNN e.g., FlowNet [13]. In contrast, our MatchTrans is much more efficient, saving computation time and/or space for storing optical flow. For example, it is nearly an order of magnitude faster to compute (on average, 2.9ms vs. 24.3ms for an 337x600 frame) than FlowNet [13], which is one of the fastest optical flow methods. Also, a similar procedure for computing transformation coefficients was used in [14]. However, in [14], the coefficients are fed as input to another network to regress the displacement of bounding boxes for tracking, whereas we use it to warp the entire feature map for aligning the memory. In other words, rather than use the transformation coefficients to track and connect detections, we instead use them to align the memory over time to produce better features for each candidate object region. We show in Sec. 4.1 that this leads to better performance on ImageNet VID. + +Finally, even though we enforce temporal smoothness in our spatial-temporal memory (i.e., at the feature level), we do not have an explicit smoothness constraint in the output space to ensure that detections in adjacent frames are spatially smooth. We therefore apply standard Seq-NMS [19] over our per-frame detections, following [51, 14]. + +Through the specially designed Spatial-Temporal Memory and MatchTrans modules, our STMN detector aggregates and aligns useful information from temporally nearby frames for video object detection. + +We show quantitative and qualitative results of our STMN video object detector, and compare to both state-of-the-art static image and video detectors. We also conduct ablation studies to analyze the different components of our model. + +We use ImageNet VID [1], which has 3862/555/937 videos for training/validation/testing for 30 categories. Bounding box annotation is provided for all frames. We choose ImageNet VID for its relatively large size as well as for ease of comparison to existing state-of-the-art methods [1, 9, 25, 24, 14, 51, 50]. + +For object proposals, we use DeepMask [36] for our method and our own baselines. We use the R-FCN detector [9] with ResNet-101 [20] as the backbone network. Following [14], we first train R-FCN on ImageNet DET, and then transfer its weights (using the method described in Sec. 3.2) to initialize our STMN detector and continue fine-tuning it on ImageNet VID. We set sequence length T=7𝑇7T=7 during training. For testing, we observe better performance when using a longer sequence length; specifically, T=11𝑇11T=11 frames provides a good balance between performance and GPU memory/computation (we later show the relationship between performance and test sequence length). We set the number of channels of the spatial memory to 512. To reduce redundancy within sequences, we form a sequence by sampling 1 in every 10 video frames with uniform stride. For training, we start with a learning rate of 1e-3 with SGD and lower it to 1e-4 when training loss plateaus. During testing we ensemble the detection results of the STMN detector with the initial R-FCN detector from which it started since it comes for free as a byproduct of the training procedure. We employ standard left-right flipping augmentation. + +Table 1 shows the comparison to existing state-of-the-art image and video detectors. First, our STMN detector outperforms the static-image based R-FCN detector with a large margin (+7.1%). This demonstrates the effectiveness of our proposed spatial-temporal memory. Our STMN detector also achieves the best performance compared to all existing video object detection methods with ResNet-101 as the base network. Furthermore, in order to enable a fairer comparison to older methods that use Fast/Faster-RCNN + VGG-16 as the base detector and backbone network, we also train an STMN model with the Fast-RCNN as the base detector and VGG-16 as the backbone feature network. Specifically, we first train a static-image Fast-RCNN detector and initialize the weights of STMN using a similar procedure as described in Sec. 3.2.111Specifically, we convert the conv5 layer in VGG-16 to an STMM module by initializing Wzsubscript𝑊𝑧W_{z}, Wrsubscript𝑊𝑟W_{r} and W𝑊W in Eqs. 1-3 with the weights of conv5. With this setting, our STMN achieves 61.7% val mAP, which is much higher than its static-image based counterpart (52.2%). This result shows that our method can be generalized across different base detectors and backbone networks. + +When examining per-category results, our method shows the largest improvement on categories like “sheep”, “rabbit”, and “domestic cat” compared to methods like [14]. In these cases, we see a clear advantage of aggregating information across multiple frames (vs. 2 frames as in [14]), as there can be consecutive “hard” frames spanning multiple (>2absent2>2) frames (e.g., a cat turning away from the camera for several frames). On the other hand, we find that the three categories on which we perform the worst are “monkey”, “snake”, and “squirrel”. These are categories with large deformation and strong motion blur. When the per-frame appearance features fail to accurately model these objects due to such challenges, aggregating those features over time with our STMM does not help. Still, overall, we find that our model produces robust detection results across a wide range of challenges as demonstrated next in the qualitative results. + +Fig. 6 shows qualitative comparisons between our STMN detections and the static image R-FCN detections. Our STMN detections are more robust to motion blur; e.g., in the last frame of the “hamster” sequence, R-FCN gets confused about the class label of the object due to large motion blur, whereas our STMN detector correctly detects the object. In the case of difficult viewpoint and occlusion (“dog” and “rabbit”, respectively), our STMN produces robust detections by leveraging the information from neighboring easier frames (i.e., center frame in the “rabbit” sequence and the first frame in the “dog” sequence). Also, our model outputs detections that are more consistent across frames, compared with the static image detector, as can be seen in the case of “squirrel” and “rabbit”. Finally, our STMN detector is also more robust in crowded scenes as shown in the “airplane” sequence. + +We next conduct ablation studies to analyze the impact of each component in our model by comparing it to a number of baselines that lack one or more components. For this, we use Fast-RCNN as the base detector and VGG-16 as the backbone network since it is much faster to train compared to RFCN + ResNet-101. To ensure a clean analysis, we purposely do not employ any data augmentation during training for this ablative study. + +The first baseline, compared with our model, lacks the MatchTrans module and thus does not align the memory from frame to frame (STMN-No-MatchTrans). The second baseline computes the memory using ConvGRU [4], instead of our proposed STMM. Like ours, this baseline (ConvGRU-Pretrain) also uses pre-trained ImageNet weights for both the feature stack and prediction layers. Our final baseline is ConvGRU without pre-trained weights for the ensuing prediction FCs (ConvGRU-FreshFC). + +Table 2 shows the results. First, comparing our STMN to the STMN-No-MatchTrans baseline, we observe a 1.7% test mAP improvement brought by the spatial alignment across frames. This result shows the value of our MatchTrans module. To compare our STMM with ConvGRU, we first replace STMM with ConvGRU and as with standard practice, randomly initialize the weights for the FC layers after the ConvGRU. With this setting (ConvGRU-FreshFC), we obtain a relatively low test mAP of 44.8%, due to the lack of data to train the large amount of weights in the FCs. This result shows that initializing the memory by only partially transferring the pre-trained ImageNet weights is suboptimal. If we instead initialize the weights of the FCs after the ConvGRU with pre-trained weights (ConvGRU-Pretrain), we improve the test mAP from 44.8% to 48.0%. Finally, by replacing Sigmoid and Tanh with ReLU, which is our full model (STMN), we boost the performance even further to 50.7%. This shows the importance of utilizing pre-trained weights in both the feature stacks and prediction head, and the necessity of an appropriate form of recurrent computation that best matches its output to the input expected by the pre-trained weights. + +We next analyze the relationship between detection performance and length of test window size. Specifically, we test our model’s performance with test window size 3, 7, 11, and 15, on ImageNet VID validation set (the training window size is always 7). The corresponding mAP differences, with respect to that of window size 7, are -1.9%, 0.0%, +0.7%, +1.0%, respectively; as we increase the window size, the performance tends to keep increasing. This suggests the effectiveness of our memory: the longer the sequence, the more longer-range useful information is stored in the memory, which leads to better detection performance. However, increasing the test window size also increases computation cost and GPU memory consumption. Therefore, we find that setting the test window size to 11 provides a good balance. + +Finally, we sketch the computational overhead of our memory module. To forward a batch of 11 frames of size 337x600, it takes 0.52 and 0.83 seconds for R-FCN and STMN respectively, on a Titan X GPU. The added 0.028 (=0.31/11) secs/frame is spent on STMM computation including MatchTrans alignment. + +We proposed a novel spatial-temporal memory network (STMN) for video object detection. Our main contributions are a carefully-designed recurrent computation unit that integrates pre-trained image classification weights into the memory and an in-network alignment module that spatially-aligns the memory across time. Together, these lead to state-of-the-art results on ImageNet VID. Finally, we believe that our STMN could also be useful for other video understanding tasks that require accurate spatial information like action detection and keypoint detection. + +This work was supported in part by the ARO YIP W911NF17-1-0410, NSF CAREER IIS-1751206, AWS Cloud Credits for Research Program, and GPUs donated by NVIDIA. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of ARO or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein. \ No newline at end of file diff --git a/1712.06424v3.txt b/1712.06424v3.txt new file mode 100644 index 0000000000000000000000000000000000000000..73a7a6d3e038bfbee268cd1c3d5068fcaa456331 --- /dev/null +++ b/1712.06424v3.txt @@ -0,0 +1,83 @@ +The field of character generation remains relatively under-explored compared with the automatic recognition of characters Pal and Chaudhuri (2004); Zhong et al. (2016). This unbalanced progress is disadvantageous for the development of information processing of all languages, especially Chinese, one of the most widely used languages that has its characters incorporated into many other Asian languages, such as Japanese and Korean. + +Learning to write stylized Chinese characters by reading a handful of examples (as shown in Fig. 1) is also a good testbed for machine intelligence as the task can be finished effectively by humans while still remaining challenging for machines. + +Though great efforts have been made on synthesizing simple English or Latin characters Graves (2013); Lake et al. (2015), only a little exploration has been done on Chinese character generation. This is not surprising as Chinese characters pose new challenges due to their complexity and diversity. First, Chinese characters have a much larger dictionary compared with the alphabetic writings. For instance, there are 27,533 unique Chinese characters in the official GB18030 charset, with daily used ones up to 3,000. Recently, Zhang et al. [2017] propose to generate Chinese characters based on Recurrent Neural Networks Hochreiter andSchmidhuber (1997), which learns a low dimensional embedding as the character label to solve the issue of large dictionary. However, this method only generates characters without any style information, and heavily relies on the online temporal information of the strokes, which cannot generalize to the off-line applications. + +Moreover, Chinese characters have more complex shapes and structures than other symbolic characters such as Latin alphabets. Some attempts have been made on Chinese character generation by assembling components of radicals and strokes Xu et al. (2009); Zong and Zhu (2014); Lian et al. (2016). However, these models rely on the preceding parsing, which requires each character to have a clear structure. Therefore, they cannot deal with a joined-up writing style , in which strokes are connected and cursive. + +Finally, the generation of stylized Chinese characters is also challenged by the complexity in writing styles. The recent “Rewrite” Tian (2016) and its advanced version “zi2zi” Tian (2017) based on the “pix2pix” Isola et al. (2016) implement font style transfer of Chinese characters by learning to map the source style to a target style with thousands of character pairs. However, these methods have to re-train a model from scratch when observing some Chinese characters with a new style, failing to re-utilize the knowledge learned before. + +To address the aforementioned challenges, we propose a novel framework named Style-Aware Variational Auto-Encoder (SA-VAE) to conduct the stylized Chinese character generation. Compared with the alternative popular deep generative model of Generative Adversarial Networks (GAN) Goodfellow et al. (2014), Variational Auto-Encoder (VAE) Kingma and Welling (2014) naturally has the ability of posterior inference to reveal the underlying factors, usually yielding better inference effects than inference extensions to GAN Donahue et al. (2016); Dumoulin et al. (2016). In this paper, we make a feature-disentangled extension to VAE both in the model level and algorithm level. + +It is imperative to extract a pure and accurate style representation for the purpose of learning a new writing style given one or a few examples, which therefore drives us to disentangle the style and content features from the given samples. To our best knowledge, the most relevant study to solve this two-factor disentanglement problem is using a bilinear model Tenenbaum andFreeman (1997). However, the disentanglement based on matrix decomposition limits its applicabilities in the complicated situations with highly nonlinear combinations.Therefore, in the model level, we leverage the powerful capabilities of deep learning for non-linear function approximation to design a style inference network and a content recognition network, which encode the style and content information respectively. Meanwhile, in the algorithm level, we propose a novel intercross pair-wise optimization method, which encourages the extracted style embedding more pure and reliable. + +Unlike the general image generation like faces Ziwei Liu andTang (2015) or bedrooms Yu et al. (2015), Chinese character generation is also challenged by the large dictionary and rigorous structures. It may lead to confusing or incorrect results even if a small bias is introduced in Chinese character generation. To address this issue, we integrate the character knowledge into our framework by considering the specific configuration and radicals information of Chinese characters, which offers significant benefits when we generate characters with complex structures. In order to generate characters with an unseen style, our model learns the characteristics of numerous printing and handwritten styles as our style bank. Relying on the powerful generalization capabilities of our model, the proposed model makes a reasonable inference and conducts effective generalization on new styles without the need to retrain the model. + +Extensive experiments demonstrate that our method can generate stylized Chinese characters by reading only one or a few samples with diverse styles. To the best of our knowledge, this is the first attempt to learn to write Chinese characters of new styles in this one-shot/few-shot scenario. To sum up, our major contributions are as follows:•We propose a novel intercross pair-wise optimization method to disentangle the style and content features of Chinese characters, which is a general technique to solve two-factor disentanglement problems with supervision.•We introduce the domain knowledge of Chinese characters into our model a priori to guide the generation.•Our proposed framework (SA-VAE) can achieve desirable style inference and generate stylized Chinese characters in the one-shot/few-shot setting, even for the unseen styles in the training stage. + +In this section, we first formally present our task and the architecture of the whole framework. Then, we present our intercross pair-wise optimization method in detail. Finally, we show how to conduct one-shot/few-shot stylized Chinese character generation with our model. + +To frame the task formally, we make the mild assumption that all Chinese characters are independently decided by the content factor and the style factor, which can be denoted as:𝐱i,j←(𝐬i,𝐜j),←subscript𝐱𝑖𝑗subscript𝐬𝑖subscript𝐜𝑗\mathbf{x}_{i,j}\leftarrow(\mathbf{s}_{i},\mathbf{c}_{j}),(1)where 𝐬isubscript𝐬𝑖\mathbf{s}_{i} represents style i𝑖i, 𝐜jsubscript𝐜𝑗\mathbf{c}_{j} represents content j𝑗j, and 𝐱i,jsubscript𝐱𝑖𝑗\mathbf{x}_{i,j} is the character with style i𝑖i and content j𝑗j. + +Based on this assumption, we propose to infer the style representation when observing the characters, and integrate these style features with the content features to generate target characters. As the characters do not have an explicit separation between style and content, we thus have to do “reverse-engineering”—recognize the content and disentangle the style information from given characters, and combine the style with target contents to generate the stylized Chinese characters. + +To this end, we first build a dataset containing all the Chinese characters with a diverse set of styles as our style-bank, which is denoted as:𝒳={𝐱i,j},i=1,2,…,M,j=1,2,…,N,formulae-sequence𝒳subscript𝐱𝑖𝑗formulae-sequence𝑖12…𝑀𝑗12…𝑁\mathcal{X}=\{\mathbf{x}_{i,j}\},i=1,2,...,M,j=1,2,...,N,(2)where M𝑀M is the number of styles and N𝑁N is the total number of unique Chinese characters in the training dataset (See Sec. 3.1 for details). + +Afterwards, we build a Content Recognition Network 𝒞𝒞\mathcal{C} and a Style Inference Network 𝒮𝒮\mathcal{S} to respectively obtain the disentangled features of content 𝐜jsubscript𝐜𝑗\mathbf{c}_{j} and style 𝐬isubscript𝐬𝑖\mathbf{s}_{i} for each Chinese character 𝐱i,jsubscript𝐱𝑖𝑗\mathbf{x}_{i,j}. The characters are then generated via a generation network 𝒢𝒢\mathcal{G}. In the one-shot/few-shot setting, we allow the model to observe only one or a few characters with a new style denoted as {𝐱M+k,l:l+m}subscript𝐱:𝑀𝑘𝑙𝑙𝑚\{\mathbf{x}_{M+k,l:l+m}\} where k>0,m≥0formulae-sequence𝑘0𝑚0k>0,m\geq 0.Based on these characters, the style feature 𝐬M+ksubscript𝐬𝑀𝑘\mathbf{s}_{M+k} can be inferred by 𝒮𝒮\mathcal{S}, which is combined with any content feature 𝐜n∈{𝐜1:N}subscript𝐜𝑛subscript𝐜:1𝑁\mathbf{c}_{n}\in\{\mathbf{c}_{1:N}\} to generate the desirable stylized Chinese character 𝐱M+k,nsubscript𝐱𝑀𝑘𝑛\mathbf{x}_{M+k,n} via 𝒢𝒢\mathcal{G}. + +Here, we present the details of our model. The model mainly consists of three modules of a Content Recognition Network 𝒞𝒞\mathcal{C}, a Style Inference Network 𝒮𝒮\mathcal{S} and a Character Generation Network 𝒢𝒢\mathcal{G} as illustrated in Fig. 2. The whole process can be separated as two stages — inference and generation. In the inference stage, we first learn to disentangle the latent features into content-related and style-related components based on the Content Recognition Network and Style Inference Network respectively.In the generation stage, we take the content and style vectors as inputs via a deconvolutional network, such that the stylized characters are well reconstructed with the style feature that is appropriately captured in the inference stage. The training process is executed by an intercross pair-wise way (See Sec. 2.3) for a reliable disentanglement. + +Content Recognition Network. Content recognition aims to recognize the content of every Chinese character image, which provides a correct content label to the style inference network and generation network. We refer to the previous works on state-of-the-art character recognition  Xiao et al. (2017); Zhong et al. (2016) to satisfy our need and formulate it as:𝒞:𝐲=fη​(𝐱),:𝒞𝐲subscript𝑓𝜂𝐱\mathcal{C}:\mathbf{y}=f_{\eta}(\mathbf{x}),(3)where 𝐱𝐱\mathbf{x} denotes the character image, 𝐲𝐲\mathbf{y} is the content label, and η𝜂\eta denotes the network’s parameters. + +Character Structure Knowledge. Utilizing the domain knowledge of Chinese characters is essential to develop a compact model and improve the generation quality. Previous deep generative models Radford et al. (2015); Li et al. (2017) usually cast each category as a one-hot embedding, and concatenate it to all the feature maps in every layer. This method works well for some small datasets such as MNIST and SVHN which have only ten classes but fails to solve the Chinese character generation with thousands of classes111The number of classes is comparable to that of the ImageNet.. It may lead to an explosive growth of model parameters. To address this issue, we propose a more informative character encoding method by introducing the configuration and radical information of Chinese characters into our framework and build a corresponding index table 𝒦𝒦\mathcal{K}. + +Compared with the one-hot embedding, our encoding method can reuse the configuration and radical information shared among all the Chinese characters. The one-hot embedding y𝑦y of every character can be transformed to a unique content hashing code through a index table 𝒦𝒦\mathcal{K} as𝒦:𝐜=T​[𝐲].:𝒦𝐜𝑇delimited-[]𝐲\mathcal{K}:\mathbf{c}=T[\mathbf{y}].(4) + +Our encoding method is shown in Fig. 3, which is much shorter than the one-hot embedding (3000 bits in total). The first 12 bits are used to identify the 12 common configurations in Chinese characters, including up-down, left-right, surroundings and so on. The middle 101 bits are used to identify 100 frequently used radicals and the case of missing radicals.The last 20 bits are as a binary index when the former two parts are the same. Proved by the experimental results, our proposed encoding method compresses the embedding dimension while does not harm the model’s capacity compared with other embedding methods. + +Style Inference Network. The Style Inference Network is the key module to make our framework have the capacity of achieving accurate style inference. To automatically disentangle the style feature from the content information, we feed the content hashing code 𝐜𝐜\mathbf{c} to this network besides the character image 𝐱𝐱\mathbf{x}.It is realized as a diagonal Gaussian distribution parameterized by the convolutional neural network. Hence, we formulate the Style Inference Network as:𝒮:qϕ​(𝐬|𝐱,𝐜)=𝒩​(𝐬|μϕ​(𝐱,𝐜),diag​(σϕ​(𝐱,𝐜)2)),:𝒮subscript𝑞italic-ϕconditional𝐬𝐱𝐜𝒩conditional𝐬subscript𝜇italic-ϕ𝐱𝐜diagsubscriptsuperscript𝜎2italic-ϕ𝐱𝐜\mathcal{S}:q_{\phi}(\mathbf{s}|\mathbf{x},\mathbf{c})=\mathcal{N}(\mathbf{s}|\mathbf{\mu}_{\phi(\mathbf{x},\mathbf{c})},\text{diag}(\mathbf{\sigma}^{2}_{\phi(\mathbf{x},\mathbf{c})})),(5)where μϕ​(𝐱,𝐜)subscript𝜇italic-ϕ𝐱𝐜\mathbf{\mu}_{\phi(\mathbf{x},\mathbf{c})} and σϕ​(𝐱,𝐜)2subscriptsuperscript𝜎2italic-ϕ𝐱𝐜\mathbf{\sigma}^{2}_{\phi(\mathbf{x},\mathbf{c})} correspondingly denote the mean and variance of the Gaussian distribution, and ϕitalic-ϕ\phi denotes the parameters of the convolutional neural network. + +On the other hand, for a reliable disentanglement, a good Style Inference Network should try its best tosatisfy this equality:qϕ​(𝐬i|𝐱i,j,𝐜j)=qϕ​(𝐬i|𝐱i,k,𝐜k),subscript𝑞italic-ϕconditionalsubscript𝐬𝑖subscript𝐱𝑖𝑗subscript𝐜𝑗subscript𝑞italic-ϕconditionalsubscript𝐬𝑖subscript𝐱𝑖𝑘subscript𝐜𝑘\displaystyle q_{\phi}(\mathbf{s}_{i}|\mathbf{x}_{i,j},\mathbf{c}_{j})=q_{\phi}(\mathbf{s}_{i}|\mathbf{x}_{i,k},\mathbf{c}_{k}),(6)which requires the Style Inference Network to provide the same posterior distribution given different characters with the same style. This target implicitly ensures that the Style Inference Network can extract the style information because the content information of the inputs are different. This property is very important as our main purpose is to disentangle the style information and achieve one-shot inference. We will explain how to achieve Eq. (6) by the intercross pair-wise optimization method in detail in Sec. 2.3. + +Character Generation Network. In order to generate different characters with diverse styles flexibly, the Character Generation Network takes the content hashing code 𝐜𝐜\mathbf{c} and the style feature 𝐬𝐬\mathbf{s} as two independent inputs, and these two disentangled factors jointly decide the generated characters.We use a Bernoulli distribution parameterized with a deconvolutional neural network Zeiler et al. (2010); Radford et al. (2015) to model the binary image of Chinese characters, which can be formulated as:𝒢:pθ​(𝐱|𝐬,𝐜)=Bern​(𝐱|μθ​(𝐬,𝐜)),:𝒢subscript𝑝𝜃conditional𝐱𝐬𝐜Bernconditional𝐱subscript𝜇𝜃𝐬𝐜\mathcal{G}:p_{\theta}(\mathbf{x}|\mathbf{s},\mathbf{c})=\text{Bern}(\mathbf{x}|\mathbf{\mu}_{\theta(\mathbf{s},\mathbf{c})}),(7)where μθ​(𝐬,𝐜)subscript𝜇𝜃𝐬𝐜\mathbf{\mu}_{\theta(\mathbf{s},\mathbf{c})} denotes the logits of Bernoulli distribution and θ𝜃\theta denotes the parameters of deconvolutional neural network. + +Generally, latent variable generative models are usually trained by maximizing the marginal log-likelihood, but it is often intractable to implement the optimization directly. To address this issue, variational inference Wainwright et al. (2008) can be applied by optimizing a variational lower bound parameterized with qϕ​(𝐳|𝐱)subscript𝑞italic-ϕconditional𝐳𝐱q_{\phi}(\mathbf{z}|\mathbf{x}) instead of the log-likelihood. + +In our Chinese character generation task, the style and content of Chinese characters are independent as in Eq.(1). Meanwhile, the content code 𝐜𝐜\mathbf{c} can be obtained by the well-trained 𝒞𝒞\mathcal{C}. Therefore, we can get the conditional variational lower bound of vanilla VAE:log⁡pθ​(𝐱|𝐜)≥subscript𝑝𝜃conditional𝐱𝐜absent\displaystyle\log p_{\theta}(\mathbf{x}|\mathbf{c})\geqlogpθ(𝐱|𝐜)−𝕂𝕃[qϕ(𝐬|𝐱,𝐜)∥pθ(𝐬|𝐱,𝐜)]\displaystyle\log p_{\theta}(\mathbf{x}|\mathbf{c})-\mathds{KL}\left[q_{\phi}(\mathbf{s|x,c})\|p_{\theta}(\mathbf{s|x,c})\right]=\displaystyle=ℒE​L​B​O​(𝐱;𝐜,θ,ϕ),subscriptℒ𝐸𝐿𝐵𝑂𝐱𝐜𝜃italic-ϕ\displaystyle\mathcal{L}_{ELBO}(\mathbf{x};\mathbf{c},\theta,\phi),(8)where 𝕂​𝕃𝕂𝕃\mathds{KL} denotes the Kullback Leibler Divergence and pθ​(𝐬|𝐱,𝐜)subscript𝑝𝜃conditional𝐬𝐱𝐜p_{\theta}(\mathbf{s|x,c}) is the true posterior from the generative model. + +However, directly optimizing the Eq. (2.3) cannot ensure that characters with the same font share a similar style embedding. This is because the vanilla variational inference treats each character separately and there is no strong correlation between different characters, especially those with the same style.Hence, we propose a new objective of intercross pairwise optimization, which is still a lower bound of the log-likelihood. Instead of reconstructing the input as in the vanilla VAE, we try to produce the target character based on two characters with the same style information but different contents, that is to say, the generated character obtains the style information by another character with the same style, as is illustrated in Fig. 4. + +Specifically, we consider a pair of characters (𝐱,𝐱′)𝐱superscript𝐱′(\mathbf{x},\mathbf{x}^{\prime}), which share the same style 𝐬𝐬\mathbf{s} but with different contents 𝐜𝐜\mathbf{c} and 𝐜′superscript𝐜′\mathbf{c}^{\prime}. We define the objective function asℒ~(𝐱,𝐱′,\displaystyle\tilde{\mathcal{L}}(\mathbf{x},\mathbf{x}^{\prime},𝐜,𝐜′;θ,ϕ)\displaystyle\mathbf{c},\mathbf{c}^{\prime};\theta,\phi)=\displaystyle=logpθ(𝐱|𝐜)−𝕂𝕃[qϕ(𝐬|𝐱′,𝐜′)∥pθ(𝐬|𝐱,𝐜)].\displaystyle\log p_{\theta}(\mathbf{x}|\mathbf{c})-\mathds{KL}[q_{\phi}(\mathbf{s}|\mathbf{x^{\prime}},\mathbf{c^{\prime}})\|p_{\theta}(\mathbf{s}|\mathbf{x},\mathbf{c})].(9) + +By maximizing this objective, we can achieve the target of Eq.(6) which is the key point of disentanglement and one-shot inference. Specifically, from Eq.(9), we know that maximizing ℒ~~ℒ\tilde{\mathcal{L}} is equivalent to minimizing the 𝕂​𝕃𝕂𝕃\mathds{KL} term, since the data likelihood is invariant. Meanwhile, as we randomly sample the training pairs, the dual pairs will also appear. Hence, it simultaneously minimizes:𝕂𝕃[qϕ(𝐬|𝐱′,𝐜′)∥pθ(𝐬|𝐱,𝐜)],\displaystyle\mathds{KL}[q_{\phi}(\mathbf{s}|\mathbf{x^{\prime}},\mathbf{c^{\prime}})\|p_{\theta}(\mathbf{s}|\mathbf{x},\mathbf{c})],(10)𝕂𝕃[qϕ(𝐬|𝐱,𝐜)∥pθ(𝐬|𝐱′,𝐜′)].\displaystyle\mathds{KL}[q_{\phi}(\mathbf{s}|\mathbf{x},\mathbf{c})\|p_{\theta}(\mathbf{s}|\mathbf{x^{\prime}},\mathbf{c^{\prime}})].(11)With the assumption in Eq.(1), we know that the real posterior distribution of the style is identical for 𝐱𝐱\mathbf{x} and 𝐱′superscript𝐱′\mathbf{x^{\prime}}, that ispθ​(𝐬|𝐱,𝐜)=pθ​(𝐬|𝐱′,𝐜′).subscript𝑝𝜃conditional𝐬𝐱𝐜subscript𝑝𝜃conditional𝐬superscript𝐱′superscript𝐜′p_{\theta}(\mathbf{s}|\mathbf{x},\mathbf{c})=p_{\theta}(\mathbf{s}|\mathbf{x^{\prime}},\mathbf{c^{\prime}}).(12)Ideally, if two 𝕂​𝕃𝕂𝕃\mathds{KL} terms in Eq.(10) and Eq.(11) are optimized to zero, the point of equilibrium is arrived and Eq.(6) holds by substituting Eq.(12). Therefore, this derivation explains why our objective function can achieve a reliable disentanglement. + +Furthermore, this objective function can be rewritten as:ℒ~(𝐱,\displaystyle\tilde{\mathcal{L}}(\mathbf{x},𝐱′,𝐜,𝐜′;θ,ϕ)\displaystyle\mathbf{x}^{\prime},\mathbf{c},\mathbf{c}^{\prime};\theta,\phi)(13)=\displaystyle=𝔼qϕ​(𝐬|𝐱′,𝐜′)​[log⁡pθ​(𝐱|𝐬,𝐜)]−𝕂​𝕃​[qϕ​(𝐬|𝐱′,𝐜′)∥pθ​(𝐬)],subscript𝔼subscript𝑞italic-ϕconditional𝐬superscript𝐱′superscript𝐜′delimited-[]subscript𝑝𝜃conditional𝐱𝐬𝐜𝕂𝕃delimited-[]conditionalsubscript𝑞italic-ϕconditional𝐬superscript𝐱′superscript𝐜′subscript𝑝𝜃𝐬\displaystyle\mathds{E}_{q_{\phi}(\mathbf{s}|\mathbf{x^{\prime}},\mathbf{c^{\prime}})}[\log p_{\theta}(\mathbf{x}|\mathbf{s},\mathbf{c})]-\mathds{KL}[q_{\phi}(\mathbf{s}|\mathbf{x^{\prime}},\mathbf{c^{\prime}})\|p_{\theta}(\mathbf{s})], + +where pθ​(𝐬)subscript𝑝𝜃𝐬p_{\theta}(\mathbf{s}) denotes the prior distribution of 𝐬𝐬\mathbf{s}. This form is more explicit to derive our training algorithm, in which the first term means a reconstruction loss and the second term means a regularization.Note that our proposed intercross pair-wise optimization method is a general technique for two-factor disentanglement problems Tenenbaum andFreeman (1997), which is not only restricted in the task of stylized Chinese character generation. The details of the intercross pair-wise optimization is shown in Alg. 1. + +When testing with one-shot setting, we observe a new style with only one character, then we model other characters using the following way:p(𝐱i,1:n\displaystyle p(\mathbf{x}_{i,1:n}|𝐜1:n,𝐱i,j)=\displaystyle|\mathbf{c}_{1:n},\mathbf{x}_{i,j})=(14)∫\displaystyle\intpθ​(𝐱i,1:n|𝐜1:n,𝐬i)​qϕ​(𝐬i|𝐱i,j,T​[fη​(𝐱i,j)])​d​𝐬i,subscript𝑝𝜃conditionalsubscript𝐱:𝑖1𝑛subscript𝐜:1𝑛subscript𝐬𝑖subscript𝑞italic-ϕconditionalsubscript𝐬𝑖subscript𝐱𝑖𝑗𝑇delimited-[]subscript𝑓𝜂subscript𝐱𝑖𝑗𝑑subscript𝐬𝑖\displaystyle{p_{\theta}(\mathbf{x}_{i,1:n}|\mathbf{c}_{1:n},\mathbf{s}_{i})q_{\phi}(\mathbf{s}_{i}|\mathbf{x}_{i,j},T[f_{\eta}(\mathbf{x}_{i,j})])d{\mathbf{s}_{i}}},in which 𝐱i,jsubscript𝐱𝑖𝑗\mathbf{x}_{i,j} is the observed character as the style-provider, 𝐜jsubscript𝐜𝑗\mathbf{c}_{j} is the content code of 𝐱i,jsubscript𝐱𝑖𝑗\mathbf{x}_{i,j} which can be obtained from Content Recognition Network 𝒞𝒞\mathcal{C}, 𝐬isubscript𝐬𝑖\mathbf{s}_{i} is the new style embedding inferred by our Style Inference Network 𝒮𝒮\mathcal{S} from the character 𝐱i,jsubscript𝐱𝑖𝑗\mathbf{x}_{i,j}, 𝐜1:nsubscript𝐜:1𝑛\mathbf{c}_{1:n} means the content codes of characters we want to generate and 𝐱i,1:nsubscript𝐱:𝑖1𝑛\mathbf{x}_{i,1:n} are the target characters with the new style generated by Character Generation Network 𝒢𝒢\mathcal{G}. + +If we can observe a few more characters, which means testing with few-shot setting, we use the averaged embedding vectors:𝐬i^=1n​∑j=1n𝐬i(j),where ​𝐬i(j)∼qϕ​(𝐬i|𝐱i,j,𝐜j),formulae-sequence^subscript𝐬𝑖1𝑛superscriptsubscript𝑗1𝑛superscriptsubscript𝐬𝑖𝑗similar-towhere superscriptsubscript𝐬𝑖𝑗subscript𝑞italic-ϕconditionalsubscript𝐬𝑖subscript𝐱𝑖𝑗subscript𝐜𝑗\displaystyle\hat{\mathbf{s}_{i}}=\frac{1}{n}\sum_{j=1}^{n}\mathbf{s}_{i}^{(j)},\;\textrm{where }\mathbf{s}_{i}^{(j)}\sim q_{\phi}(\mathbf{s}_{i}|\mathbf{x}_{i,j},\mathbf{c}_{j}),(15)where j=1​…​n𝑗1…𝑛j=1...n with n𝑛n being the number of observed characters; 𝐱i,jsubscript𝐱𝑖𝑗\mathbf{x}_{i,j} are corresponding characters we observed and 𝐜jsubscript𝐜𝑗\mathbf{c}_{j} are the content code of 𝐱i,jsubscript𝐱𝑖𝑗\mathbf{x}_{i,j}. 𝐬i(j)superscriptsubscript𝐬𝑖𝑗\mathbf{s}_{i}^{(j)} are independent random variables correspondingly obey the posterior distribution qϕ​(𝐬𝐢|𝐱𝐢,𝐣,𝐜𝐣)subscript𝑞italic-ϕconditionalsubscript𝐬𝐢subscript𝐱𝐢𝐣subscript𝐜𝐣q_{\phi}({\mathbf{s_{i}}|\mathbf{x_{i,j}},\mathbf{c_{j}}}).With Eq.(6), we can get V​a​r​[𝐬i^]=1n​V​a​r​[𝐬i]𝑉𝑎𝑟delimited-[]^subscript𝐬𝑖1𝑛𝑉𝑎𝑟delimited-[]subscript𝐬𝑖{Var}[\hat{\mathbf{s}_{i}}]=\frac{1}{n}{Var}[\mathbf{s}_{i}],which means that we can obtain more stable estimation of the style information by averaging over multiple characters. + +In this section, we first introduce the dataset we build. Then we present the one-shot/few-shot generation results and present some experimental results to verify that our model has a strong ability of style generalization and disentanglement. Finally, we show the necessity and advantage of using the proposed encoding method with human knowledge. + +As our main purpose is to generalize over new styles based on learning sufficient support styles, we need to get enough styles for our model to learn. As no existing datasets satisfy our goal, we build a new one. The dataset consists of Chinese characters in 200 styles collected from the Internet. We randomly select 80%percent8080\% of these styles (i.e., 160 styles) to be used in the style-bank for our training and the rest 20%percent2020\% (i.e., 40 styles) to be used for test. We choose the most frequently used 3000 Chinese characters from each style in the style-bank to build our training set. + +Fig. 5 shows the one-shot and few-shot generation results. Both results are presented with a printing style and a handwritten style, which demonstrates that our model has a capacity of dealing with diverse styles. + +Meanwhile, we make a comparison with some baseline models of font style transfer (”Rewrite” Tian (2016), ”zi2zi” Tian (2017)) as shown in Table 3.2. As the former setting, our SA-VAE generates the new-stylized characters in the table by observing only one character. As for other methods, if the target style is in the training set (1000 samples used to train here), the results are close to ours. However, if the target style is new (unseen in the training stage) and the amount of style providers is small (10 characters with the new style used to finetune here), they hardly capture anything about the new style. Therefore, our SA-VAE presents a clear advantage in the one-shot/few-shot inference. + +The style generalization is the key point in our SA-VAE framework, which proves our model has a capacity of generalizing to a new style. To show that our model can achieve this goal, we do the interpolation between two disparate styles. Besides, we also find the nearest neighbors of our one-shot generalization results to show our method is not finding the most similar style in the training set. The results are shown in Fig. 6. + +Successfully disentangling the style information from the content information is another necessity to achieve one-shot generation with given styles. First, we show a qualitative experimental result as shown in Fig 7. We can see compared with our SA-VAE, the style embedding extracted without intercross pair-wise optimization method contains too much content information and leads to blurry results. + +Meanwhile, We also conduct a quantitative experiment. Based on the intuition that a pure style embedding should contain enough information to represent its style while little information to represent its content, we choose a simple classifier to do some auxiliary classification tasks using the style embeddings obtained by our intercross pair-wise optimization method and vanilla VAE’s method.To simplify the training, we only use 100 unique characters per style as the training data to conduct style classification and use 100 styles per character to conduct character content classification, then test the prediction accuracy over the rest of samples. The results are shown in Table 2. + +Both the qualitative and quantitative experiment results provide a strong proof that our intercross pair-wise optimization method has a powerful ability of disentanglement. + +Our encoding method with domain knowledge instead of the one-hot embedding provides a solution for the large dictionary issue of Chinese characters. To show the effectiveness of knowledge guidance, we compare the converge speed of three encoding methods – our content code, the one-hot embedding and the binary embedding. The results are shown in Fig. 8. + +Depending on the cost of expanding model capacity, the one-hot embedding may provide a comparable converge speed with our knowledgeable content code. However, this embedding method will make the model parameters exploded in a larger Chinese characters dictionary. The binary embedding consumes shorter length (⌈log2⁡N⌉subscript2𝑁\lceil\log_{2}{N}\rceil bits) , but it hardly converges to a meaningful result. + +We have presented a novel Style-Aware VAE framework, which achieves the stylized Chinese character generation by reading only one or a few characters. Our model disentangles the style information and the content information with the intercross pair-wise optimization method and shows a powerful one-shot or few-shot generalization ability with new styles. Experiments demonstrate the impressive generation results on characters of both printing and handwritten styles. \ No newline at end of file diff --git a/1712.06560v3.txt b/1712.06560v3.txt new file mode 100644 index 0000000000000000000000000000000000000000..a233f8492e052e35c83c625cb509db7a1536516a --- /dev/null +++ b/1712.06560v3.txt @@ -0,0 +1,87 @@ +In RL, an agent tries to learn to perform a sequence of actions in an environment that maximizes some notion of cumulative reward [1]. However, reward functions are often deceptive, and solely optimizing for reward without some mechanism to encourage intelligent exploration can lead to getting stuck in local optima and the agent failing to properly learn [2, 3, 1]. Unlike in supervised learning with deep neural networks (DNNs), wherein local optima are not thought to be a problem [4, 5], the training data in RL is determined by the actions an agent takes. If the agent greedily takes actions that maximize reward, the training data for the algorithm will be limited and it may not discover alternate strategies with larger payoffs (i.e. it can get stuck in local optima)[2, 3, 1]. Sparse reward signals can also be a problem for algorithms that only maximize reward, because at times there may be no reward gradient to follow. The possibility of deceptiveness and/or sparsity in the reward signal motivates the need for efficient and directed exploration, in which an agent is motivated to visit unexplored states in order to learn to accumulate higher rewards. Although deep RL algorithms have performed amazing feats in recent years [6, 7, 8], they have mostly done so despite relying on simple, undirected (aka dithering) exploration strategies, in which an agent hopes to explore new areas of its environment by taking random actions (e.g. epsilon-greedy exploration) [1]. + +A number of methods have been proposed to promote directed exploration in RL [9, 10], including recent methods that handle high-dimensional state spaces with DNNs. A common idea is to encourage an agent to visit states it has rarely or never visited (or take novel actions in those states). Methods proposed to track state (or state-action pair) visitation frequency include (1) approximating state visitation counts based on either auto-encoded latent codes of states [11] or pseudo-counts from state-space density models [12, 13], (2) learning a dynamics model that predicts future states (assuming predictions will be worse for rarely visited states/state-action pairs) [14, 15, 16], and (3) methods based on compression (novel states should be harder to compress) [9]. + +Those methods all count each state separately. A different approach to is to hand-design (or learn) an abstract, holistic description of an agent’s lifetime behavior, and then encourage the agent to exhibit different behaviors from those previously performed. That is the approach of novelty search (NS) [3] and quality diversity (QD) algorithms [17, 18, 19], which are described in detail below. Such algorithms are also interestingly different, and have different capabilities, because they perform exploration with a population of agents rather than a single agent (discussed in SI Sec. 6.2). NS and QD have shown promise with smaller neural networks on problems with low-dimensional input and output spaces [20, 17, 18, 19, 21, 22].Evolution strategies (ES) [23] was recently shown to perform well on high-dimensional deep RL tasks in a short amount of wall clock time by scaling well to many distributed computers.In this paper, for the first time, we study how these two types of algorithms can be hybridized with ES to scale them to deep neural networks and thus tackle hard, high-dimensional deep reinforcement learning problems, without sacrificing the speed/scalability benefits of ES. We first study NS, which performs exploration only (ignoring the reward function) to find a set of novel solutions [3]. We then investigate algorithms that balance exploration and exploitation, specifically novel instances of QD algorithms, which seek to produce a set of solutions that are both novel and high-performing [20, 17, 18, 19]. Both NS and QD are explained in detail in Sec. 3. + +ES directly searches in the parameter space of a neural network to find an effective policy. A team from OpenAI recently showed that ES can achieve competitive performance on many reinforcement learning (RL) tasks while offering some unique benefits over traditional gradient-based RL methods [24]. Most notably, ES is highly parallelizable, which enables near linear speedups in runtime as a function of CPU/GPU workers. For example, with hundreds of parallel CPUs, ES was able to achieve roughly the same performance on Atari games with the same DNN architecture in 1 hour as A3C did in 24 hours [24]. In this paper, we investigate adding NS and QD to ES only; in future work, we will investigate how they might be hybridized with Q-learning and policy gradient methods. We start with ES because (1) its fast wall-clock time allows rapid experimental iteration, and (2) NS and QD were originally developed as neuroevolution methods, making it natural to try them first with ES, which is also an evolutionary algorithm. + +Here we test whether encouraging novelty via NS and QD improves the performance of ES on sparse and/or deceptive control tasks. Our experiments confirm that NS-ES and two simple versions of QD-ES (NSR-ES and NSRA-ES) avoid local optima encountered by ES and achieve higher performance on tasks ranging from simulated robots learning to walk around a deceptive trap to the high-dimensional pixel-to-action task of playing Atari games. Our results add these new families of exploration algorithms to the RL toolbox, opening up avenues for studying how they can best be combined with RL algorithms, whether ES or others. + +Evolution strategies (ES) are a class of black box optimization algorithms inspired by natural evolution [23]: At every iteration (generation), a population of parameter vectors (genomes) is perturbed (mutated) and, optionally, recombined (merged) via crossover. The fitness of each resultant offspring is then evaluated according to some objective function (reward) and some form of selection then ensures that individuals with higher reward tend to produce offspring for the next generation. Many algorithms in the ES class differ in their representation of the population and methods of recombination; the algorithms subsequently referred to in this work belong to the class of Natural Evolution Strategies (NES) [25, 26]. NES represents the population as a distribution of parameter vectors θ𝜃\theta characterized by parameters ϕitalic-ϕ\phi: pϕ​(θ)subscript𝑝italic-ϕ𝜃p_{\phi}(\theta). Under a fitness function, f​(θ)𝑓𝜃f(\theta), NES seeks to maximize the average fitness of the population, 𝔼θ∼pϕ​[f​(θ)]subscript𝔼similar-to𝜃subscript𝑝italic-ϕdelimited-[]𝑓𝜃\mathbb{E}_{\theta\sim p_{\phi}}[f(\theta)], by optimizing ϕitalic-ϕ\phi with stochastic gradient ascent. + +Recent work from OpenAI outlines a version of NES applied to standard RL benchmark problems [24]. We will refer to this variant simply as ES going forward. In their work, a fitness function f​(θ)𝑓𝜃f(\theta) represents the stochastic reward experienced over a full episode of agent interaction, where θ𝜃\theta parameterizes the policy πθsubscript𝜋𝜃\pi_{\theta}.From the population distribution pϕtsubscript𝑝subscriptitalic-ϕ𝑡p_{\phi_{t}} , parameters θti∼𝒩​(θt,σ2​I)similar-tosubscriptsuperscript𝜃𝑖𝑡𝒩subscript𝜃𝑡superscript𝜎2𝐼\theta^{i}_{t}\sim\mathcal{N}(\theta_{t},\,\sigma^{2}I) are sampled and evaluated to obtain f​(θti)𝑓subscriptsuperscript𝜃𝑖𝑡f(\theta^{i}_{t}). In a manner similar to REINFORCE [27], θtsubscript𝜃𝑡\theta_{t} is updated using an estimate of approximate gradient of expected reward:∇ϕ𝔼θ∼ϕ​[f​(θ)]≈1n​∑i=1nf​(θti)​∇ϕlog⁡pϕ​(θti)subscript∇italic-ϕsubscript𝔼similar-to𝜃italic-ϕdelimited-[]𝑓𝜃1𝑛superscriptsubscript𝑖1𝑛𝑓subscriptsuperscript𝜃𝑖𝑡subscript∇italic-ϕsubscript𝑝italic-ϕsubscriptsuperscript𝜃𝑖𝑡\nabla_{\phi}\mathbb{E}_{\theta\sim\phi}[f(\theta)]\approx\frac{1}{n}\sum_{i=1}^{n}f(\theta^{i}_{t})\nabla_{\phi}\log p_{\phi}(\theta^{i}_{t})where n𝑛n is the number of samples evaluated per generation. Intuitively, NES samples parameters in the neighborhood of θtsubscript𝜃𝑡\theta_{t} and determines the direction in which θtsubscript𝜃𝑡\theta_{t} should move to improve expected reward. Since this gradient estimate has high variance, NES relies on a large n𝑛n for variance reduction. Generally, NES also evolves the covariance of the population distribution, but for the sake of fair comparison with Salimans et al. [24] we consider only static covariance distributions, meaning σ𝜎\sigma is fixed throughout training. + +To sample from the population distribution, Salimans et al. [24] apply additive Gaussian noise to the current parameter vector : θti=θt+σ​ϵisubscriptsuperscript𝜃𝑖𝑡subscript𝜃𝑡𝜎subscriptitalic-ϵ𝑖\theta^{i}_{t}=\theta_{t}+\sigma\epsilon_{i} where ϵi∼𝒩​(0,I)similar-tosubscriptitalic-ϵ𝑖𝒩0𝐼\epsilon_{i}\sim\mathcal{N}(0,\,I). Although θ𝜃\theta is high-dimensional, previous work has shown Gaussian parameter noise to have beneficial exploration properties when applied to deep networks [26, 28, 29]. The gradient is then estimated by taking a sum of sampled parameter perturbations weighted by their reward:∇θt𝔼ϵ∼𝒩​(0,I)​[f​(θt+σ​ϵ)]≈1n​σ​∑i=1nf​(θti)​ϵisubscript∇subscript𝜃𝑡subscript𝔼similar-toitalic-ϵ𝒩0𝐼delimited-[]𝑓subscript𝜃𝑡𝜎italic-ϵ1𝑛𝜎superscriptsubscript𝑖1𝑛𝑓subscriptsuperscript𝜃𝑖𝑡subscriptitalic-ϵ𝑖\nabla_{\theta_{t}}\mathbb{E}_{\epsilon\sim\mathcal{N}(0,\,I)}[f(\theta_{t}+\sigma\epsilon)]\approx\frac{1}{n\sigma}\sum_{i=1}^{n}f(\theta^{i}_{t})\epsilon_{i}To ensure that the scale of reward between domains does not bias the optimization process, we follow the approach of Salimans et al. [24] and rank-normalize f​(θti)𝑓subscriptsuperscript𝜃𝑖𝑡f(\theta^{i}_{t}) before taking the weighted sum. Overall, this NES variant exhibits performance on par with contemporary, gradient-based algorithms on difficult RL domains, including simulated robot locomotion and Atari environments [30]. + +Inspired by nature’s drive towards diversity, NS encourages policies to engage in notably different behaviors than those previously seen. The algorithm encourages different behaviors by computing the novelty of the current policy with respect to previously generated policies and then encourages the population distribution to move towards areas of parameter space with high novelty. NS outperforms reward-based methods in maze and biped walking domains, which possess deceptive reward signals that attract agents to local optima [3]. In this work, we investigate the efficacy of NS at the scale of DNNs by combining it with ES.In NS, a policy π𝜋\pi is assigned a domain-dependent behavior characterization b​(π)𝑏𝜋b(\pi) that describes its behavior. For example, in the case of a humanoid locomotion problem, b​(π)𝑏𝜋b(\pi) may be as simple as a two-dimensional vector containing the humanoid’s final {x,y}𝑥𝑦\{x,y\} location. Throughout training, every πθsubscript𝜋𝜃\pi_{\theta} evaluated adds b​(πθ)𝑏subscript𝜋𝜃b(\pi_{\theta}) to an archive set A𝐴A with some probability. A particular policy’s novelty N​(b​(πθ),A)𝑁𝑏subscript𝜋𝜃𝐴N(b(\pi_{\theta}),A) is then computed by selecting the k-nearest neighbors of b​(πθ)𝑏subscript𝜋𝜃b(\pi_{\theta}) from A𝐴A and computing the average distance between them:N​(θ,A)=N​(b​(πθ),A)=1|S|​∑j∈S‖b​(πθ)−b​(πj)‖2𝑁𝜃𝐴𝑁𝑏subscript𝜋𝜃𝐴1𝑆subscript𝑗𝑆subscriptnorm𝑏subscript𝜋𝜃𝑏subscript𝜋𝑗2N(\theta,A)=N(b(\pi_{\theta}),A)=\frac{1}{|{S}|}\sum_{j\in{S}}||{b(\pi_{\theta})-b(\pi_{j})}||_{2}S=k​N​N​(b​(πθ),A)𝑆𝑘𝑁𝑁𝑏subscript𝜋𝜃𝐴S=kNN(b(\pi_{\theta}),A)={b​(π1),b​(π2),…,b​(πk)}absent𝑏subscript𝜋1𝑏subscript𝜋2…𝑏subscript𝜋𝑘=\{b(\pi_{1}),b(\pi_{2}),...,b(\pi_{k})\}Above, the distance between behavior characterizations is calculated with an L​2𝐿2L2-norm, but any distance function can be substituted. Previously, NS has been implemented with a genetic algorithm [3]. We next explain how NS can now be combined with ES, to leverage the advantages of both. + +We use the ES optimization framework, described in Sec. 2.1, to compute and follow the gradient of expected novelty with respect to θtsubscript𝜃𝑡\theta_{t}. Given an archive A𝐴A and sampled parameters θti=θt+σ​ϵisubscriptsuperscript𝜃𝑖𝑡subscript𝜃𝑡𝜎subscriptitalic-ϵ𝑖\theta^{i}_{t}=\theta_{t}+\sigma\epsilon_{i}, the gradient estimate can be computed:∇θt𝔼ϵ∼𝒩​(0,I)​[N​(θt+σ​ϵ,A)|A]≈1n​σ​∑i=1nN​(θti,A)​ϵisubscript∇subscript𝜃𝑡subscript𝔼similar-toitalic-ϵ𝒩0𝐼delimited-[]conditional𝑁subscript𝜃𝑡𝜎italic-ϵ𝐴𝐴1𝑛𝜎superscriptsubscript𝑖1𝑛𝑁subscriptsuperscript𝜃𝑖𝑡𝐴subscriptitalic-ϵ𝑖\nabla_{\theta_{t}}\mathbb{E}_{\epsilon\sim\mathcal{N}(0,\,I)}[N(\theta_{t}+\sigma\epsilon,A)|A]\approx\frac{1}{{n}\sigma}\sum_{i=1}^{n}N(\theta^{i}_{t},A)\epsilon_{i}The gradient estimate obtained tells us how to change the current policy’s parameters θtsubscript𝜃𝑡\theta_{t} to increase the average novelty of our parameter distribution. We condition the gradient estimate on A, as the archive is fixed at the beginning of a given iteration and updated only at the end. We add only the behavior characterization corresponding to each θtsubscript𝜃𝑡\theta_{t}, as adding those for each sample θtisuperscriptsubscript𝜃𝑡𝑖\theta_{t}^{i} would inflate the archive and slow the nearest-neighbors computation. As more behavior characterizations are added to A𝐴A, the novelty landscape changes, resulting in commonly occurring behaviors becoming “boring." Optimizing for expected novelty leads to policies that move towards unexplored areas of behavior space. + +NS-ES could operate with a single agent that is rewarded for acting differently than its ancestors. However, to encourage additional diversity and get the benefits of population-based exploration described in SI Sec. 6.2, we can instead create a population of M𝑀M agents, which we will refer to as the meta-population. Each agent, characterized by a unique θmsuperscript𝜃𝑚\theta^{m}, is rewarded for being different from all prior agents in the archive (ancestors, other agents, and the ancestors of other agents), an idea related to that of Liu et al. [31], which optimizes for a distribution of M diverse, high-performing policies. We hypothesize that the selection of M𝑀M is domain dependent and that identifying which domains favor which regime is a fruitful area for future research. + +We initialize M𝑀M random parameter vectors and at every iteration select one to update. For our experiments, we probabilistically select which θmsuperscript𝜃𝑚\theta^{m} to advance from a discrete probability distribution as a function of θmsuperscript𝜃𝑚\theta^{m}’s novelty. Specifically, at every iteration, for a set of agent parameter vectors Π={θ1,θ2,…,θM}Πsuperscript𝜃1superscript𝜃2…superscript𝜃𝑀\Pi=\{\theta^{1},\theta^{2},...,\theta^{M}\}, we calculate each θmsuperscript𝜃𝑚\theta^{m}’s probability of being selected P​(θm)𝑃superscript𝜃𝑚P(\theta^{m}) as its novelty normalized by the sum of novelty across all policies:P​(θm)=N​(θm,A)∑j=1MN​(θj,A)𝑃superscript𝜃𝑚𝑁superscript𝜃𝑚𝐴superscriptsubscript𝑗1𝑀𝑁superscript𝜃𝑗𝐴P(\theta^{m})=\frac{N(\theta^{m},A)}{\sum_{j=1}^{M}N(\theta^{j},A)}(1)Having multiple, separate agents represented as independent Gaussians is a simple choice for the meta-population distribution. In future work, more complex sampling distributions that represent the multi-modal nature of meta-population parameter vectors could be tried. + +After selecting an individual m𝑚m from the meta-population, we compute the gradient of expected novelty with respect to m𝑚m’s current parameter vector, θtmsubscriptsuperscript𝜃𝑚𝑡\theta^{m}_{t}, and perform an update step accordingly:θt+1m←θtm+α​1n​σ​∑i=1nN​(θti,m,A)​ϵi←subscriptsuperscript𝜃𝑚𝑡1subscriptsuperscript𝜃𝑚𝑡𝛼1𝑛𝜎superscriptsubscript𝑖1𝑛𝑁superscriptsubscript𝜃𝑡𝑖𝑚𝐴subscriptitalic-ϵ𝑖\theta^{m}_{t+1}\leftarrow\theta^{m}_{t}+\alpha\frac{1}{n\sigma}\sum_{i=1}^{n}N(\theta_{t}^{i,m},A)\epsilon_{i}Where n𝑛n is the number of sampled perturbations to θtmsubscriptsuperscript𝜃𝑚𝑡\theta^{m}_{t}, α𝛼\alpha is the stepsize, and θii,m=θtm+σ​ϵisubscriptsuperscript𝜃𝑖𝑚𝑖subscriptsuperscript𝜃𝑚𝑡𝜎subscriptitalic-ϵ𝑖\theta^{i,m}_{i}=\theta^{m}_{t}+\sigma\epsilon_{i}, where ϵi∼𝒩​(0,I)similar-tosubscriptitalic-ϵ𝑖𝒩0𝐼\epsilon_{i}\sim\mathcal{N}(0,\,I). Once the current parameter vector is updated, b​(πθt+1m)𝑏subscript𝜋subscriptsuperscript𝜃𝑚𝑡1b(\pi_{\theta^{m}_{t+1}}) is computed and added to the shared archive A𝐴A. The whole process is repeated for a pre-specified number of iterations, as there is no true convergence point of NS. During training, the algorithm preserves the policy with the highest average episodic reward and returns this policy once training is complete. Although Salimans et al. [24] return only the final policy after training with ES, the ES experiments in this work return the best-performing policy to facilitate fair comparison with NS-ES. Algorithm 1 in SI Sec. 6.5 outlines a simple, parallel implementation of NS-ES. It is important to note that the addition of the archive and the replacement of the fitness function with novelty does not damage the scalability of the ES optimization procedure (SI Sec. 6.4). + +NS-ES alone can enable agents to avoid deceptive local optima in the reward function. Reward signals, however, are still very informative and discarding them completely may cause performance to suffer. Consequently, we train a variant of NS-ES, which we call NSR-ES, that combines the reward (“fitness") and novelty calculated for a given set of policy parameters θ𝜃\theta. Similar to NS-ES and ES, NSR-ES operates on entire episodes and can thus evaluate reward and novelty simultaneously for any sampled parameter vector: θti,m=θtm+ϵisubscriptsuperscript𝜃𝑖𝑚𝑡subscriptsuperscript𝜃𝑚𝑡subscriptitalic-ϵ𝑖\theta^{i,m}_{t}=\theta^{m}_{t}+\epsilon_{i}. Specifically, we compute f​(θti,m)𝑓superscriptsubscript𝜃𝑡𝑖𝑚f(\theta_{t}^{i,m}) and N​(θti,m,A)𝑁superscriptsubscript𝜃𝑡𝑖𝑚𝐴N(\theta_{t}^{i,m},A), average the two values, and set the average as the weight for the corresponding ϵisubscriptitalic-ϵ𝑖\epsilon_{i}. The averaging process is integrated into the parameter update rule as:θt+1m←θtm+α​1n​σ​∑i=1nf​(θti,m)+N​(θti,m,A)2​ϵi←subscriptsuperscript𝜃𝑚𝑡1subscriptsuperscript𝜃𝑚𝑡𝛼1𝑛𝜎superscriptsubscript𝑖1𝑛𝑓superscriptsubscript𝜃𝑡𝑖𝑚𝑁superscriptsubscript𝜃𝑡𝑖𝑚𝐴2subscriptitalic-ϵ𝑖\theta^{m}_{t+1}\leftarrow\theta^{m}_{t}+\alpha\frac{1}{n\sigma}\sum_{i=1}^{n}\frac{f(\theta_{t}^{i,m})+N(\theta_{t}^{i,m},A)}{2}\epsilon_{i}Intuitively, the algorithm follows the approximated gradient in parameter-space towards policies that both exhibit novel behaviors and achieve high rewards. Often, however, the scales of f​(θ)𝑓𝜃f(\theta) and N​(θ,A)𝑁𝜃𝐴N(\theta,A) differ. To combine the two signals effectively, we rank-normalize f​(θti,m)𝑓superscriptsubscript𝜃𝑡𝑖𝑚f(\theta_{t}^{i,m}) and N​(θti,m,A)𝑁superscriptsubscript𝜃𝑡𝑖𝑚𝐴N(\theta_{t}^{i,m},A) independently before computing the average. Optimizing a linear combination of novelty and reward was previously explored in Cuccu and Gomez [32] and Cuccu et al. [33], but not with large neural networks on high-dimensional problems. The result of NSR-ES is a set of M𝑀M agents being optimized to be both high-performing, yet different from each other. + +NSR-ES has an equal weighting of the performance and novelty gradients that is static across training. We explore a further extension of NSR-ES called NSRAdapt-ES (NSRA-ES), which takes advantage of the opportunity to dynamically weight the priority given to the performance gradient f​(θti,m)𝑓superscriptsubscript𝜃𝑡𝑖𝑚f(\theta_{t}^{i,m}) vs. the novelty gradient N​(θti,m,A)𝑁superscriptsubscript𝜃𝑡𝑖𝑚𝐴N(\theta_{t}^{i,m},A) by intelligently adapting a weighting parameter w𝑤w during training.By doing so, the algorithm can follow the performance gradient when it is making progress, increasingly try different things if stuck in a local optimum, and switch back to following the performance gradient once unstuck.For a specific w𝑤w at a given generation, the parameter update rule for NSRA-ES is expressed as follows:θt+1m←θtm+α​1n​σ​∑i=1nw​f​(θti,m)​ϵi+(1−w)​N​(θti,m,A)​ϵi←subscriptsuperscript𝜃𝑚𝑡1subscriptsuperscript𝜃𝑚𝑡𝛼1𝑛𝜎superscriptsubscript𝑖1𝑛𝑤𝑓superscriptsubscript𝜃𝑡𝑖𝑚subscriptitalic-ϵ𝑖1𝑤𝑁superscriptsubscript𝜃𝑡𝑖𝑚𝐴subscriptitalic-ϵ𝑖\theta^{m}_{t+1}\leftarrow\theta^{m}_{t}+\alpha\frac{1}{n\sigma}\sum_{i=1}^{n}wf(\theta_{t}^{i,m})\epsilon_{i}+(1-w)N(\theta_{t}^{i,m},A)\epsilon_{i}We set w=1.0𝑤1.0w=1.0 initially and decrease itif performance stagnates across a fixed number of generations. We continue decreasing w𝑤w until performance increases, at which point we increase w𝑤w. While many previous works have adapted exploration pressure online by learning the amount of noise to add to the parameters [28, 25, 26, 34], such approaches rest on the assumption that an increased amount of parameter noise leads to increased behavioral diversity, which is often not the case (e.g. too much noise may lead to degenerate policies) [20]. Here we directly adapt the weighting between behavioral diversity and performance, which more directly controls the trade-off of interest. SI Sec. 6.5 provides a more detailed description of how we adapt w𝑤w as well as pseudocode for NSR-ES and NSRA-ES. Source code and hyperparameter settings for our experiments can be found here: https://github.com/uber-research/deep-neuroevolution + +We first tested our implementation of NS-ES, NSR-ES, and NSRA-ES on the problem of having a simulated humanoid learn to walk. We chose this problem because it is a challenging continuous control benchmark where most would presume a reward function is necessary to solve the problem. With NS-ES, we test whether searching through novelty alone can find solutions to the problem. A similar result has been shown for much smaller neural networks (∼similar-to\mathtt{\sim}50-100 parameters) on a more simple simulated biped [20], but here we test whether NS-ES can enable locomotion at the scale of deep neural networks on a much more sophisticated environment. NSR-ES and NSRA-ES experiments then test the effectiveness of combining exploration and reward pressures on this difficult continuous control problem. SI Sec. 6.7 outlines complete experimental details. + +The first environment is in a slightly modified version of OpenAI Gym’s Humanoid-v1 environment. Because the heart of this challenge is to learn to walk efficiently, not to walk in a particular direction, we modified the environment reward to be isotropic (i.e. indifferent to the direction the humanoid traveled) by setting the velocity component of reward to distance traveled from the origin as opposed to distance traveled in the positive x𝑥x direction. + +As described in section 2.2, novelty search requires a domain-specific behavior characterization (BC) for each policy, which we denote as b​(πθi)𝑏subscript𝜋subscript𝜃𝑖b(\pi_{\theta_{i}}). For the Humanoid Locomotion problem the BC is the agent’s final {x,y}𝑥𝑦\{x,y\} location, as it was in Lehman and Stanley [20]. NS also requires a distance function between two BCs. Following Lehman and Stanley [20], the distance function is the square of the Euclidean distance:d​i​s​t​(b​(πθi),b​(πθj))=‖b​(πθi)−b​(πθj)‖22𝑑𝑖𝑠𝑡𝑏subscript𝜋subscript𝜃𝑖𝑏subscript𝜋subscript𝜃𝑗superscriptsubscriptnorm𝑏subscript𝜋subscript𝜃𝑖𝑏subscript𝜋subscript𝜃𝑗22dist(b(\pi_{\theta_{i}}),b(\pi_{\theta_{j}}))=||b(\pi_{\theta_{i}})-b(\pi_{\theta_{j}})||_{2}^{2}The first result is that ES obtains a higher final reward than NS-ES (p<0.05𝑝0.05p<0.05) and NSR-ES (p<0.05𝑝0.05p<0.05); these and all future p𝑝p values are calculated via a Mann-Whitney U test. The performance gap is more pronounced for smaller amounts of computation (Fig. 1 (c)). However, many will be surprised that NS-ES is still able to consistently solve the problem despite ignoring the environment’s reward function. While the BC is aligned [35] with the problem in that reaching new {x,y}𝑥𝑦\{x,y\} positions tends to also encourage walking, there are many parts of the reward function that the BC ignores (e.g. energy-efficiency, impact costs). + +We hypothesize that with a sophisticated BC that encourages diversity in all of the behaviors the multi-part reward function cares about, there would be no performance gap. However, such a BC may be difficult to construct and would likely further exaggerate the amount of computation required for NS to match ES. NSR-ES demonstrates faster learning than NS-ES due to the addition of reward pressure, but ultimately results in similar final performance after 600 generations (p>0.05𝑝0.05p>0.05, Fig. 1 (c)). Promisingly, on this non-deceptive problem, NSRA-ES does not pay a cost for its latent exploration capabilities and performs similarly to ES (p>0.05𝑝0.05p>0.05). + +The Humanoid Locomotion problem does not appear to be a deceptive problem, at least for ES. To test whether NS-ES, NSR-ES, and NSR-ES specifically help with deception, we also compare ES to these algorithms on a variant of this environment we created that adds a deceptive trap (a local optimum) that must be avoided for maximum performance (Fig.  1 (b)). In this new environment, a small three-sided enclosure is placed at a short distance in front of the starting position of the humanoid and the reward function is simply the distance traveled in the positive x𝑥x direction. + +Fig. 1 (d) and SI Sec. 6.8 show the reward received by each algorithm and Fig. 2 shows how the algorithms differ qualitatively during search on this problem. In every run, ES gets stuck in the local optimum due to following reward into the deceptive trap. NS-ES is able to avoid the local optimum as it ignores reward completely and instead seeks to thoroughly explore the environment, but doing so also means it makes slow progress according to the reward function. NSR-ES demonstrates superior performance to NS-ES (p<0.01𝑝0.01p<0.01) and ES (p<0.01𝑝0.01p<0.01) as it benefits from both optimizing for reward and escaping the trap via the pressure for novelty. Like ES, NSRA-ES learns to walk into the deceptive trap initially, as it initially is optimizing for reward only. Once stuck in the local optimum, the algorithm continually increases its pressure for novelty, allowing it to escape the deceptive trap and ultimately achieve much higher rewards than NS-ES (p<0.01𝑝0.01p<0.01) and NSR-ES (p<0.01𝑝0.01p<0.01). Based just on these two domains, NSRA-ES seems to be the best algorithm across the board because it can exploit well when there is no deception, add exploration dynamically when there is, and return to exploiting once unstuck. The latter is likely why NSRA-ES outperforms even NSR-ES on the deceptive humanoid locomotion problem. + +Fig. 2 also shows the benefit of maintaining a meta-population (M=5𝑀5M=5) in the NS-ES, NSR-ES, and NSRA-ES algorithms. Some lineages get stuck in the deceptive trap, incentivizing other policies to explore around the trap. At that point, all three algorithms begin to allocate more computational resources to this newly discovered, more promising strategy via the probabilistic selection method outlined in Sec. 3.1. Both the novelty pressure and having a meta-population thus appear to be useful, but in future work we look to disambiguate the relative contribution made by each. + +We also tested NS-ES, NSR-ES, and NSRA-ES on numerous games from the Atari 2600 environment in OpenAI Gym [36]. Atari games serve as an informative benchmark due to their high-dimensional pixel input and complex control dynamics; each game also requires different levels of exploration to solve. To demonstrate the effectiveness of NS-ES, NSR-ES, and NSRA-ES for local optima avoidance and directed exploration, we tested on 12 different games with varying levels of complexity, as defined by the taxonomy in Bellemare et al. [12]. Primarily, we focused on games in which, during preliminary experiments, we observed ES prematurely converging to local optima (Seaquest, Q*Bert, Freeway, Frostbite, and Beam Rider). However, we also included a few other games where ES did not converge to local optima to understand the performance of our algorithm in less-deceptive domains (Alien, Amidar, Bank Heist, Gravitar, Zaxxon, and Montezuma’s Revenge). SI Sec. 6.6 describes additional experimental details. We report the median reward across 5 independent runs of the best policy found in each run (see Table 1). + +For the behavior characterization, we follow an idea from Naddaf [37] and concatenate Atari game RAM states for each timestep in an episode. RAM states in Atari 2600 games are integer-valued vectors of length 128 in the range [0, 255] that describe all the state variables in a game (e.g. the location of the agent and enemies). Ultimately, we want to automatically learn behavior characterizations directly from pixels. A plethora of recent research suggests that this is a viable approach [38, 39, 12]. For example, low-dimensional, latent representations of the state space could be extracted from auto-encoders [11, 40] or networks trained to predict future states [16, 14]. In this work, however, we focus on learning with a pre-defined, informative behavior characterization and leave the task of jointly learning a policy and latent representation of states for future work. In effect, basing novelty on RAM states provides a confirmation of what is possible in principle with a sufficiently informed behavior characterization. We also emphasize that, while during training NS-ES, NSR-ES, and NSRA-ES use RAM states to guide novelty search, the policy itself, πθtsubscript𝜋subscript𝜃𝑡\pi_{\theta_{t}}, operates only on image input and can be evaluated without any RAM state information.The distance between behavior characterizations is the sum of L2-distances at each timestep t𝑡t:dist(b(πθi),b(πθj))=∑t=1T||(bt(πθi))−bt(πθj))||2dist(b(\pi_{\theta_{i}}),b(\pi_{\theta_{j}}))=\sum_{t=1}^{T}||(b_{t}(\pi_{\theta_{i}}))-b_{t}(\pi_{\theta_{j}}))||_{2}For trajectories of different lengths, the last state of the shorter trajectory is repeated until the lengths of both match. Because the BC distance is not normalized by trajectory length, novelty is biased to be higher for longer trajectories. In some Atari games, this bias can lead to higher performing policies, but in other games longer trajectories tend to have a neutral or even negative relationship with performance. In this work we found it beneficial to keep novelty unnormalized, but further investigation into different BC designs could yield additional improvements. + +Table 1 compares the performance of each algorithm discussed above to each other and with those from two popular methods for exploration in RL, namely Noisy DQN [29] and A3C+ [12]. Noisy DQN and A3C+ only outperform all the ES variants considered in this paper on 3/12 games and 2/12 games respectively. NSRA-ES, however, outperforms the other algorithms on 5/12 games, suggesting that NS and QD are viable alternatives to contemporary exploration methods. + +While the novelty pressure in NS-ES does help it avoid local optima in some cases (discussed below), optimizing for novelty alone does not result in higher reward in most games (although it does in some). However, it is surprising how well NS-ES does in many tasks given that it is not explicitly attempting to increase reward. Because NSR-ES combines exploration with reward maximization, it is able to avoid local optima encountered by ES while also learning to play the game well. In each of the 5 games in which we observed ES converging to premature local optima (i.e. Seaquest, Q*Bert, Freeway, Beam Rider, Frostbite), NSR-ES achieves a higher median reward. In the other games, ES does not benefit from adding an exploration pressure and NSR-ES performs worse. It is expected that if there are no local optima and reward maximization is sufficient to perform well, the extra cost of encouraging exploration will hurt performance. Mitigating such costs, NSRA-ES optimizes solely for reward until a performance plateau is reached. After that, the algorithm will assign more weight to novelty and thus encourage exploration. We found this to be beneficial, as NSRA-ES achieves higher median rewards than ES on 8/12 games and NSR-ES on 9/12 games. It’s superior performance validates NSRA-ES as the best among the evolutionary algorithms considered and suggests that using an adaptive weighting between novelty and reward is a promising direction for future research. + +In the game Seaquest, the avoidance of local optima is particularly important (Fig. 3). ES performance flatlines early at a median reward of 960, which corresponds to a behavior of the agent descending to the bottom, shooting fish, and never coming up for air. This strategy represents a classic local optima, as coming up for air requires temporarily foregoing reward, but enables far higher rewards to be earned in the long run (Salimans et al. [24] did not encounter this particular local optimum with their hyperparameters, but the point is that ES without exploration can get stuck indefinitely on whichever major local optima it encounters). NS-ES learns to come up for air in all 5 runs and achieves a slightly higher median reward of 1044.5 (p<0.05𝑝0.05p<0.05). NSR-ES also avoids this local optimum, but its additional reward signal helps it play the game better (e.g. it is better at shooting enemies), resulting in a significantly higher median reward of 2329.7 (p<0.01𝑝0.01p<0.01). Because NSRA-ES takes reward steps initially, it falls into the same local optimum as ES. Because we chose (without performing a hyperparameter search) to change the weighting w𝑤w between performance and novelty infrequently (only every 50 generations), and to change it by a small amount (only 0.05), 200 generations was not long enough to emphasize novelty enough to escape this local optimum. We found that by changing w𝑤w every 10 generations, this problem is remedied and the performance of NSRA-ES equals that of NSR-ES (p>0.05𝑝0.05p>0.05, Fig. 3). These results motivate future research into better hyperparameters for changing w𝑤w, and into more complex, intelligent methods of dynamically adjusting w𝑤w, including with a population of agents with different dynamic w𝑤w strategies. + +The Atari results illustrate that NS is an effective mechanism for encouraging directed exploration, given an appropriate behavior characterization, for complex, high-dimensional control tasks. A novelty pressure alone produces impressive performance on many games, sometimes even beating ES. Combining novelty and reward performs far better, and improves ES performance on tasks where it appears to get stuck on local optima. + +NS and QD are classes of evolutionary algorithms designed to avoid local optima and promote exploration in RL environments, but have only been previously shown to work with small neural networks (on the order of hundreds of connections). ES was recently shown to be capable of training deep neural networks that can solve challenging, high-dimensional RL tasks [24]. It also is much faster when many parallel computers are available. Here we demonstrate that, when hybridized with ES, NS and QD not only preserve the attractive scalability properties of ES, but also help ES explore and avoid local optima in domains with deceptive reward functions. To the best of our knowledge, this paper reports the first attempt at augmenting ES to perform directed exploration in high-dimensional environments. We thus provide an option for those interested in taking advantage of the scalability of ES, but who also want higher performance on domains that have reward functions that are sparse or have local optima. The latter scenario will likely hold for most challenging, real-world domains that machine learning practitioners will wish to tackle in the future. + +Additionally, this work highlights alternate options for exploration in RL domains. The first is to holistically describe the behavior of an agent instead of defining a per-state exploration bonus. The second is to encourage a population of agents to simultaneously explore different aspects of an environment. These new options thereby open new research areas into (1) comparing holistic vs. state-based exploration, and population-based vs. single-agent exploration, more systematically and on more domains, (2) investigating the best way to combine the merits of all of these options, and (3) hybridizing holistic and/or population-based exploration with other algorithms that work well on deep RL problems, such as policy gradients and DQN. It should be relatively straightforward to combine NS with policy gradients (NS-PG). It is less obvious how to combine it with Q-learning (NS-Q), but may be possible. + +As with any exploration method, encouraging novelty can come at a cost if such an exploration pressure is not necessary. In Atari games such as Alien and Gravitar, and in the Humanoid Locomotion problem without a deceptive trap, both NS-ES and NSR-ES perform worse than ES. To avoid this cost, we introduce the NSRA-ES algorithm, which attempts to invest in exploration only when necessary. NSRA-ES tends to produce better results than ES, NS-ES, and NSR-ES across many different domains, making it an attractive new algorithm for deep RL tasks. Similar strategies for adapting the amount of exploration online may also be advantageous for other deep RL algorithms. How best to dynamically balance between exploitation and exploration in deep RL remains an open, critical research challenge, and our work underscores the importance of, and motivates further, such work. Overall, our work shows that ES is a rich and unexploited parallel path for deep RL research. It is worthy of exploring not only because it is an alternative algorithm for RL problems, but also because innovations created in the ES family of algorithms could be ported to improve other deep RL algorithm families like policy gradients and Q learning, or through hybrids thereof. + +We thank all of the members of Uber AI Labs, in particular Thomas Miconi, Rui Wang, Peter Dayan, John Sears, Joost Huizinga, and Theofanis Karaletsos, for helpful discussions. We also thank Justin Pinkul, Mike Deats, Cody Yancey, Joel Snow, Leon Rosenshein and the entire OpusStack Team inside Uber for providing our computing platform and for technical support. + +Videos of example agent behavior in all the environments can be viewed here: https://goo.gl/cVUG2U. + +As mentioned in the introduction, aside from being holistic vs. state-based, there is another interesting difference between most exploration methods for RL [12, 13, 14, 15, 16] and the NS/QD family of algorithms. We do not investigate the benefits of this difference experimentally in this paper, but they are one reason we are interested in NS/QD as an exploration method for RL. One commonality among the previous methods is that the exploration is performed by a single agent, a choice that has interesting consequences for learning. To illustrate these consequences, we borrow an example from Stanton and Clune [41]. Imagine a cross-shaped maze (Fig. 4) where to go in each cardinal direction an agent must master a different skill (e.g. going north requires learning to swim, west requires climbing mountains, east requires walking on sand, and south requires walking on ice). Assume rewards may or may not exist at the end of each corridor, so all corridors need to be explored. A single agent has two extreme options, either a depth-first search that serially learns to go to the end of each corridor, or a breadth-first search that goes a bit further in one direction, then comes back to the center and goes a bit further in another direction, etc. Either way, to get to the end of each hallway, the agent will have to at least have traversed each hallway once and thus will have to learn all four sets of skills. With the breadth-first option, all four skillsets must be mastered, but a much longer total distance is traveled. + +In both cases, another problem arises because, despite recent progress [43, 44], neural networks still suffer from catastrophic forgetting, meaning that as they learn new skills they rapidly lose the ability to perform previously learned ones [45]. Due to catastrophic forgetting, at the end of learning there will be an agent specialized in one of the skills (e.g. swimming), but all of the other skills will have been lost. Furthermore, if any amount of the breadth-first search strategy is employed, exploring each branch a bit further will require relearning that skill mostly from scratch each iteration, significantly slowing exploration. Even if catastrophic forgetting could be solved, there may be limits on the cognitive capacity of single agents (as occurs in humans), preventing one agent from mastering all possible skills. + +A different approach is to explore with a population of agents. In that case, separate agents could become experts in the separate tasks required to explore in each direction. That may speed learning because each agent can, in parallel, learn only the skills required for its corridor. Additionally, at the end of exploration a specialist will exist with each distinct skill (versus only one skill remaining in the single-agent case). The resulting population of specialists, each with a different skill or way of solving a problem, can then be harnessed by other machine learning algorithms that efficiently search through the repertoire of specialists to find the skill or behavior needed in a particular situation [17, 46]. The skills of each specialist (in any combination or number) could also then be combined into a single generalist via policy distillation [47]. A further benefit of the population-based approach is, when combining exploration with some notion of quality (e.g. maximizing reward), a population can try out many different strategies/directions and, once one or a few promising strategies are found, the algorithm can reallocate resources to pursue them. The point is not that population-based exploration methods are better or worse than single-agent exploration methods (when holding computation constant), but instead that they are a different option with different capabilities, pros, and cons, and are thus worth investigating [41]. Supporting this view, recent work has demonstrated the benefits of populations for deep learning [48, 49]. + +Although optimizing for novelty can be a useful exploration signal for RL agents, the efficacy of optimizing for novelty is determined by the choice of behavior characterization (BC). Often, a BC can be difficult to specify for complex environments, for which the principal axes of effective exploration cannot be enumerated. However, choosing an informative BC, like choosing an informative reward function, is a useful way to inject domain knowledge to induce specific agent behavior. In cases where designing the BC is cumbersome, methods do exist to systematically derive or learn them [50, 51]. The Atari results for NSR-ES and NSRA-ES also suggest that even if the BC is not selected carefully for the domain (the RAM state was not designed to be a BC, and thus being diverse in some RAM state dimensions does not lead to fruitful exploration), novelty with respect to the BC is still a useful exploration signal when combined with reward. Although determining appropriate BCs is out of the scope of this work, we believe it is fruitful to investigate the effect of BC choice on exploration in future work and that doing so may further improve performance. + +As shown in Salimans et al. [24], ES scales well with the amount of computation available. Specifically, as more CPUs are used, training times reduce almost linearly, whereas DQN and A3C are not amenable to massive parallelization. NS-ES, NSR-ES and NSRA-ES, however, enjoy the same parallelization benefits as ES because they use an almost identical optimization process. The addition of an archive between agents in the meta-population does not hurt scalability because A𝐴A is only updated after θtmsubscriptsuperscript𝜃𝑚𝑡\theta^{m}_{t} has been updated. Since A𝐴A is kept fixed during the calculation of N​(θti,m,A)𝑁superscriptsubscript𝜃𝑡𝑖𝑚𝐴N(\theta_{t}^{i,m},A) and f​(θti,m)𝑓subscriptsuperscript𝜃𝑖𝑚𝑡f(\theta^{i,m}_{t}) for all i=1​…​n𝑖1…𝑛i=1...n perturbations, the coordinator only needs to broadcast A𝐴A once at the beginning of each generation. In all algorithms, the parameter vector θtisubscriptsuperscript𝜃𝑖𝑡\theta^{i}_{t} must be broadcast at the beginning of each generation and since A𝐴A generally takes up much less memory than the parameter vector, broadcasting both would incur effectively zero extra network overhead. NS-ES, NSR-ES, and NSRA-ES do however introduce an additional computation conducted on the coordinator node. At the start of every generation we must compute the novelty of each candidate θtm;m∈{1,…,M}subscriptsuperscript𝜃𝑚𝑡𝑚1…𝑀\theta^{m}_{t};m\in\{1,...,M\}. For an archive of length n𝑛n this operation is O​(M​n)𝑂𝑀𝑛O(Mn), but since M𝑀M is small and fixed throughout training this cost is not significant in practice. Additionally, there are methods for keeping the archive small if this computation becomes an issue [52]. + +For the NSRA-ES algorithm, we introduce 3 new hyperparameters: w𝑤w, twsubscript𝑡𝑤t_{w}, δwsubscript𝛿𝑤\delta_{w}. These quantities determine the agent’s preference for novelty or reward at various phases in training. For all of our experiments, w=1.0𝑤1.0w=1.0 initially, meaning that NSRA-ES initially follows the gradient of reward only. If the best episodic reward seen, fb​e​s​tsubscript𝑓𝑏𝑒𝑠𝑡f_{best}, does not increase in tw=50subscript𝑡𝑤50t_{w}=50 generations, w𝑤w is decreased by δw=0.05subscript𝛿𝑤0.05\delta_{w}=0.05 and gradients with respect to the new weighted average of novelty and reward are followed. The process is repeated until a new, higher fb​e​s​tsubscript𝑓𝑏𝑒𝑠𝑡f_{best} is found, at which point w𝑤w is increased by δwsubscript𝛿𝑤\delta_{w}. Intuitively the algorithm follows reward gradients until the increases in episodic reward plateau, at which point the agent is increasingly encouraged to explore. The agent will continue to explore until a promising behavior (i.e. one with higher reward than seen so far) is found. NSRA-ES then increases w𝑤w to pivot back towards exploitation instead of exploration. + +Following Salimans et al. [24], the network architecture for the Atari experiments consists of 2 convolutional layers (16 filters of size 8x8 with stride 4 and 32 filters of size 4x4 with stride 2) followed by 1 fully-connected layer with 256 hidden units, followed by a linear output layer with one neuron per action. The action space dimensionality can range from 3 to 18 for different games. ReLU activations are placed between all layers, right after virtual batch normalization units [53]. Virtual batch normalization is equivalent to batch normalization [54], except that the layer normalization statistics are computed from a reference batch chosen at the start of training. In our experiments, we collected a reference batch of size 128 at the start of training, generated by random agent gameplay. Without virtual batch normalization, Gaussian perturbations to the network parameters tend to lead to single-action policies. The lack of action diversity in perturbed policies cripples learning and leads to poor results [24]. + +The preprocessing is identical to that in Mnih et al. [7]. Each frame is downsampled to 84x84 pixels, after which it is converted to grayscale. The actual observation to the network is a concatenation of 4 subsequent frames and actions are executed with a frameskip of 4. Each episode of training starts with up to 30 random, no-operation actions (no-ops). Policies are also evaluated using a random number (sampled uniformly from 1-30) of no-op starts, whereas Mnih et al. [7] evaluates policies using starts randomly sampled from the initial portion of human expert trajectories (a dataset we do not have access to). + +For all experiments, we fixed the training hyperparameters for fair comparison. Each network is trained with the Adam optimizer [55] with a learning rate of η=10−2𝜂superscript102\eta=10^{-2} and a noise standard deviation of σ=0.02𝜎0.02\sigma=0.02. The number of samples drawn from the population distribution each generation was n=5000𝑛5000n=5000. For NS-ES, NSR-ES, and NSRA-ES we set M=3𝑀3M=3 as the meta-population size and k=10𝑘10k=10 for the nearest-neighbor computation, values that were both chosen through an informal hyperparameter search. We lowered M𝑀M because the Atari network is much larger and thus each generation is more computationally expensive. A lower M𝑀M enables more generations to occur in training. We trained ES, NS-ES, NSR-ES, and NSRA-ES for a the same number of generations T𝑇T for each game. The value of T𝑇T varies between 150 and 300 depending on the number of timesteps per episode of gameplay (i.e. games with longer episodes are trained for 150 generations and vice versa). The figures in SI Sec. 6.9 show how many generations of training occurred for each game. + +The domain is the MuJoCo Humanoid-v1 environment in OpenAI Gym [36].In it, a humanoid robot receives a scalar reward composed of four components per timestep. The robot gets positive reward for standing and velocity in the positive x𝑥x direction, and negative reward for ground impact energy and energy expended. These four components are summed across every timestep in an episode to get the total reward. Following the neural network architecture outlined by Salimans et al. [24], the neural network is a multilayer perceptron with two hidden layers containing 256 neurons each, resulting in a network with 166.7K parameters. While small (especially in the number of layers) compared to many deep RL architectures, this network is still orders of magnitude larger than what NS has been tried with before. The input to the network is the observation space from the environment, which is a vector ∈ℝ376absentsuperscriptℝ376\in\mathbb{R}^{376} representing the state of the humanoid (e.g. joint angles, velocities) and the output of the network is a vector of motor commands ∈ℝ17absentsuperscriptℝ17\in\mathbb{R}^{17} [36]. + +For all experiments, we fixed the training hyperparameters for fair comparison. Each network was trained with the Adam optimizer [55] with a learning rate of η=10−2𝜂superscript102\eta=10^{-2} and a noise standard deviation of σ=0.02𝜎0.02\sigma=0.02. The number of samples drawn from the population distribution each generation was n=10000𝑛10000n=10000. For NS-ES, NSR-ES, and NSRA-ES we set M=5𝑀5M=5 as the meta-population size and k=10𝑘10k=10 for the nearest-neighbor computation, values that were both chosen through an informal hyperparameter search. We trained ES, NS-ES, NSR-ES, and NSRA-ES for the same number of generations T𝑇T for each game. The value of T𝑇T is 600 for the Humanoid Locomotion problem and 800 for the Humanoid Locomotion with Deceptive Trap problem. \ No newline at end of file diff --git a/1712.06751v2.txt b/1712.06751v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..74ba40513a429968d1877f7c6b48fa38d28b2b63 --- /dev/null +++ b/1712.06751v2.txt @@ -0,0 +1,49 @@ +Adversarial examples are inputs to a predictive machine learning model that are maliciously designed to cause poor performance Goodfellow et al. (2015). Adversarial examples expose regions of the input space where the model performs poorly, which can aid in understanding and improving the model. By using these examples as training data, adversarial training learns models that are more robust, and may even perform better on non-adversarial examples. Interest in understanding vulnerabilities of NLP systems is growing Jia and Liang (2017); Zhao et al. (2018); Belinkov and Bisk (2018); Iyyer et al. (2018).Previous work has focused on heuristics for creating adversarial examples in the black-box setting, without any explicit knowledge of the model parameters. In the white-box setting, we use complete knowledge of the model to develop worst-case attacks, which can reveal much larger vulnerabilities. + +We propose a white-box adversary against differentiable text classifiers. We find that only a few manipulations are needed to greatly increase the misclassification error. Furthermore, fast generation of adversarial examples allows feasible adversarial training, which helps the model defend against adversarial examples and improve accuracy on clean examples.At the core of our method lies an atomic flip operation, which changes one token to another by using the directional derivatives of the model with respect to the one-hot vector input. + +Our contributions are as follows:1.We propose an efficient gradient-based optimization method to manipulate discrete text structure at its one-hot representation.2.We investigate the robustness of a classifier trained with adversarial examples, by studying its resilience to attacks and its accuracy on clean test data. + +Adversarial examples are powerful tools to investigate the vulnerabilities of a deep learning model Szegedy et al. (2014).While this line of research has recently received a lot of attention in the deep learning community, it has a long history in machine learning, going back to adversarial attacks on linear spam classifiers Dalvi et al. (2004); Lowd and Meek (2005).Hosseini et al. Hosseini et al. (2017) show that simple modifications, such as adding spaces or dots between characters, can drastically change the toxicity score from Google’s perspective API 111https://www.perspectiveapi.com.Belinkov and Bisk Belinkov and Bisk (2018) show that character-level machine translation systems are overly sensitive to random character manipulations, such as keyboard typos. They manipulate every word in a sentence with synthetic or natural noise. However, throughout our experiments, we care about the degree of distortion in a sentence, and look for stronger adversaries which can increase the loss within a limited budget. Instead of randomly perturbing text, we propose an efficient method, which can generate adversarial text using the gradients of the model with respect to the input. + +Adversarial training interleaves training with generation of adversarial examples Goodfellow et al. (2015).Concretely, after every iteration of training, adversarial examples are created and added to the mini-batches.A projected gradient-based approach to create adversarial examples by Madry et al. Madry et al. (2018) has proved to be one of the most effective defense mechanisms against adversarial attacks for image classification.Miyato et al. Miyato et al. (2017) create adversarial examples by adding noise to word embeddings, without creating real-world textual adversarial examples. Our work is the first to propose an efficient method to generate real-world adversarial examples which can also be used for effective adversarial training. + +HotFlip is a method for generating adversarial examples with character substitutions (“flips”). HotFlip also supports insertion and deletion operations by representing them as sequences of character substitutions. It uses the gradient with respect to a one-hot input representation to efficiently estimate which individual change has the highest estimated loss, and it uses a beam search to find a set of manipulations that work well together to confuse a classifier. + +We use J​(𝐱,𝐲)𝐽𝐱𝐲J(\mathbf{x},\mathbf{y}) to refer to the loss of the model on input 𝐱𝐱\mathbf{x} with true output 𝐲𝐲\mathbf{y}. For example, for classification, the loss would be the log-loss over the output of the softmax unit.Let V𝑉V be the alphabet, 𝐱𝐱\mathbf{x} be a text of length L𝐿L characters, and xi​j∈{0,1}|V|subscript𝑥𝑖𝑗superscript01𝑉x_{ij}\in\{0,1\}^{|V|} denote a one-hot vector representing the j𝑗j-th character of the i𝑖i-th word. The character sequence can be represented by𝐱𝐱\mathbf{x} = [(x11subscript𝑥11x_{11},.. x1​nsubscript𝑥1𝑛x_{1n});..(xm​1subscript𝑥𝑚1x_{m1},.. xm​nsubscript𝑥𝑚𝑛x_{mn})]wherein a semicolon denotes explicit segmentation between words. The number of words is denoted by m𝑚m, and n𝑛n is the number of maximum characters allowed for a word. + +We represent text operations as vectors in the input space and estimate the change in loss by directional derivatives with respect to these operations. Based on these derivatives, the adversary can choose the best loss-increasing direction. Our algorithm requires just one function evaluation (forward pass) and one gradient computation (backward pass) to estimate the best possible flip. + +A flip of the j𝑗j-th character of the i𝑖i-th word (a→b→𝑎𝑏a\rightarrow b) can be represented by this vector:v→i​j​bsubscriptsuperscript→𝑣absent𝑖𝑗𝑏\vec{v}^{\,}_{ijb} = (0→superscript→0absent\vec{0}^{\,},..;(((0→superscript→0absent\vec{0}^{\,},..(((0,..-1,0,..,1,0)j)_{j},..0→superscript→0absent\vec{0}^{\,})i)_{i}; 0→superscript→0absent\vec{0}^{\,},..)where -1 and 1 are in the corresponding positions for the a𝑎a-th and b𝑏b-th characters of the alphabet, respectively, and xi​j(a)=1superscriptsubscript𝑥𝑖𝑗𝑎1x_{ij}^{(a)}=1. A first-order approximation of change in loss can be obtained from a directional derivative along this vector: ∇v→i​j​bJ​(𝐱,𝐲)=∇xJ​(𝐱,𝐲)T⋅v→i​j​bsubscript∇subscriptsuperscript→𝑣absent𝑖𝑗𝑏𝐽𝐱𝐲⋅subscript∇𝑥𝐽superscript𝐱𝐲𝑇subscriptsuperscript→𝑣absent𝑖𝑗𝑏\nabla_{\vec{v}^{\,}_{ijb}}J(\mathbf{x},\mathbf{y})=\nabla_{x}J(\mathbf{x},\mathbf{y})^{T}\cdot\>\vec{v}^{\,}_{ijb}We choose the vector with biggest increase in loss:max​∇xJ​(𝐱,𝐲)T⋅v→i​j​b=maxi​j​b​∂J∂xi​j(b)−∂J∂xi​j(a)⋅absentmaxsubscript∇𝑥𝐽superscript𝐱𝐲𝑇subscriptsuperscript→𝑣absent𝑖𝑗𝑏𝑖𝑗𝑏maxsuperscript𝐽subscript𝑥𝑖𝑗𝑏superscript𝐽subscript𝑥𝑖𝑗𝑎\begin{split}\underset{}{\text{max}}\nabla_{x}J(\mathbf{x},\mathbf{y})^{T}\cdot\>\vec{v}^{\,}_{ijb}=\underset{{ijb}}{\text{max}}{{\frac{\partial{J}}{\partial{x_{ij}}}}^{(b)}-{\frac{\partial{J}}{\partial{x_{ij}}}}^{(a)}}\end{split}(1)Using the derivatives as a surrogate loss, we simply need to find the best change by calling the function mentioned in eq. 1, to estimate the best character change (a→b→𝑎𝑏a\rightarrow b).This is in contrast to a naive loss-based approach, which has to query the classifier for every possible change to compute the exact loss induced by those changes. In other words, apart from the overhead of calling the function in eq. 1, one backward pass saves the adversary a large number of forward passes. + +Character insertion222For ease in exposition, we assume that the word size is at most n𝑛n-1, leaving at least one position of padding at the end. at the j𝑗j-th position of the i𝑖i-th word can also be treated as a character flip, followed by more flips as characters are shifted to the right until the end of the word.max​∇xJ​(𝐱,𝐲)T⋅v→i​j​b=maxi​j​b​∂J∂xi​j(b)−∂J∂xi​j(a)+∑j′=j+1n(∂J∂xi​j′(b′)−∂J∂xi​j′(a′))⋅absentmaxsubscript∇𝑥𝐽superscript𝐱𝐲𝑇subscriptsuperscript→𝑣absent𝑖𝑗𝑏𝑖𝑗𝑏maxsuperscript𝐽subscript𝑥𝑖𝑗𝑏superscript𝐽subscript𝑥𝑖𝑗𝑎superscriptsubscriptsuperscript𝑗′𝑗1𝑛superscript𝐽subscript𝑥𝑖superscript𝑗′superscript𝑏′superscript𝐽subscript𝑥𝑖superscript𝑗′superscript𝑎′\underset{}{\text{max}}\nabla_{x}J(\mathbf{x},\mathbf{y})^{T}\cdot\>\vec{v}^{\,}_{ijb}=\underset{{ijb}}{\text{max}}{{\frac{\partial{J}}{\partial{x_{ij}}}}^{(b)}-{\frac{\partial{J}}{\partial{x_{ij}}}}^{(a)}}\\+\sum_{j^{{}^{\prime}}=j+1}^{n}\bigg{(}{{\frac{\partial{J}}{\partial{x_{ij^{{}^{\prime}}}}}}^{(b^{{}^{\prime}})}-{\frac{\partial{J}}{\partial{x_{ij^{{}^{\prime}}}}}}^{(a^{{}^{\prime}})}}\bigg{)}where xi​j′(a′)=1superscriptsubscript𝑥𝑖superscript𝑗′superscript𝑎′1x_{ij^{{}^{\prime}}}^{(a^{{}^{\prime}})}=1 and xi​j′−1(b′)=1superscriptsubscript𝑥𝑖superscript𝑗′1superscript𝑏′1x_{i{j^{{}^{\prime}}{-1}}}^{(b^{{}^{\prime}})}=1.Similarly, character deletion can be written as a number of character flips as characters are shifted to the left.Since the magnitudes of direction vectors (operations) are different, we normalize by the L2subscript𝐿2L_{2} norm of the vector i.e., v→2​N→𝑣2𝑁\frac{\vec{v}}{\sqrt{2N}}, where N is the number of total flips. + +We explained how to estimate the best single change in text to get the maximum increase in loss. A greedy or beam search of r𝑟r steps will give us an adversarial example with a maximum of r𝑟r flips, or more concretely an adversarial example within an L0subscript𝐿0L_{0} distance of r𝑟r from the original example.Our beam search requires only 𝒪​(b​r)𝒪𝑏𝑟\mathcal{O}(br) forward passes and an equal number of backward passes, with r𝑟r being the budget and b𝑏b, the beam width.We elaborate on this with an example: Consider the loss function J(.)J(.), input x0subscript𝑥0x_{0}, and an individual change cjsubscript𝑐𝑗c_{j}. We estimate the score for the change as ∂J​(x0)∂cj𝐽subscript𝑥0subscript𝑐𝑗\frac{\partial{J(x_{0})}}{\partial{c_{j}}}.For a sequence of 3 changes [c1subscript𝑐1c_{1},c2subscript𝑐2c_{2},c3subscript𝑐3c_{3}], we evaluate the “score” as follows.score([​c1,c2,c3​])=∂J​(x0)∂c1+∂J​(x1)∂c2+∂J​(x2)∂c3score([subscript𝑐1subscript𝑐2subscript𝑐3])𝐽subscript𝑥0subscript𝑐1𝐽subscript𝑥1subscript𝑐2𝐽subscript𝑥2subscript𝑐3\text{score([}c_{1},c_{2},c_{3}\text{])}=\frac{\partial{J(x_{0})}}{\partial{c_{1}}}+\frac{\partial{J(x_{1})}}{\partial{c_{2}}}+\frac{\partial{J(x_{2})}}{\partial{c_{3}}}where x1subscript𝑥1x_{1} and x2subscript𝑥2x_{2} are the modified input after applying [c1subscript𝑐1c_{1}] and [c1subscript𝑐1c_{1}, c2subscript𝑐2c_{2}] respectively.We need b𝑏b forward and backward passes to compute derivatives at each step of the path, leading to 𝒪​(b​r)𝒪𝑏𝑟\mathcal{O}(br) queries. In contrast, a naive loss-based approach requires computing the exact loss for every possible change at every stage of the beam search, leading to 𝒪​(b​r​L​|V|)𝒪𝑏𝑟𝐿𝑉\mathcal{O}(brL|V|) queries. + +In principle, HotFlip could be applied to any differentiable character-based classifier. Here, we focus on the CharCNN-LSTM architecture Kim et al. (2016), which can be adapted for classification via a single dense layer after the last recurrent hidden unit.We use the AG’s news dataset333https://www.di.unipi.it/~gulli/, which consists of 120,000 training and 7,600 test instances from four equal-sized classes: World, Sports, Business, and Science/Technology.The architecture consists of a 2-layer stacked LSTM with 500 hidden units, a character embedding size of 25, and 1000 kernels of width 6 for temporal convolutions. This classifier was able to outperform Conneau et al. (2017), which has achieved the state-of-the-art result on some benchmarks, on AG’s news. The model is trained with SGD and gradient clipping, and the batch size was set to 64.We used 10% of the training data as the development set, and trained for a maximum of 25 epochs.We only allow character changes if the new word does not exist in the vocabulary, to avoid changes that are more likely to change the meaning of text. The adversary uses a beam size of 10, and has a budget of maximum of 10% of characters in the document.In Figure 1, we plot the success rate of the adversary against an acceptable confidence score for the misclassification. That is, we consider the adversary successful only if the classifier misclassifies the instance with a given confidence score. For this experiment, we create adversarial examples for 10% of the test set. + +We compare with a (greedy) black-box adversary, which does not have access to model parameters, and simply queries the classifier with random character changes. Belinkov and Bisk Belinkov and Bisk (2018) define an attack, Key, in which a character is replaced with an adjacent character in the keyboard. We allow a stronger black-box attacker to change a character to any character in the alphabet, and we call it Key∗.As expected a white-box adversary is much more damaging, and has a higher success rate. As can be seen, the beam-search strategy is very effective in fooling the classifier even with an 0.9 confidence constraint, tricking the classifier for more than 90% of the instances.A greedy search is less effective especially in producing high-confidence scores.We use a maximum of 10% of characters in the document as the budget for the adversary, but our adversary changes an average of 4.18% of the characters to trick the classifier at confidence 0.5. The adversary picks the flip operation around 80% of the times, and favors delete over insert by two to one. + +For our adversarial training, we use only use the flip operation, and evaluate models’ robustness to this operation only. This is because insert and delete manipulations are n𝑛n times slower to generate, where n𝑛n is the number of maximum characters allowed for a word. For these experiments, we have no constraint on confidence score. We flip r𝑟r characters for each training sample, which was set to20% of the characters in text after tuning, based on the accuracy on the development set. In addition, for faster generation of adversarial examples, we directly apply the top r𝑟r flips after the first backward pass, simultaneously444The adversary at test time would still use beam search.. + +We use the full test set for this experiment, and we compare HotFlip adversarial training with the white-box (supervised) adversarial training Miyato et al. (2017) that perturbs word embeddings, which we adapt to work with character embeddings. Specifically, the adversarial noise per character is constrained by the Frobenius norm of the embedding matrix composed of the sequence of characters in the word.We also create another baseline where instead of white-box adversarial examples, we add black-box adversarial examples (Key∗superscriptKey\texttt{Key}^{*}) to the mini-batches. As shown in Table 2, our approach decreases misclassification error anddramatically decreases the adversary’s success rate. In particular, adversarial training on real adversarial examples generated by HotFlip, is more effective than training on pseudo-adversarial examples created by adding noise to the embeddings. + +The current error of our adversarially trained model is still beyond an acceptable rate; this is mainly because the adversary that we use at test time, which uses beam search, is strictly stronger than our model’s internal adversary. This has been observed in computer vision where strongest adversaries are not efficient enough for adversarial training, but can break models trained with weaker adversaries Carlini and Wagner (2017). + +Our human evaluation experiment shows that our character-based adversarial examples rarely alter the meaning of a sentence. We conduct an experiment of annotating 600 randomly-picked instances annotated by at least three crowd workers in Amazon Mechanical Turk. This set contains 150 examples of each class of AG’s-news dataset, all of which are correctly classified by the classifier. We manipulate half of this set by our algorithm, which can successfully trick the classifier to misclassify these 300 adversarial examples.The median accuracy of our participants decreased by 1.78% from 87.49% on clean examples to 85.71% on adversarial examples.Similar small drops in human performance have been reported for image classification Papernot et al. (2016) and text comprehension Jia and Liang (2017). + +HotFlip can naturally be adapted to generate adversarial examples for word-level models, by computing derivatives with respect to one-hot word vectors.After a few character changes, the meaning of the text is very likely to be preserved or inferred by the reader Rawlinson (1976), which was also confirmed by our human subjects study.By contrast, word-level adversarial manipulations are much more likely to change the meaning of text, which makes the use of semantics-preserving constraints necessary.For example, changing the word good to bad changes the sentiment of the sentence “this was a good movie”. In fact, we expect the model to predict a different label after such a change. + +To showcase the applicability of HotFlip to a word-level classifier, we use Kim’s CNN Kim (2014) trained for binary sentiment classification on the SST dataset Socher et al. (2013). In order to create adversarial examples, we add constraints so that the resulting sentence is likely to preserve the original meaning; we only flip a word wisubscript𝑤𝑖w_{i} to wjsubscript𝑤𝑗w_{j} only if these constraints are satisfied:1.The cosine similarity between the embedding of words is bigger than a threshold (0.8).2.The two words have the same part-of-speech.3.We disallow replacing of stop-words, as for many of the stop-words, it is difficult to find cases where replacing them will still render the sentence grammatically correct. We also disallow changing a word to another word with the same lexeme for the same purpose. + +Table 3 shows a few adversarial examples with only one word flip. In the second and the fourth examples, the adversary flips a positive word (i.e., good, nice) with highly positive words (i.e., terrific, wonderful) in an overall very negative review.These examples, albeit interesting and intuitive, are not abundant, and thus pose less threat to an NLP word-level model. Specifically, given the strict set of constraints, we were able to create only 41 examples (2% of the correctly-classified instances of the SST test set) with one or two flips. + +For a qualitative analysis of relative brittleness of character-level models, we study the change in word embedding as an adversarial flip, insert, or delete operation occurs in Table 4. We use the output of the highway layer as the word representation, and report the embedding for a few adversarial words, for which the original word is not among their top 5 nearest neighbors. + +In a character-level model, the lookup operation to pick a word from the vocabulary is replaced by a character-sequence feature extractor which gives an embedding for any input, including OOV words which would be mapped to an UNK token in a word-level model. This makes the embedding space induced in character-level representation more dense, which makes character-level models more likely to misbehave under small adversarial perturbations. + +White-box attacks are among the most serious forms of attacks an adversary can inflict on a machine learning model.We create white-box adversarial examples by computing derivatives with respect to a few character-edit operations (i.e., flip, insert, delete), which can be used in a beam-search optimization.While character-edit operations have little impact on human understanding, we found that character-level models are highly sensitive to adversarial perturbations.Employing these adversarial examples in adversarial training renders the models more robust to such attacks, as well as more robust to unseen clean data. + +Contrasting and evaluating robustness of different character-level models for different tasks is an important future direction for adversarial NLP. In addition, the discrete nature of text makes it a more challenging task to understand the landscape of adversarial examples. Research in this direction can shed light on vulnerabilities of NLP models. + +This work was funded by ARO grant W911NF-15-1-0265. \ No newline at end of file diff --git a/1712.06848v1.txt b/1712.06848v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..59e6d96458eb21d94bfccbca6152d08f1b0d2335 --- /dev/null +++ b/1712.06848v1.txt @@ -0,0 +1,161 @@ +In a two-sided market, there are several sellers who hold items for sale and several buyers who consider buying these items. Examples are stock exchanges, used-car markets,emission trading markets (Godby,, 1999; Sturm,, 2008),Internet advertisements (Feldman and Gonen,, 2016) and markets for spectrum reallocation (Leyton-Brown et al.,, 2017).Each trader has a different valuation to each bundle of items.In contrast to a one-sided market, here the valuations of both the buyers and the sellers are their private information, and both sides might act strategically.A double auction is a mechanism for organizing a two-sided market — deciding who will buy, who will sell and at what prices. + +An important requirement from a double-auction is efficiency, which is measured by its gain-from-trade (GFT) — the total value gained by the buyers minus the total value contributed by the sellers. As an example, in a used-car market with a single buyer and a single seller holding a single car, if the seller values the car as vssubscript𝑣𝑠v_{s} and the buyer as vb>vssubscript𝑣𝑏subscript𝑣𝑠v_{b}>v_{s}, then the potential GFT is vb−vssubscript𝑣𝑏subscript𝑣𝑠v_{b}-v_{s}. + +The most commonly used double-auction mechanism is the Walrasian mechanism (Rustichini et al.,, 1994; Babaioff et al.,, 2014). It computes an equilibrium price — a price at whichthe supply equals the demand: the total number of units that sellers are interested to sell at this price equals the total number of units that buyers are interested to buy at this price. In a single-good market, an equilibrium price exists whenever the agents have decreasing-marginal-returns (DMR) — the marginal utility for an agent from having one more unit is weakly-decreasing in his current number of units (Gul and Stacchetti,, 2000).Moreover, by the First Welfare Theorem, this mechanism attains the maximum GFT (Nisan et al.,, 2007, Theorem 11.13). Unfortunately, this mechanism is not incentive-compatible (IC) — agents have an incentive to misreport their valuations in order to manipulate the price. + +The problem of designing an IC double-auction has already been considered by Vickrey. In his seminal paper (Vickrey,, 1961) he described a variant of his famous second-price auction for a two-sided market. Like its one-sided variant, it is dominant-strategy incentive-compatible (DSIC, aka truthful) — it is a weakly-dominant strategy for each agent to reveal its true valuation function. But unlike the one-sided variant it is not budget-balanced (BB) — it has a deficit — it requires the market-maker to bring money from home. While it is possible to charge entrance-fees to cover this cost, this makes the mechanism not individually rational (IR) — some traders might lose from participating. + +Myerson and Satterthwaite, (1983) proved that, in a two-sided market, any mechanism that is IR, BB and IC cannot be efficient . Intuitively, the reason is that it is impossible to truthfully determine prices for trading.Consider any mechanism that charges the buyer pbsubscript𝑝𝑏p_{b} and pays the seller pssubscript𝑝𝑠p_{s}. If psvssubscript𝑝𝑏subscript𝑣𝑠p_{b}>v_{s}, the buyer is incentivized to force the price down. Setting ps=vbsubscript𝑝𝑠subscript𝑣𝑏p_{s}=v_{b} and pb=vssubscript𝑝𝑏subscript𝑣𝑠p_{b}=v_{s} leads to a deficit. One way out is to determine take-it-or-leave-it prices independently of the traders’ valuations, but this might result in a total loss of GFT. + +This impossibility result initiated a search for double-auction mechanisms that are IC, IR and BB, and attain an approximately maximal GFT.We define the competitive ratio of a mechanism as the minimum ratio (over all utility profiles) of its GFT divided by the optimal GFT.The first approximation mechanism was presented by McAfeeMcAfee, (1992) for the case when each seller has a single unit and each buyer wants a single unit.McAfee’s mechanism is truthful — it is a weakly-dominant strategy for each agent to report his true valuation for the item.Its competitive-ratio is 1−1/k11𝑘1-1/k, where k𝑘k is the number of units traded in the optimal situation. (i.e, its GFT is always at least 1−1/k11𝑘1-1/k of the maximum GFT). Thus, McAfee’s mechanism is asymptotically efficient — when the market-size k𝑘k grows to infinity, the GFT approaches the maximum.In addition to being truthful, IR, BB and asymptotically-efficient, McAfee’s mechanism has a fifth nice property — it is prior-free (PF). This means that it does not require any statistical information about the traders’ valuations; it works well even for worst-case (adversarial) valuations. + +The main drawback of McAfee’s mechanism is that it works only for single-unit traders. Another potential drawback is that it is only weakly-budget-balanced (WBB) — the market-maker need not bring money, but may the have to take money. Moreover, in some cases the market-maker consumes almost all the GFT, leaving only little GFT to the traders (Segal-Halevi et al., 2016b, ).This may be acceptable when the market-maker is a monopolist (e.g. a government),but might be problematicwhen the market-maker faces competition, e.g. in stock exchange platforms, since a low GFT for the traders might drive them away to the competitors.111Technically it is possible to convert a WBB mechanism to a SBB one: randomly pick an agent before the trade, disallow him to participate in the trade, and give him all the surplus after the trade. However, this might induce a lot of people without any interest in the trade (e.g, “sellers” with no goods or “buyers” with no money) to participate in the auction, in the hope of winning the lottery. We believe this goes against the idea of truthfulness, and might have adverse effects on the market. + +This paper presents MUDA — a double-auction mechanism for traders that buy and sell multiple units. The only assumption required is that all traders have decreasing-marginal-returns; this is the same assumption that guarantees the existence of market-equilibrium. + +The main idea of MUDA is to calculate equilibrium prices using random halving. The general scheme is presented below; it is explained in more detail in Section 3.MUDA (general scheme):Split the market to two sub-markets, left and right, by sending each trader to each side with probability 1/2, independently of the others.Then, in each sub-market:1.Calculate a market-equilibrium price (pRsuperscript𝑝𝑅p^{R} at the right, pLsuperscript𝑝𝐿p^{L} at the left).2.Let the agents trade at the price from the other market (pLsuperscript𝑝𝐿p^{L} at the right, pRsuperscript𝑝𝑅p^{R} at the left).The random-sampling technique was found useful in one-sided markets (Goldberg et al.,, 2001, 2006; Devanur et al.,, 2015; Balcan et al.,, 2008, 2007)and matching markets (Devanur and Hayes,, 2009).However, applying it to a two-sided market poses a new challenge: material balance — the number of units bought and sold must be exactly equal. This is in contrast to a one-sided market, where the seller may leave some units unsold. Random-sampling in two-sided markets was used only with one-parametric agents — agents whose valuations are characterized by a single signal Baliga and Vohra, (2003); Kojima and Yamashita, (2014). + +MUDA (general scheme):Split the market to two sub-markets, left and right, by sending each trader to each side with probability 1/2, independently of the others.Then, in each sub-market:1.Calculate a market-equilibrium price (pRsuperscript𝑝𝑅p^{R} at the right, pLsuperscript𝑝𝐿p^{L} at the left).2.Let the agents trade at the price from the other market (pLsuperscript𝑝𝐿p^{L} at the right, pRsuperscript𝑝𝑅p^{R} at the left). + +With random-sampling, the price at each sub-market is determined exogenously based on the other sub-market, so the agents cannot manipulate it by reporting strategically. However, because of the material-balance requirement, the traders have another reason to report strategically — they might try to manipulate the quantity of trade. Thus, the multi-unit two-sided setting is more difficult than both the single-unit two-sided setting of McAfee and the multi-unit one-sided setting common in the random-sampling literature. To illustrate this added difficulty, we prove: + +The proof is given in Segal-Halevi and Hassidim, (2017).Theorem 1 can be seen as a dual to the Myerson–Satterthwaite impossibility theorem. In their setting, the quantity is determined exogenously and the traders might manipulate the price; in our setting, the price is determined exogenously and the traders might manipulate the quantity. + +We present two variants of MUDA that overcome this impossibility when the market is sufficiently large. We call them Lottery-MUDA and Vickrey-MUDA. + +Step 1 is the same in both variants. Step 2in both variantsstarts by calculating the aggregate demand and aggregate supply in each sub-market, at the prices calculated in the other sub-market.Usually, the aggregate demand will be larger or smaller than the aggregate supply, so the sub-market will have a long side and a short side (e.g, if there is more demand than supply then the buyers are the long side and the sellers are the short side). The short side can always trade their optimum quantity; i.e, if the buyers are short, we can let each buyer buy the number of units that maximizes his utility given the price. The two variants of MUDA differ in the way they handle the long side: in Lottery-MUDA the traders in the long side are selected using a random permutation that ignores their values, while in Vickrey-MUDA the high-value traders in the long side are selected.In Vickrey-MUDA, each selected trader pays the market-maker a positive trading-feecalculated as in a Vickrey auction; this fee is separate from the money transferred among the traders(the inspiration to this idea came from a recent working paper by Loertscher and Mezzetti, (2016)). + +We emphasize that the properties are true ex-post — for every outcome of the randomization in the mechanism. + +We distinguish between the total-GFT, which includesthe gain of both the agents and the market-maker,and the agents-GFT, whichincludes only the gain of the agents.Since Lottery-MUDA is SBB, the agents-GFT equals the total-GFT.In Vickrey-MUDA, the total-GFT is always higher since the most profitable deals are selected. However, the agents-GFT might be much lower. In a particular example shown in the arXiv version, the total-GFT is high but the agents-GFT is near 0.Thus, Vickrey-MUDA may be preferred when the market-maker is a monopolist (e.g, a government), while Lottery-MUDA may be preferred when the market-maker faces competition (e.g, a stock-exchange). + +The competitive-ratio of MUDA depends onk𝑘k — the number of units traded in the optimal situation (the k𝑘k used by McAfee 1992),andM𝑀M — the maximum number of units offered(demanded) by a single seller(buyer).M𝑀M represents the market concentration — how much market power is held by a single trader. + +The proof is given in Section 5. + +While Vickrey-MUDA attains more total-GFT than Lottery-MUDA, their asymptotic behavior is similar — both of them approach the optimal total-GFT when the market size (k𝑘k) is large, as longas the market-concentration factor (represented by M𝑀M) is kept constant. In contrast, if M𝑀M is very large (M=k𝑀𝑘M=k) the market effectively has a single buyer and a single seller, and the impossibility result of (Myerson and Satterthwaite,, 1983) implies that no positive approximation of the GFT is possible.The arXiv version shows an example in which the agents-GFT of Vickrey-MUDA is close to 0 (the agents-GFT of Lottery-MUDA always equals its total-GFT). + +While we focus on approximating the maximum GFT (buyers’ values minus trading sellers’ values),other mechanisms in the literature approximate the maximum social welfare (buyers’ values plus non-trading sellers’ values).But any mechanism that attains a fraction α𝛼\alpha of the optimal GFT also attains a fraction of at least α𝛼\alpha of the optimal social welfare (Brustle et al.,, 2017). Hence, MUDA is asymptotically-optimal with respect to the social-welfare too. + +The lower bound of Theorem 3depends on k𝑘k — the optimal trade size.Ideally, we would like a bound that depends on the number of traders that come to the market (say, n𝑛n). However, we cannot attain such bound theoretically in a worst-case analysis, even for the social-welfare. As an example, consider a single-good single-unit market having n𝑛n sellers with value 222, n−1𝑛1n-1 buyers with value 111 and one buyer with value 100000010000001000000. Here k=1𝑘1k=1 as there is only one relevant trade. The competitive ratio of any mechanism depends only on the probability with which it performs this single trade; this probability does not change even when n→∞→𝑛n\to\infty. + +We complement our worst-case analysis that depends on k𝑘k with simulations of both variants of MUDAon agents drawn from both synthetic and realistic distributions. The simulations show that, when valuations are random (and not worst-case), the competitive-ratio of MUDA increases with the number of traders. These are presented in Section 6. + +Most existing mechanisms for multi-unit double-auction are not truthful, e.g. Plott and Gray, (1990). + +The research on truthful double auction has made many advancements since McAfee, (1992). There are variants of McAfee’s mechanism for maximizing the auctioneer’s surplus (Deshmukh et al.,, 2002), handling spatially-distributed markets (Babaioff et al.,, 2004), transaction costs (Chu and Shen,, 2006), supply chains (Babaioff and Walsh,, 2006), constraints on the set of traders that can trade simultaneously (Yao et al.,, 2011; Dütting et al.,, 2017; Brustle et al.,, 2017),online arrival of buyers (Wang et al.,, 2010) and strong budget-balance (Colini-Baldeschi et al.,, 2016).All these advancements are for single-unit agents. + +Other double-auction mechanisms either assume that the agents’ valuations are additive(Huang et al.,, 2002; Xu et al.,, 2010; Feldman and Gonen,, 2016; Goel et al.,, 2016; Hirai and Sato,, 2017)or assume that their valuations are represented by a single parameterGonen et al., (2007); Kojima and Yamashita, (2014).The DMR valuations handled by MUDA are multi-parametric and include additive valuations as a special case. + +Several recent double-auction mechanisms work in a Bayesian setting — they assume that the traders’ valuations are drawn from some probability distribution that is public knowledge. Such knowledge allows the mechanism designer to attain approximate efficiency without relying on the agents’ reports.Examples areYoon, (2008); Colini-Baldeschi et al., (2017).Some other mechanisms require partial prior knowledge on the valuations, such as their median (Blumrosen and Dobzinski,, 2014) or their maximum and minimum value Gonen and Egri, (2017).(Baliga and Vohra,, 2003) assume that the agents’ valuations are drawn from some unknown distribution (they handle single-unit traders) .In contrast, MUDA needs no prior information on the agents’ valuations and does not even assume that they are drawn from some distribution. + +We are aware of two truthful mechanisms that handle multi-parametric agents with DMR valuations in a prior-free way. The first is byBlumrosen and Dobzinski, (2014): their competitive ratio is 1/48 — it is not asymptotically-efficient. The second is by Loertscher and Mezzetti, (2016), which is being developed simultaneously to our work.Their mechanism (that does not use market-halving) is asymptotically-efficient when the valuations of the tradersare drawn from probability distributions satisfying certain conditions. In contrast, our convergence theorem does not assume that agents’ valuations are drawn from a distribution at all. + +We consider a market for a single good. Some agents, the “sellers”, are endowed with at most M𝑀M units of that good, and other agents, the “buyers”, are endowed with an unlimited supply of money.Each agent j𝑗j has a valuation-function vjsubscript𝑣𝑗v_{j} that returns, for every integer t𝑡t between 00 and M𝑀M, the agent’s value for owning t𝑡t units. The valuations are normalized such that vi​(0)=0subscript𝑣𝑖00v_{i}(0)=0. + +All agents havedecreasing marginal returns (DMR). Formally,vj​(t+1)−vj​(t)≤vj​(t)−vj​(t−1)subscript𝑣𝑗𝑡1subscript𝑣𝑗𝑡subscript𝑣𝑗𝑡subscript𝑣𝑗𝑡1v_{j}(t+1)-v_{j}(t)\leq v_{j}(t)-v_{j}(t-1), for every agent j𝑗j and t∈{1,…,M−1}𝑡1…𝑀1t\in\{1,\dots,M-1\}. + +We will often represent a multi-unit agent as M𝑀M single-unit virtual agents; the value of virtual-agent t𝑡t of agent j𝑗j is the agent’s marginal value for having the t𝑡t-th unit:vj,t:=vj​(t)−vj​(t−1)assignsubscript𝑣𝑗𝑡subscript𝑣𝑗𝑡subscript𝑣𝑗𝑡1v_{j,t}:=v_{j}(t)-v_{j}(t-1) for t∈{1,…,M}𝑡1…𝑀t\in\{1,\dots,M\} (a similar idea was used by Chawla et al., (2010)). + +We assume that the agents’ valuations are generic, i.e, all marginal values of different traders are different and linearly-independent over the integers (no linear combination with integer coefficients equals zero).This assumption can be dropped if we use centralized tie-breaking; see Hsu et al., (2016) for other ways to handle ties in markets. + +Given a price p𝑝p per unit of the good, the gain of a buyer i𝑖i from buying t𝑡t units is G​a​i​ni​(t,p)=vi​(t)−t⋅p𝐺𝑎𝑖subscript𝑛𝑖𝑡𝑝subscript𝑣𝑖𝑡⋅𝑡𝑝Gain_{i}(t,p)=v_{i}(t)-t\cdot p, and the gain of a seller j𝑗j from selling t𝑡t units isG​a​i​nj​(t,p)=t⋅p+vj​(Mj−t)−vj​(Mj)𝐺𝑎𝑖subscript𝑛𝑗𝑡𝑝⋅𝑡𝑝subscript𝑣𝑗subscript𝑀𝑗𝑡subscript𝑣𝑗subscript𝑀𝑗Gain_{j}(t,p)=t\cdot p+v_{j}(M_{j}-t)-v_{j}(M_{j}), where Mjsubscript𝑀𝑗M_{j} is the number of units initially held by seller j𝑗j, Mj≤Msubscript𝑀𝑗𝑀M_{j}\leq M. + +A mechanism is a (randomized) function that takes the agents’ valuations and returns (1) a trading-price p𝑝p, (2) for each buyer(seller) i𝑖i, the amount of units tisubscript𝑡𝑖t_{i} he should buy(sell) at price p𝑝p, and possibly a trading-fee fisubscript𝑓𝑖f_{i} paid to the market-maker. A mechanism is materially-balanced if the number of units bought equals the number of units sold:∑i∈Buyersti=∑j∈Sellerstjsubscript𝑖Buyerssubscript𝑡𝑖subscript𝑗Sellerssubscript𝑡𝑗\sum_{i\in\text{Buyers}}t_{i}=\sum_{j\in\text{Sellers}}t_{j}.It is budget-balanced (BB) ifit is materially-balanced and ∑i∈Tradersfi≥0subscript𝑖Traderssubscript𝑓𝑖0\sum_{i\in\text{Traders}}f_{i}\geq 0. It is strongly-budget-balanced (SBB) if ∑i∈Tradersfi=0subscript𝑖Traderssubscript𝑓𝑖0\sum_{i\in\text{Traders}}f_{i}=0. + +A mechanism isindividually-rational (IR) if every agent i𝑖i has a weakly-positive gain: G​a​i​ni​(ti,p)−fi≥0𝐺𝑎𝑖subscript𝑛𝑖subscript𝑡𝑖𝑝subscript𝑓𝑖0Gain_{i}(t_{i},p)-f_{i}\geq 0 with probability 1. It is DSIC (= truthful) if an agent can never increase his gain by pretending to have different valuations. + +The demand of buyer i𝑖i is the number of units that maximizes the gain: D​e​m​a​n​di​(p)=arg⁡maxt∈{0,…,M}⁡G​a​i​ni​(t,p)𝐷𝑒𝑚𝑎𝑛subscript𝑑𝑖𝑝subscript𝑡0…𝑀𝐺𝑎𝑖subscript𝑛𝑖𝑡𝑝Demand_{i}(p)=\arg\max_{t\in\{0,\dots,M\}}Gain_{i}(t,p). The genericity assumption implies that the maximum is unique.When i𝑖i has DMR, D​e​m​a​n​di​(p)𝐷𝑒𝑚𝑎𝑛subscript𝑑𝑖𝑝Demand_{i}(p) equals the number of virtual-buyers i,t𝑖𝑡i,t with vi,t>psubscript𝑣𝑖𝑡𝑝v_{i,t}>p.222This is true only for a DMR agent.For example, suppose buyer i𝑖i values one unit as 3 and two units as 4. Then vi,1=3subscript𝑣𝑖13v_{i,1}=3 and vi,2=1subscript𝑣𝑖21v_{i,2}=1.If the price is 2, then there is one virtual buyer with value above the price, and indeed the agent’s demand is 1. However, if the buyer values one unit as 1 and two units as 4, then vi,1=1subscript𝑣𝑖11v_{i,1}=1 and vi,2=3subscript𝑣𝑖23v_{i,2}=3.If the price is 2, then there is still one virtual buyer with value above the price, but the agent’s demand is 0. + +The aggregate-demand at price p𝑝p is the sum of demands of all buyers. Equivalently, this is the number of virtual-buyers with vj,t>psubscript𝑣𝑗𝑡𝑝v_{j,t}>p.The supply and aggregate-supply are defined analogously. + +The total-gain-from-trade is the sum of gains of all buyers and sellers: t​o​t​a​l​G​F​T:=∑i∈TradersG​a​i​ni​(ti)assign𝑡𝑜𝑡𝑎𝑙𝐺𝐹𝑇subscript𝑖Traders𝐺𝑎𝑖subscript𝑛𝑖subscript𝑡𝑖total~{}GFT:=\sum_{i\in\text{Traders}}Gain_{i}(t_{i}).Note that in a materially-balanced mechanism, the total-GFT does not depend on the trading-price.The agents-GFT is the total GFT minus the total fees, a​g​e​n​t​s​G​F​T:=t​o​t​a​l​G​F​T−∑i∈Tradersfiassign𝑎𝑔𝑒𝑛𝑡𝑠𝐺𝐹𝑇𝑡𝑜𝑡𝑎𝑙𝐺𝐹𝑇subscript𝑖Traderssubscript𝑓𝑖agents~{}GFT:=total~{}GFT-\sum_{i\in\text{Traders}}f_{i}. + +This section explains the details of the MUDA mechanism presented in the introduction.The steps are done in each sub-market separately. For convenience we describe step 1 in the right market and step 2 in the left market; the execution in the opposite direction is entirely analogous. + +We calculate a price that is an equilibrium price at the right market — a price pRsuperscript𝑝𝑅p^{R} for whichD​e​m​a​n​dR​(pR)=S​u​p​p​l​yR​(pR)𝐷𝑒𝑚𝑎𝑛superscript𝑑𝑅superscript𝑝𝑅𝑆𝑢𝑝𝑝𝑙superscript𝑦𝑅superscript𝑝𝑅Demand^{R}(p^{R})=Supply^{R}(p^{R}).Such a price exists even in more general (multi-good) settings. It can be found, for example, by simulating an English auction (Gul and Stacchetti,, 2000), or by binary search. + +For each buyer i𝑖i in the left market, calculate D​e​m​a​n​di​(pR)𝐷𝑒𝑚𝑎𝑛subscript𝑑𝑖superscript𝑝𝑅Demand_{i}(p^{R}).For each seller j𝑗j in the left market, calculateS​u​p​p​l​yj​(pR)𝑆𝑢𝑝𝑝𝑙subscript𝑦𝑗superscript𝑝𝑅Supply_{j}(p^{R}).Let D​e​m​a​n​dL𝐷𝑒𝑚𝑎𝑛superscript𝑑𝐿Demand^{L} be the sum of demands and S​u​p​p​l​yL𝑆𝑢𝑝𝑝𝑙superscript𝑦𝐿Supply^{L} the sum of supplies. If D​e​m​a​n​dL=S​u​p​p​l​yL𝐷𝑒𝑚𝑎𝑛superscript𝑑𝐿𝑆𝑢𝑝𝑝𝑙superscript𝑦𝐿Demand^{L}=Supply^{L}, then we can let the traders trade freely at price pRsuperscript𝑝𝑅p^{R} and the market will clear.Usually, however, we will not be so lucky: there will be either excess demand (D​e​m​a​n​dL>S​u​p​p​l​yL𝐷𝑒𝑚𝑎𝑛superscript𝑑𝐿𝑆𝑢𝑝𝑝𝑙superscript𝑦𝐿Demand^{L}>Supply^{L}) or excess supply (D​e​m​a​n​dL0subscript𝑘𝑗0k_{j}>0 and zero if kj=0subscript𝑘𝑗0k_{j}=0. + +In both variants of MUDA, the traders cannot affect their trading-price.Moreover, in both variants, the traders in the short side of each sub-market trade the amount of units that maximizes their gain given the price, so for them the mechanism is obviously IR and DSIC. As for the long-side traders: + +(a) in Lottery-MUDA they play random serial dictatorship: the first agents in the line trade their optimal quantity given the price and the last agents in the line cannot trade at all. There is at most a single agent, in the middle of the line, who trades less than his optimal quantity. Because of the DMR assumption, it is always optimal to trade as many units as possible up to the optimal quantity (since the highest gain comes from trading the first units).Therefore, the mechanism is IR and DSIC for all traders. + +(b) In Vickrey-MUDA, long-side virtual-traders trade only if they have positive gain. In this case, a trader with kjsubscript𝑘𝑗k_{j} participating virtual-traders pays a fee that is equal to the gain ofat most kjsubscript𝑘𝑗k_{j} non-participating virtual-traders. Since themechanism always selects the virtual-traders with the highest gain, the total fee paid by any trader is lower than his gain, so the net gain remains positive and the mechanism is IR. The mechanism is DSIC since it is effectively a multi-unit Vickrey-auction with a reserve-price. It is known that such a mechanism is DSIC; we omit the proof. + +In this section we prove Theorem 3.In fact, we prove a more generalclaim that depends on a third parameter, m𝑚m — the minimum number of units offered(demanded) by a single seller(buyer) at same value.We assume that the virtual-traders of each trader i𝑖i are divided to groups of size at least m𝑚m, such that the values in each group are the same.So each agent i𝑖i values mi,1subscript𝑚𝑖1m_{i,1} units as vi,1subscript𝑣𝑖1v_{i,1}, mi,2subscript𝑚𝑖2m_{i,2} units as vi,2subscript𝑣𝑖2v_{i,2}, etc., withmi,l≥msubscript𝑚𝑖𝑙𝑚m_{i,l}\geq m for all l𝑙l and ∑lmi,l≤Msubscript𝑙subscript𝑚𝑖𝑙𝑀\sum_{l}m_{i,l}\leq M.Theorem 3 follows from the expression at the end of this section by setting m=1𝑚1m=1. + +We first analyze the optimal trade, then the right sub-market and finally the left sub-market. + +In the optimal trade, there is a set B∗subscript𝐵B_{*} of virtual-buyerswho buy goods from a set S∗subscript𝑆S_{*} of virtual-sellers.By material-balance the numbers of virtual-agents inboth groups are the same; this is the number we denoted by k𝑘k:|B∗|=|S∗|=ksubscript𝐵subscript𝑆𝑘\displaystyle|B_{*}|=|S_{*}|=k(1)We call these k𝑘k buyers and sellers the efficient traders. We make the pessimistic assumption that all GFT in the sub-markets comes from these efficient traders. Therefore, the GFT of our mechanism depends on the numbers of efficient traders that trade in each sub-market. + +The reduction in GFT has two reasons: one is the sampling error — efficient buyers and sellers land in different sub-markets, so they do not meet and cannot trade. This error is easy to bound using standard tail bounds. The second reason is the pricing error — the price at the sub-market might be too high or too low, which might create imbalance in the demand and supply. Analyzing this error requires careful analysis of the equilibrium in the optimal situation vs. the equilibrium in each sub-market. + +In the right sub-market, MUDA calculates an equilibrium price pRsuperscript𝑝𝑅p^{R}. We define four sets of virtual-traders:•B−subscript𝐵B_{-} is the set of efficient virtual-buyers (members of B∗subscript𝐵B_{*}) whose value is below pRsuperscript𝑝𝑅p^{R} (so they won’t buy at price pRsuperscript𝑝𝑅p^{R}).•S−subscript𝑆S_{-} is the set of efficient virtual-sellers (members of S∗subscript𝑆S_{*}) whose value is above pRsuperscript𝑝𝑅p^{R} (so they won’t sell at price pRsuperscript𝑝𝑅p^{R}).•B+subscript𝐵B_{+} is the set of inefficient virtual-buyers whose value is above pRsuperscript𝑝𝑅p^{R} (so they want to buy at price pRsuperscript𝑝𝑅p^{R}).•S+subscript𝑆S_{+} is the set of inefficient virtual-sellers whose value is below pRsuperscript𝑝𝑅p^{R} (so they want to sell at price pRsuperscript𝑝𝑅p^{R}).These sets represent the pricing error, so we want to upper-bound their sizes. + +For any set T𝑇T of agents, denote by TRsuperscript𝑇𝑅T^{R} the subset of T𝑇T that is sampled to the right market and by TLsuperscript𝑇𝐿T^{L} the subset of T𝑇T sampled to the left market. By definition of the equilibrium price pRsuperscript𝑝𝑅p^{R}:|B∗R|−|B−R|+|B+R|=|S∗R|−|S−R|+|S+R|subscriptsuperscript𝐵𝑅subscriptsuperscript𝐵𝑅subscriptsuperscript𝐵𝑅subscriptsuperscript𝑆𝑅subscriptsuperscript𝑆𝑅subscriptsuperscript𝑆𝑅\displaystyle|B^{R}_{*}|-|B^{R}_{-}|+|B^{R}_{+}|=|S^{R}_{*}|-|S^{R}_{-}|+|S^{R}_{+}|(2)In order to relate (1) and (2), we have to relate B∗R,S∗Rsubscriptsuperscript𝐵𝑅subscriptsuperscript𝑆𝑅B^{R}_{*},S^{R}_{*} to B∗,S∗subscript𝐵subscript𝑆B_{*},S_{*}. This is be done using the following lemma. + +The lemma is proved using Hoeffding’s inequality. The proof is standard and we omit it. + +We apply this lemma twice, to B∗subscript𝐵B_{*} and S∗subscript𝑆S_{*}, and combine the outcomes using the union bound. This gives, ∀q>0for-all𝑞0\forall q>0:w.p.​1−4​e−2​m​q2M2​k::w.p.14superscript𝑒2𝑚superscript𝑞2superscript𝑀2𝑘absent\displaystyle\text{w.p.}1-4e^{{-2mq^{2}\over M^{2}k}}:||B∗R|−k2|0for-all𝑞0\forall q>0:w.p.​1−4​e−2​m​q2M2​k::w.p.14superscript𝑒2𝑚superscript𝑞2superscript𝑀2𝑘absent\displaystyle\text{w.p.}1-4e^{{-2mq^{2}\over M^{2}k}}:||B−R∪S+R|−|B+R∪S−R||<2​qsuperscriptsubscript𝐵𝑅superscriptsubscript𝑆𝑅superscriptsubscript𝐵𝑅superscriptsubscript𝑆𝑅2𝑞\displaystyle\left||B_{-}^{R}\cup S_{+}^{R}|-|B_{+}^{R}\cup S_{-}^{R}|\right|<2q(5)Of the two sets in the left-hand side, at least one must be empty: if pRsuperscript𝑝𝑅p^{R} is too high (relative to some optimal equilibrium price pOsuperscript𝑝𝑂p^{O}) then efficient buyers quit and inefficient sellers join, but no inefficient buyers join and no efficient sellers quit, so B+R=S−R=∅superscriptsubscript𝐵𝑅superscriptsubscript𝑆𝑅B_{+}^{R}=S_{-}^{R}=\emptyset. This situation is illustrated in Figure 1. Analogously, if pRsuperscript𝑝𝑅p^{R} is too low then B−R=S+R=∅superscriptsubscript𝐵𝑅superscriptsubscript𝑆𝑅B_{-}^{R}=S_{+}^{R}=\emptyset. + +From now on we assume that the situation is like in Figure 1 (the other situation is analogous). So (5) implies:∀q:w.p.​1−4​e−2​m​q2M2​k:|B−R|<2​q​ and ​|S+R|<2​q:for-all𝑞w.p.14superscript𝑒2𝑚superscript𝑞2superscript𝑀2𝑘:superscriptsubscript𝐵𝑅2𝑞 and superscriptsubscript𝑆𝑅2𝑞\displaystyle\forall q:~{}~{}\text{w.p.}1-4e^{{-2mq^{2}\over M^{2}k}}:~{}~{}|B_{-}^{R}|<2q\text{~{}and~{}}|S_{+}^{R}|<2q(6)Our goal is now to derive an upper bound on B−subscript𝐵B_{-} and S+subscript𝑆S_{+}. They are entirely analogous; we focus on B−subscript𝐵B_{-}. Note that we cannot apply (3) directly to B−subscript𝐵B_{-}, since B−subscript𝐵B_{-} is a random-set — it depends on the random-sampling through pRsuperscript𝑝𝑅p^{R}.(3) does not apply to sets T𝑇T that depend on the random-sampling; as an illustration, suppose the set T𝑇T is selected such that it contains only virtual-agents from the right market. Then TR=Tsuperscript𝑇𝑅𝑇T^{R}=T so (3) is obviously not satisfied. Fortunately, B−subscript𝐵B_{-} is a special random-set — it is one-dimensional: for every integer t>0𝑡0t>0, it has only a single possible value with cardinality t𝑡t, which is the set of t𝑡t virtual-buyers with the lowest value in B∗subscript𝐵B_{*} (see Figure 1, where t=1𝑡1t=1). Denote these sets by B−,tsubscript𝐵𝑡B_{-,t}. For every t𝑡t, B−,tsubscript𝐵𝑡B_{-,t} is independent of the random-sampling, so it is eligible to (3). Substituting there q→2​t−2​q→𝑞2𝑡2𝑞q\to 2t-2q gives:∀q,t:w.p.​1−2​e−2​m​(2​t−2​q)2M2⋅4​t::for-all𝑞𝑡w.p.12superscript𝑒2𝑚superscript2𝑡2𝑞2⋅superscript𝑀24𝑡:absent\displaystyle\forall q,t:\text{w.p.}1-2e^{{-2m(2t-2q)^{2}\over M^{2}\cdot 4t}}:||B−,4​tR|−2​t|<2​t−2​qsuperscriptsubscript𝐵4𝑡𝑅2𝑡2𝑡2𝑞\displaystyle\left||B_{-,4t}^{R}|-{2t}\right|<2t-2q(7)⟹\displaystyle\implies|B−,4​tR|>2​qsuperscriptsubscript𝐵4𝑡𝑅2𝑞\displaystyle|B_{-,4t}^{R}|>2qIf |B−R|<2​qsuperscriptsubscript𝐵𝑅2𝑞|B_{-}^{R}|<2q and |B−,4​tR|>2​qsuperscriptsubscript𝐵4𝑡𝑅2𝑞|B_{-,4t}^{R}|>2q, then necessarily |B−|<4​tsubscript𝐵4𝑡|B_{-}|<4t. So by combining (6) and (7) with the union bound we get, ∀q,tfor-all𝑞𝑡\forall q,t:w.p.​1−4​e−2​m​(t−q)2M2​t−4​e−2​m​q2M2​k:|B−|<4​t​ & ​|S+|<4​t:w.p.14superscript𝑒2𝑚superscript𝑡𝑞2superscript𝑀2𝑡4superscript𝑒2𝑚superscript𝑞2superscript𝑀2𝑘subscript𝐵4𝑡 & subscript𝑆4𝑡\displaystyle\text{w.p.}1-4e^{{-2m(t-q)^{2}\over M^{2}t}}-4e^{{-2mq^{2}\over M^{2}k}}:|B_{-}|<4t\text{~{}\&~{}}|S_{+}|<4t(8)To simplify the expression we choose t=2​q𝑡2𝑞t=2q; assuming 2​qk2−9​q​ and ​|SL|>k2−qw.p. 1−8e−2mq2M2k:superscript𝐵𝐿𝑘29𝑞 and superscript𝑆𝐿𝑘2𝑞\displaystyle\text{w.p. $1-8e^{{-2mq^{2}\over M^{2}k}}$:}~{}~{}|B^{L}|>{k\over 2}-9q\text{~{}~{}and~{}~{}}|S^{L}|>{k\over 2}-qIn Vickrey-MUDA, the most efficient traders in each side trade with each other. Therefore, the mechanism makes at least the k2−9​q𝑘29𝑞{k\over 2}-9q most efficient deals in the left submarket. Similar considerations are true in the right submarket. All in all, Vickrey-MUDA does at least the k−18​q𝑘18𝑞k-18q most efficient out of the k𝑘k efficient deals. Therefore, w.p. 1−8​e−2​m​q2M2​k18superscript𝑒2𝑚superscript𝑞2superscript𝑀2𝑘1-8e^{{-2mq^{2}\over M^{2}k}}, the competitive ratio is at least 1−18​qk118𝑞𝑘1-18{q\over k}. + +In Lottery-MUDA, the efficient sellers in S∗Lsuperscriptsubscript𝑆𝐿S_{*}^{L} have to compete with the inefficient sellers in S+Lsuperscriptsubscript𝑆𝐿S_{+}^{L} in the random lottery. The expected number of efficient deals carried out is thus:|BL||S+L|+|S∗L|≥k/2−9​qk/2+9​q≥k2−18​qsuperscript𝐵𝐿superscriptsubscript𝑆𝐿superscriptsubscript𝑆𝐿𝑘29𝑞𝑘29𝑞𝑘218𝑞\displaystyle{|B^{L}|\over|S_{+}^{L}|+|S_{*}^{L}|}\geq{k/2-9q\over k/2+9q}\geq{k\over 2}-18qTherefore, w.p. 1−8​e−2​m​q2M2​k18superscript𝑒2𝑚superscript𝑞2superscript𝑀2𝑘1-8e^{{-2mq^{2}\over M^{2}k}},the expected competitive ratio is at least 1−36​qk136𝑞𝑘1-36{q\over k}. So w.p. 1, the expected competitive ratio is at least1−8​e−2​m​q2M2​k−36​qk18superscript𝑒2𝑚superscript𝑞2superscript𝑀2𝑘36𝑞𝑘1-8e^{{-2mq^{2}\over M^{2}k}}-36{q\over k}. + +All our analysis so far holds simultaneously for every q