ZHANGYUXUAN-zR commited on
Commit
1547e7b
·
verified ·
1 Parent(s): 19a457c

Add files using upload-large-folder tool

Browse files
parse/train/H1x-x309tm/H1x-x309tm.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1x-x309tm/H1x-x309tm_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1x-x309tm/H1x-x309tm_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1x-x309tm/H1x-x309tm_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/eVuMspr9cu5/eVuMspr9cu5.md ADDED
@@ -0,0 +1,263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CATs: Cost Aggregation Transformers for Visual Correspondence
2
+
3
+ Seokju Cho∗ Yonsei University
4
+
5
+ Sunghwan Hong∗ Korea University
6
+
7
+ Sangryul Jeon Yonsei University
8
+
9
+ Yunsung Lee Korea University
10
+
11
+ Kwanghoon Sohn Yonsei University
12
+
13
+ Seungryong Kim† Korea University
14
+
15
+ # Abstract
16
+
17
+ We propose a novel cost aggregation network, called Cost Aggregation Transformers (CATs), to find dense correspondences between semantically similar images with additional challenges posed by large intra-class appearance and geometric variations. Cost aggregation is a highly important process in matching tasks, which the matching accuracy depends on the quality of its output. Compared to handcrafted or CNN-based methods addressing the cost aggregation, in that either lacks robustness to severe deformations or inherit the limitation of CNNs that fail to discriminate incorrect matches due to limited receptive fields, CATs explore global consensus among initial correlation map with the help of some architectural designs that allow us to fully leverage self-attention mechanism. Specifically, we include appearance affinity modeling to aid the cost aggregation process in order to disambiguate the noisy initial correlation maps and propose multi-level aggregation to efficiently capture different semantics from hierarchical feature representations. We then combine with swapping self-attention technique and residual connections not only to enforce consistent matching, but also to ease the learning process, which we find that these result in an apparent performance boost. We conduct experiments to demonstrate the effectiveness of the proposed model over the latest methods and provide extensive ablation studies. Code and trained models are available at https://sunghwanhong.github.io/CATs/.
18
+
19
+ # 1 Introduction
20
+
21
+ Establishing dense correspondences across semantically similar images can facilitate many Computer Vision applications, including semantic segmentation [46, 54, 36], object detection [29], and image editing [53, 30, 28, 25]. Unlike classical dense correspondence problems that consider visually similar images taken under the geometrically constrained settings [16, 19, 50, 18], semantic correspondence poses additional challenges from large intra-class appearance and geometric variations caused by the unconstrained settings of given image pair.
22
+
23
+ Recent approaches [42, 43, 45, 34, 37, 39, 31, 58, 47, 57, 51, 35] addressed these challenges by carefully designing deep convolutional neural networks (CNNs)-based models analogously to the classical matching pipeline [48, 41], feature extraction, cost aggregation, and flow estimation. Several works [24, 9, 37, 39, 47, 51] focused on the feature extraction stage, as it has been proven that the more powerful feature representation the model learns, the more robust matching is obtained [24, 9, 51]. However, solely relying on the matching similarity between features without any prior often suffers from the challenges due to ambiguities generated by repetitive patterns or background clutters [42, 24, 26]. On the other hand, some methods [42, 49, 43, 23, 26, 58] focused on flow estimation stage either by designing additional CNN as an ad-hoc regressor that predicts the parameters of a single global transformation [42, 43], finding confident matches from correlation maps [20, 26], or directly feeding the correlation maps into the decoder to infer dense correspondences [58]. However, these methods highly rely on the quality of the initial correlation maps.
24
+
25
+ The latest methods [45, 37, 44, 21, 31, 27, 35] have focused on the second stage, highlighting the importance of cost aggregation. Since the quality of correlation maps is of prime importance, they proposed to refine the matching scores by formulating the task as optimal transport problem [47, 31], re-weighting matching scores by Hough space voting for geometric consistency [37, 39], or utilizing high-dimensional 4D or 6D convolutions to find locally consistent matches [45, 44, 27, 35]. Although formulated variously, these methods either use hand-crafted techniques that are neither learnable nor robust to severe deformations, or inherit the limitation of CNNs, e.g., limited receptive fields, failing to discriminate incorrect matches that are locally consistent.
26
+
27
+ In this work, we focus on the cost aggregation stage, and propose a novel cost aggregation network to tackle aforementioned issues. Our network, called Cost Aggregation with Transformers (CATs), is based on Transformer [61, 10], which is renowned for its global receptive field. By considering all the matching scores computed between features of input images globally, our aggregation networks explore global consensus and thus refine the ambiguous or noisy matching scores effectively.
28
+
29
+ Specifically, based on the observation that desired correspondence should be aligned at discontinuities with appearance of images, we concatenate an appearance embedding with the correlation map, which helps to disambiguate the correlation map within the Transformer. To benefit from hierarchical feature representations, following [26, 39, 58], we use a stack of correlation maps constructed from multilevel features, and propose to effectively aggregate the scores across the multi-level correlation maps. Furthermore, we consider bidirectional nature of correlation map, and leverage the correlation map from both directions, obtaining reciprocal scores by swapping the pair of dimensions of correlation map in order to allow global consensus in both perspective. In addition to all these combined, we provide residual connections around aggregation networks in order to ease the learning process.
30
+
31
+ We demonstrate our method on several benchmarks [38, 11, 12]. Experimental results on various benchmarks prove the effectiveness of the proposed model over the latest methods for semantic correspondence. We also provide an extensive ablation study to validate and analyze components in CATs.
32
+
33
+ # 2 Related Work
34
+
35
+ Semantic Correspondence. Methods for semantic correspondence generally follow the classical matching pipeline [48, 41], including feature extraction, cost aggregation, and flow estimation. Most early efforts [7, 30, 11] leveraged the hand-crafted features which are inherently limited in capturing high-level semantics. Though using deep CNN-based features [5, 24, 42, 43, 23, 49, 26] has become increasingly popular thanks to their invariance to deformations, without a means to refine the matching scores independently computed between the features, the performance would be rather limited.
36
+
37
+ To alleviate this, several methods focused on flow estimation stage. Rocco et al. [42, 43] proposed an end-to-end network to predict global transformation parameters from the matching scores, and their success inspired many variants [49, 23, 25]. RTNs [23] obtain semantic correspondences through an iterative process of estimating spatial transformations. DGC-Net [34], Semantic-GLU-Net [58] and DMP [15] utilize a CNN-based decoder to directly find correspondence fields. PDC-Net [59] proposed a flexible probabilistic model that jointly learns the flow estimation and its uncertainty. Arguably, directly regressing correspondences from the initial matching scores highly relies on the quality of them.
38
+
39
+ Recent numerous methods [45, 37, 39, 31, 47, 51, 35] thus have focused on cost aggregation stage to refine the initial matching scores. Among hand-crafted methods, SCOT [31] formulates semantic correspondence as an optimal transport problem and attempts to solve two issues, namely many to one matching and background matching. HPF [37] first computes appearance matching confidence using hyperpixel features and then uses Regularized Hough Matching (RHM) algorithm for cost aggregation to enforce geometric consistency. DHPF [39], that replaces feature selection algorithm of HPF [37] with trainable networks, also uses RHM. However, these hand-crafted techniques for refining the matching scores are neither learnable nor robust to severe deformations. As learningbased approaches, NC-Net [45] utilizes 4D convolution to achieve local neighborhood consensus by finding locally consistent matches, and its variants [44, 27] proposed more efficient methods. GOCor [57] proposed aggregation module that directly improves the correlation maps. GSF [21] formulated pruning module to suppress false positives of correspondences in order to refine the initial correlation maps. CHM [35] goes one step further, proposing a learnable geometric matching algorithm which utilizes 6D convolution. However, they are all limited in the sense that they inherit limitation of CNN-based architectures, which is local receptive fields.
40
+
41
+ ![](images/68593a83af1c0d0320e95acf250abac804be4699416bd99ef0b18fc88e8a0b39.jpg)
42
+ Figure 1: Overall network architecture. Our networks consist of feature extraction, cost aggregation, and flow estimation modules. We first extract multi-level dense features and construct a stack of correlation maps. We then concatenate with embedded features and feed into the Transformer-based cost aggregator to obtain a refined correlation map. The flow is then inferred from the refined map.
43
+
44
+ Transformers in Vision. Transformer [61], the de facto standard for Natural Language Processing (NLP) tasks, has recently imposed significant impact on various tasks in Computer Vision fields such as image classification [10, 55], object detection [3, 62], tracking and matching [52, 51]. ViT [10], the first work to propose an end-to-end Transformer-based architecture for the image classification task, successfully extended the receptive field, owing to its self-attention nature that can capture global relationship between features. For visual correspondence, LoFTR [51] uses cross and self-attention module to refine the feature maps conditioned on both input images, and formulate the hand-crafted aggregation layer with dual-softmax [45, 60] and optimal transport [47] to infer correspondences. COTR [22] takes coordinates as an input and addresses dense correspondence task without the use of correlation map. Unlike these, for the first time, we propose a Transformer-based cost aggregation module.
45
+
46
+ # 3 Methodology
47
+
48
+ # 3.1 Motivation and Overview
49
+
50
+ Let us denote a pair of images, i.e., source and target, as $I _ { s }$ and $I _ { t }$ , which represent semantically similar images, and features extracted from $I _ { s }$ and $I _ { t }$ as $D _ { s }$ and $D _ { t }$ , respectively. Here, our goal is to establish a dense correspondence field $F ( i )$ between two images that is defined for each pixel $i$ , which warps $I _ { t }$ towards $I _ { s }$ .
51
+
52
+ Estimating the correspondence with sole reliance on matching similarities between $D _ { s }$ and $D _ { t }$ is often challenged by the ambiguous matches due to the repetitive patterns or background clutters [42, 24, 26]. To address this, numerous methods proposed cost aggregation techniques that focus on refining the initial matching similarities either by formulating the task as optimal transport problem [47, 31], using regularized Hough matching to re-weight the costs [37, 39], or 4D or 6D convolutions [45, 27, 44, 35]. However, these methods either use hand-crafted techniques that are weak to severe deformations, or fail to discriminate incorrect matches due to limited receptive fields.
53
+
54
+ ![](images/b924b9258fa5e27a628a7e8fd0ffb42d53d6bcd8f80e35a1b93e885925f068e0.jpg)
55
+ Figure 2: Visualization of correlation map and self-attention: (a) source image, (b) target image, (c) raw correlation map, (d) self-attention, (e) refined correlation map, and (f) ground-truth, which are bilinearly upsampled. The visualization proves that CATs successfully aggregates the costs by integrating the surrounding information of the query, represented as green circle in the source.
56
+
57
+ To overcome these, we present Transformer-based cost aggregation networks that effectively integrate information present in all pairwise matching costs, dubbed CATs, as illustrated in Fig. 1. As done widely in other works [42, 45, 50, 34, 37], we follow the common practice for feature extraction and cost computation. In the following, we first explain feature extraction and cost computation, and then describe several critical design choices we made for effective aggregation of the matching costs.
58
+
59
+ # 3.2 Feature Extraction and Cost Computation
60
+
61
+ To extract dense feature maps from images, we follow [26, 37, 39] that use multi-level features for construction of correlation maps. We use CNNs that produce a sequence of $L$ feature maps, and $D ^ { l }$ represents a feature map at $l$ -th level. As done in [37], we use different combination of multi-level features depending on the dataset trained on, e.g., PF-PASCAL [12] or SPair-71k [38]. Given a sequence of feature maps, we resize all the selected feature maps to $\mathbb { R } ^ { h \times w \times c }$ , with height $h$ , width $w$ and $c$ channels. The resized features then undergo $l$ -2 normalization.
62
+
63
+ Given resized dense features $D _ { s }$ and $D _ { t }$ , we compute a correlation map $\mathcal { C } \in \mathbb { R } ^ { h w \times h w }$ using the inner product between features: $\mathcal { C } ( i , j ) = D _ { t } ( i ) \cdot D _ { s } ( j )$ with points $i$ and $j$ in the target and source features, respectively. In this way, all pairwise feature matches are computed and stored. However, raw matching scores contain numerous ambiguous matching points as exemplified in Fig. 2, which results inaccurate correspondences. To remedy this, we propose cost aggregation networks in the following that aim to refine the ambiguous or noisy matching scores.
64
+
65
+ # 3.3 Transformer Aggregator
66
+
67
+ Renowned for its global receptive fields, one of the key elements of Transformer [61] is the selfattention mechanism, which enables finding the correlated input tokens by first feeding into scaled dot product attention function, normalizing with Layer Normalization (LN) [1], and passing the normalized values to a MLP. Several works [10, 3, 62, 51] have shown that given images or features as input, Transformers [61] integrate the global information in a flexible manner by learning to find the attention scores for all pairs of tokens.
68
+
69
+ In this paper, we leverage the Transformers to integrate the matching scores to discover global consensus by considering global context information. Specifically, we obtain a refined cost $\scriptstyle { \mathcal { C } } ^ { \prime }$ by feeding the raw cost $\mathcal { C }$ to the Transformer $\tau$ , consisting of self-attention, LN, and MLP modules:
70
+
71
+ $$
72
+ \begin{array} { r } { \mathcal { C } ^ { \prime } = \mathcal { T } ( \mathcal { C } + E _ { \mathrm { p o s } } ) , } \end{array}
73
+ $$
74
+
75
+ where $E _ { \mathrm { p o s } }$ denotes positional embedding. The standard Transformer receives as input a 1D sequence of token embeddings. In our context, we reshape the correlation map $\mathcal { C }$ into a sequence of vectors $\mathcal { C } ( k ) \in \mathbb { R } ^ { 1 \times h w }$ for $k \in \{ 1 , . . . , h w \}$ . We visualize the refined correlation map with self-attention in Fig. 2, where the ambiguities are significantly resolved.
76
+
77
+ Appearance Affinity Modeling. When only matching costs are considered for aggregation, selfattention layer processes the correlation map itself disregarding the noise involved in the correlation map, which may lead to inaccurate correspondences. Rather than solely relying on raw correlation map, we additionally provide an appearance embedding from input features to disambiguate the correlation map aided by appearance affinity within the Transformer. Intuition behind is that visually similar points in an image, e.g., color or feature, have similar correspondences, as proven in stereo matching literature, e.g., Cost Volume Filtering (CVF) [16, 50].
78
+
79
+ ![](images/d4f0838acb1454fc93eaaa71ab9d22a6ea1293b72e2cc408fcfc9066efe9a723.jpg)
80
+ Figure 3: Illustration of Transformer aggregator. Given correlation maps $\mathcal { C }$ with projected features, Transformer aggregation consisting of intra- and inter-correlation self-attention with LN and MLP refines the inputs not only across spatial domains but across levels.
81
+
82
+ To provide appearance affinity, we propose to concatenate embedded features projected from input features with the correlation map. We first feed the features $D$ into linear projection networks, and then concatenate the output along corresponding dimension, so that the correlation map is augmented such that $[ \mathcal { C } , \mathcal { P } ( D ) ] \in \bar { \mathbb { R } } ^ { h w \times ( h \bar { w } + p ) }$ , where $[ \cdot ]$ denotes concatenation, $\mathcal { P }$ denotes linear projection networks, and $p$ is channel dimension of embedded feature. Within the Transformer, self-attention layer aggregates the correlation map and passes the output to the linear projection networks to retain the size of original correlation $\mathcal { C }$ .
83
+
84
+ Multi-Level Aggregation. As shown in [37, 34, 39, 58, 31], leveraging multi-level features allows capturing hierarchical semantic feature representations. Thus we also use multi-level features from different levels of convolutional layers to construct a stack of correlation maps. Each correlation map $\mathcal { C } ^ { l }$ computed between $D _ { s } ^ { l }$ and $D _ { \mathrm { \it t } } ^ { l }$ is concatenated with corresponding embedded features and fed into the aggregation networks. The aggregation networks now consider multiple correlations, aiming to effectively aggregates the matches by the hierarchical semantic representations.
85
+
86
+ As shown in Fig. 3, a stack of $L$ augmented correlation maps, $[ \mathcal { C } ^ { l } , \mathcal { P } ( D ^ { l } ) ] _ { l = 1 } ^ { L } \in \mathbb { R } ^ { h w \times ( h w + p ) \times L }$ , undergo the Transformer aggregator. For each $l$ -th augmented correlation map, we aggregate with self-attention layer across all the points in the augmented correlation map, and we refer this as intra-correlation self-attention. In addition, subsequent to this, the correlation map undergoes intercorrelation self-attention across multi-level dimensions. Contrary to HPF [37] that concatenates all the multi-level features and compute a correlation map, which disregards the level-wise similarities, within the inter-correlation layer of the proposed model, the similar matching scores are explored across multi-level dimensions. In this way, we can embrace richer semantics in different levels of feature maps, as shown in Fig. 4.
87
+
88
+ # 3.4 Cost Aggregation with Transformers
89
+
90
+ By leveraging the Transformer aggregator, we present cost aggregation framework with following additional techniques to improve the performance.
91
+
92
+ Swapping Self-Attention. To obtain a refined correlation map invariant to order of the input images and impose consistent matching scores, we argue that reciprocal scores should be used as aids to infer confident correspondences. As correlation map contains bidirectional matching scores, from both target and source perspective, we can leverage matching similarities from both directions in order to obtain more reciprocal scores as done similarly in other works [45, 26].
93
+
94
+ As shown in Fig. 1, we first feed the augmented correlation map to the aforementioned Transformer aggregator. Then we transpose the output, swapping the pair of dimensions in order to concatenate with the embedded feature from the other image, and feed into the subsequent another aggregator. Note that we share the parameters of the Transformer aggregators to obtain reciprocal scores. Formally, we define the whole process as following:
95
+
96
+ $$
97
+ \begin{array} { r l } & { \boldsymbol { \mathcal { S } } = \mathcal { T } ( [ \mathcal { C } ^ { l } , \mathcal { P } ( D _ { t } ^ { l } ) ] _ { l = 1 } ^ { L } + E _ { \mathrm { p o s } } ) , } \\ & { \boldsymbol { \mathcal { C } } ^ { \prime } = \mathcal { T } ( [ ( \boldsymbol { \mathcal { S } } ^ { l } ) ^ { \mathrm { T } } , \mathcal { P } ( D _ { s } ^ { l } ) ] _ { l = 1 } ^ { L } + E _ { \mathrm { p o s } } ) , } \end{array}
98
+ $$
99
+
100
+ where $\begin{array} { r } { \mathcal { C } ^ { \mathrm { T } } ( i , j ) = \mathcal { C } ( j , i ) } \end{array}$ denotes swapping the pair of dimensions corresponding to the source and target images; $s$ denotes the intermediate correlation map before swapping the axis. Note that NC-Net [45] proposed a similar procedure, but instead of processing serially, they separately process the correlation map and its transposed version and add the outputs, which is designed to produce a correlation map invariant to the particular order of the input images. Unlike this, we process the correlation map serially, first aggregating one pair of dimensions and then further aggregating with respect to the other pair. In this way, the subsequent attention layer is given more consistent matching scores as an input, allowing further reduction of inconsistent matching scores. We include an ablation study to justify our choice in Section 4.4
101
+
102
+ ![](images/32d639afbe84467ac5dcf588ab8737aad1a574ee73db333eb6b50c7e31118b09.jpg)
103
+ Figure 4: Visualization of multi-level aggregation: (a) source, (b) target images, (c), (d) multi-level correlation maps (e.g., $l = 1$ and $l = 3$ ), respectively, and final correlation maps by (e) HPF [37] and (f) CATs. Note that HPF and CATs utilize the same feature maps. Compared to HPF, CATs successfully embrace richer semantics in different levels of feature map.
104
+
105
+ Residual Connection. At the initial phase when the correlation map is fed into the Transformers, noisy score maps are inferred due to randomly-initialized parameters, which could complicate the learning process. To stabilize the learning process and provide a better initialization for the matching, we employ the residual connection. Specifically, we enforce the cost aggregation networks to estimate the residual correlation by adding residual connection around aggregation networks.
106
+
107
+ # 3.5 Training
108
+
109
+ Data Augmentation. Transformer is well known for lacking some of inductive bias and its datahungry nature thus necessitates a large quantity of training data to be fed [61, 10]. Recent methods [55, 56, 32] that employ the Transformer to address Computer Vision tasks have empirically shown that data augmentation techniques have positive impact on performance. However, in correspondence task, the question of to what extent can data augmentation affect the performance has not yet been properly addressed. From the experiments, we empirically find that data augmentation has positive impacts on performance in semantic correspondence with Transformers as reported in Section 4.4. To apply data augmentation [6, 2] with predetermined probabilities to input images at random. Specifically, $5 0 \%$ of the time, we randomly crop the input image, and independently for each augmentation function used in [6], we set the probability for applying the augmentation as $2 0 \%$ . More details can be found in supplementary material.
110
+
111
+ Training Objective. As in [37, 39, 35], we assume that the ground-truth keypoints are given for each pair of images. We first average the stack of refined correlation maps $\mathcal { C } ^ { \prime } \in \overline { { \mathbb { R } } } ^ { h w \times h w \times L }$ to obtain $\mathcal { C } ^ { \prime \prime } \in \overset { \cdot } { \mathbb { R } } ^ { h w \times h w }$ and then transform it into a dense flow field $F _ { \mathrm { p r e d } }$ using soft-argmax operator [26]. Subsequently, we compare the predicted dense flow field with the ground-truth flow field $F _ { \mathrm { G T } }$ obtained by following the protocol of [37] using input keypoints. For the training objective, we utilize Average End-Point Error (AEPE) [34], computed by averaging the Euclidean distance between the ground-truth and estimated flow. We thus formulate the objective function as $\mathcal { L } = \| F _ { \mathrm { G T } } - F _ { \mathrm { p r e d } } \| _ { 2 }$ .
112
+
113
+ # 4 Experiments
114
+
115
+ # 4.1 Implementation Details
116
+
117
+ For backbone feature extractor, we use ResNet-101 [14] pre-trained on ImageNet [8], and following [37], extract the features from the best subset layers. Other backbone features can also be used, which we analyze the effect of various backbone features in the following ablation study. For the hyper-parameters for Transformer encoder, we set the depth as 1 and the number of heads as 6. We resize the spatial size of the input image pairs to $2 5 6 \times 2 5 6$ and a sequence of selected features are resized to $1 6 \times 1 6$ . We use a learnable positional embedding [10], instead of fixed [61]. We implemented our network using PyTorch [40], and AdamW [33] optimizer with an initial learning rate of 3e−5 for the CATs layers and 3e−6 for the backbone features are used, which we gradually decrease during training.
118
+
119
+ Table 1: Quantitative evaluation on standard benchmarks [38, 11, 12]. Higher PCK is better. The best results are in bold, and the second best results are underlined. CATs† means CATs without fine-tuning feature backbone. Feat.-level: Feature-level, FT. feat.: Fine-tune feature.
120
+
121
+ <table><tr><td rowspan="2">Methods</td><td rowspan="2">Feat.-level</td><td rowspan="2">FT. feat.</td><td rowspan="2">Aggregation</td><td rowspan="2">SPair-71k [38] PCK @ αbbox 0.1</td><td colspan="2">PF-PASCAL [12] PCK @ Qimg</td><td rowspan="2"></td><td colspan="2">PF-WILLOW[11]</td></tr><tr><td>0.05</td><td>0.1 0.15</td><td>PCK @ αbbox 0.05</td><td>0.1 0.15</td></tr><tr><td>WTA</td><td>Single</td><td>X</td><td>■</td><td>25.7</td><td>35.2</td><td>53.3</td><td>62.8</td><td>24.7 46.9</td><td>59.0</td></tr><tr><td>CNNGeo [42]</td><td>Single</td><td>X</td><td></td><td>20.6</td><td>41.0</td><td>69.5</td><td>80.4</td><td>36.9 69.2</td><td>77.8</td></tr><tr><td>A2Net [49]</td><td>Single</td><td>X</td><td></td><td>22.3</td><td>42.8</td><td>70.8</td><td>83.3</td><td>36.3 68.8</td><td>84.4</td></tr><tr><td>WeakAlign [43]</td><td>Single</td><td>X</td><td></td><td>20.9</td><td>49.0</td><td>74.8</td><td>84.0</td><td>37.0 70.2</td><td>79.9</td></tr><tr><td>RTNs [23]</td><td>Single</td><td>X</td><td></td><td>25.7</td><td>55.2</td><td>75.9</td><td>85.2</td><td>41.3 71.9</td><td>86.2</td></tr><tr><td>SFNet [26]</td><td>Multi</td><td>X</td><td></td><td>-</td><td>53.6</td><td>81.9</td><td>90.6</td><td>46.3 74.0</td><td>84.2</td></tr><tr><td>NC-Net [45]</td><td>Single</td><td>√</td><td>4D Conv.</td><td>20.1</td><td>54.3</td><td>78.9</td><td>86.0</td><td>33.8 67.0</td><td>83.7</td></tr><tr><td>DCC-Net[17]</td><td>Single</td><td>X</td><td>4D Conv.</td><td>=</td><td>55.6</td><td>82.3</td><td>90.5</td><td>43.6 73.8</td><td>86.5</td></tr><tr><td>HPF[37]</td><td>Multi</td><td>-</td><td>RHM</td><td>28.2</td><td>60.1</td><td>84.8</td><td>92.7</td><td>45.9 74.4</td><td>85.6</td></tr><tr><td>GSF [21]</td><td>Multi</td><td>X</td><td>2D Conv.</td><td>36.1</td><td>65.6</td><td>87.8</td><td>95.9</td><td>49.1 78.7</td><td>90.2</td></tr><tr><td>ANC-Net [27]</td><td>Single</td><td>X</td><td>4D Conv.</td><td>-</td><td>-</td><td>86.1</td><td></td><td>=</td><td>=</td></tr><tr><td>DHPF [39]</td><td>Multi</td><td>X</td><td>RHM</td><td>37.3</td><td>75.7</td><td>90.7</td><td>95.0</td><td>49.5 77.6</td><td>89.1</td></tr><tr><td>SCOT[31]</td><td>Multi</td><td>-</td><td>OT-RHM</td><td>35.6</td><td>63.1</td><td>85.4</td><td>92.7</td><td>47.8 76.0</td><td>87.1</td></tr><tr><td>CHM[35]</td><td>Single</td><td>√</td><td>6D Conv.</td><td>46.3</td><td>80.1</td><td>91.6</td><td>94.9</td><td>52.7 79.4</td><td>87.5</td></tr><tr><td>CATst</td><td>Multi</td><td>X</td><td>Transformer</td><td>42.4</td><td>67.5</td><td>89.1</td><td>94.9</td><td>46.6 75.6</td><td>87.5</td></tr><tr><td>CATs</td><td>Multi</td><td></td><td>Transformer</td><td>49.9</td><td>75.4</td><td>92.6</td><td>96.4</td><td>50.3 79.2</td><td>90.3</td></tr></table>
122
+
123
+ Table 2: Per-class quantitative evaluation on SPair-71k [38] benchmark.
124
+
125
+ <table><tr><td>Methods</td><td>aero.</td><td>bike</td><td>bird</td><td>boat</td><td>bott.</td><td>bus</td><td>car</td><td>cat</td><td>chai.</td><td>cow</td><td>dog</td><td>hors.</td><td>mbik.</td><td>pers.</td><td>plan.</td><td>shee.</td><td>trai.</td><td>tv</td><td>all</td></tr><tr><td>CNNGeo [42]</td><td>23.4</td><td>16.7</td><td>40.2</td><td>14.3</td><td>36.4</td><td>27.7</td><td>26.0</td><td>32.7</td><td>12.7</td><td>27.4</td><td>22.8</td><td>13.7</td><td>20.9</td><td>21.0</td><td>17.5</td><td>10.2</td><td>30.8</td><td>34.1</td><td>20.6</td></tr><tr><td>A2Net[49]</td><td>22.6</td><td>18.5</td><td>42.0</td><td>16.4</td><td>37.9</td><td>30.8</td><td>26.5</td><td>35.6</td><td>13.3</td><td>29.6</td><td>24.3</td><td>16.0</td><td>21.6</td><td>22.8</td><td>20.5</td><td>13.5</td><td>31.4</td><td>36.5</td><td>22.3</td></tr><tr><td>WeakAlign [43]</td><td>22.2</td><td>17.6</td><td>41.9</td><td>15.1</td><td>38.1</td><td>27.4</td><td>27.2</td><td>31.8</td><td>12.8</td><td>26.8</td><td>22.6</td><td>14.2</td><td>20.0</td><td>22.2</td><td>17.9</td><td>10.4</td><td>32.2</td><td>35.1</td><td>20.9</td></tr><tr><td>NC-Net [45]</td><td>17.9</td><td>12.2</td><td>32.1</td><td>11.7</td><td>29.0</td><td>19.9</td><td>16.1</td><td>39.2</td><td>9.9</td><td>23.9</td><td>18.8</td><td>15.7</td><td>17.4</td><td>15.9</td><td>14.8</td><td>9.6</td><td>24.2</td><td>31.1</td><td>20.1</td></tr><tr><td>HPF[37]</td><td>25.2</td><td>18.9</td><td>52.1</td><td>15.7</td><td>38.0</td><td>22.8</td><td>19.1</td><td>52.9</td><td>17.9</td><td>33.0</td><td>32.8</td><td>20.6</td><td>24.4</td><td>27.9</td><td>21.1</td><td>15.9</td><td>31.5</td><td>35.6</td><td>28.2</td></tr><tr><td>SCOT[31]</td><td>34.9</td><td>20.7</td><td>63.8</td><td>21.1</td><td>43.5</td><td>27.3</td><td>21.3</td><td>63.1</td><td>20.0</td><td>42.9</td><td>42.5</td><td>31.1</td><td>29.8</td><td>35.0</td><td>27.7</td><td>24.4</td><td>48.4</td><td>40.8</td><td>35.6</td></tr><tr><td>DHPF[39]</td><td>38.4</td><td>23.8</td><td>68.3</td><td>18.9</td><td>42.6</td><td>27.9</td><td>20.1</td><td>61.6</td><td>22.0</td><td>46.9</td><td>46.1</td><td>33.5</td><td>27.6</td><td>40.1</td><td>27.6</td><td>28.1</td><td>49.5</td><td>46.5</td><td>37.3</td></tr><tr><td>CHM [35]</td><td>49.6</td><td>29.3</td><td>68.7</td><td>29.7</td><td>45.3</td><td>48.4</td><td>39.5</td><td>64.9</td><td>20.3</td><td>60.5</td><td>56.1</td><td>46.0</td><td>33.8</td><td>44.3</td><td>38.9</td><td>314</td><td>72.2</td><td>55.5</td><td>46.3</td></tr><tr><td>CATst</td><td>46.5</td><td>26.9</td><td>69.1</td><td>24.3</td><td>44.3</td><td>38.5</td><td>30.2</td><td>65.7</td><td>15.9</td><td>53.7</td><td>52.2</td><td>46.7</td><td>32.7</td><td>35.2</td><td>32.2</td><td>31.2</td><td>68.0</td><td>49.1</td><td>42.4</td></tr><tr><td>CATs</td><td>52.0</td><td>34.7</td><td>72.2</td><td>34.3</td><td>49.9</td><td>57.5</td><td>43.6</td><td>66.5</td><td>24.4</td><td>63.2</td><td>56.5</td><td>52.0</td><td>42.6</td><td>41.7</td><td>43.0</td><td>33.6</td><td>72.6</td><td>58.0</td><td>49.9</td></tr></table>
126
+
127
+ # 4.2 Experimental Settings
128
+
129
+ In this section, we conduct comprehensive experiments for semantic correspondence, by evaluating our approach through comparisons to state-of-the-art methods including CNNGeo [42], A2Net [49], WeakAlign [43], NC-Net [45], RTNs [23], SFNet [26], HPF [37], DCC-Net [17], ANC-Net [27], DHPF [39], SCOT [31], GSF [21], and CHMNet [35]. In Section 4.3, we first evaluate matching results on several benchmarks with quantitative measures, and then provide an analysis of each component in our framework in Section 4.4. For more implementation details, please refer to our implementation available at https://github.com/SunghwanHong/CATs.
130
+
131
+ Datasets. SPair-71k [38] provides total 70,958 image pairs with extreme and diverse viewpoint, scale variations, and rich annotations for each image pair, e.g., keypoints, scale difference, truncation and occlusion difference, and clear data split. Previously, for semantic matching, most of the datasets are limited to a small quantity with similar viewpoints and scales [11, 12]. As our network relies on Transformer which requires a large number of data for training, SPair-71k [38] makes the use of Transformer in our model feasible. we also consider PF-PASCAL [12] containing 1,351 image pairs from 20 categories and PF-WILLOW [11] containing 900 image pairs from 4 categories, each dataset providing corresponding ground-truth annotations.
132
+
133
+ Evaluation Metric. For evaluation on SPair-71k [38], PF-WILLOW [11], and PF-PASCAL [12], we employ a percentage of correct keypoints (PCK), computed as the ratio of estimated keypoints within the threshold from ground-truths to the total number of keypoints. Given predicted keypoint $k _ { \mathrm { p r e d } }$ and ground-truth keypoint $k _ { \mathrm { G T } }$ , we count the number of predicted keypoints that satisfy following condition: $d ( k _ { \mathrm { p r e d } } , k _ { \mathrm { G T } } ) \leq \alpha \cdot \operatorname* { m a x } ( H , W )$ , where $d ( \cdot )$ denotes Euclidean distance; $\alpha$ denotes a threshold which we evaluate on PF-PASCAL with $\alpha _ { \mathrm { i m g } }$ , SPair-71k and PF-WILLOW with $\alpha _ { \mathrm { b b o x } }$ ; $H$ and $W$ denote height and width of the object bounding box or entire image, respectively.
134
+
135
+ ![](images/1e7241ed9d73ab27ea4cb77e702b390c9c4b098c6437317372cdc6caff5a6072.jpg)
136
+ Figure 5: Qualitative results on SPair-71k [38]: (from top to bottom) keypoints transfer results by SCOT [31], DHPF [39], and CATs. Note that green and red line denotes correct and wrong prediction, respectively, with respect to the ground-truth.
137
+
138
+ # 4.3 Matching Results
139
+
140
+ For a fair comparison, we follow the evaluation protocol of [37] for SPair-71k, which our network is trained on the training split and evaluated on the test split. Similarly, for PF-PASCAL and PFWILLOW, following the common evaluation protocol of [13, 23, 17, 37, 39], we train our network on the training split of PF-PASCAL [12] and then evaluate on the test split of PF-PASCAL [12] and PF-WILLOW [11]. All the results of other methods are reported under identical setting.
141
+
142
+ Table 1 summarizes quantitative results on SPair-71k [38], PF-PASCAL [12] and PF-WILLOW [11]. We note whether each method leverages multi-level features and fine-tunes the backbone features in order to ensure a fair comparison. We additionally denote the types of cost aggregation. Generally, our CATs outperform other methods over all the benchmarks. This is also confirmed by the results on SPair-71k, as shown in Table 2, where the proposed method outperforms other methods by large margin. Note that CATs† reports lower PCK than that of CHM, and this is because CHM fine-tunes its backbone networks while CATs† does not. Fig. 5 visualizes qualitative results for extremely challenging image pairs. We observe that compared to current state-of-the-art methods [31, 39], our method is capable of suppressing noisy scores and find accurate correspondences in cases with large scale and geometric variations.
143
+
144
+ It is notable that CATs generally report lower PCK on PF-WILLOW [11] compared to other stateof-the-art methods. This is because the Transformer is well known for lacking some of inductive bias. When we evaluate on PF-WILLOW, we infer with the model trained on the training split of PFPASCAL, which only contains 1,351 image pairs, and as only relatively small quantity of image pairs is available within the PF-PASCAL training split, the Transformer shows low generalization power. This demonstrates that the Transformer-based architecture indeed requires a means to compensate for the lack of inductive bias, e.g., data augmentation.
145
+
146
+ # 4.4 Ablation Study
147
+
148
+ In this section we show an ablation analysis to validate critical components we made to design our architecture, and provide an analysis on use of different backbone features, and data augmentation. We train all the variants on the training split of SPair-71k [38] when evaluating on SPair-71k, and train on PF-PASCAL [12] for evaluating on PF-PASCAL. We measure the PCK, and each ablation experiment is conducted under same experimental setting for a fair comparison.
149
+
150
+ Network Architecture. Table 3 shows the analysis on key components in our architecture. There are four key components we analyze for the ablation study, including appearance modelling, multilevel aggregation, swapping self-attention, and residual connection.
151
+
152
+ We first define the model without any of these as baseline, which simply feeds the correlation map into the selfattention layer. We evaluate on SPair-71k benchmark by progressively adding the each key component. From I to $\mathbf { V }$ , we observe consistent increase in performance when each component is added. II shows a large improvement in performance, which demonstrates that the appearance modelling enabled the model to refine the ambiguous or noisy matching scores. Although relatively small increase in PCK for III, it proves that the proposed model successfully aggregates the multi-level correlation maps. Furthermore, $\mathbf { I V }$ and $\mathbf { V }$ show apparent increase, proving the significance of both components.
153
+
154
+ Table 3: Ablation study of CATs.
155
+
156
+ <table><tr><td>Components</td><td>SPair-71k Qbbox =0.1</td></tr><tr><td>(I) Baseline</td><td>26.8</td></tr><tr><td>(II) + Appearance Modelling</td><td>33.5</td></tr><tr><td>(IⅢI) + Multi-level Aggregation</td><td>35.9</td></tr><tr><td>(IV) + Swapping Self-Attention</td><td>38.8</td></tr><tr><td>(V + Residual Connection</td><td>42.4</td></tr></table>
157
+
158
+ Feature Backbone. As shown in Table 4, we explore the impact of different feature backbones on the performance on SPair-71k [38] and PF-PASCAL [12]. We report the results of models with backbone networks frozen. The top two rows are models with DeiT-B [55], next two rows use DINO [4], and the rest use ResNet101 [14] as backbone. Specifically, subscript single for DeiT-B and DINO, we use the feature map extracted at the last layer for the singlelevel, while for subscript all, every feature map
159
+
160
+ Table 4: Ablation study of feature backbone.
161
+
162
+ <table><tr><td>Feature Backbone</td><td>SPair-71k @bbox = 0.1</td><td>PF-PASCAL Qimg= 0.1</td></tr><tr><td>DeiT-Bgingle[55]</td><td>32.1</td><td>76.5</td></tr><tr><td>DeiT-Bal1 [55]</td><td>38.2</td><td>87.5</td></tr><tr><td>DINO w/ ViT-B/16sing1e [4] DINO w/ViT-B/16a11 [4]</td><td>39.5</td><td>88.9</td></tr><tr><td></td><td>42.0</td><td>88.9</td></tr><tr><td>ResNet-101sing1e [14]</td><td>37.4</td><td>87.3</td></tr><tr><td>ResNet-101mu1ti[14]</td><td>42.4</td><td>89.1</td></tr></table>
163
+
164
+ from 12 layers is used for cost construction. For ResNet-101 subscript single, we use a single-level feature cropped at $\mathrm { c o n v 4 - 2 3 }$ , while for multi, we use the best layer subset provided by [37]. Summarizing the results, we observed that leveraging multi-level features showed apparent improvements in performance, proving effectiveness of multi-level aggregation introduced by our method. It is worth noting that DINO, which is more excel at dense tasks than DeiT-B, outperforms DeiT-B when applied to semantic matching. This indicates that fine-tuning the feature could enhance the performance. To best of our knowledge, we are the first to employ Transformer-based features for semantic matching. It would be an interesting setup to train an end-to-end Transformer-based networks, and we hope this work draws attention from community and made useful for future works.
165
+
166
+ Data Augmentation. In Table 5, we compared the PCK performance between our variants and DHPF [39]. We note if the model is trained with augmentation. For a fair comparison, we evaluate both DHPF [39] and CATs trained on SPair-71k [38] using strong supervision, which assumes that the ground-truth keypoints are given. The results show that compared to DHPF, a CNN-based method, data augmentation has a larger influence on CATs in terms of performance. This demonstrates that not only we eased the data-hunger problem inherent in Transformers, but also found that applying augmentations for matching has positive effects. Augmentation technique would bring a highly likely improvements in performance, and we hope that the future works benefit from this.
167
+
168
+ Table 5: Effects of augmentation.
169
+
170
+ <table><tr><td></td><td>Augment.</td><td>SPair-71k αbbox = 0.1</td></tr><tr><td>DHPF[39]</td><td></td><td>37.3</td></tr><tr><td>DHPF [39]</td><td>X</td><td>39.4</td></tr><tr><td>CATs</td><td>A</td><td>43.5</td></tr><tr><td>CATs</td><td></td><td>49.9</td></tr></table>
171
+
172
+ Serial swapping. It is apparent that Equation 2 is not designed for an order-invariant output. Different from NC-Net [45], we let the correlation map undergo the self-attention module in a serial manner. We conducted a simple experiment to compare the difference between each approach. From experiments, we obtained the results of parallel and serial processing on SPair-71k with $\alpha _ { \mathrm { b b o x } } = 0 . 1$ , which are PCK of 40.8 and 42.4, respectively. In light of this, although CATs may not support order invariance, adopting serial processing can obtain higher PCK as it has a better capability to reduce inconsistent matching scores by additionally processing the already processed cost map, which we finalize the architecture to include serial processing.
173
+
174
+ # 4.5 Analysis
175
+
176
+ Visualizing Self-Attention. We visualize the multi-level attention maps obtained from the Transformer aggregator. As shown in Fig. 6, the learned self-attention map at each level exhibits different aspect. With these self-attentions, our networks can leverage multi-level correlations to capture hierarchical semantic feature representations effectively.
177
+
178
+ ![](images/2ffe664b93bf2f6e2d7edc1c5df1dcfca3a13bad3fcff59bb6aa6ce38283bd12.jpg)
179
+ Figure 6: Visualization of self-attention: (from left to right) source and target images, and multilevel self-attentions. Note that each attention map attends different aspects, and CATs aggregates the cost leveraging hierarchical semantic representations.
180
+
181
+ Memory and run-time. In Table 6, we show the memory and run-time comparison to NCNet [45], SCOT [31], DHPF [39] and CHM [35] with CATs. For a fair comparison, the results are obtained using a single NVIDIA GeForce RTX 2080 Ti GPU and Intel Core i7-10700 CPU. We measure the inference time for both the process without counting feature extraction, and the whole process. Thanks to Transformers’ fast com
182
+
183
+ Table 6: Memory and run-time comparison. Inference time for aggregator is denoted by (·).
184
+
185
+ <table><tr><td></td><td>Aggregation</td><td>Memory [GB]</td><td>Run-time [ms]</td></tr><tr><td>NC-Net [45]</td><td>4D Conv.</td><td>1.2</td><td>193.3 (166.1)</td></tr><tr><td>SCOT [31]</td><td>OT-RHM</td><td>4.6</td><td>146.5 (81.6)</td></tr><tr><td>DHPF [39]</td><td>RHM</td><td>1.6</td><td>57.7 (29.5)</td></tr><tr><td>CHM [35]</td><td>6D Conv</td><td>1.6</td><td>47.2 (38.3)</td></tr><tr><td>CATs</td><td>Transformer</td><td>1.9</td><td>34.5 (7.4)</td></tr></table>
186
+
187
+ putation nature, compared to other methods, our method is beyond compare. We also find that compared to other cost aggregation methods including 4D, 6D convolutons, OT-RHM and RHM, ours show comparable efficiency in terms of computational cost. Note that NC-Net utilizes a single feature map while other methods utilize multi-level feature maps. We used the standard self-attention module for implementation, but more advanced and efficient transformer [32] architectures could reduce the overall memory consumption.
188
+
189
+ # 4.6 Limitations
190
+
191
+ One obvious limitation that CATs possess is that when applying the method to non-corresponding images, the proposed method would still deliver correspondences as it lacks power to ignore pixels that do not have correspondence at all. A straightforward solution would be to consider including a module to account for pixel-wise matching confidence. Another limitation of CATs would be its inability to address a task of finding accurate correspondences given multi-objects or non-corresponding objects. Addressing such challenges would be a promising direction for future work.
192
+
193
+ # 5 Conclusion
194
+
195
+ In this paper, we have proposed, for the first time, Transformer-based cost aggregation networks for semantic correspondence which enables aggregating the matching scores computed between input features, dubbed CATs. We have made several architectural designs in the network architecture, including appearance affinity modelling, multi-level aggregation, swapping self-attention, and residual correlation. We have shown that our method surpasses the current state-of-the-art in several benchmarks. Moreover, we have conducted extensive ablation studies to validate our choices and explore its capacity. A natural next step, which we leave for future work, is to examine how CATs could extend its domain to tasks including 3-D reconstruction, semantic segmentation and stitching, and to explore self-supervised learning.
196
+
197
+ # Acknowledgements
198
+
199
+ This research was supported by the MSIT, Korea, under the ICT Creative Consilience program (IITP-2021-2020-0-01819) and (No. 2020-0-00368, A Neural-Symbolic Model for Knowledge Acquisition and Inference Techniques) supervised by the IITP and National Research Foundation of Korea (NRF-2021R1C1C1006897).
200
+
201
+ References
202
+ [1] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
203
+ [2] Alexander Buslaev, Vladimir I Iglovikov, Eugene Khvedchenya, Alex Parinov, Mikhail Druzhinin, and Alexandr A Kalinin. Albumentations: fast and flexible image augmentations. Information, 2020.
204
+ [3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV. Springer, 2020.
205
+ [4] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. arXiv preprint arXiv:2104.14294, 2021.
206
+ [5] Christopher B Choy, JunYoung Gwak, Silvio Savarese, and Manmohan Chandraker. Universal correspondence network. NeurIPS, 29:2414–2422, 2016.
207
+ [6] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, 2020.
208
+ [7] Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In CVPR Workshops), 2005.
209
+ [8] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
210
+ [9] Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superpoint: Self-supervised interest point detection and description. In CVPR, 2018.
211
+ [10] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
212
+ [11] Bumsub Ham, Minsu Cho, Cordelia Schmid, and Jean Ponce. Proposal flow. In CVPR, 2016.
213
+ [12] Bumsub Ham, Minsu Cho, Cordelia Schmid, and Jean Ponce. Proposal flow: Semantic correspondences from object proposals. IEEE transactions on pattern analysis and machine intelligence, 2017.
214
+ [13] Kai Han, Rafael S Rezende, Bumsub Ham, Kwan-Yee K Wong, Minsu Cho, Cordelia Schmid, and Jean Ponce. Scnet: Learning semantic correspondence. In ICCV, 2017.
215
+ [14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
216
+ [15] Sunghwan Hong and Seungryong Kim. Deep matching prior: Test-time optimization for dense correspondence. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021.
217
+ [16] Asmaa Hosni, Christoph Rhemann, Michael Bleyer, Carsten Rother, and Margrit Gelautz. Fast cost-volume filtering for visual correspondence and beyond. PAMI, 2012.
218
+ [17] Shuaiyi Huang, Qiuyue Wang, Songyang Zhang, Shipeng Yan, and Xuming He. Dynamic context correspondence network for semantic alignment. In ICCV, 2019.
219
+ [18] Tak-Wai Hui, Xiaoou Tang, and Chen Change Loy. Liteflownet: A lightweight convolutional neural network for optical flow estimation. In CVPR, 2018.
220
+ [19] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. In CVPR, 2017.
221
+ [20] Sangryul Jeon, Seungryong Kim, Dongbo Min, and Kwanghoon Sohn. Parn: Pyramidal affine regression networks for dense semantic correspondence. In ECCV, 2018.
222
+ [21] Sangryul Jeon, Dongbo Min, Seungryong Kim, Jihwan Choe, and Kwanghoon Sohn. Guided semantic flow. In ECCV. Springer, 2020.
223
+ [22] Wei Jiang, Eduard Trulls, Jan Hosang, Andrea Tagliasacchi, and Kwang Moo Yi. Cotr: Correspondence transformer for matching across images. arXiv preprint arXiv:2103.14167, 2021.
224
+ [23] Seungryong Kim, Stephen Lin, Sang Ryul Jeon, Dongbo Min, and Kwanghoon Sohn. Recurrent transformer networks for semantic correspondence. In NeurIPS, 2018.
225
+ [24] Seungryong Kim, Dongbo Min, Bumsub Ham, Sangryul Jeon, Stephen Lin, and Kwanghoon Sohn. Fcss: Fully convolutional self-similarity for dense semantic correspondence. In CVPR, 2017.
226
+ [25] Seungryong Kim, Dongbo Min, Somi Jeong, Sunok Kim, Sangryul Jeon, and Kwanghoon Sohn. Semantic attribute matching networks. In CVPR, 2019.
227
+ [26] Junghyup Lee, Dohyung Kim, Jean Ponce, and Bumsub Ham. Sfnet: Learning object-aware semantic correspondence. In CVPR, 2019.
228
+ [27] Shuda Li, Kai Han, Theo W Costain, Henry Howard-Jenkins, and Victor Prisacariu. Correspondence networks with adaptive neighbourhood consensus. In CVPR, 2020.
229
+ [28] Jing Liao, Yuan Yao, Lu Yuan, Gang Hua, and Sing Bing Kang. Visual attribute transfer through deep image analogy. arXiv:1705.01088, 2017.
230
+ [29] Tsung-Yi Lin, Piotr Dollár, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In CVPR, 2017.
231
+ [30] Ce Liu, Jenny Yuen, and Antonio Torralba. Sift flow: Dense correspondence across scenes and its applications. IEEE transactions on pattern analysis and machine intelligence, 33(5):978–994, 2010.
232
+ [31] Yanbin Liu, Linchao Zhu, Makoto Yamada, and Yi Yang. Semantic correspondence as an optimal transport problem. In CVPR, 2020.
233
+ [32] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
234
+ [33] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv:1711.05101, 2017.
235
+ [34] Iaroslav Melekhov, Aleksei Tiulpin, Torsten Sattler, Marc Pollefeys, Esa Rahtu, and Juho Kannala. Dgc-net: Dense geometric correspondence network. In WACV, 2019.
236
+ [35] Juhong Min and Minsu Cho. Convolutional hough matching networks. arXiv preprint arXiv:2103.16831, 2021.
237
+ [36] Juhong Min, Dahyun Kang, and Minsu Cho. Hypercorrelation squeeze for few-shot segmentation. arXiv preprint arXiv:2104.01538, 2021.
238
+ [37] Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Hyperpixel flow: Semantic correspondence with multi-layer neural features. In ICCV, 2019.
239
+ [38] Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Spair-71k: A large-scale benchmark for semantic correspondence. arXiv preprint arXiv:1908.10543, 2019.
240
+ [39] Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Learning to compose hypercolumns for visual correspondence. In ECCV, 2020.
241
+ [40] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
242
+ [41] James Philbin, Ondrej Chum, Michael Isard, Josef Sivic, and Andrew Zisserman. Object retrieval with large vocabularies and fast spatial matching. In CVPR. IEEE, 2007.
243
+ [42] Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. Convolutional neural network architecture for geometric matching. In CVPR, 2017.
244
+ [43] Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. End-to-end weakly-supervised semantic alignment. In ´ CVPR, 2018.
245
+ [44] Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. Efficient neighbourhood consensus networks via ´ submanifold sparse convolutions. In ECCV, 2020.
246
+ [45] Ignacio Rocco, Mircea Cimpoi, Relja Arandjelovic, Akihiko Torii, Tomas Pajdla, and Josef Sivic. Neigh- ´ bourhood consensus networks. In NeurIPS, 2018.
247
+ [46] Michael Rubinstein, Armand Joulin, Johannes Kopf, and Ce Liu. Unsupervised joint object discovery and segmentation in internet images. In CVPR, 2013.
248
+ [47] Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superglue: Learning feature matching with graph neural networks. In CVPR, 2020.
249
+ [48] Daniel Scharstein and Richard Szeliski. A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. International journal of computer vision, 2002.
250
+ [49] Paul Hongsuck Seo, Jongmin Lee, Deunsol Jung, Bohyung Han, and Minsu Cho. Attentive semantic alignment with offset-aware correlation kernels. In ECCV, 2018.
251
+ [50] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In CVPR, 2018.
252
+ [51] Jiaming Sun, Zehong Shen, Yuang Wang, Hujun Bao, and Xiaowei Zhou. Loftr: Detector-free local feature matching with transformers. arXiv preprint arXiv:2104.00680, 2021.
253
+ [52] Peize Sun, Yi Jiang, Rufeng Zhang, Enze Xie, Jinkun Cao, Xinting Hu, Tao Kong, Zehuan Yuan, Changhu Wang, and Ping Luo. Transtrack: Multiple-object tracking with transformer. arXiv preprint arXiv:2012.15460, 2020.
254
+ [53] Richard Szeliski. Image alignment and stitching: A tutorial. Foundations and Trends® in Computer Graphics and Vision, 2006.
255
+ [54] Tatsunori Taniai, Sudipta N Sinha, and Yoichi Sato. Joint recovery of dense correspondence and cosegmentation in two images. In CVPR, 2016.
256
+ [55] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers and distillation through attention. arXiv preprint arXiv:2012.12877, 2020.
257
+ [56] Hugo Touvron, Matthieu Cord, Alexandre Sablayrolles, Gabriel Synnaeve, and Hervé Jégou. Going deeper with image transformers. arXiv preprint arXiv:2103.17239, 2021.
258
+ [57] Prune Truong, Martin Danelljan, Luc V Gool, and Radu Timofte. Gocor: Bringing globally optimized correspondence volumes into your neural network. In NeurIPS, 2020.
259
+ [58] Prune Truong, Martin Danelljan, and Radu Timofte. Glu-net: Global-local universal network for dense flow and correspondences. In CVPR, 2020.
260
+ [59] Prune Truong, Martin Danelljan, Luc Van Gool, and Radu Timofte. Learning accurate dense correspondences and when to trust them. arXiv preprint arXiv:2101.01710, 2021.
261
+ [60] Michał J Tyszkiewicz, Pascal Fua, and Eduard Trulls. Disk: Learning local features with policy gradient. arXiv preprint arXiv:2006.13566, 2020.
262
+ [61] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
263
+ [62] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020.
parse/train/eVuMspr9cu5/eVuMspr9cu5_content_list.json ADDED
@@ -0,0 +1,1179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "CATs: Cost Aggregation Transformers for Visual Correspondence ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 200,
8
+ 122,
9
+ 797,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Seokju Cho∗ Yonsei University ",
17
+ "bbox": [
18
+ 205,
19
+ 227,
20
+ 323,
21
+ 255
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Sunghwan Hong∗ Korea University ",
28
+ "bbox": [
29
+ 361,
30
+ 227,
31
+ 483,
32
+ 253
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Sangryul Jeon Yonsei University ",
39
+ "bbox": [
40
+ 524,
41
+ 227,
42
+ 642,
43
+ 253
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "Yunsung Lee Korea University ",
50
+ "bbox": [
51
+ 679,
52
+ 227,
53
+ 792,
54
+ 255
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "Kwanghoon Sohn Yonsei University ",
61
+ "bbox": [
62
+ 307,
63
+ 275,
64
+ 431,
65
+ 303
66
+ ],
67
+ "page_idx": 0
68
+ },
69
+ {
70
+ "type": "text",
71
+ "text": "Seungryong Kim† Korea University ",
72
+ "bbox": [
73
+ 571,
74
+ 275,
75
+ 694,
76
+ 304
77
+ ],
78
+ "page_idx": 0
79
+ },
80
+ {
81
+ "type": "text",
82
+ "text": "Abstract ",
83
+ "text_level": 1,
84
+ "bbox": [
85
+ 462,
86
+ 339,
87
+ 535,
88
+ 356
89
+ ],
90
+ "page_idx": 0
91
+ },
92
+ {
93
+ "type": "text",
94
+ "text": "We propose a novel cost aggregation network, called Cost Aggregation Transformers (CATs), to find dense correspondences between semantically similar images with additional challenges posed by large intra-class appearance and geometric variations. Cost aggregation is a highly important process in matching tasks, which the matching accuracy depends on the quality of its output. Compared to handcrafted or CNN-based methods addressing the cost aggregation, in that either lacks robustness to severe deformations or inherit the limitation of CNNs that fail to discriminate incorrect matches due to limited receptive fields, CATs explore global consensus among initial correlation map with the help of some architectural designs that allow us to fully leverage self-attention mechanism. Specifically, we include appearance affinity modeling to aid the cost aggregation process in order to disambiguate the noisy initial correlation maps and propose multi-level aggregation to efficiently capture different semantics from hierarchical feature representations. We then combine with swapping self-attention technique and residual connections not only to enforce consistent matching, but also to ease the learning process, which we find that these result in an apparent performance boost. We conduct experiments to demonstrate the effectiveness of the proposed model over the latest methods and provide extensive ablation studies. Code and trained models are available at https://sunghwanhong.github.io/CATs/. ",
95
+ "bbox": [
96
+ 232,
97
+ 371,
98
+ 766,
99
+ 633
100
+ ],
101
+ "page_idx": 0
102
+ },
103
+ {
104
+ "type": "text",
105
+ "text": "1 Introduction ",
106
+ "text_level": 1,
107
+ "bbox": [
108
+ 174,
109
+ 659,
110
+ 310,
111
+ 676
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "Establishing dense correspondences across semantically similar images can facilitate many Computer Vision applications, including semantic segmentation [46, 54, 36], object detection [29], and image editing [53, 30, 28, 25]. Unlike classical dense correspondence problems that consider visually similar images taken under the geometrically constrained settings [16, 19, 50, 18], semantic correspondence poses additional challenges from large intra-class appearance and geometric variations caused by the unconstrained settings of given image pair. ",
118
+ "bbox": [
119
+ 174,
120
+ 690,
121
+ 825,
122
+ 773
123
+ ],
124
+ "page_idx": 0
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "Recent approaches [42, 43, 45, 34, 37, 39, 31, 58, 47, 57, 51, 35] addressed these challenges by carefully designing deep convolutional neural networks (CNNs)-based models analogously to the classical matching pipeline [48, 41], feature extraction, cost aggregation, and flow estimation. Several works [24, 9, 37, 39, 47, 51] focused on the feature extraction stage, as it has been proven that the more powerful feature representation the model learns, the more robust matching is obtained [24, 9, 51]. However, solely relying on the matching similarity between features without any prior often suffers from the challenges due to ambiguities generated by repetitive patterns or background clutters [42, 24, 26]. On the other hand, some methods [42, 49, 43, 23, 26, 58] focused on flow estimation stage either by designing additional CNN as an ad-hoc regressor that predicts the parameters of a single global transformation [42, 43], finding confident matches from correlation maps [20, 26], or directly feeding the correlation maps into the decoder to infer dense correspondences [58]. However, these methods highly rely on the quality of the initial correlation maps. ",
129
+ "bbox": [
130
+ 174,
131
+ 779,
132
+ 825,
133
+ 864
134
+ ],
135
+ "page_idx": 0
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "",
140
+ "bbox": [
141
+ 174,
142
+ 92,
143
+ 825,
144
+ 174
145
+ ],
146
+ "page_idx": 1
147
+ },
148
+ {
149
+ "type": "text",
150
+ "text": "The latest methods [45, 37, 44, 21, 31, 27, 35] have focused on the second stage, highlighting the importance of cost aggregation. Since the quality of correlation maps is of prime importance, they proposed to refine the matching scores by formulating the task as optimal transport problem [47, 31], re-weighting matching scores by Hough space voting for geometric consistency [37, 39], or utilizing high-dimensional 4D or 6D convolutions to find locally consistent matches [45, 44, 27, 35]. Although formulated variously, these methods either use hand-crafted techniques that are neither learnable nor robust to severe deformations, or inherit the limitation of CNNs, e.g., limited receptive fields, failing to discriminate incorrect matches that are locally consistent. ",
151
+ "bbox": [
152
+ 174,
153
+ 180,
154
+ 825,
155
+ 291
156
+ ],
157
+ "page_idx": 1
158
+ },
159
+ {
160
+ "type": "text",
161
+ "text": "In this work, we focus on the cost aggregation stage, and propose a novel cost aggregation network to tackle aforementioned issues. Our network, called Cost Aggregation with Transformers (CATs), is based on Transformer [61, 10], which is renowned for its global receptive field. By considering all the matching scores computed between features of input images globally, our aggregation networks explore global consensus and thus refine the ambiguous or noisy matching scores effectively. ",
162
+ "bbox": [
163
+ 174,
164
+ 297,
165
+ 825,
166
+ 367
167
+ ],
168
+ "page_idx": 1
169
+ },
170
+ {
171
+ "type": "text",
172
+ "text": "Specifically, based on the observation that desired correspondence should be aligned at discontinuities with appearance of images, we concatenate an appearance embedding with the correlation map, which helps to disambiguate the correlation map within the Transformer. To benefit from hierarchical feature representations, following [26, 39, 58], we use a stack of correlation maps constructed from multilevel features, and propose to effectively aggregate the scores across the multi-level correlation maps. Furthermore, we consider bidirectional nature of correlation map, and leverage the correlation map from both directions, obtaining reciprocal scores by swapping the pair of dimensions of correlation map in order to allow global consensus in both perspective. In addition to all these combined, we provide residual connections around aggregation networks in order to ease the learning process. ",
173
+ "bbox": [
174
+ 174,
175
+ 373,
176
+ 825,
177
+ 500
178
+ ],
179
+ "page_idx": 1
180
+ },
181
+ {
182
+ "type": "text",
183
+ "text": "We demonstrate our method on several benchmarks [38, 11, 12]. Experimental results on various benchmarks prove the effectiveness of the proposed model over the latest methods for semantic correspondence. We also provide an extensive ablation study to validate and analyze components in CATs. ",
184
+ "bbox": [
185
+ 174,
186
+ 505,
187
+ 825,
188
+ 560
189
+ ],
190
+ "page_idx": 1
191
+ },
192
+ {
193
+ "type": "text",
194
+ "text": "2 Related Work ",
195
+ "text_level": 1,
196
+ "bbox": [
197
+ 174,
198
+ 585,
199
+ 321,
200
+ 603
201
+ ],
202
+ "page_idx": 1
203
+ },
204
+ {
205
+ "type": "text",
206
+ "text": "Semantic Correspondence. Methods for semantic correspondence generally follow the classical matching pipeline [48, 41], including feature extraction, cost aggregation, and flow estimation. Most early efforts [7, 30, 11] leveraged the hand-crafted features which are inherently limited in capturing high-level semantics. Though using deep CNN-based features [5, 24, 42, 43, 23, 49, 26] has become increasingly popular thanks to their invariance to deformations, without a means to refine the matching scores independently computed between the features, the performance would be rather limited. ",
207
+ "bbox": [
208
+ 174,
209
+ 621,
210
+ 825,
211
+ 704
212
+ ],
213
+ "page_idx": 1
214
+ },
215
+ {
216
+ "type": "text",
217
+ "text": "To alleviate this, several methods focused on flow estimation stage. Rocco et al. [42, 43] proposed an end-to-end network to predict global transformation parameters from the matching scores, and their success inspired many variants [49, 23, 25]. RTNs [23] obtain semantic correspondences through an iterative process of estimating spatial transformations. DGC-Net [34], Semantic-GLU-Net [58] and DMP [15] utilize a CNN-based decoder to directly find correspondence fields. PDC-Net [59] proposed a flexible probabilistic model that jointly learns the flow estimation and its uncertainty. Arguably, directly regressing correspondences from the initial matching scores highly relies on the quality of them. ",
218
+ "bbox": [
219
+ 174,
220
+ 710,
221
+ 825,
222
+ 821
223
+ ],
224
+ "page_idx": 1
225
+ },
226
+ {
227
+ "type": "text",
228
+ "text": "Recent numerous methods [45, 37, 39, 31, 47, 51, 35] thus have focused on cost aggregation stage to refine the initial matching scores. Among hand-crafted methods, SCOT [31] formulates semantic correspondence as an optimal transport problem and attempts to solve two issues, namely many to one matching and background matching. HPF [37] first computes appearance matching confidence using hyperpixel features and then uses Regularized Hough Matching (RHM) algorithm for cost aggregation to enforce geometric consistency. DHPF [39], that replaces feature selection algorithm of HPF [37] with trainable networks, also uses RHM. However, these hand-crafted techniques for refining the matching scores are neither learnable nor robust to severe deformations. As learningbased approaches, NC-Net [45] utilizes 4D convolution to achieve local neighborhood consensus by finding locally consistent matches, and its variants [44, 27] proposed more efficient methods. GOCor [57] proposed aggregation module that directly improves the correlation maps. GSF [21] formulated pruning module to suppress false positives of correspondences in order to refine the initial correlation maps. CHM [35] goes one step further, proposing a learnable geometric matching algorithm which utilizes 6D convolution. However, they are all limited in the sense that they inherit limitation of CNN-based architectures, which is local receptive fields. ",
229
+ "bbox": [
230
+ 174,
231
+ 827,
232
+ 823,
233
+ 911
234
+ ],
235
+ "page_idx": 1
236
+ },
237
+ {
238
+ "type": "image",
239
+ "img_path": "images/68593a83af1c0d0320e95acf250abac804be4699416bd99ef0b18fc88e8a0b39.jpg",
240
+ "image_caption": [
241
+ "Figure 1: Overall network architecture. Our networks consist of feature extraction, cost aggregation, and flow estimation modules. We first extract multi-level dense features and construct a stack of correlation maps. We then concatenate with embedded features and feed into the Transformer-based cost aggregator to obtain a refined correlation map. The flow is then inferred from the refined map. "
242
+ ],
243
+ "image_footnote": [],
244
+ "bbox": [
245
+ 173,
246
+ 94,
247
+ 816,
248
+ 305
249
+ ],
250
+ "page_idx": 2
251
+ },
252
+ {
253
+ "type": "text",
254
+ "text": "",
255
+ "bbox": [
256
+ 174,
257
+ 386,
258
+ 825,
259
+ 510
260
+ ],
261
+ "page_idx": 2
262
+ },
263
+ {
264
+ "type": "text",
265
+ "text": "Transformers in Vision. Transformer [61], the de facto standard for Natural Language Processing (NLP) tasks, has recently imposed significant impact on various tasks in Computer Vision fields such as image classification [10, 55], object detection [3, 62], tracking and matching [52, 51]. ViT [10], the first work to propose an end-to-end Transformer-based architecture for the image classification task, successfully extended the receptive field, owing to its self-attention nature that can capture global relationship between features. For visual correspondence, LoFTR [51] uses cross and self-attention module to refine the feature maps conditioned on both input images, and formulate the hand-crafted aggregation layer with dual-softmax [45, 60] and optimal transport [47] to infer correspondences. COTR [22] takes coordinates as an input and addresses dense correspondence task without the use of correlation map. Unlike these, for the first time, we propose a Transformer-based cost aggregation module. ",
266
+ "bbox": [
267
+ 173,
268
+ 520,
269
+ 826,
270
+ 672
271
+ ],
272
+ "page_idx": 2
273
+ },
274
+ {
275
+ "type": "text",
276
+ "text": "3 Methodology ",
277
+ "text_level": 1,
278
+ "bbox": [
279
+ 174,
280
+ 693,
281
+ 313,
282
+ 710
283
+ ],
284
+ "page_idx": 2
285
+ },
286
+ {
287
+ "type": "text",
288
+ "text": "3.1 Motivation and Overview ",
289
+ "text_level": 1,
290
+ "bbox": [
291
+ 176,
292
+ 726,
293
+ 390,
294
+ 741
295
+ ],
296
+ "page_idx": 2
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "Let us denote a pair of images, i.e., source and target, as $I _ { s }$ and $I _ { t }$ , which represent semantically similar images, and features extracted from $I _ { s }$ and $I _ { t }$ as $D _ { s }$ and $D _ { t }$ , respectively. Here, our goal is to establish a dense correspondence field $F ( i )$ between two images that is defined for each pixel $i$ , which warps $I _ { t }$ towards $I _ { s }$ . ",
301
+ "bbox": [
302
+ 174,
303
+ 752,
304
+ 825,
305
+ 808
306
+ ],
307
+ "page_idx": 2
308
+ },
309
+ {
310
+ "type": "text",
311
+ "text": "Estimating the correspondence with sole reliance on matching similarities between $D _ { s }$ and $D _ { t }$ is often challenged by the ambiguous matches due to the repetitive patterns or background clutters [42, 24, 26]. To address this, numerous methods proposed cost aggregation techniques that focus on refining the initial matching similarities either by formulating the task as optimal transport problem [47, 31], using regularized Hough matching to re-weight the costs [37, 39], or 4D or 6D convolutions [45, 27, 44, 35]. However, these methods either use hand-crafted techniques that are weak to severe deformations, or fail to discriminate incorrect matches due to limited receptive fields. ",
312
+ "bbox": [
313
+ 174,
314
+ 814,
315
+ 825,
316
+ 911
317
+ ],
318
+ "page_idx": 2
319
+ },
320
+ {
321
+ "type": "image",
322
+ "img_path": "images/b924b9258fa5e27a628a7e8fd0ffb42d53d6bcd8f80e35a1b93e885925f068e0.jpg",
323
+ "image_caption": [
324
+ "Figure 2: Visualization of correlation map and self-attention: (a) source image, (b) target image, (c) raw correlation map, (d) self-attention, (e) refined correlation map, and (f) ground-truth, which are bilinearly upsampled. The visualization proves that CATs successfully aggregates the costs by integrating the surrounding information of the query, represented as green circle in the source. "
325
+ ],
326
+ "image_footnote": [],
327
+ "bbox": [
328
+ 174,
329
+ 94,
330
+ 823,
331
+ 195
332
+ ],
333
+ "page_idx": 3
334
+ },
335
+ {
336
+ "type": "text",
337
+ "text": "To overcome these, we present Transformer-based cost aggregation networks that effectively integrate information present in all pairwise matching costs, dubbed CATs, as illustrated in Fig. 1. As done widely in other works [42, 45, 50, 34, 37], we follow the common practice for feature extraction and cost computation. In the following, we first explain feature extraction and cost computation, and then describe several critical design choices we made for effective aggregation of the matching costs. ",
338
+ "bbox": [
339
+ 173,
340
+ 268,
341
+ 825,
342
+ 338
343
+ ],
344
+ "page_idx": 3
345
+ },
346
+ {
347
+ "type": "text",
348
+ "text": "3.2 Feature Extraction and Cost Computation ",
349
+ "text_level": 1,
350
+ "bbox": [
351
+ 176,
352
+ 353,
353
+ 508,
354
+ 368
355
+ ],
356
+ "page_idx": 3
357
+ },
358
+ {
359
+ "type": "text",
360
+ "text": "To extract dense feature maps from images, we follow [26, 37, 39] that use multi-level features for construction of correlation maps. We use CNNs that produce a sequence of $L$ feature maps, and $D ^ { l }$ represents a feature map at $l$ -th level. As done in [37], we use different combination of multi-level features depending on the dataset trained on, e.g., PF-PASCAL [12] or SPair-71k [38]. Given a sequence of feature maps, we resize all the selected feature maps to $\\mathbb { R } ^ { h \\times w \\times c }$ , with height $h$ , width $w$ and $c$ channels. The resized features then undergo $l$ -2 normalization. ",
361
+ "bbox": [
362
+ 174,
363
+ 378,
364
+ 825,
365
+ 463
366
+ ],
367
+ "page_idx": 3
368
+ },
369
+ {
370
+ "type": "text",
371
+ "text": "Given resized dense features $D _ { s }$ and $D _ { t }$ , we compute a correlation map $\\mathcal { C } \\in \\mathbb { R } ^ { h w \\times h w }$ using the inner product between features: $\\mathcal { C } ( i , j ) = D _ { t } ( i ) \\cdot D _ { s } ( j )$ with points $i$ and $j$ in the target and source features, respectively. In this way, all pairwise feature matches are computed and stored. However, raw matching scores contain numerous ambiguous matching points as exemplified in Fig. 2, which results inaccurate correspondences. To remedy this, we propose cost aggregation networks in the following that aim to refine the ambiguous or noisy matching scores. ",
372
+ "bbox": [
373
+ 174,
374
+ 468,
375
+ 825,
376
+ 553
377
+ ],
378
+ "page_idx": 3
379
+ },
380
+ {
381
+ "type": "text",
382
+ "text": "3.3 Transformer Aggregator ",
383
+ "text_level": 1,
384
+ "bbox": [
385
+ 174,
386
+ 568,
387
+ 385,
388
+ 583
389
+ ],
390
+ "page_idx": 3
391
+ },
392
+ {
393
+ "type": "text",
394
+ "text": "Renowned for its global receptive fields, one of the key elements of Transformer [61] is the selfattention mechanism, which enables finding the correlated input tokens by first feeding into scaled dot product attention function, normalizing with Layer Normalization (LN) [1], and passing the normalized values to a MLP. Several works [10, 3, 62, 51] have shown that given images or features as input, Transformers [61] integrate the global information in a flexible manner by learning to find the attention scores for all pairs of tokens. ",
395
+ "bbox": [
396
+ 173,
397
+ 593,
398
+ 825,
399
+ 676
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "In this paper, we leverage the Transformers to integrate the matching scores to discover global consensus by considering global context information. Specifically, we obtain a refined cost $\\scriptstyle { \\mathcal { C } } ^ { \\prime }$ by feeding the raw cost $\\mathcal { C }$ to the Transformer $\\tau$ , consisting of self-attention, LN, and MLP modules: ",
406
+ "bbox": [
407
+ 174,
408
+ 683,
409
+ 823,
410
+ 724
411
+ ],
412
+ "page_idx": 3
413
+ },
414
+ {
415
+ "type": "equation",
416
+ "img_path": "images/a19f1a9273725ca75c764e920cd2bee42011f7194d86919304077f2dfbbc3ced.jpg",
417
+ "text": "$$\n\\begin{array} { r } { \\mathcal { C } ^ { \\prime } = \\mathcal { T } ( \\mathcal { C } + E _ { \\mathrm { p o s } } ) , } \\end{array}\n$$",
418
+ "text_format": "latex",
419
+ "bbox": [
420
+ 433,
421
+ 729,
422
+ 563,
423
+ 746
424
+ ],
425
+ "page_idx": 3
426
+ },
427
+ {
428
+ "type": "text",
429
+ "text": "where $E _ { \\mathrm { p o s } }$ denotes positional embedding. The standard Transformer receives as input a 1D sequence of token embeddings. In our context, we reshape the correlation map $\\mathcal { C }$ into a sequence of vectors $\\mathcal { C } ( k ) \\in \\mathbb { R } ^ { 1 \\times h w }$ for $k \\in \\{ 1 , . . . , h w \\}$ . We visualize the refined correlation map with self-attention in Fig. 2, where the ambiguities are significantly resolved. ",
430
+ "bbox": [
431
+ 173,
432
+ 750,
433
+ 825,
434
+ 806
435
+ ],
436
+ "page_idx": 3
437
+ },
438
+ {
439
+ "type": "text",
440
+ "text": "Appearance Affinity Modeling. When only matching costs are considered for aggregation, selfattention layer processes the correlation map itself disregarding the noise involved in the correlation map, which may lead to inaccurate correspondences. Rather than solely relying on raw correlation map, we additionally provide an appearance embedding from input features to disambiguate the correlation map aided by appearance affinity within the Transformer. Intuition behind is that visually similar points in an image, e.g., color or feature, have similar correspondences, as proven in stereo matching literature, e.g., Cost Volume Filtering (CVF) [16, 50]. ",
441
+ "bbox": [
442
+ 173,
443
+ 814,
444
+ 825,
445
+ 912
446
+ ],
447
+ "page_idx": 3
448
+ },
449
+ {
450
+ "type": "image",
451
+ "img_path": "images/d4f0838acb1454fc93eaaa71ab9d22a6ea1293b72e2cc408fcfc9066efe9a723.jpg",
452
+ "image_caption": [
453
+ "Figure 3: Illustration of Transformer aggregator. Given correlation maps $\\mathcal { C }$ with projected features, Transformer aggregation consisting of intra- and inter-correlation self-attention with LN and MLP refines the inputs not only across spatial domains but across levels. "
454
+ ],
455
+ "image_footnote": [],
456
+ "bbox": [
457
+ 174,
458
+ 89,
459
+ 821,
460
+ 181
461
+ ],
462
+ "page_idx": 4
463
+ },
464
+ {
465
+ "type": "text",
466
+ "text": "To provide appearance affinity, we propose to concatenate embedded features projected from input features with the correlation map. We first feed the features $D$ into linear projection networks, and then concatenate the output along corresponding dimension, so that the correlation map is augmented such that $[ \\mathcal { C } , \\mathcal { P } ( D ) ] \\in \\bar { \\mathbb { R } } ^ { h w \\times ( h \\bar { w } + p ) }$ , where $[ \\cdot ]$ denotes concatenation, $\\mathcal { P }$ denotes linear projection networks, and $p$ is channel dimension of embedded feature. Within the Transformer, self-attention layer aggregates the correlation map and passes the output to the linear projection networks to retain the size of original correlation $\\mathcal { C }$ . ",
467
+ "bbox": [
468
+ 173,
469
+ 250,
470
+ 825,
471
+ 348
472
+ ],
473
+ "page_idx": 4
474
+ },
475
+ {
476
+ "type": "text",
477
+ "text": "Multi-Level Aggregation. As shown in [37, 34, 39, 58, 31], leveraging multi-level features allows capturing hierarchical semantic feature representations. Thus we also use multi-level features from different levels of convolutional layers to construct a stack of correlation maps. Each correlation map $\\mathcal { C } ^ { l }$ computed between $D _ { s } ^ { l }$ and $D _ { \\mathrm { \\it t } } ^ { l }$ is concatenated with corresponding embedded features and fed into the aggregation networks. The aggregation networks now consider multiple correlations, aiming to effectively aggregates the matches by the hierarchical semantic representations. ",
478
+ "bbox": [
479
+ 174,
480
+ 357,
481
+ 825,
482
+ 440
483
+ ],
484
+ "page_idx": 4
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "As shown in Fig. 3, a stack of $L$ augmented correlation maps, $[ \\mathcal { C } ^ { l } , \\mathcal { P } ( D ^ { l } ) ] _ { l = 1 } ^ { L } \\in \\mathbb { R } ^ { h w \\times ( h w + p ) \\times L }$ , undergo the Transformer aggregator. For each $l$ -th augmented correlation map, we aggregate with self-attention layer across all the points in the augmented correlation map, and we refer this as intra-correlation self-attention. In addition, subsequent to this, the correlation map undergoes intercorrelation self-attention across multi-level dimensions. Contrary to HPF [37] that concatenates all the multi-level features and compute a correlation map, which disregards the level-wise similarities, within the inter-correlation layer of the proposed model, the similar matching scores are explored across multi-level dimensions. In this way, we can embrace richer semantics in different levels of feature maps, as shown in Fig. 4. ",
489
+ "bbox": [
490
+ 173,
491
+ 446,
492
+ 826,
493
+ 574
494
+ ],
495
+ "page_idx": 4
496
+ },
497
+ {
498
+ "type": "text",
499
+ "text": "3.4 Cost Aggregation with Transformers ",
500
+ "text_level": 1,
501
+ "bbox": [
502
+ 176,
503
+ 590,
504
+ 468,
505
+ 606
506
+ ],
507
+ "page_idx": 4
508
+ },
509
+ {
510
+ "type": "text",
511
+ "text": "By leveraging the Transformer aggregator, we present cost aggregation framework with following additional techniques to improve the performance. ",
512
+ "bbox": [
513
+ 174,
514
+ 616,
515
+ 823,
516
+ 645
517
+ ],
518
+ "page_idx": 4
519
+ },
520
+ {
521
+ "type": "text",
522
+ "text": "Swapping Self-Attention. To obtain a refined correlation map invariant to order of the input images and impose consistent matching scores, we argue that reciprocal scores should be used as aids to infer confident correspondences. As correlation map contains bidirectional matching scores, from both target and source perspective, we can leverage matching similarities from both directions in order to obtain more reciprocal scores as done similarly in other works [45, 26]. ",
523
+ "bbox": [
524
+ 174,
525
+ 654,
526
+ 825,
527
+ 723
528
+ ],
529
+ "page_idx": 4
530
+ },
531
+ {
532
+ "type": "text",
533
+ "text": "As shown in Fig. 1, we first feed the augmented correlation map to the aforementioned Transformer aggregator. Then we transpose the output, swapping the pair of dimensions in order to concatenate with the embedded feature from the other image, and feed into the subsequent another aggregator. Note that we share the parameters of the Transformer aggregators to obtain reciprocal scores. Formally, we define the whole process as following: ",
534
+ "bbox": [
535
+ 173,
536
+ 729,
537
+ 825,
538
+ 799
539
+ ],
540
+ "page_idx": 4
541
+ },
542
+ {
543
+ "type": "equation",
544
+ "img_path": "images/6dbf2e5d3285efdc36e50966ba1b634e7e9e5c1655fdf02bc74bb7f4f07bc6c3.jpg",
545
+ "text": "$$\n\\begin{array} { r l } & { \\boldsymbol { \\mathcal { S } } = \\mathcal { T } ( [ \\mathcal { C } ^ { l } , \\mathcal { P } ( D _ { t } ^ { l } ) ] _ { l = 1 } ^ { L } + E _ { \\mathrm { p o s } } ) , } \\\\ & { \\boldsymbol { \\mathcal { C } } ^ { \\prime } = \\mathcal { T } ( [ ( \\boldsymbol { \\mathcal { S } } ^ { l } ) ^ { \\mathrm { T } } , \\mathcal { P } ( D _ { s } ^ { l } ) ] _ { l = 1 } ^ { L } + E _ { \\mathrm { p o s } } ) , } \\end{array}\n$$",
546
+ "text_format": "latex",
547
+ "bbox": [
548
+ 375,
549
+ 805,
550
+ 620,
551
+ 849
552
+ ],
553
+ "page_idx": 4
554
+ },
555
+ {
556
+ "type": "text",
557
+ "text": "where $\\begin{array} { r } { \\mathcal { C } ^ { \\mathrm { T } } ( i , j ) = \\mathcal { C } ( j , i ) } \\end{array}$ denotes swapping the pair of dimensions corresponding to the source and target images; $s$ denotes the intermediate correlation map before swapping the axis. Note that NC-Net [45] proposed a similar procedure, but instead of processing serially, they separately process the correlation map and its transposed version and add the outputs, which is designed to produce a correlation map invariant to the particular order of the input images. Unlike this, we process the correlation map serially, first aggregating one pair of dimensions and then further aggregating with respect to the other pair. In this way, the subsequent attention layer is given more consistent matching scores as an input, allowing further reduction of inconsistent matching scores. We include an ablation study to justify our choice in Section 4.4 ",
558
+ "bbox": [
559
+ 174,
560
+ 854,
561
+ 823,
562
+ 911
563
+ ],
564
+ "page_idx": 4
565
+ },
566
+ {
567
+ "type": "image",
568
+ "img_path": "images/32d639afbe84467ac5dcf588ab8737aad1a574ee73db333eb6b50c7e31118b09.jpg",
569
+ "image_caption": [
570
+ "Figure 4: Visualization of multi-level aggregation: (a) source, (b) target images, (c), (d) multi-level correlation maps (e.g., $l = 1$ and $l = 3$ ), respectively, and final correlation maps by (e) HPF [37] and (f) CATs. Note that HPF and CATs utilize the same feature maps. Compared to HPF, CATs successfully embrace richer semantics in different levels of feature map. "
571
+ ],
572
+ "image_footnote": [],
573
+ "bbox": [
574
+ 174,
575
+ 94,
576
+ 823,
577
+ 195
578
+ ],
579
+ "page_idx": 5
580
+ },
581
+ {
582
+ "type": "text",
583
+ "text": "",
584
+ "bbox": [
585
+ 174,
586
+ 273,
587
+ 825,
588
+ 343
589
+ ],
590
+ "page_idx": 5
591
+ },
592
+ {
593
+ "type": "text",
594
+ "text": "Residual Connection. At the initial phase when the correlation map is fed into the Transformers, noisy score maps are inferred due to randomly-initialized parameters, which could complicate the learning process. To stabilize the learning process and provide a better initialization for the matching, we employ the residual connection. Specifically, we enforce the cost aggregation networks to estimate the residual correlation by adding residual connection around aggregation networks. ",
595
+ "bbox": [
596
+ 174,
597
+ 354,
598
+ 825,
599
+ 424
600
+ ],
601
+ "page_idx": 5
602
+ },
603
+ {
604
+ "type": "text",
605
+ "text": "3.5 Training ",
606
+ "text_level": 1,
607
+ "bbox": [
608
+ 174,
609
+ 444,
610
+ 272,
611
+ 458
612
+ ],
613
+ "page_idx": 5
614
+ },
615
+ {
616
+ "type": "text",
617
+ "text": "Data Augmentation. Transformer is well known for lacking some of inductive bias and its datahungry nature thus necessitates a large quantity of training data to be fed [61, 10]. Recent methods [55, 56, 32] that employ the Transformer to address Computer Vision tasks have empirically shown that data augmentation techniques have positive impact on performance. However, in correspondence task, the question of to what extent can data augmentation affect the performance has not yet been properly addressed. From the experiments, we empirically find that data augmentation has positive impacts on performance in semantic correspondence with Transformers as reported in Section 4.4. To apply data augmentation [6, 2] with predetermined probabilities to input images at random. Specifically, $5 0 \\%$ of the time, we randomly crop the input image, and independently for each augmentation function used in [6], we set the probability for applying the augmentation as $2 0 \\%$ . More details can be found in supplementary material. ",
618
+ "bbox": [
619
+ 174,
620
+ 470,
621
+ 826,
622
+ 622
623
+ ],
624
+ "page_idx": 5
625
+ },
626
+ {
627
+ "type": "text",
628
+ "text": "Training Objective. As in [37, 39, 35], we assume that the ground-truth keypoints are given for each pair of images. We first average the stack of refined correlation maps $\\mathcal { C } ^ { \\prime } \\in \\overline { { \\mathbb { R } } } ^ { h w \\times h w \\times L }$ to obtain $\\mathcal { C } ^ { \\prime \\prime } \\in \\overset { \\cdot } { \\mathbb { R } } ^ { h w \\times h w }$ and then transform it into a dense flow field $F _ { \\mathrm { p r e d } }$ using soft-argmax operator [26]. Subsequently, we compare the predicted dense flow field with the ground-truth flow field $F _ { \\mathrm { G T } }$ obtained by following the protocol of [37] using input keypoints. For the training objective, we utilize Average End-Point Error (AEPE) [34], computed by averaging the Euclidean distance between the ground-truth and estimated flow. We thus formulate the objective function as $\\mathcal { L } = \\| F _ { \\mathrm { G T } } - F _ { \\mathrm { p r e d } } \\| _ { 2 }$ . ",
629
+ "bbox": [
630
+ 174,
631
+ 635,
632
+ 825,
633
+ 732
634
+ ],
635
+ "page_idx": 5
636
+ },
637
+ {
638
+ "type": "text",
639
+ "text": "4 Experiments ",
640
+ "text_level": 1,
641
+ "bbox": [
642
+ 174,
643
+ 753,
644
+ 312,
645
+ 771
646
+ ],
647
+ "page_idx": 5
648
+ },
649
+ {
650
+ "type": "text",
651
+ "text": "4.1 Implementation Details ",
652
+ "text_level": 1,
653
+ "bbox": [
654
+ 176,
655
+ 787,
656
+ 377,
657
+ 803
658
+ ],
659
+ "page_idx": 5
660
+ },
661
+ {
662
+ "type": "text",
663
+ "text": "For backbone feature extractor, we use ResNet-101 [14] pre-trained on ImageNet [8], and following [37], extract the features from the best subset layers. Other backbone features can also be used, which we analyze the effect of various backbone features in the following ablation study. For the hyper-parameters for Transformer encoder, we set the depth as 1 and the number of heads as 6. We resize the spatial size of the input image pairs to $2 5 6 \\times 2 5 6$ and a sequence of selected features are resized to $1 6 \\times 1 6$ . We use a learnable positional embedding [10], instead of fixed [61]. We implemented our network using PyTorch [40], and AdamW [33] optimizer with an initial learning rate of 3e−5 for the CATs layers and 3e−6 for the backbone features are used, which we gradually decrease during training. ",
664
+ "bbox": [
665
+ 174,
666
+ 814,
667
+ 825,
668
+ 911
669
+ ],
670
+ "page_idx": 5
671
+ },
672
+ {
673
+ "type": "table",
674
+ "img_path": "images/02c57b9c2aa99ad0e5b0410f96cc01fea4f18712269675f140579b5200c5c558.jpg",
675
+ "table_caption": [
676
+ "Table 1: Quantitative evaluation on standard benchmarks [38, 11, 12]. Higher PCK is better. The best results are in bold, and the second best results are underlined. CATs† means CATs without fine-tuning feature backbone. Feat.-level: Feature-level, FT. feat.: Fine-tune feature. "
677
+ ],
678
+ "table_footnote": [],
679
+ "table_body": "<table><tr><td rowspan=\"2\">Methods</td><td rowspan=\"2\">Feat.-level</td><td rowspan=\"2\">FT. feat.</td><td rowspan=\"2\">Aggregation</td><td rowspan=\"2\">SPair-71k [38] PCK @ αbbox 0.1</td><td colspan=\"2\">PF-PASCAL [12] PCK @ Qimg</td><td rowspan=\"2\"></td><td colspan=\"2\">PF-WILLOW[11]</td></tr><tr><td>0.05</td><td>0.1 0.15</td><td>PCK @ αbbox 0.05</td><td>0.1 0.15</td></tr><tr><td>WTA</td><td>Single</td><td>X</td><td>■</td><td>25.7</td><td>35.2</td><td>53.3</td><td>62.8</td><td>24.7 46.9</td><td>59.0</td></tr><tr><td>CNNGeo [42]</td><td>Single</td><td>X</td><td></td><td>20.6</td><td>41.0</td><td>69.5</td><td>80.4</td><td>36.9 69.2</td><td>77.8</td></tr><tr><td>A2Net [49]</td><td>Single</td><td>X</td><td></td><td>22.3</td><td>42.8</td><td>70.8</td><td>83.3</td><td>36.3 68.8</td><td>84.4</td></tr><tr><td>WeakAlign [43]</td><td>Single</td><td>X</td><td></td><td>20.9</td><td>49.0</td><td>74.8</td><td>84.0</td><td>37.0 70.2</td><td>79.9</td></tr><tr><td>RTNs [23]</td><td>Single</td><td>X</td><td></td><td>25.7</td><td>55.2</td><td>75.9</td><td>85.2</td><td>41.3 71.9</td><td>86.2</td></tr><tr><td>SFNet [26]</td><td>Multi</td><td>X</td><td></td><td>-</td><td>53.6</td><td>81.9</td><td>90.6</td><td>46.3 74.0</td><td>84.2</td></tr><tr><td>NC-Net [45]</td><td>Single</td><td>√</td><td>4D Conv.</td><td>20.1</td><td>54.3</td><td>78.9</td><td>86.0</td><td>33.8 67.0</td><td>83.7</td></tr><tr><td>DCC-Net[17]</td><td>Single</td><td>X</td><td>4D Conv.</td><td>=</td><td>55.6</td><td>82.3</td><td>90.5</td><td>43.6 73.8</td><td>86.5</td></tr><tr><td>HPF[37]</td><td>Multi</td><td>-</td><td>RHM</td><td>28.2</td><td>60.1</td><td>84.8</td><td>92.7</td><td>45.9 74.4</td><td>85.6</td></tr><tr><td>GSF [21]</td><td>Multi</td><td>X</td><td>2D Conv.</td><td>36.1</td><td>65.6</td><td>87.8</td><td>95.9</td><td>49.1 78.7</td><td>90.2</td></tr><tr><td>ANC-Net [27]</td><td>Single</td><td>X</td><td>4D Conv.</td><td>-</td><td>-</td><td>86.1</td><td></td><td>=</td><td>=</td></tr><tr><td>DHPF [39]</td><td>Multi</td><td>X</td><td>RHM</td><td>37.3</td><td>75.7</td><td>90.7</td><td>95.0</td><td>49.5 77.6</td><td>89.1</td></tr><tr><td>SCOT[31]</td><td>Multi</td><td>-</td><td>OT-RHM</td><td>35.6</td><td>63.1</td><td>85.4</td><td>92.7</td><td>47.8 76.0</td><td>87.1</td></tr><tr><td>CHM[35]</td><td>Single</td><td>√</td><td>6D Conv.</td><td>46.3</td><td>80.1</td><td>91.6</td><td>94.9</td><td>52.7 79.4</td><td>87.5</td></tr><tr><td>CATst</td><td>Multi</td><td>X</td><td>Transformer</td><td>42.4</td><td>67.5</td><td>89.1</td><td>94.9</td><td>46.6 75.6</td><td>87.5</td></tr><tr><td>CATs</td><td>Multi</td><td></td><td>Transformer</td><td>49.9</td><td>75.4</td><td>92.6</td><td>96.4</td><td>50.3 79.2</td><td>90.3</td></tr></table>",
680
+ "bbox": [
681
+ 178,
682
+ 137,
683
+ 820,
684
+ 372
685
+ ],
686
+ "page_idx": 6
687
+ },
688
+ {
689
+ "type": "table",
690
+ "img_path": "images/84da0486c40fbee4c9cf77768a756715632c99a88f1506c0d02f87cf0b3518bc.jpg",
691
+ "table_caption": [
692
+ "Table 2: Per-class quantitative evaluation on SPair-71k [38] benchmark. "
693
+ ],
694
+ "table_footnote": [],
695
+ "table_body": "<table><tr><td>Methods</td><td>aero.</td><td>bike</td><td>bird</td><td>boat</td><td>bott.</td><td>bus</td><td>car</td><td>cat</td><td>chai.</td><td>cow</td><td>dog</td><td>hors.</td><td>mbik.</td><td>pers.</td><td>plan.</td><td>shee.</td><td>trai.</td><td>tv</td><td>all</td></tr><tr><td>CNNGeo [42]</td><td>23.4</td><td>16.7</td><td>40.2</td><td>14.3</td><td>36.4</td><td>27.7</td><td>26.0</td><td>32.7</td><td>12.7</td><td>27.4</td><td>22.8</td><td>13.7</td><td>20.9</td><td>21.0</td><td>17.5</td><td>10.2</td><td>30.8</td><td>34.1</td><td>20.6</td></tr><tr><td>A2Net[49]</td><td>22.6</td><td>18.5</td><td>42.0</td><td>16.4</td><td>37.9</td><td>30.8</td><td>26.5</td><td>35.6</td><td>13.3</td><td>29.6</td><td>24.3</td><td>16.0</td><td>21.6</td><td>22.8</td><td>20.5</td><td>13.5</td><td>31.4</td><td>36.5</td><td>22.3</td></tr><tr><td>WeakAlign [43]</td><td>22.2</td><td>17.6</td><td>41.9</td><td>15.1</td><td>38.1</td><td>27.4</td><td>27.2</td><td>31.8</td><td>12.8</td><td>26.8</td><td>22.6</td><td>14.2</td><td>20.0</td><td>22.2</td><td>17.9</td><td>10.4</td><td>32.2</td><td>35.1</td><td>20.9</td></tr><tr><td>NC-Net [45]</td><td>17.9</td><td>12.2</td><td>32.1</td><td>11.7</td><td>29.0</td><td>19.9</td><td>16.1</td><td>39.2</td><td>9.9</td><td>23.9</td><td>18.8</td><td>15.7</td><td>17.4</td><td>15.9</td><td>14.8</td><td>9.6</td><td>24.2</td><td>31.1</td><td>20.1</td></tr><tr><td>HPF[37]</td><td>25.2</td><td>18.9</td><td>52.1</td><td>15.7</td><td>38.0</td><td>22.8</td><td>19.1</td><td>52.9</td><td>17.9</td><td>33.0</td><td>32.8</td><td>20.6</td><td>24.4</td><td>27.9</td><td>21.1</td><td>15.9</td><td>31.5</td><td>35.6</td><td>28.2</td></tr><tr><td>SCOT[31]</td><td>34.9</td><td>20.7</td><td>63.8</td><td>21.1</td><td>43.5</td><td>27.3</td><td>21.3</td><td>63.1</td><td>20.0</td><td>42.9</td><td>42.5</td><td>31.1</td><td>29.8</td><td>35.0</td><td>27.7</td><td>24.4</td><td>48.4</td><td>40.8</td><td>35.6</td></tr><tr><td>DHPF[39]</td><td>38.4</td><td>23.8</td><td>68.3</td><td>18.9</td><td>42.6</td><td>27.9</td><td>20.1</td><td>61.6</td><td>22.0</td><td>46.9</td><td>46.1</td><td>33.5</td><td>27.6</td><td>40.1</td><td>27.6</td><td>28.1</td><td>49.5</td><td>46.5</td><td>37.3</td></tr><tr><td>CHM [35]</td><td>49.6</td><td>29.3</td><td>68.7</td><td>29.7</td><td>45.3</td><td>48.4</td><td>39.5</td><td>64.9</td><td>20.3</td><td>60.5</td><td>56.1</td><td>46.0</td><td>33.8</td><td>44.3</td><td>38.9</td><td>314</td><td>72.2</td><td>55.5</td><td>46.3</td></tr><tr><td>CATst</td><td>46.5</td><td>26.9</td><td>69.1</td><td>24.3</td><td>44.3</td><td>38.5</td><td>30.2</td><td>65.7</td><td>15.9</td><td>53.7</td><td>52.2</td><td>46.7</td><td>32.7</td><td>35.2</td><td>32.2</td><td>31.2</td><td>68.0</td><td>49.1</td><td>42.4</td></tr><tr><td>CATs</td><td>52.0</td><td>34.7</td><td>72.2</td><td>34.3</td><td>49.9</td><td>57.5</td><td>43.6</td><td>66.5</td><td>24.4</td><td>63.2</td><td>56.5</td><td>52.0</td><td>42.6</td><td>41.7</td><td>43.0</td><td>33.6</td><td>72.6</td><td>58.0</td><td>49.9</td></tr></table>",
696
+ "bbox": [
697
+ 176,
698
+ 417,
699
+ 831,
700
+ 523
701
+ ],
702
+ "page_idx": 6
703
+ },
704
+ {
705
+ "type": "text",
706
+ "text": "",
707
+ "bbox": [
708
+ 173,
709
+ 542,
710
+ 823,
711
+ 571
712
+ ],
713
+ "page_idx": 6
714
+ },
715
+ {
716
+ "type": "text",
717
+ "text": "4.2 Experimental Settings ",
718
+ "text_level": 1,
719
+ "bbox": [
720
+ 176,
721
+ 588,
722
+ 367,
723
+ 604
724
+ ],
725
+ "page_idx": 6
726
+ },
727
+ {
728
+ "type": "text",
729
+ "text": "In this section, we conduct comprehensive experiments for semantic correspondence, by evaluating our approach through comparisons to state-of-the-art methods including CNNGeo [42], A2Net [49], WeakAlign [43], NC-Net [45], RTNs [23], SFNet [26], HPF [37], DCC-Net [17], ANC-Net [27], DHPF [39], SCOT [31], GSF [21], and CHMNet [35]. In Section 4.3, we first evaluate matching results on several benchmarks with quantitative measures, and then provide an analysis of each component in our framework in Section 4.4. For more implementation details, please refer to our implementation available at https://github.com/SunghwanHong/CATs. ",
730
+ "bbox": [
731
+ 174,
732
+ 614,
733
+ 825,
734
+ 712
735
+ ],
736
+ "page_idx": 6
737
+ },
738
+ {
739
+ "type": "text",
740
+ "text": "Datasets. SPair-71k [38] provides total 70,958 image pairs with extreme and diverse viewpoint, scale variations, and rich annotations for each image pair, e.g., keypoints, scale difference, truncation and occlusion difference, and clear data split. Previously, for semantic matching, most of the datasets are limited to a small quantity with similar viewpoints and scales [11, 12]. As our network relies on Transformer which requires a large number of data for training, SPair-71k [38] makes the use of Transformer in our model feasible. we also consider PF-PASCAL [12] containing 1,351 image pairs from 20 categories and PF-WILLOW [11] containing 900 image pairs from 4 categories, each dataset providing corresponding ground-truth annotations. ",
741
+ "bbox": [
742
+ 173,
743
+ 720,
744
+ 825,
745
+ 833
746
+ ],
747
+ "page_idx": 6
748
+ },
749
+ {
750
+ "type": "text",
751
+ "text": "Evaluation Metric. For evaluation on SPair-71k [38], PF-WILLOW [11], and PF-PASCAL [12], we employ a percentage of correct keypoints (PCK), computed as the ratio of estimated keypoints within the threshold from ground-truths to the total number of keypoints. Given predicted keypoint $k _ { \\mathrm { p r e d } }$ and ground-truth keypoint $k _ { \\mathrm { G T } }$ , we count the number of predicted keypoints that satisfy following condition: $d ( k _ { \\mathrm { p r e d } } , k _ { \\mathrm { G T } } ) \\leq \\alpha \\cdot \\operatorname* { m a x } ( H , W )$ , where $d ( \\cdot )$ denotes Euclidean distance; $\\alpha$ denotes a threshold which we evaluate on PF-PASCAL with $\\alpha _ { \\mathrm { i m g } }$ , SPair-71k and PF-WILLOW with $\\alpha _ { \\mathrm { b b o x } }$ ; $H$ and $W$ denote height and width of the object bounding box or entire image, respectively. ",
752
+ "bbox": [
753
+ 174,
754
+ 842,
755
+ 825,
756
+ 912
757
+ ],
758
+ "page_idx": 6
759
+ },
760
+ {
761
+ "type": "image",
762
+ "img_path": "images/1e7241ed9d73ab27ea4cb77e702b390c9c4b098c6437317372cdc6caff5a6072.jpg",
763
+ "image_caption": [
764
+ "Figure 5: Qualitative results on SPair-71k [38]: (from top to bottom) keypoints transfer results by SCOT [31], DHPF [39], and CATs. Note that green and red line denotes correct and wrong prediction, respectively, with respect to the ground-truth. "
765
+ ],
766
+ "image_footnote": [],
767
+ "bbox": [
768
+ 174,
769
+ 94,
770
+ 823,
771
+ 285
772
+ ],
773
+ "page_idx": 7
774
+ },
775
+ {
776
+ "type": "text",
777
+ "text": "",
778
+ "bbox": [
779
+ 173,
780
+ 356,
781
+ 821,
782
+ 385
783
+ ],
784
+ "page_idx": 7
785
+ },
786
+ {
787
+ "type": "text",
788
+ "text": "4.3 Matching Results ",
789
+ "text_level": 1,
790
+ "bbox": [
791
+ 174,
792
+ 401,
793
+ 334,
794
+ 416
795
+ ],
796
+ "page_idx": 7
797
+ },
798
+ {
799
+ "type": "text",
800
+ "text": "For a fair comparison, we follow the evaluation protocol of [37] for SPair-71k, which our network is trained on the training split and evaluated on the test split. Similarly, for PF-PASCAL and PFWILLOW, following the common evaluation protocol of [13, 23, 17, 37, 39], we train our network on the training split of PF-PASCAL [12] and then evaluate on the test split of PF-PASCAL [12] and PF-WILLOW [11]. All the results of other methods are reported under identical setting. ",
801
+ "bbox": [
802
+ 174,
803
+ 426,
804
+ 825,
805
+ 496
806
+ ],
807
+ "page_idx": 7
808
+ },
809
+ {
810
+ "type": "text",
811
+ "text": "Table 1 summarizes quantitative results on SPair-71k [38], PF-PASCAL [12] and PF-WILLOW [11]. We note whether each method leverages multi-level features and fine-tunes the backbone features in order to ensure a fair comparison. We additionally denote the types of cost aggregation. Generally, our CATs outperform other methods over all the benchmarks. This is also confirmed by the results on SPair-71k, as shown in Table 2, where the proposed method outperforms other methods by large margin. Note that CATs† reports lower PCK than that of CHM, and this is because CHM fine-tunes its backbone networks while CATs† does not. Fig. 5 visualizes qualitative results for extremely challenging image pairs. We observe that compared to current state-of-the-art methods [31, 39], our method is capable of suppressing noisy scores and find accurate correspondences in cases with large scale and geometric variations. ",
812
+ "bbox": [
813
+ 174,
814
+ 503,
815
+ 825,
816
+ 641
817
+ ],
818
+ "page_idx": 7
819
+ },
820
+ {
821
+ "type": "text",
822
+ "text": "It is notable that CATs generally report lower PCK on PF-WILLOW [11] compared to other stateof-the-art methods. This is because the Transformer is well known for lacking some of inductive bias. When we evaluate on PF-WILLOW, we infer with the model trained on the training split of PFPASCAL, which only contains 1,351 image pairs, and as only relatively small quantity of image pairs is available within the PF-PASCAL training split, the Transformer shows low generalization power. This demonstrates that the Transformer-based architecture indeed requires a means to compensate for the lack of inductive bias, e.g., data augmentation. ",
823
+ "bbox": [
824
+ 174,
825
+ 647,
826
+ 825,
827
+ 744
828
+ ],
829
+ "page_idx": 7
830
+ },
831
+ {
832
+ "type": "text",
833
+ "text": "4.4 Ablation Study ",
834
+ "text_level": 1,
835
+ "bbox": [
836
+ 174,
837
+ 762,
838
+ 316,
839
+ 776
840
+ ],
841
+ "page_idx": 7
842
+ },
843
+ {
844
+ "type": "text",
845
+ "text": "In this section we show an ablation analysis to validate critical components we made to design our architecture, and provide an analysis on use of different backbone features, and data augmentation. We train all the variants on the training split of SPair-71k [38] when evaluating on SPair-71k, and train on PF-PASCAL [12] for evaluating on PF-PASCAL. We measure the PCK, and each ablation experiment is conducted under same experimental setting for a fair comparison. ",
846
+ "bbox": [
847
+ 174,
848
+ 787,
849
+ 825,
850
+ 857
851
+ ],
852
+ "page_idx": 7
853
+ },
854
+ {
855
+ "type": "text",
856
+ "text": "Network Architecture. Table 3 shows the analysis on key components in our architecture. There are four key components we analyze for the ablation study, including appearance modelling, multilevel aggregation, swapping self-attention, and residual connection. ",
857
+ "bbox": [
858
+ 174,
859
+ 866,
860
+ 821,
861
+ 909
862
+ ],
863
+ "page_idx": 7
864
+ },
865
+ {
866
+ "type": "text",
867
+ "text": "We first define the model without any of these as baseline, which simply feeds the correlation map into the selfattention layer. We evaluate on SPair-71k benchmark by progressively adding the each key component. From I to $\\mathbf { V }$ , we observe consistent increase in performance when each component is added. II shows a large improvement in performance, which demonstrates that the appearance modelling enabled the model to refine the ambiguous or noisy matching scores. Although relatively small increase in PCK for III, it proves that the proposed model successfully aggregates the multi-level correlation maps. Furthermore, $\\mathbf { I V }$ and $\\mathbf { V }$ show apparent increase, proving the significance of both components. ",
868
+ "bbox": [
869
+ 174,
870
+ 90,
871
+ 540,
872
+ 229
873
+ ],
874
+ "page_idx": 8
875
+ },
876
+ {
877
+ "type": "table",
878
+ "img_path": "images/dcc2a57555305274faa27a8cf4f005254df8adda876fa9edd9036cf81849e427.jpg",
879
+ "table_caption": [
880
+ "Table 3: Ablation study of CATs. "
881
+ ],
882
+ "table_footnote": [],
883
+ "table_body": "<table><tr><td>Components</td><td>SPair-71k Qbbox =0.1</td></tr><tr><td>(I) Baseline</td><td>26.8</td></tr><tr><td>(II) + Appearance Modelling</td><td>33.5</td></tr><tr><td>(IⅢI) + Multi-level Aggregation</td><td>35.9</td></tr><tr><td>(IV) + Swapping Self-Attention</td><td>38.8</td></tr><tr><td>(V + Residual Connection</td><td>42.4</td></tr></table>",
884
+ "bbox": [
885
+ 552,
886
+ 121,
887
+ 823,
888
+ 207
889
+ ],
890
+ "page_idx": 8
891
+ },
892
+ {
893
+ "type": "text",
894
+ "text": "",
895
+ "bbox": [
896
+ 174,
897
+ 229,
898
+ 823,
899
+ 257
900
+ ],
901
+ "page_idx": 8
902
+ },
903
+ {
904
+ "type": "text",
905
+ "text": "Feature Backbone. As shown in Table 4, we explore the impact of different feature backbones on the performance on SPair-71k [38] and PF-PASCAL [12]. We report the results of models with backbone networks frozen. The top two rows are models with DeiT-B [55], next two rows use DINO [4], and the rest use ResNet101 [14] as backbone. Specifically, subscript single for DeiT-B and DINO, we use the feature map extracted at the last layer for the singlelevel, while for subscript all, every feature map ",
906
+ "bbox": [
907
+ 174,
908
+ 266,
909
+ 483,
910
+ 416
911
+ ],
912
+ "page_idx": 8
913
+ },
914
+ {
915
+ "type": "table",
916
+ "img_path": "images/18498a593618270a08d137551e6fbbd9cd7be32ebcb7dedd2d7f687354ee29be.jpg",
917
+ "table_caption": [
918
+ "Table 4: Ablation study of feature backbone. "
919
+ ],
920
+ "table_footnote": [],
921
+ "table_body": "<table><tr><td>Feature Backbone</td><td>SPair-71k @bbox = 0.1</td><td>PF-PASCAL Qimg= 0.1</td></tr><tr><td>DeiT-Bgingle[55]</td><td>32.1</td><td>76.5</td></tr><tr><td>DeiT-Bal1 [55]</td><td>38.2</td><td>87.5</td></tr><tr><td>DINO w/ ViT-B/16sing1e [4] DINO w/ViT-B/16a11 [4]</td><td>39.5</td><td>88.9</td></tr><tr><td></td><td>42.0</td><td>88.9</td></tr><tr><td>ResNet-101sing1e [14]</td><td>37.4</td><td>87.3</td></tr><tr><td>ResNet-101mu1ti[14]</td><td>42.4</td><td>89.1</td></tr></table>",
922
+ "bbox": [
923
+ 495,
924
+ 291,
925
+ 823,
926
+ 398
927
+ ],
928
+ "page_idx": 8
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "from 12 layers is used for cost construction. For ResNet-101 subscript single, we use a single-level feature cropped at $\\mathrm { c o n v 4 - 2 3 }$ , while for multi, we use the best layer subset provided by [37]. Summarizing the results, we observed that leveraging multi-level features showed apparent improvements in performance, proving effectiveness of multi-level aggregation introduced by our method. It is worth noting that DINO, which is more excel at dense tasks than DeiT-B, outperforms DeiT-B when applied to semantic matching. This indicates that fine-tuning the feature could enhance the performance. To best of our knowledge, we are the first to employ Transformer-based features for semantic matching. It would be an interesting setup to train an end-to-end Transformer-based networks, and we hope this work draws attention from community and made useful for future works. ",
933
+ "bbox": [
934
+ 173,
935
+ 417,
936
+ 826,
937
+ 541
938
+ ],
939
+ "page_idx": 8
940
+ },
941
+ {
942
+ "type": "text",
943
+ "text": "Data Augmentation. In Table 5, we compared the PCK performance between our variants and DHPF [39]. We note if the model is trained with augmentation. For a fair comparison, we evaluate both DHPF [39] and CATs trained on SPair-71k [38] using strong supervision, which assumes that the ground-truth keypoints are given. The results show that compared to DHPF, a CNN-based method, data augmentation has a larger influence on CATs in terms of performance. This demonstrates that not only we eased the data-hunger problem inherent in Transformers, but also found that applying augmentations for matching has positive effects. Augmentation technique would bring a highly likely improvements in performance, and we hope that the future works benefit from this. ",
944
+ "bbox": [
945
+ 174,
946
+ 550,
947
+ 576,
948
+ 674
949
+ ],
950
+ "page_idx": 8
951
+ },
952
+ {
953
+ "type": "table",
954
+ "img_path": "images/e48cf7c21bfc2ecaa84180e1fe9f11e0947673adebb681f30779f0833dc7cd82.jpg",
955
+ "table_caption": [
956
+ "Table 5: Effects of augmentation. "
957
+ ],
958
+ "table_footnote": [],
959
+ "table_body": "<table><tr><td></td><td>Augment.</td><td>SPair-71k αbbox = 0.1</td></tr><tr><td>DHPF[39]</td><td></td><td>37.3</td></tr><tr><td>DHPF [39]</td><td>X</td><td>39.4</td></tr><tr><td>CATs</td><td>A</td><td>43.5</td></tr><tr><td>CATs</td><td></td><td>49.9</td></tr></table>",
960
+ "bbox": [
961
+ 588,
962
+ 569,
963
+ 825,
964
+ 659
965
+ ],
966
+ "page_idx": 8
967
+ },
968
+ {
969
+ "type": "text",
970
+ "text": "",
971
+ "bbox": [
972
+ 173,
973
+ 675,
974
+ 820,
975
+ 715
976
+ ],
977
+ "page_idx": 8
978
+ },
979
+ {
980
+ "type": "text",
981
+ "text": "Serial swapping. It is apparent that Equation 2 is not designed for an order-invariant output. Different from NC-Net [45], we let the correlation map undergo the self-attention module in a serial manner. We conducted a simple experiment to compare the difference between each approach. From experiments, we obtained the results of parallel and serial processing on SPair-71k with $\\alpha _ { \\mathrm { b b o x } } = 0 . 1$ , which are PCK of 40.8 and 42.4, respectively. In light of this, although CATs may not support order invariance, adopting serial processing can obtain higher PCK as it has a better capability to reduce inconsistent matching scores by additionally processing the already processed cost map, which we finalize the architecture to include serial processing. ",
982
+ "bbox": [
983
+ 174,
984
+ 729,
985
+ 825,
986
+ 842
987
+ ],
988
+ "page_idx": 8
989
+ },
990
+ {
991
+ "type": "text",
992
+ "text": "4.5 Analysis ",
993
+ "text_level": 1,
994
+ "bbox": [
995
+ 174,
996
+ 857,
997
+ 271,
998
+ 872
999
+ ],
1000
+ "page_idx": 8
1001
+ },
1002
+ {
1003
+ "type": "text",
1004
+ "text": "Visualizing Self-Attention. We visualize the multi-level attention maps obtained from the Transformer aggregator. As shown in Fig. 6, the learned self-attention map at each level exhibits different aspect. With these self-attentions, our networks can leverage multi-level correlations to capture hierarchical semantic feature representations effectively. ",
1005
+ "bbox": [
1006
+ 174,
1007
+ 883,
1008
+ 821,
1009
+ 911
1010
+ ],
1011
+ "page_idx": 8
1012
+ },
1013
+ {
1014
+ "type": "image",
1015
+ "img_path": "images/2ffe664b93bf2f6e2d7edc1c5df1dcfca3a13bad3fcff59bb6aa6ce38283bd12.jpg",
1016
+ "image_caption": [
1017
+ "Figure 6: Visualization of self-attention: (from left to right) source and target images, and multilevel self-attentions. Note that each attention map attends different aspects, and CATs aggregates the cost leveraging hierarchical semantic representations. "
1018
+ ],
1019
+ "image_footnote": [],
1020
+ "bbox": [
1021
+ 174,
1022
+ 94,
1023
+ 823,
1024
+ 178
1025
+ ],
1026
+ "page_idx": 9
1027
+ },
1028
+ {
1029
+ "type": "text",
1030
+ "text": "",
1031
+ "bbox": [
1032
+ 173,
1033
+ 248,
1034
+ 823,
1035
+ 276
1036
+ ],
1037
+ "page_idx": 9
1038
+ },
1039
+ {
1040
+ "type": "text",
1041
+ "text": "Memory and run-time. In Table 6, we show the memory and run-time comparison to NCNet [45], SCOT [31], DHPF [39] and CHM [35] with CATs. For a fair comparison, the results are obtained using a single NVIDIA GeForce RTX 2080 Ti GPU and Intel Core i7-10700 CPU. We measure the inference time for both the process without counting feature extraction, and the whole process. Thanks to Transformers’ fast com",
1042
+ "bbox": [
1043
+ 174,
1044
+ 286,
1045
+ 493,
1046
+ 410
1047
+ ],
1048
+ "page_idx": 9
1049
+ },
1050
+ {
1051
+ "type": "table",
1052
+ "img_path": "images/d3816e7129509dcc296344d277bee35bf31f85aac1d65326efb93f5065464665.jpg",
1053
+ "table_caption": [
1054
+ "Table 6: Memory and run-time comparison. Inference time for aggregator is denoted by (·). "
1055
+ ],
1056
+ "table_footnote": [],
1057
+ "table_body": "<table><tr><td></td><td>Aggregation</td><td>Memory [GB]</td><td>Run-time [ms]</td></tr><tr><td>NC-Net [45]</td><td>4D Conv.</td><td>1.2</td><td>193.3 (166.1)</td></tr><tr><td>SCOT [31]</td><td>OT-RHM</td><td>4.6</td><td>146.5 (81.6)</td></tr><tr><td>DHPF [39]</td><td>RHM</td><td>1.6</td><td>57.7 (29.5)</td></tr><tr><td>CHM [35]</td><td>6D Conv</td><td>1.6</td><td>47.2 (38.3)</td></tr><tr><td>CATs</td><td>Transformer</td><td>1.9</td><td>34.5 (7.4)</td></tr></table>",
1058
+ "bbox": [
1059
+ 504,
1060
+ 319,
1061
+ 823,
1062
+ 393
1063
+ ],
1064
+ "page_idx": 9
1065
+ },
1066
+ {
1067
+ "type": "text",
1068
+ "text": "putation nature, compared to other methods, our method is beyond compare. We also find that compared to other cost aggregation methods including 4D, 6D convolutons, OT-RHM and RHM, ours show comparable efficiency in terms of computational cost. Note that NC-Net utilizes a single feature map while other methods utilize multi-level feature maps. We used the standard self-attention module for implementation, but more advanced and efficient transformer [32] architectures could reduce the overall memory consumption. ",
1069
+ "bbox": [
1070
+ 174,
1071
+ 410,
1072
+ 825,
1073
+ 492
1074
+ ],
1075
+ "page_idx": 9
1076
+ },
1077
+ {
1078
+ "type": "text",
1079
+ "text": "4.6 Limitations ",
1080
+ "text_level": 1,
1081
+ "bbox": [
1082
+ 174,
1083
+ 508,
1084
+ 294,
1085
+ 523
1086
+ ],
1087
+ "page_idx": 9
1088
+ },
1089
+ {
1090
+ "type": "text",
1091
+ "text": "One obvious limitation that CATs possess is that when applying the method to non-corresponding images, the proposed method would still deliver correspondences as it lacks power to ignore pixels that do not have correspondence at all. A straightforward solution would be to consider including a module to account for pixel-wise matching confidence. Another limitation of CATs would be its inability to address a task of finding accurate correspondences given multi-objects or non-corresponding objects. Addressing such challenges would be a promising direction for future work. ",
1092
+ "bbox": [
1093
+ 174,
1094
+ 535,
1095
+ 825,
1096
+ 618
1097
+ ],
1098
+ "page_idx": 9
1099
+ },
1100
+ {
1101
+ "type": "text",
1102
+ "text": "5 Conclusion ",
1103
+ "text_level": 1,
1104
+ "bbox": [
1105
+ 174,
1106
+ 637,
1107
+ 299,
1108
+ 655
1109
+ ],
1110
+ "page_idx": 9
1111
+ },
1112
+ {
1113
+ "type": "text",
1114
+ "text": "In this paper, we have proposed, for the first time, Transformer-based cost aggregation networks for semantic correspondence which enables aggregating the matching scores computed between input features, dubbed CATs. We have made several architectural designs in the network architecture, including appearance affinity modelling, multi-level aggregation, swapping self-attention, and residual correlation. We have shown that our method surpasses the current state-of-the-art in several benchmarks. Moreover, we have conducted extensive ablation studies to validate our choices and explore its capacity. A natural next step, which we leave for future work, is to examine how CATs could extend its domain to tasks including 3-D reconstruction, semantic segmentation and stitching, and to explore self-supervised learning. ",
1115
+ "bbox": [
1116
+ 173,
1117
+ 670,
1118
+ 826,
1119
+ 794
1120
+ ],
1121
+ "page_idx": 9
1122
+ },
1123
+ {
1124
+ "type": "text",
1125
+ "text": "Acknowledgements ",
1126
+ "text_level": 1,
1127
+ "bbox": [
1128
+ 176,
1129
+ 814,
1130
+ 338,
1131
+ 830
1132
+ ],
1133
+ "page_idx": 9
1134
+ },
1135
+ {
1136
+ "type": "text",
1137
+ "text": "This research was supported by the MSIT, Korea, under the ICT Creative Consilience program (IITP-2021-2020-0-01819) and (No. 2020-0-00368, A Neural-Symbolic Model for Knowledge Acquisition and Inference Techniques) supervised by the IITP and National Research Foundation of Korea (NRF-2021R1C1C1006897). ",
1138
+ "bbox": [
1139
+ 176,
1140
+ 845,
1141
+ 823,
1142
+ 901
1143
+ ],
1144
+ "page_idx": 9
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "text": "References \n[1] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. \n[2] Alexander Buslaev, Vladimir I Iglovikov, Eugene Khvedchenya, Alex Parinov, Mikhail Druzhinin, and Alexandr A Kalinin. Albumentations: fast and flexible image augmentations. Information, 2020. \n[3] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV. Springer, 2020. \n[4] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. arXiv preprint arXiv:2104.14294, 2021. \n[5] Christopher B Choy, JunYoung Gwak, Silvio Savarese, and Manmohan Chandraker. Universal correspondence network. NeurIPS, 29:2414–2422, 2016. \n[6] Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, 2020. \n[7] Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In CVPR Workshops), 2005. \n[8] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. \n[9] Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superpoint: Self-supervised interest point detection and description. In CVPR, 2018. \n[10] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. \n[11] Bumsub Ham, Minsu Cho, Cordelia Schmid, and Jean Ponce. Proposal flow. In CVPR, 2016. \n[12] Bumsub Ham, Minsu Cho, Cordelia Schmid, and Jean Ponce. Proposal flow: Semantic correspondences from object proposals. IEEE transactions on pattern analysis and machine intelligence, 2017. \n[13] Kai Han, Rafael S Rezende, Bumsub Ham, Kwan-Yee K Wong, Minsu Cho, Cordelia Schmid, and Jean Ponce. Scnet: Learning semantic correspondence. In ICCV, 2017. \n[14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. \n[15] Sunghwan Hong and Seungryong Kim. Deep matching prior: Test-time optimization for dense correspondence. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021. \n[16] Asmaa Hosni, Christoph Rhemann, Michael Bleyer, Carsten Rother, and Margrit Gelautz. Fast cost-volume filtering for visual correspondence and beyond. PAMI, 2012. \n[17] Shuaiyi Huang, Qiuyue Wang, Songyang Zhang, Shipeng Yan, and Xuming He. Dynamic context correspondence network for semantic alignment. In ICCV, 2019. \n[18] Tak-Wai Hui, Xiaoou Tang, and Chen Change Loy. Liteflownet: A lightweight convolutional neural network for optical flow estimation. In CVPR, 2018. \n[19] Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. In CVPR, 2017. \n[20] Sangryul Jeon, Seungryong Kim, Dongbo Min, and Kwanghoon Sohn. Parn: Pyramidal affine regression networks for dense semantic correspondence. In ECCV, 2018. \n[21] Sangryul Jeon, Dongbo Min, Seungryong Kim, Jihwan Choe, and Kwanghoon Sohn. Guided semantic flow. In ECCV. Springer, 2020. \n[22] Wei Jiang, Eduard Trulls, Jan Hosang, Andrea Tagliasacchi, and Kwang Moo Yi. Cotr: Correspondence transformer for matching across images. arXiv preprint arXiv:2103.14167, 2021. \n[23] Seungryong Kim, Stephen Lin, Sang Ryul Jeon, Dongbo Min, and Kwanghoon Sohn. Recurrent transformer networks for semantic correspondence. In NeurIPS, 2018. \n[24] Seungryong Kim, Dongbo Min, Bumsub Ham, Sangryul Jeon, Stephen Lin, and Kwanghoon Sohn. Fcss: Fully convolutional self-similarity for dense semantic correspondence. In CVPR, 2017. \n[25] Seungryong Kim, Dongbo Min, Somi Jeong, Sunok Kim, Sangryul Jeon, and Kwanghoon Sohn. Semantic attribute matching networks. In CVPR, 2019. \n[26] Junghyup Lee, Dohyung Kim, Jean Ponce, and Bumsub Ham. Sfnet: Learning object-aware semantic correspondence. In CVPR, 2019. \n[27] Shuda Li, Kai Han, Theo W Costain, Henry Howard-Jenkins, and Victor Prisacariu. Correspondence networks with adaptive neighbourhood consensus. In CVPR, 2020. \n[28] Jing Liao, Yuan Yao, Lu Yuan, Gang Hua, and Sing Bing Kang. Visual attribute transfer through deep image analogy. arXiv:1705.01088, 2017. \n[29] Tsung-Yi Lin, Piotr Dollár, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. Feature pyramid networks for object detection. In CVPR, 2017. \n[30] Ce Liu, Jenny Yuen, and Antonio Torralba. Sift flow: Dense correspondence across scenes and its applications. IEEE transactions on pattern analysis and machine intelligence, 33(5):978–994, 2010. \n[31] Yanbin Liu, Linchao Zhu, Makoto Yamada, and Yi Yang. Semantic correspondence as an optimal transport problem. In CVPR, 2020. \n[32] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021. \n[33] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv:1711.05101, 2017. \n[34] Iaroslav Melekhov, Aleksei Tiulpin, Torsten Sattler, Marc Pollefeys, Esa Rahtu, and Juho Kannala. Dgc-net: Dense geometric correspondence network. In WACV, 2019. \n[35] Juhong Min and Minsu Cho. Convolutional hough matching networks. arXiv preprint arXiv:2103.16831, 2021. \n[36] Juhong Min, Dahyun Kang, and Minsu Cho. Hypercorrelation squeeze for few-shot segmentation. arXiv preprint arXiv:2104.01538, 2021. \n[37] Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Hyperpixel flow: Semantic correspondence with multi-layer neural features. In ICCV, 2019. \n[38] Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Spair-71k: A large-scale benchmark for semantic correspondence. arXiv preprint arXiv:1908.10543, 2019. \n[39] Juhong Min, Jongmin Lee, Jean Ponce, and Minsu Cho. Learning to compose hypercolumns for visual correspondence. In ECCV, 2020. \n[40] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017. \n[41] James Philbin, Ondrej Chum, Michael Isard, Josef Sivic, and Andrew Zisserman. Object retrieval with large vocabularies and fast spatial matching. In CVPR. IEEE, 2007. \n[42] Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. Convolutional neural network architecture for geometric matching. In CVPR, 2017. \n[43] Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. End-to-end weakly-supervised semantic alignment. In ´ CVPR, 2018. \n[44] Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. Efficient neighbourhood consensus networks via ´ submanifold sparse convolutions. In ECCV, 2020. \n[45] Ignacio Rocco, Mircea Cimpoi, Relja Arandjelovic, Akihiko Torii, Tomas Pajdla, and Josef Sivic. Neigh- ´ bourhood consensus networks. In NeurIPS, 2018. \n[46] Michael Rubinstein, Armand Joulin, Johannes Kopf, and Ce Liu. Unsupervised joint object discovery and segmentation in internet images. In CVPR, 2013. \n[47] Paul-Edouard Sarlin, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. Superglue: Learning feature matching with graph neural networks. In CVPR, 2020. \n[48] Daniel Scharstein and Richard Szeliski. A taxonomy and evaluation of dense two-frame stereo correspondence algorithms. International journal of computer vision, 2002. \n[49] Paul Hongsuck Seo, Jongmin Lee, Deunsol Jung, Bohyung Han, and Minsu Cho. Attentive semantic alignment with offset-aware correlation kernels. In ECCV, 2018. \n[50] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In CVPR, 2018. \n[51] Jiaming Sun, Zehong Shen, Yuang Wang, Hujun Bao, and Xiaowei Zhou. Loftr: Detector-free local feature matching with transformers. arXiv preprint arXiv:2104.00680, 2021. \n[52] Peize Sun, Yi Jiang, Rufeng Zhang, Enze Xie, Jinkun Cao, Xinting Hu, Tao Kong, Zehuan Yuan, Changhu Wang, and Ping Luo. Transtrack: Multiple-object tracking with transformer. arXiv preprint arXiv:2012.15460, 2020. \n[53] Richard Szeliski. Image alignment and stitching: A tutorial. Foundations and Trends® in Computer Graphics and Vision, 2006. \n[54] Tatsunori Taniai, Sudipta N Sinha, and Yoichi Sato. Joint recovery of dense correspondence and cosegmentation in two images. In CVPR, 2016. \n[55] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers and distillation through attention. arXiv preprint arXiv:2012.12877, 2020. \n[56] Hugo Touvron, Matthieu Cord, Alexandre Sablayrolles, Gabriel Synnaeve, and Hervé Jégou. Going deeper with image transformers. arXiv preprint arXiv:2103.17239, 2021. \n[57] Prune Truong, Martin Danelljan, Luc V Gool, and Radu Timofte. Gocor: Bringing globally optimized correspondence volumes into your neural network. In NeurIPS, 2020. \n[58] Prune Truong, Martin Danelljan, and Radu Timofte. Glu-net: Global-local universal network for dense flow and correspondences. In CVPR, 2020. \n[59] Prune Truong, Martin Danelljan, Luc Van Gool, and Radu Timofte. Learning accurate dense correspondences and when to trust them. arXiv preprint arXiv:2101.01710, 2021. \n[60] Michał J Tyszkiewicz, Pascal Fua, and Eduard Trulls. Disk: Learning local features with policy gradient. arXiv preprint arXiv:2006.13566, 2020. \n[61] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. \n[62] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020. ",
1149
+ "bbox": [
1150
+ 171,
1151
+ 90,
1152
+ 828,
1153
+ 921
1154
+ ],
1155
+ "page_idx": 10
1156
+ },
1157
+ {
1158
+ "type": "text",
1159
+ "text": "",
1160
+ "bbox": [
1161
+ 171,
1162
+ 63,
1163
+ 828,
1164
+ 917
1165
+ ],
1166
+ "page_idx": 11
1167
+ },
1168
+ {
1169
+ "type": "text",
1170
+ "text": "",
1171
+ "bbox": [
1172
+ 171,
1173
+ 92,
1174
+ 828,
1175
+ 712
1176
+ ],
1177
+ "page_idx": 12
1178
+ }
1179
+ ]
parse/train/eVuMspr9cu5/eVuMspr9cu5_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/eVuMspr9cu5/eVuMspr9cu5_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJY0-Kcll/rJY0-Kcll.md ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OPTIMIZATION AS A MODEL FOR FEW-SHOT LEARNING
2
+
3
+ Sachin Ravi∗and Hugo Larochelle
4
+
5
+ Twitter, Cambridge, USA {sachinr,hugo}@twitter.com
6
+
7
+ # ABSTRACT
8
+
9
+ Though deep neural networks have shown great success in the large data domain, they generally perform poorly on few-shot learning tasks, where a classifier has to quickly generalize after seeing very few examples from each class. The general belief is that gradient-based optimization in high capacity classifiers requires many iterative steps over many examples to perform well. Here, we propose an LSTMbased meta-learner model to learn the exact optimization algorithm used to train another learner neural network classifier in the few-shot regime. The parametrization of our model allows it to learn appropriate parameter updates specifically for the scenario where a set amount of updates will be made, while also learning a general initialization of the learner (classifier) network that allows for quick convergence of training. We demonstrate that this meta-learning model is competitive with deep metric-learning techniques for few-shot learning.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Deep learning has shown great success in a variety of tasks with large amounts of labeled data in image classification (He et al., 2015), machine translation (Wu et al., 2016), and speech modeling (Oord et al., 2016). These achievements have relied on the fact that optimization of these deep, high-capacity models requires many iterative updates across many labeled examples. This type of optimization breaks down in the small data regime where we want to learn from very few labeled examples. In this setting, rather than have one large dataset, we have a set of datasets, each with few annotated examples per class. The motivation for this task lies not only in the fact that humans, even children, can usually generalize after just one example of a given object, but also because models excelling at this task would have many useful applications. Firstly, they would help alleviate data collection as we would not require millions of labeled examples to attain reasonable performance. Furthermore, in many fields, data exhibits the characteristic of having many different classes but few examples per class. Models that are able to generalize from few examples would be able to capture this type of data effectively.
14
+
15
+ There seem to be two main reasons why gradient-based optimization fails in the face of few labeled examples. Firstly, the variants of gradient-based optimization algorithms, such as momentum (Nesterov, 1983), Adagrad (Duchi et al., 2011), Adadelta (Zeiler, 2012), and ADAM (Kingma & Ba, 2014), weren’t designed specifically to perform well under the constraint of a set number of updates. Specifically when applied to non-convex optimization problems, with a reasonable choice of hyperparameters these algorithms don’t have very strong guarantees of speed of convergence, beyond that they will eventually converge to a good solution after what could be many millions of iterations. Secondly, for each separate dataset considered, the network would have to start from a random initialization of its parameters, which considerably hurts its ability to converge to a good solution after a few updates. Transfer learning (Caruana, 1995; Bengio et al., 2012; Donahue et al., 2013) can be applied to alleviate this problem by fine-tuning a pre-trained network from another task which has more labelled data; however, it has been observed that the benefit of a pre-trained network greatly decreases as the task the network was trained on diverges from the target task (Yosinski et al., 2014). What is needed is a systematic way to learn a beneficial common initialization that would serve as a good point to start training for the set of datasets being considered. This would provide the same benefits as transfer learning, but with the guarantee that the initialization is an optimal starting point for fine-tuning.
16
+
17
+ Previous work has suggested one manner in which to acquire quick knowledge from few examples, through the idea of meta-learning (Thrun, 1998; Schmidhuber et al., 1997). Meta-learning suggests framing the learning problem at two levels. The first is quick acquisition of knowledge within each separate task presented. This process is guided by the second, which involves slower extraction of information learned across all the tasks.
18
+
19
+ We present a method here that addresses the weakness of neutral networks trained with gradientbased optimization on the few-shot learning problem by framing the problem within a meta-learning setting. We propose an LSTM-based meta-learner optimizer that is trained to optimize a learner neural network classifier. The meta-learner captures both short-term knowledge within a task and long-term knowledge common among all the tasks. By using an objective that directly captures an optimization algorithm’s ability to have good generalization performance given only a set number of updates, the meta-learner model is trained to converge a learner classifier to a good solution quickly on each task. Additionally, the formulation of our meta-learner model allows it to learn a task-common initialization for the learner classifier, which captures fundamental knowledge shared among all the tasks.
20
+
21
+ # 2 TASK DESCRIPTION
22
+
23
+ We first begin by detailing the meta-learning formulation we use. In the typical machine learning setting, we are interested in a dataset $D$ and usually split $D$ so that we optimize parameters $\theta$ on a training set $D _ { t r a i n }$ and evaluate its generalization on the test set $D _ { t e s t }$ . In meta-learning, however, we are dealing with meta-sets $\mathcal { D }$ containing multiple regular datasets, where each $D \in { \mathcal { D } }$ has a split of $D _ { t r a i n }$ and $D _ { t e s t }$ .
24
+
25
+ We consider the $k$ -shot, $N$ -class classification task, where for each dataset $D$ , the training set consists of $k$ labelled examples for each of $N$ classes, meaning that $D _ { t r a i n }$ consists of $k \cdot N$ examples, and $D _ { t e s t }$ has a set number of examples for evaluation. We note that previous work (Vinyals et al., 2016) has used the term episode to describe each dataset consisting of a training and test set.
26
+
27
+ In meta-learning, we thus have different meta-sets for meta-training, meta-validation, and metatesting $( \mathcal { D } _ { m e t a - t r a i n }$ , $\mathcal { D } _ { m e t a - v a l i d a t i o n }$ , and $\mathcal { D } _ { m e t a - t e s t }$ , respectively). On $\mathcal { D } _ { m e t a - t r a i n }$ , we are interested in training a learning procedure (the meta-learner) that can take as input one of its training sets $D _ { t r a i n }$ and produce a classifier (the learner) that achieves high average classification performance on its corresponding test set $D _ { t e s t }$ . Using $\mathcal { D } _ { m e t a - v a l i d a t i o n }$ we can perform hyper-parameter selection of the meta-learner and evaluate its generalization performance on $\mathcal { D } _ { m e t a - t e s t }$ .
28
+
29
+ For this formulation to correspond to the few-shot learning setting, each training set in datasets $D \in { \mathcal { D } }$ will contain few labeled examples (we consider $k = 1$ or $k = 5$ ), that must be used to generalize to good performance on the corresponding test set. An example of this formulation is given in Figure 1.
30
+
31
+ # 3 MODEL
32
+
33
+ We now move to the description of our proposed model for meta-learning.
34
+
35
+ # 3.1 MODEL DESCRIPTION
36
+
37
+ Consider a single dataset, or episode, $D \in \mathcal { D } _ { m e t a - t r a i n }$ . Suppose we have a learner neural net classifier with parameters $\theta$ that we want to train on $D _ { t r a i n }$ . The standard optimization algorithms used to train deep neural networks are some variant of gradient descent, which uses updates of the form
38
+
39
+ $$
40
+ \theta _ { t } = \theta _ { t - 1 } - \alpha _ { t } \nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t } ,
41
+ $$
42
+
43
+ ![](images/e2e6fe20fd5637b14c1999b4c2f7aba46971b973299832b60342a6c17e965540.jpg)
44
+ Figure 1: Example of meta-learning setup. The top represents the meta-training set $\mathcal { D } _ { m e t a - t r a i n }$ , where inside each gray box is a separate dataset that consists of the training set $D _ { t r a i n }$ (left side of dashed line) and the test set $D _ { t e s t }$ (right side of dashed line). In this illustration, we are considering the 1-shot, 5-class classification task where for each dataset, we have one example from each of 5 classes (each given a label 1-5) in the training set and 2 examples for evaluation in the test set. The meta-test set $\mathcal { D } _ { m e t a - t e s t }$ is defined in the same way, but with a different set of datasets that cover classes not present in any of the datasets in $\mathcal { D } _ { m e t a - t r a i n }$ (similarly, we additionally have a meta-validation set that is used to determine hyper-parameters).
45
+
46
+ where $\theta _ { t - 1 }$ are the parameters of the learner after $t - 1$ updates, $\alpha _ { t }$ is the learning rate at time $t$ , $\mathcal { L } _ { t }$ is the loss optimized by the learner for its $t ^ { \mathrm { t h } }$ update, $\nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t }$ is the gradient of that loss with respect to parameters $\theta _ { t - 1 }$ , and $\theta _ { t }$ is the updated parameters of the learner.
47
+
48
+ Our key observation that we leverage here is that this update resembles the update for the cell state in an LSTM (Hochreiter & Schmidhuber, 1997)
49
+
50
+ $$
51
+ c _ { t } = f _ { t } \odot c _ { t - 1 } + i _ { t } \odot \tilde { c } _ { t } ,
52
+ $$
53
+
54
+ if $f _ { t } = 1 , c _ { t - 1 } = \theta _ { t - 1 } , i _ { t } = \alpha _ { t }$ , and $\tilde { c } _ { t } = - \nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t }$
55
+
56
+ Thus, we propose training a meta-learner LSTM to learn an update rule for training a neural network. We set the cell state of the LSTM to be the parameters of the learner, or $c _ { t } = \theta _ { t }$ , and the candidate cell state $\tilde { c } _ { t } = \nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t }$ , given how valuable information about the gradient is for optimization. We define parametric forms for $i _ { t }$ and $f _ { t }$ so that the meta-learner can determine optimal values through the course of the updates.
57
+
58
+ Let us start with $i _ { t }$ , which corresponds to the learning rate for the updates. We let
59
+
60
+ $$
61
+ i _ { t } = \sigma \left( \mathbf { W } _ { I } \cdot \left[ \nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t } , \mathcal { L } _ { t } , \theta _ { t - 1 } , i _ { t - 1 } \right] + { \mathbf { b } } _ { I } \right) ,
62
+ $$
63
+
64
+ meaning that the learning rate is a function of the current parameter value $\theta _ { t - 1 }$ , the current gradient $\nabla _ { \theta _ { t - 1 } } \bar { \mathcal { L } } _ { t }$ , the current loss $\scriptstyle { \mathcal { L } } _ { t }$ , and the previous learning rate $i _ { t - 1 }$ . With this information, the metalearner should be able to finely control the learning rate so as to train the learner quickly while avoiding divergence.
65
+
66
+ As for $f _ { t }$ , it seems possible that the optimal choice isn’t the constant 1. Intuitively, what would justify shrinking the parameters of the learner and forgetting part of its previous value would be if the learner is currently in a bad local optima and needs a large change to escape. This would correspond to a situation where the loss is high but the gradient is close to zero. Thus, one proposal for the forget gate is to have it be a function of that information, as well as the previous value of the forget gate:
67
+
68
+ $$
69
+ f _ { t } = \sigma \left( \mathbf { W } _ { F } \cdot \left[ \nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t } , \mathcal { L } _ { t } , \theta _ { t - 1 } , f _ { t - 1 } \right] + { \mathbf { b } } _ { F } \right) .
70
+ $$
71
+
72
+ Additionally, notice that we can also learn the initial value of the cell state $c _ { 0 }$ for the LSTM, treating it as a parameter of the meta-learner. This corresponds to the initial weights of the classifier (that the meta-learner is training). Learning this initial value lets the meta-learner determine the optimal initial weights of the learner so that training begins from a beneficial starting point that allows optimization to proceed rapidly. Lastly, note that though the meta-learner’s update rule matches the cell state update of the LSTM, the meta-learner also bears similarity to the GRU (Cho et al., 2014) hidden state update, with the exception that the forget and input gates aren’t tied to sum to one.
73
+
74
+ # 3.2 PARAMETER SHARING & PREPROCESSING
75
+
76
+ Because we want our meta-learner to produce updates for deep neural networks, which consist of tens of thousands of parameters, to prevent an explosion of meta-learner parameters we need to employ some sort of parameter sharing. Thus as in Andrychowicz et al. (2016), we share parameters across the coordinates of the learner gradient. This means each coordinate has its own hidden and cell state values but the LSTM parameters are the same across all coordinates. This allows us to use a compact LSTM model and additionally has the nice property that the same update rule is used for each coordinate, but one that is dependent on the respective history of each coordinate during optimization. We can easily implement parameter sharing by having the input be a batch of gradient coordinates and loss inputs $( \nabla _ { \theta _ { t , i } } \mathcal { L } _ { t } , \mathcal { L } _ { t } )$ for each dimension $i$ .
77
+
78
+ Because the different coordinates of the gradients and the losses can be of very different magnitudes, we need to be careful in normalizing the values so that the meta-learner is able to use them properly during training. Thus, we also found that the preprocessing method of Andrychowicz et al. (2016) worked well when applied to both the dimensions of the gradients and the losses at each time step:
79
+
80
+ $$
81
+ x \to \left\{ { \begin{array} { l l } { \left( { \frac { \log ( | x | ) } { p } } , \operatorname { s g n } ( x ) \right) } & { { \mathrm { i f ~ } } | x | \geq e ^ { - p } } \\ { ( - 1 , e ^ { p } x ) } & { { \mathrm { o t h e r w i s e } } } \end{array} } \right.
82
+ $$
83
+
84
+ This preprocessing adjusts the scaling of gradients and losses, while also separating the information about their magnitude and their sign (the latter being mostly useful for gradients). We found that the suggested value of $p = 1 0$ in the above formula worked well in our experiments.
85
+
86
+ # 3.3 TRAINING
87
+
88
+ The question now is how do we train the LSTM meta-learner model to be effective at few-shot learning tasks? As observed in Vinyals et al. (2016), in order to perform well at this task, it is key to have training conditions match those of test time. During evaluation of the meta-learning, for each dataset (episode), $D = ( D _ { t r a i n } , D _ { t e s t } ) \in \mathcal { D } _ { m e t a - t e s t }$ , a good meta-learner model will, given a series of learner gradients and losses on the training set $D _ { t r a i n }$ , suggest a series of updates for the classifier that pushes it towards good performance on the test set $D _ { t e s t }$ .
89
+
90
+ Thus to match test time conditions, when considering each dataset $D \in \mathcal { D } _ { m e t a - t r a i n }$ , the training objective we use is the loss $\mathcal { L } _ { t e s t }$ of the produced classifier on $D$ ’s test set $D _ { t e s t }$ . While iterating over the examples in $D$ ’s training set $D _ { t r a i n }$ , at each time step $t$ the LSTM meta-learner receives $( \nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t } , \mathcal { L } _ { t } )$ from the learner (the classifier) and proposes the new set of parameters $\theta _ { t }$ . The process repeats for $T$ steps, after which the classifier and its final parameters are evaluated on the test set to produce the loss that is then used to train the meta-learner. The training algorithm is described in Algorithm 1 and the corresponding computational graph is shown in Figure 2.
91
+
92
+ # 3.3.1 GRADIENT INDEPENDENCE ASSUMPTION
93
+
94
+ Notice that our formulation would imply that the losses $\mathcal { L } _ { t }$ and gradients $\nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t }$ of the learner are dependent on the parameters of the meta-learner. Gradients on the meta-learner’s parameters should normally take this dependency into account. However, as discussed by Andrychowicz et al. (2016), this complicates the computation of the meta-learner’s gradients. Thus, following Andrychowicz et al. (2016), we make the simplifying assumption that these contributions to the gradients aren’t important and can be ignored, which allows us to avoid taking second derivatives, a considerably expensive operation. We were still able to train the meta-learner effectively in spite of this simplifying assumption.
95
+
96
+ ![](images/7694e2406518b27117c703bdf850f7e323c2b29428e92b79f94d5628f188adca.jpg)
97
+ Figure 2: Computational graph for the forward pass of the meta-learner. The dashed line divides examples from the training set $D _ { t r a i n }$ and test set $D _ { t e s t }$ . Each $( \mathbf { X } _ { i } , \mathbf { Y } _ { i } )$ is the $i ^ { t h }$ batch from the training set whereas $( \mathbf { X } , \mathbf { Y } )$ is all the elements from the test set. The dashed arrows indicate that we do not back-propagate through that step when training the meta-learner. We refer to the learner as $M$ , where $M ( \mathbf { X } ; \theta )$ is the output of learner $M$ using parameters $\theta$ for inputs $\mathbf { X }$ . We also use $\nabla _ { t }$ as a shorthand for $\nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t }$ .
98
+
99
+ # 3.3.2 INITIALIZATION OF META-LEARNER LSTM
100
+
101
+ When training LSTMs, it is advised to initialize the LSTM with small random weights and to set the forget gate bias to a large value so that the forget gate is initialized to be close to 1, thus enabling gradient flow (Zaremba, 2015). In addition to the forget gate bias setting, we found that we needed to initialize the input gate bias to be small so that the input gate value (and thus the learning rate) used by the meta-learner LSTM starts out being small. With this combined initialization, the metalearner starts close to normal gradient descent with a small learning rate, which helps initial stability of training.
102
+
103
+ # 3.4 BATCH NORMALIZATION
104
+
105
+ Batch Normalization (Ioffe & Szegedy, 2015) is a recently proposed method to stabilize and thus speed up learning of deep neural networks by reducing internal covariate shift within the learner’s hidden layers. This reduction is achieved by normalizing each layer’s pre-activation, by subtracting by the mean and dividing by the standard deviation. During training, the mean and standard deviation are estimated using the current batch being trained on, whereas during evaluation a running average of both statistics calculated on the training set is used. We need to be careful with batch normalization for the learner network in the meta-learning setting, because we do not want to collect mean and standard deviation statistics during meta-testing in a way that allows information to leak between different datasets (episodes), being considered. One easy way to prevent this issue is to not collect statistics at all during the meta-testing phase, but just use our running averages from metatraining. This, however, has a bad impact on performance, because we have changed meta-training and meta-testing conditions, causing the meta-learner to learn a method of optimization that relies on batch statistics which it now does not have at meta-testing time. In order to keep the two phases as similar as possible, we found that a better strategy was to collect statistics for each dataset $D \in { \mathcal { D } }$ during $\mathcal { D } _ { m e t a - t e s t }$ , but then erase the running statistics when we consider the next dataset. Thus, during meta-training, we use batch statistics for both the training and testing set whereas during meta-testing, we use batch statistics for the training set (and to compute our running averages) but then use the running averages during testing. This does not cause any information to leak between different datasets, but also allows the meta-learner to be trained on conditions that are matched between training and testing. Lastly, because we are doing very few training steps, we computed the running averages so that higher preference is given to the later values.
106
+
107
+ # Algorithm 1 Train Meta-Learner
108
+
109
+ Input: Meta-training set $\overline { { \mathcal { D } _ { m e t a - t r a i n } } }$ , Learner $M$ with parameters θ, Meta-Learner $R$ with parameters $\Theta$ .
110
+
111
+ 1: $\Theta _ { 0 } \gets$ random initialization
112
+ 2:
113
+ 3: for $d = 1 , n$ do
114
+ 4: $D _ { t r a i n } , D _ { t e s t } $ random dataset from $\mathcal { D } _ { m e t a - t r a i n }$
115
+ 5: θ0 ← c0 . Intialize learner parameters
116
+ 6:
117
+ 7: 8: for $\begin{array} { r l } & { \mathbf { r } \ t = 1 , T \ \mathbf { \delta } \mathbf { \cdot } \mathbf { d o } } \\ & { \mathbf { X } _ { t } , \mathbf { Y } _ { t } \gets \mathrm { r a n d o m \ b a t c h \ f r o m \ } D _ { t r a i n } } \\ & { \mathcal { L } _ { t } \gets \mathcal { L } ( M ( \mathbf { X } _ { t } ; \theta _ { t - 1 } ) , \mathbf { Y } _ { t } ) } \\ & { c _ { t } \gets R ( ( \nabla _ { \theta _ { t - 1 } } \mathcal { L } _ { t } , \mathcal { L } _ { t } ) ; \Theta _ { d - 1 } ) } \\ & { \theta _ { t } \gets c _ { t } } \end{array}$ $t = 1 , T$ do
118
+ 9: $\triangleright$ Get loss of learner on train batch
119
+ 10: . Get output of meta-learner using Equation 2
120
+ 11: $\triangleright$ Update learner parameters
121
+ 12: end for
122
+ 13:
123
+ 14: 15: $\begin{array} { r l } & { \mathbf { X } , \mathbf { Y } \gets D _ { t e s t } } \\ & { \mathcal { L } _ { t e s t } \gets \mathcal { L } ( M ( \mathbf { X } ; \boldsymbol { \theta } _ { T } ) , \mathbf { Y } ) } \end{array}$ $\triangleright$ Get loss of learner on test batch
124
+ 16: Update $\Theta _ { d }$ using $\nabla _ { \Theta _ { d - 1 } } \mathcal { L } _ { t e s t }$ . Update meta-learner parameters
125
+ 17:
126
+ 18: end for
127
+
128
+ # 4 RELATED WORK
129
+
130
+ While this work falls within the broad literature of transfer learning in general, we focus here on positioning it relative to previous work on meta-learning and few-shot learning.
131
+
132
+ # 4.1 META-LEARNING
133
+
134
+ Meta-learning has a long history, but has grown to prominence recently as many have advocated for it as a key to achieving human-level intelligence in the future (Lake et al., 2016). The ability to learn at two levels (learning within each task presented, while accumulating knowledge about the similarities and differences between tasks) is seen as being crucial to improving AI. Previous work has used a variety of techniques in the meta-learning setting.
135
+
136
+ Schmidhuber (1992; 1993) explored using networks that learn how to modify their own weights over a number of computations steps on the input. The updating of the weights is defined in a parametric form that allows the prediction and weight-change process to be differentiable end-to-end. The work of Bengio et al. (1990; 1995) and Bengio (1993) considered learning update rules for neural networks that are biologically plausible. This property is enforced by allowing the parametric form of the update to only have as input local information at each hidden unit to determine the weight change. Different optimization methods, such as genetic programming or simulated annealing, are used to train the learning rule.
137
+
138
+ In Santoro et al. (2016), a memory-augmented neural network is trained to learn how to store and retrieve memories to use for each classification task. The work of Andrychowicz et al. (2016) uses an LSTM to train a neural network; however, they are interested in learning a general optimization algorithm to train neural networks for large-scale classification, whereas we are interested in the few-shot learning problem. This work also builds upon Hochreiter et al. (2001) and Bosc, both of which used LSTMs to train multi-layer perceptrons to learn on binary classification and timeseries prediction tasks. Another related method is the work of Bertinetto et al. (2016), who train a meta-learner to map a training example to the weights of a neural network that is then used to classify future examples from this class; however, unlike our method the classifier network is directly produced rather than being fine-tuned after multiple training steps. Our work also bears similarity to Maclaurin et al. (2015), who tune the hyperparameters of gradient descent with momentum by backpropagating through the chain of gradient steps to optimize the validation performance.
139
+
140
+ # 4.2 FEW-SHOT LEARNING
141
+
142
+ The best performing methods for few-shot learning have been mainly metric learning methods. Deep siamese networks (Koch, 2015) train a convolutional network to embed examples so that items in the same class are close while items in different classes are far away, according to some distance metric. Matching networks (Vinyals et al., 2016) refine this idea so that training and testing conditions match, by defining a differentiable nearest neighbor loss involving the cosine similarities of embeddings produced by a convolutional network.
143
+
144
+ # 5 EVALUATION
145
+
146
+ In this section, we describe the results of experiments, examining the properties of our model and comparing our method’s performance against different approaches∗. Following Vinyals et al. (2016), we consider the $k$ -shot, $N$ -class classification setting where a meta-learner trains on many related but small training sets of $k$ examples for each of $N$ classes. We first split the list of all classes in the data into disjoint sets and assign them to each meta-set of meta-training, meta-validation, and meta-testing. To generate each instance of a $k$ -shot, $N$ -class task dataset $D = ( D _ { t r a i n } , D _ { t e s t } ) \in \mathcal { D }$ , we do the following: we first sample $N$ classes from the list of classes corresponding to the meta-set we consider. We then sample $k$ examples from each of those classes. These $k$ examples together compose the training set $D _ { t r a i n }$ . Then, an additional fixed amount of the rest of the examples are sampled to yield a test set $D _ { t e s t }$ . We generally have 15 examples per class in the test sets. When training the meta-learner, we iterate by sampling these datasets (episodes) repeatedly. For metavalidation and meta-testing, however, we produce a fixed number of these datasets to evaluate each method. We produce enough datasets to ensure that the confidence interval of the mean accuracy is small.
147
+
148
+ For the learner, we use a simple CNN containing 4 convolutional layers, each of which is a $3 \times 3$ convolution with 32 filters, followed by batch normalization, a ReLU non-linearity, and lastly a $2 \times 2$ max-pooling. The network then has a final linear layer followed by a softmax for the number of classes being considered. The loss function $\mathcal { L }$ is the average negative log-probability assigned by the learner to the correct class. For the meta-learner, we use a 2-layer LSTM, where the first layer is a normal LSTM and the second layer is our modified LSTM meta-learner. The gradients and losses are preprocessed and fed into the first layer LSTM, and the regular gradient coordinates are also used by the second layer LSTM to implement the state update rule shown in (1). At each time step, the learner’s loss and gradient is computed on a batch consisting of the entire training set $D _ { t r a i n }$ , because we consider training sets with only a total of 5 or 25 examples. We train our LSTM with ADAM using a learning rate of 0.001 and with gradient clipping using a value of 0.25.
149
+
150
+ # 5.1 EXPERIMENT RESULTS
151
+
152
+ The Mini-ImageNet dataset was proposed by Vinyals et al. (2016) as a benchmark offering the challenges of the complexity of ImageNet images, without requiring the resources and infrastructure necessary to run on the full ImageNet dataset. Because the exact splits used in Vinyals et al. (2016) were not released, we create our own version of the Mini-Imagenet dataset by selecting a random 100 classes from ImageNet and picking 600 examples of each class. We use 64, 16, and 20 classes for training, validation and testing, respectively. We consider 1-shot and 5-shot classification for 5 classes. We use 15 examples per class for evaluation in each test set. We compare against two baselines and a recent metric-learning technique, Matching Networks (Vinyals et al., 2016), which has achieved state-of-the-art results in few-shot learning. The results are shown in Table 1.
153
+
154
+ The first baseline we use is a nearest-neighbor baseline (Baseline-nearest-neighbor), where we first train a network to classify between all the classes jointly in the original meta-training set. At metatest time, for each dataset $D$ , we embed all the items in the training set using our trained network and then use nearest-neighbor matching among the embedded training examples to classify each test example. The second baseline we use (Baseline-finetune) represents a coarser version of our metalearner model. As in the first baseline, we start by training a network to classify jointly between all classes in the meta-training set. We then use the meta-validation set to search over SGD hyperparameters, where each training set is used to fine-tune the pre-trained network before evaluating on the test set. We use a fixed number of updates for fine tuning and search over the learning rate and learning rate decay used during the course of these updates.
155
+
156
+ Table 1: Average classification accuracies on Mini-ImageNet with $9 5 \%$ confidence intervals. Marked in bold are the best results for each scenario, as well as other results with an overlapping confidence interval.
157
+
158
+ <table><tr><td rowspan="2">Model</td><td colspan="2">5-class</td></tr><tr><td>1-shot</td><td>5-shot</td></tr><tr><td>Baseline-finetune</td><td>28.86 ± 0.54%</td><td>49.79 ± 0.79%</td></tr><tr><td>Baseline-nearest-neighbor</td><td>41.08 ± 0.70%</td><td>51.04 ± 0.65%</td></tr><tr><td>Matching Network</td><td>43.40±0.78%</td><td>51.09 ± 0.71%</td></tr><tr><td>Matching Network FCE</td><td>43.56 ± 0.84%</td><td>55.31 ± 0.73%</td></tr><tr><td>Meta-Learner LSTM (OURS)</td><td>43.44 ± 0.77%</td><td>60.60 ± 0.71%</td></tr></table>
159
+
160
+ For Matching Networks, we implemented our own version of both the basic and the fully-conditional embedding (FCE) versions. In the basic version, a convolutional network is trained to learn independent embeddings for examples in the training and test set. In the FCE version, a bidirectional-LSTM is used to learn an embedding for the training set such that each training example’s embedding is also a function of all the other training examples. Additionally, an attention-LSTM is used so that a test example embedding is also a function of all the embeddings of the training set. We do not consider fine-tuning the network using the train set during meta-testing to improve performance as mentioned in Vinyals et al. (2016), but do note that our meta-learner could also be fine-tuned using this data. Note that to remain consistent with Vinyals et al. (2016), our baseline and matching net convolutional networks have 4 layers each with 64 filters. We also added dropout to each convolutional block in matching nets to prevent overfitting.
161
+
162
+ For our meta-learner, we train different models for the 1-shot and 5-shot tasks, that make 12 and 5 updates, respectively. We noticed that better performance for each task was attained if the metalearner is explicitly trained to do the set number of updates during meta-training that will be used during meta-testing.
163
+
164
+ We attain results that are much better than the baselines discussed and competitive with Matching Networks. For 5-shot, we are able to do much better than Matching Networks, whereas for 1-shot, the confidence interval for our performance intersects the interval for Matching Networks. Again, we note that the numbers do not match the ones provided by Vinyals et al. (2016) simply because we created our version of the dataset and implemented our own versions of their model. It is interesting to note that the fine-tuned baseline is worse than the nearest-neighbor baseline. Because we are not regularizing the classifier, with very few updates the fine-tuning model overfits, especially in the 1-shot case. This propensity to overfit speaks to the benefit of meta-training the initialization of the classifier end-to-end as is done in the meta-learning LSTM.
165
+
166
+ # 5.2 VISUALIZATION OF META-LEARNER
167
+
168
+ We also visualize the optimization strategy learned by the meta-learner, in Figure 3. We can look at the $i _ { t }$ and $f _ { t }$ gate values in Equation 2 at each update step, to try to get an understanding of how the meta-learner updates the learner during training. We visualize the gate values while training on different datasets $D _ { t r a i n }$ , to observe whether there are variations between training sets. We consider both 1-shot and 5-shot classification settings, where the meta-learner is making 10 and 5 updates, respectively. For the forget gate values for both tasks, the meta-learner seems to adopt a simple weight decay strategy that seems consistent across different layers. The input gate values are harder to interpret to glean the meta-learner’s strategy. However, there seems to a be a lot of variability between different datasets, indicating that the meta-learner isn’t simply learning a fixed optimization strategy. Additionally, there seem to be differences between the two tasks, suggesting that the meta-learner has adopted different methods to deal with the different conditions of each setting.
169
+
170
+ ![](images/1f1e5a7520c8e157de196092efc3251653304bb26f83448f6382ace1021ded51.jpg)
171
+ Figure 3: Visualization of the input and forget values output by the meta-learner during the course of its updates. Layers $1 - 4$ represent the values for a randomly selected parameter from the 4 convolutional layers and layer 5 represents the values for a random parameter from fully-connected layer. The different curves represent training steps on different datasets.
172
+
173
+ # 6 CONCLUSION
174
+
175
+ We described an LSTM-based model for meta-learning, which is inspired from the parameter updates suggested by gradient descent optimization algorithms. Our LSTM meta-learner uses its state to represent the learning updates of the parameters of a classifier. It is trained to discover both a good initialization for the learner’s parameters, as well as a successful mechanism for updating the learner’s parameters to a given small training set for some new classification task. Our experiments demonstrate that our approach outperforms natural baselines and is competitive to the state-of-theart in metric learning for few-shot learning.
176
+
177
+ In this work, we focused our study to the few-shot and few-classes setting. However, it would be more valuable to train meta-learners that can perform well across a full spectrum of settings, i.e. for few or lots of training examples and for few or lots of possible classes. Our future work will thus consider moving towards this more challenging scenario.
178
+
179
+ # ACKNOWLEDGMENTS
180
+
181
+ We thank Jake Snell, Kevin Swersky, and Oriol Vinyals for helpful discussions of this work.
182
+
183
+ # REFERENCES
184
+
185
+ Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W. Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. CoRR, abs/1606.04474, 2016. URL http://arxiv.org/abs/1606.04474.
186
+
187
+ Samy Bengio. Optimisation d’une regle d’apprentissage pour r ´ eseaux de neurones artificiels ´ . PhD thesis, Departement d’Informatique et Recherche Op ´ erationnelle. Universit ´ e de Montr ´ eal, 1993. ´
188
+
189
+ Samy Bengio, Yoshua Bengio, and Jocelyn Cloutier. On the search for new learning rules for ANNs. Neural Processing Letters, 2(4):26–30, 1995.
190
+
191
+ Yoshua Bengio, Samy Bengio, and Jocelyn Cloutier. Learning a synaptic learning rule. Universite´ de Montreal, D ´ epartement d’informatique et de recherche op ´ erationnelle, 1990. ´
192
+
193
+ Yoshua Bengio et al. Deep learning of representations for unsupervised and transfer learning. ICML Unsupervised and Transfer Learning, 27:17–36, 2012.
194
+
195
+ Luca Bertinetto, Joao F. Henriques, Jack Valmadre, Philip H. S. Torr, and Andrea Vedaldi. Learning ˜ feed-forward one-shot learners. CoRR, abs/1606.05233, 2016. URL http://arxiv.org/ abs/1606.05233.
196
+
197
+ Tom Bosc. Learning to learn neural networks.
198
+
199
+ Rich Caruana. Learning many related tasks at the same time with backpropagation. Advances in neural information processing systems, pp. 657–664, 1995.
200
+
201
+ Kyunghyun Cho, Bart van Merrienboer, C¸ aglar Gulc¸ehre, Fethi Bougares, Holger Schwenk, and ¨ Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. CoRR, abs/1406.1078, 2014. URL http://arxiv.org/abs/1406. 1078.
202
+
203
+ Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. CoRR, abs/1310.1531, 2013. URL http://arxiv.org/abs/1310.1531.
204
+
205
+ John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. J. Mach. Learn. Res., 12:2121–2159, July 2011. ISSN 1532-4435. URL http://dl.acm.org/citation.cfm?id $\equiv$ 1953048.2021068.
206
+
207
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. URL http://arxiv.org/abs/1512.03385.
208
+
209
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
210
+
211
+ Sepp Hochreiter, A. Steven Younger, and Peter R. Conwell. Learning to learn using gradient descent. In IN LECTURE NOTES ON COMP. SCI. 2130, PROC. INTL. CONF. ON ARTI NEURAL NETWORKS (ICANN-2001, pp. 87–94. Springer, 2001.
212
+
213
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. CoRR, abs/1502.03167, 2015. URL http://arxiv.org/ abs/1502.03167.
214
+
215
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980.
216
+
217
+ Gregory Koch. Siamese neural networks for one-shot image recognition. PhD thesis, University of Toronto, 2015.
218
+
219
+ Brenden M. Lake, Tomer D. Ullman, Joshua B. Tenenbaum, and Samuel J. Gershman. Building machines that learn and think like people. CoRR, abs/1604.00289, 2016. URL http://arxiv. org/abs/1604.00289.
220
+
221
+ Dougal Maclaurin, David Duvenaud, and Ryan P Adams. Gradient-based hyperparameter optimization through reversible learning. In Proceedings of the 32nd International Conference on Machine Learning, 2015.
222
+
223
+ Yurii Nesterov. A method of solving a convex programming problem with convergence rate o (1/k2). 1983.
224
+
225
+ Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
226
+
227
+ Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy P. Lillicrap. Oneshot learning with memory-augmented neural networks. CoRR, abs/1605.06065, 2016. URL http://arxiv.org/abs/1605.06065.
228
+
229
+ Jurgen Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent ¨ networks. Neural Computation, 4(1):131–139, 1992.
230
+
231
+ Jurgen Schmidhuber. A neural network that embeds its own meta-levels. In ¨ Neural Networks, 1993., IEEE International Conference on, pp. 407–412. IEEE, 1993.
232
+
233
+ Jurgen Schmidhuber, Jieyu Zhao, and Marco Wiering. Shifting inductive bias with success-story ¨ algorithm, adaptive levin search, and incremental self-improvement. Machine Learning, 28(1): 105–130, 1997.
234
+
235
+ Sebastian Thrun. Lifelong learning algorithms. In Learning to learn, pp. 181–209. Springer, 1998.
236
+
237
+ Oriol Vinyals, Charles Blundell, Timothy P. Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. CoRR, abs/1606.04080, 2016. URL http://arxiv. org/abs/1606.04080.
238
+
239
+ Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
240
+
241
+ Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? CoRR, abs/1411.1792, 2014. URL http://arxiv.org/abs/1411. 1792.
242
+
243
+ Wojciech Zaremba. An empirical exploration of recurrent network architectures. 2015.
244
+
245
+ Matthew D. Zeiler. ADADELTA: an adaptive learning rate method. CoRR, abs/1212.5701, 2012. URL http://arxiv.org/abs/1212.5701.
parse/train/rJY0-Kcll/rJY0-Kcll_content_list.json ADDED
@@ -0,0 +1,1271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "OPTIMIZATION AS A MODEL FOR FEW-SHOT LEARNING ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 174,
8
+ 99,
9
+ 571,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Sachin Ravi∗and Hugo Larochelle ",
17
+ "bbox": [
18
+ 184,
19
+ 170,
20
+ 423,
21
+ 185
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Twitter, Cambridge, USA {sachinr,hugo}@twitter.com ",
28
+ "bbox": [
29
+ 184,
30
+ 188,
31
+ 437,
32
+ 218
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "ABSTRACT ",
39
+ "text_level": 1,
40
+ "bbox": [
41
+ 452,
42
+ 256,
43
+ 544,
44
+ 270
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "Though deep neural networks have shown great success in the large data domain, they generally perform poorly on few-shot learning tasks, where a classifier has to quickly generalize after seeing very few examples from each class. The general belief is that gradient-based optimization in high capacity classifiers requires many iterative steps over many examples to perform well. Here, we propose an LSTMbased meta-learner model to learn the exact optimization algorithm used to train another learner neural network classifier in the few-shot regime. The parametrization of our model allows it to learn appropriate parameter updates specifically for the scenario where a set amount of updates will be made, while also learning a general initialization of the learner (classifier) network that allows for quick convergence of training. We demonstrate that this meta-learning model is competitive with deep metric-learning techniques for few-shot learning. ",
51
+ "bbox": [
52
+ 233,
53
+ 285,
54
+ 764,
55
+ 452
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 INTRODUCTION ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 176,
65
+ 477,
66
+ 336,
67
+ 492
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Deep learning has shown great success in a variety of tasks with large amounts of labeled data in image classification (He et al., 2015), machine translation (Wu et al., 2016), and speech modeling (Oord et al., 2016). These achievements have relied on the fact that optimization of these deep, high-capacity models requires many iterative updates across many labeled examples. This type of optimization breaks down in the small data regime where we want to learn from very few labeled examples. In this setting, rather than have one large dataset, we have a set of datasets, each with few annotated examples per class. The motivation for this task lies not only in the fact that humans, even children, can usually generalize after just one example of a given object, but also because models excelling at this task would have many useful applications. Firstly, they would help alleviate data collection as we would not require millions of labeled examples to attain reasonable performance. Furthermore, in many fields, data exhibits the characteristic of having many different classes but few examples per class. Models that are able to generalize from few examples would be able to capture this type of data effectively. ",
74
+ "bbox": [
75
+ 174,
76
+ 508,
77
+ 825,
78
+ 689
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "There seem to be two main reasons why gradient-based optimization fails in the face of few labeled examples. Firstly, the variants of gradient-based optimization algorithms, such as momentum (Nesterov, 1983), Adagrad (Duchi et al., 2011), Adadelta (Zeiler, 2012), and ADAM (Kingma & Ba, 2014), weren’t designed specifically to perform well under the constraint of a set number of updates. Specifically when applied to non-convex optimization problems, with a reasonable choice of hyperparameters these algorithms don’t have very strong guarantees of speed of convergence, beyond that they will eventually converge to a good solution after what could be many millions of iterations. Secondly, for each separate dataset considered, the network would have to start from a random initialization of its parameters, which considerably hurts its ability to converge to a good solution after a few updates. Transfer learning (Caruana, 1995; Bengio et al., 2012; Donahue et al., 2013) can be applied to alleviate this problem by fine-tuning a pre-trained network from another task which has more labelled data; however, it has been observed that the benefit of a pre-trained network greatly decreases as the task the network was trained on diverges from the target task (Yosinski et al., 2014). What is needed is a systematic way to learn a beneficial common initialization that would serve as a good point to start training for the set of datasets being considered. This would provide the same benefits as transfer learning, but with the guarantee that the initialization is an optimal starting point for fine-tuning. ",
85
+ "bbox": [
86
+ 174,
87
+ 695,
88
+ 825,
89
+ 890
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "",
96
+ "bbox": [
97
+ 176,
98
+ 103,
99
+ 823,
100
+ 146
101
+ ],
102
+ "page_idx": 1
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Previous work has suggested one manner in which to acquire quick knowledge from few examples, through the idea of meta-learning (Thrun, 1998; Schmidhuber et al., 1997). Meta-learning suggests framing the learning problem at two levels. The first is quick acquisition of knowledge within each separate task presented. This process is guided by the second, which involves slower extraction of information learned across all the tasks. ",
107
+ "bbox": [
108
+ 174,
109
+ 152,
110
+ 825,
111
+ 222
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "We present a method here that addresses the weakness of neutral networks trained with gradientbased optimization on the few-shot learning problem by framing the problem within a meta-learning setting. We propose an LSTM-based meta-learner optimizer that is trained to optimize a learner neural network classifier. The meta-learner captures both short-term knowledge within a task and long-term knowledge common among all the tasks. By using an objective that directly captures an optimization algorithm’s ability to have good generalization performance given only a set number of updates, the meta-learner model is trained to converge a learner classifier to a good solution quickly on each task. Additionally, the formulation of our meta-learner model allows it to learn a task-common initialization for the learner classifier, which captures fundamental knowledge shared among all the tasks. ",
118
+ "bbox": [
119
+ 173,
120
+ 229,
121
+ 825,
122
+ 368
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "2 TASK DESCRIPTION ",
129
+ "text_level": 1,
130
+ "bbox": [
131
+ 176,
132
+ 395,
133
+ 370,
134
+ 411
135
+ ],
136
+ "page_idx": 1
137
+ },
138
+ {
139
+ "type": "text",
140
+ "text": "We first begin by detailing the meta-learning formulation we use. In the typical machine learning setting, we are interested in a dataset $D$ and usually split $D$ so that we optimize parameters $\\theta$ on a training set $D _ { t r a i n }$ and evaluate its generalization on the test set $D _ { t e s t }$ . In meta-learning, however, we are dealing with meta-sets $\\mathcal { D }$ containing multiple regular datasets, where each $D \\in { \\mathcal { D } }$ has a split of $D _ { t r a i n }$ and $D _ { t e s t }$ . ",
141
+ "bbox": [
142
+ 174,
143
+ 430,
144
+ 825,
145
+ 501
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "We consider the $k$ -shot, $N$ -class classification task, where for each dataset $D$ , the training set consists of $k$ labelled examples for each of $N$ classes, meaning that $D _ { t r a i n }$ consists of $k \\cdot N$ examples, and $D _ { t e s t }$ has a set number of examples for evaluation. We note that previous work (Vinyals et al., 2016) has used the term episode to describe each dataset consisting of a training and test set. ",
152
+ "bbox": [
153
+ 174,
154
+ 507,
155
+ 823,
156
+ 563
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "text",
162
+ "text": "In meta-learning, we thus have different meta-sets for meta-training, meta-validation, and metatesting $( \\mathcal { D } _ { m e t a - t r a i n }$ , $\\mathcal { D } _ { m e t a - v a l i d a t i o n }$ , and $\\mathcal { D } _ { m e t a - t e s t }$ , respectively). On $\\mathcal { D } _ { m e t a - t r a i n }$ , we are interested in training a learning procedure (the meta-learner) that can take as input one of its training sets $D _ { t r a i n }$ and produce a classifier (the learner) that achieves high average classification performance on its corresponding test set $D _ { t e s t }$ . Using $\\mathcal { D } _ { m e t a - v a l i d a t i o n }$ we can perform hyper-parameter selection of the meta-learner and evaluate its generalization performance on $\\mathcal { D } _ { m e t a - t e s t }$ . ",
163
+ "bbox": [
164
+ 174,
165
+ 570,
166
+ 825,
167
+ 654
168
+ ],
169
+ "page_idx": 1
170
+ },
171
+ {
172
+ "type": "text",
173
+ "text": "For this formulation to correspond to the few-shot learning setting, each training set in datasets $D \\in { \\mathcal { D } }$ will contain few labeled examples (we consider $k = 1$ or $k = 5$ ), that must be used to generalize to good performance on the corresponding test set. An example of this formulation is given in Figure 1. ",
174
+ "bbox": [
175
+ 174,
176
+ 661,
177
+ 825,
178
+ 717
179
+ ],
180
+ "page_idx": 1
181
+ },
182
+ {
183
+ "type": "text",
184
+ "text": "3 MODEL ",
185
+ "text_level": 1,
186
+ "bbox": [
187
+ 176,
188
+ 743,
189
+ 267,
190
+ 758
191
+ ],
192
+ "page_idx": 1
193
+ },
194
+ {
195
+ "type": "text",
196
+ "text": "We now move to the description of our proposed model for meta-learning. ",
197
+ "bbox": [
198
+ 176,
199
+ 779,
200
+ 658,
201
+ 794
202
+ ],
203
+ "page_idx": 1
204
+ },
205
+ {
206
+ "type": "text",
207
+ "text": "3.1 MODEL DESCRIPTION ",
208
+ "text_level": 1,
209
+ "bbox": [
210
+ 176,
211
+ 816,
212
+ 367,
213
+ 830
214
+ ],
215
+ "page_idx": 1
216
+ },
217
+ {
218
+ "type": "text",
219
+ "text": "Consider a single dataset, or episode, $D \\in \\mathcal { D } _ { m e t a - t r a i n }$ . Suppose we have a learner neural net classifier with parameters $\\theta$ that we want to train on $D _ { t r a i n }$ . The standard optimization algorithms used to train deep neural networks are some variant of gradient descent, which uses updates of the form ",
220
+ "bbox": [
221
+ 174,
222
+ 845,
223
+ 823,
224
+ 901
225
+ ],
226
+ "page_idx": 1
227
+ },
228
+ {
229
+ "type": "equation",
230
+ "img_path": "images/477adba1d6498bc8e115b5fe6876244fa549761be85ba4d162c87db613a1d753.jpg",
231
+ "text": "$$\n\\theta _ { t } = \\theta _ { t - 1 } - \\alpha _ { t } \\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t } ,\n$$",
232
+ "text_format": "latex",
233
+ "bbox": [
234
+ 415,
235
+ 909,
236
+ 581,
237
+ 926
238
+ ],
239
+ "page_idx": 1
240
+ },
241
+ {
242
+ "type": "image",
243
+ "img_path": "images/e2e6fe20fd5637b14c1999b4c2f7aba46971b973299832b60342a6c17e965540.jpg",
244
+ "image_caption": [
245
+ "Figure 1: Example of meta-learning setup. The top represents the meta-training set $\\mathcal { D } _ { m e t a - t r a i n }$ , where inside each gray box is a separate dataset that consists of the training set $D _ { t r a i n }$ (left side of dashed line) and the test set $D _ { t e s t }$ (right side of dashed line). In this illustration, we are considering the 1-shot, 5-class classification task where for each dataset, we have one example from each of 5 classes (each given a label 1-5) in the training set and 2 examples for evaluation in the test set. The meta-test set $\\mathcal { D } _ { m e t a - t e s t }$ is defined in the same way, but with a different set of datasets that cover classes not present in any of the datasets in $\\mathcal { D } _ { m e t a - t r a i n }$ (similarly, we additionally have a meta-validation set that is used to determine hyper-parameters). "
246
+ ],
247
+ "image_footnote": [],
248
+ "bbox": [
249
+ 246,
250
+ 102,
251
+ 736,
252
+ 337
253
+ ],
254
+ "page_idx": 2
255
+ },
256
+ {
257
+ "type": "text",
258
+ "text": "where $\\theta _ { t - 1 }$ are the parameters of the learner after $t - 1$ updates, $\\alpha _ { t }$ is the learning rate at time $t$ , $\\mathcal { L } _ { t }$ is the loss optimized by the learner for its $t ^ { \\mathrm { t h } }$ update, $\\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t }$ is the gradient of that loss with respect to parameters $\\theta _ { t - 1 }$ , and $\\theta _ { t }$ is the updated parameters of the learner. ",
259
+ "bbox": [
260
+ 174,
261
+ 489,
262
+ 825,
263
+ 532
264
+ ],
265
+ "page_idx": 2
266
+ },
267
+ {
268
+ "type": "text",
269
+ "text": "Our key observation that we leverage here is that this update resembles the update for the cell state in an LSTM (Hochreiter & Schmidhuber, 1997) ",
270
+ "bbox": [
271
+ 173,
272
+ 537,
273
+ 823,
274
+ 566
275
+ ],
276
+ "page_idx": 2
277
+ },
278
+ {
279
+ "type": "equation",
280
+ "img_path": "images/d6850271389a93beb235beb8239081eced81a375ed02cfe92e2edb276987e971.jpg",
281
+ "text": "$$\nc _ { t } = f _ { t } \\odot c _ { t - 1 } + i _ { t } \\odot \\tilde { c } _ { t } ,\n$$",
282
+ "text_format": "latex",
283
+ "bbox": [
284
+ 413,
285
+ 570,
286
+ 583,
287
+ 587
288
+ ],
289
+ "page_idx": 2
290
+ },
291
+ {
292
+ "type": "text",
293
+ "text": "if $f _ { t } = 1 , c _ { t - 1 } = \\theta _ { t - 1 } , i _ { t } = \\alpha _ { t }$ , and $\\tilde { c } _ { t } = - \\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t }$ ",
294
+ "bbox": [
295
+ 173,
296
+ 589,
297
+ 522,
298
+ 606
299
+ ],
300
+ "page_idx": 2
301
+ },
302
+ {
303
+ "type": "text",
304
+ "text": "Thus, we propose training a meta-learner LSTM to learn an update rule for training a neural network. We set the cell state of the LSTM to be the parameters of the learner, or $c _ { t } = \\theta _ { t }$ , and the candidate cell state $\\tilde { c } _ { t } = \\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t }$ , given how valuable information about the gradient is for optimization. We define parametric forms for $i _ { t }$ and $f _ { t }$ so that the meta-learner can determine optimal values through the course of the updates. ",
305
+ "bbox": [
306
+ 173,
307
+ 611,
308
+ 825,
309
+ 681
310
+ ],
311
+ "page_idx": 2
312
+ },
313
+ {
314
+ "type": "text",
315
+ "text": "Let us start with $i _ { t }$ , which corresponds to the learning rate for the updates. We let ",
316
+ "bbox": [
317
+ 173,
318
+ 688,
319
+ 707,
320
+ 703
321
+ ],
322
+ "page_idx": 2
323
+ },
324
+ {
325
+ "type": "equation",
326
+ "img_path": "images/884084139b5eb0fcae7807ecf0f20cbdf19af8ab7b4e4bbbbb5a597c7f942d7f.jpg",
327
+ "text": "$$\ni _ { t } = \\sigma \\left( \\mathbf { W } _ { I } \\cdot \\left[ \\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t } , \\mathcal { L } _ { t } , \\theta _ { t - 1 } , i _ { t - 1 } \\right] + { \\mathbf { b } } _ { I } \\right) ,\n$$",
328
+ "text_format": "latex",
329
+ "bbox": [
330
+ 341,
331
+ 704,
332
+ 655,
333
+ 723
334
+ ],
335
+ "page_idx": 2
336
+ },
337
+ {
338
+ "type": "text",
339
+ "text": "meaning that the learning rate is a function of the current parameter value $\\theta _ { t - 1 }$ , the current gradient $\\nabla _ { \\theta _ { t - 1 } } \\bar { \\mathcal { L } } _ { t }$ , the current loss $\\scriptstyle { \\mathcal { L } } _ { t }$ , and the previous learning rate $i _ { t - 1 }$ . With this information, the metalearner should be able to finely control the learning rate so as to train the learner quickly while avoiding divergence. ",
340
+ "bbox": [
341
+ 173,
342
+ 726,
343
+ 825,
344
+ 781
345
+ ],
346
+ "page_idx": 2
347
+ },
348
+ {
349
+ "type": "text",
350
+ "text": "As for $f _ { t }$ , it seems possible that the optimal choice isn’t the constant 1. Intuitively, what would justify shrinking the parameters of the learner and forgetting part of its previous value would be if the learner is currently in a bad local optima and needs a large change to escape. This would correspond to a situation where the loss is high but the gradient is close to zero. Thus, one proposal for the forget gate is to have it be a function of that information, as well as the previous value of the forget gate: ",
351
+ "bbox": [
352
+ 173,
353
+ 787,
354
+ 825,
355
+ 871
356
+ ],
357
+ "page_idx": 2
358
+ },
359
+ {
360
+ "type": "equation",
361
+ "img_path": "images/501b1780376496ec05d26c457ac52e34e3920f665c994bd9254413b03c249bb5.jpg",
362
+ "text": "$$\nf _ { t } = \\sigma \\left( \\mathbf { W } _ { F } \\cdot \\left[ \\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t } , \\mathcal { L } _ { t } , \\theta _ { t - 1 } , f _ { t - 1 } \\right] + { \\mathbf { b } } _ { F } \\right) .\n$$",
363
+ "text_format": "latex",
364
+ "bbox": [
365
+ 334,
366
+ 869,
367
+ 661,
368
+ 888
369
+ ],
370
+ "page_idx": 2
371
+ },
372
+ {
373
+ "type": "text",
374
+ "text": "Additionally, notice that we can also learn the initial value of the cell state $c _ { 0 }$ for the LSTM, treating it as a parameter of the meta-learner. This corresponds to the initial weights of the classifier (that the meta-learner is training). Learning this initial value lets the meta-learner determine the optimal initial weights of the learner so that training begins from a beneficial starting point that allows optimization to proceed rapidly. Lastly, note that though the meta-learner’s update rule matches the cell state update of the LSTM, the meta-learner also bears similarity to the GRU (Cho et al., 2014) hidden state update, with the exception that the forget and input gates aren’t tied to sum to one. ",
375
+ "bbox": [
376
+ 173,
377
+ 895,
378
+ 823,
379
+ 924
380
+ ],
381
+ "page_idx": 2
382
+ },
383
+ {
384
+ "type": "text",
385
+ "text": "",
386
+ "bbox": [
387
+ 174,
388
+ 103,
389
+ 825,
390
+ 174
391
+ ],
392
+ "page_idx": 3
393
+ },
394
+ {
395
+ "type": "text",
396
+ "text": "3.2 PARAMETER SHARING & PREPROCESSING ",
397
+ "text_level": 1,
398
+ "bbox": [
399
+ 174,
400
+ 196,
401
+ 508,
402
+ 212
403
+ ],
404
+ "page_idx": 3
405
+ },
406
+ {
407
+ "type": "text",
408
+ "text": "Because we want our meta-learner to produce updates for deep neural networks, which consist of tens of thousands of parameters, to prevent an explosion of meta-learner parameters we need to employ some sort of parameter sharing. Thus as in Andrychowicz et al. (2016), we share parameters across the coordinates of the learner gradient. This means each coordinate has its own hidden and cell state values but the LSTM parameters are the same across all coordinates. This allows us to use a compact LSTM model and additionally has the nice property that the same update rule is used for each coordinate, but one that is dependent on the respective history of each coordinate during optimization. We can easily implement parameter sharing by having the input be a batch of gradient coordinates and loss inputs $( \\nabla _ { \\theta _ { t , i } } \\mathcal { L } _ { t } , \\mathcal { L } _ { t } )$ for each dimension $i$ . ",
409
+ "bbox": [
410
+ 174,
411
+ 224,
412
+ 825,
413
+ 352
414
+ ],
415
+ "page_idx": 3
416
+ },
417
+ {
418
+ "type": "text",
419
+ "text": "Because the different coordinates of the gradients and the losses can be of very different magnitudes, we need to be careful in normalizing the values so that the meta-learner is able to use them properly during training. Thus, we also found that the preprocessing method of Andrychowicz et al. (2016) worked well when applied to both the dimensions of the gradients and the losses at each time step: ",
420
+ "bbox": [
421
+ 174,
422
+ 358,
423
+ 825,
424
+ 414
425
+ ],
426
+ "page_idx": 3
427
+ },
428
+ {
429
+ "type": "equation",
430
+ "img_path": "images/fc8b19fade8866048b0eacb92ecd6830896786f15e89bd063c60b2ea65dfbb32.jpg",
431
+ "text": "$$\nx \\to \\left\\{ { \\begin{array} { l l } { \\left( { \\frac { \\log ( | x | ) } { p } } , \\operatorname { s g n } ( x ) \\right) } & { { \\mathrm { i f ~ } } | x | \\geq e ^ { - p } } \\\\ { ( - 1 , e ^ { p } x ) } & { { \\mathrm { o t h e r w i s e } } } \\end{array} } \\right.\n$$",
432
+ "text_format": "latex",
433
+ "bbox": [
434
+ 364,
435
+ 426,
436
+ 629,
437
+ 469
438
+ ],
439
+ "page_idx": 3
440
+ },
441
+ {
442
+ "type": "text",
443
+ "text": "This preprocessing adjusts the scaling of gradients and losses, while also separating the information about their magnitude and their sign (the latter being mostly useful for gradients). We found that the suggested value of $p = 1 0$ in the above formula worked well in our experiments. ",
444
+ "bbox": [
445
+ 174,
446
+ 481,
447
+ 825,
448
+ 523
449
+ ],
450
+ "page_idx": 3
451
+ },
452
+ {
453
+ "type": "text",
454
+ "text": "3.3 TRAINING ",
455
+ "text_level": 1,
456
+ "bbox": [
457
+ 174,
458
+ 546,
459
+ 287,
460
+ 560
461
+ ],
462
+ "page_idx": 3
463
+ },
464
+ {
465
+ "type": "text",
466
+ "text": "The question now is how do we train the LSTM meta-learner model to be effective at few-shot learning tasks? As observed in Vinyals et al. (2016), in order to perform well at this task, it is key to have training conditions match those of test time. During evaluation of the meta-learning, for each dataset (episode), $D = ( D _ { t r a i n } , D _ { t e s t } ) \\in \\mathcal { D } _ { m e t a - t e s t }$ , a good meta-learner model will, given a series of learner gradients and losses on the training set $D _ { t r a i n }$ , suggest a series of updates for the classifier that pushes it towards good performance on the test set $D _ { t e s t }$ . ",
467
+ "bbox": [
468
+ 173,
469
+ 575,
470
+ 825,
471
+ 660
472
+ ],
473
+ "page_idx": 3
474
+ },
475
+ {
476
+ "type": "text",
477
+ "text": "Thus to match test time conditions, when considering each dataset $D \\in \\mathcal { D } _ { m e t a - t r a i n }$ , the training objective we use is the loss $\\mathcal { L } _ { t e s t }$ of the produced classifier on $D$ ’s test set $D _ { t e s t }$ . While iterating over the examples in $D$ ’s training set $D _ { t r a i n }$ , at each time step $t$ the LSTM meta-learner receives $( \\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t } , \\mathcal { L } _ { t } )$ from the learner (the classifier) and proposes the new set of parameters $\\theta _ { t }$ . The process repeats for $T$ steps, after which the classifier and its final parameters are evaluated on the test set to produce the loss that is then used to train the meta-learner. The training algorithm is described in Algorithm 1 and the corresponding computational graph is shown in Figure 2. ",
478
+ "bbox": [
479
+ 174,
480
+ 666,
481
+ 825,
482
+ 763
483
+ ],
484
+ "page_idx": 3
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "3.3.1 GRADIENT INDEPENDENCE ASSUMPTION ",
489
+ "text_level": 1,
490
+ "bbox": [
491
+ 174,
492
+ 786,
493
+ 513,
494
+ 799
495
+ ],
496
+ "page_idx": 3
497
+ },
498
+ {
499
+ "type": "text",
500
+ "text": "Notice that our formulation would imply that the losses $\\mathcal { L } _ { t }$ and gradients $\\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t }$ of the learner are dependent on the parameters of the meta-learner. Gradients on the meta-learner’s parameters should normally take this dependency into account. However, as discussed by Andrychowicz et al. (2016), this complicates the computation of the meta-learner’s gradients. Thus, following Andrychowicz et al. (2016), we make the simplifying assumption that these contributions to the gradients aren’t important and can be ignored, which allows us to avoid taking second derivatives, a considerably expensive operation. We were still able to train the meta-learner effectively in spite of this simplifying assumption. ",
501
+ "bbox": [
502
+ 173,
503
+ 811,
504
+ 825,
505
+ 924
506
+ ],
507
+ "page_idx": 3
508
+ },
509
+ {
510
+ "type": "image",
511
+ "img_path": "images/7694e2406518b27117c703bdf850f7e323c2b29428e92b79f94d5628f188adca.jpg",
512
+ "image_caption": [
513
+ "Figure 2: Computational graph for the forward pass of the meta-learner. The dashed line divides examples from the training set $D _ { t r a i n }$ and test set $D _ { t e s t }$ . Each $( \\mathbf { X } _ { i } , \\mathbf { Y } _ { i } )$ is the $i ^ { t h }$ batch from the training set whereas $( \\mathbf { X } , \\mathbf { Y } )$ is all the elements from the test set. The dashed arrows indicate that we do not back-propagate through that step when training the meta-learner. We refer to the learner as $M$ , where $M ( \\mathbf { X } ; \\theta )$ is the output of learner $M$ using parameters $\\theta$ for inputs $\\mathbf { X }$ . We also use $\\nabla _ { t }$ as a shorthand for $\\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t }$ . "
514
+ ],
515
+ "image_footnote": [],
516
+ "bbox": [
517
+ 184,
518
+ 104,
519
+ 815,
520
+ 285
521
+ ],
522
+ "page_idx": 4
523
+ },
524
+ {
525
+ "type": "text",
526
+ "text": "3.3.2 INITIALIZATION OF META-LEARNER LSTM ",
527
+ "text_level": 1,
528
+ "bbox": [
529
+ 174,
530
+ 428,
531
+ 532,
532
+ 443
533
+ ],
534
+ "page_idx": 4
535
+ },
536
+ {
537
+ "type": "text",
538
+ "text": "When training LSTMs, it is advised to initialize the LSTM with small random weights and to set the forget gate bias to a large value so that the forget gate is initialized to be close to 1, thus enabling gradient flow (Zaremba, 2015). In addition to the forget gate bias setting, we found that we needed to initialize the input gate bias to be small so that the input gate value (and thus the learning rate) used by the meta-learner LSTM starts out being small. With this combined initialization, the metalearner starts close to normal gradient descent with a small learning rate, which helps initial stability of training. ",
539
+ "bbox": [
540
+ 173,
541
+ 460,
542
+ 825,
543
+ 559
544
+ ],
545
+ "page_idx": 4
546
+ },
547
+ {
548
+ "type": "text",
549
+ "text": "3.4 BATCH NORMALIZATION ",
550
+ "text_level": 1,
551
+ "bbox": [
552
+ 176,
553
+ 598,
554
+ 387,
555
+ 612
556
+ ],
557
+ "page_idx": 4
558
+ },
559
+ {
560
+ "type": "text",
561
+ "text": "Batch Normalization (Ioffe & Szegedy, 2015) is a recently proposed method to stabilize and thus speed up learning of deep neural networks by reducing internal covariate shift within the learner’s hidden layers. This reduction is achieved by normalizing each layer’s pre-activation, by subtracting by the mean and dividing by the standard deviation. During training, the mean and standard deviation are estimated using the current batch being trained on, whereas during evaluation a running average of both statistics calculated on the training set is used. We need to be careful with batch normalization for the learner network in the meta-learning setting, because we do not want to collect mean and standard deviation statistics during meta-testing in a way that allows information to leak between different datasets (episodes), being considered. One easy way to prevent this issue is to not collect statistics at all during the meta-testing phase, but just use our running averages from metatraining. This, however, has a bad impact on performance, because we have changed meta-training and meta-testing conditions, causing the meta-learner to learn a method of optimization that relies on batch statistics which it now does not have at meta-testing time. In order to keep the two phases as similar as possible, we found that a better strategy was to collect statistics for each dataset $D \\in { \\mathcal { D } }$ during $\\mathcal { D } _ { m e t a - t e s t }$ , but then erase the running statistics when we consider the next dataset. Thus, during meta-training, we use batch statistics for both the training and testing set whereas during meta-testing, we use batch statistics for the training set (and to compute our running averages) but then use the running averages during testing. This does not cause any information to leak between different datasets, but also allows the meta-learner to be trained on conditions that are matched between training and testing. Lastly, because we are doing very few training steps, we computed the running averages so that higher preference is given to the later values. ",
562
+ "bbox": [
563
+ 173,
564
+ 632,
565
+ 825,
566
+ 924
567
+ ],
568
+ "page_idx": 4
569
+ },
570
+ {
571
+ "type": "text",
572
+ "text": "Algorithm 1 Train Meta-Learner ",
573
+ "text_level": 1,
574
+ "bbox": [
575
+ 174,
576
+ 103,
577
+ 393,
578
+ 117
579
+ ],
580
+ "page_idx": 5
581
+ },
582
+ {
583
+ "type": "text",
584
+ "text": "Input: Meta-training set $\\overline { { \\mathcal { D } _ { m e t a - t r a i n } } }$ , Learner $M$ with parameters θ, Meta-Learner $R$ with parameters $\\Theta$ . ",
585
+ "bbox": [
586
+ 173,
587
+ 119,
588
+ 821,
589
+ 148
590
+ ],
591
+ "page_idx": 5
592
+ },
593
+ {
594
+ "type": "text",
595
+ "text": "1: $\\Theta _ { 0 } \\gets$ random initialization \n2: \n3: for $d = 1 , n$ do \n4: $D _ { t r a i n } , D _ { t e s t } $ random dataset from $\\mathcal { D } _ { m e t a - t r a i n }$ \n5: θ0 ← c0 . Intialize learner parameters \n6: \n7: 8: for $\\begin{array} { r l } & { \\mathbf { r } \\ t = 1 , T \\ \\mathbf { \\delta } \\mathbf { \\cdot } \\mathbf { d o } } \\\\ & { \\mathbf { X } _ { t } , \\mathbf { Y } _ { t } \\gets \\mathrm { r a n d o m \\ b a t c h \\ f r o m \\ } D _ { t r a i n } } \\\\ & { \\mathcal { L } _ { t } \\gets \\mathcal { L } ( M ( \\mathbf { X } _ { t } ; \\theta _ { t - 1 } ) , \\mathbf { Y } _ { t } ) } \\\\ & { c _ { t } \\gets R ( ( \\nabla _ { \\theta _ { t - 1 } } \\mathcal { L } _ { t } , \\mathcal { L } _ { t } ) ; \\Theta _ { d - 1 } ) } \\\\ & { \\theta _ { t } \\gets c _ { t } } \\end{array}$ $t = 1 , T$ do \n9: $\\triangleright$ Get loss of learner on train batch \n10: . Get output of meta-learner using Equation 2 \n11: $\\triangleright$ Update learner parameters \n12: end for \n13: \n14: 15: $\\begin{array} { r l } & { \\mathbf { X } , \\mathbf { Y } \\gets D _ { t e s t } } \\\\ & { \\mathcal { L } _ { t e s t } \\gets \\mathcal { L } ( M ( \\mathbf { X } ; \\boldsymbol { \\theta } _ { T } ) , \\mathbf { Y } ) } \\end{array}$ $\\triangleright$ Get loss of learner on test batch \n16: Update $\\Theta _ { d }$ using $\\nabla _ { \\Theta _ { d - 1 } } \\mathcal { L } _ { t e s t }$ . Update meta-learner parameters \n17: \n18: end for ",
596
+ "bbox": [
597
+ 178,
598
+ 161,
599
+ 826,
600
+ 416
601
+ ],
602
+ "page_idx": 5
603
+ },
604
+ {
605
+ "type": "text",
606
+ "text": "4 RELATED WORK ",
607
+ "text_level": 1,
608
+ "bbox": [
609
+ 176,
610
+ 446,
611
+ 344,
612
+ 463
613
+ ],
614
+ "page_idx": 5
615
+ },
616
+ {
617
+ "type": "text",
618
+ "text": "While this work falls within the broad literature of transfer learning in general, we focus here on positioning it relative to previous work on meta-learning and few-shot learning. ",
619
+ "bbox": [
620
+ 174,
621
+ 482,
622
+ 823,
623
+ 511
624
+ ],
625
+ "page_idx": 5
626
+ },
627
+ {
628
+ "type": "text",
629
+ "text": "4.1 META-LEARNING ",
630
+ "text_level": 1,
631
+ "bbox": [
632
+ 174,
633
+ 534,
634
+ 336,
635
+ 547
636
+ ],
637
+ "page_idx": 5
638
+ },
639
+ {
640
+ "type": "text",
641
+ "text": "Meta-learning has a long history, but has grown to prominence recently as many have advocated for it as a key to achieving human-level intelligence in the future (Lake et al., 2016). The ability to learn at two levels (learning within each task presented, while accumulating knowledge about the similarities and differences between tasks) is seen as being crucial to improving AI. Previous work has used a variety of techniques in the meta-learning setting. ",
642
+ "bbox": [
643
+ 174,
644
+ 563,
645
+ 823,
646
+ 632
647
+ ],
648
+ "page_idx": 5
649
+ },
650
+ {
651
+ "type": "text",
652
+ "text": "Schmidhuber (1992; 1993) explored using networks that learn how to modify their own weights over a number of computations steps on the input. The updating of the weights is defined in a parametric form that allows the prediction and weight-change process to be differentiable end-to-end. The work of Bengio et al. (1990; 1995) and Bengio (1993) considered learning update rules for neural networks that are biologically plausible. This property is enforced by allowing the parametric form of the update to only have as input local information at each hidden unit to determine the weight change. Different optimization methods, such as genetic programming or simulated annealing, are used to train the learning rule. ",
653
+ "bbox": [
654
+ 174,
655
+ 638,
656
+ 825,
657
+ 750
658
+ ],
659
+ "page_idx": 5
660
+ },
661
+ {
662
+ "type": "text",
663
+ "text": "In Santoro et al. (2016), a memory-augmented neural network is trained to learn how to store and retrieve memories to use for each classification task. The work of Andrychowicz et al. (2016) uses an LSTM to train a neural network; however, they are interested in learning a general optimization algorithm to train neural networks for large-scale classification, whereas we are interested in the few-shot learning problem. This work also builds upon Hochreiter et al. (2001) and Bosc, both of which used LSTMs to train multi-layer perceptrons to learn on binary classification and timeseries prediction tasks. Another related method is the work of Bertinetto et al. (2016), who train a meta-learner to map a training example to the weights of a neural network that is then used to classify future examples from this class; however, unlike our method the classifier network is directly produced rather than being fine-tuned after multiple training steps. Our work also bears similarity to Maclaurin et al. (2015), who tune the hyperparameters of gradient descent with momentum by backpropagating through the chain of gradient steps to optimize the validation performance. ",
664
+ "bbox": [
665
+ 174,
666
+ 757,
667
+ 825,
668
+ 924
669
+ ],
670
+ "page_idx": 5
671
+ },
672
+ {
673
+ "type": "text",
674
+ "text": "4.2 FEW-SHOT LEARNING ",
675
+ "text_level": 1,
676
+ "bbox": [
677
+ 176,
678
+ 103,
679
+ 364,
680
+ 117
681
+ ],
682
+ "page_idx": 6
683
+ },
684
+ {
685
+ "type": "text",
686
+ "text": "The best performing methods for few-shot learning have been mainly metric learning methods. Deep siamese networks (Koch, 2015) train a convolutional network to embed examples so that items in the same class are close while items in different classes are far away, according to some distance metric. Matching networks (Vinyals et al., 2016) refine this idea so that training and testing conditions match, by defining a differentiable nearest neighbor loss involving the cosine similarities of embeddings produced by a convolutional network. ",
687
+ "bbox": [
688
+ 174,
689
+ 128,
690
+ 825,
691
+ 213
692
+ ],
693
+ "page_idx": 6
694
+ },
695
+ {
696
+ "type": "text",
697
+ "text": "5 EVALUATION ",
698
+ "text_level": 1,
699
+ "bbox": [
700
+ 176,
701
+ 233,
702
+ 313,
703
+ 248
704
+ ],
705
+ "page_idx": 6
706
+ },
707
+ {
708
+ "type": "text",
709
+ "text": "In this section, we describe the results of experiments, examining the properties of our model and comparing our method’s performance against different approaches∗. Following Vinyals et al. (2016), we consider the $k$ -shot, $N$ -class classification setting where a meta-learner trains on many related but small training sets of $k$ examples for each of $N$ classes. We first split the list of all classes in the data into disjoint sets and assign them to each meta-set of meta-training, meta-validation, and meta-testing. To generate each instance of a $k$ -shot, $N$ -class task dataset $D = ( D _ { t r a i n } , D _ { t e s t } ) \\in \\mathcal { D }$ , we do the following: we first sample $N$ classes from the list of classes corresponding to the meta-set we consider. We then sample $k$ examples from each of those classes. These $k$ examples together compose the training set $D _ { t r a i n }$ . Then, an additional fixed amount of the rest of the examples are sampled to yield a test set $D _ { t e s t }$ . We generally have 15 examples per class in the test sets. When training the meta-learner, we iterate by sampling these datasets (episodes) repeatedly. For metavalidation and meta-testing, however, we produce a fixed number of these datasets to evaluate each method. We produce enough datasets to ensure that the confidence interval of the mean accuracy is small. ",
710
+ "bbox": [
711
+ 174,
712
+ 263,
713
+ 825,
714
+ 457
715
+ ],
716
+ "page_idx": 6
717
+ },
718
+ {
719
+ "type": "text",
720
+ "text": "For the learner, we use a simple CNN containing 4 convolutional layers, each of which is a $3 \\times 3$ convolution with 32 filters, followed by batch normalization, a ReLU non-linearity, and lastly a $2 \\times 2$ max-pooling. The network then has a final linear layer followed by a softmax for the number of classes being considered. The loss function $\\mathcal { L }$ is the average negative log-probability assigned by the learner to the correct class. For the meta-learner, we use a 2-layer LSTM, where the first layer is a normal LSTM and the second layer is our modified LSTM meta-learner. The gradients and losses are preprocessed and fed into the first layer LSTM, and the regular gradient coordinates are also used by the second layer LSTM to implement the state update rule shown in (1). At each time step, the learner’s loss and gradient is computed on a batch consisting of the entire training set $D _ { t r a i n }$ , because we consider training sets with only a total of 5 or 25 examples. We train our LSTM with ADAM using a learning rate of 0.001 and with gradient clipping using a value of 0.25. ",
721
+ "bbox": [
722
+ 173,
723
+ 464,
724
+ 825,
725
+ 617
726
+ ],
727
+ "page_idx": 6
728
+ },
729
+ {
730
+ "type": "text",
731
+ "text": "5.1 EXPERIMENT RESULTS ",
732
+ "text_level": 1,
733
+ "bbox": [
734
+ 176,
735
+ 633,
736
+ 374,
737
+ 647
738
+ ],
739
+ "page_idx": 6
740
+ },
741
+ {
742
+ "type": "text",
743
+ "text": "The Mini-ImageNet dataset was proposed by Vinyals et al. (2016) as a benchmark offering the challenges of the complexity of ImageNet images, without requiring the resources and infrastructure necessary to run on the full ImageNet dataset. Because the exact splits used in Vinyals et al. (2016) were not released, we create our own version of the Mini-Imagenet dataset by selecting a random 100 classes from ImageNet and picking 600 examples of each class. We use 64, 16, and 20 classes for training, validation and testing, respectively. We consider 1-shot and 5-shot classification for 5 classes. We use 15 examples per class for evaluation in each test set. We compare against two baselines and a recent metric-learning technique, Matching Networks (Vinyals et al., 2016), which has achieved state-of-the-art results in few-shot learning. The results are shown in Table 1. ",
744
+ "bbox": [
745
+ 174,
746
+ 660,
747
+ 825,
748
+ 785
749
+ ],
750
+ "page_idx": 6
751
+ },
752
+ {
753
+ "type": "text",
754
+ "text": "The first baseline we use is a nearest-neighbor baseline (Baseline-nearest-neighbor), where we first train a network to classify between all the classes jointly in the original meta-training set. At metatest time, for each dataset $D$ , we embed all the items in the training set using our trained network and then use nearest-neighbor matching among the embedded training examples to classify each test example. The second baseline we use (Baseline-finetune) represents a coarser version of our metalearner model. As in the first baseline, we start by training a network to classify jointly between all classes in the meta-training set. We then use the meta-validation set to search over SGD hyperparameters, where each training set is used to fine-tune the pre-trained network before evaluating on the test set. We use a fixed number of updates for fine tuning and search over the learning rate and learning rate decay used during the course of these updates. ",
755
+ "bbox": [
756
+ 174,
757
+ 791,
758
+ 825,
759
+ 904
760
+ ],
761
+ "page_idx": 6
762
+ },
763
+ {
764
+ "type": "table",
765
+ "img_path": "images/2f5b0d0775ad31fde9f31e7551b9049345d01d509384c2d884cddf80e5193cbd.jpg",
766
+ "table_caption": [
767
+ "Table 1: Average classification accuracies on Mini-ImageNet with $9 5 \\%$ confidence intervals. Marked in bold are the best results for each scenario, as well as other results with an overlapping confidence interval. "
768
+ ],
769
+ "table_footnote": [],
770
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">5-class</td></tr><tr><td>1-shot</td><td>5-shot</td></tr><tr><td>Baseline-finetune</td><td>28.86 ± 0.54%</td><td>49.79 ± 0.79%</td></tr><tr><td>Baseline-nearest-neighbor</td><td>41.08 ± 0.70%</td><td>51.04 ± 0.65%</td></tr><tr><td>Matching Network</td><td>43.40±0.78%</td><td>51.09 ± 0.71%</td></tr><tr><td>Matching Network FCE</td><td>43.56 ± 0.84%</td><td>55.31 ± 0.73%</td></tr><tr><td>Meta-Learner LSTM (OURS)</td><td>43.44 ± 0.77%</td><td>60.60 ± 0.71%</td></tr></table>",
771
+ "bbox": [
772
+ 254,
773
+ 101,
774
+ 743,
775
+ 222
776
+ ],
777
+ "page_idx": 7
778
+ },
779
+ {
780
+ "type": "text",
781
+ "text": "",
782
+ "bbox": [
783
+ 174,
784
+ 313,
785
+ 821,
786
+ 340
787
+ ],
788
+ "page_idx": 7
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "For Matching Networks, we implemented our own version of both the basic and the fully-conditional embedding (FCE) versions. In the basic version, a convolutional network is trained to learn independent embeddings for examples in the training and test set. In the FCE version, a bidirectional-LSTM is used to learn an embedding for the training set such that each training example’s embedding is also a function of all the other training examples. Additionally, an attention-LSTM is used so that a test example embedding is also a function of all the embeddings of the training set. We do not consider fine-tuning the network using the train set during meta-testing to improve performance as mentioned in Vinyals et al. (2016), but do note that our meta-learner could also be fine-tuned using this data. Note that to remain consistent with Vinyals et al. (2016), our baseline and matching net convolutional networks have 4 layers each with 64 filters. We also added dropout to each convolutional block in matching nets to prevent overfitting. ",
793
+ "bbox": [
794
+ 174,
795
+ 347,
796
+ 825,
797
+ 501
798
+ ],
799
+ "page_idx": 7
800
+ },
801
+ {
802
+ "type": "text",
803
+ "text": "For our meta-learner, we train different models for the 1-shot and 5-shot tasks, that make 12 and 5 updates, respectively. We noticed that better performance for each task was attained if the metalearner is explicitly trained to do the set number of updates during meta-training that will be used during meta-testing. ",
804
+ "bbox": [
805
+ 174,
806
+ 507,
807
+ 825,
808
+ 563
809
+ ],
810
+ "page_idx": 7
811
+ },
812
+ {
813
+ "type": "text",
814
+ "text": "We attain results that are much better than the baselines discussed and competitive with Matching Networks. For 5-shot, we are able to do much better than Matching Networks, whereas for 1-shot, the confidence interval for our performance intersects the interval for Matching Networks. Again, we note that the numbers do not match the ones provided by Vinyals et al. (2016) simply because we created our version of the dataset and implemented our own versions of their model. It is interesting to note that the fine-tuned baseline is worse than the nearest-neighbor baseline. Because we are not regularizing the classifier, with very few updates the fine-tuning model overfits, especially in the 1-shot case. This propensity to overfit speaks to the benefit of meta-training the initialization of the classifier end-to-end as is done in the meta-learning LSTM. ",
815
+ "bbox": [
816
+ 174,
817
+ 570,
818
+ 825,
819
+ 695
820
+ ],
821
+ "page_idx": 7
822
+ },
823
+ {
824
+ "type": "text",
825
+ "text": "5.2 VISUALIZATION OF META-LEARNER ",
826
+ "text_level": 1,
827
+ "bbox": [
828
+ 178,
829
+ 727,
830
+ 462,
831
+ 739
832
+ ],
833
+ "page_idx": 7
834
+ },
835
+ {
836
+ "type": "text",
837
+ "text": "We also visualize the optimization strategy learned by the meta-learner, in Figure 3. We can look at the $i _ { t }$ and $f _ { t }$ gate values in Equation 2 at each update step, to try to get an understanding of how the meta-learner updates the learner during training. We visualize the gate values while training on different datasets $D _ { t r a i n }$ , to observe whether there are variations between training sets. We consider both 1-shot and 5-shot classification settings, where the meta-learner is making 10 and 5 updates, respectively. For the forget gate values for both tasks, the meta-learner seems to adopt a simple weight decay strategy that seems consistent across different layers. The input gate values are harder to interpret to glean the meta-learner’s strategy. However, there seems to a be a lot of variability between different datasets, indicating that the meta-learner isn’t simply learning a fixed optimization strategy. Additionally, there seem to be differences between the two tasks, suggesting that the meta-learner has adopted different methods to deal with the different conditions of each setting. ",
838
+ "bbox": [
839
+ 174,
840
+ 757,
841
+ 825,
842
+ 924
843
+ ],
844
+ "page_idx": 7
845
+ },
846
+ {
847
+ "type": "image",
848
+ "img_path": "images/1f1e5a7520c8e157de196092efc3251653304bb26f83448f6382ace1021ded51.jpg",
849
+ "image_caption": [
850
+ "Figure 3: Visualization of the input and forget values output by the meta-learner during the course of its updates. Layers $1 - 4$ represent the values for a randomly selected parameter from the 4 convolutional layers and layer 5 represents the values for a random parameter from fully-connected layer. The different curves represent training steps on different datasets. "
851
+ ],
852
+ "image_footnote": [],
853
+ "bbox": [
854
+ 199,
855
+ 99,
856
+ 797,
857
+ 479
858
+ ],
859
+ "page_idx": 8
860
+ },
861
+ {
862
+ "type": "text",
863
+ "text": "6 CONCLUSION ",
864
+ "text_level": 1,
865
+ "bbox": [
866
+ 176,
867
+ 571,
868
+ 318,
869
+ 588
870
+ ],
871
+ "page_idx": 8
872
+ },
873
+ {
874
+ "type": "text",
875
+ "text": "We described an LSTM-based model for meta-learning, which is inspired from the parameter updates suggested by gradient descent optimization algorithms. Our LSTM meta-learner uses its state to represent the learning updates of the parameters of a classifier. It is trained to discover both a good initialization for the learner’s parameters, as well as a successful mechanism for updating the learner’s parameters to a given small training set for some new classification task. Our experiments demonstrate that our approach outperforms natural baselines and is competitive to the state-of-theart in metric learning for few-shot learning. ",
876
+ "bbox": [
877
+ 174,
878
+ 607,
879
+ 825,
880
+ 704
881
+ ],
882
+ "page_idx": 8
883
+ },
884
+ {
885
+ "type": "text",
886
+ "text": "In this work, we focused our study to the few-shot and few-classes setting. However, it would be more valuable to train meta-learners that can perform well across a full spectrum of settings, i.e. for few or lots of training examples and for few or lots of possible classes. Our future work will thus consider moving towards this more challenging scenario. ",
887
+ "bbox": [
888
+ 176,
889
+ 712,
890
+ 825,
891
+ 767
892
+ ],
893
+ "page_idx": 8
894
+ },
895
+ {
896
+ "type": "text",
897
+ "text": "ACKNOWLEDGMENTS ",
898
+ "text_level": 1,
899
+ "bbox": [
900
+ 176,
901
+ 789,
902
+ 326,
903
+ 801
904
+ ],
905
+ "page_idx": 8
906
+ },
907
+ {
908
+ "type": "text",
909
+ "text": "We thank Jake Snell, Kevin Swersky, and Oriol Vinyals for helpful discussions of this work. ",
910
+ "bbox": [
911
+ 173,
912
+ 814,
913
+ 774,
914
+ 829
915
+ ],
916
+ "page_idx": 8
917
+ },
918
+ {
919
+ "type": "text",
920
+ "text": "REFERENCES ",
921
+ "text_level": 1,
922
+ "bbox": [
923
+ 176,
924
+ 854,
925
+ 285,
926
+ 869
927
+ ],
928
+ "page_idx": 8
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W. Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. CoRR, abs/1606.04474, 2016. URL http://arxiv.org/abs/1606.04474. ",
933
+ "bbox": [
934
+ 176,
935
+ 882,
936
+ 823,
937
+ 922
938
+ ],
939
+ "page_idx": 8
940
+ },
941
+ {
942
+ "type": "text",
943
+ "text": "Samy Bengio. Optimisation d’une regle d’apprentissage pour r ´ eseaux de neurones artificiels ´ . PhD thesis, Departement d’Informatique et Recherche Op ´ erationnelle. Universit ´ e de Montr ´ eal, 1993. ´ ",
944
+ "bbox": [
945
+ 173,
946
+ 103,
947
+ 825,
948
+ 132
949
+ ],
950
+ "page_idx": 9
951
+ },
952
+ {
953
+ "type": "text",
954
+ "text": "Samy Bengio, Yoshua Bengio, and Jocelyn Cloutier. On the search for new learning rules for ANNs. Neural Processing Letters, 2(4):26–30, 1995. ",
955
+ "bbox": [
956
+ 174,
957
+ 141,
958
+ 821,
959
+ 170
960
+ ],
961
+ "page_idx": 9
962
+ },
963
+ {
964
+ "type": "text",
965
+ "text": "Yoshua Bengio, Samy Bengio, and Jocelyn Cloutier. Learning a synaptic learning rule. Universite´ de Montreal, D ´ epartement d’informatique et de recherche op ´ erationnelle, 1990. ´ ",
966
+ "bbox": [
967
+ 173,
968
+ 179,
969
+ 823,
970
+ 208
971
+ ],
972
+ "page_idx": 9
973
+ },
974
+ {
975
+ "type": "text",
976
+ "text": "Yoshua Bengio et al. Deep learning of representations for unsupervised and transfer learning. ICML Unsupervised and Transfer Learning, 27:17–36, 2012. ",
977
+ "bbox": [
978
+ 173,
979
+ 217,
980
+ 823,
981
+ 246
982
+ ],
983
+ "page_idx": 9
984
+ },
985
+ {
986
+ "type": "text",
987
+ "text": "Luca Bertinetto, Joao F. Henriques, Jack Valmadre, Philip H. S. Torr, and Andrea Vedaldi. Learning ˜ feed-forward one-shot learners. CoRR, abs/1606.05233, 2016. URL http://arxiv.org/ abs/1606.05233. ",
988
+ "bbox": [
989
+ 174,
990
+ 255,
991
+ 825,
992
+ 297
993
+ ],
994
+ "page_idx": 9
995
+ },
996
+ {
997
+ "type": "text",
998
+ "text": "Tom Bosc. Learning to learn neural networks. ",
999
+ "bbox": [
1000
+ 173,
1001
+ 306,
1002
+ 477,
1003
+ 321
1004
+ ],
1005
+ "page_idx": 9
1006
+ },
1007
+ {
1008
+ "type": "text",
1009
+ "text": "Rich Caruana. Learning many related tasks at the same time with backpropagation. Advances in neural information processing systems, pp. 657–664, 1995. ",
1010
+ "bbox": [
1011
+ 169,
1012
+ 330,
1013
+ 825,
1014
+ 359
1015
+ ],
1016
+ "page_idx": 9
1017
+ },
1018
+ {
1019
+ "type": "text",
1020
+ "text": "Kyunghyun Cho, Bart van Merrienboer, C¸ aglar Gulc¸ehre, Fethi Bougares, Holger Schwenk, and ¨ Yoshua Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. CoRR, abs/1406.1078, 2014. URL http://arxiv.org/abs/1406. 1078. ",
1021
+ "bbox": [
1022
+ 174,
1023
+ 367,
1024
+ 825,
1025
+ 424
1026
+ ],
1027
+ "page_idx": 9
1028
+ },
1029
+ {
1030
+ "type": "text",
1031
+ "text": "Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. CoRR, abs/1310.1531, 2013. URL http://arxiv.org/abs/1310.1531. ",
1032
+ "bbox": [
1033
+ 173,
1034
+ 434,
1035
+ 825,
1036
+ 477
1037
+ ],
1038
+ "page_idx": 9
1039
+ },
1040
+ {
1041
+ "type": "text",
1042
+ "text": "John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. J. Mach. Learn. Res., 12:2121–2159, July 2011. ISSN 1532-4435. URL http://dl.acm.org/citation.cfm?id $\\equiv$ 1953048.2021068. ",
1043
+ "bbox": [
1044
+ 173,
1045
+ 484,
1046
+ 825,
1047
+ 529
1048
+ ],
1049
+ "page_idx": 9
1050
+ },
1051
+ {
1052
+ "type": "text",
1053
+ "text": "Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. URL http://arxiv.org/abs/1512.03385. ",
1054
+ "bbox": [
1055
+ 176,
1056
+ 536,
1057
+ 823,
1058
+ 566
1059
+ ],
1060
+ "page_idx": 9
1061
+ },
1062
+ {
1063
+ "type": "text",
1064
+ "text": "Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997. ",
1065
+ "bbox": [
1066
+ 173,
1067
+ 574,
1068
+ 823,
1069
+ 603
1070
+ ],
1071
+ "page_idx": 9
1072
+ },
1073
+ {
1074
+ "type": "text",
1075
+ "text": "Sepp Hochreiter, A. Steven Younger, and Peter R. Conwell. Learning to learn using gradient descent. In IN LECTURE NOTES ON COMP. SCI. 2130, PROC. INTL. CONF. ON ARTI NEURAL NETWORKS (ICANN-2001, pp. 87–94. Springer, 2001. ",
1076
+ "bbox": [
1077
+ 173,
1078
+ 612,
1079
+ 825,
1080
+ 656
1081
+ ],
1082
+ "page_idx": 9
1083
+ },
1084
+ {
1085
+ "type": "text",
1086
+ "text": "Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. CoRR, abs/1502.03167, 2015. URL http://arxiv.org/ abs/1502.03167. ",
1087
+ "bbox": [
1088
+ 173,
1089
+ 664,
1090
+ 823,
1091
+ 707
1092
+ ],
1093
+ "page_idx": 9
1094
+ },
1095
+ {
1096
+ "type": "text",
1097
+ "text": "Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980. ",
1098
+ "bbox": [
1099
+ 171,
1100
+ 715,
1101
+ 823,
1102
+ 746
1103
+ ],
1104
+ "page_idx": 9
1105
+ },
1106
+ {
1107
+ "type": "text",
1108
+ "text": "Gregory Koch. Siamese neural networks for one-shot image recognition. PhD thesis, University of Toronto, 2015. ",
1109
+ "bbox": [
1110
+ 171,
1111
+ 753,
1112
+ 823,
1113
+ 782
1114
+ ],
1115
+ "page_idx": 9
1116
+ },
1117
+ {
1118
+ "type": "text",
1119
+ "text": "Brenden M. Lake, Tomer D. Ullman, Joshua B. Tenenbaum, and Samuel J. Gershman. Building machines that learn and think like people. CoRR, abs/1604.00289, 2016. URL http://arxiv. org/abs/1604.00289. ",
1120
+ "bbox": [
1121
+ 173,
1122
+ 791,
1123
+ 823,
1124
+ 834
1125
+ ],
1126
+ "page_idx": 9
1127
+ },
1128
+ {
1129
+ "type": "text",
1130
+ "text": "Dougal Maclaurin, David Duvenaud, and Ryan P Adams. Gradient-based hyperparameter optimization through reversible learning. In Proceedings of the 32nd International Conference on Machine Learning, 2015. ",
1131
+ "bbox": [
1132
+ 173,
1133
+ 843,
1134
+ 825,
1135
+ 886
1136
+ ],
1137
+ "page_idx": 9
1138
+ },
1139
+ {
1140
+ "type": "text",
1141
+ "text": "Yurii Nesterov. A method of solving a convex programming problem with convergence rate o (1/k2). 1983. ",
1142
+ "bbox": [
1143
+ 176,
1144
+ 895,
1145
+ 821,
1146
+ 922
1147
+ ],
1148
+ "page_idx": 9
1149
+ },
1150
+ {
1151
+ "type": "text",
1152
+ "text": "Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016. ",
1153
+ "bbox": [
1154
+ 176,
1155
+ 103,
1156
+ 823,
1157
+ 146
1158
+ ],
1159
+ "page_idx": 10
1160
+ },
1161
+ {
1162
+ "type": "text",
1163
+ "text": "Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy P. Lillicrap. Oneshot learning with memory-augmented neural networks. CoRR, abs/1605.06065, 2016. URL http://arxiv.org/abs/1605.06065. ",
1164
+ "bbox": [
1165
+ 178,
1166
+ 155,
1167
+ 820,
1168
+ 198
1169
+ ],
1170
+ "page_idx": 10
1171
+ },
1172
+ {
1173
+ "type": "text",
1174
+ "text": "Jurgen Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent ¨ networks. Neural Computation, 4(1):131–139, 1992. ",
1175
+ "bbox": [
1176
+ 176,
1177
+ 207,
1178
+ 821,
1179
+ 236
1180
+ ],
1181
+ "page_idx": 10
1182
+ },
1183
+ {
1184
+ "type": "text",
1185
+ "text": "Jurgen Schmidhuber. A neural network that embeds its own meta-levels. In ¨ Neural Networks, 1993., IEEE International Conference on, pp. 407–412. IEEE, 1993. ",
1186
+ "bbox": [
1187
+ 173,
1188
+ 244,
1189
+ 821,
1190
+ 273
1191
+ ],
1192
+ "page_idx": 10
1193
+ },
1194
+ {
1195
+ "type": "text",
1196
+ "text": "Jurgen Schmidhuber, Jieyu Zhao, and Marco Wiering. Shifting inductive bias with success-story ¨ algorithm, adaptive levin search, and incremental self-improvement. Machine Learning, 28(1): 105–130, 1997. ",
1197
+ "bbox": [
1198
+ 174,
1199
+ 281,
1200
+ 823,
1201
+ 324
1202
+ ],
1203
+ "page_idx": 10
1204
+ },
1205
+ {
1206
+ "type": "text",
1207
+ "text": "Sebastian Thrun. Lifelong learning algorithms. In Learning to learn, pp. 181–209. Springer, 1998. ",
1208
+ "bbox": [
1209
+ 171,
1210
+ 333,
1211
+ 820,
1212
+ 349
1213
+ ],
1214
+ "page_idx": 10
1215
+ },
1216
+ {
1217
+ "type": "text",
1218
+ "text": "Oriol Vinyals, Charles Blundell, Timothy P. Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. CoRR, abs/1606.04080, 2016. URL http://arxiv. org/abs/1606.04080. ",
1219
+ "bbox": [
1220
+ 174,
1221
+ 357,
1222
+ 820,
1223
+ 400
1224
+ ],
1225
+ "page_idx": 10
1226
+ },
1227
+ {
1228
+ "type": "text",
1229
+ "text": "Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016. ",
1230
+ "bbox": [
1231
+ 174,
1232
+ 409,
1233
+ 825,
1234
+ 465
1235
+ ],
1236
+ "page_idx": 10
1237
+ },
1238
+ {
1239
+ "type": "text",
1240
+ "text": "Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? CoRR, abs/1411.1792, 2014. URL http://arxiv.org/abs/1411. 1792. ",
1241
+ "bbox": [
1242
+ 173,
1243
+ 474,
1244
+ 823,
1245
+ 517
1246
+ ],
1247
+ "page_idx": 10
1248
+ },
1249
+ {
1250
+ "type": "text",
1251
+ "text": "Wojciech Zaremba. An empirical exploration of recurrent network architectures. 2015. ",
1252
+ "bbox": [
1253
+ 173,
1254
+ 526,
1255
+ 743,
1256
+ 541
1257
+ ],
1258
+ "page_idx": 10
1259
+ },
1260
+ {
1261
+ "type": "text",
1262
+ "text": "Matthew D. Zeiler. ADADELTA: an adaptive learning rate method. CoRR, abs/1212.5701, 2012. URL http://arxiv.org/abs/1212.5701. ",
1263
+ "bbox": [
1264
+ 176,
1265
+ 550,
1266
+ 825,
1267
+ 579
1268
+ ],
1269
+ "page_idx": 10
1270
+ }
1271
+ ]
parse/train/rJY0-Kcll/rJY0-Kcll_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJY0-Kcll/rJY0-Kcll_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJxbJeHFPS/rJxbJeHFPS.md ADDED
@@ -0,0 +1,529 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WHAT CAN NEURAL NETWORKS REASON ABOUT?
2
+
3
+ Keyulu $\mathbf { X } \mathbf { u } ^ { \dag }$ , Jingling $\mathbf { L i } ^ { \dagger }$ , Mozhi Zhang‡, Simon S. $\mathbf { D } \mathbf { u } ^ { \mathrm { S } }$ , Ken-ichi Kawarabayashi¶, Stefanie Jegelka†
4
+
5
+ †Massachusetts Institute of Technology (MIT) ‡University of Maryland §Institute for Advanced Study (IAS) ¶National Institute of Informatics (NII) {keyulu, stefje}@mit.edu
6
+
7
+ # ABSTRACT
8
+
9
+ Neural networks have succeeded in many reasoning tasks. Empirically, these tasks require specialized network structures, e.g., Graph Neural Networks (GNNs) perform well on many such tasks, but less structured networks fail. Theoretically, there is limited understanding of why and when a network structure generalizes better than others, although they have equal expressive power. In this paper, we develop a framework to characterize which reasoning tasks a network can learn well, by studying how well its computation structure aligns with the algorithmic structure of the relevant reasoning process. We formally define this algorithmic alignment and derive a sample complexity bound that decreases with better alignment. This framework offers an explanation for the empirical success of popular reasoning models, and suggests their limitations. As an example, we unify seemingly different reasoning tasks, such as intuitive physics, visual question answering, and shortest paths, via the lens of a powerful algorithmic paradigm, dynamic programming (DP). We show that GNNs align with DP and thus are expected to solve these tasks. On several reasoning tasks, our theory is supported by empirical results.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Recently, there have been many advances in building neural networks that can learn to reason. Reasoning spans a variety of tasks, for instance, visual and text-based question answering (Johnson et al., $2 0 1 7 \mathrm { a }$ ; Weston et al., 2015; Hu et al., 2017; Fleuret et al., 2011; Antol et al., 2015), intuitive physics, i.e., predicting the time evolution of physical objects (Battaglia et al., 2016; Watters et al., 2017; Fragkiadaki et al., 2016; Chang et al., 2017), mathematical reasoning (Saxton et al., 2019; Chang et al., 2019) and visual IQ tests (Santoro et al., 2018; Zhang et al., 2019).
14
+
15
+ Curiously, neural networks that perform well in reasoning tasks usually possess specific structures (Santoro et al., 2017). Many successful models follow the Graph Neural Network (GNN) framework (Battaglia et al., 2018; 2016; Palm et al., 2018; Mrowca et al., 2018; Sanchez-Gonzalez et al., 2018; Janner et al., 2019). These networks explicitly model pairwise relations and recursively update each object’s representation by aggregating its relations with other objects. Other computational structures, e.g., neural symbolic programs (Yi et al., 2018; Mao et al., 2019; Johnson et al., 2017b) and Deep Sets (Zaheer et al., 2017), are effective on specific tasks.
16
+
17
+ However, there is limited understanding of the relation between the generalization ability and network structure for reasoning. What tasks can a neural network (sample efficiently) learn to reason about? Answering this question is crucial for understanding the empirical success and limitations of existing models, and for designing better models for new reasoning tasks.
18
+
19
+ This paper is an initial work towards answering this fundamental question, by developing a theoretical framework to characterize what tasks a neural network can reason about. We build on a simple observation that reasoning processes resemble algorithms. Hence, we study how well a reasoning algorithm aligns with the computation graph of the network. Intuitively, if they align well, the network only needs to learn simple algorithm steps to simulate the reasoning process, which leads to better sample efficiency. We formalize this intuition with a numeric measure of algorithmic alignment,
20
+
21
+ ![](images/e0aadb6c6e3aa5600c0b242e250ffc513c310c05e2f972111f83184499802b89.jpg)
22
+
23
+ ![](images/102207ce574aa8bf098410a9580ad03763dbe2757188c757627afc459bf95b98.jpg)
24
+ Dynamic programming What is the cost to defeat monster X by following the optimal path?
25
+
26
+ ![](images/9660efccc57477ae220b2de834bbe1a959baaa7bcfc3fe05b5299cac50800dd0.jpg)
27
+ NP-hard problem Subset sum: Is there a subset that sums to 0?
28
+
29
+ Summary statistics What is the maximum value difference among treasures?
30
+
31
+ ![](images/b8d70f3220509e86d5bbe875fca8e1cd655e3edf7d69882e8eb11251ae9e1d70.jpg)
32
+ Relational argmax What are the colors of the furthest pair of objects?
33
+ Figure 1: Overview of reasoning tasks with increasingly complex structure. Each task category shows an example task on which we perform experiments in Section 4. Algorithmic alignment suggests that (a) Deep Sets and GNNs, but not MLP, can sample efficiently learn summary statistics, (b) GNNs, but not Deep Sets, can learn relational argmax, (c) GNNs can learn dynamic programming, an algorithmic paradigm that we show to unify many reasoning tasks, (d) GNNs cannot learn subset sum (NP-hard), but NES, a network we design based on exhaustive search, can generalize. Our theory agrees with empirical results (Fig. 3).
34
+
35
+ and show initial support for our hypothesis that algorithmic alignment facilitates learning: Under simplifying assumptions, we show a sample complexity bound that decreases with better alignment.
36
+
37
+ Our framework explains the empirical success of popular reasoning models and suggests their limitations. As concrete examples, we study four categories of increasingly complex reasoning tasks: summary statistics, relational argmax (asking about properties of the result of comparing multiple relations), dynamic programming, and NP-hard problems (Fig. 1). Using alignment, we characterize which architectures are expected to learn each task well: Networks inducing permutation invariance, such as Deep Sets (Zaheer et al., 2017), can learn summary statistics, and one-iteration GNNs can learn relational argmax. Many other more complex tasks, such as intuitive physics, visual question answering, and shortest paths – despite seeming different – can all be solved via a powerful algorithmic paradigm: dynamic programming (DP) (Bellman, 1966). Multi-iteration GNNs algorithmically align with DP and hence are expected to sample-efficiently learn these tasks. Indeed, they do. Our results offer an explanation for the popularity of GNNs in the relational reasoning literature, and also suggest limitations for tasks with even more complex structure. As an example of such a task, we consider subset sum, an NP-hard problem where GNNs indeed fail. Overall, empirical results (Fig. 3) agree with our theoretical analysis based on algorithmic alignment (Fig. 1). These findings also suggest how to take into account task structure when designing new architectures.
38
+
39
+ The perspective that structure in networks helps is not new. For example, in a well-known position paper, Battaglia et al. (2018) argue that GNNs are suitable for relational reasoning because they have relational inductive biases, but without formalizations. Here, we take such ideas one step further, by introducing a formal definition (algorithmic alignment) for quantifying the relation between network and task structure, and by formally deriving implications for learning. These theoretical ideas are the basis for characterizing what reasoning tasks a network can learn well. Our algorithmic structural condition also differs from structural assumptions common in learning theory (Vapnik, 2013; Bartlett & Mendelson, 2002; Bartlett et al., 2017; Neyshabur et al., 2015; Golowich et al., 2018) and specifically aligns with reasoning.
40
+
41
+ In summary, we introduce algorithmic alignment to analyze learning for reasoning. Our initial theoretical results suggest that algorithmic alignment is desirable for generalization. On four categories of reasoning tasks with increasingly complex structure, we apply our framework to analyze which tasks some popular networks can learn well. GNNs algorithmically align with dynamic programming, which solves a broad range of reasoning tasks. Finally, our framework implies guidelines for designing networks for new reasoning tasks. Experimental results confirm our theory.
42
+
43
+ # 2 PRELIMINARIES
44
+
45
+ We begin by introducing notations and summarizing common neural networks for reasoning tasks. Let $S$ denote the universe, i.e., a configuration/set of objects to reason about. Each object $s \in S$ is represented by a vector $X$ . This vector could be state descriptions (Battaglia et al., 2016; Santoro et al., 2017) or features learned from data such as images (Santoro et al., 2017). Information about the specific question can also be included in the object representations. Given a set of universes $\{ S _ { 1 } , . . . , S _ { M } \}$ and answer labels $\{ y _ { 1 } , . . . , y _ { M } \} \subseteq \mathcal { Y }$ , we aim to learn a function $g$ that can answer questions about unseen universes, $y = g \left( S \right)$ .
46
+
47
+ ![](images/578a103683e5f8c5fbf52f2c57701847426e5efef163ca1d9456a247b512ba17.jpg)
48
+ Figure 2: Our framework suggests that better algorithmic alignment improves generalization. As an example, our framework explains why GNN generalizes when learning to answer shortest paths. A correct reasoning process for the shortest paths task is the Bellman-Ford algorithm. The computation structure of a GNN (left) aligns well with Bellman-Ford (right): the GNN can simulate Bellman-Ford by merely learning a simple reasoning step, i.e., the relaxation step in the last line (a sum, and a min over neighboring nodes $v$ ) via its aggregation operation. In contrast, a giant MLP or Deep Set must learn the structure of the entire for-loop. Thus, the GNN is expected to generalize better when learning shortest paths, as is confirmed in experiments (Section 4.3).
49
+
50
+ Multi-layer perceptron (MLP). For a single-object universe, applying an MLP on the object representation usually works well. But when there are multiple objects, simply applying an MLP to the concatenated object representations often does not generalize (Santoro et al., 2017).
51
+
52
+ Deep Sets. As the input to the reasoning function is an unordered set, the function should be permutation-invariant, i.e., the output is the same for all input orderings. To induce permutation invariance in a neural network, Zaheer et al. (2017) propose Deep Sets, of the form
53
+
54
+ $$
55
+ y = \mathbf { M L P _ { 2 } } \Big ( \sum _ { s \in S } \mathbf { M L P _ { 1 } } \left( X _ { s } \right) \Big ) .
56
+ $$
57
+
58
+ Graph Neural Networks (GNNs). GNNs are originally proposed for learning on graphs (Scarselli et al., 2009b). Their structures follow a message passing scheme (Gilmer et al., 2017; Xu et al., 2018; 2019), where the representation $h _ { s } ^ { ( k ) }$ of each node $s$ (in iteration $k$ ) is recursively updated by aggregating the representation of neighboring nodes. GNNs can be adopted for reasoning by considering objects as nodes and assuming all objects pairs are connected, i.e., a complete graph (Battaglia et al., 2018):
59
+
60
+ $$
61
+ h _ { s } ^ { ( k ) } = \sum _ { t \in S } \mathrm { M L P } _ { 1 } ^ { ( k ) } \left( h _ { s } ^ { ( k - 1 ) } , h _ { t } ^ { ( k - 1 ) } \right) , \quad h _ { S } = \mathrm { M L P } _ { 2 } \Big ( \sum _ { s \in S } h _ { s } ^ { ( K ) } \Big ) ,
62
+ $$
63
+
64
+ where $h _ { S }$ is the answer/output and $K$ is the number of GNN layers. Each object’s representation is initialized as $h _ { s } ^ { ( 0 ) } = X _ { s }$ . Although other aggregation functions are proposed, we use sum in our experiments. Similar to Deep Sets, GNNs are also permutation invariant. While Deep Sets focus on individual objects, GNNs can also focus on pairwise relations.
65
+
66
+ The GNN framework includes many reasoning models. Relation Networks (Santoro et al., 2017) and Interaction Networks (Battaglia et al., 2016) resemble one-layer GNNs. Recurrent Relational Networks (Palm et al., 2018) apply LSTMs (Hochreiter & Schmidhuber, 1997) after aggregation.
67
+
68
+ # 3 THEORETICAL FRAMEWORK: ALGORITHMIC ALIGNMENT
69
+
70
+ Next, we study how the network structure and task may interact, and possible implications for generalization. Empirically, different network structures have different degrees of success in learning reasoning tasks, e.g., GNNs can learn relations well, but Deep Sets often fail (Fig. 3). However, all these networks are universal approximators (Propositions 3.1 and 3.2). Thus, their differences in test accuracy must come from generalization.
71
+
72
+ We observe that the answer to many reasoning tasks may be computed via a reasoning algorithm; we further illustrate the algorithms for some reasoning tasks in Section 4. Many neural networks can represent algorithms (Pérez et al., 2019). For example, Deep Sets can universally represent permutation-invariant set functions (Zaheer et al., 2017; Wagstaff et al., 2019). This also holds for GNNs and MLPs, as we show in Propositions 3.1 and 3.2 (our setting differs from Scarselli et al. (2009a) and $\mathrm { X u }$ et al. (2019), who study functions on graphs):
73
+
74
+ Proposition 3.1. Let $f : \mathbb { R } ^ { d \times N } \mathbb { R }$ be any continuous function over sets $S$ of bounded cardinality $| S | \le N$ . If $f$ is permutation-invariant to the elements in $S$ , and the elements are in a compact set in $\mathbf { \mathbb { R } } ^ { d }$ , then $f$ can be approximated arbitrarily closely by a GNN (of any depth).
75
+
76
+ Proposition 3.2. For any GNN $\mathcal { N }$ , there is an MLP that can represent all functions $\mathcal { N }$ can represent.
77
+
78
+ But, empirically, not all network structures work well when learning these algorithms, i.e., they generalize differently. Intuitively, a network may generalize better if it can represent a function “more easily”. We formalize this idea by algorithmic alignment, formally defined in Definition 3.4. Indeed, not only the reasoning process has an algorithmic structure: the neural network’s architecture induces a computational structure on the function it computes. This corresponds to an algorithm that prescribes how the network combines computations from modules. Fig. 2 illustrates this idea for a GNN, where the modules are its MLPs applied to pairs of objects. In the shortest paths problem, the GNN matches the structure of the Bellman-Ford algorithm: to simulate the Bellman-Ford with a GNN, the GNN’s MLP modules only need to learn a simple update equation (Fig. 2). In contrast, if we want to represent the Bellman-Ford algorithm with a single MLP, it needs to simulate an entire for-loop, which is much more complex than one update step. Therefore, we expect the GNN to have better sample complexity than MLP when learning to solve shortest path problems.
79
+
80
+ This perspective suggests that a neural network which better aligns with a correct reasoning process (algorithmic solution) can more easily learn a reasoning task than a neural network that does not align well. If we look more broadly at reasoning, there may also exist solutions which only solve a task approximately, or whose structure is obtuse. In this paper, we focus on reasoning tasks whose underlying reasoning process is exact and has clear algorithmic structure. We leave the study of approximation algorithms and unknown structures for future work.
81
+
82
+ # 3.1 FORMALIZATION OF ALGORITHMIC ALIGNMENT
83
+
84
+ We formalize the above intuition in a PAC learning framework (Valiant, 1984). PAC learnability formalizes simplicity as sample complexity, i.e., the number of samples needed to ensure low test error with high probability. It refers to a learning algorithm $\mathcal { A }$ that, given training samples $\{ x _ { i } , y _ { i } \} _ { i = 1 } ^ { M }$ outputs a function training method, e. $f = \mathcal { A } ( \{ x _ { i } , y _ { i } \} _ { i = 1 } ^ { M } )$ . The learning algorithm here is the neural network and its A function is simple if it has low sample complexity.
85
+
86
+ Definition 3.3. (PAC learning and sample complexity). Fix an error parameter $\epsilon > 0$ and failure probability $\delta \in ( 0 , 1 )$ . Suppose $\{ x _ { i } , y _ { i } \} _ { i = 1 } ^ { M }$ are i.i.d. samples from some distribution $\mathcal { D }$ , and the data satisfies $y _ { i } = g ( x _ { i } )$ for some underlying function $g$ . Let $f = \mathcal { A } ( \left\{ x _ { i } , y _ { i } \right\} _ { i = 1 } ^ { M } )$ be the function generated by a learning algorithm . Then $g$ is $( M , \epsilon , \delta )$ -learnable with $\mathcal { A }$ if
87
+
88
+ $$
89
+ \begin{array} { r } { \mathbb { P } _ { x \sim \mathcal { D } } \left[ \| f ( x ) - g ( x ) \| \le \epsilon \right] \ge 1 - \delta . } \end{array}
90
+ $$
91
+
92
+ The sample complexity $\mathcal { C } _ { A } \left( g , \epsilon , \delta \right)$ is the minimum $M$ so that $g$ is $( M , \epsilon , \delta )$ -learnable with $\mathcal { A }$ .
93
+
94
+ With the PAC learning framework, we define a numeric measure of algorithmic alignment (Definition 3.4), and under simplifying assumptions, we show that the sample complexity decreases with better algorithmic alignment (Theorem 3.6).
95
+
96
+ Formally, a neural network aligns with an algorithm if it can simulate the algorithm via a limited number of modules, and each module is simple, i.e., has low sample complexity.
97
+
98
+ Definition 3.4. (Algorithmic alignment). Let $g$ be a reasoning function and $\mathcal { N }$ a neural network with $n$ modules ${ \mathcal { N } } _ { i }$ . The module functions $f _ { 1 } , . . . , f _ { n }$ generate $g$ for $\mathcal { N }$ if, by replacing ${ \mathcal { N } } _ { i }$ with $f _ { i }$ , the network $\mathcal { N }$ simulates $g$ . Then $N \left( M , \epsilon , \delta \right)$ -algorithmically aligns with $g$ if (1) $f _ { 1 } , . . . , f _ { n }$ generate $g$ and (2) there are learning algorithms $A _ { i }$ for the ${ \mathcal { N } } _ { i }$ ’s such that $n \cdot \operatorname* { m a x } _ { i } C _ { \mathcal { A } _ { i } } ( f _ { i } , \epsilon , \delta ) \leq M$ .
99
+
100
+ Good algorithmic alignment, i.e., small $M$ , implies that all algorithm steps $f _ { i }$ to simulate the algorithm $g$ are easy to learn. Therefore, the algorithm steps should not simulate complex programming constructs such as for-loops, whose sample complexity is large (Theorem 3.5).
101
+
102
+ Next, we show how to compute the algorithmic alignment value $M$ . Algorithmic alignment resembles Kolmogorov complexity (Kolmogorov, 1998) for neural networks. Thus, it is generally non-trivial to obtain the optimal alignment between a neural network and an algorithm. However, one important difference to Kolmogorov complexity is that any algorithmic alignment that yields decent sample complexity is good enough (unless we want the tightest bound). In Section 4, we will see several examples where finding a good alignment is not hard. Then, we can compute the value of an alignment by summing the sample complexity of the algorithm steps with respect to the modules, e.g. MLPs. For ilustration, we show an example of how one may compute sample complexity of MLP modules.
103
+
104
+ A line of works show one can analyze the optimization and generalization behavior of overparameterized neural networks via neural tangent kernel (NTK) (Allen-Zhu et al., 2019; Arora et al., 2019a;b; 2020; Du et al., $2 0 1 9 \mathrm { c }$ ;a; Jacot et al., 2018; Li & Liang, 2018). Building upon Arora et al. (2019a), Du et al. (2019b) show that infinitely-wide GNNs trained with gradient descent can provably learn certain smooth functions. The current work studies a broader class of functions, e.g., algorithms, compared to those studied in Du et al. (2019b), but with more simplifying assumptions.
105
+
106
+ Here, Theorem 3.5, proved in the Appendix, summarizes and extends Theorem 6.1 of Arora et al. (2019a) for over-parameterized MLP modules to vector-valued functions. Our framework can be used with other sample complexity bounds for other types of modules, too.
107
+
108
+ Theorem 3.5. (Sample complexity for overparameterized MLP modules). Let $\mathcal { A }$ be an overparameterized and randomly initialized two-layer MLP trained with gradient descent for a sufficient number of iterations. Suppose $g : \mathbb { R } ^ { d } \mathbb { R } ^ { m }$ with components $\begin{array} { r } { g ( x ) ^ { ( i ) } = \sum _ { j } \alpha _ { j } ^ { ( i ) } \big ( \beta _ { j } ^ { ( i ) \top } x \big ) ^ { p _ { j } ^ { ( i ) } } } \end{array}$ , where $\beta _ { j } ^ { ( i ) } \in \mathbb { R } ^ { d }$ , $\alpha \in \mathbb { R } ,$ , and $p _ { j } ^ { ( i ) } = 1$ or $p _ { j } ^ { ( i ) } = 2 l ( l \in \mathbb { N } _ { + } )$ . The sample complexity $\mathcal { C } _ { A } ( g , \epsilon , \delta )$ is
109
+
110
+ $$
111
+ \mathcal { C } _ { \mathcal { A } } ( g , \epsilon , \delta ) = O \Big ( \frac { \operatorname* { m a x } _ { i } \sum _ { j = 1 } ^ { K } p _ { j } ^ { ( i ) } | \alpha _ { j } ^ { ( i ) } | \cdot \| \beta _ { j } ^ { ( i ) } \| _ { 2 } ^ { p _ { j } ^ { ( i ) } } + \log { ( m / \delta ) } } { ( \epsilon / m ) ^ { 2 } } \Big ) .
112
+ $$
113
+
114
+ Theorem 3.5 suggests that functions that are “simple” when expressed as a polynomial, e.g., via a Taylor expansion, are sample efficiently learnable by an MLP module. Thus, algorithm steps that perform computation over many objects may require many samples for an MLP module to learn, since the number $K$ of polynomials or $\| \beta _ { j } ^ { ( i ) } \|$ can increase in Eqn. (3.2). “For loop” is one example of such complex algorithm steps.
115
+
116
+ # 3.2 BETTER ALGORITHMIC ALIGNMENT IMPLIES BETTER GENERALIZATION
117
+
118
+ We show an initial result demonstrating that algorithmic alignment is desirable for generalization. Theorem 3.6 states that, in a simplifying setting where we sequentially train modules of a network with auxiliary labels, the sample complexity bound increases with algorithmic alignment value $M$ .
119
+
120
+ While we do not have auxiliary labels in practice, we observe the same pattern for end-to-end learning in experiments (Section 4). We leave sample complexity analysis for end-to-end-learning to future work. We prove Theorem 3.6 in Appendix D.
121
+
122
+ Theorem 3.6. (Algorithmic alignment improves sample complexity). Fix  and $\delta$ . Suppose $\left\{ S _ { i } , y _ { i } \right\} _ { i = 1 } ^ { M } \sim \mathcal { D }$ , where $| S _ { i } | < N$ , and $y _ { i } = g ( S _ { i } )$ for some $g$ . Suppose $\mathcal { N } _ { 1 } , . . . , \mathcal { N } _ { n }$ are network N ’s MLP modules in sequential order. Suppose $\mathcal { N }$ and $g$ $( M , \epsilon , \delta )$ -algorithmically align via functions $f _ { 1 } , . . . , f _ { n }$ . Under the following assumptions, $g$ is $( M , O ( \epsilon ) , O ( \delta ) )$ -learnable by $\mathcal { N }$ .
123
+
124
+ $\pmb { a } _ { , }$ ) Algorithm stability. Let $\mathcal { A }$ be the learning algorithm for the ${ \mathcal { N } } _ { i }$ ’s. Suppose $f = \mathcal { A } ( \{ x _ { i } , y _ { i } \} _ { i = 1 } ^ { M } )$ and $\boldsymbol { \hat { f } } = \boldsymbol { \mathcal { A } } ( \left\{ \boldsymbol { \hat { x } } _ { i } , y _ { i } \right\} _ { i = 1 } ^ { M } )$ . For any $x$ , $\begin{array} { r } { \| f ( x ) - \hat { f } ( x ) \| \leq L _ { 0 } \cdot \operatorname* { m a x } _ { i } \| x _ { i } - \hat { x } _ { i } \| , } \end{array}$ , for some $L _ { 0 }$ .
125
+
126
+ $\pmb { b }$ ) Sequential learning. We train ${ \mathcal { N } } _ { i }$ ’s sequentially: $\mathcal { N } _ { 1 }$ has input samples $\{ \hat { x } _ { i } ^ { ( 1 ) } , f _ { 1 } ( \hat { x } _ { i } ^ { ( 1 ) } ) \} _ { i = 1 } ^ { N }$ ))}Ni=1, with $\hat { x } _ { i } ^ { ( 1 ) }$ obtained from $S _ { i }$ . For $j > 1$ , the input $\hat { x } _ { i } ^ { ( j ) }$ for ${ \mathcal { N } } _ { j }$ are the outputs from the previous modules, but labels are generated by the correct functions $f _ { j - 1 } , . . . , f _ { 1 }$ on $\hat { x } _ { i } ^ { ( 1 ) }$ .
127
+
128
+ c) Lipschitzness. The learned functions ${ \hat { f } } _ { j }$ satisfy $\| \hat { f } _ { j } ( x ) - \hat { f } _ { j } ( \hat { x } ) \| \leq L _ { 1 } \| x - \hat { x } \|$ , for some $L _ { 1 }$
129
+
130
+ ![](images/0b7d95ebd39512a7b18a1c1c8f376a694539a70af3e963539e0f36506dac7425.jpg)
131
+ Figure 3: Test accuracies on reasoning tasks with increasingly complex structure. Fig. 1 shows an overview of the tasks. $\mathrm { G N N } k$ is GNN with $k$ iterations. (a) Summary statistics. All models except MLP generalize. (b) Relational argmax. Deep Sets fail. (c) Dynamic programming. Only GNNs with sufficient iterations generalize. (d) An NP-hard problem. Even GNNs fail, but NES generalizes.
132
+
133
+ In our analysis, the Lipschitz constants and the universe size are constants going into $O ( \epsilon )$ and $O ( \delta )$ . As an illustrative example, we use Theorem 3.6 and 3.5 to show that GNN has a polynomial improvement in sample complexity over MLP when learning simple relations. Indeed, GNN aligns better with summary statistics of pairwise relations than MLP does (Section 4.1).
134
+
135
+ Corollary 3.7. Suppose universe $S$ has $\ell$ objects $X _ { 1 } , . . . , X _ { \ell }$ , and $\begin{array} { r } { g ( S ) = \sum _ { i , j } ( X _ { i } - X _ { j } ) ^ { 2 } } \end{array}$ . In the setting of Theorem 3.6, the sample complexity bound for MLP is $O ( \ell ^ { 2 } )$ times larger than for GNN.
136
+
137
+ # 4 PREDICTING WHAT NEURAL NETWORKS CAN REASON ABOUT
138
+
139
+ Next, we apply our framework to analyze the neural networks for reasoning from Section 2: MLP, Deep Sets, and GNNs. Using algorithmic alignment, we predict whether each model can generalize on four categories of increasingly complex reasoning tasks: summary statistics, relational argmax, dynamic programming, and an NP-hard problem (Fig. 3). Our theoretical analysis is confirmed with experiments (Dataset and training details are in Appendix G). To empirically compare sample complexity of different models, we make sure all models perfectly fit training sets through extensive hyperparameter tuning. Therefore, the test accuracy reflects how well a model generalizes.
140
+
141
+ The examples in this section, together with our framework, suggest an explanation why GNNs are widely successful across reasoning tasks: Popular reasoning tasks such as visual question answering and intuitive physics can be solved by DP. GNNs align well with DP, and hence are expected to learn sample efficiently.
142
+
143
+ # 4.1 SUMMARY STATISTICS
144
+
145
+ As discussed in Section 2, we assume each object $X$ has a state representation $X = [ h _ { 1 } , h _ { 2 } , . . . , h _ { k } ]$ where each $h _ { i } \in \mathbb { R } ^ { d _ { i } }$ is a feature vector. An MLP can learn simple polynomial functions of the state representation (Theorem 3.5). In this section, we show how Deep Sets use MLP as building blocks to learn summary statistics.
146
+
147
+ Questions about summary statistics are common in reasoning tasks. One example from CLEVR (Johnson et al., 2017a) is “How many objects are either small cylinders or red things?” Deep Sets (Eqn. 2.1) align well with algorithms that compute summary statistics over individual objects. Suppose we want to compute the sum of a feature over all objects. To simulate the reasoning algorithm, we can use the first MLP in Deep Sets to extract the desired feature and aggregate them using the pooling layer. Under this alignment, each MLP only needs to learn simple steps, which leads to good sample complexity. Similarly, Deep Sets can learn to compute max or min of a feature by using smooth approximations like the softmax $\begin{array} { r } { \underset { \bullet \in S } { \operatorname* { m a x } } _ { s \in S } X _ { s } \approx \mathrm { l o g } ( \sum _ { s \in X _ { s } } \exp ( X _ { s } ) ) } \end{array}$ . In contrast, if we train an MLP to perform sum or max, the MLP must learn a complex for-loop and therefore needs more samples. Therefore, our framework predicts that Deep Sets have better sample complexity than MLP when learning summary statistics.
148
+
149
+ ![](images/559221edba810957339e3174cfdb3df3a643d508029a5f5b5c3a1036933b049d.jpg)
150
+ Figure 4: Test accuracy vs. training set size for models trained on sub-sampled training sets and evaluated on the same test set of monster trainer (DP task). Test accuracies increase faster when a neural network aligns well with an algorithmic solution of the task. For example, the test accuracy of GNN4 increases by $2 3 \%$ when the number of training samples increases from 40, 000 to 80, 000, which is much higher than that of Deep Sets $\left( 0 . 2 \% \right)$ .
151
+
152
+ Maximum value difference. We confirm our predictions by training models to compute the maximum value difference task. Each object in this task is a treasure $X = [ h _ { 1 } , h _ { 2 } , h _ { 3 } ]$ with location $h _ { 1 }$ , value $h _ { 2 }$ , and color $h _ { 3 }$ . We train models to predict the difference in value between the most and the least valuable treasure, $\begin{array} { r } { y ( S ) = \operatorname* { m a x } _ { s \in S } h _ { 2 } ( X _ { s } ) - \operatorname* { m i n } _ { s \in S } h _ { 2 } ( X _ { s } ) } \end{array}$ .
153
+
154
+ The test accuracy follows our prediction (Fig. 3a). MLP does not generalize and only has $9 \%$ test accuracy, while Deep Sets has $96 \%$ . Interestingly, if we sort the treasures by value (Sorted MLP in Fig. 3a), MLP achieves perfect test accuracy. This observation can be explained with our theory—when the treasures are sorted, the reasoning algorithm is reduced to a simple subtraction: $y ( S ) \dot { = } h _ { 2 } ( X _ { | S | } ) - h _ { 2 } ( X _ { 1 } )$ , which has a low sample complexity for even MLPs (Theorem 3.5). GNNs also have high test accuracies. This is because summary statistics are a special case of relational argmax, which GNNs can learn as shown next.
155
+
156
+ # 4.2 RELATIONAL ARGMAX
157
+
158
+ Next, we study relational argmax: tasks where we need to compare pairwise relations and answer a question about that result. For example, a question from Sort-of-CLEVR (Santoro et al., 2017) asks “What is the shape of the object that is farthest from the gray object?”, which requires comparing the distance between object pairs.
159
+
160
+ One-iteration GNN aligns well with relational argmax, as it sums over all pairs of objects, and thus can compare, e.g. via softmax, pairwise information without learning the “for loops”. In contrast, Deep Sets require many samples to learn this, because most pairwise relations cannot be encoded as a sum of individual objects:
161
+
162
+ Claim 4.1. Suppose $g ( x , y ) = 0$ if and only if $x = y$ . There is no $f$ such that $g ( x , y ) = f ( x ) + f ( y )$
163
+
164
+ Therefore, if we train a Deep Set to compare pairwise relations, one of the MLP modules has to learn a complex “for loop”, which leads to poor sample complexity. Our experiment confirms that GNNs generalize better than Deep Sets when learning relational argmax.
165
+
166
+ Furthest pair. As an example of relational argmax, we train models to identify the furthest pair among a set of objects. We use the same object settings as the maximum value difference task. We train models to find the colors of the two treasures with the largest distance. The answer is a pair of colors, encoded as an integer category:
167
+
168
+ $$
169
+ \begin{array} { r } { y ( S ) = ( h _ { 3 } ( X _ { s _ { 1 } } ) , h _ { 3 } ( X _ { s _ { 2 } } ) ) \quad \mathrm { s . t . } \ \{ X _ { s _ { 1 } } , X _ { s _ { 2 } } \} = \arg \operatorname* { m a x } _ { s _ { 1 } , s _ { 2 } \in S } \| h _ { 1 } ( X _ { s _ { 1 } } ) - h _ { 1 } ( X _ { s _ { 2 } } ) \| _ { \ell _ { 1 } } } \end{array}
170
+ $$
171
+
172
+ Distance as a pairwise function satisfies the condition in Claim 4.1. As predicted by our framework, Deep Sets has only $21 \%$ test accuracy, while GNNs have more than $90 \%$ accuracy.
173
+
174
+ # 4.3 DYNAMIC PROGRAMMING
175
+
176
+ We observe that a broad class of relational reasoning tasks can be unified by the powerful algorithmic paradigm dynamic programming $( D P )$ (Bellman, 1966). DP recursively breaks down a problem into simpler sub-problems. It has the following general form:
177
+
178
+ $$
179
+ \operatorname { A n s w e r } [ k ] [ i ] = { \mathrm { D P - U p d a t e } } ( \left\{ { \mathrm { A n s w e r } } [ k - 1 ] [ j ] \right\} , j = 1 . . . n ) ,
180
+ $$
181
+
182
+ where Answer $[ k ] [ i ]$ is the solution to the sub-problem indexed by iteration $k$ and state $i$ , and DPUpdate is an task-specific update function that computes Answer $[ k ] [ i ]$ from Answer $[ k - 1 ] [ j ]$ ’s.
183
+
184
+ GNNs algorithmically align with a class of DP algorithms. We can interpret GNN as a DP algorithm, where node representations $h _ { i } ^ { ( k ) }$ are Answer $[ k ] [ i ]$ , and the GNN aggregation step is the DP-Update. Therefore, Theorem 3.6 suggests that a GNN with enough iterations can sample efficiently learn any DP algorithm with a simple DP-update function, e.g. sum/min/max.
185
+
186
+ Shortest paths. As an example, we experiment with GNN on Shortest paths, a standard DP problem. Shortest paths can be solved by the Bellman-Ford algorithm (Bellman, 1958), which recursively updates the minimum distance between each object $u$ and the source $s$ :
187
+
188
+ $$
189
+ \mathrm { i s t a n c e } [ 1 ] [ u ] = \mathrm { c o s t } ( s , u ) , \quad \mathrm { d i s t a n c e } [ k ] [ u ] = \operatorname* { m i n } _ { v } \big \{ \mathrm { d i s t a n c e } [ k - 1 ] [ v ] + \mathrm { c o s t } ( v , u ) \big \} ,
190
+ $$
191
+
192
+ As discussed above, GNN aligns well with this DP algorithm. Therefore, our framework predicts that GNN has good sample complexity when learning to find shortest paths. To verify this, we test different models on a monster trainer game, which is a shortest path variant with unkown cost functions that need to be learned by the models. Appendix G.3 describes the task in details.
193
+
194
+ In Fig. 3c, only GNNs with at least four iterations generalize well. The empirical result confirms our theory: a neural network can sample efficiently learn a task if it aligns with a correct algorithm. Interestingly, GNN does not need as many iterations as Bellman-Ford. While Bellman-Ford needs $N = 7$ iterations, GNNs with four iterations have almost identical test accuracy as GNNs with seven iterations $94 \%$ vs $9 5 \%$ ). This can also be explained through algorithmic alignment, as GNN aligns with an optimized version of Bellman-Ford, which we explain in Appendix G.3.
195
+
196
+ Fig. 4 shows how the test accuracies of different models vary with the number of sub-sampled training points. Indeed, the test accuracy increases more slowly for models that align worse with the task, which implies they need more training samples to achieve similar generalization performance. Again, this confirms our theory.
197
+
198
+ After verifying that GNNs can sample-efficiently learn DP, we show that two popular families of reasoning tasks, visual question answering and intuitive physics, can be formulated as DP. Therefore, our framework explains why GNNs are effective in these tasks.
199
+
200
+ Visual question answering. The Pretty-CLEVR dataset (Palm et al., 2018) is an extension of Sort-of-CLEVR (Santoro et al., 2017) and CLEVR (Johnson et al., 2017a). GNNs work well on these datasets. Each question in Pretty-CLEVR has state representations and asks “Starting at object $X$ , if each time we jump to the closest object, which object is $K$ jumps away?”. This problem can be solved by DP, which computes the answers for $k$ jumps from the answers for $( k - 1 )$ jumps.
201
+
202
+ $$
203
+ \operatorname { c l o s e s t } [ 1 ] [ i ] = \arg \operatorname* { m i n } _ { j } d ( i , j ) , \quad \operatorname { c l o s e s t } [ k ] [ i ] = \operatorname { c l o s e s t } [ k - 1 ] \Big [ \operatorname { c l o s e s t } [ 1 ] [ i ] \Big ] \mathrm { ~ f o r ~ } k > 1 ,
204
+ $$
205
+
206
+ where closest $[ k ] [ i ]$ is the answer for jumping $k$ times from object $i$ , and $d ( i , j )$ is the distance between the $i$ -th and the $j$ -th object.
207
+
208
+ Intuitive physics. Battaglia et al. (2016) and Watters et al. (2017) train neural networks to predict object dynamics in rigid body scenes and n-body systems. Chang et al. (2017) and Janner et al. (2019) study other rigid body scenes. If the force acting on a physical object stays constant, we can compute the object’s trajectory with simple functions (physics laws) based on its initial position and force. Physical interactions, however, make the force change, which means the function to compute the object’s dynamics has to change too. Thus, a DP algorithm would recursively compute the next force changes in the system and update DP states (velocity, momentum, position etc of objects) according to the (learned) forces and physics laws (Thijssen, 2007).
209
+
210
+ $$
211
+ \begin{array} { r } { \operatorname { r } k = 1 . . K : \quad \operatorname { t i m e } = \operatorname* { m i n } _ { i , j } \operatorname { F o r c e - c h a n g e - t i m e } ( \mathrm { s t a t e } [ k - 1 , i ] , \mathrm { s t a t e } [ k - 1 , j ] ) , } \\ { \operatorname { f o r } i = 1 . . N : \quad \mathrm { s t a t e } [ k ] [ i ] = \operatorname { U p d a t e - b y - f o r c e s } ( \mathrm { s t a t e } [ k - 1 ] [ j ] , \mathrm { t i m e } ) , \ j = 1 . . N , } \end{array}
212
+ $$
213
+
214
+ Force-change-time computes the time at which the force between object $i$ and $j$ will change. Updateby-forces updates the state of each object at the next force change time. In rigid body systems, force changes only at collision. In datasets where no object collides more than once between time frames, one-iteration algorithm/GNN can work (Battaglia et al., 2016). More iterations are needed if multiple collisions occur between two consecutive frames (Li & Liang, 2018). In n-body systems, forces change continuously but smoothly. Thus, finite-iteration DP/GNN can be viewed as a form of Runge-Kutta method (DeVries & Hamill, 1995).
215
+
216
+ # 4.4 DESIGNING NEURAL NETWORKS WITH ALGORITHMIC ALIGNMENT
217
+
218
+ While DP solves many reasoning tasks, it has limitations. For example, NP-hard problems cannot be solved by DP. It follows that GNN also cannot sample-efficiently learn these hard problems. Our framework, however, goes beyond GNNs. If we know the structure of a suitable underlying reasoning algorithm, we can design a network with a similar structure to learn it. If we have no prior knowledge about the structure, then neural architecture search over algorithmic structures will be needed.
219
+
220
+ Subset Sum. As an example, we design a new architecture that can learn to solve the subset sum problem: Given a set of numbers, does there exist a subset that sums to 0? Subset sum is NP-hard (Karp, 1972) and cannot be solved by DP. Therefore, our framework predicts that GNN cannot generalize on this task. One subset sum algorithm is exhaustive search, where we enumerate all $2 ^ { | S | }$ possible subsets $\tau$ and check whether $\tau$ has zero-sum. Following this algorithm, we design a similarly structured neural network which we call Neural Exhaustive Search (NES). Given a universe, NES enumerates all subsets of objects and passes each subset through an LSTM followed by a MLP. The results are aggregated with a max-pooling layer and MLP:
221
+
222
+ $$
223
+ \begin{array} { r } { \mathbf { M L P } _ { 2 } ( \operatorname* { m a x } _ { \tau \subseteq S } \mathbf { M L P } _ { 1 } \circ \mathbf { L S T M } ( X _ { 1 } , . . . , X _ { | \tau | } : X _ { 1 } , . . . , X _ { | \tau | } \in \tau ) ) . } \end{array}
224
+ $$
225
+
226
+ This architecture aligns well with subset-sum, since the first MLP and LSTM only need to learn a simple step, checking whether a subset has zero sum. Therefore, we expect NES to generalize well in this task. Indeed, NES has $98 \%$ test accuracy, while other models perform much worse (Fig. 3d).
227
+
228
+ # 5 CONCLUSION
229
+
230
+ This paper is an initial step towards formally understanding how neural networks can learn to reason. In particular, we answer what tasks a neural network can learn to reason about well, by studying the generalization ability of learning the underlying reasoning processes for a task. To this end, we introduce an algorithmic alignment framework to formalize the interaction between the structure of a neural network and a reasoning process, and provide preliminary results on sample complexity. Our results explain the success and suggest the limits of current neural architectures: Graph Neural Networks generalize in many popular reasoning tasks because the underlying reasoning processes for those tasks resemble dynamic programming.
231
+
232
+ Our algorithmic alignment perspective may inspire neural network design and opens up theoretical avenues. An interesting direction for future work is to design, e.g. via algorithmic alignment, neural networks that can learn other reasoning paradigms beyond dynamic programming, and to explore the neural architecture search space of algorithmic structures.
233
+
234
+ From a broader standpoint, reasoning assumes a good representation of the concepts and objects in the world. To complete the picture, it would also be interesting to understand how to better disentangle and eventually integrate “representation” and “reasoning”.
235
+
236
+ # ACKNOWLEDGMENTS
237
+
238
+ We thank Zi Wang and Jiajun Wu for insightful discussions. This research was supported by NSF CAREER award 1553284, DARPA DSO’s Lagrange program under grant FA86501827838 and a Chevron-MIT Energy Fellowship. This research was also supported by JST ERATO JPMJER1201 and JSPS Kakenhi JP18H05291. MZ was supported by DARPA award HR0011-15-C-0113 under subcontract to Raytheon BBN Technologies. The views, opinions, and/or findings contained in this article are those of the author and should not be interpreted as representing the official views or policies, either expressed or implied, of the Defense Advanced Research Projects Agency or the Department of Defense.
239
+
240
+ # REFERENCES
241
+
242
+ Zeyuan Allen-Zhu, Yuanzhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. In Advances in Neural Information Processing Systems, pp. 6155–6166, 2019.
243
+
244
+ Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In Proceedings of the IEEE international conference on computer vision, pp. 2425–2433, 2015.
245
+
246
+ Sanjeev Arora, Simon Du, Wei Hu, Zhiyuan Li, and Ruosong Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In International Conference on Machine Learning, pp. 322–332, 2019a.
247
+
248
+ Sanjeev Arora, Simon S Du, Wei Hu, Zhiyuan Li, Russ R Salakhutdinov, and Ruosong Wang. On exact computation with an infinitely wide neural net. In Advances in Neural Information Processing Systems, pp. 8139–8148, 2019b.
249
+
250
+ Sanjeev Arora, Simon S. Du, Zhiyuan Li, Ruslan Salakhutdinov, Ruosong Wang, and Dingli Yu. Harnessing the power of infinitely wide deep nets on small-data tasks. In International Conference on Learning Representations, 2020.
251
+
252
+ Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3(Nov):463–482, 2002.
253
+
254
+ Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems, pp. 6240–6249, 2017.
255
+
256
+ Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, et al. Interaction networks for learning about objects, relations and physics. In Advances in Neural Information Processing Systems, pp. 4502–4510, 2016.
257
+
258
+ Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
259
+
260
+ Richard Bellman. On a routing problem. Quarterly of applied mathematics, 16(1):87–90, 1958.
261
+
262
+ Richard Bellman. Dynamic programming. Science, 153(3731):34–37, 1966.
263
+
264
+ Michael Chang, Abhishek Gupta, Sergey Levine, and Thomas L. Griffiths. Automatically composing representation transformations as a means for generalization. In International Conference on Learning Representations, 2019.
265
+
266
+ Michael B Chang, Tomer Ullman, Antonio Torralba, and Joshua B Tenenbaum. A compositional object-based approach to learning physical dynamics. In International Conference on Learning Representations, 2017.
267
+
268
+ Paul L DeVries and Patrick Hamill. A first course in computational physics, 1995.
269
+
270
+ Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pp. 1675– 1685, 2019a.
271
+
272
+ Simon S Du, Kangcheng Hou, Russ R Salakhutdinov, Barnabas Poczos, Ruosong Wang, and Keyulu Xu. Graph neural tangent kernel: Fusing graph neural networks with graph kernels. In Advances in Neural Information Processing Systems, pp. 5724–5734, 2019b.
273
+
274
+ Simon S. Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. In International Conference on Learning Representations, 2019c.
275
+
276
+ François Fleuret, Ting Li, Charles Dubout, Emma K Wampler, Steven Yantis, and Donald Geman. Comparing machines and humans on a visual categorization test. Proceedings of the National Academy of Sciences, 108(43):17621–17625, 2011.
277
+
278
+ Katerina Fragkiadaki, Pulkit Agrawal, Sergey Levine, and Jitendra Malik. Learning visual predictive models of physics for playing billiards. In International Conference on Learning Representations, 2016.
279
+
280
+ Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pp. 1273–1272, 2017.
281
+
282
+ Noah Golowich, Alexander Rakhlin, and Ohad Shamir. Size-independent sample complexity of neural networks. In Conference On Learning Theory, pp. 297–299, 2018.
283
+
284
+ Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
285
+
286
+ Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to reason: End-to-end module networks for visual question answering. In Proceedings of the IEEE International Conference on Computer Vision, pp. 804–813, 2017.
287
+
288
+ Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Advances in neural information processing systems, pp. 8571–8580, 2018.
289
+
290
+ Michael Janner, Sergey Levine, William T. Freeman, Joshua B. Tenenbaum, Chelsea Finn, and Jiajun Wu. Reasoning about physical interactions with object-centric models. In International Conference on Learning Representations, 2019.
291
+
292
+ Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2901–2910, 2017a.
293
+
294
+ Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Judy Hoffman, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Inferring and executing programs for visual reasoning. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2989–2998, 2017b.
295
+
296
+ Richard M Karp. Reducibility among combinatorial problems. In Complexity of computer computations, pp. 85–103. Springer, 1972.
297
+
298
+ Andrei N Kolmogorov. On tables of random numbers. Theoretical Computer Science, 207(2): 387–395, 1998.
299
+
300
+ Yuanzhi Li and Yingyu Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. In Advances in Neural Information Processing Systems, pp. 8157–8166, 2018.
301
+
302
+ Jiayuan Mao, Chuang Gan, Pushmeet Kohli, Joshua B. Tenenbaum, and Jiajun Wu. The neurosymbolic concept learner: Interpreting scenes, words, and sentences from natural supervision. In International Conference on Learning Representations, 2019.
303
+
304
+ Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li F Fei-Fei, Josh Tenenbaum, and Daniel L Yamins. Flexible neural representation for physics prediction. In Advances in Neural Information Processing Systems, pp. 8799–8810, 2018.
305
+
306
+ Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. Norm-based capacity control in neural networks. In Conference on Learning Theory, pp. 1376–1401, 2015.
307
+
308
+ Rasmus Palm, Ulrich Paquet, and Ole Winther. Recurrent relational networks. In Advances in Neural Information Processing Systems, pp. 3368–3378, 2018.
309
+
310
+ Jorge Pérez, Javier Marinkovic, and Pablo Barceló. On the turing completeness of modern neural ´ network architectures. In International Conference on Learning Representations, 2019.
311
+
312
+ Alvaro Sanchez-Gonzalez, Nicolas Heess, Jost Tobias Springenberg, Josh Merel, Martin Riedmiller, Raia Hadsell, and Peter Battaglia. Graph networks as learnable physics engines for inference and control. In International Conference on Machine Learning, pp. 4467–4476, 2018.
313
+
314
+ Adam Santoro, David Raposo, David G Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. In Advances in neural information processing systems, pp. 4967–4976, 2017.
315
+
316
+ Adam Santoro, Felix Hill, David Barrett, Ari Morcos, and Timothy Lillicrap. Measuring abstract reasoning in neural networks. In International Conference on Machine Learning, pp. 4477–4486, 2018.
317
+
318
+ David Saxton, Edward Grefenstette, Felix Hill, and Pushmeet Kohli. Analysing mathematical reasoning abilities of neural models. In International Conference on Learning Representations, 2019.
319
+
320
+ Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. Computational capabilities of graph neural networks. IEEE Transactions on Neural Networks, 20 (1):81–102, 2009a.
321
+
322
+ Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009b.
323
+
324
+ Jos Thijssen. Computational physics. Cambridge university press, 2007.
325
+
326
+ Leslie G Valiant. A theory of the learnable. In Proceedings of the sixteenth annual ACM symposium on Theory of computing, pp. 436–445. ACM, 1984.
327
+
328
+ Vladimir Vapnik. The nature of statistical learning theory. Springer science & business media, 2013.
329
+
330
+ Edward Wagstaff, Fabian B Fuchs, Martin Engelcke, Ingmar Posner, and Michael Osborne. On the limitations of representing functions on sets. In International Conference on Machine Learning, 2019.
331
+
332
+ Nicholas Watters, Daniel Zoran, Theophane Weber, Peter Battaglia, Razvan Pascanu, and Andrea Tacchetti. Visual interaction networks: Learning a physics simulator from video. In Advances in neural information processing systems, pp. 4539–4547, 2017.
333
+
334
+ Jason Weston, Antoine Bordes, Sumit Chopra, Alexander M Rush, Bart van Merriënboer, Armand Joulin, and Tomas Mikolov. Towards ai-complete question answering: A set of prerequisite toy tasks. arXiv preprint arXiv:1502.05698, 2015.
335
+
336
+ Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In International Conference on Machine Learning, pp. 5453–5462, 2018.
337
+
338
+ Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019.
339
+
340
+ Kexin Yi, Jiajun Wu, Chuang Gan, Antonio Torralba, Pushmeet Kohli, and Josh Tenenbaum. Neuralsymbolic vqa: Disentangling reasoning from vision and language understanding. In Advances in Neural Information Processing Systems, pp. 1031–1042, 2018.
341
+
342
+ Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, pp. 3391–3401, 2017.
343
+
344
+ Chi Zhang, Feng Gao, Baoxiong Jia, Yixin Zhu, and Song-Chun Zhu. Raven: A dataset for relational and analogical visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5317–5327, 2019.
345
+
346
+ # A PROOF OF PROPOSITION 3.1
347
+
348
+ We will prove the universal approximation of GNNs by showing that GNNs have at least the same expressive power as Deep Sets, and then apply the universal approximation of Deep Sets for permutation invariant continuous functions.
349
+
350
+ Zaheer et al. (2017) prove the universal approximation of Deep Sets under the restriction that the set size is fixed and the hidden dimension is equal to the set size plus one. Wagstaff et al. (2019) extend the universal approximation result for Deep Sets by showing that the set size does not have to be fixed and the hidden dimension is only required to be at least as large as the set size. The results for our purposes can be summarized as follows.
351
+
352
+ Universal approximation of Deep Sets. Assume the elements are from a compact set in $\mathbb { R } ^ { d }$ . Any continuous function on a set $S$ of size bounded by $N$ , i.e., $f : \mathbb { R } ^ { d \times N } \mathbb { R }$ , that is permutation invariant to the elements in $S$ can be approximated arbitrarily close by some Deep Sets model with sufficiently large width and output dimension for its MLPs.
353
+
354
+ Next we show any Deep Sets can be expressed by some GNN with one message passing iteration.
355
+ The computation structure of one-layer GNNs is shown below.
356
+
357
+ $$
358
+ h _ { s } = \sum _ { t \in S } \phi \left( X _ { s } , X _ { t } \right) , \quad h _ { S } = g \left( \sum _ { s \in S } h _ { s } \right) ,
359
+ $$
360
+
361
+ where $\phi$ and $g$ are parameterized by MLPs. If $\phi$ is a function that ignores $X _ { t }$ so that $\phi \left( X _ { s } , X _ { t } \right) =$ $\rho ( X _ { s } )$ for some $\rho$ , e.g., by letting part of the weight matricies in $\phi$ be $0$ , then we essentially get a Deep Sets in the following form.
362
+
363
+ $$
364
+ h _ { s } = \rho \left( X _ { s } \right) , \quad h _ { S } = g \left( \sum _ { s \in S } h _ { s } \right) .
365
+ $$
366
+
367
+ For any such $\rho$ , we can get the corresponding $\phi$ via the construction above. Hence for any Deep Sets, we can express it with an one-layer GNN. The same result applies to GNNs with multiple layers (message passing iterations), because we can express a function $\rho ( X _ { s } )$ by the composition of multiple $\rho ^ { ( k ) }$ ’s, which we can express with a GNN layer via our construction above. It then follows that GNNs are universal approximators for permutation invariant continuous functions.
368
+
369
+ # B PROOF OF PROPOSITION 3.2
370
+
371
+ For any GNN $\mathcal { N }$ , we construct an MLP that is able to do the exact same computation as $\mathcal { N }$ . It will then follow that the MLP can represent any function $\mathcal { N }$ can represent. Suppose the computation structure of $\mathcal { N }$ is the following.
372
+
373
+ $$
374
+ h _ { s } ^ { ( k ) } = \sum _ { t \in S } f ^ { ( k ) } \left( h _ { s } ^ { ( k - 1 ) } , h _ { t } ^ { ( k - 1 ) } \right) , \quad h _ { S } = g \left( \sum _ { s \in S } h _ { s } ^ { ( K ) } \right) ,
375
+ $$
376
+
377
+ where $f$ and $g$ are parameterized by MLPs. Suppose the set size is bounded by $M$ (the expressive power of GNNs also depend on $M$ Wagstaff et al. (2019)). We first show the result for a fixed size input, i.e., MLPs can simulate GNNs if the input set has a fixed size, and then apply an ensemble approach to deal with variable sized input.
378
+
379
+ Let the input to the MLP be a vector concatenated by $h _ { s } ^ { ( 0 ) }$ ’s, in some arbitrary ordering. For each message passing iteration of $\mathcal { N }$ , any $f ^ { ( k ) }$ can be represented by an MLP. Thus, for each pair of $( h _ { t } ^ { ( k - 1 ) } , \bar { h _ { s } ^ { ( k - 1 ) } } )$ , we can set weights in the MLP so that the the concatenation of all $f ( h _ { t } ^ { ( k - 1 ) } , h _ { s } ^ { ( k - 1 ) } )$ become the hidden vector after some layers of the MLP. With the vector of $f ( h _ { t } ^ { ( k - 1 ) } , h _ { s } ^ { ( k - 1 ) } )$ as input, in the next few layers of the MLP we can construct weights so that we have the concatenation of $\begin{array} { r } { \boldsymbol { h } _ { s } ^ { ( k ) } = \sum _ { t \in S } \boldsymbol { f } ^ { ( k ) } \left( \boldsymbol { h } _ { s } ^ { ( k - 1 ) } , \boldsymbol { h } _ { t } ^ { ( k - 1 ) } \right) } \end{array}$ as the result of the hidden dimension, because we can encode summation with weights in MLPs. So far, we can simulate an iteration of GNN $\mathcal { N }$ with layers of MLP. We can repeat the process for $K$ times by stacking the similar layers. Finally, with a concatenation of $h _ { s } ^ { ( K ) }$ as our hidden dimension in the MLP, similarly, we can simulate $\begin{array} { r } { h _ { S } = g \left( \sum _ { s \in S } h _ { s } ^ { ( K ) } \right) } \end{array}$ with layers of MLP. Stacking all layers together, we have obtained an MLP that can simulate $\mathcal { N }$ .
380
+
381
+ To deal with variable sized inputs, we construct $M$ MLPs that can simulate the GNN for each input set size $1 , . . . , M$ . Then we construct a meta-layer, whose weights represent (universally approximate) the summation of the output of $M$ MLPs multiplied by an indicator function of whether each MLPs has the same size as the set input (these need to be input information). The meta layer weights on top can then essentially select the output from of MLP that has the same size as the set input and then exactly simulate the GNN. Note that the MLP we construct here has the requirement for how we input the data and the information of set sizes etc. In practice, we can have $M$ MLPs and decide which MLP to use depending on the input set size.
382
+
383
+ # C PROOF OF THEOREM 3.5
384
+
385
+ Theorem 3.5 is a generalization of Theorem 6.1 in (Arora et al., 2019a), which addresses the scalar case. See (Arora et al., 2019a) for a complete list of assumptions.
386
+
387
+ Theorem C.1. (Arora et al., 2019a) Suppose we have $\begin{array} { r } { \boldsymbol { g } : \mathbb { R } ^ { d } \mathbb { R } , \boldsymbol { g } ( \boldsymbol { x } ) = \sum _ { j } \alpha _ { j } ( \beta _ { j } ^ { \top } \boldsymbol { x } ) ^ { p _ { j } } } \end{array}$ , where $\beta _ { j } \in \mathbb { R } ^ { d }$ , $\alpha \in \mathbb { R }$ , and $p _ { j } = 1$ or $p _ { j } = 2 l$ $\mathopen { } \mathclose \bgroup \left( l \in \mathbb { N } _ { + } \aftergroup \egroup \right)$ . Let $\mathcal { A }$ be an overparameterized two-layer MLP that is randomly initialized and trained with gradient descent for a sufficient number of iterations. The sample complexity CA(g, , δ) is O Pj pj |αj |·kβj kpj2 +log(1/δ)2 .
388
+
389
+ To extend the sample complexity bound to vector-valued functions, we view each entry/component of the output vector as an independent scalar-valued output. We can then apply a union bound to bound the error rate and failure probability for the output vector, and thus, bound the overall sample complexity.
390
+
391
+ Let $\epsilon$ and $\delta$ be the given error rate and failure probability. Moreover, suppose we choose some error rate $\epsilon _ { \mathrm { 0 } }$ and failure probability $\delta _ { 0 }$ for the output/function of each entry. Applying Theorem C.1 to each component
392
+
393
+ $$
394
+ g ( x ) ^ { ( i ) } = \sum _ { j } \alpha _ { j } ^ { ( i ) } \left( \beta _ { j } ^ { ( i ) \top } x \right) ^ { p _ { j } ^ { ( i ) } } = : g _ { i } ( x )
395
+ $$
396
+
397
+ yields a sample complexity bound of
398
+
399
+ $$
400
+ \mathcal { C } _ { A } ( g _ { i } , \epsilon _ { 0 } , \delta _ { 0 } ) = O \left( \frac { \sum _ { j } p _ { j } ^ { ( i ) } | \alpha _ { j } ^ { ( i ) } | \cdot \| \beta _ { j } ^ { ( i ) } \| _ { 2 } ^ { p _ { j } ^ { ( i ) } } + \log { ( 1 / \delta _ { 0 } ) } } { \epsilon _ { 0 } ^ { 2 } } \right)
401
+ $$
402
+
403
+ for each $g _ { i } ( x )$ . Now let us bound the overall error rate and failure probability given $\epsilon _ { \mathrm { 0 } }$ and $\delta _ { 0 }$ for each entry. The probability that we fail to learn each of the $g _ { i }$ is at most $\delta _ { 0 }$ . Hence, by a union bound, the probability that we fail to learn any of the $g _ { i }$ is at most $m \cdot \delta _ { 0 }$ . Thus, with probability at least $1 - m \delta _ { 0 }$ , we successfully learn all $g _ { i }$ for $i = 1 , . . . , m$ , so the error for every entry is bounded by $\epsilon _ { \mathrm { 0 } }$ . The error for the vector output is then at most $\Sigma _ { i = 1 } ^ { m } \epsilon _ { 0 } = m \epsilon _ { 0 }$ .
404
+
405
+ Setting $m \delta _ { 0 } = \delta$ and $m \epsilon _ { 0 } = \epsilon$ gives us $\begin{array} { r } { \delta _ { 0 } = \frac { \delta } { m } } \end{array}$ and $\epsilon _ { 0 } = \frac { \epsilon } { m }$ . Thus, if we can successfully learn the function for each output entry independently with error $\epsilon / m$ and failure rate $\delta / m$ , we can successfully learn the entire vector-valued function with rate $\epsilon$ and $\delta$ . This yields the following overall sample complexity bound:
406
+
407
+ $$
408
+ \mathcal { C } _ { A } ( g , \epsilon , \delta ) = O \left( \frac { \operatorname* { m a x } _ { i } \sum _ { j } p _ { j } ^ { ( i ) } | \alpha _ { j } ^ { ( i ) } | \cdot \| \beta _ { j } ^ { ( i ) } \| _ { 2 } ^ { p _ { j } ^ { ( i ) } } + \log { ( m / \delta ) } } { { ( \epsilon / m ) } ^ { 2 } } \right)
409
+ $$
410
+
411
+ Regarding $m$ as a constant, we can further simplify the sample complexity to
412
+
413
+ $$
414
+ \mathcal { C } _ { A } ( g , \epsilon , \delta ) = O \left( \frac { \operatorname* { m a x } _ { i } \sum _ { j } p _ { j } ^ { ( i ) } | \alpha _ { j } ^ { ( i ) } | \cdot \| \beta _ { j } ^ { ( i ) } \| _ { 2 } ^ { p _ { j } ^ { ( i ) } } + \log { ( 1 / \delta ) } } { \epsilon ^ { 2 } } \right) .
415
+ $$
416
+
417
+ # D PROOF OF THEOREM 3.6
418
+
419
+ We will show the learnability result by an inductive argument. Specifically, we will show that under our setting and assumptions, the error between the learned function and correct function on the test set will not blow up after the transform of another learned function $\hat { f } _ { j }$ , assuming learnability on previous $\hat { f } _ { 1 } , . . . , \hat { f } _ { j - 1 }$ by induction. Thus, we can essentially provably learn at all layers/iterations and eventually learn $g$ .
420
+
421
+ Suppose we have performed the sequential learning. Let us consider what happens at the test time. Let $f _ { j }$ be the correct functions as defined in the algorithmic alignment. Let $\hat { f } _ { j }$ be the functions learned by algorithm $A _ { j }$ and MLP ${ \mathcal { N } } _ { j }$ . We have input $S \sim \mathcal { D }$ , and our goal is to bound $\| g ( S ) - \hat { g } ( S ) \|$ with high probability. To show this, we bound the error of the intermediate representation vectors, i.e., the output of $\hat { f } _ { j }$ and $f _ { j }$ , and thus, the input to $\hat { f } _ { j + 1 }$ and $f _ { j + 1 }$ .
422
+
423
+ Let us first consider what happens for the first module $\mathcal { N } _ { 1 }$ . $f _ { 1 }$ and $\hat { f } _ { 1 }$ have the same input distribution $x \sim \mathcal { D }$ , where $x$ are obtained from $S$ , e.g., the pairwise object representations as in Eqn. 2.2. Hence, by the learnability assumption on $\mathcal { A } _ { 1 }$ , $\| f _ { 1 } ( x ) - \hat { f } _ { 1 } ( x ) \| < \epsilon$ with probability at least $1 - \delta$ . The error for the input of $\mathcal { N } _ { 2 }$ is then $O ( \epsilon )$ with failure probability $O ( \delta )$ , because there are a constant number of terms of aggregation of $f _ { 1 }$ ’s output, and we can apply union bound to upper bound the failure probability.
424
+
425
+ Next, we proceed by induction. Let us fix a $k$ . Let $z$ denote the input for $f _ { k }$ , which are generated by the previous $f _ { j }$ ’s, and let $\hat { z }$ denote the input for $\hat { f } _ { k }$ , which are generated by the previous $\hat { f } _ { j }$ ’s. Assume $\lVert z - \hat { z } \rVert \leq O ( \epsilon )$ with failure probability at most $O ( \delta )$ . We aim to show that this holds for $k + 1$ . For the simplicity of notation, let $f$ denote the correct function $f _ { k }$ and let $\hat { f }$ denote the learned function $\hat { f } _ { k }$ . Since there are a constant number of terms for aggregation, our goal is then to bound $\| \hat { f } ( \hat { z } ) - f ( z ) \|$ . By triangle inequality, we have
426
+
427
+ $$
428
+ \begin{array} { r l } & { \| \hat { f } ( \hat { z } ) - f ( z ) \| = \| \hat { f } ( \hat { z } ) - \hat { f } ( z ) + \hat { f } ( z ) - f ( z ) \| } \\ & { \qquad \le \| \hat { f } ( \hat { z } ) - \hat { f } ( z ) \| + \| \hat { f } ( z ) - f ( z ) \| } \end{array}
429
+ $$
430
+
431
+ We can bound the first term with the Lipschitzness assumption of $\hat { f }$ as the following.
432
+
433
+ $$
434
+ \| \hat { f } ( \hat { z } ) - \hat { f } ( z ) \| \leq L _ { 1 } \| \hat { z } - z \|
435
+ $$
436
+
437
+ To bound the second term, our key insight is that $f$ is a learnale correct function, so by the learnability coefficients in algorithmic alignment, it is close to the function $\tilde { f }$ learned by the learning algorithm $\mathcal { A }$ on the correct samples, i.e., $f$ is close to $\tilde { f } = \mathcal { A } \left( \{ z _ { i } , y _ { i } \} \right)$ . Moreover, $\hat { f }$ is generated by the learning algorithm $\mathcal { A }$ on the perturbed samples, i.e., $\hat { f } = \mathcal { A } \left( \left\{ \hat { z } _ { i } , y _ { i } \right\} \right)$ . By the algorithm stability assumption, $\hat { f }$ and $\tilde { f }$ should be close if the input samples are only slightly perturbed. It then follows that
438
+
439
+ $$
440
+ \begin{array} { r l } & { \| \hat { f } ( z ) - f ( z ) \| = \| \hat { f } ( z ) - \tilde { f } ( z ) + \tilde { f } ( z ) - f ( z ) \| } \\ & { \qquad \leq \| \hat { f } ( z ) - \tilde { f } ( z ) \| + \| \tilde { f } ( z ) - f ( z ) \| } \\ & { \qquad \leq L _ { 0 } \operatorname* { m a x } _ { i } \| z _ { i } - \hat { z } _ { i } \| + \epsilon \quad \mathrm { w . p . ~ } \geq 1 - \delta } \end{array}
441
+ $$
442
+
443
+ where $z _ { i }$ and $\hat { z } _ { i }$ are the training samples at the same layer $k$ . Here, we apply the same induction condition as what we had for $z$ and $\hat { z }$ : $\| z _ { i } - \hat { z } _ { i } \| \leq O ( \epsilon )$ with failure probability at most $O ( \delta )$ . We can then apply union bound to bound the probability of any bad event happening. Here, we have 3 bad events each happening with probability at most $\overset { \cdot } { O } ( \delta )$ . Thus, with probability at least $1 - O ( \delta )$ , we have
444
+
445
+ $$
446
+ \| \hat { f } ( \hat { z } ) - f ( z ) \| \le L _ { 1 } O ( \epsilon ) + L _ { 0 } O ( \epsilon ) + \epsilon = O ( \epsilon )
447
+ $$
448
+
449
+ This completes the proof.
450
+
451
+ # E PROOF OF COROLLARY 3.7
452
+
453
+ Our main insight is that a giant MLP learns the same function $( X _ { i } - X _ { j } ) ^ { 2 }$ for $\ell ^ { 2 }$ times and encode them in the weights. This leads to the $O ( \ell ^ { 2 } )$ extra sample complexity through Theorem 3.5, because the number of polynomial terms $( X _ { i } - X _ { j } ) ^ { 2 }$ is of order $\ell ^ { 2 }$ .
454
+
455
+ First of all, the function $f ( x , y ) = ( x - y ) ^ { 2 }$ can be expressed as the following polynomial.
456
+
457
+ $$
458
+ ( x - y ) ^ { 2 } = \left( { \left[ 1 \ - 1 \right] } ^ { \top } { \left[ x \ y \right] } \right) ^ { 2 }
459
+ $$
460
+
461
+ We have β = [1 − 1], so p · kβkp = 4. Hence, by Theorem 3.5, it takes O( log(1/δ)2 ) s amples for an MLP to learn $f ( x , y ) = ( x - y ) ^ { 2 }$ . Under the sequential training setting, an one-layer GNN applies an MLP to learn $f$ , and then sums up the outcome of $f ( X _ { i } , X _ { j } )$ for all pairs $X _ { i } , X _ { j }$ . Here, we essentially get the aggregation error $O ( \ell ^ { 2 } \cdot \epsilon )$ from $\ell ^ { 2 }$ pairs. However, we will see that applying an MLP to learn $g$ will also incur the same aggregation error. Hence, we do not need to consider the aggregation error effect when we compare the sample complexities.
462
+
463
+ Now we consider using MLP to learn the function $g$ . No matter in what order the objects $X _ { i }$ are concatenated, we can express $g$ with the sum of polynomials as the following.
464
+
465
+ $$
466
+ g ( S ) = \sum _ { i j } ( \beta _ { i j } ^ { \top } [ X _ { 1 } , . . . , X _ { n } ] ) ^ { 2 } ,
467
+ $$
468
+
469
+ where $\beta _ { i j }$ has 1 at the $i$ -th entry, $- 1$ at the $j$ -th entry and 0 elsewhere. Hence $\| \beta _ { i j } \| ^ { p } \cdot p = 4$ . It then follows from Theorem 3.5 and union bound that it takes $O ( ( \ell ^ { 2 } + \log ( 1 / \hat { \delta } ) ) / \hat { \epsilon } ^ { 2 } )$ to learn $g$ , where $\hat { \epsilon } = \ell ^ { 2 } \epsilon$ and $\hat { \delta } = \ell ^ { 2 } \delta$ . Here, as we have discussed above, the same aggregation error $\hat { \epsilon }$ occurs in the aggregation process of $f$ , so we can simply consider $\hat { \epsilon }$ for both. Thus, comparing $O ( \log ( 1 / \hat { \delta } ) / \hat { \epsilon } ^ { 2 } )$ and $O ( ( \ell ^ { 2 } + \log ( 1 / \hat { \delta } ) ) / \hat { \epsilon } ^ { 2 } )$ gives us the $O ( \ell ^ { 2 } )$ difference.
470
+
471
+ # F PROOF OF CLAIM 4.1
472
+
473
+ We prove the claim by contradiction. Suppose there exists $f$ such that $f ( x ) + f ( y ) = g ( x , y )$ for any $x$ and $y$ . This implies that for any $x$ , we have $f ( x ) + f ( x ) = g ( x , x ) = 0$ . It follows that $f ( x ) = 0$ for any $x$ . Now consider some $x$ and $y$ so that $x \neq y$ . We must have $f ( x ) + f ( y ) = 0 + 0 = 0$ . However, $g ( x , y ) \neq 0$ because $x \neq y$ . Hence, there exists $x$ and $y$ so that $f ( x ) + f ( y ) \neq g ( x , y )$ . We have reached a contradiction.
474
+
475
+ # G EXPERIMENTS: DATA AND TRAINING DETAILS
476
+
477
+ # G.1 FANTASTIC TREASURE: MAXIMUM VALUE DIFFERENCE
478
+
479
+ Dataset generation. In the dataset, we sample 50, 000 training data, 5, 000 validation data, and 5, 000 test data. For each model, we report the test accuracy with the hyperparameter setting that achieves the best validation accuracy. In each training sample, the input universe consists of 25 treasures $X _ { 1 } , . . . , X _ { 2 5 }$ . For each treasure $X _ { i }$ , we have $\mathbf { \bar { \it X } } _ { i } = \mathbf { \bar { \Psi } } [ h _ { 1 } , h _ { 2 } , h _ { 3 } ]$ , where the location $h _ { 1 }$ is sampled uniformly from $[ 0 . . 2 0 ] ^ { 8 }$ , the value $h _ { 2 }$ is sample uniformly form [0..100], and the color $h _ { 3 }$ is sampled uniformly from [1..6]. The task is to answer what the difference is in value between the most and least valuable treasure. We generate the answer label $y$ for a universe $S$ as follows: we find the the maximum difference in value among all treasures and set it to $y$ . Then we make the label $y$ into one-hot encoding with $1 0 0 + 1 = 1 0 1$ classes.
480
+
481
+ Hyperparameter setting. We train all models with the Adam optimizer, with learning rate from $1 e - 3 , 5 e - 4$ , and $1 e - 4$ , and we decay the learning rate by 0.5 every 50 steps. We use cross-entropy loss. We train all models for 150 epochs. We tune batch size of 128 and 64.
482
+
483
+ For GNNs and HRN, we choose the hidden dimension of MLP modules from 128 and 256. For DeepSet and MLP, we choose the hidden dimension of MLP modules from 128, 256, 2500, 5000. For the MLP and DeepSet model, we choose the number of of hidden layers for MLP moduels from 4 and 8, 16. For GNN and HRN, we set the number of hidden layers of the MLP modules to 3, 4. Moreover, dropout with rate 0.5 is applied before the last two hidden layers of ${ \bf M L P } _ { 1 }$ , i.e., the last MLP module in all models.
484
+
485
+ # G.2 FANTASTIC TREASURE: FURTHEST PAIR
486
+
487
+ Dataset generation. In the dataset, we sample 60, 000 training data, 6, 000 validation data, and 6, 000 test data. For each model, we report the test accuracy with the hyperparameter setting that achieves the best validation accuracy. In each training sample, the input universe consists of 25 treasures $X _ { 1 } , . . . , X _ { 2 5 }$ . For each treasure $X _ { i }$ , we have $X _ { i } = [ h _ { 1 } , h _ { 2 } , h _ { 3 } ]$ , where the location $h _ { 1 }$ is sampled uniformly from $[ 0 . . 2 0 ] ^ { 8 }$ , the value $h _ { 2 }$ is sample uniformly form [0..100], and the color $h _ { 3 }$ is sampled uniformly from [1..6]. The task is to answer what are the colors of the two treasure that are the most distant from each other. We generate the answer label $y$ for a universe $S$ as follows: we find the pair of treasures that are the most distant from each other, say $( X _ { i } , X _ { j } )$ . Then we order the pair $( h _ { 3 } ( X _ { i } ) , h _ { 3 } ( X _ { j } ) )$ to obtain an ordered pair $( a , b )$ with $a \leq b$ (aka. $a = \grave { \operatorname* { m i n } } \{ h _ { 3 } ( X _ { i } ) , h _ { 3 } ( X _ { j } ) \}$ and $( b = \operatorname* { m a x } \{ h _ { 3 } ( \operatorname { \bar { X } } _ { i } ) , h _ { 3 } ( X _ { j } ) \} )$ , where $h _ { 3 } ( X _ { i } )$ denotes the color of $X _ { i }$ . Then we compute the label $y$ from $( a , b )$ by counting how many valid pairs of colors are smaller than $( a , b )$ (a pair $( k , l )$ is smaller than $( a , b )$ iff i). $k < a$ or ii). $k = a$ and $l < b$ ). The label $y$ is one-hot encoding of the minimum cost with $6 \times ( 6 - 1 ) / 2 + 6 = 2 1$ classes.
488
+
489
+ Hyperparameter setting. We train all models with the Adam optimizer, with learning rate from $1 e - 3 , 5 e - 4$ , and $1 e - 4$ , and we decay the learning rate by 0.5 every 50 steps. We use cross-entropy loss. We train all models for 150 epochs. We tune batch size of 128 and 64.
490
+
491
+ For the MLP and DeepSet model, we choose the number of of hidden layers of MLP modules from 4 and 8, 16. For GNN and HRN models, we set the number of hidden layers of the MLP modules from 3 and 4. For DeepSet and MLP models, we choose the hidden dimension of MLP modules from 128, 256, 2500, 5000. For GNNs and HRN, we choose the hidden dimension of MLP modules from 128 and 256. Moreover, dropout with rate 0.5 is applied before the last two hidden layers of ${ \bf M L P } _ { 1 }$ , i.e., the last MLP module in all models.
492
+
493
+ # G.3 MONSTER TRAINER
494
+
495
+ Task description. We are a monster trainer who lives in a world $S$ with 10 monsters. Each monster $X = [ h _ { 1 } , h _ { 2 } ]$ has a location $h _ { 1 } \in [ 0 . . 1 0 ] ^ { 2 }$ and a unique combat level $h _ { 2 } \in [ 1 . . 1 0 ]$ . In each game, the trainer starts at a random location with level zero, $X _ { \mathrm { t r a i n e r } } = [ p _ { 0 } , 0 ]$ , and receives a quest to defeat the level- $k$ monster. At each time step, the trainer can challenge any more powerful monster $X$ , with a cost equal to the product of the travel distance and the level difference $c ( X _ { \mathrm { t r a i n e r } } , X ) =$ $\| h _ { 1 } ( X _ { \mathrm { t r a i n e r } } ) - h _ { 1 } ( X ) \| _ { \ell _ { 1 } } \times { \bar { ( } } h _ { 2 } ( X ) - h _ { 2 } ( X _ { \mathrm { t r a i n e r } } ) )$ . After defeating monster $X$ , the trainer’s level upgrades to $h _ { 2 } ( X )$ , and the trainer moves to $h _ { 1 } ( X )$ . We ask the minimum cost of completing the quest, i.e., defeating the level- $k$ monster. The range of cost (number of classes for prediction) is 200. To make games even more challenging, we sample games whose optimal solution involves defeating three to seven non-quest monsters.
496
+
497
+ A DP algorithm for shortest paths that needs half of the iterations of Bellman-Ford. We provide a DP algorithm as the following. To compute a shortest-path from a source object $s$ to a target object $t$ with at most seven stops, we run the following updates for four iterations:
498
+
499
+ $$
500
+ \operatorname { a n c e } _ { s } [ 1 ] [ u ] = \cot ( s , u ) , \qquad \operatorname { d i s t a n c e } _ { s } [ k ] [ u ] = \operatorname* { m i n } _ { v } \big \{ \operatorname { d i s t a n c e } _ { s } [ k - 1 ] [ v ] + \operatorname { c o s t } ( v , u ) \big \} ,
501
+ $$
502
+
503
+ $$
504
+ \mathrm { d i s t a n c e } _ { t } [ 1 ] [ u ] = \mathrm { c o s t } ( u , t ) , \qquad \mathrm { d i s t a n c e } _ { t } [ k ] [ u ] = \operatorname* { m i n } _ { v } \big \{ \mathrm { d i s t a n c e } _ { t } [ k - 1 ] [ v ] + \mathrm { c o s t } ( u , v ) \big \} .
505
+ $$
506
+
507
+ Update Eqn. G.1 is identical to the Bellman-Ford algorithm Eqn. 4.2, and distance $s [ k ] [ u ]$ is the shortest distance from $s$ to $u$ with at most $k$ stops. Update Eqn. G.2 is a reverse Bellman-Ford algorithm, and distance $_ t [ k ] [ u ]$ is the shortest distance from $u$ to $t$ with at most $k$ stops. After running Eqn. G.1 and Eqn. G.2 for $k$ iterations, we can compute a shortest path with at most $2 k$ stops by enumerating a mid-point and aggregating the results of the two Bellman-Ford algorithms:
508
+
509
+ $$
510
+ \begin{array} { r } { \operatorname* { m i n } _ { u } \left\{ \mathrm { d i s t a n c e } _ { s } [ k ] [ u ] + \mathrm { d i s t a n c e } _ { t } [ k ] [ u ] \right\} . } \end{array}
511
+ $$
512
+
513
+ Thus, this algorithm needs half of the iterations of Bellman-Ford.
514
+
515
+ Dataset generation. In the dataset, we sample 200, 000 training data, 6, 000 validation data, and $6 , 0 0 0$ test data. For each model, we report the test accuracy with the hyperparameter setting that achieves the best validation accuracy. In each training sample, the input universe consists of the trainer and 10 monsters $X _ { 0 } , . . . , X _ { 1 0 }$ , and the request level $k$ , i.e., we need to challenge monster $k$ . We have $X _ { i } = [ h _ { 1 } , h _ { 2 } ]$ , where $h _ { 1 } = i$ indicates the combat level, and the location $\bar { h _ { 2 } } \in [ 0 . . 1 0 ] ^ { 2 }$ is sampled uniformly from $[ 0 . . 1 0 ] ^ { 2 }$ . We generate the answer label $y$ for a universe $S$ as follows. We implement a shortest path algorithm to compute the minimum cost from the trainer to monster $k$ , where the cost is defined in task description. Then the label $y$ is a one-hot encoding of minimum cost with 200 classes. Moreover, when we sample the data, we apply rejection sampling to ensure that the minimum cost’s shortest path is of length $3 , 4 , 5 , 6 , 7$ with equal probability. That is, we eliminate the trivial questions.
516
+
517
+ Hyperparameter setting. We train all models with the Adam optimizer, with learning rate from $2 e - 4$ and $5 e - 4$ , and we decay the learning rate by 0.5 every 50 steps. We use cross-entropy loss. We train all models for 300 epochs. We tune batch size of 128 and 64.
518
+
519
+ For the MLP model, we choose the number of layers from 4 and 8, 16. For other models, we choose the number of hidden layers of MLP modules from 3 and 4. For GNN models, we choose the hidden dimension of MLP modules from 128 and 256. For DeepSet and MLP models, we choose the hidden dimension of MLP modules from 128, 256, 2500. Moreover, dropout with rate 0.5 is applied before the last two hidden layers of ${ \bf M L P } _ { 1 }$ , i.e., the last MLP module in all models.
520
+
521
+ # G.4 SUBSET SUM
522
+
523
+ Dataset generation. In the dataset, we sample 40, 000 training data, 4, 000 validation data, and 4, 000 test data. For each model, we report the test accuracy with the hyperparameter setting that achieves the best validation accuracy. In each training sample, the input universe $S$ consists of 6 numbers $X _ { 1 } , . . . , X _ { 6 }$ , where each $X _ { i }$ is uniformly sampled from [-200..200]. The goal is to decide if there exists a subset that sums up to 0. In the data generation, we carefully decrease the number of questions that have trivial answers: 1)we control the number of samples where $0 \in \{ X _ { 1 } , . . . , X _ { 6 } \}$ to be around $1 \%$ of the total training data; 2) we further control the number of samples where $X _ { 1 } + \ldots + X _ { 6 } = 0$ or $\exists i , j \in [ 1 . . 6 ]$ so that $X _ { i } = - X _ { j }$ to be around $1 . 5 \%$ of the total training data. In addition, we apply rejection sampling to make sure that the questions with answer yes (aka. such subset exists) and answer no (aka. no such subset exists) are balanced (i.e., 20,000 samples for each class in the training data).
524
+
525
+ Hyperparameter setting. We train all models with the Adam optimizer, with learning rate from $1 e - 3 , 5 e - 4$ , and $1 e - 4$ , and we decay the learning rate by 0.5 every 50 steps. We use cross-entropy loss. We train all models for 300 epochs. The batch size we use for all models is 64.
526
+
527
+ For DeepSets and MLP models, we choose the number of of hidden layers of the MLP modules from 4, 8, 16. For GNN and HRN models, we set the number of hidden layers of the last MLP modules to 4. For DeepSets and MLP, we choose the hidden dimension of MLP modules from 128, 256, 2500, 5000. For GNN and HRN models, we choose the hidden dimension of MLP modules from 128 and 256. Moreover, dropout with rate 0.5 is applied before the last two hidden layers of ${ \bf M L P } _ { 1 }$ , i.e., the last MLP module in all models.
528
+
529
+ The model Neural Exhaustive Search (NES) enumerates all possible non-empty subsets $\tau$ of $S$ , and passes the numbers of $\tau$ to an MLP, in a random order, to obtain the hidden feature. The hidden feature is then passed to a single-direction one-layer LSTM of hidden dimension 128. Afterwards, NES applies an aggregation function to these $2 ^ { 6 } - 1$ hidden states obtained by the LSTM to obtain the final output. For NES, we set the number of hidden layers of the last MLP, i.e., ${ \mathrm { { M L P } _ { 2 } } }$ , to 4, the number of hidden layers of the MLPs prior to the last MLP, i.e., ${ \bf M L P } _ { 1 }$ , to 3, and we choose the hidden dimension of all MLP modules from 128 and 256.
parse/train/rJxbJeHFPS/rJxbJeHFPS_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJxbJeHFPS/rJxbJeHFPS_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rJxbJeHFPS/rJxbJeHFPS_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rygvFyrKwH/rygvFyrKwH.md ADDED
@@ -0,0 +1,456 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ADVERSARIAL ROBUSTNESS AS A PRIOR FOR LEARNED REPRESENTATIONS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ An important goal in deep learning is to learn versatile, high-level feature representations of input data. However, standard networks’ representations seem to possess shortcomings that, as we illustrate, prevent them from fully realizing this goal. In this work, we show that robust optimization can be re-cast as a tool for enforcing priors on the features learned by deep neural networks. It turns out that representations learned by robust models address the aforementioned shortcomings and make significant progress towards learning a high-level encoding of inputs. In particular, these representations are approximately invertible, while allowing for direct visualization and manipulation of salient input features. More broadly, our results indicate adversarial robustness as a promising avenue for improving learned representations. 1
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Beyond achieving remarkably high accuracy on a variety of tasks (Krizhevsky et al., 2012; He et al., 2015; Collobert & Weston, 2008), a major appeal of deep learning is the ability to learn effective feature representations of data. Specifically, deep neural networks can be thought of as linear classifiers acting on learned feature representations (also known as feature embeddings). A major goal in representation learning is for these embeddings to encode high-level, interpretable features of any given input (Goodfellow et al., 2016; Bengio et al., 2013; Bengio, 2019). Indeed, learned representations turn out to be quite versatile—in computer vision, for example, they are the driving force behind transfer learning Girshick et al. (2014); Donahue et al. (2014), and image similarity metrics such as VGG distance Dosovitskiy & Brox (2016a); Johnson et al. (2016); Zhang et al. (2018).
12
+
13
+ These successes and others clearly illustrate the utility of learned feature representations. Still, deep networks and their embeddings exhibit some shortcomings that are at odds with our idealized model of a linear classifier on top of interpretable high-level features. For example, the existence of adversarial examples (Biggio et al., 2013; Szegedy et al., 2014)—and the fact that they may correspond to flipping predictive features Ilyas et al. (2019)—suggests that deep neural networks make predictions based on features that are vastly different from what humans use, or even recognize. (This message has been also corroborated by several recent works (Brendel & Bethge, 2019; Geirhos et al., 2019; Jetley et al., 2018; Zhang & Zhu, 2019).) In fact, we show a more direct example of such a shortcoming (c.f. Section 2), wherein one can construct pairs of images that appear completely different to a human but are nearly identical in terms of their learned feature representations.
14
+
15
+ Our contributions. Motivated by the limitations of standard representations, we propose using the robust optimization framework as a tool to enforce (user-specified) priors on features that models should learn (and thus on their learned feature representations). We demonstrate that the resulting learned “robust representations” (the embeddings learned by adversarially robust neural networks Goodfellow et al. (2015); Madry et al. (2018)) address many of the shortcomings affecting standard learned representations and thereby enable new modes of interaction with inputs via manipulation of salient features. These findings are summarized below (c.f. Figure 1 for an illustration):
16
+
17
+ ![](images/581aba13baf930787ad18a164c4b4aa0f3bc7d98e95e689e626726480235a4e6.jpg)
18
+ Figure 1: Sample images highlighting the properties and applications of “robust representations” studied in this work. All of these manipulations use only gradient descent on simple, unregularized, direct functions of the representations of adversarially robust neural networks Goodfellow et al. (2015); Madry et al. (2018).
19
+
20
+ • Representation inversion (Section 4.1): In stark contrast to standard representations, ro
21
+ bust representations are approximately invertible—that is, they provide a high-level embedding of the input such that images with similar robust representations are semantically similar, and the salient features of an image are easily recoverable from its robust feature
22
+ representation. This property also naturally enables feature interpolation between arbitrary
23
+ inputs.
24
+ Simple feature visualization (Section 4.2): Direct maximization of the coordinates of
25
+ robust representations suffices to visualize easily recognizable features of the model. This is
26
+ again a significant departure from standard models where (a) without explicit regularization
27
+ at visualization time, feature visualization often produces unintelligible results; and (b)
28
+ even with regularization, visualized features in the representation layer are scarcely human
29
+ recognizeable Olah et al. (2017).
30
+ • Feature manipulation (Section 4.2.1): Through the aforementioned direct feature visual
31
+ ization property, robust representations enable the addition of specific features to images through direct first-order optimization.
32
+
33
+ Broadly, our results indicate that robust optimization is a promising avenue for learning representations that are more “aligned” with our notion of perception. Furthermore, our findings highlight the the desirability of adversarial robustness as a goal beyond the standard security and reliability context.
34
+
35
+ # 2 LIMITATIONS OF STANDARD REPRESENTATIONS
36
+
37
+ Following standard convention, for a given deep network we define the representation $R ( x ) \in \mathbb { R } ^ { k }$ of a given input $x \in \mathbb { R } ^ { d }$ as the activations of the penultimate layer of the network (where usually $k \ll d ,$ ). The prediction of the network can thus be viewed as the output of a linear classifier on the representation $R ( x )$ . We refer to the distance in representation space between two inputs $( x _ { 1 } , x _ { 2 } )$ as the $\ell _ { 2 }$ distance between their representations $( R ( x _ { 1 } ) , R ( x _ { 2 } ) )$ , i.e., $\| R ( x _ { 1 } ) - R ( x _ { 2 } ) \| _ { 2 }$ .
38
+
39
+ A common aspiration in representation learning is to have that for any pixel-space input $x$ , $R ( x )$ is a vector encoding a set of “human-meaningful” features of $x$ Bengio (2019); Goodfellow et al. (2016); Bengio et al. (2013). These high-level features would be linearly separable with respect to the classification task, allowing the classifier to attain high accuracy.
40
+
41
+ Running somewhat counter to this intuition, however, we find that it is straightforward to construct pairs of images with nearly identical representations yet drastically different content, as shown in
42
+
43
+ Figure 2. Finding such pairs turns out to be as simple as sampling two images $x _ { 1 } , x _ { 2 } \sim \mathcal { D }$ , then optimizing one of them to minimize distance in representation space to the other:
44
+
45
+ $$
46
+ x _ { 1 } ^ { \prime } = x _ { 1 } + \arg \operatorname* { m i n } _ { \delta } \| R ( x _ { 1 } + \delta ) - R ( x _ { 2 } ) \| _ { 2 } .
47
+ $$
48
+
49
+ Indeed, solving objective (1) yields images that have similar representations, but share no qualitative resemblance (in fact, $x _ { 1 } ^ { \prime }$ tends to look nearly identical to $x _ { 1 }$ ). An example of such a pair is given in Figure 2.
50
+
51
+ Note that if representations truly provided an encoding of any image into high-level features, finding images with similar representations should necessitate finding images with similar high-level features. Thus, the existence of these image pairs (and similar phenomena observed by prior work Jacobsen et al. (2019)) lays bare a misalignment between the notion of distance induced via the features learned by current deep networks, and the notion of distance as perceived by humans.
52
+
53
+ ![](images/c2c8f8f2758d02025b01695f3a9eac6139f75c459cb312af7ce336933907f7de.jpg)
54
+ Figure 2: A limitation of standard neural network representations: it is straightforward to construct pairs of images $( x _ { 1 } ^ { \prime } , x _ { 2 } )$ that appear completely different yet map to similar representations.
55
+
56
+ # 3 ADVERSARIAL ROBUSTNESS AS A PRIOR
57
+
58
+ Our analysis in Section 2 and prior work (Jacobsen et al., 2019) prompt the question:
59
+
60
+ How can we learn better-behaved representations?
61
+
62
+ In this work, we demonstrate that the representations learned by adversarially robust neural networks seem to address many identified limitations of standard representations, and make significant progress towards the broader goal of learning high-level, human-understandable encodings.
63
+
64
+ Adversarially robust deep networks and robust optimization. In standard settings, supervised machine learning models are trained by minimizing the expected loss with respect to a set of parameters $\theta$ , i.e., by solving an optimization problem of the form:
65
+
66
+ $$
67
+ \theta ^ { * } = \operatorname* { m i n } _ { \theta } \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } \left[ \mathcal { L } _ { \theta } ( x , y ) \right] .
68
+ $$
69
+
70
+ We refer to (2) as the standard training objective—finding the optimum of this objective should guarantee high performance on unseen data from the distribution. It turns out, however, that deep neural networks trained with this standard objective are extraordinarily vulnerable to adversarial examples (Biggio et al., 2013; Szegedy et al., 2014)—by changing a natural input imperceptibly, one can easily manipulate the predictions of a deep network to be arbitrarily incorrect.
71
+
72
+ A natural approach (and one of the most successful) for defending against these adversarial examples is to use the robust optimization framework: a classical framework for optimization in the presence of uncertainty (Wald, 1945; Danskin, 1967). In particular, instead of just finding parameters which minimize the expected loss (as in the standard objective), a robust optimization objective also requires that the model induced by the parameters $\theta$ be robust to worst-case perturbation of the input:
73
+
74
+ $$
75
+ \theta ^ { * } = \underset { \theta } { \arg \operatorname* { m i n } } \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } \left[ \underset { \delta \in \Delta } { \operatorname* { m a x } } \mathcal { L } _ { \theta } ( x + \delta , y ) \right] .
76
+ $$
77
+
78
+ This robust objective is in fact common in the context of machine learning security, where $\Delta$ is usually chosen to be a simple convex set, e.g., an $\ell _ { p }$ -ball. Canonical instantiations of robust optimization such as adversarial training (Goodfellow et al., 2015; Madry et al., 2018)) have arisen as practical ways of obtaining networks that are invariant to small $\ell _ { p }$ -bounded changes in the input while maintaining high accuracy (though a small tradeoff between robustness and accuracy has been noted by prior work Tsipras et al. (2019); Su et al. (2018)(also cf. Appendix Tables 4 and 5 for a comparison of accuracies of standard and robust classifiers)).
79
+
80
+ Robust optimization as a feature prior. Traditionally, adversarial robustness in the deep learning setting has been explored as a goal predominantly in the context of ML security and reliability (Biggio & Roli, 2018).
81
+
82
+ In this work, we consider an alternative perspective on adversarial robustness—we cast it as a prior on the features that can be learned by a model. Specifically, models trained with objective (3) must be invariant to a set of perturbations $\Delta$ . Thus, selecting $\Delta$ to be a set of perturbations that humans are robust to (e.g., small $\ell _ { p }$ -norm perturbations) results in models that share more invariances with (and thus are encouraged to use similar features to) human perception. Note that incorporating human-selected priors and invariances in this fashion has a long history in the design of ML models—convolutional layers, for instance, were introduced as a means of introducing an invariance to translations of the input (Fukushima, 1980).
83
+
84
+ In what follows, we will explore the effect of the prior induced by adversarial robustness on models’ learned representations, and demonstrate that representations learned by adversarially robust models are better behaved, and do in fact seem to use features that are more human-understandable.
85
+
86
+ # 4 PROPERTIES AND APPLICATIONS OF ROBUST REPRESENTATIONS
87
+
88
+ In the previous section, we proposed using robust optimization as a way of enforcing user-specified priors during model training. Our goal was to mitigate the issues with standard representations identified in Section 2. We now demonstrate that the learned representations resulting from training with this prior indeed exhibit several advantages over standard representations.
89
+
90
+ Recall that we define a representation $R ( \cdot )$ as a function induced by a neural network which maps inputs $x \in \mathbb { R } ^ { n }$ to vectors $R ( x ) \ \in \ \mathbb { R } ^ { k }$ in the representation layer of that network (the penultimate layer). In what follows, we refer to “standard representations” as the representation functions induced by standard (non-robust) networks, trained with the objective (2)—analogously, “robust representations” refer to the representation functions induced by $\ell _ { 2 }$ -adversarially robust networks, i.e. networks trained with the objective (3) with $\Delta$ being the $\ell _ { 2 }$ ball:
91
+
92
+ $$
93
+ \theta _ { r o b u s t } ^ { * } = \underset { \theta } { \arg \operatorname* { m i n } } \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } \left[ \underset { \| \delta \| _ { 2 } \leq \varepsilon } { \operatorname* { m a x } } \mathcal { L } _ { \theta } ( x + \delta , y ) \right] .
94
+ $$
95
+
96
+ It is worth noting that despite the value of $\varepsilon$ used for training being quite small, we find that robust optimization globally affects the behavior of learned representations. As we demonstrate in this section, the benefits of robust representations extend to out-of-distribution inputs and far beyond $\varepsilon$ -balls around the training distribution.
97
+
98
+ Experimental setup. We train robust and standard ResNet-50 (He et al., 2016) networks on the Restricted ImageNet (Tsipras et al., 2019) and ImageNet (Russakovsky et al., 2015) datasets. Datasets specifics are in in Appendix A.1, training details are in in Appendices A.2 and A.3, and the performance of each model is reported in Appendix A.4. In the main text, we present results for Restricted ImageNet, and link to (nearly identical) results for ImageNet present in the appendices (B.1.4,B.3.2).
99
+
100
+ Unless explicitly noted otherwise, our optimization method of choice for any objective function will be (projected) gradient descent (PGD), a first-order method which is known to be highly effective for minimizing neural network-based loss functions for both standard and adversarially robust neural networks (Athalye et al., 2018a; Madry et al., 2018).
101
+
102
+ Code for reproducing our results is available at https://github.com/snappymanatee/ robust-learned-representations.
103
+
104
+ # 4.1 INVERTING ROBUST REPRESENTATIONS
105
+
106
+ As discussed in Section 2, for standard deep networks, given any input $x$ , it is straightforward to find another input that looks entirely different but has nearly the same representation (c.f. Figure 2). We noted that this finding runs somewhat counter to the idea that these learned representations effectively capture relevant input features. After all, if the representation function was truly extracting “high-level” features of the input as we conceptualize them, semantically dissimilar images should (by definition) have different representations. We now show that the state of affairs is greatly improved for robust representations.
107
+
108
+ Robust representations are (approximately) invertible out of the box. We begin by recalling the optimization objective (1) used in Section 2 to find pairs of images with similar representations, a simple minimization of $\ell _ { 2 }$ distance in representation space from a source image $x _ { 1 }$ to a target image $x _ { 2 }$ :
109
+
110
+ $$
111
+ x _ { 1 } ^ { \prime } = x _ { 1 } + \arg \operatorname* { m i n } _ { \delta } \| R ( x _ { 1 } + \delta ) - R ( x _ { 2 } ) \| _ { 2 } .
112
+ $$
113
+
114
+ This process can be seen as recovering an image that maps to the desired target representation, and hence is commonly referred to as representation inversion (Dosovitskiy & Brox, 2016b; Mahendran & Vedaldi, 2015; Ulyanov et al., 2017). It turns out that in sharp contrast to what we observe for standard models, the images resulting from minimizing (4) for robust models are actually semantically similar to the original (target) images whose representation is being matched, and this behavior is consistent across multiple samplings of the starting point (source image) $x _ { 1 }$ (cf. Figure 3).
115
+
116
+ ![](images/90beef5de3fe62e0e8e19dd61163b34bcb6a0747e031a8c07302e5c4ff406b44.jpg)
117
+ Figure 3: Visualization of inputs that are mapped to similar representations by models trained on the Restricted ImageNet dataset. Target $( x _ { 2 } )$ ) & Source $( x _ { 1 } )$ : random examples image from the test set; Robust and Standard $( x _ { 1 } ^ { \prime } )$ : result of minimizing the objective (4) to match (in $\ell _ { 2 }$ -distance) the representation of the target image starting from the corresponding source image for (top): a robust (adversarially trained) and (bottom): a standard model respectively. For the robust model, we observe that the resulting images are perceptually similar to the target image in terms of high-level features (even though they do not match it exactly), while for the standard model they often look more similar to the source image which is the seed for the optimization process. Additional results in Appendix B.1, and similar results for ImageNet are in Appendix B.1.4.
118
+
119
+ Representation proximity seems to entail semantic similarity. In fact, the contrast between the invertibility of standard and robust representations is even stronger. To illustrate this, we will attempt to match the representation of a target image while staying close to the starting image of the optimization in pixel-wise $\ell _ { 2 }$ -norm (this is equivalent to putting a norm bound on $\delta$ in objective (4)). With standard models, we can consistently get close to the target image in representation space, without moving far from the source image $x _ { 1 }$ . On the other hand, for robust models, we cannot get close to the target representation while staying close to the source image—this is illustrated quantitatively in Figure 4. This indicates that for robust models, semantic similarity may in fact be necessary for representation similarity (and is not, for instance, merely an artifact of the local robustness induced by robust optimization).
120
+
121
+ ![](images/bea51eaa4baec2a9289a434a8043132c49c412177afd98087031b2e96c5b097a.jpg)
122
+ Figure 4: Optimizing objective (4) with PGD and an $\ell _ { 2 }$ -norm constraint around the source image. On the $x$ -axis is the radius of the constraint set, and on the $y$ -axis is the distance in representation space between the minimizer of objective (4) within the constraint set and the target image, normalized by the norm of the representation of the target image: i.e., a point $( x _ { i } , y _ { i } )$ on the graph corresponds to $y _ { i } = \operatorname* { m i n } _ { \| \delta \| _ { 2 } \leq x _ { i } } \| R ( x + \delta ) - R ( x _ { t a r g } ) \| _ { 2 } / \| R ( x _ { t a r g } ) \| _ { 2 }$ . Notably, we are unable to closely match the representation of the target image for the robust network until the norm constraint grows very large, and in particular much larger than the norm of the perturbation that the model is trained to be robust against $\dot { \varepsilon }$ in objective (3)). Shown are $9 5 \%$ confidence intervals over random choice of source and target images.
123
+
124
+ ![](images/14cb7a193ef56242233d1d3cba3a29fb8ec9145adf3f556b8a3abe2a25e8af9c.jpg)
125
+ Figure 5: A visualization of the final solutions to the optimizing objective (4) with PGD when constraining the solution to lie in an $\ell _ { 2 }$ ball around the source image for an adversarially robust neural network. We note that even the radius of the constraint set is small and we cannot match the representation very well, salient features of the target image still arise.
126
+
127
+ We also find that even when $\delta$ is highly constrained (i.e. when we are forced to stay very close to the source image and thus cannot match the representation of the target well), the solution to the inversion problem still displays some salient features of the target image (c.f. Figure 5). Both of these observations suggest that the representations of robust networks function much more like we would expect high-level feature representations to behave.
128
+
129
+ Inversion of out-of-distribution inputs. We find that the inversion properties uncovered above hold even for out-of-distribution inputs, demonstrating that robust representations capture general features as opposed to features only relevant for the specific classification task. In particular, we repeat the inversion experiment (simple minimization of distance in representation space) using images from classes not present in the original dataset used during training (Figure 6 right) and structured random patterns (Figure 14 in Appendix B.1): the reconstructed images consistently resemble the targets.
130
+
131
+ Interpolation between arbitrary inputs. Note that this ability to consistently invert representations into corresponding inputs also translates into the ability to semantically interpolate between any two inputs. For any two inputs $x _ { 1 }$ and $x _ { 2 }$ , one can (linearly) interpolate between $R ( x _ { 1 } )$ and $R \dot { ( } x _ { 2 } )$ in representation space, then use the inversion procedure to get images corresponding to the interpolate representations. The resulting inputs interpolate between the two endpoints in a percep
132
+
133
+ ![](images/44d19c78d2490d493290b74c27276384a053910770ba6312b1d63a8683afa0e1.jpg)
134
+ Figure 6: Robust representations yield semantically meaningful embeddings. Target: random images from the test set (col. 1-5) and from outside of the training distribution (6-10); Result: images obtained from optimizing inputs (using Gaussian noise as the source image) to minimize $\ell _ { 2 }$ -distance to the representations of the corresponding image in the top row. (More examples appear in Appendix B.1.)
135
+
136
+ tually plausible manner without any of the “ghosting” artifacts present in input-space interpolation.
137
+ We show examples of this inversion as well as experimental details in Appendix A.5.
138
+
139
+ # 4.2 DIRECT FEATURE VISUALIZATION
140
+
141
+ A common technique for visualizing and understanding the representation function $R ( \cdot )$ of a given network is optimization-based feature visualization (Olah et al., 2017), a process in which we maximize a specific feature (component) in the representation with respect to the input, in order to obtain insight into the role of the feature in classification. Concretely, given some $i \in [ k ]$ denoting a component of the representation vector, we use gradient descent to find an input $x ^ { \prime }$ that maximally activates it, i.e., we solve:
142
+
143
+ $$
144
+ x ^ { \prime } = x _ { 0 } + \arg \operatorname* { m a x } _ { \delta } R ( x _ { 0 } + \delta ) _ { i }
145
+ $$
146
+
147
+ for various starting points $x _ { 0 }$ which might be random images from $\mathcal { D }$ or even random noise.
148
+
149
+ Visualization “fails” for standard networks. For standard networks, optimizing the objective (5) often yields unsatisfying results. While we can easily find images for which the ${ \bf \bar { \rho } } _ { i ^ { t h } }$ component of $R ( \cdot )$ is large (and thus the optimization problem is tractable), these images tends to look meaningless to humans, often resembling the starting point of the optimization. Even when these images are non-trivial, they tend to contain abstract, hard-to-discern patterns (c.f. Figure 7 (bottom)). As we discuss later in this section, regularization/post-processing of visualizations does improve this state of affairs, though not very significantly and potentially at the cost of suppressing useful features present in the representation post-hoc.
150
+
151
+ Robust representations allow for direct visualization of human-recognizable features. For robust representations, however, we find that easily recognizable high-level features emerge from optimizing objective (5) directly, without any regularization or post-processing. We present the results of this maximization in Figure 7 (top): coordinates consistently represent the same concepts across different choice of starting input $x _ { 0 }$ (both in and out of distribution). Furthermore, these concepts are not merely an artifact of our visualization process, as they consistently appear in the test-set inputs that most strongly activate their corresponding coordinates (Figure 8).
152
+
153
+ The limitations of regularization for visualization in standard networks. Given that directly optimizing objective (5) does not produce human-meaningful images, prior work on visualization usually tries to regularize objective (5) through a variety of methods. These methods include applying random transformations during the optimization process (Mordvintsev et al., 2015; Olah et al., 2017), restricting the space of possible solutions (Nguyen et al., 2015; 2016; 2017), or postprocessing the input or gradients (Oygard, 2015; Tyka, 2016). While regularization does in general produce better results qualitatively, it comes with a few notable disadvantages that are wellrecognized in the domain of feature visualization. First, when one introduces prior information about what makes images visually appealing into the optimization process, it becomes difficult to disentangle the effects of the actual model from the effect of the prior information introduced
154
+
155
+ # Maximizing different coordinates (i)
156
+
157
+ ![](images/79ce205f6e2aa4edf25191a6814e92dd251ef4a2e799bdfc3303e41c8f6fcc09.jpg)
158
+ Figure 7: Correspondence between image-level patterns and activations learned by standard and robust models on the Restricted ImageNet dataset. Starting from randomly chosen seed inputs (noise/images), we use PGD to find inputs that (locally) maximally activate a given component of the representation vector (cf. Appendix A.6.1 for details). In the left column we have the seed inputs $x _ { 0 }$ (selected randomly), and in subsequent columns we visualize the result of the optimization (5), i.e., $x ^ { \prime }$ , for different activations, with each row starting from the same (far left) input $x _ { 0 }$ for (top): a robust (adversarially trained) and (bottom): a standard model. Additional visualizations in Appendix B.3, and similar results for ImageNet in B.3.2.
159
+
160
+ ![](images/10866b1c743e113d7a7305ba462ae93df8b4116c74ee3d9e3a64fb7df99912ef.jpg)
161
+ Figure 8: Maximizing inputs $x ^ { \prime }$ (found by solving (5) with $x _ { 0 }$ being a gray image) and most or least activating images (from the test set) for two random activations of a robust model trained on the Restricted ImageNet dataset. For each activation, we plot the three images from the validation set that had the highest or lowest activation value sorted by the magnitude of the selected activation.
162
+
163
+ through regularization2. Furthermore, while adding regularization does improve the visual quality of the visualizations, the components of the representation still cannot be shown to correspond to any recognizable high-level feature. Indeed, Olah et al. (2017) note that in the representation layer of a standard GoogLeNet, “Neurons do not seem to correspond to particularly meaningful semantic ideas”—the corresponding feature visualizations are reproduced in Figure 9. We also provide examples of representation-layer visualizations for VGG16 (which we found qualitatively best among modern architectures) regularized with jittering and random rotations in Figure 10. While these visualizations certainly look better qualitatively than their unregularized counterparts in Figure 7 (bottom), there remains a significantly large gap in quality and discernability between these regularized visualizations and those of the robust network in Figure 7 (top).
164
+
165
+ ![](images/af2858d20852fe2f7f66df8c0220ea6862971dcaafe1c130c288d373a7d0edaa.jpg)
166
+ Figure 9: Figure reproduced from (Olah et al., 2017)—a visualization of a few components of the representation layer of GoogLeNet. While regularization (as well as Fourier parameterization and colorspace decorrelation) yields visually appealing results, the visualization does not reveal consistent semantic concepts.
167
+
168
+ ![](images/db424b520d9a3f75acb094f682a3898f1de1fdbace74291b51ddf46d32cbd414.jpg)
169
+ Figure 10: A visualization of the first four components of the representation layer of VGG16 when regularization via random jittering and rotation is applied. Figure produced using the Lu${ \mathrm { c i d } } ^ { a }$ visualization library.
170
+
171
+ ahttps://github.com/tensorflow/ lucid/
172
+
173
+ ![](images/30347e69be0e93e7774824cc42566eed0e8a3a663b0fcbb0e13bd47c30b9652b.jpg)
174
+ Figure 11: Visualization of the results from maximizing a chosen (left) and a random (right) representation coordinate starting from random images for the Restricted ImageNet dataset. In each figure, the top row has the initial images, and the bottom row has a feature added. Additional examples in Appendix B.4.
175
+
176
+ # 4.2.1 NATURAL CONSEQUENCE: FEATURE MANIPULATION
177
+
178
+ The ability to directly visualize high-level, recognizable features reveals another application of robust representations, which we refer to as feature manipulation. Consider the visualization objective (5) shown in the previous section. Starting from some original image, optimizing this objective results in the corresponding feature being introduced in a continuous manner. It is hence possible to stop this process relatively early to ensure that the content of the original image is preserved. As a heuristic, we stop the optimization process as soon as the desired feature attains a larger value than all the other coordinates of the representation. We visualize the result of this process for a variety of input images in Figure 11, where “stripes” or “red limbs” are introduced seamlessly into images without any processing or regularization 3.
179
+
180
+ # 5 RELATED WORK
181
+
182
+ Adversarial Robustness Our work studies the feature representations of adversarially robust networks. As discussed in Section 3, these are networks trained with the robust optimization framework (Wald, 1945; Goodfellow et al., 2015; Madry et al., 2018) and were originally proposed in the context of defending against adversarial perturbations (Biggio et al., 2013; Szegedy et al., 2014). Adversarial robustness has been studied extensively in the context of machine learning security (see e.g., Carlini & Wagner (2017); Athalye et al. (2018b;a); Papernot et al. (2017)), and as an independent phenomenon (see e.g., Gilmer et al. (2018); Schmidt et al. (2018); Jacobsen et al. (2019); Ilyas et al. (2019); Tsipras et al. (2019); Su et al. (2018). Recent work also uses robust models for input manipulation: Tsipras et al. (2019) observe that large adversarial perturbation constructed for robust networks actually resemble instances of the target class, and Anon. $( 2 0 1 9 ) ^ { 4 }$ demonstrates that robust classifiers can be used for a wide array of image synthesis tasks. While our work also manipulates inputs with robust classifiers, we focus on understanding properties of robust representations (via inversion and component visualization), rather than perform any downstream tasks.
183
+
184
+ Inverting representations. Previous methods for inverting learned representations typically either solve an optimization problem similar to (1) while imposing a “natural image” prior on the input Mahendran & Vedaldi (2015); Yosinski et al. (2015); Ulyanov et al. (2017) or train a separate model to perform the inversion Kingma & Welling (2015); Dosovitskiy & Brox (2016b;a). Note that since these methods introduce priors or additional components into the inversion process, their results are not fully faithful to the model. In an orthogonal direction, it is possible to construct models that are analytically invertible by construction Dinh et al. (2014; 2017); Jacobsen et al. (2018); Behrmann et al. (2018). However, the representations learned by these models do not seem to be perceptually meaningful (for instance, interpolating between points in the representation space does not lead to perceptual input space interpolations Jacobsen et al. (2018)). Another notable distinction between the inversions shown here and invertible networks is that the latter are an exactly invertible map from $\mathbb { R } ^ { d } \to \mathbb { R } ^ { d }$ , while the former shows that we can approximately recover the original input in $\bar { \mathbb { R } } ^ { d }$ from a representation in $\mathbb { R } ^ { k }$ for $k \ll d$ .
185
+
186
+ Feature visualization. Typical methods for visualizing features or classes learned by deep networks follow an optimization-based approach, optimizing objectives similar to objective (5). Since this optimization does not lead to meaningful visualizations directly, these methods incorporate domain-specific input priors (either hand-crafted Nguyen et al. (2015) or learned Nguyen et al. (2016; 2017)) and regularizers Simonyan et al. (2013); Mordvintsev et al. (2015); Oygard (2015); Yosinski et al. (2015); Tyka (2016); Olah et al. (2017) to produce human-discernible visualizations. The key difference of our work is that we avoid the use of such priors or regularizers altogether, hence producing visualizations that are fully based on the model itself without introducing any additional bias.
187
+
188
+ Semantic feature manipulation. The latent space of generative adversarial networks (GANs) Goodfellow et al. (2014) tends to allow for “semantic feature arithmetic” Radford et al. (2016); Larsen et al. (2016) (similar to that in word2vec embeddings Mikolov et al. (2013)) where one can manipulate salient input features using latent space manipulations. In a similar vein, one can utilize an image-to-image translation framework to perform such manipulation (e.g. transforming horses to zebras), although this requires a task-specific dataset and model Zhu et al. (2017). Somewhat orthogonally, it is possible to utilize the deep representations of standard models to perform semantic feature manipulations; however such methods tend to either only perform well on datasets where the inputs are center-aligned Upchurch et al. (2017), or are restricted to a small set of manipulations Gatys et al. (2016).
189
+
190
+ # 6 CONCLUSION
191
+
192
+ We show that the learned representations of robustly trained models align much more closely with our idealized view of neural network embeddings as extractors of human-meaningful, high-level features. After highlighting certain shortcomings of standard deep networks and their representations, we demonstrate that robust optimization can actually be viewed as inducing a human prior over the features that models are able to learn. In this way, one can view the robust representations that result from this prior as feature extractors that are more aligned with human perception.
193
+
194
+ In support of this view, we demonstrate that robust representations overcome the challenges identified for standard representations: they are approximately invertible, and moving towards an image in representation space seems to entail recovering salient features of that image in pixel space. Furthermore, we show that robust representations can be directly visualized with first-order methods without the need for post-processing or regularization, and also yield much more human-understandable features than standard models (even when they are visualized with regularization). These two properties (inversion and direct feature visualization), in addition to serving as illustrations of the benefits of robust representations, also enable direct modes of input manipulation (interpolation and feature manipulation, respectively).
195
+
196
+ Overall, our findings highlight robust optimization as a framework to enforce feature priors on learned models. We believe that further exploring this paradigm will lead to models that are significantly more human-aligned while enabling a wide range of new modes of interactions.
197
+
198
+ # REFERENCES
199
+
200
+ Julius Adebayo, Justin Gilmer, Michael Muelly, Ian Goodfellow, Moritz Hardt, and Been Kim. Sanity checks for saliency maps. In Neural Information Processing Systems (NeurIPS), 2018.
201
+
202
+ Anon. Image synthesis with a single (robust) classifier. In Neural Information Processing Systems (NeurIPS), 2019.
203
+
204
+ Anish Athalye, Nicholas Carlini, and David A. Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International Conference on Machine Learning (ICML), 2018a.
205
+
206
+ Anish Athalye, Logan Engstrom, Andrew Ilyas, and Kevin Kwok. Synthesizing robust adversarial examples. In International Conference on Machine Learning (ICML), 2018b.
207
+
208
+ David Bau, Jun-Yan Zhu, Jonas Wulff, William Peebles, Hendrik Strobelt, Bolei Zhou, and Antonio Torralba. Inverting layers of a large generator. In ICLR Debugging Machine Learning Models Workshop, 2019.
209
+
210
+ Jens Behrmann, Will Grathwohl, Ricky T. Q. Chen, David Duvenaud, and Jörn-Henrik Jacobsen. Invertible residual networks. In arXiv preprint arXiv:1811.00995, 2018.
211
+
212
+ Y. Bengio, A. Courville, and P. Vincent. Representation learning: A review and new perspectives. 2013.
213
+
214
+ Yoshua Bengio. Talk abstract: Learning high-level representations for agents, 2019. URL https://calendar.mit.edu/event/yoshua_bengio_learning_ high-level_representations_for_agents#.XYozli2ZNhF. Abstract for talk given at MIT.
215
+
216
+ Battista Biggio and Fabio Roli. Wild patterns: Ten years after the rise of adversarial machine learning. 2018.
217
+
218
+ Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Šrndic, Pavel Laskov, Gior- ´ gio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In Joint European conference on machine learning and knowledge discovery in databases (ECML-KDD), 2013.
219
+
220
+ Wieland Brendel and Matthias Bethge. Approximating CNNs with bag-of-local-features models works surprisingly well on imagenet. In International Conference on Learning Representations (ICLR), 2019.
221
+
222
+ Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations (ICLR), 2019.
223
+
224
+ Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Workshop on Artificial Intelligence and Security (AISec), 2017.
225
+
226
+ Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th international conference on Machine learning, pp. 160–167, 2008.
227
+
228
+ John M. Danskin. The Theory of Max-Min and its Application to Weapons Allocation Problems. 1967.
229
+
230
+ Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. In arXiv preprint arXiv:1410.8516, 2014.
231
+
232
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. In International Conference on Learning Representations (ICLR), 2017.
233
+
234
+ Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In International conference on machine learning (ICML), 2014.
235
+
236
+ Alexey Dosovitskiy and Thomas Brox. Generating images with perceptual similarity metrics based on deep networks. In neural information processing systems (NeurIPS), 2016a.
237
+
238
+ Alexey Dosovitskiy and Thomas Brox. Inverting visual representations with convolutional networks. In Computer Vision and Pattern Recognition (CVPR), 2016b.
239
+
240
+ Kunihiko Fukushima. Neocognitron: A self-organizing neural network model for a mechanism of pattern recognition unaffected by shift in position. Biological cybernetics, 1980.
241
+
242
+ Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In computer vision and pattern recognition (CVPR), 2016.
243
+
244
+ Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. Imagenet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019.
245
+
246
+ Justin Gilmer, Luke Metz, Fartash Faghri, Samuel S Schoenholz, Maithra Raghu, Martin Wattenberg, and Ian Goodfellow. Adversarial spheres. In Workshop of International Conference on Learning Representations (ICLR), 2018.
247
+
248
+ Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In computer vision and pattern recognition (CVPR), pp. 580–587, 2014.
249
+
250
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In neural information processing systems (NeurIPS), 2014.
251
+
252
+ Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016.
253
+
254
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations (ICLR), 2015.
255
+
256
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In international conference on computer vision (ICCV), 2015.
257
+
258
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
259
+
260
+ Andrew Ilyas, Shibani Santurkar, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In Neural Information Processing Systems (NeurIPS), 2019.
261
+
262
+ Jorn-Henrik Jacobsen, Jens Behrmann, Richard Zemel, and Matthias Bethge. Excessive invariance causes adversarial vulnerability. In International Contemporary on Learning Representations, 2019.
263
+
264
+ Jörn-Henrik Jacobsen, Arnold W.M. Smeulders, and Edouard Oyallon. i-revnet: Deep invertible networks. In International Conference on Learning Representations (ICLR), 2018.
265
+
266
+ Saumya Jetley, Nicholas Lord, and Philip Torr. With friends like these, who needs adversaries? In Advances in Neural Information Processing Systems (NeurIPS), 2018.
267
+
268
+ Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European conference on computer vision (ECCV), 2016.
269
+
270
+ Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on Learning Representations (ICLR), 2015.
271
+
272
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NeurIPS), 2012.
273
+
274
+ Anders Boesen Lindbo Larsen, Søren Kaae Sønderby, Hugo Larochelle, and Ole Winther. Autoencoding beyond pixels using a learned similarity metric. In International Conference on Machine Learning (ICML), 2016.
275
+
276
+ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations (ICLR), 2018.
277
+
278
+ Aravindh Mahendran and Andrea Vedaldi. Understanding deep image representations by inverting them. In computer vision and pattern recognition (CVPR), 2015.
279
+
280
+ Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pp. 3111–3119, 2013.
281
+
282
+ Alexander Mordvintsev, Christopher Olah, and Mike Tyka. Inceptionism: Going deeper into neural networks, 2015. URL https://ai.googleblog.com/2015/06/ inceptionism-going-deeper-into-neural.html.
283
+
284
+ Alexander Mordvintsev, Nicola Pezzotti, Ludwig Schubert, and Chris Olah. Differentiable image parameterizations. In Distill, 2018.
285
+
286
+ Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Conference on computer vision and pattern recognition (CVPR), 2015.
287
+
288
+ Anh Nguyen, Alexey Dosovitskiy, Jason Yosinski, Thomas Brox, and Jeff Clune. Synthesizing the preferred inputs for neurons in neural networks via deep generator networks. In Neural Information Processing Systems (NeurIPS), 2016.
289
+
290
+ Anh Nguyen, Jeff Clune, Yoshua Bengio, Alexey Dosovitskiy, and Jason Yosinski. Plug & play generative networks: Conditional iterative generation of images in latent space. In Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
291
+
292
+ Chris Olah, Alexander Mordvintsev, and Ludwig Schubert. Feature visualization. In Distill, 2017.
293
+
294
+ Audun Oygard. Visualizing googlenet classes, 2015. URL https://www.auduno.com/ 2015/07/29/visualizing-googlenet-classes/.
295
+
296
+ Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Asia Conference on Computer and Communications Security, 2017.
297
+
298
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In International Conference on Learning Representations (ICLR), 2016.
299
+
300
+ Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li FeiFei. ImageNet Large Scale Visual Recognition Challenge. In International Journal of Computer Vision (IJCV), 2015.
301
+
302
+ Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander M ˛adry. Adversarially robust generalization requires more data. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
303
+
304
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
305
+
306
+ Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013.
307
+
308
+ Dong Su, Huan Zhang, Hongge Chen, Jinfeng Yi, Pin-Yu Chen, and Yupeng Gao. Is robustness the cost of accuracy? a comprehensive study on the robustness of 18 deep image classification models. In European Conference on Computer Vision (ECCV), 2018.
309
+
310
+ Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations (ICLR), 2014.
311
+
312
+ Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. In International Conference on Learning Representations (ICLR), 2019.
313
+
314
+ Mike Tyka. Class visualization with bilateral filters, 2016. URL https://mtyka.github. io/deepdream/2016/02/05/bilateral-class-vis.html.
315
+
316
+ Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In ArXiv preprint arXiv:1711.10925, 2017.
317
+
318
+ Paul Upchurch, Jacob Gardner, Geoff Pleiss, Robert Pless, Noah Snavely, Kavita Bala, and Kilian Weinberger. Deep feature interpolation for image content changes. In conference on computer vision and pattern recognition (CVPR), 2017.
319
+
320
+ Abraham Wald. Statistical decision functions which minimize the maximum risk. In Annals of Mathematics, 1945.
321
+
322
+ Jason Yosinski, Jeff Clune, Anh Nguyen, Thomas Fuchs, and Hod Lipson. Understanding neural networks through deep visualization. In arXiv preprint arXiv:1506.06579, 2015.
323
+
324
+ Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Computer Vision and Pattern Recognition (CVPR), 2018.
325
+
326
+ Tianyuan Zhang and Zhanxing Zhu. Interpreting adversarially trained convolutional neural networks. In International Conference on Machine Learning (ICML), 2019.
327
+
328
+ Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In international conference on computer vision(ICCV), 2017.
329
+
330
+ # A EXPERIMENTAL SETUP
331
+
332
+ # A.1 DATASETS
333
+
334
+ In the main text, we perform all our experimental analysis on the Restricted ImageNet dataset Tsipras et al. (2019) which is obtained by grouping together semantically similar classes from ImageNet into 9 super-classes shown in Table 1. Attaining robust models for the complete ImageNet dataset is known to be challenging, both due to the hardness of the learning problem itself, as well as the computational complexity.
335
+
336
+ For the sake of completeness, we also replicate our experiments feature visualization and representation inversion on the complete ImageNet dataset Russakovsky et al. (2015) in Appendices B.3.2 and B.1.4—in particular, cf. Figures 22 and 16.
337
+
338
+ Table 1: Classes used in the Restricted ImageNet model. The class ranges are inclusive.
339
+
340
+ <table><tr><td>Class</td><td>Corresponding ImageNet Classes</td></tr><tr><td>“Dog”</td><td>151 to 268</td></tr><tr><td>“Cat”</td><td>281 to 285</td></tr><tr><td>“Frog”</td><td>30 to 32</td></tr><tr><td>&quot;Turtle”</td><td>33 to 37</td></tr><tr><td>“Bird”</td><td>80 to 100</td></tr><tr><td>&quot;Primate”</td><td>365 to 382</td></tr><tr><td>“Fish”</td><td>389 to 397</td></tr><tr><td>“Crab”</td><td>118 to 121</td></tr><tr><td>&quot;Insect”</td><td>300 to 319</td></tr></table>
341
+
342
+ # A.2 MODELS
343
+
344
+ We use the ResNet-50 architecture He et al. (2016) for our adversarially trained classifiers on all datasets. Unless otherwise specified, we use standard ResNet-50 classifiers trained using empirical risk minimization as a baseline in our experiments. Additionally, it has been noted in prior work that among standard classifiers, VGG networks Simonyan & Zisserman (2015) tend to have better-behaved representations and feature visualizations Mordvintsev et al. (2018). Thus, we also compare against standard VGG16 networks in the subsequent appendices. All models are trained with data augmentation, momentum 0.9 and weight decay $5 e ^ { - \bar { 4 } }$ . Other hyperparameters are provided in Tables 2 and 3.
345
+
346
+ The exact procedure used to train robust models along with the corresponding hyperparameters are described in Section A.3. For standard (not adversarially trained) classifiers on the complete 1k-class ImageNet dataset, we use pre-trained models provided in the PyTorch repository5.
347
+
348
+ Table 2: Standard hyperparameters for the models trained in the main paper.
349
+
350
+ <table><tr><td>Dataset</td><td>Model</td><td>Arch.</td><td>Epochs</td><td>LR</td><td>Batch Size</td><td>LR Schedule</td><td></td></tr><tr><td>Restricted ImageNet</td><td>standard</td><td>ResNet-50</td><td>110</td><td>0.1</td><td>256</td><td>Drop by 10 at epochs ∈ [30,60]</td><td></td></tr><tr><td>Restricted ImageNet</td><td>robust</td><td>ResNet-50</td><td>110</td><td>0.1</td><td>256</td><td>Drop by 10 at epochs ∈ [30,60]</td><td></td></tr><tr><td>ImageNet</td><td>robust</td><td>ResNet-50</td><td>110</td><td>0.1</td><td>256</td><td>Drop by 10 at epochs ∈ [100]</td><td></td></tr></table>
351
+
352
+ Test performance of all the classifiers can be found in Section A.4. Specific parameters used to study the properties of learned representations are described in Section A.6.
353
+
354
+ # A.3 ADVERSARIAL TRAINING
355
+
356
+ To obtain robust classifiers, we employ the adversarial training methodology proposed in Madry et al. (2018). Specifically, we train against a projected gradient descent (PGD) adversary with a normalized step size, starting from a random initial perturbation of the training data. We consider adversarial perturbations in $\ell _ { 2 }$ -norm. Unless otherwise specified, we use the values of $\epsilon$ provided in Table 3 to train/evaluate our models (the images themselves lie in the range $[ 0 , 1 ] )$ .
357
+
358
+ Table 3: Hyperparameters used for adversarial training.
359
+
360
+ <table><tr><td>Dataset</td><td>E</td><td># steps</td><td>Step size</td></tr><tr><td>Restricted ImageNet</td><td>3.0</td><td>7</td><td>0.5</td></tr><tr><td>ImageNet</td><td>3.0</td><td>7</td><td>0.5</td></tr></table>
361
+
362
+ # A.4 MODEL PERFORMANCE
363
+
364
+ Standard test performance for the models used in the paper are presented in Table 4 for the Restricted ImageNet dataset and in Table 5 for the complete ImageNet dataset.
365
+
366
+ Additionally, we report adversarial accuracy of both standard and robust models. Here, adversarial accuracies are computed against a PGD adversary with 20 steps and step size of 0.375. (We also evaluated against a stronger adversary using more steps (100) of PGD, however this had a marginal effect on the adversarial accuracy of the models.)
367
+
368
+ Table 4: Test accuracy for standard and robust models on the Restricted ImageNet dataset.
369
+
370
+ <table><tr><td>Model</td><td>Standard</td><td>Adversarial (eps=3.0)</td></tr><tr><td>Standard VGG16</td><td>98.22%</td><td>2.17%</td></tr><tr><td>Standard ResNet-50</td><td>98.01%</td><td>4.74%</td></tr><tr><td>RobustResNet-50</td><td>92.39%</td><td>81.91%</td></tr></table>
371
+
372
+ Table 5: Top-1 accuracy for standard and robust models on the ImageNet dataset.
373
+
374
+ <table><tr><td>Model</td><td>Standard</td><td>Adversarial (eps=3.0)</td></tr><tr><td>Standard VGG16</td><td>73.36%</td><td>0.35%</td></tr><tr><td>Standard ResNet-50</td><td>76.13%</td><td>0.13%</td></tr><tr><td>Robust ResNet-50</td><td>57.90%</td><td>35.16%</td></tr></table>
375
+
376
+ # A.5 IMAGE INTERPOLATIONS
377
+
378
+ A natural consequence of the “natural invertibility” property of robust representations is the ability to synthesize natural interpolations between any two inputs $x _ { 1 } , x _ { 2 } \in \mathbb { R } ^ { n }$ . In particular, given two images $x _ { 1 }$ and $x _ { 2 }$ , we define the $\lambda$ -interpolate between them as
379
+
380
+ $$
381
+ x _ { \lambda } = \operatorname* { m i n } _ { x } \| \left( \lambda \cdot R ( x _ { 1 } ) + ( 1 - \lambda ) \cdot R ( x _ { 2 } ) \right) - R ( x ) \| _ { 2 } .
382
+ $$
383
+
384
+ where, for a given $\lambda$ , we find $x _ { \lambda }$ by solving (6) with projected gradient descent. Intuitively, this corresponds to linearly interpolating between the points in representation space and then finding a point in image space that has a similar representation. To construct a length- $( T + 1 )$ interpolation, we choose $\breve { \lambda } = \stackrel { \cdot } { \left\{ 0 , \frac { 1 } { T } , \frac { 2 } { T } , \dots 1 \right\} }$ . The resulting interpolations, shown in Figure 12, demonstrate that the $\lambda$ -interpolates of robust representations correspond to a meaningful feature interpolation between images. (For standard models constructing meaningful interpolations is impossible due to the brittleness identified in Section 2—see Appendix B.1.3 for details.)
385
+
386
+ ![](images/a3c81c00f8e24ed58f4c47db232e08a88480e0fbb10d73d6cf4988882ab28433.jpg)
387
+ Top: Image-space interpolation
388
+ Figure 12: Image interpolation using robust representations compared to their image-space counterparts. The former appear perceptually plausible while the latter exhibit ghosting artifacts. For pairs of images from the Restricted ImageNet test set, we solve (6) for $\lambda$ varying between zero and one, i.e., we match linear interpolates in representation space. Additional interpolations appear in Appendix B.2.1 Figure 17. We demonstrate the ineffectiveness of interpolation with standard representations in Appendix B.2.2 Figure 18.
389
+
390
+ Relation to other interpolation methods. We emphasize that linearly interpolating in robust representation space works for any two images. This generality is in contrast to interpolations induced by GANs (e.g. (Radford et al., 2016; Brock et al., 2019)), which can only interpolate between images generated by the generator. (Reconstructions of out-of-range images tend to be decipherable but rather different from the originals Bau et al. (2019).) It is worth noting that even for models with analytically invertible representations, interpolating in representation space does not yield semantic interpolations Jacobsen et al. (2018).
391
+
392
+ # A.6 PARAMETERS USED IN STUDIES OF ROBUST/STANDARD REPRESENTATIONS
393
+
394
+ A.6.1 FINDING REPRESENTATION-FEATURE CORRESPONDENCE
395
+
396
+ <table><tr><td>Dataset</td><td>E</td><td># steps</td><td>Step size</td></tr><tr><td>Restricted ImageNet/ImageNet</td><td>1000</td><td>200</td><td>1</td></tr></table>
397
+
398
+ A.6.2 INVERTING REPRESENTATIONS AND INTERPOLATIONS
399
+
400
+ <table><tr><td>Dataset</td><td>E</td><td># steps</td><td>Step size</td></tr><tr><td>Restricted ImageNet/ImageNet</td><td>1000</td><td>10000</td><td>1</td></tr></table>
401
+
402
+ # B OMITTED FIGURES
403
+
404
+ # B.1 INVERTING REPRESENTATIONS
405
+
406
+ # B.1.1 RECOVERING TEST SET IMAGES USING ROBUST REPRESENTATIONS
407
+
408
+ ![](images/b56a0a18f95a5a91916bb48d75c20363a37102bc54adbb83316d0d78fa1b586a.jpg)
409
+ Figure 13: Robust representations yield semantically meaningful inverses: Original: randomly chosen test set images from the Restricted ImageNet dataset; Inverse: images obtained by inverting the representation of the corresponding image in the top row by solving the optimization problem (1) starting from: (a) different test images and (b) Gaussian noise.
410
+
411
+ # B.1.2 RECOVERING OUT-OF-DISTRIBUTION INPUTS USING ROBUST REPRESENTATIONS
412
+
413
+ ![](images/76be2dfa1c67b2a7f8578ab162003bf7419b0afbd2318a7f44396443596acc7f.jpg)
414
+ (b) Samples from other ImageNet classes outside what the model is trained on.
415
+ Figure 14: Robust representations yield semantically meaningful inverses: (Original): randomly chosen out-of-distribution inputs; (Inverse): images obtained by inverting the representation of the corresponding image in the top row by solving the optimization problem (1) starting from Gaussian noise.
416
+
417
+ # B.1.3 INVERTING STANDARD REPRESENTATIONS
418
+
419
+ ![](images/b51a5fef6ef55e1e3d708f48d2cebf1d49acbc28d7693349d7485760841c6df5.jpg)
420
+ Figure 15: Standard representations do not yield semantically meaningful inverses: (Original): randomly chosen test set images from the Restricted ImageNet dataset; (Inverse): images obtained by inverting the representation of the corresponding image in the top row by solving the optimization problem (1) starting from Gaussian noise.
421
+
422
+ ![](images/5348d4a9f219de9d39c0b813bcba0dc8e5bad87d9b0f0f1634cbe5ee12ca6a39.jpg)
423
+ Figure 16: Visualization of inputs that are mapped to similar representations by models trained on the ImageNet dataset. Target $( x _ { 2 } )$ & Source $( x _ { 1 } )$ : random examples image from the test set; Robust and Standard $( x _ { 1 } ^ { \prime } )$ : result of minimizing the objective (4) to match (in $\ell _ { 2 }$ -distance) the representation of the target image starting from the corresponding source image for (top): a robust (adversarially trained) and (bottom): a standard model respectively. For the robust model, we observe that the resulting images are perceptually similar to the target image in terms of high-level features, while for the standard model they often look more similar to the source image which is the seed for the optimization process.
424
+
425
+ # B.2 IMAGE INTERPOLATIONS
426
+
427
+ # B.2.1 ADDITIONAL INTERPOLATIONS FOR ROBUST MODELS
428
+
429
+ ![](images/20892ac41645c9b7ab425e33a36b41fe0ba2b7d72fef558d263b1e91da77f99d.jpg)
430
+ Figure 17: Additional image interpolation using robust representations. To find the interpolation in input space, we construct images that map to linear interpolations of the endpoints in robust representation space. Concretely, for randomly selected pairs from the Restricted ImageNet test set, we use (1) to find images that match to the linear interpolates in representation space (6).
431
+
432
+ # B.2.2 INTERPOLATIONS FOR STANDARD MODELS
433
+
434
+ ![](images/2ce908265387c4e60682507e947620aa80a650787141d2e3251d656c5f45ef1f.jpg)
435
+ Figure 18: Image interpolation using standard representations. To find the interpolation in input space, we construct images that map to linear interpolations of the endpoints in standard representation space. Concretely, for randomly selected pairs from the Restricted ImageNet test set, we use (1) to find images that match to the linear interpolates in representation space (6). Image space interpolations from the standard model appear to be significantly less meaningful than their robust counterparts. They are visibly similar to linear interpolation directly in the input space, which is in fact used to seed the optimization process.
436
+
437
+ # B.3.1 ADDITIONAL FEATURE VISUALIZATIONS FOR THE RESTRICTED IMAGENET DATASET
438
+
439
+ ![](images/5e4e5067445657b601b9b08817e3e47423ac17f53b6f357ec67a8b1ef160fbec.jpg)
440
+ Figure 19: Correspondence between image-level features and representations learned by a robust model on the Restricted ImageNet dataset. Starting from randomly chosen seed inputs (noise/images), we use a constrained optimization process to identify input features that maximally activate a given component of the representation vector (cf. Appendix A.6.1 for details). Specifically, (left column): inputs to the optimization process, and (subsequent columns): features that activate randomly chosen representation components, along with the predicted class of the feature.
441
+
442
+ ![](images/adf86849c87d65d9e5cc5621b02f18be6013072c2bcd3be11cd960cecfe240a1.jpg)
443
+ Figure 20: Correspondence between image-level features and representations learned by a robust model on the Restricted ImageNet dataset. Starting from randomly chosen seed inputs (noise/images), we use a constrained optimization process to identify input features that maximally activate a given component of the representation vector (cf. Appendix A.6.1 for details). Specifically, (left column): inputs to the optimization process, and (subsequent columns): features that activate select representation components, along with the predicted class of the feature.
444
+
445
+ # Maximizing different coordinates (i)
446
+
447
+ ![](images/5ef5f0eeab01d16a8d4089bf7beccf2bb700d2e9990fd688a37d8b135f078e78.jpg)
448
+ Figure 21: Correspondence between image-level patterns and activations learned by standard and robust models on the Restricted ImageNet dataset. Starting from randomly chosen seed inputs (noise/images), we use PGD to find inputs that (locally) maximally activate a given component of the representation vector (cf. Appendix A.6.1 for details). In the left column we have the original inputs (selected randomly), and in subsequent columns we visualize the result of the optimization (5) for different activations, with each row starting from the same (far left) input for (top): a robust (adversarially trained) ResNet-50 model, (middle): a standard ResNet-50 model and (bottom): a standard VGG16 model.
449
+
450
+ ![](images/37e1850c53f956ac625b53c68fd54f0ab924ee2613bd9f189be11ead6dd9c9dc.jpg)
451
+ Figure 22: Correspondence between image-level patterns and activations learned by standard and robust models on the complete ImageNet dataset. Starting from randomly chosen seed inputs (noise/images), we use PGD to find inputs that (locally) maximally activate a given component of the representation vector (cf. Appendix A.6.1 for details). In the left column we have the original inputs (selected randomly), and in subsequent columns we visualize the result of the optimization (5) for different activations, with each row starting from the same (far left) input for (top): a robust (adversarially trained) ResNet-50 model, (middle): a standard ResNet-50 model and (bottom): a standard VGG16 model.
452
+
453
+ # B.4 ADDITIONAL EXAMPLES OF FEATURE MANIPULATION
454
+
455
+ ![](images/5918f00849584015b8873b7c8db151741061285dbccc54fb93add3568de5de63.jpg)
456
+ Figure 23: Visualization of the results adding various neurons, labelled on the left, to randomly chosen test images. The rows alternate between the original test images, and those same images with an additional feature arising from maximizing the corresponding neuron.
parse/train/rygvFyrKwH/rygvFyrKwH_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rygvFyrKwH/rygvFyrKwH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rygvFyrKwH/rygvFyrKwH_model.json ADDED
The diff for this file is too large to render. See raw diff